From 6bf8209f8bdfe138d5282059eef765324909f2fd Mon Sep 17 00:00:00 2001 From: xwt <2740516069@qq.com> Date: 星期一, 09 六月 2025 23:31:19 +0800 Subject: [PATCH] 新增特殊物料备注 --- pages/QC/LLJ/Add.vue | 280 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 242 insertions(+), 38 deletions(-) diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue index 0384da9..fd7fe3e 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,48 @@ </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="action-buttons" v-if="this.current"> - <button class="secondary-btn" @click="getInspectionItems">鑾峰彇妫�楠岄」鐩�</button> - </view> + <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="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 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 +152,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> @@ -155,7 +179,8 @@ <button @click="remarksPopup = !remarksPopup">鍙栨秷</button> </view> </view> - + + <view class="barcode"> <u-modal :show="drawingShow" title="鍥剧焊鏄庣粏" @confirm="drawingConfirm" @cancel="drawingCancel" showCancelButton> @@ -183,8 +208,8 @@ </uni-table> </u-modal> </view> - </view> + </template> <script> @@ -207,10 +232,17 @@ planQty: "", mocode: "", boardStyle: "", - itemId: "" + itemId: "", + emergencyStatus: false, + lotNo1: '', + emergency:'', + permissionModalVisible: false, + permissionAccount: '', + hasEmergencyPermission: false }, tableData: [], remarksPopup: false, + meomPopup: false, current: true, drawing: [], drawingShow: false, @@ -220,7 +252,10 @@ REMARK: '', checkState: false, writeStatu: true, - fileName:'' + fileName:'', + originalRemarks: '', + hasEmergencyPermission: false, + } }, onLoad(options) { @@ -232,6 +267,7 @@ this.formData.releaseNo = params["releaseNo"]; this.formData.lotNo = params["lotNo"]; this.msgId = params["msgId"]; + this.emergency = params["emergency"] if (params["current"] === 'A') { this.current = true; @@ -254,6 +290,7 @@ }); } + if (this.$loginInfo.account === 'PL017') {this.hasEmergencyPermission = true;} }, methods: { @@ -306,6 +343,7 @@ } }); }, + fillRecord(item, index) { // 濉啓璁板綍鐨勯�昏緫 uni.navigateTo({ @@ -508,7 +546,10 @@ }).then(res => { let data = res.data.tbBillList[0]; if (data) { - this.formData = data; + this.formData = { + ...data, + emergencyStatus: data.emergency + }; this.$post({ url: "/LLJ/getJYItem", @@ -986,7 +1027,169 @@ // 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; + 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; + 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() { + 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); + } + }) + } + }, + } } </script> @@ -1080,12 +1283,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 +1326,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 +1359,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 { -- Gitblit v1.9.3