Ben Lin
2024-06-21 2abb91c893f2eed3761bd09aabe12400460d2863
产品工艺路线更新
已修改6个文件
已添加1个文件
247 ■■■■■ 文件已修改
src/api/tigerapi/system.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Tree/src/types/tree.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/bas/MaterialInfo/index.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/composition/RouteAction.vue 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/composition/index.vue 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/data.ts 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/role/RoleDrawer.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/tigerapi/system.ts
@@ -745,7 +745,7 @@
}
async function getListByPageAsync(params: any) {
  const data = await defHttp.post(
    { url: Api.QueryUrl, params },
    { url: Api.QueryUrl, params,timeout:30000 },
    {
      isTransformResponse: false,
    },
src/components/Tree/src/types/tree.ts
@@ -106,6 +106,11 @@
    default: () => [],
  },
  halfCheckedKeys: {
    type: [Array, Object] as PropType<KeyType[]>,
    default: () => [],
  },
  beforeRightClick: {
    type: Function as PropType<(...arg: any) => Promise<ContextMenuItem[] | ContextMenuOptions>>,
    default: undefined,
src/views/tigerprojects/bas/MaterialInfo/index.vue
@@ -43,6 +43,7 @@
  import { columns, searchFormSchema } from './Material.data';
  import { DeleteMaterial, getMaterialListByPage } from '../../../../api/tigerapi/bas/MaterialInfo';
  import { useModal } from '/@/components/Modal';
  import { getListByPage } from '/@/api/tigerapi/system';
  import { useGo } from '/@/hooks/web/usePage';
  const go = useGo();
@@ -50,7 +51,8 @@
  const [registerModal, { openModal: openMaterialModal }] = useModal();
  const [registerTable, { reload }] = useTable({
    title: '物料列表',
    api: getMaterialListByPage,
    api: getListByPage,
    searchInfo: { TABLE_NAME: 'BAS_ITEM' },
    columns,
    formConfig: {
      labelWidth: 120,
@@ -103,7 +105,7 @@
   * @description: è·³è½¬äº§å“å·¥è‰ºç»‘定页面
   * @param {*} record
   * @return {*}
   */
   */
  function handleBinding(record: Recordable) {
    const id = {
      ID: record.ID,
@@ -112,7 +114,15 @@
      Title: `产品[${record.ITEM_CODE}]工艺绑定`,
      colSlots: [],
      crudColSlots: [],
      dense: true,
      pageTitle: `产品工艺绑定`,
      pageContent: `这里是管理产品的工艺绑定,一个产品可以绑定多个工艺路线`,
    };
    go(`/ProdRouteBinding/CP/${encodeURI(JSON.stringify(id))}`);
    // let obj = JSON.stringify(id);
    // push({
    //   path: '/ProdRouteBinding',
    //   state: {obj}, //HTML5 History API çš„传参,参数隐藏不在地址栏显示(history)
    // })
  }
</script>
src/views/tigerprojects/system/lowcode/composition/RouteAction.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,142 @@
<!--
 * @Description: å·¥è‰ºè·¯çº¿æ·»åŠ é¡µé¢
 * @Author: Ben Lin
 * @version:
 * @Date: 2024-06-20 12:13:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-21 00:11:00
-->
<template>
  <Card title="操作">
    <CardGrid v-for="item in navItems" :key="item.title" @click="changeItem(item.action)">
      <span class="flex flex-col items-center">
        <Icon :icon="item.icon" :color="item.color" size="20" />
        <span class="text-md mt-2 truncate">{{ item.title }}</span>
      </span>
    </CardGrid>
  </Card>
  <GeneralModal @register="register" @success="handleSuccess"></GeneralModal>
</template>
<script lang="ts" setup>
  import { Card, CardGrid } from 'ant-design-vue';
  import Icon from '@/components/Icon/Icon.vue';
  import { RouteToProd } from '/@/api/tigerapi/mes/router';
  import GeneralModal from '/@/views/components/GeneralModal.vue';
  import { useModal } from '/@/components/Modal';
  import { useI18n } from '/@/hooks/web/useI18n';
  const { t } = useI18n();
  const [register, { openModal }] = useModal();
  interface NavItem {
    title: string;
    icon: string;
    color: string;
    url: string;
    action: string;
  }
  // å¿«æ·å¯¼èˆª
  const navItems: NavItem[] = [
    {
      title: '添加工艺路线',
      icon: 'ion:home-outline',
      color: '#1fdaca',
      url: '/workbench',
      action: 'addRoute',
    },
    {
      title: '添加客户',
      icon: 'materialreq|svg',
      color: '#bf0c2c',
      url: '/materialreq',
      action: 'addCustomer',
    },
    // {
    //   title: '销售出库单',
    //   icon: 'Out|svg',
    //   color: '#e18525',
    //   url: '/saleoutorder',
    // },
    // {
    //   title: '完工入库单',
    //   icon: 'In|svg',
    //   color: '#3fb27f',
    //   url: '/finishedwarehouse',
    // },
    // {
    //   title: '生产退料单',
    //   icon: 'materialret|svg',
    //   color: '#4daf1bc9',
    //   url: '/materialret',
    // },
    // {
    //   title: '盘点单',
    //   icon: 'inventory|svg',
    //   color: '#00d8ff',
    //   url: '/inventory',
    // },
    // {
    //   title: '调拨单',
    //   icon: 'transfer|svg',
    //   color: '#00d8ff',
    //   url: '/transfer',
    // },
    // {
    //   title: '实时库存',
    //   icon: 'WmsItem|svg',
    //   color: '#00d8ff',
    //   url: '/WmsItem',
    // },
  ];
  function changeItem(action) {
    if (action == 'addRoute') {
      openModal(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' },
      });
    }
  }
  /**
   * @description: é€‰æ‹©å·¥è‰ºè·¯çº¿æˆåŠŸè¿”å›žæ–¹æ³•
   * @param {*} d
   * @param {*} u
   * @return {*}
   */
  function handleSuccess(d, u) {
    let codes = d.values.id.split(',');
    let eintity: any[] = [];
    var i;
    for (i = 0; i < codes.length; i++) {
      RouteToProd({ rotId: codes[i], prodCode: 'K5811AA015007' }).then(() => {});
    }
  }
</script>
src/views/tigerprojects/system/lowcode/composition/index.vue
@@ -1,5 +1,13 @@
<template>
  <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
  <PageWrapper
    :dense="dense"
    contentFullHeight
    fixedHeight
    contentClass="flex"
    :title="pageTitle"
    :content="pageContent"
    @back="goBack"
  >
    <GeneralTree
      class="w-1/4 xl:w-1/5"
      @select="handleSelect"
@@ -10,7 +18,9 @@
    /><!--
      add
      @handle-add="handleAdd" -->
    <div class="w-3/4 xl:w-4/5"></div>
    <div class="w-3/4 xl:w-4/5 p-5">
      <RouteAction v-if="entityName == 'ProdRouteBinding'" />
    </div>
    <!-- <BasicTable class="w-3/4 xl:w-4/5" @register="registerTable">
      <template #toolbar>
        <a-button type="primary" @click="handleCreate" preIcon="add_02|svg"> æ–°å¢ž </a-button>
@@ -21,7 +31,7 @@
        </template>
      </template>
    </BasicTable> -->
    <normalDrawer @register="registerDrawer" @success="handleSuccess" />
    <!-- <normalDrawer @register="registerDrawer" @success="handleSuccess" /> -->
    <CustModal
      @register="registerCust"
      @success="custSuccess"
@@ -56,6 +66,7 @@
  import { useModal } from '@/components/Modal';
  import normalDrawer from '../normalDrawer.vue';
  import GeneralModal from '/@/views/components/GeneralModal.vue';
  import RouteAction from './RouteAction.vue';
  import CustModal from '/@/views/components/CustModal.vue';
  import {
    GetActionsData,
@@ -63,6 +74,7 @@
    OpenCustModal,
    fetchTreeData,
    getFormSchema,
    getHomeUrl,
    getOthersValues,
  } from '../data';
  import { onMounted, reactive, ref } from 'vue';
@@ -72,13 +84,16 @@
  import { TreeItem } from '/@/components/TigerTree';
  import { createIconByType } from '../data';
  import { RouteToProd } from '/@/api/tigerapi/mes/router';
import { useTabs } from '/@/hooks/web/useTabs';
  import { useTabs } from '/@/hooks/web/useTabs';
  import { isNullOrUnDef } from '/@/utils/is';
  import { useGo } from '/@/hooks/web/usePage';
  defineOptions({ name: 'DeptManagement' });
  const go = useGo();
  const route = useRoute();
  const { setTitle } = useTabs();
  const objParams = ref(JSON.parse(decodeURI(route.params?.id as string)));
  const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); //ref(JSON.parse(history.state.obj))
  const entityName = ref(objParams.value.Name);
  const formSchemas = ref({}); //弹出框或高级页面多表单结构
  const useModalData = ref({}); //表单中插槽渲染按钮打开模态框useModal方法
@@ -94,6 +109,9 @@
  const treeData = ref<TreeItem[]>([]);
  const title = ref('');
  const fieldNames = ref({});
  const dense = isNullOrUnDef(objParams.value.dense) ? ref(false) : ref(objParams.value.dense);
  const pageTitle = ref(objParams.value.pageTitle);
  const pageContent = ref(objParams.value.pageContent);
  const others = ref(getOthersValues(entityName.value, objParams.value.CODE, objParams.value.ID));
  const [registerCust, { openModal: openCustomModal, closeModal }] = useModal();
  const [registerItemAdd, { openModal: openItemModal }] = useModal();
@@ -127,13 +145,21 @@
   * @description: èŽ·å–æ ‘å½¢æ•°æ®
   * @param {*} type
   * @return {*}
   */
   */
  async function fetch(type: string) {
    //根据type获取树形数据
    const data = await fetchTreeData(type, objParams.value.CODE);
    title.value = data.title;
    treeData.value = data.treeData;
    fieldNames.value = data.fieldNames;
  }
  /**
   * @description: é¡µé¢å·¦ä¾§ç‚¹å‡»è¿”回链接时的操作
   * @return {*}
   */
  function goBack() {
    go(getHomeUrl(entityName.value));
  }
  // function handleAdd(){
@@ -145,7 +171,7 @@
   * @param {*} params
   * @param {*} type
   * @return {*}
   */
   */
  function createIcon(params: Recordable<any>) {
    return createIconByType(params, entityName.value);
  }
@@ -213,9 +239,9 @@
    //     others: others.value,
    //   });
    // });
    RouteToProd({rotId: 'e4712192f75b465585107fdcd13d8003', prodCode: 'K5019AA013517'}).then(() => {
    });
    RouteToProd({ rotId: 'e4712192f75b465585107fdcd13d8003', prodCode: 'K5019AA013517' }).then(
      () => {},
    );
  }
  // function handleEdit(record: Recordable) {
@@ -229,14 +255,14 @@
  //   console.log(record);
  // }
  function handleSelect(deptId = '') {
  function handleSelect(deptId = '', info) {
    searchInfo.deptId = deptId;
    reload();
    // reload();
  }
  function handleSuccess() {
    reload();
  }
  // function handleSuccess() {
  //   reload();
  // }
  /**
   * @description: å¼¹å‡ºæ¡†ç¡®å®šè¿”回
@@ -244,7 +270,7 @@
   * @return {*}
   */
  function custSuccess(d) {
    reload();
    // reload();
  }
  /**
src/views/tigerprojects/system/lowcode/data.ts
@@ -626,6 +626,9 @@
    case 'BAS_LABEL_VAR':
      url = `/BAS_LABEL_TEMP/LC/${encodeURI(JSON.stringify({ ID: 'BAS_LABEL_TEMP', colSlots: [], crudColSlots: [] }))}`;
      break;
    case 'ProdRouteBinding':
      url = `/MaterialInfo`;
      break;
    default:
      break;
  }
@@ -703,7 +706,7 @@
      let prodTreeData = await GetRoutePTree(itemCode);
      data.treeData = convertToTree(prodTreeData, 'pid', 'id', 'root');
      data.title = '工艺路线';
      data.fieldNames = { key: 'id', title: 'name' }
      data.fieldNames = { key: 'id', title: 'name' };
      break;
    case 'BAS_PKG_DTL':
      break;
src/views/tigerprojects/system/role/RoleDrawer.vue
@@ -156,6 +156,7 @@
      }
      //console.log(list,11);
      data.record.menu = list2;
      halfCheckedKeys.value = list;
      expandedKeys.value = list;
      await getRuleOrg(data);
      await getRuleWh(data);
@@ -166,7 +167,11 @@
    }
  });
  //获取角色对应的组织
  /**
   * @description: èŽ·å–è§’è‰²å¯¹åº”çš„ç»„ç»‡
   * @param {*} data
   * @return {*}
   */
  async function getRuleOrg(data) {
    const orgList = await getROList(data.record.ID);
    var hfList = [];
@@ -181,10 +186,15 @@
      }
    }
    data.record.org = hfList;
    halfCheckedKeysOrg.value = list;
    expandedKeysOrg.value = list;
  }
  //获取角色对应的仓库
  /**
   * @description: èŽ·å–è§’è‰²å¯¹åº”çš„ä»“åº“
   * @param {*} data
   * @return {*}
   */
  async function getRuleWh(data) {
    const whList = await getWhList(data.record.ID);
    var hfList = [];
@@ -199,9 +209,15 @@
      }
    }
    data.record.wh = hfList;
    halfCheckedKeysWh.value = list;
    expandedKeysWh.value = list;
  }
  /**
   * @description: èŽ·å–è§’è‰²å¯¹åº”çš„ç”Ÿäº§
   * @param {*} data
   * @return {*}
   */
  async function getRuleProd(data) {
    const prodList = await getProdList(data.record.ID);
    var hfList = [];
@@ -216,6 +232,7 @@
      }
    }
    data.record.fty = hfList;
    halfCheckedKeysFty.value = list;
    expandedKeysFty.value = list;
  }