工单完成按钮添加

This commit is contained in:
loujf
2022-08-01 21:48:28 +08:00
parent 49cd752a30
commit c6ada8d8c8
12 changed files with 186 additions and 84 deletions

View File

@@ -62,6 +62,18 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-permission="['admin','produceshiftorder:edit','produceshiftorder:del']" fixed="left" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-dropdown trigger="click" @command="handleCommand">
<span class="el-dropdown-link">
<i class="el-icon-menu" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
<el-table-column prop="order_code" label="工单编码" />
<el-table-column prop="device_code" label="设备编码" />
<el-table-column prop="order_status_name" label="工单状态" />
@@ -98,6 +110,7 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import crudProduceshiftorder from '@/api/acs/produceshiftorder/produceshiftorder'
import crudTask from "@/api/acs/task/task";
const defaultForm = { order_id: null, order_code: null, is_unbundling: null, order_status: null, qty: null, product_code: null, material_code: null, material_name: null, material_uuid: null, cust_code: null, cust_name: null, model: null, molten_pool: null, weight: null, create_by: null, create_time: null, update_by: null, update_time: null, is_deleted: null }
export default {
@@ -137,6 +150,29 @@ export default {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
return true
},
beforeHandleCommand(index, row, command) {
return {
'index': index,
'row': row,
'command': command
}
},
finish(index, row) {
debugger
crudProduceshiftorder.finish(row.order_id).then(res => {
this.crud.toQuery()
this.crud.notify('完成成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(err => {
console.log(err.response.data.message)
})
},
handleCommand(command) {
switch (command.command) {
case 'a':// 完成
this.finish(command.index, command.row)
break
}
}
}
}