From b22000f1e0034376f408d236f4425e1dc98e51d8 Mon Sep 17 00:00:00 2001
From: yhj <1836460075@qq.com>
Date: 星期三, 05 六月 2024 13:58:28 +0800
Subject: [PATCH] 查看图号

---
 pages/inspection/inspectionInfo.vue |  190 ++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 163 insertions(+), 27 deletions(-)

diff --git a/pages/inspection/inspectionInfo.vue b/pages/inspection/inspectionInfo.vue
index 8510821..ae31139 100644
--- a/pages/inspection/inspectionInfo.vue
+++ b/pages/inspection/inspectionInfo.vue
@@ -11,9 +11,25 @@
 							<label>{{item.TASK_NO}}</label>
 						</u-col>
 					</u-row>
+					<u-row customStyle="margin-bottom: 10px" v-if="item.LOT_NO">
+						<u-col span="2">
+							<label>閿�鍞崟鍙�:</label>
+						</u-col>
+						<u-col span="4">
+							<label>{{item.LOT_NO}}</label>
+						</u-col>
+					</u-row>
 					<u-row customStyle="margin-bottom: 10px">
 						<u-col span="2">
-							<label>鏈哄彴鍙�:</label>
+							<label>宸ュ崟鏁伴噺:</label>
+						</u-col>
+						<u-col span="4">
+							<label>{{item.DAA008}}</label>
+						</u-col>
+					</u-row>
+					<u-row customStyle="margin-bottom: 10px">
+						<u-col span="2">
+							<label>鏈哄彴 / 浜х嚎:</label>
 						</u-col>
 						<u-col span="4">
 							<label>{{item.MACHINE_NO}}</label>
@@ -53,21 +69,31 @@
 					</u-row>
 					<u-row customStyle="margin-bottom: 10px">
 						<u-col span="2">
-							<label>妫�楠屽憳:</label>
+							<label>妫�楠屽憳/妫�楠岀被鍨�:</label>
 						</u-col>
 						<u-col span="4">
-							<label>{{name}}</label>
+							<label>{{item.OPERATE_MAN}} / {{item.FTYPE}}</label>
 						</u-col>
 					</u-row>
-					<u-row customStyle="margin-bottom: 10px">
-						<u-col span="2">
-							<label>妫�楠岀被鍨�</label>
-						</u-col>
-						<u-col span="4">
-							<label>{{item.FTYPE}}</label>
-						</u-col>
-					</u-row>
+					<u-button text="鐢熸垚妫�楠岃祫鏂�" type="primary" :plain="true" style="width: 200px;height: 100px;position: absolute;top: 30%;right: 10%;" @click="generate()"></u-button>
 				</view>
+			
+				
+				 <view class="container">
+				     <button @click="fetchDrawingNumber">鏌ョ湅鍥惧彿</button>
+				 
+				     <!-- 寮瑰嚭绐楀彛 -->
+				     <view v-if="pdfVisible" class="modal">
+				       <view class="modal-content">
+				         <view class="modal-header">
+				           <text>PDF棰勮</text>
+				           <button @click="closeModal">鍏抽棴</button>
+				         </view>
+				         <web-view v-if="pdfLink" :src="pdfLink" class="pdf-view"></web-view>
+				       </view>
+				     </view>
+				   </view>
+				
 			</uni-card>
 		</view>
 
@@ -76,13 +102,14 @@
 				<!-- 琛ㄥご琛� -->
 				<uni-tr>
 					<uni-th align="center" width="60">妫�楠岄」鐩�</uni-th>
-					<uni-th align="center" width="80">妫�楠屽伐鍏�</uni-th>
+					<uni-th align="center" width="60">妫�楠屽伐鍏�</uni-th>
 					<uni-th align="center" width="140">瑙勬牸</uni-th>
