From e6c3fccc9e412e79964a6dc2dae4c3da0c80095c Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 26 十一月 2024 15:22:28 +0800
Subject: [PATCH] 完成检验下单、检验任务、报告生成变更

---
 src/components/do/b1-inspect-order-plan/circuit-parameters1.vue |   36 ++--
 src/components/tool/file-preview.vue                            |   30 +++
 src/components/do/b1-ins-order/add.vue                          |   14 
 src/components/do/b1-inspect-order-plan/circuit-parameters2.vue |   26 +-
 src/main.js                                                     |    2 
 src/components/do/b1-report-preparation/order.vue               |  191 ++++++++++++--------
 src/components/do/b1-inspect-order-plan/Inspection.vue          |  147 +++++++++------
 src/components/view/b1-inspect-order-plan.vue                   |   52 ++++-
 src/components/view/b1-inspection-order.vue                     |   11 +
 9 files changed, 318 insertions(+), 191 deletions(-)

diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index 57c1b7f..60c0167 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -134,9 +134,9 @@
   <div class="ins_order_add" style=" display: block; ">
     <div v-show="!configShow&&!equipConfigShow&&!cableConfigShow">
       <el-row class="title">
-        <el-col :span="6" style="padding-left: 20px;text-align: left;">濮旀墭鍗曚俊鎭�&nbsp;&nbsp;&nbsp;鍗曚綅鎴愭湰鎬讳环锛�<span
+        <el-col :span="8" style="padding-left: 20px;text-align: left;">濮旀墭鍗曚俊鎭�&nbsp;&nbsp;&nbsp;鍗曚綅鎴愭湰鎬讳环锛�<span
             style="color: #3A7BFA">锟{total.toFixed(2)}}</span></el-col>
-        <el-col :span="18" style="text-align: right;">
+        <el-col :span="16" style="text-align: right;">
           <el-select v-model="template" size="medium" placeholder="涓嬪崟妯℃澘" style="margin-right: 10px;" v-show="active==1"
             @change="selectInsOrderTemplateById">
             <el-option v-for="(a, ai) in templates" :key="ai" :value="a.id" :label="a.name">
@@ -234,7 +234,7 @@
             <div class="search_label"><span class="required-span">* </span>鏍峰搧鏁伴噺锛�</div>
             <div class="search_input">
               <el-input-number size="small" v-model="addObj.sampleNum" :min="1" :max="100" :precision="0"
-                style="width: 65%;" @change="addStandardTree" :disabled="active>1"></el-input-number>
+                style="width: 100%;" @change="addStandardTree" :disabled="active>1"></el-input-number>
             </div>
           </el-col>
           <!-- <el-col class="search_thing" :span="6">
@@ -356,7 +356,7 @@
                 :disabled="active>1"
                 type="date"
                 placeholder="閫夋嫨鏃ユ湡"
-                size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
+                size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;">
               </el-date-picker>
             </div>
           </el-col>
@@ -368,7 +368,7 @@
                 :disabled="active>1"
                 type="date"
                 placeholder="閫夋嫨鏃ユ湡"
-                size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
+                size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;">
               </el-date-picker>
             </div>
           </el-col>
@@ -1415,7 +1415,7 @@
           })
         })
         // 鏂囦欢淇℃伅
-        this.componentData0.entity.insOrderId = this.currentId
+        this.componentData0.entity.insOrderId = this.currentId;
         this.$refs.fileList.selectList()
       }
     },
@@ -2847,7 +2847,7 @@
         }).then(res => {
           this.orderType = res.data
           if (res.data.length > 0) {
-            this.addObj.orderType = res.data[0].value
+            this.addObj.orderType = 'C'
           }
         })
       },
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 2130739..32ee71d 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -259,7 +259,7 @@
     <el-row class="title">
       <el-col :span="12" style="padding-left: 20px;text-align: left;" :class="{noShow:noBack}">妫�楠屽崟璇︽儏
       </el-col>
-      <el-col :span="12" style="text-align: right;display: flex;align-items: center;justify-content: end">
+      <el-col :span="12" style="text-align: right;display: flex;align-items: center;justify-content: end;margin-top: 16px;">
         <el-button size="small" type="primary" @click="versionDialogVisible=true" v-if="state==1&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName.includes('鐢佃矾璇曢獙')">鐢佃皟/闈炵數璋冩ā鏉垮垏鎹�</el-button>
         <el-select v-model="template" size="medium" placeholder="鐢佃矾棰勮妯℃澘" style="margin-right: 10px;margin-left: 10px;" v-if="state==1&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName.includes('鐢佃矾璇曢獙')"
           @change="selectInsProductTemplateById">
