From c3c23631be761f336789f4cc11d33fab2ec9f125 Mon Sep 17 00:00:00 2001
From: xwt <2740516069@qq.com>
Date: 星期二, 12 八月 2025 09:43:02 +0800
Subject: [PATCH] 来料检修改,推送钉钉修改

---
 pages/QC/XJ/Add.vue  |  107 +++++++--------------
 manifest.json        |    2 
 pages/QC/LLJ/Add.vue |  183 ++++++++++++++++++++++++------------
 store/index.js       |    4 
 4 files changed, 159 insertions(+), 137 deletions(-)

diff --git a/manifest.json b/manifest.json
index d7929e2..e54fe41 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,7 +2,7 @@
     "name" : "GS-MES-AP",
     "appid" : "__UNI__F08FAE3",
     "description" : "",
-    "versionName" : "1.1.3.0",
+    "versionName" : "1.1.3.1",
     "versionCode" : 1,
     "transformPx" : false,
     /* 5+App鐗规湁鐩稿叧 */
diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue
index 45778cf..4492c63 100644
--- a/pages/QC/LLJ/Add.vue
+++ b/pages/QC/LLJ/Add.vue
@@ -63,37 +63,23 @@
 		</view>
 		<view class="dropdown-row">
 			<view class="info-label">涓嶈壇鍘熷洜锛�</view>
-			<select id="defect-reason" v-model="badreason" v-if="current" @change="saveRemarksGid">
-				<option value=""></option>
-				<option value="澶栬涓嶈壇">澶栬涓嶈壇</option>
-				<option value="灏哄涓嶈壇">灏哄涓嶈壇</option>
-				<option value="鍖呰涓嶈壇">鍖呰涓嶈壇</option>
-				<option value="鎬ц兘涓嶈壇">鎬ц兘涓嶈壇</option>
-				<option value="瑁呴厤涓嶈壇">瑁呴厤涓嶈壇</option>
-				<option value="瀹夎涓嶈壇">瀹夎涓嶈壇</option>
-			</select>
+			<picker v-if="current" :value="badreasonIndex" :range="badreasonOptions" @change="onBadreasonChange">
+				<view class="picker-text" :class="{ 'selected': badreason }">{{ badreason || '' }}</view>
+			</picker>
 			<view v-else class="info-value">{{ badreason }}</view>
 		</view>
 		<view class="dropdown-row">
 			<view class="info-label">鎵�灞炶溅闂达細</view>
-			<select id="defect-reason" v-model="WORKSHOP" v-if="current" @change="saveRemarksGid">
-				<option value=""></option>
-				<option value="鐢熶骇涓�閮�">鐢熶骇涓�閮�</option>
-				<option value="鐢熶骇浜岄儴">鐢熶骇浜岄儴</option>
-				<option value="娉ㄥ杞﹂棿">娉ㄥ杞﹂棿</option>
-				<option value="鍏朵粬">鍏朵粬</option>
-			</select>
+			<picker v-if="current" :value="workshopIndex" :range="workshopOptions" @change="onWorkshopChange">
+				<view class="picker-text" :class="{ 'selected': WORKSHOP }">{{ WORKSHOP || '' }}</view>
+			</picker>
 			<view v-else class="info-value">{{ WORKSHOP }}</view>
 		</view>
 		<view class="dropdown-row">
 			<view class="info-label">璇勫鐘舵�侊細</view>
-			<select id="defect-reason" v-model="PSTYPE" v-if="current" @change="saveRemarksGid">
-				<option value=""></option>
-				<option value="鐗归噰/璁╂浣跨敤">鐗归噰/璁╂浣跨敤</option>
-				<option value="鎸戦��/杩斿伐浣跨敤">鎸戦��/杩斿伐浣跨敤</option>
-				<option value="閫�璐�">閫�璐�</option>
-				<option value="寰呭垽">寰呭垽</option>
-			</select>
+			<picker v-if="current" :value="pstypeIndex" :range="pstypeOptions" @change="onPstypeChange">
+				<view class="picker-text" :class="{ 'selected': PSTYPE }">{{ PSTYPE || '' }}</view>
+			</picker>
 			<view v-else class="info-value">{{ PSTYPE }}</view>
 		</view>
 					<view class="info-block" style="margin-top: 10px;">   
