Ben Lin
2024-07-22 323e576c64129723df20fd18effb20d96d8d18b3
工单更新
已修改8个文件
已添加1个文件
1604 ■■■■■ 文件已修改
src/views/components/CustModal.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/mes/eng/route/index.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/detail/detail.vue 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/detail/index.vue 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO_BATCH.ts 310 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts 1015 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/mainTable.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/CustModal.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-06-05 15:46:07
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-21 20:29:30
 * @LastEditTime: 2024-07-22 00:51:10
-->
<template>
  <BasicModal
@@ -12,6 +12,7 @@
    @register="registerModal"
    :title="title"
    @ok="handleSuccess"
    @cancel="handleCancel"
    :width="width"
  >
    <a-layout>
@@ -45,7 +46,7 @@
  const ALayout = Layout;
  const ACard = Card;
  const ALayoutContent = LayoutContent;
  const emit = defineEmits(['success', 'register', 'modalInner']);
  const emit = defineEmits(['success', 'register', 'modalInner', 'cancel']);
  const isUpdate = ref(true);
  const cType = ref('');
  const title = ref('');
@@ -178,4 +179,12 @@
      setModalProps({ confirmLoading: false });
    }
  }
  /**
   * @description: å–消按钮触发取消事件
   * @return {*}
   */
  function handleCancel() {
    emit('cancel');
  }
</script>
src/views/tigerprojects/mes/eng/route/index.vue
@@ -187,7 +187,7 @@
        ROT_VER: currRoute.value.ROT_VER,
        IS_ACTIVE: currRoute.value.IS_ACTIVE,
        REMARK: currRoute.value.REMARK,
        AUTH_ORG: '',
        AUTH_ORG: useUserStore().getUserInfo.orgCode,
        AUTH_PROD: '',
        AUTH_WH: '',
      },
@@ -223,7 +223,7 @@
              GPH_PROP: JSON.stringify(n.properties),
              GPH_TEXT: n.text.value,
              REMARK: a.REMARK,
              AUTH_ORG: '',
              AUTH_ORG: useUserStore().getUserInfo.orgCode,
              AUTH_PROD: '',
              AUTH_WH: '',
              OPTION_1: '',
@@ -280,7 +280,7 @@
              IS_CALC_FPY: nd.IS_CALC_FPY,
              CAN_SKIP: nd.CAN_SKIP,
              REMARK: nd.REMARK,
              AUTH_ORG: '',
              AUTH_ORG: useUserStore().getUserInfo.orgCode,
              AUTH_PROD: '',
              AUTH_WH: '',
              IS_FIRST_NODE: 'N',
@@ -330,7 +330,7 @@
        GPH_PROP: JSON.stringify(e.properties),
        GPH_POTS: JSON.stringify(e.pointsList),
        REMARK: '',
        AUTH_ORG: '',
        AUTH_ORG: useUserStore().getUserInfo.orgCode,
        AUTH_PROD: '',
        AUTH_WH: '',
        EDGE_TYPE: 0,
@@ -439,7 +439,7 @@
        IS_CALC_FPY: 'N',
        CAN_SKIP: 'N',
        REMARK: '',
        AUTH_ORG: '',
        AUTH_ORG: useUserStore().getUserInfo.orgCode,
        AUTH_PROD: '',
        AUTH_WH: '',
        IS_FIRST_NODE: '',
@@ -472,7 +472,7 @@
          UPDATE_TIME: currRoute.value.UPDATE_TIME,
          UPDATE_USER: useUserStore().getUserInfo.userId as string,
          GHOST_ROW: false,
          AUTH_ORG: '',
          AUTH_ORG: useUserStore().getUserInfo.orgCode,
          AUTH_PROD: '',
          AUTH_WH: '',
          ACT_NAME: `${selectnode.value.text.value}_0`,
@@ -509,9 +509,9 @@
        UPDATE_TIME: currRoute.value.UPDATE_TIME,
        UPDATE_USER: useUserStore().getUserInfo.userId as string,
        GHOST_ROW: false,
        AUTH_ORG: '',
        AUTH_PROD: '',
        AUTH_WH: '',
        AUTH_ORG: _act.AUTH_ORG,
        AUTH_PROD: _act.AUTH_PROD,
        AUTH_WH: _act.AUTH_WH,
        ACT_NAME: _act.ACT_NAME,
        ACT_CODE: _act.ACT_CODE,
        ROT_ID: currRoute.value.ID,
@@ -549,6 +549,9 @@
        UPDATE_TIME: currRoute.value.UPDATE_TIME,
        UPDATE_USER: useUserStore().getUserInfo.userId as string,
        GHOST_ROW: false,
        AUTH_ORG: _node.AUTH_ORG,
        AUTH_PROD: _node.AUTH_PROD,
        AUTH_WH: _node.AUTH_WH,
        NODE_NAME: _node.NODE_NAME ?? '',
        ROT_ID: currRoute.value.ID,
        SEGMENT: _node.SEGMENT,
src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-06-20 12:13:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-03 20:31:07
 * @LastEditTime: 2024-07-22 03:45:38
-->
<template>
  <Card :title="GetTitle(props.configType)['navTitle']">
@@ -54,6 +54,7 @@
  import { useTabs } from '/@/hooks/web/useTabs';
  import { EntityCustFunctionType } from '/@/api/tigerapi/model/basModel';
  import { useModal } from '/@/components/Modal';
import { CustModalParams } from '/@/api/tigerapi/model/systemModel';
  const ACard = Card;
  const objParams = inject('objParams') as Ref<any>;
@@ -72,7 +73,7 @@
      GetBaseCards(type: string | undefined) {},
      GetSelectSuccess(d, u, ...args) {},
      GenerateHtml(ype: string | null) {},
      CustFunc(type: string | undefined, ...args) {},
      CustFunc(param: CustModalParams) {},
    } as EntityCustFunctionType,
  ]);
  /* åŠ¨æ€import实体名.ts的自定义方法 */
src/views/tigerprojects/system/lowcode/detail/detail.vue
@@ -4,9 +4,9 @@
      <template #toolbar>
        <a-button
          type="primary"
          v-for="item in buttons.filter((m) => m['BUTTON_TYPE'] == 0)"
          @click="handleCreate(item['DO_METHOD'])"
          :preIcon="item['ICON_URL']"
          v-for="item in buttons.filter((m) => m['BUTTON_TYPE'] == 0)"
          :key="item"
        >
          {{ item['FUNC_NAME'] }}
