代码更新
This commit is contained in:
@@ -146,7 +146,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</crudOperation>
|
</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 type="selection" width="55" />
|
||||||
<el-table-column v-if="false" prop="repair_id" label="设备维修单标识" />
|
<el-table-column v-if="false" prop="repair_id" label="设备维修单标识" />
|
||||||
<el-table-column prop="repair_code" label="维修单号" width="120px" show-overflow-tooltip />
|
<el-table-column prop="repair_code" label="维修单号" width="120px" show-overflow-tooltip />
|
||||||
@@ -365,6 +365,53 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.crud.notify('状态不正确', CRUD.NOTIFICATION_TYPE.INFO)
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
type="success"
|
type="success"
|
||||||
icon="el-icon-position"
|
icon="el-icon-position"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="crud.selections.length !== 1"
|
:disabled="start_flag"
|
||||||
@click="startMaintain"
|
@click="startMaintain"
|
||||||
>
|
>
|
||||||
开始保养
|
开始保养
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
type="success"
|
type="success"
|
||||||
icon="el-icon-position"
|
icon="el-icon-position"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="crud.selections.length !== 1"
|
:disabled="execu_flag"
|
||||||
@click="executeMaintain"
|
@click="executeMaintain"
|
||||||
>
|
>
|
||||||
保养执行
|
保养执行
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
type="success"
|
type="success"
|
||||||
icon="el-icon-position"
|
icon="el-icon-position"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="crud.selections.length !== 1"
|
:disabled="end_flag"
|
||||||
@click="endMaintain"
|
@click="endMaintain"
|
||||||
>
|
>
|
||||||
结束保养
|
结束保养
|
||||||
@@ -117,14 +117,14 @@
|
|||||||
type="success"
|
type="success"
|
||||||
icon="el-icon-position"
|
icon="el-icon-position"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="crud.selections.length !== 1"
|
:disabled="confirm_flag"
|
||||||
@click="confirmMaintain"
|
@click="confirmMaintain"
|
||||||
>
|
>
|
||||||
保养确认
|
保养确认
|
||||||
</el-button>
|
</el-button>
|
||||||
</crudOperation>
|
</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 type="selection" width="55" />
|
||||||
<el-table-column v-if="false" prop="maint_id" label="保养单标识" />
|
<el-table-column v-if="false" prop="maint_id" label="保养单标识" />
|
||||||
<el-table-column prop="maint_code" label="保养单号" width="120px" show-overflow-tooltip />
|
<el-table-column prop="maint_code" label="保养单号" width="120px" show-overflow-tooltip />
|
||||||
@@ -190,6 +190,10 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
start_flag: true,
|
||||||
|
execu_flag: true,
|
||||||
|
end_flag: true,
|
||||||
|
confirm_flag: true,
|
||||||
classes: [],
|
classes: [],
|
||||||
class_idStr: null,
|
class_idStr: null,
|
||||||
materOpt_code: '23',
|
materOpt_code: '23',
|
||||||
@@ -298,6 +302,43 @@ export default {
|
|||||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
mySelectionChange(rows) {
|
||||||
|
this.buttonChange(rows)
|
||||||
|
},
|
||||||
|
// 处理按钮是否显示
|
||||||
|
buttonChange(rows) {
|
||||||
|
if (rows.length !== 0) {
|
||||||
|
this.start_flag = false
|
||||||
|
this.execu_flag = false
|
||||||
|
this.end_flag = false
|
||||||
|
this.confirm_flag = false
|
||||||
|
for (let i = 0; i < rows.length; i++) {
|
||||||
|
if ('01,03,04,05,99'.includes(rows[i].invstatus)) {
|
||||||
|
this.start_flag = true
|
||||||
|
}
|
||||||
|
if ('01,02,04,05,99'.includes(rows[i].invstatus)) {
|
||||||
|
this.execu_flag = true
|
||||||
|
}
|
||||||
|
if ('01,02,04,05,99'.includes(rows[i].invstatus)) {
|
||||||
|
this.end_flag = true
|
||||||
|
}
|
||||||
|
if ('01,02,03,05,99'.includes(rows[i].invstatus)) {
|
||||||
|
this.confirm_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.confirm_flag = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user