From da498efb165dbada586396baecc71c644e46b1e8 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 23 七月 2024 14:00:41 +0800
Subject: [PATCH] 交接时选择试验室

---
 src/components/do/b1-ins-order/add.vue                 |   58 +++++++++++---
 src/components/tool/scroll-paging.vue                  |    3 
 src/view/notice.vue                                    |   21 ----
 src/main.js                                            |    8 +-
 src/components/do/b1-inspect-order-plan/Inspection.vue |    2 
 src/components/view/b1-inspect-order-plan.vue          |   66 +++++++++++++---
 src/components/view/b1-inspection-order.vue            |   43 +++++++++-
 src/assets/api/controller.js                           |    1 
 8 files changed, 147 insertions(+), 55 deletions(-)

diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index 19d9552..a74994c 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -186,6 +186,7 @@
   doInsOrder: "/insOrderPlan/doInsOrder", //鎵ц妫�楠屾搷浣�
   saveInsContext: "/insOrderPlan/saveInsContext", //淇濆瓨妫�楠屽唴瀹�
   upPlanUser: "/insOrderPlan/upPlanUser", //浠诲姟浜ゆ帴
+  upPlanUser2: "/insOrderPlan/upPlanUser2", //浠诲姟浜ゆ帴
   verifyPlan: "/insOrderPlan/verifyPlan", //澶嶆牳妫�楠屼换鍔�
   submitPlan: "/insOrderPlan/submitPlan", //妫�楠屼换鍔℃彁浜�
   inspectionOrderDetailsTaskSwitching: "/insOrderPlan/inspectionOrderDetailsTaskSwitching", // 妫�楠屽崟璇︽儏-浠诲姟鍒囨崲
diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index fb9622e..160ebde 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -565,8 +565,17 @@
           <el-col class="search_thing" :span="22">
             <div class="search_label"><span class="required-span" v-if="addObj.type == 2">* </span>鎸囨淳浜哄憳锛�</div>
             <div class="search_input">
-              <el-select v-model="distributeData.userId" placeholder="璇烽�夋嫨" size="small" filterable style="width: 100%;">
+              <el-select v-model="distributeData.userId" placeholder="璇烽�夋嫨" size="small" filterable style="width: 100%;" @change="changeUser">
                 <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
+                </el-option>
+              </el-select>
+            </div>
+          </el-col>
+          <el-col class="search_thing" :span="22" v-if="distributeData.userId">
+            <div class="search_label"><span class="required-span">* </span>璇曢獙瀹わ細</div>
+            <div class="search_input">
+              <el-select v-model="distributeData.sonLaboratory" placeholder="璇烽�夋嫨" size="small" filterable style="width: 100%;">
+                <el-option v-for="item in sonLaboratoryList" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
             </div>
@@ -984,7 +993,8 @@
         issuedDialogVisible: false,
         distributeData: {
           appointed: '',
-          userId: ''
+          userId: '',
+          sonLaboratory:''
         },
         personList: [],
         upLoad: false,
@@ -1051,7 +1061,8 @@
         temperatureTitle: '',
         temperatureTestNum: '',
         isShowInput: false,
-        temId: ''
+        temId: '',
+        sonLaboratoryList:[]
       }
     },
     watch: {
@@ -1230,7 +1241,7 @@
             item.tell = ask
           }
         })
-        console.log('ask---', ask)
+        // console.log('ask---', ask)
         this.temperatureShow = false
       },
       temperatureShowClose () {
@@ -1279,7 +1290,7 @@
       },
 
       handleTemperatureTestChange (value) {
-        console.log('value---', value)
+        // console.log('value---', value)
       },
       handleSelectionChange(val) {
         this.opticalProjectList = val;
@@ -1476,7 +1487,7 @@
               isHaveBushing = false
             }
           })
-          console.log('isHaveBushing===', isHaveBushing)
+          // console.log('isHaveBushing===', isHaveBushing)
           if (productListSelected && select[2] === '鍏夌紗' && isHaveBushing === false) {
             this.$message.error('鍏夌紗娓╁害寰幆椤圭洰蹇呴』杩涜鍏夌氦閰嶇疆')
 
@@ -1802,11 +1813,16 @@
           this.$message.error('鎸囨淳浜哄憳鏈~鍐�')
           return
         }