@@ -30,16 +30,47 @@
        />
      </template>
    </BasicTable>
    <Suspense>
      <CustModal
        @register="registerCust"
        @success="custSuccess"
        @cancel="custCancel"
        :type="cType"
        :entityName="entityName"
        @modalInner="getdtlSlots"
      >
        <!-- ç”¨æ’槽自定义多表单 -->
        <template #[item.name] v-for="item in dtlSlots" :key="item.name">
          <BasicForm @register="useFormData[item.name][0]" v-if="useFormData[item.name]">
            <!-- ç”¨æ’槽自定义弹出选择框 -->
            <template #[name]="{ field }" v-for="name in item.slots" :key="name">
              <a-button
                class="mt-1 ml-1"
                size="small"
                @click="handleCustClick(field)"
                :preIcon="item.preIcons[name]"
              />
              <GeneralModal
                @register="useModalData[name][0]"
                @success="(d, u) => handleEntSuccess(d, u, item.name)"
              />
            </template>
          </BasicForm>
          <!-- è‡ªå®šä¹‰å†…容 -->
        </template>
      </CustModal>
    </Suspense>
    <normalDrawer @register="registerDrawer" @success="handleSuccess" />
  </div>
</template>
<script lang="ts" setup>
  import { Ref, inject, onMounted, ref } from 'vue';
  import { BasicTable, useTable, TableAction } from '/@/components/Table';
  import { useForm } from '/@/components/Form/index';
  import { BasicForm, useForm } from '/@/components/Form/index';
  import { useDrawer } from '/@/components/Drawer';
  import GeneralModal from '/@/views/components/GeneralModal.vue';
  import normalDrawer from '../normalDrawer.vue';
  import CustModal from '/@/views/components/CustModal.vue';
  import { isFunction, isNullOrUnDef } from '/@/utils/is';
  import { useModal } from '/@/components/Modal';
  import { useGo } from '/@/hooks/web/usePage';
@@ -62,11 +93,11 @@
  const go = useGo();
  const [registerDrawer, { openDrawer }] = useDrawer();
  const [registerItemAdd, { openModal: openItemModal }] = useModal();
  const [registerCust, { openModal: openCustModal }] = useModal();
  const cType = ref('');
  const selectVals = ref({});
  const colSlots = ref<any>(objParams['colSlots']); //按钮插槽
  const dtlSlots = ref([] as any[]);
  const useModalData = ref({}); //表单中插槽渲染按钮打开模态框useModal方法
  const useFormData = ref({});
  const custImport = ref<any[]>([]);
  const EntityCustFunction = ref([
    {
@@ -94,6 +125,8 @@
      KeyFieldValues,
      GetSelectSuccess,
      OpenSelectItem,
      GetUseForm,
      GetUseModals,
    },
  ] = isNullOrUnDef(custImport.value['default'])
    ? EntityCustFunction.value
@@ -103,6 +136,11 @@
    KeyFieldValues && isFunction(KeyFieldValues)
      ? KeyFieldValues(objParams['CODE'], objParams['ID'])
      : [];
  const useformdata = GetUseForm && isFunction(GetUseForm) ? GetUseForm() : {};
  const useFormData = ref<any>(useformdata);
  /* è¡¨å•中插槽渲染按钮打开模态框useModal方法 */
  const modals = GetUseModals && isFunction(GetUseModals) ? GetUseModals() : { useModalData: {} };
  const useModalData = ref(modals['useModalData']);
  const [registerTable, { getForm, reload, setProps }] = useTable({
    title: `${objParams['firstTitle']}列表`,
    api: getListByPage,
@@ -146,6 +184,8 @@
      useFormData,
      crudColSlots: colSlots.value,
      data,
      selectVals,
      colSlots,
    };
    const actionItem = GenerateActionButton(params, buttons, openDrawer, reload);
    if (isNullOrUnDef(custImport.value['default'])) {
@@ -161,6 +201,7 @@
      useModal,
      go,
      setProps,
      openCustModal,
    );
  }
@@ -241,4 +282,69 @@
  function handleSelectItem(item) {
    OpenSelectItem(openItemModal);
  }
  /**
   * @description: å¼¹å‡ºæ¡†ç¡®å®šè¿”回
   * @param {*} d
   * @return {*}
   */
  function custSuccess(d) {
    reload();
  }
  /**
   * @description: å¼¹å‡ºæ¡†å–消返回
   * @param {*} reload
   * @return {*}
   */
  function custCancel() {
    reload();
  }
  /**
   * @description: å„表单内弹出选择框选择成功后方法
   * @param {*} d
   * @param {*} u
   * @param {*} item
   * @return {*}
   */
  function handleEntSuccess(d, u, item) {
    /* åŠ¨æ€import实体名.ts的自定义方法 */
    try {
      var values = GetSelectSuccess(d, u);
      selectVals.value = values; //保存弹出框选择的结果
      let _val = {};
      d.returnFieldName.map((x) => {
        _val[x] = values[x];
      });
      useFormData.value[item][1].setFieldsValue(_val);
    } catch (e) {}
  }
  /**
   * @description: æ‰“开表单中的模态框
   * @param {*} item
   * @return {*}
   */
  function handleCustClick(item) {
    OpenSelectItem(
      useModalData.value[item][1].openModal, //带入openModal方法
      item,
      null,
      selectVals,
    );
  }
  /**
   * @description: èŽ·å–å¤šè¡¨å•æ’æ§½åˆ—è¡¨
   * @param {*} d
   * @return {*}
   */
  function getdtlSlots(d, callback) {
    dtlSlots.value = d;
    callback();
    // setTimeout(() => {
    //   callback();
    // }, 100);
  }
</script>
src/views/tigerprojects/system/lowcode/detail/index.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-05-30 13:28:20
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-21 18:02:52
 * @LastEditTime: 2024-07-22 01:55:07
-->
<template>
  <PageWrapper :title="pageTitle" :content="contentStr" contentBackground @back="goBack">
@@ -24,35 +24,6 @@
        <Suspense></Suspense>
      </div>
    </div>
    <Suspense>
      <CustModal
        @register="registerCust"
        @success="custSuccess"
        :type="cType"
        :detailSlots="dtlSlots"
        :entityName="entityName"
      >
        <!-- ç”¨æ’槽自定义多表单 -->
        <template #[item.name] v-for="item in dtlSlots" :key="item.name">
          <BasicForm @register="useFormData[item.name][0]" v-if="useFormData[item.name]">
            <!-- ç”¨æ’槽自定义弹出选择框 -->
            <template #[name]="{ field }" v-for="name in item.slots" :key="name">
              <a-button
                class="mt-1 ml-1"
                size="small"
                @click="handleCustClick(field)"
                :preIcon="item.preIcons[name]"
              />
              <GeneralModal
                @register="useModalData[name][0]"
                @success="(d, u) => handleEntSuccess(d, u, item.name)"
              />
            </template>
          </BasicForm>
          <!-- è‡ªå®šä¹‰å†…容 -->
        </template>
      </CustModal>
    </Suspense>
  </PageWrapper>
</template>
@@ -67,11 +38,7 @@
  import detail from './detail.vue';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { useMessage } from '/@/hooks/web/useMessage';
  import GeneralModal from '/@/views/components/GeneralModal.vue';
  import CustModal from '/@/views/components/CustModal.vue';
  import { BasicForm } from '/@/components/Form/index';
  import { useGlobSetting } from '/@/hooks/setting';
  import { useModal } from '/@/components/Modal';
  const { t } = useI18n();
@@ -93,18 +60,10 @@
  const entityName = ref(routeParams.value.Name);
  const detailName = ref(objParams.value.detailName);
  const globSetting = useGlobSetting();
  const formSchemas = ref({}); //弹出框多表单结构
  const useModalData = ref({}); //表单中插槽渲染按钮打开模态框useModal方法
  const useFormData = ref({});
  const secondColSlots = ref<any>(objParams.value.secondColSlots); //按钮插槽
  const crudColSlots = ref<any>(objParams.value.colSlots);
  const cType = ref('');
  const dtlSlots = ref([] as any[]);
  const selectVals = ref({});
  const keyFieldValues = ref<any>(null);
  provide<Ref<any>>('objParams', objParams.value);
  provide<Ref<any>>('keyFieldValues', keyFieldValues);
  const [registerCust] = useModal();
  var currentKey = ref('detailfirst');
  const { setTitle } = useTabs();
@@ -147,52 +106,5 @@
        };
      };
    }
  }
  /**
   * @description: è‡ªå®šä¹‰å¼¹å‡ºæ¡†ç¡®å®šè¿”回
   * @param {*} d
   * @return {*}
   */
  function custSuccess(d) {
    // reload();
  }
  /**
   * @description: å„表单内弹出选择框选择成功后方法
   * @param {*} d
   * @param {*} u
   * @param {*} item
   * @return {*}
   */
  function handleEntSuccess(d, u, item) {
    /* åŠ¨æ€import实体名.ts的自定义方法 */
    try {
      import(`../entityts/${cType.value}.ts`).then((m) => {
        const [{ GetSelectSuccess }] = m.default();
        var values = GetSelectSuccess(d, u);
        selectVals.value = values; //保存弹出框选择的结果
        let _val = {};
        d.returnFieldName.map((x) => {
          _val[x] = values[x];
        });
        useFormData.value[item][1].setFieldsValue(_val);
      });
    } catch (e) {}
  }
  /**
   * @description: æ‰“开自定义模态框
   * @param {*} item
   * @return {*}
   */
  function handleCustClick(item) {
    OpenCustModal(
      useModalData.value[item][1].openModal, //带入openModal方法
      cType.value,
      item,
      [],
      // selectVals.value['ROUTE_CODE'],
    ); //[openRvModal], selectVals.value['ID']这是自定义参数,按实际需求
  }
