Просмотр исходного кода

完成流程设置的大部分需求变更

sh4wmoo 2 лет назад
Родитель
Сommit
b3e76a9bf3

+ 170 - 149
src/components/business/process/node-modal/node-modal.vue

@@ -12,8 +12,7 @@
       sticky
       @modalOk="modalOk"
       @modalCancel="modalCancel"
-      @on-cancel="modalCancel"
-      :valid-form-ref-list="['formInLine-tab1','formInLine-tab2','formInLine-tab3','formInLine-tab4']">
+      @on-cancel="modalCancel">
         <DkTabs :options="tabsOptions" v-model="currentTab" @on-click="changeTabs" style="margin: 10px 0;"/>
 
         <!--          &lt;!&ndash;    返回工序    &ndash;&gt;-->
@@ -31,7 +30,7 @@
         {{ nodeData }}<br/>
 
         <!--   tab1 - 基本信息    -->
-        <DkForm ref="formInline-tab1" v-if="currentTab =='tab1'" v-model="nodeData" :label-max-words="6" :colCount="2">
+        <DkForm ref="formInline" v-if="currentTab =='tab1'" v-model="nodeData" :label-max-words="6" :colCount="2">
           <!--   工序名称    -->
           <DkFormItem prop="nodeName" :required="true">
             <InputPop v-model="nodeData.nodeName" ref="nodeName"/>
@@ -58,8 +57,8 @@
                          @ok="chooseJudgeGradeIds"
                          :default-value="judgeGradeDefaultValue"
                          :check-auto-set-main-field="false"
-                         :type="this.$config.MagnifierType.judgeGrade"
-                         :other-condition="{flgValid: true,notInGradeKinds:[this.$config.gradeKind.damage]}"/>
+                         :type="$config.MagnifierType.judgeGrade"
+                         :other-condition="{flgValid: true,notInGradeKinds:[$config.gradeKind.damage],gradeTypes:[nodeData.nodeKind]}"/>
           </DkFormItem>
           <!--    工号类型    -->
           <DkFormItem prop="userKind" :required="true" v-if="nodeControl?.userKind?.visible">
@@ -111,7 +110,7 @@
           </DkFormItem>
         </DkForm>
         <!--   tab2 - 缺陷设置    -->
-        <DkForm ref="formInline-tab2" v-if="currentTab =='tab2'" v-model="nodeData" :label-max-words="6" :colCount="2">
+        <DkForm ref="formInline" v-if="currentTab =='tab2'" v-model="nodeData" :label-max-words="6" :colCount="2">
           <!--    产生缺陷    -->
           <DkFormItem prop="flgJobDefect" v-if="nodeControl?.jobDefectTable?.visible"
                       :info="$config.nodeInfo.flgJobDefect">
@@ -120,7 +119,7 @@
           </DkFormItem>
         </DkForm>
         <!--   tab3 - 高级属性    -->
-        <DkForm ref="formInline-tab3" v-if="currentTab =='tab3'" v-model="nodeData" :label-max-words="6" :colCount="2">
+        <DkForm ref="formInline" v-if="currentTab =='tab3'" v-model="nodeData" :label-max-words="6" :colCount="2">
           <!--    工艺类别    -->
           <DkFormItem prop="techType" :data-type="$config.dataType.number">
             <SelectPop ref="techType" v-model="nodeData.techType" label-key="dataValue" value-key="dataId"
@@ -173,17 +172,13 @@
           <!--    返回分级    -->
           <DkFormItem prop="backGradeIds"
                       v-if="nodeControl?.backGradeIds?.visible && ([$config.nodeKind.halfCheck,$config.nodeKind.finishCheck].includes(nodeData.nodeKind)&&nodeData.flgAloneJudge)"
-                      :required="[$config.nodeKind.halfCheck,$config.nodeKind.finishCheck].includes(nodeData.nodeKind)&&nodeData.flgAloneJudge"
                       :data-type="$config.dataType.array">
