Ben Lin
2024-11-12 a42c6f16bbb177dfcc754d53d925afddead38eba
src/store/modules/prodRoute.ts
@@ -18,6 +18,8 @@
  curConfig: any;
  curSelectedNodes: any[];
  ItemCode: string;
  Wo: string;
  CustCode: string;
  name: string;
  curDtl: any;
  changeToCPPage: boolean;
@@ -33,6 +35,8 @@
    curDtl: {},
    changeToCPPage: false,
    name: '',
    CustCode: '',
    Wo: ''
  }),
  getters: {
    getCurProdRotTree(state): PageRotTree[] {
@@ -46,6 +50,12 @@
    },
    getItemCodes(state): string {
      return state.ItemCode;
    },
    getCustCode(state): string {
      return state.CustCode;
    },
    getWo(state): string {
      return state.Wo;
    },
    getcurDtl(state): any {
      return state.curDtl;
@@ -104,6 +114,12 @@
    setItemCode(val: string) {
      this.ItemCode = val;
    },
    setCustCode(val: string) {
      this.CustCode = val;
    },
    setWo(val: string) {
      this.Wo = val;
    },
    setcurDtl(val: any) {
      this.curDtl = val;
    },
@@ -119,6 +135,8 @@
      this.curSelectedNodes = [];
      this.curDtl = {};
      this.name = '';
      this.ItemCode = '';
      this.CustCode = '';
    },
    /**
     * @description: 设置默认工艺路线
@@ -144,7 +162,7 @@
      });
      if (action.IsSuccessed) {
        const rotTree = this.curProdRotTree.filter((q) => q.name == this.getname);
        rotTree[0].treeInfo.children[0].children.map((item) => {
        rotTree[0].treeInfo[0].children[0].children.map((item) => {
          if (item.code == param.others['code']) {
            item.isDefault = true;
          } else {
@@ -160,7 +178,8 @@
     * @return {*}
     */
    getParent(tid: string): MesRotTree {
      return findParent(this.getCurProdRotTree, tid) as unknown as MesRotTree;
      const rotTree = this.getCurProdRotTree.filter((q) => q.name == this.getname);
      return findParent(rotTree[0].treeInfo, tid) as unknown as MesRotTree;
    },
  },
});