</script>
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-21 20:55:33
 * @LastEditTime: 2024-07-22 02:58:01
 */
import { Ref, h, ref, render, unref } from 'vue';
@@ -40,7 +40,7 @@
  const isPrint = (type: number) => type === 5;
  const isPackage = (type: number) => type === 6;
  const ActionColumn: BasicColumn = {
    width: 220,
    width: 180,
    title: '操作',
    dataIndex: 'action',
    slots: { customRender: 'action' },
@@ -256,9 +256,22 @@
          });
          break;
        case 'set':
        case 'setRot':
          openRvModal(true, { rotId: selectVals.value['ROUTE_CODE'], slotName: slotName });
          break;
        case 'setRot':
          const id = {
            ID: params['record'].ID,
            Name: 'WoRouteBinding',
            CODE: params['record'].ITEM_CODE,
            Title: `工单[${params['record'].ITEM_CODE}]工艺绑定`,
            colSlots: [] /* è¡¨æ ¼å†…的查询表单字段的插槽列表,一般用于弹出选择框按钮 */,
            crudColSlots: [] /* å¢žåˆ æ”¹è¡¨å•字段的插槽列表,一般用于弹出选择框按钮 */,
            dense: true,
            pageTitle: `工单工艺绑定`,
            pageContent: `这里是管理工单的工艺绑定,一个工单可以绑定多个工艺路线`,
          };
          go(`/WoRouteBinding/CP/${encodeURI(JSON.stringify(id))}`);
          break;
      }
    },
  };
src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO_BATCH.ts
@@ -4,18 +4,22 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-20 22:29:35
 * @LastEditTime: 2024-07-22 02:29:18
 */