-            <!--          <SelectPop ref="backGradeIds" v-model="nodeData.backGradeIds" label-key="gradeName" value-key="gradeId"-->
-            <!--                     :disabled="!([$config.nodeKind.halfCheck,$config.nodeKind.finishCheck].includes(nodeData.nodeKind)&&nodeData.flgAloneJudge)"-->
-            <!--                     :multiple="true" :options="productGradeList"/>-->
             <SelectPop ref="backGradeIds" v-model="nodeData.backGradeIds" label-key="gradeName" value-key="gradeId"
-                       :multiple="true" :options="productGradeList"/>
+                       :multiple="true" :options="productGradeList" />
           </DkFormItem>
         </DkForm>
         <!--   tab4 - 流程控制    -->
-        <DkForm ref="formInline-tab4" v-if="currentTab =='tab4'" v-model="nodeData" :label-max-words="6" :colCount="2">
+        <DkForm ref="formInline" v-if="currentTab =='tab4'" v-model="nodeData" :label-max-words="6" :colCount="2">
           <!--    成型标签    -->
           <DkFormItem prop="moldingSysTags" v-if="nodeControl?.moldingSysTags?.visible" :span="12">
             <SelectPop ref="moldingSysTags" v-model="nodeData.moldingSysTags" label-key="kindName" value-key="kindCode"
@@ -196,9 +191,9 @@
           <div v-if="currentTab =='tab1'">
             <!--    生产工号    -->
             <EditTable ref="productUserTable" :title='"生产工号"' :titleInfo='"未设置代表有数据采集权限的用户都可以作为此工序生产工号"'
-                       :data="nodeData.userList.filter(it=>it.userKind==$config.userKind.product)"
+                       :data="productUserList"
                        v-if="nodeControl?.userTable?.visible&&productUserTableFlag"
-                       :columns="userColumns_noKind"
+                       :columns="userColumns"
                        enabledRepeatId="userId"
                        :height="200"
                        controlId="userId"
@@ -206,9 +201,9 @@
                        :show-setting-flag="false"/>
             <!--    操作工号    -->
             <EditTable ref="operateUserTable" :title='"操作工号"' :titleInfo='"未设置代表有数据采集权限的用户都可以操作此工序"'
-                       :data="nodeData.userList.filter(it=>it.userKind==$config.userKind.operate)"
+                       :data="operateUserList"
                        v-if="nodeControl?.userTable?.visible&&operateUserTableFlag&&nodeData.userKind==$config.userKind.operate"
-                       :columns="userColumns_noKind"
+                       :columns="userColumns"
                        enabledRepeatId="userId"
                        :height="200"
                        controlId="userId"
@@ -238,9 +233,9 @@
           <div v-if="currentTab =='tab3'">
             <!--    回收/检验设置    -->
             <EditTable ref="checkRecoverTable" :title='nodeData.nodeKind===$config.nodeKind.recover?"回收设置":"检验设置"'
-                       :data="nodeData.routerList"
-                       v-if="[$config.nodeKind.recover,$config.nodeKind.halfCheck,$config.nodeKind.finishCheck].includes(nodeData.nodeKind)"
-                       :columns="routerColumns"
+                       :data="checkRecoverRouterList"
+                       v-if="[$config.nodeKind.recover,$config.nodeKind.halfCheck,$config.nodeKind.finishCheck].includes(nodeData.nodeKind)&&checkRecoverTableFlag"
+                       :columns="nodeData?.backGradeIds?.length>0||nodeData.recycledKind==$config.recycledKind.before?checkRecoverColumns:checkRecoverColumns_noBack"
                        :controlId="'node1Id'"
                        :height="200"
                        :enabledRepeatId="['node1Id','backNodeId']"
@@ -258,10 +253,10 @@
                        :enabledRepeat="false"
                        :show-setting-flag="false"/>
             <!--    跨流程工序    -->
-            <!--          {{nodeData.routerType}}-->
-            <EditTable ref="routerTable" :title='"跨流程工序"' :data="nodeData.routerList"
+            <!--          {{nodeData.routeType}}-->
+            <EditTable ref="routerTable" :title='"跨流程工序"' :data="crossRouterList"
                        v-if="nodeControl?.routerTable?.visible&&routerTableFlag&&nodeData.recycledKind!==$config.recycledKind.before"
-                       :columns="routerColumns_noNode1AndBack"
+                       :columns="crossRouterColumns"
                        :controlId="'node2Id'"
                        :height="200"
                        :enabledRepeatId="'nodeId'"
