This commit is contained in:
zds
2022-10-10 19:35:55 +08:00
parent 7e97657f16
commit 900b4a9e1e
6 changed files with 116 additions and 92 deletions

View File

@@ -68,7 +68,6 @@
type="success"
icon="el-icon-position"
size="mini"
:disabled="crud.selections.length !== 1"
@click="repair"
>
维修
@@ -79,7 +78,6 @@
type="success"
icon="el-icon-position"
size="mini"
:disabled="crud.selections.length !== 1"
@click="notRepair"
>
不维修
@@ -155,6 +153,7 @@ export default {
data() {
return {
classes: [],
checkrows: [],
class_idStr: null,
materOpt_code: '23',
statusList: [
@@ -240,23 +239,23 @@ export default {
}
},
repair() {
const _selectData = this.$refs.table.selection
const data = _selectData[0]
if (data.status !== '01') {
return this.crud.notify('只能对生成状态的单据进行维修', CRUD.NOTIFICATION_TYPE.INFO)
this.checkrows = this.$refs.table.selection
if(this.checkrows.length === 0 ){
this.crud.notify('请勾选需要操作的记录!')
return false
}
crudDevicerepairrequest.repair(data).then(res => {
crudDevicerepairrequest.repair({ rows: this.checkrows}).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
},
notRepair() {
const _selectData = this.$refs.table.selection
const data = _selectData[0]
if (data.status !== '01') {
return this.crud.notify('只能对生成状态的单据进行操作', CRUD.NOTIFICATION_TYPE.INFO)
this.checkrows = this.$refs.table.selection
if(this.checkrows.length === 0 ){
this.crud.notify('请勾选需要操作的记录!')
return false
}
crudDevicerepairrequest.notRepair(data).then(res => {
crudDevicerepairrequest.notRepair({ rows: this.checkrows}).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})