From 847696329faa795077d966845f37b88fbd3a2cdc Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期二, 21 五月 2024 16:33:28 +0800
Subject: [PATCH] 2023-5-21 selOutBatchNo接口 质量的过程检验,新增不触发接口,编辑或者查看才触发 与 追溯select切换只显示第一条数据问题

---
 src/views/product/producttraceability/index.vue |  268 ++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 192 insertions(+), 76 deletions(-)

diff --git a/src/views/product/producttraceability/index.vue b/src/views/product/producttraceability/index.vue
index 7c3f3d5..437b369 100644
--- a/src/views/product/producttraceability/index.vue
+++ b/src/views/product/producttraceability/index.vue
@@ -10,6 +10,7 @@
                 :data="partList"
                 :formatter="labelFormatter"
                 :selectLoading="selectLoading"
+                ref="systemSelect"
                 :valueColumn="valueColumn"
                 @selectChange="queryBatchNoData"
                 @remoteSearch="queryPart"
@@ -23,14 +24,14 @@
         </el-row>
 
       </div>
-      <div style="margin-left:20px;">
+      <!-- <div style="margin-left:20px;">
         <el-radio v-model="traceType" label="posite" @change="changeTraceType"
           >鍙嶅悜杩芥函</el-radio
         >
         <el-radio v-model="traceType" label="negate" @change="changeTraceType"
           >姝e悜杩芥函</el-radio
         >
-      </div>
+      </div> -->
     </div>
     <div class="product-traceability-body-div">
       <div class="product-traceability-relationship-div">
@@ -272,10 +273,10 @@
                   <div>宸ヤ綔绔欙細</div>
                   <div>鎶ュ伐鍗曞彿锛�</div>
                   <div>鎶ュ伐浜哄憳锛�</div>
-                  <div>浜у搧缂栧彿锛�</div>
+                  <div>鎵规鍙凤細</div>
                   <div>闆朵欢鍙凤細</div>
                   <div>鍗曚綅锛�</div>
-                  <div>浜у嚭鏁伴噺锛�</div>
+
                 </div>
                 <div class="product-traceability-producttracking-val-div">
                   <div :title="currProductTracking.workstationName">
@@ -290,7 +291,6 @@
                     {{ currProductTracking.partNo }}
                   </div>
                   <div>{{ currProductTracking.unit }}</div>
-                  <div>{{ currProductTracking.productQty }}</div>
                 </div>
               </div>
               <div class="product-traceability-producttracking-item-div">
@@ -298,19 +298,21 @@
                   <div>鐝粍锛�</div>
                   <div>姹囨姤宸ュ簭锛�</div>
                   <div>姹囨姤鏃堕棿锛�</div>
-                  <div>鎵瑰彿锛�</div>
+                  <!-- <div>鎵瑰彿锛�</div> -->
                   <div>闆朵欢鎻忚堪锛�</div>
                   <div>鐢熶骇鏃ユ湡锛�</div>
+                  <div>浜у嚭鏁伴噺锛�</div>
                 </div>
                 <div class="product-traceability-producttracking-val-div">
                   <div>{{ currProductTracking.crewName }}</div>
                   <div>{{ currProductTracking.operationName }}</div>
                   <div>{{ currProductTracking.trackingTime }}</div>
-                  <div>{{ currProductTracking.systemNo }}</div>
+                  <!-- <div>{{ currProductTracking.systemNo }}</div> -->
                   <div :title="currProductTracking.partName">
                     {{ currProductTracking.partName }}
                   </div>
                   <div>{{ currProductTracking.productDate }}</div>
+                  <div>{{ currProductTracking.productQty }}</div>
                 </div>
               </div>
             </div>
@@ -342,8 +344,111 @@
             </div>
           </el-tab-pane> -->
           <el-tab-pane label="妫�娴嬩俊鎭�" name="妫�娴嬩俊鎭�">