@@ -272,7 +272,7 @@
         <el-button size="medium" @click="templateDia=true" v-if="state==1&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName.includes('鐢佃矾璇曢獙')&&addInsProductTemplatePower">
             <span style="color: #3A7BFA;">淇濆瓨妯℃澘</span>
           </el-button>
-        <el-button size="small" type="primary" @click="sampleVisible=true;uploadSample()">鏍峰搧鍒囨崲</el-button>
+        <!-- <el-button size="small" type="primary" @click="sampleVisible=true;uploadSample()">鏍峰搧鍒囨崲</el-button> -->
         <el-button size="small" type="primary" @click="taskVisible=true" v-show="!isLook">浠诲姟鍒囨崲</el-button>
         <el-button size="small" type="primary" @click="handleSubmit" v-if="state==1"
           :loading="submitLoading">鎻愪氦</el-button>
@@ -429,10 +429,10 @@
                   </template>
                   <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='鏍峰搧缂栧彿'">
                     <div style="display: flex;flex-wrap: nowrap;align-items: center;width: 100%" :title="currentSample.sampleCode">
-                      <i class="el-icon-caret-left table_caret" style="width: 16px;" @click="caretSample(-1)" v-if="!currentFiberOpticTape&&!currentFiberOptic"></i>
+                      <!-- <i class="el-icon-caret-left table_caret" style="width: 16px;" @click="caretSample(-1)" v-if="!currentFiberOpticTape&&!currentFiberOptic"></i> -->
                       <div :style="`font-family:${n.v.ff} !important;overflow: hidden;white-space: nowrap;width: calc(100% - 32px);`">{{currentSample.sampleCode}}</div>
-                      <i class="el-icon-caret-right table_caret" style="width: 16px;"
-                      v-if="!currentFiberOpticTape&&!currentFiberOptic" @click="caretSample(1)"></i>
+                      <!-- <i class="el-icon-caret-right table_caret" style="width: 16px;"
+                      v-if="!currentFiberOpticTape&&!currentFiberOptic" @click="caretSample(1)"></i> -->
                     </div>
                   </template>
                   <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='鏍峰搧鍨嬪彿'">
@@ -750,7 +750,8 @@
       </div>
       <el-upload :action="action"
       :data="{
-        orderId:id,
+        orderId:this.orderId0,
+        sampleId:id,
         sonLaboratory:sonLaboratory
       }"
       v-if="state==1&&fileAdd"
@@ -889,28 +890,31 @@
             :rows="2"></el-input>
           </div>
         </div>
-        <table border="1" cellpadding="10" class="thermal-table">
-          <tr style="font-size: 18px;font-weight: 500;background-color: #F0F1F5;padding: 10px 0;box-sizing: border-box;">
-            <td>鏍峰搧</td>
-            <td>鏍峰搧缂栧彿</td>
-            <td>鍨嬪彿</td>
-            <td>妫�楠岄」</td>
-            <td>妫�楠屽瓙椤�</td>
-            <td>宸ユ椂</td>
-          </tr>
-          <template v-for="(item,index) in sampleProduct">
-            <tr>
-              <td :rowspan="item.insProduct.length+1">{{ item.sample }}</td>
-              <td :rowspan="item.insProduct.length+1">{{ item.sampleCode }}</td>
-              <td :rowspan="item.insProduct.length+1">{{ item.model }}</td>
+        <template v-for="(x,y) in newUserInfo">
+          <p style="margin: 10px 0;"><el-tag size="small">{{x.name}}</el-tag> 宸ユ椂濉啓</p>
+          <table border="1" cellpadding="10" class="thermal-table">
+            <tr style="font-size: 18px;font-weight: 500;background-color: #F0F1F5;padding: 10px 0;box-sizing: border-box;">
+              <td>鏍峰搧</td>
+              <td>鏍峰搧缂栧彿</td>
+              <td>鍨嬪彿</td>
+              <td>妫�楠岄」</td>
+              <td>妫�楠屽瓙椤�</td>
+              <td>宸ユ椂</td>
             </tr>