@@ -199,7 +185,7 @@
 						<uni-th align="center" width="90">鑳藉惁鎵撳紑鏂囦欢</uni-th>
 						<uni-th align="center" width="150">鎿嶄綔锛堢偣鍑伙級</uni-th>
 					</uni-tr>
-					<uni-tr v-for="(item,index) in drawing" style="height: 100px;">
+					<uni-tr v-for="(item,index) in (drawing || [])" style="height: 100px;">
 						<uni-td align="center">{{item.fName}}</uni-td>
 						<uni-td align="center" style="font-size:25px;">
 							<div v-if="item.fRelevantObject==' '" style="color: #E47470;">脳</div>
@@ -360,6 +346,13 @@
 				PSTYPE: '',
 				WORKSHOP: '',
 				REMARK: '',
+				// picker 閫夐」鍜岀储寮�
+				badreasonOptions: ['', '澶栬涓嶈壇', '灏哄涓嶈壇', '鍖呰涓嶈壇', '鎬ц兘涓嶈壇', '瑁呴厤涓嶈壇', '瀹夎涓嶈壇'],
+				badreasonIndex: 0,
+				workshopOptions: ['', '鐢熶骇涓�閮�', '鐢熶骇浜岄儴', '娉ㄥ杞﹂棿', '鍏朵粬'],
+				workshopIndex: 0,
+				pstypeOptions: ['', '鐗归噰/璁╂浣跨敤', '鎸戦��/杩斿伐浣跨敤', '閫�璐�', '寰呭垽'],
+				pstypeIndex: 0,
 				checkState: false,
 				writeStatu: true,
 				fileName:'',
@@ -494,16 +487,68 @@
 				this.remarks = this.formData.remarks || this.remarks || '';
 				console.log('鎵撳紑寮圭獥鏃剁殑remarks鍊�:', this.remarks);
 			},