-            <div style="margin-top:10px;">
-              <el-tabs type="card">
+            <div style="margin-top:10px;height: 80vh;overflow-y: scroll;">
+                <div class="process" v-if="process">
+                    <el-divider
+                    class="pane-divider"
+                    direction="vertical"
+                    ></el-divider>
+                    <span style="font-size:14px;font-weight:bold"
+                    >杩囩▼妫�</span>
+                    <div style="font-size: 12px;margin-top: 10px;margin-left: 10px;">鏍峰搧鍚嶏細<span style="font-weight: 700;">{{process.sampleName}}</span></div>
+                    <el-table
+                    stripe
+                    :data="process.sampleItem"
+                    :height="paramsTableHeight"
+                    :header-cell-style="paramsTableHeaderStyle0"
+                    :row-class-name="tableRowClassName"
+                    class="taskinfo-params-table"
+                    style="margin: 10px;width: 95%;"
+                  >
+                    <el-table-column
+                      prop="father"
+                      label="椤圭洰"
+                      align="center"
+                      min-width="75px"
+                    />
+                    <el-table-column
+                      prop="name"
+                      label="鎸囨爣"
+                      align="center"
+                      min-width="100px"
+                    />
+                    <el-table-column
+                      prop="result"
+                      label="缁撴灉"
+                      align="center"
+                      min-width="60px"
+                    >
+                      <template slot-scope="scope">
+                        {{
+                          scope.row.isQualified == 0
+                            ? '涓嶅悎鏍�'
+                            : (scope.row.isQualified==1?'鍚堟牸':'')
+                        }}
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                      prop="userName"
+                      label="妫�楠屼汉"
+                      align="center"
+                      min-width="90px"
+                    />
+                  </el-table>
+                </div>
+                <div class="product" v-if="finished" :class="{checkMore:process}">
+                    <el-divider
+                    class="pane-divider"
+                    direction="vertical"
+                    ></el-divider>
+                    <span style="font-size:14px;font-weight:bold"
+                    >浜у搧妫�</span>
+                    <div style="font-size: 12px;margin-top: 10px;margin-left: 10px;">鏍峰搧鍚嶏細<span style="font-weight: 700;">{{finished.sampleName}}</span></div>
+                    <el-table
+                    stripe
+                    :data="finished.sampleItem"
+                    :height="paramsTableHeight"
+                    :header-cell-style="paramsTableHeaderStyle0"
+                    :row-class-name="tableRowClassName"
+                    class="taskinfo-params-table"
+                    style="margin: 10px;width: 95%;"
+                  >
+                    <el-table-column
+                      prop="father"
+                      label="椤圭洰"
+                      align="center"
+                      min-width="75px"
+                    />
+                    <el-table-column
+                      prop="name"
+                      label="鎸囨爣"
+                      align="center"
+                      min-width="100px"
+                    />
+                    <el-table-column
+                      prop="result"
+                      label="缁撴灉"
+                      align="center"
+                      min-width="60px"
+                    >
+                      <template slot-scope="scope">
+                        {{
+                          scope.row.isQualified == 0
+                            ? '涓嶅悎鏍�'
+                            : (scope.row.isQualified==1?'鍚堟牸':'')
+                        }}
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                      prop="userName"
+                      label="妫�楠屼汉"
+                      align="center"
+                      min-width="90px"
+                    />
+                  </el-table>
+                </div>
+                <!-- <p v-show="!process&&!finished">鏆傛棤鏁版嵁</p> -->
+              <!-- <el-tabs type="card">
                 <el-tab-pane
                   v-for="(item, index) in checkItemList"
                   :key="item.reportTypeLabel"
@@ -422,30 +527,12 @@
                     </el-table-column>
                   </el-table>
                 </el-tab-pane>
-                <!--<el-tab-pane label="闄勪欢">
-                  <el-upload
-                    drag
-                    ref="upload"
-                    action="/mes/reportSample/upload"
-                    :headers="headers"
-                    :auto-upload="true"
-                    :file-list="fileList"
-                    list-type="text"
-                    :on-preview="handlePreview"
-                    :with-credentials="true"
-                  >
-                    <i class="el-icon-upload"></i>
-                    <div class="el-upload__text">
-                      灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em>
-                    </div>
-                  </el-upload>
-                </el-tab-pane>-->
-              </el-tabs>
+              </el-tabs> -->
             </div>
           </el-tab-pane>
           <el-tab-pane label="鐢熶骇璁板綍" name="鐢熶骇璁板綍">
             <div style="margin-top:10px;">