import { Tag, Tooltip } from 'ant-design-vue';
import { ActionItem, BasicColumn } from '/@/components/Table';
import { ActionItem, BasicColumn, FormSchema } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';
import { h, unref } from 'vue';
import { GetEnum } from '/@/api/tigerapi/system';
import { getEntity, GetEnum, SaveEntity } from '/@/api/tigerapi/system';
import { useLocale } from '/@/locales/useLocale';
import { useModal } from '/@/components/Modal';
import { CustModalParams, FunctionType } from '/@/api/tigerapi/model/systemModel';
import { useForm } from '/@/components/Form';
import { useMessage } from '/@/hooks/web/useMessage';
const { getLocale } = useLocale();
const { createMessage, createErrorModal } = useMessage();
const { t } = useI18n();
function _default() {
@@ -46,6 +50,16 @@
     * @return {*}
     */
    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
      data.map((x) => {
        if (x.name == 'handlePause') {
          x.onClick = handlePause.bind(null, args, params);
          x.tooltip = '暂停';
        }
        if (x.name == 'handleRelease') {
          x.onClick = handleRelease.bind(null, args, params);
          x.tooltip = '下发';
        }
      });
      return data;
    },
    /**
@@ -173,10 +187,296 @@
      return { ORDER_NO: val };
    },
    GetUseForm: () => {
      return {};
      return {
        forminfo: useForm({
          labelWidth: 120,
          schemas: woformSchema,
          actionColOptions: {
            span: 24,
          },
          showActionButtonGroup: false,
        }),
      };
    },
    /**
     * @description: è‡ªå®šä¹‰æ–¹æ³•
     * @param {string} type
     * @param {array} args
     * @return {*}
     */
    CustFunc: (param: CustModalParams) => {
      switch (param.cType) {
        case 'BIZ_MES_WO_BATCH':
          return getWoFns[param.FnName](param) as Promise<any>;
          break;
        default:
          return new Promise((resolve, reject) => {
            try {
              (e) => {};
              resolve(true);
            } catch {
              reject(false);
            } finally {
              // args[0][0]({ confirmLoading: false });
            }
          });
        // break;
      }
    },
    /**
     * @description: èŽ·å–å¤šè¡¨å•æ’æ§½åˆ—è¡¨
     * @return {*}
     */
    GetDtlSlots: (type: string) => {
      let result = [] as any[];
      switch (type) {
        case 'BIZ_MES_WO_BATCH':
          result = [
            {
              name: 'forminfo',
              slots: ['add', 'set'],
              preIcons: { add: 'search|svg', set: 'config|svg' }, //如果是多个表单,增加多个插槽。slots是弹出框按钮的插槽,preIcons是插槽对应的按钮图标
              title: '下发配置',
            },
          ];
          break;
      }
      return result;
    },
    /**
     * @description: èŽ·å–æ¨¡æ€æ¡†åº”ç”¨åˆ—è¡¨
     * @return {*}
     */
    GetUseModals: () => {
      return {
        useModalData: {
          add: useModal(),
          set: useModal(),
          addRot: useModal(),
          setRot: useModal(),
        },
      };
    },
    /**
     * @description: å¼¹å‡ºé€‰æ‹©æ¡†é€‰æ‹©æˆåŠŸè¿”å›žæ–¹æ³•
     * @param {*} d
     * @param {*} u
     * @return {*}
     */
    GetSelectSuccess: (d, u) => {
      return {
        ROUTE_CODE: d.values['val'],
        // ID: d.values['id'],
        ROT_ID: d.values['id'],
      };
    },
    /**
     * @description: æ‰“开弹出选择框
     * @param {Fn} openItemModal
     * @param {array} args
     * @return {*}
     */
    OpenSelectItem: (openItemModal: Fn, ...args) => {
      const slotName = args[0];
      switch (slotName) {
        case 'addRot':
        case 'add':
          openItemModal(true, {
            title: '工艺路线列表',
            schemas: [
              {
                field: 'ROT_CODE',
                component: 'Input',
                label: '工艺路线编码',
                colProps: {
                  span: 12,
                },
              },
            ],
            ItemColumns: [
              {
                title: t('工艺路线编码'),
                dataIndex: 'ROT_CODE',
                resizable: true,
                sorter: true,
                width: 200,
              },
              {
                title: t('工艺路线名称'),
                dataIndex: 'ROT_NAME',
                resizable: true,
                sorter: true,
                width: 180,
              },
            ],
            tableName: 'MES_ROUTE',
            rowKey: 'ROT_CODE',
            returnFieldName: ['ROUTE_CODE', 'ROT_ID'], //返回值要赋值的字段名称
            searchInfo: { TABLE_NAME: 'MES_ROUTE' },
          });
          break;
      }
    },
  };
  /* ä»¥ä¸‹æ˜¯å†…部方法,不export,供上面的方法调用 */
  /**
   * @description: è‡ªå®šä¹‰æ–¹æ³•
   * @return {*}
   */
  const getWoFns: Record<string, FunctionType> = {
    /**
     * @description: å·¥å•下发保存方法
     * @param {CustModalParams} param
     * @return {*}
     */
    SaveWoBatch: (param: CustModalParams) => {
      return new Promise((resolve, reject) => {
        try {
          const wo = param.values['mValues'];
          wo.STATUS = 2;
          wo.ACT_LINE = param.values['forminfo'].ACT_LINE;
          SaveEntity(wo, true, 'BIZ_MES_WO_BATCH').then((action) => {
            if (action.IsSuccessed) {
              resolve(action);
            } else {
              reject(action);
            }
          });
        } catch {
          reject(false);
        }
      });
    },
  };
  /**
   * @description: å·¥å•暂停方法
   * @param {*} args
   * @param {Recordable} params
   * @return {*}
   */
  function handlePause(args, params: Recordable) {
    const reload = args[1];
    if (params['record'].STATUS == 0) {
      createErrorModal({
        title: t('警告'),
        content: t('工单是初始化状态,不能暂停!'),
        getContainer: () => document.body,
      });
      return;
    }
    if (params['record'].STATUS == 5) {
      createErrorModal({
        title: t('警告'),
        content: t('工单是完成状态,不能暂停!'),
        getContainer: () => document.body,
      });
      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('暂停操作失败'));
      }
    });
  }
  /**
   * @description: å·¥å•下发方法
   * @param {*} args
   * @param {Recordable} params
   * @return {*}
   */
  function handleRelease(args, params: Recordable) {
    const openCustModal = args[7];
    openCustModal(true, {
      isUpdate: true, //是否更新操作
      ctype: 'BIZ_MES_WO_BATCH', //是哪个页面
      title: '工单下发', //标题
      width: '900px', //弹出框宽度
      formEl: params['useFormData'].value,
      formElName: ['forminfo'], //表单插槽名称
      RowKeys: { add: 'ROUTE_CODE', set: 'ROUTE_CODE' }, //插槽的弹出框选择的code
      fnName: 'SaveWoBatch', //保存方法名
      initFnName: {}, //初始化方法名,没有就留空{}
      values: params['record'], //表单记录
    });
  }
  const woformSchema: FormSchema[] = [
    {
      field: 'PLAN_QTY',
      label: '工单数量',
      component: 'Input',
      required: true,
      colProps: {
        span: 24,
      },
      dynamicDisabled: ({ values }) => {
        return true;
      },
    },
    // {
    //   field: 'RELEASE_QTY',
    //   label: '工单下发数量',
    //   component: 'Input',
    //   required: true,
    //   colProps: {
    //     span: 24,
    //   },
    // },
    {
      label: '计划产线',
      field: 'ACT_LINE',
      component: 'ApiSelect',
      required: true,
      colProps: {
        span: 24,
      },
      componentProps: {
        api: getEntity,
        params: { entityName: 'MES_LINE', sqlcmd: ' 1=1 ', order: '' },
        resultField: 'Data.Items',
        labelField: 'LINE_NAME',
        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,
    //   },
    // },
  ];
  return [methods, ActionColumn];
}
src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1015 @@
/*
 * @Description: äº§å“å·¥è‰ºè·¯çº¿ç›¸å…³
 * @Author: Ben Lin
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-21 18:26:07
 */
import { Ref, h, ref, render, unref } from 'vue';
import { GetRoutePTree, RouteToCust, RouteToProd } from '/@/api/tigerapi/mes/router';
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';
import { NavItem } from '/@/api/tigerapi/model/basModel';
import { useMessage } from '/@/hooks/web/useMessage';
import { useModal } from '/@/components/Modal';
import { FormSchema } from '/@/components/Table';
import { initRoute } from '../data';
import { CustModalParams } from '/@/api/tigerapi/model/systemModel';
import { useUserStore } from '/@/store/modules/user';
const { t } = useI18n();
const { createErrorModal } = useMessage();
const { getLocale } = useLocale();
function _default() {
  /* å®šä¹‰å˜é‡ */
  const isNormal = (type: number) => type === 0;
  const isScan = (type: number) => type === 1;
  const isAssy = (type: number) => type === 2;
  const isTest = (type: number) => type === 3;
  const isAudit = (type: number) => type === 4;
  const isPrint = (type: number) => type === 5;
  const isPackage = (type: number) => type === 6;
  /**
   * @description: äº§å“ç»‘定工艺路线的一些自定义方法
   * @return {*}
   */
  const methods = {
    /**
     * @description: èŽ·å–æ ‘å½¢å›¾æ ‡
     * @param {Recordable} params
     * @return {*}
     */
    CreateIcon: (params: Recordable<any>) => {
      let icon = '';
      switch (params['type']) {
        case 'Product':
          icon = 'similar-product|svg';
          break;
        case 'Route':
          icon = 'route|svg';
          break;
        case 'Node':
          icon = 'node|svg';
          break;
        case 'Action':
          icon = 'rot_action|svg';
          break;
        case 'Customer':
          icon = 'customer|svg';
          break;
      }
      return icon;
    },
    /**
     * @description: é«˜çº§è¡¨å•和详情页面返回主页面的url
     * @return {*}
     */
    GetHomeUrl: () => {
      return `/V_BAS_PROD/LC/${encodeURI(JSON.stringify({ ID: 'V_BAS_PROD', colSlots: [], crudColSlots: [] }))}`;
    },
    /**
     * @description: èŽ·å–æ ‘å½¢æ•°æ®
     * @param {string} type
     * @return {*}
     */
    fetchTreeData: async (type: string, itemCode: string) => {
      let data = { title: '', treeData: [] as any[], fieldNames: {} };
      let prodTreeData = await GetRoutePTree({prodCode: itemCode, orgCode: useUserStore().getUserInfo.orgCode});
      // let uniqueArr = prodTreeData.reduce((acc, current) => {
      //   if (!acc.some((x) => x.pid == current.pid && x.id == current.id && x.seq == current.seq && x.type == current.type)) {
      //     acc.push(current);
      //   }
      //   return acc;
      // }, [] as V_MES_ROUTE_PTREE[]);
      data.treeData = convertToTree(prodTreeData, 'pid', 'tid', 'root');
      data.title = '工艺路线';
      data.fieldNames = { key: 'tid', title: 'name' };
      return data;
    },
    /**
     * @description: èŽ·å–é…ç½®é¡¹è¡¨å•å­—æ®µï¼Œæ ¹æ®æ ‘å½¢èŠ‚ç‚¹type不同而不同
     * @param {string} type
     * @return {*}
     */
    GetCrudForm: (type: string) => {
      let form: FormSchema[] = [];
      switch (type) {
        case 'Action':
          form = actionFormShema;
          break;
        case 'Node':
          form = nodeFormShema;
          break;
      }
      return form;
    },
    /**
     * @description: èŽ·å–è¡¨å•ä¸­çš„å­—æ®µæ’æ§½åˆ—è¡¨
     * @return {*}
     */
    GetCrudColSlots: () => {
      return ['scanadd', 'assyadd', 'testadd', 'auditadd', 'printadd', 'pkgadd'];
    },
    /**
     * @description: åˆ‡æ¢èŠ‚ç‚¹æ—¶äº‹ä»¶æ–¹æ³•
     * @return {*}
     */
    nodeChange: (params: {
      resetFields: any;
      setFieldsValue: any;
      objParams: Ref<any>;
      selectedNodes: Ref<any[]>;
    }) => {
      let sqlcmd = ' 1=1 ';
      if (!isNullOrEmpty(params['objParams'].value['CODE'])) {
        sqlcmd += `And PROD_CODE = '${params['objParams'].value['CODE']}'`;
      }
      if (!isNullOrEmpty(params['selectedNodes'].value[0].cust)) {
        sqlcmd += `And CUST_CODE = '${params['selectedNodes'].value[0].cust}'`;
      }
      if (!isNullOrEmpty(params['selectedNodes'].value[0].id)) {
        sqlcmd +=
          params['selectedNodes'].value[0].type == 'Action'
            ? `And ACT_ID = '${params['selectedNodes'].value[0].id}'`
            : `And NODE_ID = '${params['selectedNodes'].value[0].id}'`;
      }
      getEntity({
        sqlcmd: sqlcmd,
        entityName:
          params['selectedNodes'].value[0].type == 'Action' ? 'MES_PROD_ACTION' : 'MES_PROD_OPER',
        order: '',
      }).then((res) => {
        params['resetFields']();
        if (params['selectedNodes'].value[0].type == 'Action') {
          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,
            RULE_CODE: res.Data.Items[0].RULE_CODE,
            TEST_CODE: res.Data.Items[0].TEST_CODE,
            SAPL_CODE: res.Data.Items[0].SAPL_CODE,
            LABEL_CODE: res.Data.Items[0].LABEL_CODE,
            PKG_CODE: res.Data.Items[0].PKG_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,
          });
        }
        if (params['selectedNodes'].value[0].type == 'Node') {
          params['setFieldsValue']({
            ID: res.Data.Items[0].ID,
            OPER_CODE: res.Data.Items[0].OPER_CODE,
            ROT_ID: res.Data.Items[0].ROT_ID,
            NODE_ID: res.Data.Items[0].NODE_ID,
            NODE_NAME: res.Data.Items[0].NODE_NAME,
            IS_ACTIVE: res.Data.Items[0].IS_ACTIVE,
            IS_CALC_FPY: res.Data.Items[0].IS_CALC_FPY,
            CAN_SKIP: res.Data.Items[0].CAN_SKIP,
            IS_INPUT: res.Data.Items[0].IS_INPUT,
            IS_OUTPUT: res.Data.Items[0].IS_OUTPUT,
            REMARK: res.Data.Items[0].REMARK,
            PROD_CODE: params['objParams'].value['CODE'],
            CUST_CODE: params['selectedNodes'].value[0].cust,
          });
        }
      });
    },
    /**
     * @description: è‡ªå®šä¹‰æäº¤æ–¹æ³•
     * @return {*}
     */
    SubmitFunc: (values: Recordable<any>, type: string, emit) => {
      let entityName = '';
      switch (type) {
        case 'Action':
          entityName = 'MES_PROD_ACTION';
          break;
        case 'Node':
          entityName = 'MES_PROD_OPER';
          break;
      }
      SaveEntity(values, true, entityName).then((action) => {
        if (action.IsSuccessed) {
          emit('success');
        }
      });
    },
    /**
     * @description: å¼¹å‡ºé€‰æ‹©æ¡†æ‰“开方法
     * @param {Fn} openItemModal
     * @return {*}
     */
    OpenSelectItem: (openItemModal: Fn, ...args) => {
      let config = {};
      switch (args[0]) {
        case 'scanadd':
          config = ruleModalCfg;
          break;
        case 'assyadd':
          config = itemCodeModalCfg;
          break;
        case 'testadd':
          config = itemCodeModalCfg;
          break;
        case 'printadd':
          config = printModalCfg;
          break;
        case 'pkgadd':
          config = pkgModalCfg;
          break;
      }
      openItemModal(true, config);
    },
    /**
     * @description: å¼¹å‡ºé€‰æ‹©æ¡†é€‰æ‹©æˆåŠŸè¿”å›ž
     * @param {*} d
     * @param {*} u
     * @return {*}
     */
    GetSelectSuccess: (d, u, ...args) => {
      let value = {};
      switch (args[0]) {
        case 'scanadd':
          value = {
            RULE_CODE: d.values['val'],
          };
          break;
        case 'assyadd':
          value = {
            ITEM_CODE: d.values['val'],
          };
          break;
        case 'printadd':
          value = {
            LABEL_CODE: d.values['val'],
          };
          break;
        case 'pkgadd':
          value = {
            pkgRULE_CODE: d.values['val'],
          };
        case 'addRoute':
          if (isNullOrEmpty(args[1]['CODE'])) {
            createErrorModal({
              title: t('sys.api.errorTip'),
              content: '产品为空,不能添加工艺路线,请点击左侧选择产品',
            });
            return;
          }
          let codes = d.values.id.split(',');
          var i;
          for (i = 0; i < codes.length; i++) {
            if (d.which == 'addRoute') {
              RouteToProd({ rotId: codes[i], prodCode: args[1]['CODE'] });
            }
          }
          args[2]();
          break;
        case 'addCustomer':
          if (isNullOrEmpty(args[1]['CODE'])) {
            createErrorModal({
              title: t('sys.api.errorTip'),
              content: '产品为空,不能添加工艺路线,请点击左侧选择产品',
            });
            return;
          }
          let rotIds = d.ROT_ID.split(',');
          var i;
          for (i = 0; i < rotIds.length; i++) {
            RouteToCust({ rotId: rotIds[i], prodCode: args[1]['CODE'], custCode: d.CUST_CODE });
          }
          args[2]();
          break;
      }
      return value;
    },
    /**
     * @description: èŽ·å–æ¨¡æ€æ¡†åº”ç”¨åˆ—è¡¨
     * @return {*}
     */
    GetUseModals: () => {
      return {
        addRoute: useModal(),
        addCustomer: useModal(),
        editRoute: useModal(),
      };
    },
    /**
     * @description: èŽ·å–æ ‡é¢˜ä¿¡æ¯
     * @param {string} type
     * @return {*}
     */
    GetTitle: (type: string) => {
      return {
        configTitle: type == 'Action' ? '行为配置' : '工序配置',
        navTitle: type == 'Product' ? '添加工艺路线' : '工艺路线维护',
      };
    },
    /**
     * @description: æ ¹æ®é€‰ä¸­çš„æ ‘节点返回主页面,自定义方法,这里是判断要切换哪个组件
     * @param {Ref} selectedNodes
     * @return {*}
     */
    SelectNode: (selectedNodes: Ref<any[]>) => {
      let result = {
        showConfig: false,
        showNav: false,
        type: selectedNodes.value[0].type,
        nodes: selectedNodes.value,
      };
      if (isNullOrUnDef(selectedNodes)) {
        return result;
      }
      if (selectedNodes.value[0].type == 'Product' || selectedNodes.value[0].type == 'Route') {
        result.showNav = true;
        result.showConfig = false;
      }
      if (selectedNodes.value[0].type == 'Action' || selectedNodes.value[0].type == 'Node') {
        result.showNav = false;
        result.showConfig = true;
      }
      return result;
    },
    /**
     * @description: èŽ·å–å¯¼èˆªé¡¹
     * @return {*}
     */
    GetNavItems: (type: string) => {
      let item: NavItem[] = [];
      switch (type) {
        case 'Product':
          item = [
            {
              title: '添加产品工艺路线',
              icon: 'add_green|svg',
              color: '#1fdaca',
              url: '/addRoute',
              action: 'addRoute',
              isStep: false,
            },
            {
              title: '添加客户工艺路线',
              icon: 'add_customer|svg',
              color: '#bf0c2c',
              url: '/addCustomer',
              action: 'addCustomer',
              isStep: true,
            },
          ];
          break;
        case 'Route':
          item = [
            {
              title: '编辑工艺路线',
              icon: 'clarity:note-edit-line',
              color: '#1fdaca',
              url: '/editRoute',
              action: 'editRoute',
              isStep: false,
            },
          ];
          break;
      }
      return item;
    },
    /**
     * @description: å¯¼èˆªé¡µé¢åˆ‡æ¢æŒ‰é’®æ—¶è°ƒç”¨æ–¹æ³•
     * @param {any} action
     * @return {*}
     */
    navChangeItem: (action: any, ...args) => {
      switch (action) {
        case 'addRoute':
          args[0](true, {
            title: '工艺路线列表',
            schemas: [
              {
                field: 'ROT_CODE',
                component: 'Input',
                label: '工艺路线编码',
                colProps: {
                  span: 12,
                },
              },
            ],
            ItemColumns: [
              {
                title: t('工艺路线编码'),
                dataIndex: 'ROT_CODE',
                resizable: true,
                sorter: true,
                width: 200,
              },
              {
                title: t('工艺路线名称'),
                dataIndex: 'ROT_NAME',
                resizable: true,
                sorter: true,
                width: 180,
              },
            ],
            tableName: 'MES_ROUTE',
            rowKey: 'ROT_CODE',
            returnFieldName: ['ROUTE_CODE'], //返回值要赋值的字段名称
            searchInfo: { TABLE_NAME: 'MES_ROUTE' },
            which: action,
          });
          break;
        case 'addCustomer':
          args[0](true, {
            title: '请完成以下步骤',
          });
          break;
        case 'editRoute':
          args[1](true, { rotId: args[2][0].id, slotName: '' });
          break;
      }
    },
    /**
     * @description: èŽ·å–å¡ç‰‡å†…é…ç½®åˆ—è¡¨ï¼Œä»¥å¾ªçŽ¯æ˜¾ç¤ºå¤šä¸ªå¡ç‰‡å¹¶é…ç½®å¤šä¸ªæ’æ§½
     * @return {*}
     */
    GetBaseCards: (type: string) => {
      let reusts: any[] = [];
      switch (type) {
        case 'Product':
          reusts = [];
          break;
        case 'Route':
          reusts = [
            {
              name: 'RotInfo',
              slots: [],
              preIcons: {},
              title: '工艺路线图',
              entityName: '',
            },
          ];
          break;
      }
      return reusts;
    },
    /**
     * @description: èŽ·å–æ’æ§½åˆ—è¡¨
     * @return {*}
     */
    GetSlots: () => {
      return ['RotInfo'];
    },
    /**
     * @description: ç”Ÿæˆhtml
     * @return {*}
     */
    GenerateHtml: (type: string | null) => {
      const newElement = document.createElement('div');
      // newElement.textContent = 'New Element =>'+type;
      // newElement.style.height = '250px';
      newElement.id = 'lfContainer';
      newElement.className = 'h-full';
      // newElement.style.color = 'blue';
      // newElement.style.fontSize = '16px';
      return newElement;
    },
    /**
     * @description: è‡ªå®šä¹‰æ–¹æ³•
     * @param {string} type
     * @param {array} args
     * @return {*}
     */
    CustFunc: (param: CustModalParams) => {
      if (param.cType == 'Route') {
        // initRoute(args[0], args[1]);
      }
    },
    GetUseForm: () => {
      return {};
    },
  };
  /* ä»¥ä¸‹æ˜¯å†…部方法,不export,供上面的方法调用 */
  /**
   * @description: å¼¹å‡ºé€‰æ‹©æ¡†-物料选择框配置
   * @return {*}
   */
  const itemCodeModalCfg = {
    title: '物料列表',
    schemas: [
      {
        field: 'ITEM_CODE',
        component: 'Input',
        label: '物料编码',
        colProps: {
          span: 12,
        },
      },
    ],
    ItemColumns: [
      {
        title: t('物料编码'),
        dataIndex: 'ITEM_CODE',
        resizable: true,
        sorter: true,
        width: 200,
      },
      {
        title: t('物料名称'),
        dataIndex: 'ITEM_NAME',
        resizable: true,
        sorter: true,
        width: 180,
      },
    ],
    tableName: 'BAS_ITEM',
    rowKey: 'ITEM_CODE',
    searchInfo: { TABLE_NAME: 'BAS_ITEM' },
  };
  /**
   * @description: å¼¹å‡ºé€‰æ‹©æ¡†-规则选择框配置
   * @return {*}
   */
  const ruleModalCfg = {
    title: '规则列表',
    schemas: [
      {
        field: 'RULE_CODE',
        component: 'Input',
        label: '规则编码',
        colProps: {
          span: 12,
        },
      },
    ],
    ItemColumns: [
      {
        title: t('规则编码'),
        dataIndex: 'RULE_CODE',
        resizable: true,
        sorter: true,
        width: 200,
      },
      {
        title: t('规则名称'),
        dataIndex: 'RULE_NAME',
        resizable: true,
        sorter: true,
        width: 180,
      },
    ],
    tableName: 'BAS_CODE_RULE',
    rowKey: 'RULE_CODE',
    searchInfo: { TABLE_NAME: 'BAS_CODE_RULE' },
  };
  /**
   * @description: å¼¹å‡ºé€‰æ‹©æ¡†-打印模板选择框配置
   * @return {*}
   */
  const printModalCfg = {
    title: '打印模板列表',
    schemas: [
      {
        field: 'LABEL_CODE',
        component: 'Input',
        label: '模板编码',
        colProps: {
          span: 12,
        },
      },
    ],
    ItemColumns: [
      {
        title: t('模板编码'),
        dataIndex: 'LABEL_CODE',
        resizable: true,
        sorter: true,
        width: 200,
      },
      {
        title: t('模板名称'),
        dataIndex: 'LABEL_NAME',
        resizable: true,
        sorter: true,
        width: 180,
      },
    ],
    tableName: 'BAS_LABEL_TEMP',
    rowKey: 'LABEL_CODE',
    searchInfo: { TABLE_NAME: 'BAS_LABEL_TEMP' },
  };
  const pkgModalCfg = {
    title: '包装规则列表',
    schemas: [
      {
        field: 'RULE_CODE',
        component: 'Input',
        label: '包装规则编码',
        colProps: {
          span: 12,
        },
      },
    ],
    ItemColumns: [
      {
        title: t('包装规则编码'),
        dataIndex: 'RULE_CODE',
        resizable: true,
        sorter: true,
        width: 200,
      },
      {
        title: t('包装规则名称'),
        dataIndex: 'RULE_NAME',
        resizable: true,
        sorter: true,
        width: 180,
      },
    ],
    tableName: 'BAS_PKG_RULE',
    rowKey: 'RULE_CODE',
    searchInfo: { TABLE_NAME: 'BAS_PKG_RULE' },
  };
  /**
   * @description: è¡Œä¸ºé…ç½®è¡¨å•字段
   * @return {*}
   */
  const actionFormShema: FormSchema[] = [
    {
      field: 'PROD_CODE',
      label: '产品编码',
      component: 'Input',
      dynamicDisabled: ({ values }) => {
        return true;
      },
      colProps: { span: 12 },
    },
    {
      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,
    },
    {
      field: 'CUST_CODE',
      label: '客户编码',
      component: 'Input',
      dynamicDisabled: ({ values }) => {
        return true;
      },
      colProps: { span: 12 },
    },
    {
      field: 'ACT_TYPE',
      label: '行为类型',
      component: 'ApiSelect',
      colProps: { span: 12 },
      defaultValue: 0,
      componentProps: {
        api: GetEnum,
        params: { name: 'MES_PROD_ACTION+ACT_TYPEs' },
        resultField: 'Data',
        labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name',
        valueField: 'Value',
        // onChange: (e, v) => {
        //   alert(e)
        //   console.log('ApiSelect====>:', e, v);
        // },
      },
    },
    {
      field: 'IS_ACTIVE',
      label: '是否启用',
      required: true,
      component: 'Select',
      colProps: { span: 12 },
      componentProps: {
        options: [
          {
            label: '是',
            value: 'Y',
            key: 'Y',
          },
          {
            label: '否',
            value: 'N',
            key: 'N',
          },
        ],
      },
    },
    {
      field: 'RULE_CODE',
      label: '扫码验证',
      component: 'Input',
      colProps: { span: 10 },
      ifShow: ({ values }) => isScan(values.ACT_TYPE),
    },
    {
      field: '0',
      label: '1',
      defaultValue: '',
      component: 'Input',
      colProps: { span: 2, pull: 1 },
      ifShow: ({ values }) => isScan(values.ACT_TYPE),
      colSlot: 'scanadd',
    },
    {
      field: 'ITEM_CODE',
      label: '组装上料',
      colProps: { span: 10 },
      component: 'Input',
      ifShow: ({ values }) => isAssy(values.ACT_TYPE),
    },
    {
      field: '00',
      label: '1',
      defaultValue: '',
      component: 'Input',
      colProps: { span: 2, pull: 1 },
      ifShow: ({ values }) => isAssy(values.ACT_TYPE),
      colSlot: 'assyadd',
    },
    {
      field: 'TEST_CODE',
      label: '产品测试',
      colProps: { span: 10 },
      component: 'Input',
      ifShow: ({ values }) => isTest(values.ACT_TYPE),
    },
    {
      field: 'test0',
      label: '1',
      defaultValue: '',
      component: 'Input',
      colProps: { span: 2, pull: 1 },
      ifShow: ({ values }) => isTest(values.ACT_TYPE),
      colSlot: 'testadd',
    },
    {
      field: 'SAPL_CODE',
      label: '产品抽检',
      colProps: { span: 10 },
      component: 'Input',
      ifShow: ({ values }) => isAudit(values.ACT_TYPE),
    },
    {
      field: 'audit0',
      label: '1',
      defaultValue: '',
      component: 'Input',
      colProps: { span: 2, pull: 1 },
      ifShow: ({ values }) => isAudit(values.ACT_TYPE),
      colSlot: 'auditadd',
    },
    {
      field: 'LABEL_CODE',
      label: '标签打印',
      colProps: { span: 10 },
      component: 'Input',
      ifShow: ({ values }) => isPrint(values.ACT_TYPE),
    },
    {
      field: 'print0',
      label: '1',
      defaultValue: '',
      component: 'Input',
      colProps: { span: 2, pull: 1 },
      ifShow: ({ values }) => isPrint(values.ACT_TYPE),
      colSlot: 'printadd',
    },
    {
      field: 'pkgRULE_CODE',
      label: '包装规则',
      colProps: { span: 10 },
      component: 'Input',
      ifShow: ({ values }) => isPackage(values.ACT_TYPE),
    },
    {
      field: 'pkg0',
      label: '1',
      defaultValue: '',
      component: 'Input',
      colProps: { span: 2, pull: 1 },
      ifShow: ({ values }) => isPackage(values.ACT_TYPE),
      colSlot: 'pkgadd',
    },
    {
      field: 'REMARK',
      label: '备注',
      component: 'Input',
      colProps: { span: 12 },
    },
  ];
  /**
   * @description: å·¥åºé…ç½®è¡¨å•字段
   * @return {*}
   */
  const nodeFormShema: FormSchema[] = [
    {
      field: 'PROD_CODE',
      label: '产品编码',
      component: 'Input',
      dynamicDisabled: ({ values }) => {
        return true;
      },
      colProps: { span: 12 },
    },
    {
      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: 'NODE_ID',
      label: 'NODE_ID',
      component: 'Input',
      show: false,
    },
    {
      field: 'NODE_NAME',
      label: '工序节点名称',
      component: 'Input',
    },
    {
      field: 'CUST_CODE',
      label: '客户编码',
      component: 'Input',
      dynamicDisabled: ({ values }) => {
        return true;
      },
      colProps: { span: 12 },
    },
    {
      field: 'OPER_CODE',
      label: '工序编码',
      component: 'Input',
    },
    {
      field: 'IS_ACTIVE',
      label: '是否启用',
      required: true,
      component: 'Select',
      colProps: { span: 12 },
      componentProps: {
        options: [
          {
            label: '是',
            value: 'Y',
            key: 'Y',
          },
          {
            label: '否',
            value: 'N',
            key: 'N',
          },
        ],
      },
    },
    {
      field: 'IS_CALC_FPY',
      label: '是否计算直通率',
      required: true,
      component: 'Select',
      colProps: { span: 12 },
      componentProps: {
        options: [
          {
            label: '是',
            value: 'Y',
            key: 'Y',
          },
          {
            label: '否',
            value: 'N',
            key: 'N',
          },
        ],
      },
    },
    {
      field: 'CAN_SKIP',
      label: '是否允许跳站',
      required: true,
      component: 'Select',
      colProps: { span: 12 },
      componentProps: {
        options: [
          {
            label: '是',
            value: 'Y',
            key: 'Y',
          },
          {
            label: '否',
            value: 'N',
            key: 'N',
          },
        ],
      },
    },
    {
      field: 'IS_INPUT',
      label: '是否投入站',
      required: true,
      component: 'Select',
      colProps: { span: 12 },
      componentProps: {
        options: [
          {
            label: '是',
            value: 'Y',
            key: 'Y',
          },
          {
            label: '否',
            value: 'N',
            key: 'N',
          },
        ],
      },
    },
    {
      field: 'IS_OUTPUT',
      label: '是否产出站',
      required: true,
      component: 'Select',
      colProps: { span: 12 },
      componentProps: {
        options: [
          {
            label: '是',
            value: 'Y',
            key: 'Y',
          },
          {
            label: '否',
            value: 'N',
            key: 'N',
          },
        ],
      },
    },
    {
      field: 'REMARK',
      label: '备注',
      component: 'Input',
      colProps: { span: 12 },
    },
  ];
  return [methods];
}
export default _default;
src/views/tigerprojects/system/lowcode/normal/mainTable.vue
@@ -4,9 +4,9 @@
      <template #toolbar>
        <a-button
          type="primary"
          v-for="item in buttons.filter((m) => m['BUTTON_TYPE'] == 0)"
          @click="handleCreate(item['DO_METHOD'])"
          :preIcon="item['ICON_URL']"
          v-for="item in buttons.filter((m) => m['BUTTON_TYPE'] == 0)"
          :key="item"
        >
          {{ item['FUNC_NAME'] }}
@@ -34,6 +34,7 @@
      <CustModal
        @register="registerCust"
        @success="custSuccess"
        @cancel="custCancel"
        :type="cType"
        :entityName="entityName"
        @modalInner="getdtlSlots"
@@ -404,12 +405,24 @@
        });
    } catch (e) {}
  }
  //弹出框确定返回
  /**
   * @description: å¼¹å‡ºæ¡†ç¡®å®šè¿”回
   * @param {*} d
   * @return {*}
   */
  function custSuccess(d) {
    reload();
  }
  /**
   * @description: å¼¹å‡ºæ¡†å–消返回
   * @param {*} reload
   * @return {*}
   */
  function custCancel() {reload();}
  /**
   * @description: å„表单内弹出选择框选择成功后方法
   * @param {*} d
   * @param {*} u