@@ -272,13 +267,6 @@
         <!--            {{ nodeControl }}<br/>-->
         <!--            {{ allNodes }}<br/>-->
         <!--      {{nodeData.routerList}}<br/>-->
-<!--   todo 切换tab保存各list   -->
-<!--   todo 2个userList数据问题   -->
-<!--   todo 2个routerList数据问题   -->
-<!--   todo routerType切换的问题   -->
-<!--   todo 返回分级不为null时有返回工序列,null时,隐藏并清空   -->
-<!--   todo 返回工序(回收后处理方式为 后续流程 时,此列隐藏并清空)   -->
-<!--   todo 产品分级表【t_product_grade】增加了分级类型字段【grade_types】,半检时数据源为分级类型为null或【工艺节点-半检】,成检时数据源为分级类型为null或【工艺节点-成检】)   -->
 <!--   todo 可用窑炉【非必须,多选】   -->
 <!--   todo 校验问题,并跳转到对应tab   -->
 
@@ -328,6 +316,10 @@ export default {
   data() {
     let self = this
     return {
+      operateUserList:[],//操作工号集合
+      productUserList:[],///生产工号集合
+      crossRouterList:[],///生产工号集合
+      checkRecoverRouterList:[],//检验回收集合
       currentTab: 'tab1',
       judgeGradeDefaultValue: '',
       loading: false,
@@ -338,7 +330,7 @@ export default {
       jobDefectTableFlag: true,
       pdtTableFlag: true,
       routerTableFlag: true,
-      checkRecoverTable: true,
+      checkRecoverTableFlag: true,//检验/回收table
       modalDisplay: false,//如不定义此变量,则进入modal无动画
       split: 0.5,
       tableHeight: null,
@@ -347,44 +339,15 @@ export default {
       nodeData: {},//工序数据
       nodeDataSocial: {},// 工序数据(原始)
       nodeControl: {},//工序控制
-      tabsOptions: [//tabs选项
+      //tabs选项
+      tabsOptions: [
         { label: self.$t('basic_info'), name: 'tab1' },
         { label: self.$t('defect_setting'), name: 'tab2' },
         { label: self.$t('advanced_attribute'), name: 'tab3' },
         { label: self.$t('flow_control'), name: 'tab4' },
       ],
-      userColumns: [
-        {
-          field: 'userCode',
-          type: 'tableSelect',
-          controlId: 'userId',
-          param: () => {
-            return { userType: self.$config.userType.workTeam }
-          },
-          sortBoolean: false,
-          dataType: self.$config.tableSelectType.user,
-          fieldUpdate: self.$updateColumns.processNodeChooseUser,
-          searchDetailFlag: false,
-          width: 'auto',
-        },
-        { field: 'userName', type: 'disabled', width: 'auto' },
-        {
-          field: 'userKind',
-          type: 'select',
-          options: () => self.dataKindList.filter(it => it.kindType === '节点工号')
-            .filter(it => !(self.nodeData.userKind == self.$config.userKind.product && it.kindCode == self.$config.userKind.operate)),
-          labelKey: 'kindName',
-          valueKey: 'kindCode',
-          fieldUpdate: [
-            { updateField: 'userKind', valueFiled: 'kindName' },
-          ],
-          searchDetailFlag: false,
-          width: 'auto',
-        },
-        { field: 'remarks', type: 'text', width: 'auto' },
-      ],
       // 不包括工号类型
-      userColumns_noKind: [
+      userColumns: [
         {
           field: 'userCode',
           type: 'tableSelect',
@@ -483,10 +446,9 @@ export default {
         { field: 'remarks', type: 'text', width: 'auto' },
       ],
       //router_type=2/3
-      routerColumns: [
+      checkRecoverColumns: [
         {
           field: 'node1Id',
-          // title: () => self.nodeData.nodeKind===self.$config.nodeKind.recover?'报废前工序':'可检验工序',
           type: 'select',
           controlId: 'node1Id',
           options: () => self.allNodes.filter(it => !it.flgAloneJudge && it.id != self.process.currentNodeId),
@@ -524,8 +486,40 @@ export default {
         },
         { field: 'remarks', type: 'text', width: 'auto' },
       ],
+      checkRecoverColumns_noBack: [
+        {
+          field: 'node1Id',
+          type: 'select',
+          controlId: 'node1Id',
+          options: () => self.allNodes.filter(it => !it.flgAloneJudge && it.id != self.process.currentNodeId),
+          labelKey: 'name',
+          valueKey: 'id',
+          width: 'auto'
+        },
+        {
+          field: 'productGrade',
+          type: 'select',
+          options: () => self.nodeData.nodeKind === self.$config.nodeKind.recover ?
+            self.productGradeList.filter(it => [self.$config.gradeKindType.decrease, self.$config.gradeKindType.inferior].includes(it.gradeKind))
+            : self.productGradeList.filter(it => ![self.$config.gradeKindType.decrease, self.$config.gradeKindType.inferior].includes(it.gradeKind)),
+          labelKey: 'gradeName',
+          valueKey: 'gradeId',
+          multiple: true,
+          width: 'auto'
+        },
+        {
+          field: 'moldingSysTags',
+          type: 'select',
+          options: () => self.moldingSysTagsList,
+          labelKey: 'kindName',
+          valueKey: 'kindCode',
+          multiple: true,
+          width: 'auto'
+        },
+        { field: 'remarks', type: 'text', width: 'auto' },
+      ],
       //router_type=4
-      routerColumns_noNode1AndBack: [
+      crossRouterColumns: [
         {
           field: 'node2IdName',
           selectField: 'nodeName',
@@ -582,25 +576,20 @@ export default {
       techTypeList: [],//工艺类别
     }
   },
-  methods: {
-    ...mapMutations(['setProcessNodeModalDisplay', 'setCurrentNodeId']),
-    /**
-     * @desc   : 处理跨流程工序类别 1:画面中连线 2:到达检验工序的设置 3:回收工序设置 4:跨流程设置
-     * @author : 张潇木
-     * @date   : 2023/3/31 14:11
-     */
-    handleRouterType() {
-      if (this.nodeData.flowKind === this.$config.flowKind.end) {
-        this.nodeControl.routerTable.visible = false
-      }
-      this.nodeData.routerType = 4
-      if ([this.$config.nodeKind.halfCheck, this.$config.nodeKind.finishCheck].includes(this.nodeData.nodeKind) && this.nodeData.flgAloneJudge) {
-        this.nodeData.routerType = 2
-      }
-      if (this.$config.recycledKind.before === this.nodeData.recycledKind && this.nodeData.nodeKind === this.$config.nodeKind.recover) {
-        this.nodeData.routerType = 3
+  watch: {
+    //监听返回分级,处理检验table
+    'nodeData.backGradeIds'(n, o){
+      if(!n||!o||n.isEmptyArray()||o.isEmptyArray()){
+        this.checkRecoverRouterList = []
+        this.checkRecoverTableFlag=false
+        this.$nextTick(() => {
+          this.checkRecoverTableFlag=true
+        })
       }
     },
+  },
+  methods: {
+    ...mapMutations(['setProcessNodeModalDisplay', 'setCurrentNodeId']),
     /**
      * @desc   : 处理可判定分级初始值
      * @author : 张潇木
@@ -669,19 +658,20 @@ export default {
       this.$nextTick(() => {
         this.routerTableFlag = !this.routerTableFlag
       })
-      this.checkRecoverTable = !this.checkRecoverTable
+      this.checkRecoverTableFlag = !this.checkRecoverTableFlag
       this.$nextTick(() => {
         //重新渲染回收/检验设置table列名
-        if (e == 'tab3' && [this.$config.nodeKind.recover, this.$config.nodeKind.halfCheck, this.$config.nodeKind.finishCheck].includes(this.nodeData.nodeKind)) {
+        if (e == 'tab3' &&this.$refs.checkRecoverTable
+          && [this.$config.nodeKind.recover, this.$config.nodeKind.halfCheck, this.$config.nodeKind.finishCheck].includes(this.nodeData.nodeKind)) {
           let columnTile = this.nodeData.nodeKind === this.$config.nodeKind.recover ? '报废前工序' : '可检验工序'
           this.$refs.checkRecoverTable.changeColumnTitle('node1Id', columnTile)
         }
-        this.checkRecoverTable = !this.checkRecoverTable
+        this.checkRecoverTableFlag = !this.checkRecoverTableFlag
       })
       //endregion
 
       //设置表单数据
-      this.setFormData()
+      this.setTableData()
     },
     /**
      * @desc   : 改变操作模式
@@ -712,15 +702,8 @@ export default {
     changeFlgAloneJudge(e) {
       if (!e) {
         this.nodeData.backGradeIds = undefined
-        this.nodeData.routerType = 4
-      } else {
-        this.nodeData.routerType = 2
       }
-      this.nodeData.routerList = []
-      this.routerTableFlag = !this.routerTableFlag
-      this.$nextTick(() => {
-        this.routerTableFlag = !this.routerTableFlag
-      })
+      this.checkRecoverRouterList = []
       this.$refs['formInline'].clearValidate()
     },
     /**
@@ -729,19 +712,11 @@ export default {
      * @date   : 2023/4/4 13:12
      */
     changeRecycledKind(e) {
-      // if(e===this.$config.recycledKind.before){
-      //   this.nodeData.routerType=3
-      // }else{
-      //   this.nodeData.routerType=4
-      // }
-      this.nodeData.routerList = []
-      this.routerTableFlag = !this.routerTableFlag
-      this.$nextTick(() => {
-        this.routerTableFlag = !this.routerTableFlag
-      })
+      this.checkRecoverRouterList = []
+      this.nodeData.routerList=this.nodeData.routerList.filter(it=>it.routeType!=this.$config.routeType.recover)
     },
     /**
-     * @desc   : 选择流程工序
+     * @desc   : todo 选择流程工序
      * @author : 周兴
      * @date   : 2023/3/15 16:25
      */
@@ -777,7 +752,7 @@ export default {
     changeUserKind(e) {
       //当切换到生产工号时,删除userTable中设置的操作工号
       if (e == this.$config.userKind.product) {
-        this.nodeData.userList =this.nodeData.userList.filter(it=>it.userKind==this.$config.userKind.product)
+        this.nodeData.userList =this.nodeData.userList?.filter(it=>it.userKind==this.$config.userKind.product)
       }
     },
     /**
@@ -817,7 +792,7 @@ export default {
      */
     setParams() {
       // 设置表单数据
-      this.setFormData()
+      this.setTableData()
 
       // region 设置图形业务数据
       //根据工序id获取工序数据
@@ -852,18 +827,18 @@ export default {
 
     },
     /**
-     * @desc   : 设置表单数据
+     * @desc   : 设置表单数据 - 判断当前哪些table存在,不存在的table 不需要重新设置数据
      * @author : 张潇木
      * @date   : 2023/5/30 17:19
      */
-    setFormData(){
-      //判断当前哪些table存在,不存在的table 不需要重新设置数据
-      //操作工号
+    setTableData(){
+
+      //region操作工号
       if(this.$refs.operateUserTable){
         //将原操作工号删除
-        this.nodeData.userList =this.nodeData.userList.filter(it=>it.userKind!==this.$config.userKind.operate)
+        this.nodeData.userList =this.nodeData?.userList?.filter(it=>it.userKind!==this.$config.userKind.operate)||[]
         //取新的操作工号
-        let operateUserList = this.$refs?.operateUserTable?.getTableDataFilter().map((it, index) => {
+        this.operateUserList = this.$refs?.operateUserTable?.getTableDataFilter().map((it, index) => {
           return {
             flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
             nodeId: this.process.currentNodeId,
@@ -875,16 +850,19 @@ export default {
             remarks: it.remarks,
             ftyId: this.$store.state.user.ftyId
           }
-        })
+        })||[]
         //增加到userList中
-        this.nodeData.userList=[...this.nodeData.userList,...operateUserList]
+        this.nodeData.userList=[...this.nodeData.userList,...this.operateUserList]
+
       }
-      //生产工号
+      //endregion
+
+      //region生产工号
       if(this.$refs.productUserTable){
         //将原操作工号删除
-        this.nodeData.userList =this.nodeData.userList.filter(it=>it.userKind!==this.$config.userKind.product)
+        this.nodeData.userList =this.nodeData?.userList?.filter(it=>it.userKind!==this.$config.userKind.product)||[]
         //取新的生产工号
-        let productUserList = this.$refs?.productUserTable?.getTableDataFilter().map((it, index) => {
+        this.productUserList = this.$refs?.productUserTable?.getTableDataFilter().map((it, index) => {
           return {
             flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
             nodeId: this.process.currentNodeId,
@@ -896,11 +874,14 @@ export default {
             remarks: it.remarks,
             ftyId: this.$store.state.user.ftyId
           }
-        })
+        })||[]
         //增加到userList中
-        this.nodeData.userList=[...this.nodeData.userList,...productUserList]
+        this.nodeData.userList=[...this.nodeData.userList,...this.productUserList]
+
       }
-      //工序在制品
+      //endregion
+
+      //region工序在制品
       if(this.$refs.pdtTable){
         this.nodeData.pdtList = this.$refs?.pdtTable?.getTableDataFilter().map((it) => {
           return {
@@ -916,7 +897,9 @@ export default {
         })
         this.nodeData.cntPdtModel = this.nodeData.pdtList?.length  // 在制品型号数量
       }
-      //载具
+      //endregion
+
+      //region载具
       if(this.$refs.carTable){
         this.nodeData.carList = this.$refs?.carTable?.getTableDataFilter().map((it) => {
           return {
@@ -931,7 +914,9 @@ export default {
         })
         this.nodeData.cntCarModel = this.nodeData.carList?.length  // 可用载具数量
       }
-      //缺陷
+      //endregion
+
+      //region缺陷
       if(this.$refs.defectTable){
         this.nodeData.defectList = this.$refs?.defectTable?.getTableDataFilter().map((it) => {
         return {
@@ -947,13 +932,16 @@ export default {
       })
         this.nodeData.cntQuyDefect = this.nodeData.defectList?.length  // 可检缺陷数量
       }
-      //工种缺陷
+      //endregion
+
+      //region工种缺陷
       if(this.$refs.jobDefectTable) {
         this.nodeData.jobDefectList = this.$refs?.jobDefectTable?.getTableDataFilter().map((it) => {
           return {
             flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
             nodeId: this.process.currentNodeId,
             jobId: it.jobId,
+            jobId_Name:it.jobId_Name,
             pdtDefectId: it.pdtDefectId,
             defectCode: it.defectCode,
             defectName: it.defectName,
@@ -964,12 +952,40 @@ export default {
         })
         this.nodeData.cntJobDefect = this.nodeData.flgJobDefect ? this.nodeData.jobDefectList?.length : -1  // 工种缺陷数量,产生缺陷为true时设置成 -1
       }
-      //跨流程工序
+      //endregion
+
+      //region检验/回收设置
+      if(this.$refs.checkRecoverTable) {
+        //将原检验/回收设置删除
+        this.nodeData.routerList =this?.nodeData?.routerList?.filter(it=>it.routeType==this.$config.routeType.cross)||[]
+        //取新的检验/回收设置
+        this.checkRecoverRouterList = this.$refs?.checkRecoverTable?.getTableDataFilter().map((it) => {
+          return {
+            routeType: this.nodeData.nodeKind===this.$config.nodeKind.recover?this.$config.routeType.recover:this.$config.routeType.check,
+            flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
+            nodeId: this.process.currentNodeId,
+            node1Id: it.node1Id,
+            node2Id: this.process.currentNodeId,
+            backNodeId: it.backNodeId,
+            productGrade: it.productGrade,
+            moldingSysTags: it.moldingSysTags,
+            remarks: it.remarks,
+            ftyId: this.$store.state.user.ftyId
+          }
+        })||[]
+        //增加到routerList中
+        this.nodeData.routerList=[...this.nodeData.routerList,...this.checkRecoverRouterList]
+      }
+      //endregion
+
+      //region跨流程工序
       if(this.$refs.routerTable) {
-        this.nodeData.routerList = this.$refs?.routerTable?.getTableDataFilter().map((it) => {
-          if (this.nodeData.routerType === 4) {
+        //将原跨流程工序删除
+        this.nodeData.routerList =this.nodeData?.routerList?.filter(it=>it.routeType!==this.$config.routeType.cross)||[]
+        //取新的跨流程工序
+        this.crossRouterList = this.$refs?.routerTable?.getTableDataFilter().map((it) => {
             return {
-              routeType: this.nodeData.routerType,
+              routeType: this.$config.routeType.cross,
               flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
               nodeId: this.process.currentNodeId,
               node1Id: this.process.currentNodeId,
@@ -980,22 +996,12 @@ export default {
               remarks: it.remarks,
               ftyId: this.$store.state.user.ftyId
             }
-          } else {
-            return {
-              routeType: this.nodeData.routerType,
-              flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
-              nodeId: this.process.currentNodeId,
-              node1Id: it.node1Id,
-              node2Id: this.process.currentNodeId,
-              backNodeId: it.backNodeId,
-              productGrade: it.productGrade,
-              moldingSysTags: it.moldingSysTags,
-              remarks: it.remarks,
-              ftyId: this.$store.state.user.ftyId
-            }
-          }
-        })
+        })||[]
+        //增加到routerList中
+        this.nodeData.routerList=[...this.nodeData.routerList,...this.crossRouterList]
       }
+      //endregion
+
     },
     /**
      * @desc   : 校验数据
@@ -1099,7 +1105,21 @@ export default {
       // 工艺类别
       this.techTypeList = this.dictionaryDataList.filter(it => it.dictCode === this.$config.dictType.techType)
     },
-
+    /**
+     * @desc   : 设置table初始值
+     * @author : 张潇木
+     * @date   : 2023/5/31 10:06
+     */
+    handleTableDefaultValue() {
+      //操作工号
+      this.operateUserList=this.nodeData?.userList?.filter(it=>it.userKind==this.$config.userKind.operate)
+      //生产工号
+      this.productUserList=this.nodeData?.userList?.filter(it=>it.userKind==this.$config.userKind.product)
+      //跨工序流程
+      this.crossRouterList=this.nodeData?.routerList?.filter(it=>it.routeType==this.$config.routeType.cross)
+      //检验/回收设置
+      this.checkRecoverRouterList=this.nodeData?.routerList?.filter(it=>it.routeType!==this.$config.routeType.cross)
+    }
 
   },
   created() {
@@ -1113,7 +1133,7 @@ export default {
     // //刷新工序属性控制
     this.nodeControl = this.dataKindList.find(it => it.kindCode === this.nodeData.nodeKind)?.kindTags
     // //处理跨流程工序类别
-    this.handleRouterType()
+    // this.handleRouterType()
     // //过滤调工序组并将json解构成新结构数组
     this.allNodes = this.graph.getNodes().filter(it => it.shape == 'custom-image').map((it) => {
       return {
@@ -1124,8 +1144,10 @@ export default {
         flgAloneJudge: it.data.flgAloneJudge
       }
     })
-    //设置初始值
+    //设置系统基础数据初始值
     this.handleDataKindList()
+    //设置table初始值
+    this.handleTableDefaultValue()
     this.loading = false
   },
   mounted() {
@@ -1139,8 +1161,7 @@ export default {
   },
   beforeDestroy() {
     this.existsFlag = null
-  }
-
+  },
 }
 </script>
 

+ 11 - 0
src/config/index.js

@@ -2042,6 +2042,17 @@ export default {
     mold: "节点标签-成型交接",
     check: "节点标签-成检交接",
   },
+  /**
+   * @desc   : 路由类别
+   * @author : 张潇木
+   * @date   : 2023/5/31 10:27
+   */
+  routeType:{
+    line:1,//画布中实际存在的线
+    check:2,//检验
+    recover:3,//回收
+    cross:4,//跨工序
+  }
 }
 
 

+ 14 - 0
src/libs/tools/array-tools.js

@@ -283,5 +283,19 @@ Array.prototype.getRepeatItem = function (objFlag) {
   return tmp;
 };
 
+/**
+ * @desc   : 判断是否为空数组
+ * @author : 张潇木
+ * @date   : 2023/5/31 15:44
+ */
+Array.prototype.isEmptyArray = function () {
+  if(Array.prototype.isPrototypeOf(this)&&this.length === 0){
+    return true
+  }else{
+    return false
+  }
+
+}
+