Ben Lin
2024-06-27 1e4b207c532a50651a3e9d1e79db221542eb30eb
src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts
@@ -4,12 +4,12 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-27 16:07:06
 * @LastEditTime: 2024-06-27 19:19:49
 */
import { Ref, ref, unref } from 'vue';
import { GetRoutePTree, RouteToCust, RouteToProd } from '/@/api/tigerapi/mes/router';
import { GetEnum, convertToTree, getEntity } from '/@/api/tigerapi/system';
import { GetEnum, SaveEntity, convertToTree, getEntity } from '/@/api/tigerapi/system';
import { useLocale } from '/@/locales/useLocale';
import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
import { useI18n } from '/@/hooks/web/useI18n';
@@ -96,6 +96,30 @@
        {
          field: 'ID',
          label: 'ID',
          component: 'Input',
          show: false,
        },
        {
          field: 'ACT_ID',
          label: 'ACT_ID',
          component: 'Input',
          show: false,
        },
        {
          field: 'ROT_ID',
          label: 'ROT_ID',
          component: 'Input',
          show: false,
        },
        {
          field: 'ACT_CODE',
          label: 'ACT_CODE',
          component: 'Input',
          show: false,
        },
        {
          field: 'NODE_ID',
          label: 'NODE_ID',
          component: 'Input',
          show: false,
        },
@@ -264,7 +288,6 @@
      objParams: Ref<any>;
      selectedNodes: Ref<any[]>;
    }) => {
      params['resetFields']();
      let sqlcmd = ' 1=1 ';
      if (!isNullOrEmpty(params['objParams'].value['CODE'])) {
        sqlcmd += `And PROD_CODE = '${params['objParams'].value['CODE']}'`;
@@ -279,7 +302,16 @@
        sqlcmd: sqlcmd,
        entityName: 'MES_PROD_ACTION',
      }).then((res) => {
        params['resetFields']();
        params['setFieldsValue']({
          ID: res.Data.Items[0].ID,
          ACT_ID: res.Data.Items[0].ACT_ID,
          ROT_ID: res.Data.Items[0].ROT_ID,
          NODE_ID: res.Data.Items[0].NODE_ID,
          IS_ACTIVE: res.Data.Items[0].IS_ACTIVE,
          ITEM_CODE: res.Data.Items[0].ITEM_CODE,
          ACT_CODE: res.Data.Items[0].ACT_CODE,
          REMARK: res.Data.Items[0].REMARK,
          PROD_CODE: params['objParams'].value['CODE'],
          ACT_TYPE: res.Data.Items[0].ACT_TYPE,
          CUST_CODE: params['selectedNodes'].value[0].cust,
@@ -287,6 +319,17 @@
      });
    },
    /**
     * @description: 自定义提交方法
     * @return {*}
     */
    SubmitFunc: (values: Recordable<any>, emit) => {
      SaveEntity(values, true, 'MES_PROD_ACTION').then((action) => {
        if (action.IsSuccessed) {
          emit('success');
        }
      });
    },
    /**
     * @description: 弹出选择框打开方法
     * @param {Fn} openItemModal
     * @return {*}