+			// picker 浜嬩欢澶勭悊鏂规硶
+			onBadreasonChange(e) {
+				const index = e.detail.value;
+				this.badreasonIndex = index;
+				this.badreason = this.badreasonOptions[index];
+				this.saveRemarksGid('badreason');
+			},
+			onWorkshopChange(e) {
+				const index = e.detail.value;
+				this.workshopIndex = index;
+				this.WORKSHOP = this.workshopOptions[index];
+				this.saveRemarksGid('WORKSHOP');
+			},
+			onPstypeChange(e) {
+				const index = e.detail.value;
+				this.pstypeIndex = index;
+				this.PSTYPE = this.pstypeOptions[index];
+				this.saveRemarksGid('PSTYPE');
+			},
+			saveRemarksGid(fieldName) {
+			  // 鐩存帴淇濆瓨鍒版暟鎹簱
+			  const requestData = {
+				  gid: this.formData.id,
+				  releaseNo: this.formData.releaseNo,
+				  BLYY: this.badreason || '',
+				  SSCJ: this.WORKSHOP || '',
+				  PSZT: this.PSTYPE || ''
+			  };
+			  console.log('鍙戦�佺殑鏁版嵁:', requestData);
+			  console.log('badreason:', this.badreason);
+			  console.log('WORKSHOP:', this.WORKSHOP);
+			  console.log('PSTYPE:', this.PSTYPE);
+			  console.log('閫夋嫨鐨勫瓧娈�:', fieldName);
+			  this.$post({
+				  url: "/LLJ/saveDropdownFields",
+				  data: requestData
+			  }).then(res => {
+				  if (res && res.data && res.data.data && res.data.data.tbBillList && res.data.data.tbBillList.length > 0) {
+					  // 寤惰繜閲嶆柊鍔犺浇鏁版嵁锛岀‘淇濇暟鎹簱鏇存柊瀹屾垚
+					  setTimeout(() => {
+						  this.init();
+					  }, 500);
+				  }
+			  }).catch(err => {
+				  console.error('淇濆瓨澶辫触锛�', err);
+			  });
+			},
 			submitInspection() {
-				if (this.PSTYPE == '') {
-					this.writeStatu = false
-				}
-				if (this.badreason == '') {
-					this.writeStatu = false
-				}
-				if (this.DEPARTMENT == '') {
-					this.writeStatu = false
-				}
+				
+				// 閲嶇疆楠岃瘉鐘舵��
+				this.writeStatu = true;
+				
+				// if (this.PSTYPE == '') {
+				// 	this.writeStatu = false
+				// }
+				// if (this.badreason == '') {
+				// 	this.writeStatu = false
+				// }
+				// 绉婚櫎瀵规湭瀹氫箟鍙橀噺DEPARTMENT鐨勬鏌�
+				// if (this.DEPARTMENT == '') {
+				// 	this.writeStatu = false
+				// }
 
 				console.log(this.tableData)
 				this.checkState = false;
@@ -514,9 +559,9 @@
 				})
 				if (this.checkState) {
 
-					if (this.formData.fngDesc == '' || this.writeStatu == false) {
+					if (this.formData.fngDesc == '') {
 						uni.showToast({
-							title: '鏈~鍐欎笉鑹弿杩版垨涓嶈壇鍘熷洜鎴栨墍灞炶溅闂存垨璇勫鐘舵��',
+							title: '鏈~鍐欎笉鑹弿杩�',
 							icon: 'none'
 						});
 					} else {
@@ -538,13 +583,13 @@
 										suppName: this.formData.suppName,
 										appicationReason: this.formData.fngDesc,
 										badReason: this.badreason,
-										remark: this.REMARK,
+										remark: this.remarks || '',
 										workShop: this.WORKSHOP,
 										releaseNo: this.formData.releaseNo,
 										staffNo: 'HMCS',
 										// staffNo: this.$loginInfo.account,
 										iqcStatus: this.PSTYPE,
-										department: this.DEPARTMENT,
+										department: this.WORKSHOP, // 浣跨敤WORKSHOP鏇夸唬鏈畾涔夌殑DEPARTMENT
 										EMERGENCY: this.formData.emergencyStatus ? "1" : "0" // 纭繚绱ф�ユ斁琛岀姸鎬佹纭紶閫�
 									};
 								}
@@ -556,13 +601,13 @@
 										suppName: this.formData.suppName,
 										appicationReason: this.formData.fngDesc,
 										badReason: this.badreason,
-										remark: this.REMARK,
+										remark: this.remarks || '',
 										workShop: this.WORKSHOP,
 										releaseNo: this.formData.releaseNo,
 										// staffNo: 'HMCS',
 										staffNo: this.$loginInfo.account,
 										iqcStatus: this.PSTYPE,
-										department: this.DEPARTMENT,
+										department: this.WORKSHOP, // 浣跨敤WORKSHOP鏇夸唬鏈畾涔夌殑DEPARTMENT
 										EMERGENCY: this.formData.emergencyStatus ? "1" : "0" // 纭繚绱ф�ユ斁琛岀姸鎬佹纭紶閫�
 									};
 								}
@@ -693,6 +738,11 @@
 						this.PSTYPE = data.pszt || '';
 						this.WORKSHOP = data.sscj || '';
 						this.remarks = data.remarks || ''; // 璁剧疆remarks鍙橀噺
+						
+						// 璁剧疆 picker 绱㈠紩
+						this.badreasonIndex = this.badreasonOptions.indexOf(this.badreason);
+						this.workshopIndex = this.workshopOptions.indexOf(this.WORKSHOP);
+						this.pstypeIndex = this.pstypeOptions.indexOf(this.PSTYPE);
 
 						
 						// 纭繚PHSY瀛楁琚纭缃�
