| | |
| | | * @version: |
| | | * @Date: 2024-06-19 20:34:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-08-22 10:48:47 |
| | | * @LastEditTime: 2024-09-11 23:22:41 |
| | | */ |
| | | |
| | | import { Tag, Tooltip } from 'ant-design-vue'; |
| | |
| | | import { CustModalParams, FunctionType } from '/@/api/tigerapi/model/systemModel'; |
| | | import { useForm } from '/@/components/Form'; |
| | | import { useMessage } from '/@/hooks/web/useMessage'; |
| | | import { UpdateWoBatchStatus, UpdateWoStatus } from '/@/api/tigerapi/mes/wo'; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | |
| | | const { getLocale } = useLocale(); |
| | | const { createMessage, createErrorModal } = useMessage(); |
| | |
| | | |
| | | function _default() { |
| | | const ActionColumn: BasicColumn = { |
| | | width: 80, |
| | | width: 160, |
| | | title: '操作', |
| | | dataIndex: 'action', |
| | | slots: { customRender: 'action' }, |
| | | fixed: undefined, |
| | | fixed: 'right', |
| | | }; |
| | | |
| | | /** |
| | |
| | | data.map((x) => { |
| | | if (x.name == 'handlePause') { |
| | | x.onClick = handlePause.bind(null, args, params); |
| | | x.color = 'error'; |
| | | x.tooltip = '暂停'; |
| | | } |
| | | if (x.name == 'handleStart') { |
| | |
| | | return new Promise((resolve, reject) => { |
| | | try { |
| | | const wo = param.values['mValues']; |
| | | wo.STATUS = 2; |
| | | wo.STATUS = wo.STATUS == 3 ? wo.STATUS : 2; |
| | | wo.ACT_LINE = param.values['forminfo'].ACT_LINE; |
| | | SaveEntity(wo, true, 'BIZ_MES_WO_BATCH').then((action) => { |
| | | if (action.IsSuccessed) { |
| | |
| | | }); |
| | | return; |
| | | } |
| | | params['record'].STATUS = 4; |
| | | SaveEntity(params['record'], true, 'BIZ_MES_WO_BATCH').then((action) => { |
| | | /* 更新工单批次状态 */ |
| | | UpdateWoBatchStatus({ |
| | | UserId: useUserStore().getUserInfo.userId as string, |
| | | WorkOrder: params['record'].ORDER_NO, |
| | | WoBatch: params['record'].BATCH_NO, |
| | | Status: 4, |
| | | RouteStatus: 0, |
| | | }).then((action) => { |
| | | if (action.IsSuccessed) { |
| | | createMessage.success(t('已暂停')); |
| | | reload(); |
| | |
| | | }); |
| | | return; |
| | | } |
| | | params['record'].STATUS = 3; |
| | | SaveEntity(params['record'], true, 'BIZ_MES_WO_BATCH').then((action) => { |
| | | /* 更新工单批次状态 */ |
| | | UpdateWoBatchStatus({ |
| | | UserId: useUserStore().getUserInfo.userId as string, |
| | | WorkOrder: params['record'].ORDER_NO, |
| | | WoBatch: params['record'].BATCH_NO, |
| | | Status: 3, |
| | | RouteStatus: 0, |
| | | }).then((action) => { |
| | | if (action.IsSuccessed) { |
| | | createMessage.success(t('已取消暂停')); |
| | | createMessage.success(t('暂停已取消')); |
| | | reload(); |
| | | } else { |
| | | createMessage.success(t('取消暂停操作失败')); |
| | |
| | | */ |
| | | function handleRelease(args, params: Recordable) { |
| | | const openCustModal = args[7]; |
| | | if (params['record'].STATUS != 0) { |
| | | createErrorModal({ |
| | | title: t('警告'), |
| | | content: t('工单不是初始状态,不能下发!'), |
| | | getContainer: () => document.body, |
| | | }); |
| | | return; |
| | | } |
| | | openCustModal(true, { |
| | | isUpdate: true, //是否更新操作 |
| | | ctype: 'BIZ_MES_WO_BATCH', //是哪个页面 |
| | |
| | | getContainer: () => document.body, |
| | | }); |
| | | return; |
| | | } |
| | | params['record'].STATUS = 0; |
| | | SaveEntity(params['record'], true, 'BIZ_MES_WO_BATCH').then((action) => { |
| | | } |
| | | /* 更新工单批次状态 */ |
| | | UpdateWoBatchStatus({ |
| | | UserId: useUserStore().getUserInfo.userId as string, |
| | | WorkOrder: params['record'].ORDER_NO, |
| | | WoBatch: params['record'].BATCH_NO, |
| | | Status: 0, //取消下发状态 |
| | | RouteStatus: 0, |
| | | }).then((action) => { |
| | | if (action.IsSuccessed) { |
| | | createMessage.success(t('已取消')); |
| | | createMessage.success(t('下发已取消')); |
| | | reload(); |
| | | } else { |
| | | createMessage.success(t('取消操作失败')); |
| | | createMessage.success(t('取消下发操作失败')); |
| | | } |
| | | }); |
| | | } |