-            <tr v-for="(m,i) in item.insProduct" :key="item.id+i">
-              <td>{{ m.inspectionItem }}</td>
-              <td>{{ m.inspectionItemSubclass }}</td>
-              <td><el-input-number v-model="m.outputWorkTime" :min="0" :max="100" label="宸ユ椂" size="small"></el-input-number></td>
-            </tr>
-          </template>
-        </table>
+            <template v-for="(item,index) in sampleProduct">
+              <tr>
+                <td :rowspan="item.insProduct.length+1">{{ item.sample }}</td>
+                <td :rowspan="item.insProduct.length+1">{{ item.sampleCode }}</td>
+                <td :rowspan="item.insProduct.length+1">{{ item.model }}</td>
+              </tr>
+              <tr v-for="(m,i) in item.insProduct" :key="item.id+i">
+                <td>{{ m.inspectionItem }}</td>
+                <td>{{ m.inspectionItemSubclass }}</td>
+                <td><el-input-number v-model="x.timeArr[i]" :min="0" :max="100" label="宸ユ椂" size="small"></el-input-number></td>
+              </tr>
+            </template>
+          </table>
+        </template>
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="experimentDia = false">鍙� 娑�</el-button>
@@ -949,7 +953,7 @@
   import PowerCapacity from './power-capacity.vue'
   import filePreview from '../../tool/file-preview.vue'
   export default {
-    props: ['sonLaboratory', 'orderId', 'state','inspectorList','version','orderStateId','isLook','num1','noBack'],
+    props: ['sonLaboratory', 'orderId', 'state','inspectorList','version','orderStateId','isLook','num1','noBack','orderId0','userInfo'],
     components: {
       ValueTable,
       CircuitParameters1,
@@ -1010,8 +1014,9 @@
         },
         componentData0: {
           entity: {
-            insOrderId:'',
-            sonLaboratory:this.sonLaboratory
+            insSampleId:'',
+            sonLaboratory:this.sonLaboratory,
+            insOrderId:''
           },
           isIndex: true,
           showSelect: false,
@@ -1156,6 +1161,7 @@
         templateLoading:false,
         templateName:'',
         addInsProductTemplatePower:false,//閰嶇疆妯℃澘鏉冮檺
+        newUserInfo:[]
       }
     },
     // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
