From b76e716ff4656191d73eba398e9eb39ee975e13b Mon Sep 17 00:00:00 2001 From: xwt <2740516069@qq.com> Date: 星期五, 04 七月 2025 12:58:09 +0800 Subject: [PATCH] 来料检优化,首检巡检 --- pages/QC/LLJ/Add.vue | 281 ++++++++++++++++++++++++++++++++----------------------- 1 files changed, 162 insertions(+), 119 deletions(-) diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue index 3d0778d..3edd803 100644 --- a/pages/QC/LLJ/Add.vue +++ b/pages/QC/LLJ/Add.vue @@ -89,11 +89,15 @@ </select> </view> - <view class="info-block" style="margin-top: 10px;"> + <view class="info-block" style="margin-top: 10px;"> <view class="info-label">澶囨敞锛�</view> <input type="text" id="lotNo1" v-model="formData.lotNo1" placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�" style="color: red; font-weight: bold;"/> + </view> + <view class="info-block" style="margin-top: 10px;"> + <view class="info-label">鐮村潖瀹為獙鏁伴噺锛�</view> + <view class="info-value highlight">{{formData.phsy}}</view> </view> @@ -145,6 +149,7 @@ <!-- 鎿嶄綔鎸夐挳鍖� --> <view class="action-buttons"> + <button class="secondary-btn" @click="addDestruction" v-if="this.current">鐮村潖瀹為獙</button> <button class="secondary-btn" @click="uploadImages">涓婁紶/鏌ョ湅鍥剧墖</button> <button class="secondary-btn" @click="fetchDrawingNumber">璋冨彇PLM鍥剧焊</button> <button class="secondary-btn" @click="addDefectDescription" v-if="this.current">娣诲姞涓嶈壇鎻忚堪</button> @@ -165,6 +170,21 @@ </view> </view> + <view v-if="destructionPopup" class="overlay"> + <view class="popup"> + <h3>鐮村潖瀹為獙鏁伴噺</h3> + <form> + <view class="form-group"> + <label class="form-label">鐮村潖瀹為獙鏁伴噺:</label> + <input class="form-input" type="text" v-model="PHSY" placeholder="鐣欑┖琛ㄧず娓呴櫎鏁伴噺" /> + </view> + </form> + <div v-if="!isInteger" class="error-message">璇疯緭鍏ユ暣鏁板�兼垨鐣欑┖</div> + <button class="updateBut" @click="editDestruction">淇敼</button> + <button @click="clearDestruction">娓呴櫎</button> + <button @click="destructionPopup = !destructionPopup">鍙栨秷</button> + </view> + </view> <view class="barcode"> <u-modal :show="drawingShow" title="鍥剧焊鏄庣粏" @confirm="drawingConfirm" @cancel="drawingCancel" @@ -225,6 +245,8 @@ permissionAccount: '', hasEmergencyPermission: false, showPopup: false, + PHSY:'', + EMERGENCY: '0', }, tableData: [], @@ -242,6 +264,9 @@ fileName:'', originalRemarks: '', hasEmergencyPermission: false, + destructionPopup: false, + PHSY: '', + isInteger: true, } }, @@ -306,7 +331,8 @@ data: { itemNo: this.formData.itemId, quantity: this.formData.fcovertQty, - releaseNo: this.formData.releaseNo + releaseNo: this.formData.releaseNo, + PHSY: this.formData.PHSY } }).then(res => { if (res.status == 0) { @@ -402,7 +428,8 @@ staffNo: 'HMCS', // staffNo: this.$loginInfo.account, iqcStatus: this.PSTYPE, - department: this.DEPARTMENT + department: this.DEPARTMENT, + EMERGENCY: this.formData.emergencyStatus ? "1" : "0" // 纭繚绱ф�ユ斁琛岀姸鎬佹纭紶閫� }; } else{ @@ -419,14 +446,16 @@ // staffNo: 'HMCS', staffNo: this.$loginInfo.account, iqcStatus: this.PSTYPE, - department: this.DEPARTMENT + department: this.DEPARTMENT, + EMERGENCY: this.formData.emergencyStatus ? "1" : "0" // 纭繚绱ф�ユ斁琛岀姸鎬佹纭紶閫� }; } - console.log(this.QcIssueResultDetailes) + console.log("鎻愪氦鐨勭揣鎬ユ斁琛岀姸鎬侊細", this.formData.emergencyStatus ? "1" : "0"); + console.log("瀹屾暣鐨勬彁浜ゆ暟鎹細", this.QcIssueResultDetailes); const url = this.$store.state.serverInfo.serverAPI+`/QcIssueResult/GetProcessNo`; - // 鍙戦�� POST 璇锋眰 + if (this.PSTYPE === '鐗归噰/璁╂浣跨敤') {// 鍙戦�� POST 璇锋眰 uni.request({ url: url, // 璇锋眰鍦板潃 method: 'POST', // 璇锋眰鏂规硶 @@ -458,7 +487,7 @@ }); } }); - + } uni.showToast({ title: res.message.toString(), icon: 'success', @@ -538,9 +567,14 @@ if (data) { this.formData = { ...data, - emergencyStatus: data.emergency + emergencyStatus: data.emergency === 1 || data.emergency === "1" || data.emergency === true }; - + + // 纭繚PHSY瀛楁琚纭缃� + this.formData.PHSY = data.PHSY; + + console.log("鍔犺浇鐨勭揣鎬ユ斁琛岀姸鎬�:", this.formData.emergencyStatus); + this.$post({ url: "/LLJ/getJYItem", data: { @@ -593,58 +627,25 @@ }); }, editRemarks() { - if (this.remarks) { - //saveRemarksGid - this.$post({ - url: "/LLJ/saveRemarksGid", - data: { - gid: this.formData.id, - remarks: this.remarks, - releaseNo: this.formData.releaseNo, - } - }).then(res => { - if (res.data.tbBillList > 0) { - this.formData.remarks = this.remarks; - this.remarksPopup = !this.remarksPopup; - this.$showMessage("淇濆瓨鎴愬姛"); - setTimeout(() => { - let pages = getCurrentPages(); - let beforePage = pages[pages.length - 2]; - uni.navigateBack({ - delta: 1, //杩斿洖鐨勯〉闈㈡暟锛屽鏋滀负1琛ㄧず杩斿洖涓婁竴椤� - success: (event) => { - beforePage.$vm.reload() - } - }); - }, 2000); - } - }) - } else { - this.$post({ - url: "/LLJ/saveRemarksGid", - data: { - gid: this.formData.id, - remarks: '', - releaseNo: this.formData.releaseNo, - } - }).then(res => { - if (res.data.tbBillList > 0) { - this.formData.remarks = this.remarks; - this.remarksPopup = !this.remarksPopup; - this.$showMessage("淇濆瓨鎴愬姛"); - setTimeout(() => { - let pages = getCurrentPages(); - let beforePage = pages[pages.length - 2]; - uni.navigateBack({ - delta: 1, //杩斿洖鐨勯〉闈㈡暟锛屽鏋滀负1琛ㄧず杩斿洖涓婁竴椤� - success: (event) => { - beforePage.$vm.reload() - } - }); - }, 2000); - } - }) - } + // 淇濆瓨涓嶈壇鎻忚堪 + this.$post({ + url: "/LLJ/saveRemarksGid", + data: { + gid: this.formData.id, + remarks: this.remarks || '', + releaseNo: this.formData.releaseNo + // 涓嶅啀鍖呭惈PHSY瀛楁 + } + }).then(res => { + if (res.data.tbBillList > 0) { + this.formData.remarks = this.remarks; + this.remarksPopup = !this.remarksPopup; + this.$showMessage("淇濆瓨鎴愬姛"); + setTimeout(() => { + this.init(); + }, 2000); + } + }) }, drawingConfirm() { @@ -1050,6 +1051,9 @@ this.formData.emergencyStatus = true; this.originalLotNo1 = lotNo1; this.formData.lotNo1 = lotNo1; + // 鏇存柊绱ф�ユ斁琛岀姸鎬侊紝纭繚鎻愪氦鏃惰兘姝g‘浼犻�� + this.formData.EMERGENCY = "1"; + uni.showToast({ title: message || '绱ф�ユ斁琛屾垚鍔�', icon: 'success', @@ -1096,6 +1100,9 @@ if (result === "0") { this.formData.emergencyStatus = false; + // 鏇存柊绱ф�ユ斁琛岀姸鎬侊紝纭繚鎻愪氦鏃惰兘姝g‘浼犻�� + this.formData.EMERGENCY = "0"; + uni.showToast({ title: message || '鎾ゅ洖鎴愬姛', icon: 'success', @@ -1122,64 +1129,93 @@ }); }, editRemarks() { - if (this.remarks) { - // 鍙繚瀛樹慨鏀圭殑閮ㄥ垎 - const modifiedRemarks = this.remarks !== this.originalRemarks ? this.remarks : ''; - - this.$post({ - url: "/LLJ/saveRemarksGid", - data: { - gid: this.formData.id, - remarks: modifiedRemarks, - releaseNo: this.formData.releaseNo, - } - }).then(res => { - if (res.data.tbBillList > 0) { - this.formData.remarks = this.remarks; - this.originalRemarks = this.remarks; // 鏇存柊鍘熷澶囨敞鍊� - this.remarksPopup = !this.remarksPopup; - this.$showMessage("淇濆瓨鎴愬姛"); - setTimeout(() => { - let pages = getCurrentPages(); - let beforePage = pages[pages.length - 2]; - uni.navigateBack({ - delta: 1, //杩斿洖鐨勯〉闈㈡暟锛屽鏋滀负1琛ㄧず杩斿洖涓婁竴椤� - success: (event) => { - beforePage.$vm.reload() - } - }); - }, 2000); - } - }) - } else { - this.$post({ - url: "/LLJ/saveRemarksGid", - data: { - gid: this.formData.id, - remarks: '', - releaseNo: this.formData.releaseNo, - } - }).then(res => { - if (res.data.tbBillList > 0) { - this.formData.remarks = this.remarks; - this.originalRemarks = this.remarks; // 鏇存柊鍘熷澶囨敞鍊� - this.remarksPopup = !this.remarksPopup; - this.$showMessage("淇濆瓨鎴愬姛"); - setTimeout(() => { - let pages = getCurrentPages(); - let beforePage = pages[pages.length - 2]; - uni.navigateBack({ - delta: 1, //杩斿洖鐨勯〉闈㈡暟锛屽鏋滀负1琛ㄧず杩斿洖涓婁竴椤� - success: (event) => { - beforePage.$vm.reload() - } - }); - }, 2000); - } - }) - } - }, - + // 淇濆瓨涓嶈壇鎻忚堪 + this.$post({ + url: "/LLJ/saveRemarksGid", + data: { + gid: this.formData.id, + remarks: this.remarks || '', + releaseNo: this.formData.releaseNo + // 涓嶅啀鍖呭惈PHSY瀛楁 + } + }).then(res => { + if (res.data.tbBillList > 0) { + this.formData.remarks = this.remarks; + this.remarksPopup = !this.remarksPopup; + this.$showMessage("淇濆瓨鎴愬姛"); + setTimeout(() => { + this.init(); + }, 2000); + } + }) + }, + addDestruction() { + // 娣诲姞鐮村潖瀹為獙鐨勯�昏緫 + this.destructionPopup = !this.destructionPopup; + this.PHSY = this.formData.PHSY || ''; + this.isInteger = true; + }, + editDestruction() { + // 楠岃瘉杈撳叆鏄惁涓烘暣鏁� + if(this.PHSY === '') { + this.isInteger = true; + // 濡傛灉涓虹┖锛屼紶閫掔┖瀛楃涓诧紝鍚庣浼氬鐞嗕负null + } else { + const isInteger = /^-?\d+$/.test(this.PHSY); + this.isInteger = isInteger; + if (!isInteger) { + return; + } + } + + // 淇濆瓨鐮村潖瀹為獙鏁伴噺 + this.$post({ + url: "/LLJ/saveRemarksGid", + data: { + gid: this.formData.id, + releaseNo: this.formData.releaseNo, + PHSY: this.PHSY // 鍙互鏄┖瀛楃涓叉垨鏈夋晥鏁存暟 + // 涓嶅啀鍖呭惈remarks瀛楁 + } + }).then(res => { + if (res.data.tbBillList > 0) { + // 濡傛灉杈撳叆涓虹┖锛岃缃负null浠ヤ究涓嶆樉绀� + this.formData.PHSY = this.PHSY === '' ? null : this.PHSY; + this.destructionPopup = false; + this.$showMessage("淇濆瓨鎴愬姛"); + setTimeout(() => { + // 璺宠浆鍒板垪琛ㄩ〉闈� + uni.navigateTo({ + url: 'List' + }); + }, 2000); + } + }) + }, + clearDestruction() { + // 娓呴櫎鐮村潖瀹為獙鏁伴噺 + this.PHSY = ''; + this.$post({ + url: "/LLJ/saveRemarksGid", + data: { + gid: this.formData.id, + releaseNo: this.formData.releaseNo, + PHSY: '' // 绌哄瓧绗︿覆锛屽悗绔細澶勭悊涓簄ull + } + }).then(res => { + if (res.data.tbBillList > 0) { + this.formData.PHSY = null; // 纭繚鍓嶇涔熶负null锛屼笉鏄剧ず + this.destructionPopup = false; + this.$showMessage("娓呴櫎鎴愬姛"); + setTimeout(() => { + // 璺宠浆鍒板垪琛ㄩ〉闈� + uni.navigateTo({ + url: 'List' + }); + }, 2000); + } + }) + }, } } </script> @@ -1477,4 +1513,11 @@ } } + + .error-message { + color: #e74c3c; + font-size: 14px; + margin-top: 5px; + margin-bottom: 10px; + } </style> \ No newline at end of file -- Gitblit v1.9.3