@@ -782,7 +832,7 @@
 					success: (response) => {
 						console.log(response)
 						if (response.data.data == '杩斿洖缁撴灉涓虹┖') {
-							_this.drawing = null
+							_this.drawing = []
 						} else {
 							_this.drawing = response.data.data
 							// 閬嶅巻鏁版嵁锛屽垽鏂枃浠跺悗缂�骞舵坊鍔犲瓧娈�
@@ -1245,11 +1295,13 @@
 							if (res.data.tbBillList > 0) {
 								this.formData.remarks = this.remarks;
 								this.remarksPopup = !this.remarksPopup;
-								this.$showMessage("淇濆瓨鎴愬姛");
+								// 绔嬪嵆閲嶆柊鍔犺浇鏁版嵁纭繚鍚屾
 								setTimeout(() => {
 									this.init();
-								}, 2000);
+								}, 500);
 							}
+						}).catch(err => {
+							console.error('淇濆瓨澶辫触锛�', err);
 						})
 					},
 			addDestruction() {
@@ -1280,11 +1332,13 @@
 					if (res.data.tbBillList > 0) {
 						this.formData.PHSY = this.PHSY === '' ? null : this.PHSY;
 						this.destructionPopup = false;
-						this.$showMessage("淇濆瓨鎴愬姛");
+						// 绔嬪嵆閲嶆柊鍔犺浇鏁版嵁纭繚鍚屾
 						setTimeout(() => {
 							this.init();
-						}, 2000);
+						}, 500);
 					}
+				}).catch(err => {
+					console.error('淇濆瓨澶辫触锛�', err);
 				})
 			},
 			clearDestruction() {
@@ -1300,11 +1354,13 @@
 					if (res.data.tbBillList > 0) {
 						this.formData.PHSY = null;
 						this.destructionPopup = false;
-						this.$showMessage("娓呴櫎鎴愬姛");
+						// 绔嬪嵆閲嶆柊鍔犺浇鏁版嵁纭繚鍚屾
 						setTimeout(() => {
 							this.init();
-						}, 2000);
+						}, 500);
 					}
+				}).catch(err => {
+					console.error('娓呴櫎澶辫触锛�', err);
 				})
 			},
 			viewAttachmentInfo() {
@@ -1872,22 +1928,7 @@
 				}
 				// #endif
 			},
-			saveRemarksGid() {
-			  this.$post({
-				url: "/LLJ/saveDropdownFields",
-				data: {
-				  gid: this.formData.id,
-				  releaseNo: this.formData.releaseNo,
-				  BLYY: this.badreason || '',
-				  SSCJ: this.WORKSHOP || '',
-				  PSZT: this.PSTYPE || ''
-				}
-			  }).then(res => {
-				if (res.data.tbBillList > 0) {
-				  this.$showMessage("鑷姩淇濆瓨鎴愬姛");
-				}
-			  });
-			},
+			
 		}
 	}
 </script>
@@ -1948,6 +1989,24 @@
 		color: #2c3e50;
 		margin-right: 20px;
 	}
