From b352f095317a0cfe2cf695b4ad3898a9d4367651 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期三, 18 十二月 2024 15:49:03 +0800
Subject: [PATCH] 检验下单可查看检验数据

---
 src/view/notice.vue                               |   11 +++
 src/components/do/b1-report-preparation/order.vue |   14 ----
 src/components/view/b1-inspection-order.vue       |  127 +++++++++++++++++++++++++++++++++++++++++-
 src/components/view/index-index.vue               |   22 +++++--
 4 files changed, 149 insertions(+), 25 deletions(-)

diff --git a/src/components/do/b1-report-preparation/order.vue b/src/components/do/b1-report-preparation/order.vue
index 56024bb..e407b45 100644
--- a/src/components/do/b1-report-preparation/order.vue
+++ b/src/components/do/b1-report-preparation/order.vue
@@ -279,20 +279,6 @@
             }
           })
         })
-        // 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
       })
     },
diff --git a/src/components/view/b1-inspection-order.vue b/src/components/view/b1-inspection-order.vue
index 68f9b3f..5a5db44 100644
--- a/src/components/view/b1-inspection-order.vue
+++ b/src/components/view/b1-inspection-order.vue
@@ -377,6 +377,82 @@
 						:componentData="componentDataDataLook"/>
 				</div>
 			</el-dialog>
+      <!-- 鏂�-璺熸姤鍛婄敓鎴愮殑涓�鏍� -->
+      <el-dialog
+      title="鏁版嵁鏌ョ湅"
+      :visible.sync="lookDialogVisible"
+      width="60%"
+      :append-to-body="true"
+      :modal="!lookDialogVisible0"
+      >
+        <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%">
+                <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>
+      </el-dialog>
+      <el-dialog
+        title="妫�楠岃鎯�"
+        :visible.sync="lookDialogVisible0"
+        width="100%" :fullscreen="true" :modal="false" :append-to-body="true">
+        <Inspection v-if="lookDialogVisible0"
+        :orderId="sampleId"
+        :orderId0="orderId0"
+        :userInfo="{}"
+        :inspectorList="currentItem.inspectorList"
+        :sonLaboratory="currentItem.laboratory"
+        :state="2"
+        :orderStateId="currentItem.orderStateId"
+        :version="currentItem.version"
+        :isLook="true"
+        :num1="currentItem.num1"
+        :noBack="true"/>
+      </el-dialog>
       <el-dialog :title="deleteTilte" :visible.sync="deleteDialogVisible" width="80%">
 				<div style="height: 70vh;overflow-y: auto;" v-if="deleteDialogVisible">
 					<ValueTable ref="ValueTableDataDelete" :url="$api.insOrder.selectNoProducts+'?orderId='+orderId+'&ids='+this.revocationInsProductIds"
@@ -522,11 +598,13 @@
 <script>
 	import ValueTable from '../tool/value-table.vue'
 	import Add from '../do/b1-ins-order/add.vue'
+  import Inspection from '../do/b1-inspect-order-plan/Inspection.vue'
   import vueQr from 'vue-qr'
   import PrintJS from 'print-js'
 	export default {
 		components: {
 			ValueTable,
+      Inspection,
 			Add,
       vueQr
 		},
@@ -847,7 +925,14 @@
         BZDialogVisible:false,
         downVisible:false,
         downList:[],
-        formType:[]
+        formType:[],
+        currentInfo:{},
+        sampleList:[],
+        lookDialogVisible:false,
+        lookDialogVisible0:false,
+        sampleId:null,
+        orderId0:null,
+        currentItem:{},
 			}
 		},
     watch:{
@@ -1125,9 +1210,45 @@
 			},
 			// 鏁版嵁鏌ョ湅
 			handleDataLook(row) {
-				this.componentDataDataLook.entity.id = row.id
-				this.dataDialogVisible = true;
+				// this.componentDataDataLook.entity.id = row.id
+				// this.dataDialogVisible = true;
+
+        this.currentInfo = row
+        this.$axios.get(this.$api.insReport.getInsOrderStateCount+'?id='+row.id).then(res => {
+          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.lookDialogVisible = true
+        })
 			},