-              <div style="padding:0px 14px;height: 100%;overflow: auto;">
+              <div style="padding:0px 14px;height: 80vh !important;overflow: auto;">
                 <div class="product-record-div">
                   <div class="product-record-div-left">
                     <div class="product-record-list-header">
@@ -545,7 +632,7 @@
                             </el-table-column>
                           </el-table>
                         </el-tab-pane>
-                        <el-tab-pane label="闄勪欢">
+                        <!-- <el-tab-pane label="闄勪欢">
                           <el-upload
                             ref="upload"
                             action="/mes/operationTask/upload"
@@ -555,7 +642,7 @@
                             :auto-upload="false"
                             list-type="picture"
                           ></el-upload
-                        ></el-tab-pane>
+                        ></el-tab-pane> -->
                       </el-tabs>
                     </div>
                   </div>
@@ -667,7 +754,7 @@
               </el-tabs>
             </div>
           </el-tab-pane>
-          <el-tab-pane label="妯″叿淇℃伅" name="妯″叿淇℃伅">
+          <!-- <el-tab-pane label="妯″叿淇℃伅" name="妯″叿淇℃伅">
             <div style="margin-top:10px;">
               <el-table
                 ref="mouldRecordTable"
@@ -772,7 +859,7 @@
                 </el-table-column>
               </el-table>
             </div>
-          </el-tab-pane>
+          </el-tab-pane> -->
         </el-tabs>
       </div>
     </div>
@@ -980,6 +1067,9 @@
 .taskinfo-params-table >>> td {
   padding: 3px 0px;
 }
