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 | 431 +++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 334 insertions(+), 97 deletions(-) diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue index 0384da9..3edd803 100644 --- a/pages/QC/LLJ/Add.vue +++ b/pages/QC/LLJ/Add.vue @@ -4,9 +4,10 @@ <view class="sheet-header"> <h1>鏉ユ枡妫�楠屽崟</h1> <view class="inspection-number">妫�楠屽崟鍙凤細{{formData.releaseNo}}</view> - <!-- 閫犳ⅵ鑰呯壒娈婂姛鑳� --> - <view style="text-align: right;" v-if="this.current"><a class="sysLike" - @click="toSysSubmitFrom(formData.releaseNo)">瀹為獙瀹ら�佹</a></view> + <!--瀹為獙瀹ら�佹 --> + <view style="text-align: right;" class="action-buttons"> + <a class="sysLike" v-if="this.current" @click="toSysSubmitFrom(formData.releaseNo)">瀹為獙瀹ら�佹</a> + </view> </view> <!-- 鍩烘湰淇℃伅鍖� --> @@ -88,26 +89,37 @@ </select> </view> - <view class="dropdown-row"> - <view class="info-label">澶囨敞锛�</view> - <input type="text" id="remark" v-model="REMARK" placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�" /> + <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> + <!-- 鎿嶄綔鎸夐挳鍖� --> <view class="action-buttons" v-if="this.current"> - <button class="secondary-btn" @click="getInspectionItems">鑾峰彇妫�楠岄」鐩�</button> + <button class="secondary-btn" @click="handleEmergencyRelease">绱ф�ユ斁琛�</button> + <button class="secondary-btn" @click="handleWithdraw">鎾ゅ洖</button> + <button class="secondary-btn" @click="getInspectionItems">鑾峰彇妫�楠岄」鐩�</button> </view> + + <!-- 妫�楠岄」鐩〃鏍� --> <view class="inspection-table"> <table> <thead> <tr> - <th width="15%" style="text-align: center;">妫�楠岄」鐩�</th> + <th width="20%" style="text-align: center;">妫�楠岄」鐩�</th> <th width="50%" style="text-align: center;">妫�楠屾弿杩�</th> - <th width="20%" style="text-align: center;">璁板綍(鐐瑰嚮)</th> + <th width="15%" style="text-align: center;">璁板綍(鐐瑰嚮)</th> </tr> </thead> <tbody> @@ -129,6 +141,7 @@ <button v-if="item.current" class="record-btn" @click="fillRecord(item,index)">濉啓</button> <button v-if="!item.current" class="record-btn" @click="fillRecord(item,index)">鏌ョ湅</button> </td> + </tr> </tbody> </table> @@ -136,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> @@ -155,7 +169,23 @@ <button @click="remarksPopup = !remarksPopup">鍙栨秷</button> </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" showCancelButton> @@ -183,8 +213,8 @@ </uni-table> </u-modal> </view> - </view> + </template> <script> @@ -207,10 +237,21 @@ planQty: "", mocode: "", boardStyle: "", - itemId: "" + itemId: "", + emergencyStatus: false, + lotNo1: '', + emergency:'', + permissionModalVisible: false, + permissionAccount: '', + hasEmergencyPermission: false, + showPopup: false, + PHSY:'', + EMERGENCY: '0', + }, tableData: [], remarksPopup: false, + meomPopup: false, current: true, drawing: [], drawingShow: false, @@ -220,18 +261,28 @@ REMARK: '', checkState: false, writeStatu: true, - fileName:'' + 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; @@ -254,6 +305,7 @@ }); } + if (this.$loginInfo.account === 'PL017') {this.hasEmergencyPermission = true;} }, methods: { @@ -279,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) { @@ -306,6 +359,7 @@ } }); }, + fillRecord(item, index) { // 濉啓璁板綍鐨勯�昏緫 uni.navigateTo({ @@ -374,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{ @@ -391,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', // 璇锋眰鏂规硶 @@ -430,7 +487,7 @@ }); } }); - + } uni.showToast({ title: res.message.toString(), icon: 'success', @@ -508,8 +565,16 @@ }).then(res => { let data = res.data.tbBillList[0]; if (data) { - this.formData = data; - + this.formData = { + ...data, + 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: { @@ -562,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() { @@ -986,7 +1018,204 @@ // title: '鏃犲搴擯DF鏂囦欢锛屾墦寮�澶辫触', // icon: 'none' // }); // } - } + }, + // 澶勭悊绱ф�ユ斁琛� + handleEmergencyRelease() { + if (this.formData.emergencyStatus) { + uni.showModal({ + title: "鎻愮ず", + content: '璇ュ崟宸茬揣鎬ユ斁琛岋紝璇峰嬁閲嶅鎿嶄綔', + showCancel: false + }); + return; + } + + uni.showModal({ + title: '纭', + content: '纭畾瑕佹墽琛岀揣鎬ユ斁琛屽悧锛�', + success: (res) => { + if (res.confirm) { + // 璋冪敤鏂扮殑鍚庣鎺ュ彛 + this.$post({ + url: "/LLJ/EmergencyRelease", + data: { + id: this.formData.id + } + }).then(res => { + if (res.data && res.status === 0) { + const result = res.data.tbBillList[0]; + const message = res.data.tbBillList[1]; + const lotNo1 = res.data.tbBillList[2] || ""; + + if (result === "0") { + this.formData.emergencyStatus = true; + this.originalLotNo1 = lotNo1; + this.formData.lotNo1 = lotNo1; + // 鏇存柊绱ф�ユ斁琛岀姸鎬侊紝纭繚鎻愪氦鏃惰兘姝g‘浼犻�� + this.formData.EMERGENCY = "1"; + + uni.showToast({ + title: message || '绱ф�ユ斁琛屾垚鍔�', + icon: 'success', + duration: 2000 + }); + this.init(); + } else { + uni.showModal({ + title: "鎻愮ず", + content: message || '鎿嶄綔澶辫触', + showCancel: false + }); + } + } + }).catch(error => { + uni.showModal({ + title: "閿欒", + content: '缃戠粶閿欒锛岃妫�鏌ョ綉缁滆繛鎺�', + showCancel: false + }); + }); + } + } + }); + }, + + // 澶勭悊鎾ゅ洖 + handleWithdraw() { + uni.showModal({ + title: '纭', + content: '纭畾瑕佹挙鍥炵揣鎬ユ斁琛屽悧锛�', + success: (res) => { + if (res.confirm) { + // 璋冪敤鏂扮殑鍚庣鎺ュ彛 + this.$post({ + url: "/LLJ/WithdrawEmergencyRelease", + data: { + id: this.formData.id + } + }).then(res => { + if (res.data && res.status === 0) { + const result = res.data.tbBillList[0]; + const message = res.data.tbBillList[1]; + + if (result === "0") { + this.formData.emergencyStatus = false; + // 鏇存柊绱ф�ユ斁琛岀姸鎬侊紝纭繚鎻愪氦鏃惰兘姝g‘浼犻�� + this.formData.EMERGENCY = "0"; + + uni.showToast({ + title: message || '鎾ゅ洖鎴愬姛', + icon: 'success', + duration: 2000 + }); + this.init(); + } else { + uni.showModal({ + title: "鎻愮ず", + content: message || '鎿嶄綔澶辫触', + showCancel: false + }); + } + } + }).catch(error => { + uni.showModal({ + title: "閿欒", + content: '缃戠粶閿欒锛岃妫�鏌ョ綉缁滆繛鎺�', + showCancel: false + }); + }); + } + } + }); + }, + editRemarks() { + // 淇濆瓨涓嶈壇鎻忚堪 + 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> @@ -1080,12 +1309,9 @@ } .sysLike { - color: #3498db; + color: #1890ff; text-decoration: none; - margin-left: 15px; - padding: 3px 8px; - border-radius: 3px; - font-size: 12px; + cursor: pointer; } .doc-link:hover { @@ -1126,13 +1352,31 @@ /* 鎸夐挳鏍峰紡 */ .action-buttons { display: flex; - justify-content: flex-end; gap: 10px; - margin-top: 20px; + margin: 15px 0; + justify-content: flex-end; } - .primary-btn, .secondary-btn { + background-color: #ecf0f1; + color: #7f8c8d; + padding: 8px 15px; + border: none; + border-radius: 4px; + cursor: pointer; + } + + .secondary-btn:hover { + background-color: #d5dbdb; + } + + .secondary-btn:disabled { + background-color: #d9d9d9; + cursor: not-allowed; + opacity: 0.7; + } + + .primary-btn { padding: 10px 20px; border: none; border-radius: 4px; @@ -1141,22 +1385,8 @@ transition: all 0.3s; } - .primary-btn { - background-color: #3498db; - color: white; - } - .primary-btn:hover { background-color: #2980b9; - } - - .secondary-btn { - background-color: #ecf0f1; - color: #7f8c8d; - } - - .secondary-btn:hover { - background-color: #d5dbdb; } .record-btn { @@ -1283,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