-					<uni-th align="center" width="40">妫�楠屾暟閲�</uni-th>
+					<uni-th align="center" width="80" v-if="item.DEPARTMENT_NO=='HS0202'">缁勪欢鍚嶇О</uni-th>
+					<uni-th align="center" width="40">鏁伴噺</uni-th>
 					<uni-th align="center" width="60">涓婇檺鍊�</uni-th>
 					<uni-th align="center" width="60">涓嬮檺鍊�</uni-th>
-					<uni-th align="center" width="80">妫�楠屽��</uni-th>
-					<uni-th align="center" width="75">妫�楠岀粨鏋�</uni-th>
+					<uni-th align="center" width="70">妫�楠屽��</uni-th>
+					<uni-th align="center" width="78">缁撴灉</uni-th>
 					<uni-th align="center" width="80">涓嶈壇鍘熷洜</uni-th>
 					<uni-th align="center" width="80">澶囨敞</uni-th>
 				</uni-tr>
@@ -91,6 +118,7 @@
 					<uni-td>{{item.CHECK_ITEM}}</uni-td>
 					<uni-td>{{item.CHECK_TOOL}}</uni-td>
 					<uni-td>{{item.SPECIFICATION}}</uni-td>
+					<uni-td v-if="item.FTEXT_TYPE">{{item.FTEXT_TYPE}}</uni-td>
 					<uni-td>{{item.CHECK_NUM}}</uni-td>
 					<uni-td>{{item.UP_ALLOW}}</uni-td>
 					<uni-td>{{item.DOWN_ALLOW}}</uni-td>
@@ -101,15 +129,20 @@
 					</uni-td>
 					<uni-td>
 						<u-tag
-							v-if="item.UP_ALLOW && (item.VALUE <= item.UP_ALLOW && item.VALUE >= item.DOWN_ALLOW) || !item.UP_ALLOW && item.VALUE == '鍚堟牸'"
+							v-if="item.UP_ALLOW && (parseFloat(item.VALUE) <= parseFloat(item.UP_ALLOW) && parseFloat(item.VALUE) >= parseFloat(item.DOWN_ALLOW)) || (!item.UP_ALLOW && item.VALUE == '鍚堟牸')"
 							text="鍚堟牸" type="success"></u-tag>
 						<u-tag
-							v-if="item.UP_ALLOW && (item.VALUE > item.UP_ALLOW || item.VALUE < item.DOWN_ALLOW) || !item.UP_ALLOW && item.VALUE == '涓嶅悎鏍�'"
+							v-else
 							text="涓嶅悎鏍�" type="error"></u-tag>
 					</uni-td>
 					<uni-td>
-						<view class="content" @click="useOutClickSide">
+<!-- 						<view class="content" @click="useOutClickSide">
 							<easy-select ref="easySelect" size="medium" :value="item.BAD_REASON" @selectOne="selectOne($event,index)"></easy-select>
+						</view> -->
+						<view class="login">
+							<w-select style="margin-left: 20rpx;" v-model='chooseValue' defaultValue="璇烽�夋嫨" 
+							:list='list' valueName='CONTENT' keyName="ID" @change='change(index)'>
+							</w-select>
 						</view>
 					</uni-td>
 					<uni-td>
@@ -134,7 +167,9 @@
 <script>
 	import {
 		getInspectionInfo,
-		saveInspectionInfo
+		saveInspectionInfo,
+		getBadReason,
+		generateInfo
 	} from '../../api/inspection';
 	import {
 		baseUrl
@@ -146,7 +181,9 @@
 				table: [],
 				name: '',
 				remeke: '',
-				show: false
+				//show: false
+				chooseValue: "",
+				list: []
 			}
 		},
 		onLoad(option) {
@@ -154,6 +191,7 @@
 			this.item = item
 			this.getInspection(item.CHECK_NO)
 			this.name = uni.getStorageSync('userInfo').username
+			this.getBadReason()
 		},
 		onNavigationBarButtonTap(e) {
 			let that = this
@@ -205,12 +243,15 @@
 					console.log(this.table)
 				})
 			},