+	
+	.picker-text {
+		padding: 6px 10px;
+		border: 1px solid #ddd;
+		border-radius: 4px;
+		background-color: white;
+		color: #999;
+		font-size: 14px;
+		min-height: 32px;
+		display: flex;
+		align-items: center;
+		max-width: 150px;
+	}
+	
+	.picker-text.selected {
+		color: #e74c3c;
+		font-weight: 500;
+	}
 
 	.highlight {
 		font-weight: bold;
diff --git a/pages/QC/XJ/Add.vue b/pages/QC/XJ/Add.vue
index 7140538..e393806 100644
--- a/pages/QC/XJ/Add.vue
+++ b/pages/QC/XJ/Add.vue
@@ -40,20 +40,16 @@
               <view v-else class="info-value">{{ formData.daa020 }}</view>
             </view>
             <view class="info-item">
-              <view class="info-label">鐗╂枡缂栫爜</view>
-              <picker v-if="isUpdate" class="picker-input" name="selector" :range="ItemList"
-                      @change="onItemChange">
-                <view class="picker-value">{{ ItemList[ItemIndex] || '璇烽�夋嫨' }}</view>
-              </picker>
-              <view v-else class="info-value">{{ formData.itemNo }}</view>
-            </view>
-            <view class="info-item">
               <view class="info-label">宸ュ崟鍗曞彿</view>
               <picker v-if="isUpdate" class="picker-input" name="selector" :range="DAA001List"
                       @change="onDaa001Change">
                 <view class="picker-value">{{ DAA001List[DAA001Index] || '璇烽�夋嫨' }}</view>
               </picker>
               <view v-else class="info-value">{{ formData.billNo }}</view>
+            </view>
+            <view class="info-item">
+              <view class="info-label">鐗╂枡缂栫爜</view>
+              <view class="info-value">{{ formData.itemNo }}</view>
             </view>
             <view class="info-item">
               <view class="info-label">鐗╂枡鍚嶇О</view>
@@ -173,16 +169,12 @@
         DAA020Index: -1,
         filteredDAA020List: [],
   
-        DAA001List: [],
+                DAA001List: [],
         DAA001Index: -1,
         schemeResult: [],
-  
-        isShowTable: false,
-  
-        ItemList: [],
-        ItemIndex: -1,
-        boardItems: [],
-  
+
+                isShowTable: false,
+
         lineList: [],
   
         lineNo: "",
@@ -376,86 +368,57 @@
         });
       },
       
-      //鐢熶骇绾垮埆閫夋嫨骞跺垵濮嬭瘽宸ュ崟鍙�
+            //鐢熶骇绾垮埆閫夋嫨骞跺垵濮嬪寲宸ュ崟鍙�
       onDaa020Change(event) {
         //鑾峰彇鐢熶骇绾垮埆鐨勪笅鏍囧湴鍧�
         this.DAA020Index = event.mp.detail.value;
-  
+
         this.lineNo = this.lineList[this.DAA020Index].lineNo;
-  
-        this.$post({
-          url: "/XJ/getBoardItem",
-          data: {
-            lineNo: this.lineNo
-          }
-        }).then(res => {
-          //濉厖宸ュ崟鍙风殑鏁版嵁婧�
-          this.boardItems = res.data.tbBillList;
-          this.ItemList = this.boardItems.map(item => item.itemNo);
-          //鍙樹负榛樿绌哄�肩殑鐘舵��
-          this.ItemIndex = -1;
-        })
-  
-      },
-      onItemChange(event) {
-        this.ItemIndex = event.mp.detail.value;
-        this.formData.itemNo = this.boardItems[this.ItemIndex].itemNo;//涓昏鏄敼杩欓噷
-        this.formData.itemId = this.boardItems[this.ItemIndex].id;//涓昏鏄敼杩欓噷
-        this.formData.itemName = this.boardItems[this.ItemIndex].itemName;//涓昏鏄敼杩欓噷
-        this.formData.itemModel = this.boardItems[this.ItemIndex].itemModel;//涓昏鏄敼杩欓噷
+
         this.$post({
           url: "/XJ/getDaa001",
           data: {
-            daa020: this.lineNo,
-            item: this.formData.itemNo
+            daa020: this.lineNo
           }
         }).then(res => {
           //濉厖宸ュ崟鍙风殑鏁版嵁婧�
           this.schemeResult = res.data.tbBillList;
-          this.DAA001List = this.schemeResult.map(s => s.daa001);
+          this.DAA001List = this.schemeResult.map(s => s.Daa001);
           //鍙樹负榛樿绌哄�肩殑鐘舵��
           this.DAA001Index = -1;
-  
+
           this.formData.billNo = "";
         })
+
       },