+.checkMore{
+    margin-top: 20px;
+}
 </style>
 <script>
 import {
@@ -1128,7 +1218,9 @@
       traceType: 'posite',
       reportTypeOptions: [],
       checkItemList: [],
-      mouldRecordList: []
+      mouldRecordList: [],
+      finished:null,
+      process:null
     }
   },
   mounted() {
@@ -1138,6 +1230,7 @@
   },
   methods: {
     queryBatchNoData(){
+        this.selBatchNo = null
         queryByCustomerOrderId({customerOrderId : this.systemNo}).then(res=>{
             if(res.status===200){
                 this.selBatchNoList = res.data.data
@@ -1213,7 +1306,7 @@
     },
     labelFormatter(ele) {
       let partLabel
-      const part = this.partList.find((item) => ele.systemNo === item.systemNo)
+      const part = this.partList.find((item) => ele.customerOrderId === item.customerOrderId)
       if (part !== undefined) {
         partLabel =
           '閿�鍞鍗曞彿锛�' +
@@ -1248,6 +1341,8 @@
       } else {
         this.partList = []
       }
+      this.selBatchNo = null
+      this.selBatchNoList = []
     },
     changePart() {
       if (this.selBatchNo != null && this.selBatchNo !== '') {
@@ -1261,15 +1356,15 @@
                 const hasOutNode = data.data.linkDataArray.find((ele) => {
                   return ele.from === item.key
                 })
-                item.batchNo = 'SN鍙�:' + item.batchNo
+                item.batchNo = '鎵规鍙�:' + item.batchNo
                 item.quantity =
                   '鎶曞叆鏁伴噺:' +
                   (hasOutNode ? item.quantity : 0) +
                   ' ' +
                   item.unit
-                item.ifsBatchNo =
-                  'IFS鎵规鍙�:' +
-                  (item.ifsBatchNo == null ? '' : item.ifsBatchNo)
+                // item.ifsBatchNo =
+                //   'IFS鎵规鍙�:' +
+                //   (item.ifsBatchNo == null ? '' : item.ifsBatchNo)
               })
               this.modelData = {
                 nodeDataArray: data.data.nodeDataArray,
@@ -1328,39 +1423,51 @@
                   _that.currProductTracking = {}
                 }
                 // 妫�娴嬩俊鎭�
-                const sampleItemList = data.data.sampleItems
-                if (sampleItemList != null && sampleItemList.length > 0) {
-                  _that.paramValues = sampleItemList
-                  _that.checkItemList = []
-                  sampleItemList.forEach((item) => {
-                    const reportTypeLabel = _that.reportTypeOptions.find(
-                      (el) => {
-                        return item.reportType == el.value
-                      }
-                    )
-                    if (reportTypeLabel) {
-                      const existCheckItem = _that.checkItemList.find(
-                        (checkItem) => {
-                          return (
-                            reportTypeLabel.label == checkItem.reportTypeLabel
-                          )
-                        }
-                      )
-                      if (existCheckItem) {
-                        existCheckItem.itemList.push(item)
-                      } else {
-                        _that.checkItemList.push({
-                          reportTypeLabel: reportTypeLabel.label,
-                          itemList: [item]
-                        })
-                      }
-                    }
-                  })
-                  // reportTypeOptions
-                } else {
-                  _that.paramValues = []
-                  _that.checkItemList = []
+                const sampleItems = data.data.sampleItems
+                // 妫�娴嬩俊鎭�-杩囩▼妫�
+                if(sampleItems&&sampleItems.process&&sampleItems.process.length>0){
+                    _that.process = sampleItems.process[0]
+                }else{
+                    _that.process = null
                 }
+                // 妫�娴嬩俊鎭�-浜у搧妫�
+                if(sampleItems&&sampleItems.finished&&sampleItems.finished.length>0){
+                    _that.finished = sampleItems.finished[0]
+                }else{
+                    _that.finished = null
+                }
+                // if (sampleItemList != null && sampleItemList.length > 0) {
+                //   _that.paramValues = sampleItemList
+                //   _that.checkItemList = []
+                //   sampleItemList.forEach((item) => {
+                //     const reportTypeLabel = _that.reportTypeOptions.find(
+                //       (el) => {
+                //         return item.reportType == el.value
+                //       }
+                //     )
+                //     if (reportTypeLabel) {
+                //       const existCheckItem = _that.checkItemList.find(
+                //         (checkItem) => {
+                //           return (
+                //             reportTypeLabel.label == checkItem.reportTypeLabel
+                //           )
+                //         }
+                //       )
+                //       if (existCheckItem) {
+                //         existCheckItem.itemList.push(item)
+                //       } else {
+                //         _that.checkItemList.push({
+                //           reportTypeLabel: reportTypeLabel.label,
+                //           itemList: [item]
+                //         })
+                //       }
+                //     }
+                //   })
+                //   // reportTypeOptions
+                // } else {
+                //   _that.paramValues = []
+                //   _that.checkItemList = []
+                // }
                 _that.currOperateTask = data.data.operationTask
                 if (_that.currOperateTask == null) {
                   _that.currOperateTask = {
@@ -1388,11 +1495,11 @@
                   _that.productRecordParamValues = []
                   _that.paramTabs = []
                 } else {
-                  // 宸ユ淇℃伅
-                  _that.getStepRecords({
-                    id: _that.currOperateTask.id,
-                    sn: nodeData.batchNo.split('SN鍙�:')[1]
-                  })
+                  // 宸ユ淇℃伅--鎶ラ敊娉ㄩ噴鎺変簡
+                //   _that.getStepRecords({
+                //     id: _that.currOperateTask.id,
+                //     sn: nodeData.batchNo.split('SN鍙�:')[1]
+                //   })
                   // 宸ヨ壓鍙傛暟淇℃伅
                   _that.queryTechnologyInfo(_that.currOperateTask.id)
                   // 鐢熶骇璁板綍
@@ -1612,6 +1719,15 @@
       }
       return headerStyle
     },
+    paramsTableHeaderStyle0({ row, column, rowIndex, columnIndex }) {
+      let headerStyle = 'background:#599ef4;color:#fff;'
+      if (columnIndex === 0) {
+        headerStyle += 'border-radius: 6px 0px 0px 0px;'
+      } else if (columnIndex === 3) {
+        headerStyle += 'border-radius: 0px 6px 0px 0px;'
+      }
+      return headerStyle
+    },
     tableRowClassName({ row, rowIndex }) {
       if (rowIndex % 2 === 1) {
         return 'stripe-row'

--
Gitblit v1.9.3