-			selectOne(options,index) {
-				this.table[index].BAD_REASON = options.label
-				console.log(options.label);
-			},
-			useOutClickSide() {
-				this.$refs.easySelect.hideOptions && this.$refs.easySelect.hideOptions()
+			// selectOne(options,index) {
+			// 	this.table[index].BAD_REASON = options.label
+			// 	console.log(options.label);
+			// },
+			// useOutClickSide() {
+			// 	this.$refs.easySelect.hideOptions && this.$refs.easySelect.hideOptions()
+			// },
+			change(index) {
+				this.table[index].BAD_REASON=this.chooseValue;
 			},
 			changeSwitch(item) {
 				console.log(item)
@@ -261,6 +302,38 @@
 					return
 				}
 			},
+			generate(){
+				generateInfo(this.item.CHECK_NO).then(res=>{
+					if(!res.result){
+						this.$refs.uToast.show({
+							message:res.msg,
+							type:'error'
+						})
+						return
+					}else{
+						this.$refs.uToast.show({
+							message: "鏇存柊鎴愬姛",
+							type: 'success'
+						})
+						this.table.splice(0,this.table.length)
+						this.getInspection(this.item.CHECK_NO)
+					}
+				})
+			},
+			getBadReason() {
+				
+				getBadReason().then(res => {
+					console.log(res)
+					if(!res.result) {
+						this.$refs.uToast.show({
+							message: res.msg,
+							type: 'error'
+						})
+						return
+					}
+					this.list = res.data
+				})
+			},
 			check() {
 				for(let item of this.table) {
 					if(item.VALUE === null) {
@@ -268,8 +341,71 @@
 					}
 				}
 				return true
+			
 			}
-		}
+		},
+		getMaterialInfo(checkNo) {
+		     return uni.request({
+		       url: '/check/getMaterialInfo?checkNo=' + checkNo,
+		       method: 'POST',
+		       header: {
+		         'Content-Type': 'application/json',
+		         'dataType': 'json',
+		         'Accept': 'application/json'
+		       }
+		     });
+		   },
+		    closeModal() {
+		           this.pdfVisible = false;
+		         },
+		fetchDrawingNumber() {
+						      // 鑾峰彇褰撳墠椤甸潰鐨勬楠屽崟鍙�
+						      const checkNo = this.item.CHECK_NO;
+						
+						      // 绗竴娆¤姹傦細鑾峰彇鐗╂枡淇℃伅
+						      this.getMaterialInfo(checkNo).then(res => {
+						        const data = res[1].data; // uni.request 杩斿洖鐨勬槸涓�涓暟缁勶紝res[1] 鎵嶆槸 response
+						        if (data.result) {
+						          const { materialId, drawingNumber } = data.data;
+						           const url = `http://192.168.0.98:808/deviceMessage.ashx?lb=${materialId}&id=${drawingNumber}`;
+		
+						          // 绗簩娆¤姹傦細鑾峰彇PDF閾炬帴
+						          uni.request({
+						            url: url,
+						            method: 'POST',
+						            success: (response) => {
+						              const respData = response.data;
+						              if (respData.result) {
+						                this.pdfLink = respData.link; // 璁剧疆PDF閾炬帴
+						                this.pdfVisible = true; // 鎵撳紑寮瑰嚭绐楀彛
+						              } else {
+						                uni.showToast({
+						                  title: respData.msg,
+						                  icon: 'none'
+						                });
+						              }
+						            },
+						            fail: (error) => {
+						              uni.showToast({
+						                title: '璇锋眰鍥惧彿閾炬帴澶辫触',
+						                icon: 'none'
+						              });
+						            }
+						          });
+						        } else {
+						          uni.showToast({
+						            title: data.msg,
+						            icon: 'none'
+						          });
+						        }
+						      }).catch(error => {
+						        uni.showToast({
+						          title: '鑾峰彇鐗╂枡淇℃伅澶辫触',
+						          icon: 'none'
+						        });
+						      });
+						    
+						}
 	}
 </script>
 

--
Gitblit v1.9.3