Ben Lin
2024-09-12 a4ee6ba0ca28833cbbb8cf0e675561b10fa4c1af
src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-22 19:37:56
 * @LastEditTime: 2024-09-11 22:41:44
 */
import { Ref, h, ref, render, unref } from 'vue';
@@ -43,7 +43,7 @@
     * @description: 获取新增按钮的行为
     * @return {*}
     */
    CreateAction: (fnName: string) => {
    CreateAction: (type: string) => {
      return {
        action: 'drawer', //drawer(打开左侧抽屉框) | go(跳转到新的页面)
      };
@@ -300,8 +300,7 @@
        try {
          const form = param.values['forminfo'];
          const wo = param.values['mValues'];
          wo.ROUTE_CODE = form.ROUTE_CODE;
          wo.STATUS = 2;
          wo.STATUS = wo.STATUS == 3?wo.STATUS: 2;
          let input: SaveWoBatchInput = {
            Wo: wo,
            WoBatch: {
@@ -320,7 +319,7 @@
              CUST_CODE: wo.CUST_CODE,
              FACTORY: wo.FACTORY,
              WS_CODE: wo.WS_CODE,
              ACT_LINE: form.PLAN_LINE,
              ACT_LINE: form.ACT_LINE,
              STD_WORKER_QTY: wo.STD_WORKER_QTY,
              ACT_WORKER_QTY: wo.ACT_WORKER_QTY,
              RELEASE_TIME: new Date(),
@@ -369,6 +368,7 @@
      keyFieldValues: { ORDER_NO: params['record']['ORDER_NO'] },
      colSlots: params['colSlots'].value,
      SessionName: 'BIZ_MES_WO_BATCH_update',
      ifSave: false,
    };
    // 将对象转换为JSON字符串并保存到sessionStorage
    sessionStorage.removeItem(`${id.SessionName}_params`);
@@ -383,34 +383,6 @@
   * @return {*}
   */
  function handleConfig(args, params: Recordable) {
    // const openCustModal = args[7];
    // // rotSchema.value = getFormSchema('rotinfo');
    // params['routeData'].value = {
    //   nodes: [],
    //   edges: [],
    // };
    // initRoute(params['currlf'], params['record'].ROUTE_CODE, params['routeData'], params['currlf']);
    // getEntity({
    //   sqlcmd: `ROT_CODE = '${params['record'].ROUTE_CODE}'`,
    //   entityName: 'MES_ROUTE',
    //   order: '',
    // }).then((rot) => {
    //   params['selectVals'].value['ROUTE_CODE'] = params['record'].ROUTE_CODE;
    //   params['selectVals'].value['ROT_ID'] =
    //     !isNullOrEmpty(rot.Data) && !isNullOrEmpty(rot.Data.Items) ? rot.Data.Items[0].ID : '';
    //   openCustModal(true, {
    //     isUpdate: true,
    //     ctype: 'BIZ_MES_WO_Config',
    //     title: '工艺配置',
    //     width: '1200px',
    //     formEl: params['useFormData'].value, //如果是多个表单,增加多个插槽
    //     formElName: ['woinfo', 'prodinfo', 'rotinfo'], //表单插槽名称,支持多个表单
    //     RowKey: '',
    //     fnName: 'SaveCofig', //保存方法名
    //     others: params['routeData'].value,
    //     values: { ...params['record'], ...params['selectVals'].value }, //表单记录
    //   });
    // });
    const go = args[5];
    const id = {
      ID: params['record'].ID,
@@ -418,11 +390,14 @@
      CODE: params['record'].ORDER_NO,
      Title: `工单[${params['record'].ORDER_NO}]工艺绑定`,
      colSlots: params['colSlots'].value, /* 表格内的查询表单字段的插槽列表,一般用于弹出选择框按钮 */
      crudColSlots: [] /* 增删改表单字段的插槽列表,一般用于弹出选择框按钮 */,
      crudColSlots: {BAS_PKG_DTL:['BAS_LABEL_TEMP1add'], ItemCode: ['BAS_CODE_RULE1add']} /* 增删改表单字段的插槽列表,一般用于弹出选择框按钮 */,
      OtherTableName: ['BAS_PKG_DTL', 'ItemCode'], /* 自定义显示列表的表名,跟上面增删改的表名一致,有多个就放列表中 */
      dense: true,
      pageTitle: `工单工艺绑定`,
      pageContent: `这里是管理工单的工艺绑定,一个工单可以绑定多个工艺路线`,
      pageContent: `这里是管理工单的工艺绑定,一个工单可以绑定一个工艺路线,并可以保存为客户专用的工艺路线`,
      SessionName: 'WoRouteBinding_update',
      ifSave: false,
      rotType: 'Wo'
    };
    // 将对象转换为JSON字符串并保存到sessionStorage
    sessionStorage.removeItem(`${id.SessionName}_params`);
@@ -451,6 +426,7 @@
    });
  }
  /* 下发界面中的表单列表 */
  const woformSchema: FormSchema[] = [
    {
      field: 'PLAN_QTY',
@@ -474,8 +450,8 @@
      },
    },
    {
      label: '计划产线',
      field: 'PLAN_LINE',
      label: '实际产线',
      field: 'ACT_LINE',
      component: 'ApiSelect',
      required: true,
      colProps: {
@@ -489,35 +465,35 @@
        valueField: 'LINE_CODE',
      },
    },
    {
      label: '工艺路线',
      field: 'ROUTE_CODE',
      component: 'Input',
      required: true,
      colProps: {
        span: 22,
      },
    },
    {
      field: 'add',
      component: 'Input',
      label: '1',
      colSlot: 'add',
      defaultValue: 'MES_ROUTE',
      colProps: {
        span: 1,
      },
    },
    {
      field: 'set',
      component: 'Input',
      label: '1',
      colSlot: 'set',
      defaultValue: 'MES_ROUTE',
      colProps: {
        span: 1,
      },
    },
    // {
    //   label: '工艺路线',
    //   field: 'ROUTE_CODE',
    //   component: 'Input',
    //   required: true,
    //   colProps: {
    //     span: 22,
    //   },
    // },
    // {
    //   field: 'add',
    //   component: 'Input',
    //   label: '1',
    //   colSlot: 'add',
    //   defaultValue: 'MES_ROUTE',
    //   colProps: {
    //     span: 1,
    //   },
    // },
    // {
    //   field: 'set',
    //   component: 'Input',
    //   label: '1',
    //   colSlot: 'set',
    //   defaultValue: 'MES_ROUTE',
    //   colProps: {
    //     span: 1,
    //   },
    // },
  ];
  const woCfgformSchema: FormSchema[] = [