Ben Lin
2024-09-11 08f1b081e006f0f3b83bcbdf47f4ef494e18450b
src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO_BATCH.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-08-22 11:14:02
 * @LastEditTime: 2024-08-28 08:53:22
 */
import { Tag, Tooltip } from 'ant-design-vue';
@@ -17,6 +17,8 @@
import { CustModalParams, FunctionType } from '/@/api/tigerapi/model/systemModel';
import { useForm } from '/@/components/Form';
import { useMessage } from '/@/hooks/web/useMessage';
import { UpdateWoStatus } from '/@/api/tigerapi/mes/wo';
import { useUserStore } from '/@/store/modules/user';
const { getLocale } = useLocale();
const { createMessage, createErrorModal } = useMessage();
@@ -24,11 +26,11 @@
function _default() {
  const ActionColumn: BasicColumn = {
    width: 80,
    width: 160,
    title: '操作',
    dataIndex: 'action',
    slots: { customRender: 'action' },
    fixed: undefined,
    fixed: 'right',
  };
  /**
@@ -376,14 +378,20 @@
      });
      return;
    }
    params['record'].STATUS = 4;
    SaveEntity(params['record'], true, 'BIZ_MES_WO_BATCH').then((action) => {
      if (action.IsSuccessed) {
        createMessage.success(t('已暂停'));
        reload();
      } else {
        createMessage.success(t('暂停操作失败'));
      }
    // params['record'].STATUS = 4;
    // SaveEntity(params['record'], true, 'BIZ_MES_WO_BATCH').then((action) => {
    //   if (action.IsSuccessed) {
    //     createMessage.success(t('已暂停'));
    //     reload();
    //   } else {
    //     createMessage.success(t('暂停操作失败'));
    //   }
    // });
    UpdateWoStatus({
      UserId: useUserStore().getUserInfo.userId as string,
      WorkOrder: params['record'].ORDER_NO,
      Status: -1,
      RouteStatus: 0,
    });
  }
@@ -422,6 +430,14 @@
   */
  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', //是哪个页面