Ben Lin
2024-07-22 c24509087b1193c18ee4c87487b0fc4bf8ee0918
src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-03 20:40:54
 * @LastEditTime: 2024-07-22 18:21:59
 */
import { Ref, h, ref, render, unref } from 'vue';
@@ -18,6 +18,8 @@
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();
@@ -76,7 +78,7 @@
     */
    fetchTreeData: async (type: string, itemCode: string) => {
      let data = { title: '', treeData: [] as any[], fieldNames: {} };
      let prodTreeData = await GetRoutePTree(itemCode);
      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);
@@ -139,6 +141,7 @@
        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') {
@@ -194,6 +197,8 @@
          entityName = 'MES_PROD_OPER';
          break;
      }
      values.AUTH_ORG = useUserStore().getUserInfo.orgCode;
      values.AUTH_PROD = useUserStore().getUserInfo.prodCode;
      SaveEntity(values, true, entityName).then((action) => {
        if (action.IsSuccessed) {
          emit('success');
@@ -418,7 +423,7 @@
            ],
            tableName: 'MES_ROUTE',
            rowKey: 'ROT_CODE',
            returnFieldName: 'ROUTE_CODE', //返回值要赋值的字段名称
            returnFieldName: ['ROUTE_CODE'], //返回值要赋值的字段名称
            searchInfo: { TABLE_NAME: 'MES_ROUTE' },
            which: action,
          });
@@ -484,11 +489,14 @@
     * @param {array} args
     * @return {*}
     */
    CustFunc: (type: string | undefined, ...args) => {
      if (type == 'Route') {
    CustFunc: (param: CustModalParams) => {
      if (param.cType == 'Route') {
        // initRoute(args[0], args[1]);
      }
    },
    GetUseForm: () => {
      return {};
    },
  };
  /* 以下是内部方法,不export,供上面的方法调用 */