From c720c2a6eb50796876cae4b18b37b54e9a99ea60 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 09 十二月 2024 16:14:28 +0800
Subject: [PATCH] 电路试验互调数采

---
 src/components/do/b1-report-preparation/order.vue |  196 +++++++++++++++++++++++++++++-------------------
 1 files changed, 117 insertions(+), 79 deletions(-)

diff --git a/src/components/do/b1-report-preparation/order.vue b/src/components/do/b1-report-preparation/order.vue
index 2e76157..68887e7 100644
--- a/src/components/do/b1-report-preparation/order.vue
+++ b/src/components/do/b1-report-preparation/order.vue
@@ -38,58 +38,61 @@
       :append-to-body="true"
       :modal="!dialogVisible0"
       >
-      <span>璇烽�夋嫨濮旀墭缂栧彿涓� {{currentInfo.entrustCode}} 瑕佺敓鎴愮殑鏁版嵁</span>
-      <el-card class="box-card" style="margin-top: 16px;" v-for="(item,index) in historyList" :key="index">
-        <div slot="header" style="display: flex;justify-content: space-between;">
-          <span>{{ item.laboratory }}</span>
-          <!-- <el-checkbox v-model="item.checked"></el-checkbox> -->
-        </div>
-        <!-- <el-radio-group v-model="item.numValue" ref="radio">
-          <el-radio :label="m.value" v-for="(m,i) in item.arr" :key="i"><el-link type="primary" @click="lookDetail(item,m.value)">{{ m.label }}</el-link></el-radio>
-        </el-radio-group> -->
-        <el-table
-          :data="item.insOrderUserList"
-          border
-          style="width: 100%" @selection-change="list=>handleSelectionChange(list,item.insOrderUserList)">
-          <el-table-column
-            type="selection"
-            width="55">
-          </el-table-column>
-          <el-table-column
-            prop="submitTime"
-            label="鎻愪氦鏃ユ湡"
-            width="150">
-          </el-table-column>
-          <el-table-column
-            prop="submitUserName"
-            label="鎻愪氦浜�"
-            width="90">
-          </el-table-column>
-          <el-table-column
-            prop="term"
-            label="瀹為獙闃舵"
-            width="120">
-          </el-table-column>
-          <el-table-column
-            prop="note"
-            label="瀹為獙鎿嶄綔"
-            width="120">
-          </el-table-column>
-          <el-table-column
-            prop="tell"
-            label="鍐嶆妫�楠屽師鍥�"
-            width="120">
-          </el-table-column>
-          <el-table-column
-            fixed="right"
-            label="鎿嶄綔"
-            width="100">
-            <template slot-scope="scope">
-              <el-button @click="lookDetail(item,scope.row.num)" type="text" size="small">鏌ョ湅</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-      </el-card>
+      <span style="font-size: 16px;">璇烽�夋嫨濮旀墭缂栧彿涓� <span style="color: #3A7BFA">{{currentInfo.entrustCode}}</span> 瑕佺敓鎴愮殑鏁版嵁</span>
+      <div style="max-height: 75vh;overflow-y: auto;">
+        <template v-for="(a,b) in sampleList">
+          <el-divider></el-divider>
+          <p style="margin: 10px 0;font-weight: 700;">鏍峰搧锛�<el-tag size="small">{{a.insSample.sample}}</el-tag> &nbsp;&nbsp;&nbsp;&nbsp;鏍峰搧缂栧彿锛歿{a.insSample.sampleCode}}</p>
+          <el-card class="box-card" style="margin-top: 16px;" v-for="(item,index) in a.historyList" :key="index">
+            <div slot="header" style="display: flex;justify-content: space-between;">
+              <span>{{ item.laboratory }}</span>
+            </div>
+            <el-table
+              :data="item.insOrderUserList"
+              border
+              style="width: 100%" @selection-change="list=>handleSelectionChange(list,item.insOrderUserList)">
+              <el-table-column
+                type="selection"
+                width="55">
+              </el-table-column>
+              <el-table-column
+                prop="submitTime"
+                label="鎻愪氦鏃ユ湡"
+                min-width="150">
+              </el-table-column>
+              <el-table-column
+                prop="submitUserName"
+                label="鎻愪氦浜�"
+                min-width="90">
+              </el-table-column>
+              <el-table-column
+                prop="term"
+                label="瀹為獙闃舵"
+                min-width="120">
+              </el-table-column>
+              <el-table-column
+                prop="note"
+                label="瀹為獙鎿嶄綔"
+                min-width="120">
+              </el-table-column>
+              <el-table-column
+                prop="tell"
+                label="鍐嶆妫�楠屽師鍥�"
+                min-width="120">
+              </el-table-column>
+              <el-table-column
+                fixed="right"
+                label="鎿嶄綔"
+                min-width="100">
+                <template slot-scope="scope">
+                  <el-button @click="lookDetail(item,scope.row.num,a.insSample)" type="text" size="small">鏌ョ湅</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-card>
+          <p v-if="a.historyList.length==0" style="text-align: center;">鏆傛棤鍙敓鎴愮殑鏁版嵁</p>
+        </template>
+      </div>
       <span slot="footer" class="dialog-footer">
         <el-button :loading="loading0" @click="handleNoCreate">涓嶇敓鎴�</el-button>
         <el-button type="primary" @click="handleCreate" :loading="loading1">鐢� 鎴�</el-button>
