This commit is contained in:
2022-11-29 16:25:16 +08:00
parent d57dd9d3dc
commit ce325a6e38
9 changed files with 161 additions and 25 deletions

View File

@@ -62,4 +62,12 @@ export function reload() {
})
}
export default { add, edit, del, finish, cancel, queryUnFinish, queryByTaskId, reload }
export function forceCancel(instruction_id) {
return request({
url: 'api/instruction/forceCancel/' + instruction_id,
method: 'post',
data: instruction_id
})
}
export default { add, edit, del, finish, cancel, queryUnFinish, queryByTaskId, reload, forceCancel }

View File

@@ -160,6 +160,7 @@
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">强制取消</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
@@ -290,6 +291,14 @@ export default {
console.log(err.response.data.message)
})
},
forceCancel(index, row) {
crudInstruction.forceCancel(row.instruction_id).then(res => {
this.crud.toQuery()
this.crud.notify('强制取消成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(err => {
console.log(err.response.data.message)
})
},
reload() {
crudInstruction.reload().then(res => {
this.crud.toQuery()
@@ -313,6 +322,9 @@ export default {
case 'b':// 取消
this.cancel(command.index, command.row)
break
case 'c':// 强制取消
this.forceCancel(command.index, command.row)
break
}
}

View File

@@ -313,6 +313,13 @@ export default {
this.form.next_device_code = Array.of(data.form.next_device_code.split('').join(''))
return true
},
[CRUD.HOOK.beforeSubmit](data) {
if (this.crud.status.edit === 1) {
this.form.device_code = data.form.device_code.join('')
this.form.next_device_code = data.form.next_device_code.join('')
}
return true
},
// 改变状态
changeEnabled(data) {
var msg = '停用'