| | |
| | | * @version: |
| | | * @Date: 2024-06-19 20:34:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-08-22 10:26:40 |
| | | * @LastEditTime: 2024-08-22 11:14:02 |
| | | */ |
| | | |
| | | import { Tag, Tooltip } from 'ant-design-vue'; |
| | |
| | | data.map((x) => { |
| | | if (x.name == 'handlePause') { |
| | | x.onClick = handlePause.bind(null, args, params); |
| | | x.color = 'error' |
| | | x.tooltip = '暂停'; |
| | | } |
| | | if (x.name == 'handleStart') { |
| | | x.onClick = handleStart.bind(null, args, params); |
| | | x.tooltip = '取消暂停'; |
| | | } |
| | | if (x.name == 'handleRelease') { |
| | | x.onClick = handleRelease.bind(null, args, params); |
| | |
| | | */ |
| | | function handlePause(args, params: Recordable) { |
| | | const reload = args[1]; |
| | | if (params['record'].STATUS == 0) { |
| | | if (params['record'].STATUS != 3) { |
| | | createErrorModal({ |
| | | title: t('警告'), |
| | | content: t('工单是初始化状态,不能暂停!'), |
| | | getContainer: () => document.body, |
| | | }); |
| | | return; |
| | | } |
| | | if (params['record'].STATUS == 5) { |
| | | createErrorModal({ |
| | | title: t('警告'), |
| | | content: t('工单是完成状态,不能暂停!'), |
| | | content: t('工单不是生产中状态,不能暂停!'), |
| | | getContainer: () => document.body, |
| | | }); |
| | | return; |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description: 工单取消暂停方法 |
| | | * @param {*} args |
| | | * @param {Recordable} params |
| | | * @return {*} |
| | | */ |
| | | function handleStart(args, params: Recordable) { |
| | | const reload = args[1]; |
| | | if (params['record'].STATUS != 4) { |
| | | createErrorModal({ |
| | | title: t('警告'), |
| | | content: t('工单不是暂停状态,不能取消暂停!'), |
| | | getContainer: () => document.body, |
| | | }); |
| | | return; |
| | | } |
| | | params['record'].STATUS = 3; |
| | | SaveEntity(params['record'], true, 'BIZ_MES_WO_BATCH').then((action) => { |
| | | if (action.IsSuccessed) { |
| | | createMessage.success(t('已取消暂停')); |
| | | reload(); |
| | | } else { |
| | | createMessage.success(t('取消暂停操作失败')); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * @description: 工单下发方法 |
| | | * @param {*} args |
| | | * @param {Recordable} params |