+        if (this.distributeData.userId&&(this.distributeData.sonLaboratory== null ||this.distributeData.sonLaboratory== '')) {
+          this.$message.error('璇曢獙瀹ゆ湭濉啓')
+          return
+        }
         this.upLoad = true;
         this.$axios.post(this.$api.insOrder.upInsOrder, {
           orderId: this.distributeData.orderId,
           appointed: this.distributeData.appointed,
-          userId: this.distributeData.userId
+          userId: this.distributeData.userId,
+          sonLaboratory:this.distributeData.sonLaboratory
         }).then(res => {
           if (res.code === 201) {
             this.upLoad = false
@@ -2070,7 +2086,7 @@
           this.circulateShow = false;
         }
         if ((row.inspectionItem === '娓╁崌璇曢獙' || row.inspectionItem === '鐑惊鐜�') && row.state === 1) {
-          console.log('row---', row)
+          // console.log('row---', row)
           this.temperatureTitle = `${row.inspectionItem}瑕佹眰濉啓`
           this.isShowInput = row.inspectionItem === '鐑惊鐜�'
           this.temId = row.id
@@ -2323,7 +2339,7 @@
         }
       },
       handleAll(e) {
-        console.log('e---', e)
+        // console.log('e---', e)
         if (e.length > 0) {
           this.productList.map(m => {
             if(e.find(a=>a.id == m.id)){
@@ -2373,7 +2389,7 @@
             this.circulateShow = false;
           }
           if ((p.inspectionItem === '娓╁崌璇曢獙' || p.inspectionItem === '鐑惊鐜�') && p.state === 1) {
-            console.log('p---', p)
+            // console.log('p---', p)
             this.temperatureTitle = `${p.inspectionItem}瑕佹眰濉啓`
             this.isShowInput = p.inspectionItem === '鐑惊鐜�'
             this.temId = p.id
@@ -2656,7 +2672,7 @@
       getTotal() {
         this.totalArr = []
         this.total = 0;
-        console.log(this.sampleList)
+        // console.log(this.sampleList)
         this.sampleList.forEach(item => {
           if (item.insProduct && item.insProduct.length > 0) {
             item.insProduct.forEach(a => {
@@ -2702,7 +2718,6 @@
             if (item.manHourGroup === '' || !item.manHourGroup) {
               return true
             } else {
-              console.log(item)
               mySet.add(item.manHourGroup)
               let num2 = mySet.size
               if (num2 > num1) {
@@ -2715,6 +2730,20 @@
         })
         arr0.forEach(item => {
           this.total += Number(item.price)
+        })
+        let arr1 = this.totalArr.filter(item => item.state == 1)
+        let mySet0 = new Set();
+        this.sonLaboratoryList = []
+        arr1.forEach(item => {
+          let num1 = mySet0.size
+          mySet0.add(item.sonLaboratory)
+          let num2 = mySet0.size
+          if(num2>num1){
+            this.sonLaboratoryList.push({
+              label:item.sonLaboratory,
+              value:item.sonLaboratory,
+            })
+          }
         })
       },
       bsm2Up(val) {
@@ -2731,6 +2760,11 @@
         for (let a of set) {
           this.bsm2Val2.push(this.HaveJson(this.bsm2Val3[a - 1]))
         }
+      },
+      changeUser(){
+        if(this.sonLaboratoryList.length>0){
+          this.distributeData.sonLaboratory = this.sonLaboratoryList[0].value
+        }
       }
     }
   }
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index cb67224..5653f45 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -1653,7 +1653,6 @@
                   }
                 }
               })
-              console.log(1111,str)
               if (str != '') {
                 let count2 = 0
                 for (let i in this.currentSample.insProduct) {
@@ -1666,7 +1665,6 @@
                   .insProduct[i].inspectionItemSubclass==null||this.currentSample
                   .insProduct[i].inspectionItemSubclass==undefined?'':this.currentSample
                   .insProduct[i].inspectionItemSubclass
-                  console.log(inspectionItemClass, inspectionItem, inspectionItemSubclass)
                   if (this.currentSample.insProduct[i].templateId === a.templateId && inspectionItemClass +inspectionItem+inspectionItemSubclass ===
                     str) {
                     ids.push({
diff --git a/src/components/tool/scroll-paging.vue b/src/components/tool/scroll-paging.vue
index 367409d..7b40949 100644
--- a/src/components/tool/scroll-paging.vue
+++ b/src/components/tool/scroll-paging.vue
@@ -2,7 +2,7 @@
   <div class="scroll-pagination"  ref="content" @scroll="onScroll">
     <slot></slot>
     <el-button
-        v-show="isLoding"
+        v-show="isLoding&&!finishLoding"
         type="text"
         style="display: flex; margin: 0 auto; color: #909399"
         ><i class="el-icon-loading" style="font-size:20px"></i
@@ -34,6 +34,7 @@
       deep:true,
       handler(){
         this.isLoding = false
+        console.log(this.isLoding)
       }
     }
   },
diff --git a/src/components/view/b1-inspect-order-plan.vue b/src/components/view/b1-inspect-order-plan.vue
index 22dc87d..89ed36f 100644
--- a/src/components/view/b1-inspect-order-plan.vue
+++ b/src/components/view/b1-inspect-order-plan.vue
@@ -168,11 +168,24 @@
 		</el-dialog>
     <el-dialog title="妫�楠屼氦鎺�" :visible.sync="connectVisible" width="400px">
 			<div class="search_thing">
-        <div class="search_label" style="width:90px">浜ゆ帴浜哄憳锛�</div>
+        <div class="search_label" style="width:90px"><span class="required-span">* </span>浜ゆ帴浜哄憳锛�</div>
         <div class="search_input">
-          <el-select v-model="connectPerson" placeholder="璇烽�夋嫨" style="width: 100%;" filterable>
+          <el-select v-model="connect.connectPerson" placeholder="璇烽�夋嫨" style="width: 100%;" filterable>
             <el-option
               v-for="item in personList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </div>
+      </div>
+      <div class="search_thing">
+        <div class="search_label" style="width:90px"><span class="required-span">* </span>璇曢獙瀹わ細</div>
+        <div class="search_input">
+          <el-select v-model="connect.sonLaboratory" placeholder="璇烽�夋嫨" style="width: 100%;" filterable>
+            <el-option
+              v-for="item in sonLaboratoryList"
               :key="item.value"
               :label="item.label"
               :value="item.value">
@@ -233,9 +246,9 @@
 							font: '妫�楠�',
 							type: 'text',
 							method: 'handleInspection',
-							// disabFun: (row, index) => {
-							// 	return row.userId == null || row.insState == 3 || row.insState == 5||JSON.parse(localStorage.getItem("user")).name != row.userName
-							// }
+							disabFun: (row, index) => {
+								return row.userId == null || row.insState == 3 || row.insState == 5||JSON.parse(localStorage.getItem("user")).name != row.userName
+							}
               // disabFun: (row, index) => {
 							// 	return row.userId == null || row.insState == 3 || row.insState == 5
 							// }
@@ -308,9 +321,13 @@
 				orderId: 0,
         personList:[],
         connectVisible:false,
-        connectPerson:'',
+        connect:{
+          connectPerson:'',
+          sonLaboratory:''
+        },
         loading:false,
-        currentTime: null
+        currentTime: null,
+        sonLaboratoryList:[]
 			}
 		},
 		created() {
@@ -375,7 +392,8 @@
 				if (row) {
 					this.sampleUserForm = {
 						entrustCode: row.entrustCode,
-						insSampleId: row.id
+						insSampleId: row.id,
+            sonLaboratory: row.sonLaboratory,
 					}
 					this.claimVisible = true
 				}
@@ -502,14 +520,37 @@
       },
       handleConnect(row){
         this.orderId = row.id
+        this.connect = {}
         this.connectVisible=true;
+        this.$axios.post(this.$api.insOrderPlan.upPlanUser2, {
+            orderId:this.orderId,
+          }).then(res => {
+					if (res.code === 200&&res.data.length>0) {
+            this.sonLaboratoryList = [];
+            res.data.forEach(m=>{
+              this.sonLaboratoryList.push({
+                value:m,
+                label:m
+              })
+            })
+            this.connect.sonLaboratory = this.sonLaboratoryList[0].value
+					}
+				})
       },
       confirmConnect(){
-        if(this.connectPerson){
-          this.loading = true;
+        if(this.connect.connectPerson==null||this.connect.connectPerson==''||this.connect.connectPerson==undefined){
+          this.$message.error('鏈�夋嫨浜ゆ帴浜哄憳')
+          return
+        }
+        if(this.connect.sonLaboratory==null||this.connect.sonLaboratory==''||this.connect.sonLaboratory==undefined){
+          this.$message.error('鏈�夋嫨璇曢獙瀹�')
+          return
+        }
+        this.loading = true;
           this.$axios.post(this.$api.insOrderPlan.upPlanUser, {
             orderId:this.orderId,
-            userId:this.connectPerson
+            userId:this.connect.connectPerson,
+            sonLaboratory:this.connect.sonLaboratory,
           }).then(res => {
 					if (res.code === 200) {
             this.loading = false;
@@ -521,9 +562,6 @@
 					console.error(error)
           this.loading = false;
 				})
-        }else{
-          this.$message.error('鏈�夋嫨浜ゆ帴浜哄憳')
-        }
       },
       handleReview(row){
         this.state = 2;
diff --git a/src/components/view/b1-inspection-order.vue b/src/components/view/b1-inspection-order.vue
index e7ac309..238a71c 100644
--- a/src/components/view/b1-inspection-order.vue
+++ b/src/components/view/b1-inspection-order.vue
@@ -289,8 +289,17 @@
 						<el-col class="search_thing" style="width: 95%;">
 							<div class="search_label"><span class="required-span" v-show="distributeData.type==2">* </span>鎸囨淳浜哄憳锛�</div>
 							<div class="search_input">
-								<el-select v-model="distributeData.userId" placeholder="璇烽�夋嫨" size="small" style="width: 100%;" clearable filterable>
+								<el-select v-model="distributeData.userId" placeholder="璇烽�夋嫨" size="small" style="width: 100%;" clearable filterable @change="changeUser">
 									<el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">
+									</el-option>
+								</el-select>
+							</div>
+						</el-col>
+            <el-col class="search_thing" style="width: 95%;" v-if="distributeData.userId">
+							<div class="search_label"><span class="required-span" >* </span>璇曢獙瀹わ細</div>
+							<div class="search_input">
+								<el-select v-model="distributeData.sonLaboratory" placeholder="璇烽�夋嫨" size="small" style="width: 100%;" clearable filterable>
+									<el-option v-for="(item,i) in sonLaboratoryList" :key="i" :label="item.label" :value="item.value">
 									</el-option>
 								</el-select>
 							</div>
@@ -452,7 +461,8 @@
 					orderId: '',
 					sampleId: '',
 					appointed: '',
-					userId: ''
+					userId: '',
+          sonLaboratory:''
 				},
 				// 浜哄憳鍒楄〃
 				personList: [],
@@ -659,7 +669,8 @@
           }
         ],
         qrData:[],
-        multipleSelection:[]
+        multipleSelection:[],
+        sonLaboratoryList:[]
 			}
 		},
     watch:{
@@ -877,14 +888,32 @@
 					this.distributeData.appointed = res.data
           this.distributeData.type = row.type
 				})
+        this.$axios.post(this.$api.insOrderPlan.upPlanUser2, {
+            orderId:row.id,
+          }).then(res => {
+					if (res.code === 200&&res.data.length>0) {
+            this.sonLaboratoryList = [];
+            res.data.forEach(m=>{
+              this.sonLaboratoryList.push({
+                value:m,
+                label:m
+              })
+            })
+					}
+				})
 			},
 			submitForm2() {
 				if (this.distributeData.appointed == null || this.distributeData.appointed == '') {
 					this.$message.error('绾﹀畾鏃堕棿鏈~鍐�')
 					return
 				}
+        //
         if(this.distributeData.type==2&&(this.distributeData.userId==null||this.distributeData.userId=='')){
 					this.$message.error('鎸囨淳浜哄憳鏈~鍐�')
+					return
+				}
+        if(this.distributeData.userId&&(this.distributeData.sonLaboratory==null||this.distributeData.sonLaboratory=='')){
+					this.$message.error('璇曢獙瀹ゆ湭濉啓')
 					return
 				}
 				this.upLoad = true;
@@ -892,7 +921,8 @@
 					orderId: this.distributeData.orderId,
 					sampleId: this.distributeData.sampleId,
 					appointed: this.distributeData.appointed,
-					userId: this.distributeData.userId
+					userId: this.distributeData.userId,
+          sonLaboratory:this.distributeData.sonLaboratory,
 				}).then(res => {
 					if (res.code === 201) {
 						this.upLoad = false
@@ -985,6 +1015,11 @@
       },
       getStyle(){
         return 'height: calc(100% - '+(this.more?'94':'44')+'px)'
+      },
+      changeUser(){
+        if(this.sonLaboratoryList.length>0){
+          this.distributeData.sonLaboratory = this.sonLaboratoryList[0].value
+        }
       }
 		}
 	}
