From 2884be21228fb6b9ed801d732813e8df507cae23 Mon Sep 17 00:00:00 2001 From: xwt <2740516069@qq.com> Date: 星期二, 01 七月 2025 22:52:58 +0800 Subject: [PATCH] 推送钉钉更改 --- pages/QC/LLJ/Add.vue | 313 ++++++++++++++++++++++++++++----------------------- 1 files changed, 173 insertions(+), 140 deletions(-) diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue index fd7fe3e..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> @@ -101,26 +105,11 @@ <!-- 鎿嶄綔鎸夐挳鍖� --> <view class="action-buttons" v-if="this.current"> - <button class="secondary-btn" @click="openPermissionModal">鏉冮檺绠$悊</button> - <button v-if="hasEmergencyPermission" class="secondary-btn" @click="handleEmergencyRelease">绱ф�ユ斁琛�</button> - <button v-if="hasEmergencyPermission" class="secondary-btn" @click="handleWithdraw">鎾ゅ洖</button> + <button class="secondary-btn" @click="handleEmergencyRelease">绱ф�ユ斁琛�</button> + <button class="secondary-btn" @click="handleWithdraw">鎾ゅ洖</button> <button class="secondary-btn" @click="getInspectionItems">鑾峰彇妫�楠岄」鐩�</button> - </view> - <!-- 鏉冮檺鍒嗛厤妯℃�佹 --> - <view v-if="permissionModalVisible" 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="permissionAccount" /> - </view> - </form> - <button class="updateBut" @click="savePermission">淇濆瓨</button> - <button @click="permissionModalVisible = false">鍙栨秷</button> - </view> - </view> - + </view> + <!-- 妫�楠岄」鐩〃鏍� --> @@ -160,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> @@ -180,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" @@ -238,7 +243,11 @@ emergency:'', permissionModalVisible: false, permissionAccount: '', - hasEmergencyPermission: false + hasEmergencyPermission: false, + showPopup: false, + PHSY:'', + EMERGENCY: '0', + }, tableData: [], remarksPopup: false, @@ -255,19 +264,25 @@ fileName:'', originalRemarks: '', hasEmergencyPermission: false, + destructionPopup: false, + PHSY: '', + isInteger: true, } }, onLoad(options) { //options涓寘鍚簡url闄勫甫鐨勫弬鏁� let params = options; - + + + if (params["id"]) { this.formData.id = params["id"]; this.formData.releaseNo = params["releaseNo"]; this.formData.lotNo = params["lotNo"]; this.msgId = params["msgId"]; this.emergency = params["emergency"] + this.meom = params["meom"] if (params["current"] === 'A') { this.current = true; @@ -316,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) { @@ -412,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{ @@ -429,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', // 璇锋眰鏂规硶 @@ -468,7 +487,7 @@ }); } }); - + } uni.showToast({ title: res.message.toString(), icon: 'success', @@ -548,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: { @@ -603,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() { @@ -1060,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', @@ -1106,6 +1100,9 @@ if (result === "0") { this.formData.emergencyStatus = false; + // 鏇存柊绱ф�ユ斁琛岀姸鎬侊紝纭繚鎻愪氦鏃惰兘姝g‘浼犻�� + this.formData.EMERGENCY = "0"; + uni.showToast({ title: message || '鎾ゅ洖鎴愬姛', icon: 'success', @@ -1132,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> @@ -1487,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