-      //閫夊彇宸ュ崟濉厖鐗╂枡鍙峰拰鍏朵粬淇℃伅
+      
+            //閫夊彇宸ュ崟濉厖鐗╂枡鍙峰拰鍏朵粬淇℃伅
       onDaa001Change(event) {
         this.DAA001Index = event.mp.detail.value;
-        this.formData.billNo = this.schemeResult[this.DAA001Index].daa001;
-        this.formData.planQty = this.schemeResult[this.DAA001Index].daa008;
-        //琛ㄥ崟涓殑閮ㄥ垎瀛楁璧嬪��
+        const selectedWorkOrder = this.schemeResult[this.DAA001Index];
+        this.formData.billNo = selectedWorkOrder.Daa001;
+        this.formData.planQty = selectedWorkOrder.Daa008;
+        
+        // 浠庡伐鍗曟暟鎹腑鑾峰彇鐗╂枡淇℃伅
+        this.formData.itemNo = selectedWorkOrder.ItemNo; // 鐗╂枡缂栫爜
+        this.formData.itemName = selectedWorkOrder.ItemName; // 鐗╂枡鍚嶇О
+        this.formData.itemModel = selectedWorkOrder.ItemModel; // 瑙勬牸鍨嬪彿
+        
+        // 鑾峰彇妫�楠岄」鐩�
         this.$post({
-          url: "/XJ/getItem",
+          url: "/XJ/setJYItem",
           data: {
-            daa001: this.formData.billNo
+            itemNo: this.formData.itemNo
           }
         }).then(res => {
-          let data = res.data.tbBillList[0];
-          //褰撹繑鍥炵殑缁撴灉闆嗕负绌烘椂缃┖鍘熸湁鐨勫��
-          if (!data) {
-            this.formData.billNo = "";
-            this.formData.itemNo = "";
-            this.formData.planQty = "";
+          if (res.data.tbBillList.length > 0) {
+            this.tableData = res.data.tbBillList;
+            this.isSubmit = false;
+          } else {
+            this.$showMessage("姝ょ墿鏂欐病鏈夊惎鐢ㄧ殑妫�楠岄」鐩紝璇风淮鎶�!");
+            this.isSubmit = true;
             this.tableData = [];
-            return;
           }
-  
-          this.$post({
-            url: "/XJ/setJYItem",
-            data: {
-              itemNo: this.formData.itemNo
-            }
-          }).then(res => {
-            if (res.data.tbBillList.length > 0) {
-              this.tableData = res.data.tbBillList; // 鍦ㄧ澶村嚱鏁颁腑锛宼his 鎸囧悜澶栧眰浣滅敤鍩熺殑 this
-              this.isSubmit = false;
-            } else {
-              this.$showMessage("姝ょ墿鏂欐病鏈夊惎鐢ㄧ殑妫�楠岄」鐩紝璇风淮鎶�!");
-              this.isSubmit = true;
-              this.tableData = [];
-            }
-          });
         });
       },
       init() {
diff --git a/store/index.js b/store/index.js
index 3fb8f02..d50ed24 100644
--- a/store/index.js
+++ b/store/index.js
@@ -10,9 +10,9 @@
 			networkFlag:'鍐呯綉', 
 			serverURLInt:'http://192.168.11.251:10055',//鏈嶅姟鍣ㄤ綋妫� 10.0.1.104:10054
 			serverURL:'http://localhost:10055',//鏈湴璋冭瘯鍦板潃
-			serverAPI:'http://localhost:5184/api',//褰撳墠姝e湪浣跨敤鐨勬湇鍔″櫒,榛樿涓哄缃�  localhost
+			//serverAPI:'http://localhost:5184/api',//褰撳墠姝e湪浣跨敤鐨勬湇鍔″櫒,榛樿涓哄缃�  localhost
 			//serverAPI:'http://192.168.1.22:10054/api',//鍐呯綉 
-			//serverAPI:'http://36.26.21.214:10055/api',
+			serverAPI:'http://36.26.21.214:10055/api',
 			ftpServer:'ftp://36.26.21.214',//FTP鏈嶅姟鍣ㄥ湴鍧�
 		}
 	},

--
Gitblit v1.9.3