@@ -1191,11 +1197,12 @@
       id(val) {
         this.loading = true
         this.$axios.post(this.$api.insOrderPlan.doInsOrder, {
-          id: val,
+          sampleId: val,
           laboratory: this.sonLaboratory
         }).then(async res => {
           this.insOrder = res.data.insOrder;
-          this.componentData0.entity.insOrderId = val;
+          this.componentData0.entity.insSampleId = val;
+          this.componentData0.entity.insOrderId = this.orderId0;
           this.$refs.fileList.selectList()
           this.urgentList.forEach(m => {
             if (m.value == this.insOrder.type) {
@@ -3218,7 +3225,7 @@
       },
       // 澶嶆牳
       upInsReview(e,type) {
-        this.$confirm(`鏄惁${type}?`, "鎻愮ず", {
+        this.$confirm(type=='缁撴潫璇曢獙'?'纭缁撴潫璇曢獙锛熺‘瀹氬悗姝ゅ鎵樺崟鍋滄璇曢獙锛屽苟涓旀棤娉曞啀娆℃楠岋紒':`鏄惁${type}?`, "鎻愮ず", {
           confirmButtonText: "纭畾",
           cancelButtonText: "鍙栨秷",
           type: "warning"
@@ -3227,7 +3234,7 @@
           // 缁х画璇曢獙
           this.reviewLoading = true;
           this.$axios.post(this.$api.insOrderPlan.verifyPlan, {
-            orderId: this.orderId,
+            sampleId: this.orderId,
             type: e,
             laboratory: this.sonLaboratory,
             tell: null
@@ -3251,7 +3258,7 @@
         if (this.noReason) {
           this.reviewLoading = true;
           this.$axios.post(this.$api.insOrderPlan.verifyPlan, {
-            orderId: this.orderId,
+            sampleId: this.orderId,
             type: 0,
             laboratory: this.sonLaboratory,
             tell: this.noReason
@@ -3280,18 +3287,18 @@
             return
           }
         }
-        let num =0
-        this.sampleProduct.forEach(item=>{
-          item.insProduct.forEach(a=>{
-            if(!a.outputWorkTime){
-              num++
-            }
-          })
-        })
-        if(num>0){
-          this.$message.error('璇疯緭鍏ュ畬鎴愬伐鏃�')
-          return
-        }
+        // let num =0
+        // this.newUserInfo.forEach(item=>{
+        //   item.timeArr.forEach(a=>{
+        //     if(!a){
+        //       num++
+        //     }
+        //   })
+        // })
+        // if(num>0){
+        //   this.$message.error('璇疯緭鍏ュ畬鎴愬伐鏃�')
+        //   return
+        // }
         this.experimentDia = false
         this.experimentDia0 = false
         if(this.insOrder.orderType=='C'){
@@ -3311,6 +3318,21 @@
           return
         }
         this.experimentDia = true
+        this.newUserInfo = []
+        this.userInfo.name.forEach((item,index)=>{
+          let timeArr = []
+          this.sampleProduct.forEach(m=>{
+            m.insProduct.forEach(a=>{
+              timeArr.push(0)
+            })
+          })
+          let obj = {
+            name:item,
+            id:this.userInfo.ids[index],
+            timeArr:timeArr
+          }
+          this.newUserInfo.push(obj)
+        })
         if (this.sonLaboratory === '鐢佃矾璇曢獙') {
           this.experimentDia0 = true
         }
@@ -3323,27 +3345,30 @@
         this.addVerifyDia = false
         this.submitLoading = true;
         this.$axios.post(this.$api.insOrderPlan.checkSubmitPlan, {
-          orderId: this.orderId,
+          sampleId: this.orderId,
           laboratory: this.sonLaboratory,
         }).then(res => {
           if (res.code === 200) {
             let auxiliaryOutputWorkingHoursList = []
             this.sampleProduct.forEach(item=>{
-              item.insProduct.forEach(a=>{
-                let obj = {
-                  inspectionItem:a.inspectionItem,
-                  outputWorkTime:a.outputWorkTime,
-                  inspectionItemSubclass:a.inspectionItemSubclass,
-                  sample:item.sampleCode,
-                  insProductId:a.id,
-                  num:item.num1
-                }
-                auxiliaryOutputWorkingHoursList.push(obj)
+              item.insProduct.forEach((a,i)=>{
+                this.newUserInfo.forEach(b=>{
+                  let obj = {
+                    inspectionItem:a.inspectionItem,
+                    outputWorkTime:b.timeArr[i],
+                    inspectionItemSubclass:a.inspectionItemSubclass,
+                    sample:item.sampleCode,
+                    insProductId:a.id,
+                    num:item.num1,
+                    check:b.id
+                  }
+                  auxiliaryOutputWorkingHoursList.push(obj)
+                })
               })
             })
             if(!res.data||res.data.length==0){
               this.$axios.post(this.$api.insOrderPlan.submitPlan, {
-                orderId: this.orderId,
+                sampleId: this.orderId,
                 laboratory: this.sonLaboratory,
                 verifyUser: this.verifyUser,
                 entrustCode: this.insOrder.entrustCode,
@@ -3382,7 +3407,7 @@
                 type: ""
               }).then(() => {
                 this.$axios.post(this.$api.insOrderPlan.submitPlan, {
-                  orderId: this.orderId,
+                  sampleId: this.orderId,
                   laboratory: this.sonLaboratory,
                   verifyUser: this.verifyUser,
                   auxiliaryOutputWorkingHoursList:auxiliaryOutputWorkingHoursList,
@@ -3413,7 +3438,7 @@
       async handleCType(){
         if(this.insOrder.departmentLims=='璐ㄩ噺閮�'){
           await this.$axios.post(this.$api.insOrderPlan.verifyPlan, {
-            orderId: this.orderId,
+            sampleId: this.orderId,
             type: 1,
             laboratory: this.sonLaboratory,
             tell: null
diff --git a/src/components/do/b1-inspect-order-plan/circuit-parameters1.vue b/src/components/do/b1-inspect-order-plan/circuit-parameters1.vue
index 8c83ab2..b58a998 100644
--- a/src/components/do/b1-inspect-order-plan/circuit-parameters1.vue
+++ b/src/components/do/b1-inspect-order-plan/circuit-parameters1.vue
@@ -86,7 +86,7 @@
               <div style="text-align: center;">{{ n.unit }}</div>
             </el-col>
             <el-col :span="2">
-              <div style="text-align: center;" v-html="n.tell"></div>
+              <div style="text-align: center;" v-html="n.ask"></div>
             </el-col>
             <el-col :span="16">
               <div class="content" style="text-align: center;width: 100%;overflow-x: auto;">
@@ -127,7 +127,7 @@
               <div style="text-align: center;">{{ n.unit }}</div>
             </el-col>
             <el-col :span="2">
-              <div style="text-align: center;" v-html="n.tell"></div>
+              <div style="text-align: center;" v-html="n.ask"></div>
             </el-col>
             <el-col :span="16">
               <div class="content" style="text-align: center;width: 100%;overflow-x: auto;">
@@ -189,7 +189,7 @@
               <div style="text-align: center;">{{ n.unit }}</div>
             </el-col>
             <el-col :span="2">
-              <div style="text-align: center;" v-html="n.tell"></div>
+              <div style="text-align: center;" v-html="n.ask"></div>
             </el-col>
             <el-col :span="16">
               <div class="content" style="text-align: center;width: 100%;overflow-x: auto;">
@@ -235,7 +235,7 @@
               <div style="text-align: center;">{{ n.unit }}</div>
             </el-col>
             <el-col :span="2">
-              <div style="text-align: center;" v-html="n.tell"></div>
+              <div style="text-align: center;" v-html="n.ask"></div>
             </el-col>
             <el-col :span="17">
               <div class="content" style="text-align: center;width: 100%;overflow-x: auto;">
@@ -302,7 +302,7 @@
         {
           name:'鐢靛帇椹绘尝姣�',
           unit:'/',
-          tell:'鈮�1.45',
+          ask:'鈮�1.45',
           result:'',
           conclusion:'鍚堟牸',
           portList:[],
@@ -312,7 +312,7 @@
         {
           name:'鍚屾瀬鍖栭殧绂诲害',
           unit:'dB',
-          tell:'鈮�1.45',
+          ask:'鈮�1.45',
           result:'',
           conclusion:'鍚堟牸',
           portList:[],
@@ -323,7 +323,7 @@
           name:'浜掕皟',
           band:'2100MHz',
           unit:'dB',
-          tell:'鈮�1.45',
+          ask:'鈮�1.45',
           result:'',
           conclusion:'鍚堟牸',
           portList:[],
@@ -333,7 +333,7 @@
         {
           name:'鍋忓樊',
           unit:'dB',
-          tell:'鈮�1.45',
+          ask:'鈮�1.45',
           result:'',
           conclusion:'鍚堟牸',
           portList:[],
@@ -344,7 +344,7 @@
           name:'鏈�澶ц�﹀悎搴�',
           unit:'dB',
           band:'2100MHz',
-          tell:'鈮�1.45',
+          ask:'鈮�1.45',
           result:'',
           conclusion:'鍚堟牸',
           portList:[],
@@ -479,19 +479,19 @@
                   this.angleList = angleList
                   this.upTemplateState = false;
                 }
-                let tell = ''
-                if(item.tell.includes(',')){
-                  item.tell.split(',').forEach((m,i)=>{
-                    tell = tell + m+ (i==item.tell.split(',').length-1?'':'<br/>')
+                let ask = ''
+                if(item.ask.includes(',')){
+                  item.ask.split(',').forEach((m,i)=>{
+                    ask = ask + m+ (i==item.ask.split(',').length-1?'':'<br/>')
                   })
                 }else{
-                  tell = item.tell
+                  ask = item.ask
                 }
-                console.log(tell)
+                console.log(ask)
                 let obj = {
                   inspectionItemSubclass: item.inspectionItemSubclass,
                   unit:item.unit,
-                  tell:tell,
+                  ask:ask,
                   result:n.result,
                   id:item.id,
                   often:n.often,
@@ -773,8 +773,8 @@
       this.$delete(this.loading, y)
       this.$set( this.loading, y, true)
       this.$axios.post(this.$api.insOrderPlan.saveInsContext2, {
-        orderId:this.orderId,
-        sampleId:this.sampleId,
+        // orderId:this.orderId,
+        sampleId:this.orderId,
         sonLaboratory:h.projectList[0].sonLaboratory,
         frequency:h.band,
         insProductResult2s:arr
diff --git a/src/components/do/b1-inspect-order-plan/circuit-parameters2.vue b/src/components/do/b1-inspect-order-plan/circuit-parameters2.vue
index ecd3ef7..4e84e59 100644
--- a/src/components/do/b1-inspect-order-plan/circuit-parameters2.vue
+++ b/src/components/do/b1-inspect-order-plan/circuit-parameters2.vue
@@ -86,7 +86,7 @@
               <div style="text-align: center;">{{ n.unit }}</div>
             </el-col>
             <el-col :span="2">
-              <div style="text-align: center;" v-html="n.tell"></div>
+              <div style="text-align: center;" v-html="n.ask"></div>
             </el-col>
             <el-col :span="16">
               <div class="content" style="text-align: center;width: 100%;overflow-x: auto;">
@@ -127,7 +127,7 @@
               <div style="text-align: center;">{{ n.unit }}</div>
             </el-col>
             <el-col :span="2">
-              <div style="text-align: center;" v-html="n.tell"></div>
+              <div style="text-align: center;" v-html="n.ask"></div>
             </el-col>
             <el-col :span="16">
               <div class="content" style="text-align: center;width: 100%;overflow-x: auto;">
@@ -213,7 +213,7 @@
         {
           inspectionItemSubclass:'鐢靛帇椹绘尝姣�',
           unit:'/',
-          tell:'鈮�1.45',
+          ask:'鈮�1.45',
           result:0,
           portList:[],
           angleList:[],
@@ -222,7 +222,7 @@
         {
           inspectionItemSubclass:'鍚屾瀬鍖栭殧绂诲害',
           unit:'dB',
-          tell:'鈮�1.45',
+          ask:'鈮�1.45',
           result:0,
           portList:[],
           angleList:[],
@@ -232,7 +232,7 @@
           inspectionItemSubclass:'浜掕皟',
           often:'',//浜掕皟鐗规湁瀛楁
           unit:'dB',
-          tell:'鈮�1.45',
+          ask:'鈮�1.45',
           result:0,
           portList:[],
           angleList:[],
@@ -350,18 +350,18 @@
                   this.angleList = angleList
                   this.upTemplateState = false
                 }
-                let tell = ''
-                if(item.tell.includes(',')){
-                  item.tell.split(',').forEach((m,i)=>{
-                    tell = tell + m+ (i==item.tell.split(',').length-1?'':'<br/>')
+                let ask = ''
+                if(item.ask.includes(',')){
+                  item.ask.split(',').forEach((m,i)=>{
+                    ask = ask + m+ (i==item.ask.split(',').length-1?'':'<br/>')
                   })
                 }else{
-                  tell = item.tell
+                  ask = item.ask
                 }
                 let obj = {
                   inspectionItemSubclass: item.inspectionItemSubclass,
                   unit:item.unit,
-                  tell:tell,
+                  ask:ask,
                   result:n.result,
                   id:item.id,
                   often:n.often,
@@ -649,8 +649,8 @@
       this.$set( this.loading, y, true)
       // this.loading[y] = true
       this.$axios.post(this.$api.insOrderPlan.saveInsContext2, {
-        orderId:this.orderId,
-        sampleId:this.sampleId,
+        // orderId:this.orderId,
+        sampleId:this.orderId,
         sonLaboratory:h.projectList[0].sonLaboratory,
         frequency:h.band,
         insProductResult2s:arr
diff --git a/src/components/do/b1-report-preparation/order.vue b/src/components/do/b1-report-preparation/order.vue
index 497ec80..68887e7 100644
--- a/src/components/do/b1-report-preparation/order.vue
+++ b/src/components/do/b1-report-preparation/order.vue
@@ -38,55 +38,60 @@
       :append-to-body="true"
       :modal="!dialogVisible0"
       >
-      <span>璇烽�夋嫨濮旀墭缂栧彿涓� <span style="color: #3A7BFA">{{currentInfo.entrustCode}}</span> 瑕佺敓鎴愮殑鏁版嵁</span>
+      <span style="font-size: 16px;">璇烽�夋嫨濮旀墭缂栧彿涓� <span style="color: #3A7BFA">{{currentInfo.entrustCode}}</span> 瑕佺敓鎴愮殑鏁版嵁</span>
       <div style="max-height: 75vh;overflow-y: auto;">
-        <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>
-          </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)" type="text" size="small">鏌ョ湅</el-button>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-card>
+        <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>
@@ -98,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"
@@ -129,7 +136,7 @@
           sampleModel: null,
           sampleCode: null,
           outEntrustCode: null,
-          state: 1,
+          state: 4,
           name:null,
           engineering:null,
           production:null,
@@ -210,7 +217,10 @@
       currentItem:{},
       loading0:false,
       loading1:false,
-      dialogVisible0:false
+      dialogVisible0:false,
+      sampleList:[],
+      sampleId:null,
+      orderId0:null,
     }
   },
   mounted() {
@@ -242,38 +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,
-              insOrderUsersId:item1.id
-            })
-          }
+      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
       }
@@ -281,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'
@@ -319,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,
diff --git a/src/components/tool/file-preview.vue b/src/components/tool/file-preview.vue
index d3c4fd5..38ea63e 100644
--- a/src/components/tool/file-preview.vue
+++ b/src/components/tool/file-preview.vue
@@ -67,6 +67,7 @@
 import VueOfficeExcel from '@vue-office/excel'
 //寮曞叆鐩稿叧鏍峰紡
 import '@vue-office/excel/lib/index.css'
+import * as XLSX from "xlsx";
 export default {
   components: {
     VueOfficeDocx,
@@ -164,6 +165,11 @@
           return obj
         })
         this.csvList = arr
+        // console.log(333,this.csvList)
+        this.csvList.forEach(m=>{
+          console.log(this.calculateFormulas(m.column,m.tableData))
+          m.tableData = this.calculateFormulas(m.column,m.tableData)
+        })
       }).catch( err => {
         console.log(err)
       })
@@ -205,6 +211,28 @@
       }
       return result
     },
+    /**
+     * 璁$畻琛ㄦ牸鍏紡
+     *
+     * @param tableHeaders 琛ㄥご鏁版嵁
+     * @param tableData 琛ㄦ牸鏁版嵁
+     */
+    calculateFormulas(tableHeaders,tableData){
+      // 鐢熸垚 Excel Sheet 鏍煎紡
+      const sheetData = [tableHeaders.map(m=>m.label), ...tableData.map((row) => Object.values(row))];
+      const worksheet = XLSX.utils.aoa_to_sheet(sheetData);
+      // 璁$畻鍏紡
+      XLSX.utils.sheet_add_aoa(worksheet, [], { origin: -1 });
+      const newSheetData = XLSX.utils.sheet_to_json(worksheet, { header: 1 });
+      // 鏇存柊琛ㄥご鍜岃〃鏍兼暟鎹�
+      tableData = newSheetData.slice(1).map((row) =>
+        row.reduce((obj, value, index) => {
+          obj[newSheetData[0][index]] = value;
+          return obj;
+        }, {})
+      );
+      return tableData
+    },
     resetStyle(){
       const elements = document.querySelectorAll('[style*="pt"]');
       for (const element of elements) {
@@ -213,7 +241,7 @@
           element.setAttribute('style', style.replace(/pt/g, 'px'));
         }
       }
-    }
+    },
   }
 }
 </script>
diff --git a/src/components/view/b1-inspect-order-plan.vue b/src/components/view/b1-inspect-order-plan.vue
index d544a33..644055e 100644
--- a/src/components/view/b1-inspect-order-plan.vue
+++ b/src/components/view/b1-inspect-order-plan.vue
@@ -144,6 +144,13 @@
 						</el-select>
 					</div>
 				</div>
+        <div class="search_thing">
+					<div class="search_label">鏍峰搧缂栧彿锛�</div>
+					<div class="search_input">
+						<el-input size="small" placeholder="璇疯緭鍏�" clearable
+							v-model="componentData.entity.sampleCOde" @keyup.enter.native="refreshTable()"></el-input>
+					</div>
+				</div>
 				<div class="search_thing" style="padding-left: 30px;">
 					<el-button size="small" @click="refresh()">閲� 缃�</el-button>
 					<el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
@@ -203,12 +210,17 @@
             width="100px"
           ></el-table-column>
           <el-table-column
+            prop="sampleCode"
+            label="鏍峰搧缂栧彿"
+            width="170px"
+          ></el-table-column>
+          <el-table-column
             prop="type"
             label="绱ф�ョ▼搴�"
             width="100px"
           >
             <template slot-scope="scope">
-              <el-tag :type="typeList.find(m=>m.value==scope.row.type).type" size="small">{{ typeList.find(m=>m.value==scope.row.type).label }}</el-tag>
+              <el-tag :type="typeList.find(m=>m.value==scope.row.type)?typeList.find(m=>m.value==scope.row.type).type:''" size="small">{{ typeList.find(m=>m.value==scope.row.type)?typeList.find(m=>m.value==scope.row.type).label:'' }}</el-tag>
             </template>
           </el-table-column>
           <el-table-column
@@ -320,7 +332,7 @@
 		<div style="width: 100%;height: 100%;" v-if="activeFace >0">
 			<Add :active="activeFace" :currentId="currentId" :examine="examine"/>
 		</div>
-    <Inspection v-if="state>0" @goback="goback" :orderId="orderId" :inspectorList="inspectorList" :sonLaboratory="componentData.entity.sonLaboratory" :state="state" :orderStateId="orderStateId" :version="version" :isLook="isLook" :num1="num1"/>
+    <Inspection v-if="state>0" @goback="goback" :orderId="orderId" :inspectorList="inspectorList" :sonLaboratory="componentData.entity.sonLaboratory" :state="state" :orderStateId="orderStateId" :version="version" :isLook="isLook" :num1="num1" :orderId0="orderId0" :userInfo="userInfo" />
       <el-dialog title="鏁版嵁鏌ョ湅" :visible.sync="dataDialogVisible" width="80%">
 				<div style="height: 70vh;overflow-y: auto;" v-if="dataDialogVisible">
 					<ValueTable ref="ValueTableDataLook" :rowKey="'insProductId'" :url="$api.insOrder.selectSampleAndProductByOrderId"
@@ -502,7 +514,8 @@
 					entity: {
 						sonLaboratory: null,
 						insState: null,
-						userId: null
+						userId: null,
+            sampleCode:null,
 					},
           sortable:true,
 					isIndex: true,
@@ -609,7 +622,8 @@
 				activeFace: 0, //1锛氫笅鍗曪紝2锛氭煡鐪嬶紝3锛氬鏍革紝榛樿涓�0
 				currentId: null,
 				entityCopy: {},
-				orderId: 0,
+				orderId: null,
+        orderId0:null,
         personList:[],
         connectVisible:false,
         connect:{
@@ -659,7 +673,11 @@
         upLoadStorage: false,
         exportVisible: false,
         upLoadExport: false,
-        selectWarehouse:false
+        selectWarehouse:false,
+        userInfo:{
+          name:[],
+          ids:[]
+        }
 			}
 		},
 		created() {
@@ -904,7 +922,7 @@
 				if (row) {
 					this.sampleUserForm = {
 						entrustCode: row.entrustCode,
-						insSampleId: row.id,
+						insSampleId: row.sampleId,
             sonLaboratory: row.sonLaboratory,
 					}
 					this.claimVisible = true
@@ -912,11 +930,13 @@
 			},
 			confirmClaim() {
         this.loading = true;
+        // this.sampleUserForm.insSampleId = this.orderId
 				this.$axios.post(this.$api.insOrderPlan.claimInsOrderPlan, this.sampleUserForm, {
 					headers: {
 						'Content-Type': 'application/json'
-					}
-				}).then(res => {
+					},
+          noQs:true
+				},).then(res => {
 					if (res.code === 200 && res.data) {
             this.loading = false;
 						this.$message.success("璁ら鎴愬姛")
@@ -1054,14 +1074,18 @@
           inspectorList.push(user.name)
         }
         this.inspectorList = inspectorList
-				this.orderId = row.id
+				this.orderId = row.sampleId
+        this.orderId0 = row.id
         this.version = row.version
         this.orderStateId = row.orderStateId
         this.state = 1;
+        this.userInfo.name = row.userName.split(',')
+        this.userInfo.ids = row.userNameId.split(',')
         this.isLook = false
       },
       handleConnect(row){
-        this.orderId = row.id
+        this.orderId = row.sampleId
+        this.orderId0 = row.id
         this.connect = {}
         this.connectVisible=true;
         // this.$axios.post(this.$api.insOrderPlan.upPlanUser2, {
@@ -1090,7 +1114,7 @@
         // }
         this.loading = true;
           this.$axios.post(this.$api.insOrderPlan.upPlanUser, {
-            orderId:this.orderId,
+            sampleId:this.orderId,
             userId:this.connect.connectPerson,
             sonLaboratory:this.componentData.entity.sonLaboratory,
           }).then(res => {
@@ -1107,7 +1131,8 @@
       },
       handleReview(row){
         this.state = 2;
-				this.orderId = row.id
+				this.orderId = row.sampleId
+        this.orderId0 = row.id
         this.version = row.version
         this.orderStateId = row.orderStateId
         this.isLook = false
@@ -1136,7 +1161,8 @@
       lookHistory(row){
         this.isLook = true
         this.state = 2;
-        this.orderId = this.currentHistory.id
+        this.orderId = this.currentHistory.sampleId
+        this.orderId0 = this.currentHistory.id
         this.version = this.currentHistory.version
         this.orderStateId = this.currentHistory.orderStateId
         this.num1 = row.num
diff --git a/src/components/view/b1-inspection-order.vue b/src/components/view/b1-inspection-order.vue
index c97ecc1..7996d58 100644
--- a/src/components/view/b1-inspection-order.vue
+++ b/src/components/view/b1-inspection-order.vue
@@ -489,6 +489,9 @@
 					</el-row>
 				</span>
 		</el-dialog>
+    <el-dialog title="鎶ュ憡涓嬭浇" :visible.sync="downVisible" width="440px">
+      <p v-for="(item,index) in downList" :key="index" style="text-align: left;">鏍峰搧缂栧彿锛歿{item.codeUrl}} <el-button type="text" icon="el-icon-download" @click="handleDown(item)">鎶ュ憡涓嬭浇</el-button></p>
+    </el-dialog>
 	</div>
 </template>
 
@@ -571,7 +574,7 @@
 						type: 'text',
 						method: 'download',
 						disabFun: (row, index) => {
-							return row.state != 4 || row.reportId == null
+							return !row.reportDtos||row.reportDtos.length==0
 						}
 					}, {
 						id: 'verify',
@@ -810,6 +813,8 @@
         currentRole:'',
         BZinfo:[],
         BZDialogVisible:false,
+        downVisible:false,
+        downList:[]
 			}
 		},
     watch:{
@@ -1079,6 +1084,10 @@
 			},
 			// 涓嬭浇鎶ュ憡
 			download(row) {
+        this.downList = row.reportDtos
+        this.downVisible = true;
+      },
+      handleDown(row){
         let url = row.urlS?row.urlS:row.url;
         if(url){
           url = url.split('.')[0]+'.pdf'
diff --git a/src/main.js b/src/main.js
index 48c3c28..afa39b8 100644
--- a/src/main.js
+++ b/src/main.js
@@ -21,7 +21,7 @@
 //鏈湴
 // Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
 // const javaApi = 'http://127.0.0.1:8001';
-const javaApi = 'http://192.168.20.249:8001';
+const javaApi = 'http://172.20.10.5:8001';
 
 // //閫氫俊娴嬭瘯搴�
 // Vue.prototype.LOCATIONVUE = "http://10.1.13.77:8080";

--
Gitblit v1.9.3