代码更新

This commit is contained in:
2022-09-14 15:41:27 +08:00
parent 32d5d992c7
commit 5ce7e84c4c
2 changed files with 94 additions and 6 deletions

View File

@@ -146,7 +146,7 @@
</el-button>
</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" :data="crud.data" size="mini" style="width: 100%;" @selection-change="mySelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="repair_id" label="设备维修单标识" />
<el-table-column prop="repair_code" label="维修单号" width="120px" show-overflow-tooltip />
@@ -365,6 +365,53 @@ export default {
} else {
this.crud.notify('状态不正确', CRUD.NOTIFICATION_TYPE.INFO)
}
},
mySelectionChange(rows) {
this.buttonChange(rows)
},
// 处理按钮是否显示
buttonChange(rows) {
if (rows.length !== 0) {
this.start_flag = false
this.execu_flag = false
this.end_flag = false
this.open_flag = false
this.confirm_flag = false
this.result_flag = false
for (let i = 0; i < rows.length; i++) {
if ('01,03,04,05,06,07,99'.includes(rows[i].invstatus)) {
this.start_flag = true
}
if ('01,02,06,07,99'.includes(rows[i].invstatus)) {
this.execu_flag = true
}
if ('01,02,04,06,07,99'.includes(rows[i].invstatus)) {
this.end_flag = true
}
if ('01,02,06,07,99'.includes(rows[i].invstatus)) {
this.open_flag = true
}
if ('01,02,03,04,05,07,99'.includes(rows[i].invstatus)) {
this.confirm_flag = true
}
if ('01,02,07,99'.includes(rows[i].invstatus)) {
this.result_flag = true
}
if (rows.length > 1) {
this.handleCurrentChange()
}
}
} else {
this.handleCurrentChange()
}
},
handleCurrentChange() {
this.start_flag = true
this.execu_flag = true
this.end_flag = true
this.open_flag = true
this.confirm_flag = true
this.result_flag = true
}
}
}