@@ -100,7 +103,9 @@
       :visible.sync="dialogVisible0"
       width="100%" :fullscreen="true" :modal="false" :append-to-body="true">
       <Inspection v-if="dialogVisible0"
-      :orderId="currentInfo.id"
+      :orderId="sampleId"
+      :orderId0="orderId0"
+      :userInfo="{}"
       :inspectorList="currentItem.inspectorList"
       :sonLaboratory="currentItem.laboratory"
       :state="2"
@@ -131,7 +136,7 @@
           sampleModel: null,
           sampleCode: null,
           outEntrustCode: null,
-          state: 1,
+          state: 4,
           name:null,
           engineering:null,
           production:null,
@@ -212,7 +217,10 @@
       currentItem:{},
       loading0:false,
       loading1:false,
-      dialogVisible0:false
+      dialogVisible0:false,
+      sampleList:[],
+      sampleId:null,
+      orderId0:null,
     }
   },
   mounted() {
@@ -244,37 +252,65 @@
     handleCreateReport(row){
       this.currentInfo = row
       this.$axios.get(this.$api.insReport.getInsOrderStateCount+'?id='+row.id).then(res => {
-        this.historyList = res.data
-        this.historyList.forEach(item => {
-          item.arr = []
-          this.$set(item,'numValue',1)
-          // item.checked = false;
-          if(item.num>0){
-            for(var i=0;i<item.num;i++){
-              item.arr.push({
-                label:'璁板綍'+(i+1),
-                value:i+1
-              })
+        this.sampleList = res.data
+        this.sampleList.forEach(a=>{
+          a.historyList = a.insOrderStates
+          a.historyList.forEach(item => {
+            item.arr = []
+            this.$set(item,'numValue',1)
+            if(item.num>0){
+              for(var i=0;i<item.num;i++){
+                item.arr.push({
+                  label:'璁板綍'+(i+1),
+                  value:i+1
+                })
+              }
             }
-          }
+          })
         })
+        // this.historyList = res.data
+        // this.historyList.forEach(item => {
+        //   item.arr = []
+        //   this.$set(item,'numValue',1)
+        //   // item.checked = false;
+        //   if(item.num>0){
+        //     for(var i=0;i<item.num;i++){
+        //       item.arr.push({
+        //         label:'璁板綍'+(i+1),
+        //         value:i+1
+        //       })
+        //     }
+        //   }
+        // })
         this.dialogVisible = true
       })
     },
     // 鐢熸垚鎶ュ憡
     handleCreate(){
-      let arr = []
-      this.historyList.forEach(item => {
-        item.insOrderUserList.forEach(item1 => {
-          if(item1.state==1){
-            arr.push({
-              laboratory:item.laboratory,
-              num:item1.num
-            })
-          }
+      let insReportDto1s = []
+      let num = 0;
+      this.sampleList.forEach(a => {
+        let insReportDto2s = []
+        a.historyList.forEach(item => {
+          item.insOrderUserList.forEach(item1 => {
+            if(item1.state==1){
+              let obj0 = {
+                laboratory:item.laboratory,
+                num:item1.num,
+                insOrderUsersId:item1.id
+              }
+              insReportDto2s.push(obj0)
+              num++
+            }
+          })
         })
+        let obj0 = {
+          sampleId:a.insSample.id,
+          insReportDto2s:insReportDto2s
+        }
+        insReportDto1s.push(obj0)
       })
-      if(arr.length==0){
+      if(num==0){
         this.$message.error("璇峰厛閫夋嫨闇�瑕佺敓鎴愮殑璁板綍锛�")
         return
       }
@@ -282,7 +318,7 @@
       this.$axios.post(this.$api.insReport.isReport, {
         id:this.currentInfo.id,
         state:1,
-        insReportDto1s:arr
+        insReportDto1s:insReportDto1s
       },{
         headers: {
           'Content-Type': 'application/json'
@@ -320,12 +356,14 @@
       })
     },
     // 鏌ョ湅妫�楠岃鎯�
-    lookDetail(row,value){
+    lookDetail(row,value,insSample){
       this.dialogVisible0 = true
       let inspectorList = []
       if(row.userName){
         inspectorList = row.userName.split(',')
       }
+      this.sampleId = insSample.id
+      this.orderId0 = insSample.insOrderId
       this.currentItem = {
         num1:value,
         inspectorList:inspectorList,

--
Gitblit v1.9.3