This commit is contained in:
zds
2022-10-16 14:01:48 +08:00
parent 938a3c62d6
commit 4946b89034
5 changed files with 65 additions and 25 deletions

View File

@@ -148,7 +148,30 @@
</crudOperation>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table ref="table" v-loading="crud.loading" :max-height="590" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column
min-width="115"
label="重排调整"
align="center"
fixed="right"
>
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
icon="el-icon-top"
@click="moveUp(scope.$index, scope.row)"
>
</el-button>
<el-button
type="primary"
size="mini"
icon="el-icon-bottom"
@click="moveDown(scope.$index, scope.row)"
>
</el-button>
</template>
</el-table-column>
<el-table-column
v-permission="['admin','workorder:del','workorder:edit']"
min-width="125"
@@ -165,7 +188,7 @@
/>
</template>
</el-table-column>
<el-table-column :selectable="checkboxT" type="selection" min-width="35" />
<el-table-column fixed="left" :selectable="checkboxT" type="selection" min-width="35" />
<el-table-column prop="plan_code" label="日计划编码" min-width="105" />
<el-table-column :formatter="seriesFormat" min-width="70" prop="product_series_id" label="系列产线" />
<el-table-column prop="device_name" label="关键设备" min-width="80" />
@@ -186,8 +209,6 @@
<el-table-column prop="create_name" label="创建人" min-width="60" />
<el-table-column prop="remark" label="备注" min-width="200" />
</el-table>
<!--分页组件-->
<pagination />
</div>
<AddDialog @AddChanged="querytable" />
<StructIvt4 ref="child" :dialog-show.sync="structshow" :rowmst="form" @StructIvtClosed="querytable" />
@@ -223,7 +244,7 @@ export default {
url: 'api/dailyplan',
idField: 'dailyplan_id',
sort: '',
query: { nowstart_date: new Date(),device_id: '', status: '01' },
query: { nowstart_date: new Date(), device_id: '', status: '01' },
crudMethod: { ...dailyplan },
optShow: {
add: true,
@@ -320,14 +341,40 @@ export default {
}
}
},
moveUp(index, item) {
if (index > 0) {
const upDate = this.crud.data[index - 1]
this.crud.data.splice(index - 1, 1)
this.crud.data.splice(index, 0, upDate)
} else {
this.$message.error('已经是第一条,不可上移')
}
},
moveDown(index, item) {
if ((index + 1) === this.crud.data.length) {
this.$message.error('已经是最后一条,不可下移')
} else {
console.log(index)
const downDate = this.crud.data[index + 1]
this.crud.data.splice(index + 1, 1)
this.crud.data.splice(index, 0, downDate)
}
},
save() {
if (this.crud.query.device_id === '' || this.crud.query.device_id === undefined) {
this.crud.notify('请先选择关键设备!')
return false
}
this.form.device_id = this.crud.query.device_id
this.$refs.child.getMsg(this.crud.query.device_id, this.crud.query.nowstart_date, this.crud.query.checked)
this.structshow = true
this.checkrows = this.crud.data
if (this.checkrows.length === 0) {
this.crud.notify('当前页面无可重排数据!')
return false
}
dailyplan.submit2({ query: this.crud.query, rows: this.checkrows }).then(res => {
this.form.device_id = this.crud.query.device_id
this.$refs.child.getMsg(this.crud.query.device_id, this.crud.query.nowstart_date, this.crud.query.checked)
this.structshow = true
})
},
downdtl() {
crud.downloadLoading = true