ysy пре 1 година
родитељ
комит
a975b7ef71

+ 47 - 9
src/views/productionPlan/components/unpackDetails.vue

@@ -8,12 +8,39 @@
     :title="title"
   >
     <div class="form-wrapper">
+      <headerTitle :title="type == 1 ? '原数据' : ''"> </headerTitle>
       <ele-pro-table
         ref="table"
         :needPage="false"
         :columns="columns"
         :datasource="List"
       >
+      <template v-slot:code="{ row }">
+          <el-link  :underline="false" >
+            {{ row.code }}
+          </el-link>
+        </template>
+
+      </ele-pro-table>
+
+
+      <headerTitle v-if="type == 1" title="拆批数据明细" class="mt20">
+      </headerTitle>
+      <ele-pro-table
+        v-if="type == 1"
+        ref="unpackTable"
+        :needPage="false"
+        :columns="columns"
+        :datasource="List[0].childList"
+      >
+
+      <template v-slot:code="{ row }">
+          <el-link v-if="rowObj.code == row.code" type="primary" :underline="false">
+            {{ row.code }}
+          </el-link>
+          <span v-else>  {{ row.code }}</span>
+        </template>
+      
       </ele-pro-table>
     </div>
   </ele-modal>
@@ -27,9 +54,16 @@
         visible: false,
 
         List: [],
+        rowObj: {},
         title: '',
+        type: 1
+      };
+    },
 
-        columns: [
+    computed: {
+      // 表格列配置
+      columns() {
+        return [
           {
             prop: 'batchNo',
             label: '批次号',
@@ -42,10 +76,10 @@
             prop: 'code',
             label: '计划编号',
             align: 'center',
-            minWidth: 200
+            minWidth: 200,
+            slot:'code'
           },
 
-
           {
             prop: 'productCode',
             label: '产品编码',
@@ -83,7 +117,6 @@
             showOverflowTooltip: true
           },
 
-
           {
             prop: 'produceRoutingName',
             label: '工艺路线',
@@ -103,13 +136,15 @@
             align: 'center',
             minWidth: 200
           }
-        ]
-      };
+        ];
+      }
     },
     methods: {
-      open(type, list) {
-        this.title = type === 1 ? '拆批详情' : '合批详情';
-        this.List = list;
+      open(type, row) {
+        this.type = type;
+        this.title = type == 1 ? '拆批详情' : '合批详情';
+        this.rowObj = row;
+        this.List = row.childList || [];
         this.visible = true;
       }
     }
@@ -120,4 +155,7 @@
   .form-wrapper {
     margin-bottom: 10px;
   }
+  .mt20 {
+    margin-top: 20px;
+  }
 </style>

+ 13 - 4
src/views/productionPlan/index.vue

@@ -37,10 +37,20 @@
         <template v-slot:batchNo="{ row }">
           <el-link type="primary" :underline="false">
             {{ row.batchNo }}
-            <el-tag type="success" size="mini" v-if="row.joinPlanCode" @click.stop="splitDetails(1, row)">
+            <el-tag
+              type="success"
+              size="mini"
+              v-if="row.joinPlanCode"
+              @click.stop="splitDetails(1, row)"
+            >
               拆</el-tag
             >
-            <el-tag type="danger" size="mini" v-if="row.splitBatch == 2" @click.stop="splitDetails(2, row)">
+            <el-tag
+              type="danger"
+              size="mini"
+              v-if="row.splitBatch == 2"
+              @click.stop="splitDetails(2, row)"
+            >
               和</el-tag
             >
           </el-link>
@@ -146,7 +156,6 @@
 
     <mergeDialog ref="mergeRef" @success="reload"></mergeDialog>
 
-
     <unpackDetails ref="DetailsRef"></unpackDetails>
   </div>
 </template>
@@ -639,7 +648,7 @@
       },
 
       splitDetails(type, row) {
-          this.$refs.DetailsRef.open(type, row.childList);
+        this.$refs.DetailsRef.open(type, row);
       },
 
       handleDelete({ id }) {