+      // 鏌ョ湅妫�楠岃鎯�
+      lookDetail(row,value,insSample){
+        this.lookDialogVisible0 = true
+        let inspectorList = []
+        if(row.userName){
+          inspectorList = row.userName.split(',')
+        }
+        this.sampleId = insSample.id
+        this.orderId0 = insSample.insOrderId
+        this.currentItem = {
+          num1:value,
+          inspectorList:inspectorList,
+          ...row
+        }
+      },
 			// 涓嬭浇鎶ュ憡
 			download(row) {
         this.downList = row.reportDtos
diff --git a/src/components/view/index-index.vue b/src/components/view/index-index.vue
index f8b4406..62edac6 100644
--- a/src/components/view/index-index.vue
+++ b/src/components/view/index-index.vue
@@ -64,6 +64,7 @@
     display: flex;
     align-items: center;
     justify-content: center;
+    cursor: pointer;
   }
 
   .right-1-item .mun{
@@ -314,7 +315,7 @@
       </el-col>
       <el-col :xs="24" :sm="24" :md="10" :lg="10" :xl="10">
         <div class="right-1 card">
-          <div class="right-1-item">
+          <div class="right-1-item" @click="openNotice">
             <div class="img">
               <img src="../../../static/img/index-0.svg" alt="">
             </div>
@@ -323,7 +324,7 @@
               <p style="font-size: 14px;margin-bottom: 10px;">鎴戠殑寰呭姙</p>
             </div>
           </div>
-          <div class="right-1-item">
+          <div class="right-1-item" @click="openNotice">
             <div class="img">
               <img src="../../../static/img/index-1.svg" alt="">
             </div>
@@ -332,7 +333,7 @@
               <p style="font-size: 14px;margin-bottom: 10px;">宸插姙浜嬪疁</p>
             </div>
           </div>
-          <div class="right-1-item">
+          <div class="right-1-item" @click="openNotice">
             <div class="img">
               <img src="../../../static/img/index-2.svg" alt="">
             </div>
@@ -341,7 +342,7 @@
               <p style="font-size: 14px;margin-bottom: 10px;">鍓╀綑寰呭姙</p>
             </div>
           </div>
-          <div class="right-1-item">
+          <div class="right-1-item" @click="openNotice">
             <div class="img">
               <img src="../../../static/img/index-3.svg" alt="">
             </div>
@@ -530,7 +531,7 @@
         timer:null,
         keyMap:{},
         getNumberFourTypes: {},
-        type:'鍛�',
+        type:'鏈�',
         time:{
           week:'',
           month:'',
@@ -900,8 +901,12 @@
               break;
           }
         }else{
-          this.startTime = getYearAndMonthAndDays(new Date((new Date).getTime() - 24 * 60 * 60 * 1000))
-          this.endTime = getYearAndMonthAndDays(new Date((new Date).getTime() + 24 * 60 * 60 * 1000 * 5))
+          const year = new Date().getFullYear();
+          const month = new Date().getMonth();
+
+          // 璁剧疆璧峰鏃ユ湡鍜岀粨鏉熸棩鏈�
+          this.startTime = new Date(year, month, 1).toISOString().slice(0, 10); // 鏈堝垵
+          this.endTime = new Date(year, month + 1, 0).toISOString().slice(0, 10); // 鏈堟湯
         }
         this.initEchart()
       },
@@ -914,6 +919,9 @@
           this.changeTime(this.type)
 				})
 			},
+      openNotice(){
+        this.$parent.openNotice()
+      }
 		},
     deactivated(){
       this.timer&&clearInterval(this.timer)
diff --git a/src/view/notice.vue b/src/view/notice.vue
index bb0eaf4..f9bbe7d 100644
--- a/src/view/notice.vue
+++ b/src/view/notice.vue
@@ -16,7 +16,10 @@
         @click="goNoticeDetail(m)">
           <img :src="`../../static/img/notice-${m.viewStatus?1:0}-${m.messageType}.svg`" alt="" style="margin-right: 6px;">
           <div class="notice-content-item-left">
-            <p>{{ m.theme }}</p>
+            <p style="display: flex;justify-content: space-between;">
+              <span>{{ m.theme }}</span>
+              <i class="el-icon-delete" style="cursor: pointer;font-size: 16px;margin-right: 20px;" @click.stop="handleDel(m)"></i>
+            </p>
             <p style="width: 100%;display: flex;align-items: center;justify-content: space-between;">
               <span>鍙戦�佷汉锛歿{ m.createUser }}</span>
               <span>{{ m.createTime }}</span>
@@ -287,4 +290,10 @@
 .readStyle .notice-content-item-left p:nth-child(2){
   color: #90CBCD;
 }
+.el-icon-delete{
+  display: none;
+}
+.notice-content-item:hover .el-icon-delete{
+  display: inline-block;
+}
 </style>

--
Gitblit v1.9.3