diff --git a/src/main.js b/src/main.js
index fe3f8d2..1ce1506 100644
--- a/src/main.js
+++ b/src/main.js
@@ -15,13 +15,13 @@
 Vue.prototype.$Big = Big;
 
 // 椤圭洰鍒囨崲
-// Vue.prototype.PROJECT = '妫�娴嬩腑蹇�'
-Vue.prototype.PROJECT = '瑁呭鐢电紗'
+Vue.prototype.PROJECT = '妫�娴嬩腑蹇�'
+// Vue.prototype.PROJECT = '瑁呭鐢电紗'
 //鏈湴
 // Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
 // const javaApi = 'http://127.0.0.1:8001';
 // 寮狅細192.168.45.249
-// const javaApi = 'http://172.20.10.4:8001';
+const javaApi = 'http://172.20.10.5:8001';
 
 //浜�
 // Vue.prototype.LOCATIONVUE = "http://114.132.189.42:8080";
@@ -33,7 +33,7 @@
 
 //瑁呭鐢电紗娴嬭瘯搴�
 // Vue.prototype.LOCATIONVUE = "http://10.16.173.59";
-const javaApi = 'http://10.16.173.59:8001';
+// const javaApi = 'http://10.16.173.59:8001';
 // const javaApi = 'http://192.168.47.2:8001';
 
 Vue.prototype.HaveJson = (val) => {
diff --git a/src/view/notice.vue b/src/view/notice.vue
index 359ec7b..71a978f 100644
--- a/src/view/notice.vue
+++ b/src/view/notice.vue
@@ -7,7 +7,7 @@
   :before-close="handleClose" style="height: 100vh;z-index: 9999999;" size="450px">
     <div class="notice-content" v-loading="loading">
       <el-button size="small" type="primary" @click="handleDropdownAll(1)" style="margin-bottom: 10px;margin-left: 330px;">鍏ㄩ儴宸茶</el-button>
-      <scroll-pagination @load="refresh" :finishLoding="finishLoding" :list="list" style="height: calc(100% - 50px);" v-if="list.length>0||loading">
+      <scroll-pagination @load="refresh" :finishLoding="finishLoding" :list="list" style="height: calc(100% - 50px);">
         <div
         class="notice-content-item"
         v-for="(m,i) in list"
@@ -24,7 +24,7 @@
           </div>
         </div>
       </scroll-pagination>
-      <!-- <div v-if="list.length<1&&!loading" style="color:#909399;font-size:14px;text-align: center;margin-top:200px" >鏆傛棤鏁版嵁</div> -->
+      <div v-if="list.length<1&&!loading" style="color:#909399;font-size:14px;text-align: center;margin-top:200px" >鏆傛棤鏁版嵁</div>
     </div>
   </el-drawer>
 </div>
@@ -70,22 +70,7 @@
           value:4
         },
       ],
-      list:[
-        // {
-        //   messageType:1,
-        //   theme:'娴嬭瘯鏍囬',
-        //   createTime: '2019-08-30 15:46:17',
-        //   createUser:'<USERNAME>',
-        //   viewStatus:false,
-        // },
-        // {
-        //   messageType:2,
-        //   theme:'娴嬭瘯鏍囬',
-        //   createTime: '2019-08-30 15:46:17',
-        //   createUser:'<USERNAME>',
-        //   viewStatus:true,
-        // },
-      ],
+      list:[],
       currentPage:1,
       pageSize: 8, // 涓�椤�7鏉�
       total: null,

--
Gitblit v1.9.3