From 2b0e70bb88ced210dbc693a4d2ded2d658b1da02 Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期一, 21 七月 2025 15:30:03 +0800 Subject: [PATCH] 111 --- pages/QC/OQC/Add.vue | 576 +++++++++++++++++++++++++++++---------------------------- 1 files changed, 296 insertions(+), 280 deletions(-) diff --git a/pages/QC/OQC/Add.vue b/pages/QC/OQC/Add.vue index 08bdf0b..9ce65df 100644 --- a/pages/QC/OQC/Add.vue +++ b/pages/QC/OQC/Add.vue @@ -1,284 +1,287 @@ <template> - <view class="page-container"> - <!-- 琛ㄥ崟瀹瑰櫒 --> - <view class="form-card"> - <form :modelValue="formData"> - <view class="form-group"> - <label class="form-label">妫�楠屽崟鍙�:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.releaseNo" /> - </view> - <view class="form-group"> - <label class="form-label">鐗╂枡缂栫爜:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.itemNo" /> - </view> - <view class="form-group"> - <label class="form-label">鐗╂枡鍚嶇О:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.itemName" /> - </view> - <view class="form-group"> - <label class="form-label">鐗╂枡瑙勬牸:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.itemModel" /> - </view> - <view class="form-group"> - <label class="form-label">璁㈠崟缂栧彿:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.saleOrderNo" /> - </view> - <view class="form-group"> - <label class="form-label">閫佹鏁伴噺:</label> - <input class="form-input" disabled="true" type="number" v-model="formData.planQty" /> - </view> - <view class="form-group"> - <label class="form-label">鍒涘缓鏃堕棿:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.createDate" /> - </view> - <view class="form-group"> - <label class="form-label">鍒涘缓浜�:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.createUser" /> - </view> - <view class="form-group"> - <label class="form-label">涓嶈壇鎻忚堪:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.remeke" /> - </view> - </form> - </view> + <view class="page-container"> + <!-- 琛ㄥ崟瀹瑰櫒 --> + <view class="form-card"> + <form :modelValue="formData"> + <view class="form-group"> + <label class="form-label">妫�楠屽崟鍙�:</label> + <input v-model="formData.releaseNo" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">鐗╂枡缂栫爜:</label> + <input v-model="formData.itemNo" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">鐗╂枡鍚嶇О:</label> + <input v-model="formData.itemName" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">鐗╂枡瑙勬牸:</label> + <input v-model="formData.itemModel" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">璁㈠崟缂栧彿:</label> + <input v-model="formData.saleOrderNo" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">閫佹鏁伴噺:</label> + <input v-model="formData.planQty" class="form-input" disabled="true" type="number"/> + </view> + <view class="form-group"> + <label class="form-label">鍒涘缓鏃堕棿:</label> + <input v-model="formData.createDate" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">鍒涘缓浜�:</label> + <input v-model="formData.createUser" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">涓嶈壇鎻忚堪:</label> + <input v-model="formData.remeke" class="form-input" disabled="true" type="text"/> + </view> + </form> + </view> - <!-- 妫�楠岄」鐩崱鐗� --> - <view class="inspection-card"> - <view class="card-header"> - <view class="header-icon">馃攳</view> - <text class="header-title">妫�楠岄」鐩�</text> - <view class="header-badge">{{ tableData.length }}</view> - </view> - - <view class="inspection-list" v-if="tableData.length > 0"> - <view v-for="(item, index) in tableData" :key="index" class="inspection-item" - :class="{ 'item-completed': item.fcheckResu === '鍚堟牸', 'item-failed': item.fcheckResu === '涓嶅悎鏍�' }"> - - <!-- 宸︿晶鐘舵�佹寚绀哄櫒 --> - <view class="status-indicator" - :class="{ 'status-pass': item.fcheckResu === '鍚堟牸', 'status-fail': item.fcheckResu === '涓嶅悎鏍�', 'status-pending': item.fcheckResu === '鏈楠�' }"> - </view> - - <!-- 涓昏鍐呭鍖哄煙 --> - <view class="item-content"> - <view class="item-header"> - <view class="item-title">{{ item.fcheckItem }}</view> - <view class="status-badge" - :class="{ 'badge-pass': item.fcheckResu === '鍚堟牸', 'badge-fail': item.fcheckResu === '涓嶅悎鏍�', 'badge-pending': item.fcheckResu === '鏈楠�' }"> - <text class="status-icon">{{ item.fcheckResu === '鍚堟牸' ? '鉁�' : item.fcheckResu === '涓嶅悎鏍�' ? '鉁�' : '鈼�' }}</text> - <text class="status-text">{{ item.fcheckResu }}</text> - </view> - </view> - - <view class="item-description" v-if="item.fcheckItemDesc"> - <text class="description-text">{{ item.fcheckItemDesc }}</text> - </view> - - <view class="item-footer"> - <view class="progress-info"> - <text class="progress-label">妫�楠岃繘搴�:</text> - <view class="progress-bar"> - <view class="progress-fill" - :style="{ width: (item.fenterQty / item.checkQyt * 100) + '%' }" - :class="{ 'progress-complete': item.fenterQty >= item.checkQyt, 'progress-incomplete': item.fenterQty < item.checkQyt }"> - </view> - </view> - <text class="progress-text">{{ item.fenterQty }}/{{ item.checkQyt }}</text> - </view> - - <view class="action-button" @click="toDetail(item)" - :class="{ 'btn-complete': item.fenterQty >= item.checkQyt, 'btn-incomplete': item.fenterQty < item.checkQyt }"> - <text class="btn-text">{{ item.fenterQty >= item.checkQyt ? '鏌ョ湅璇︽儏' : '寮�濮嬫楠�' }}</text> - <text class="btn-icon">鈫�</text> - </view> - </view> - </view> - </view> - </view> - - <!-- 绌虹姸鎬� --> - <view v-else class="empty-state"> - <view class="empty-icon">馃搵</view> - <text class="empty-text">鏆傛棤妫�楠岄」鐩�</text> - <text class="empty-desc">璇峰厛鐢熸垚妫�楠岄」鐩�</text> - </view> - </view> + <!-- 妫�楠岄」鐩崱鐗� --> + <view class="inspection-card"> + <view class="card-header"> + <view class="header-icon">馃攳</view> + <text class="header-title">妫�楠岄」鐩�</text> + <view class="header-badge">{{ tableData.length }}</view> + </view> - <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - <view class="action-buttons"> - <button class="btn btn-primary" @click="submitInspection">鎻愪氦</button> - <button class="secondary-btn" @click="uploadImages">涓婁紶/鏌ョ湅鍥剧墖</button> - <button class="btn btn-secondary" @click="addDefectDescription">娣诲姞涓嶅悎鏍兼弿杩�</button> - </view> - - - <!-- 涓嶅悎鏍兼弿杩板脊鍑哄眰 --> - <view v-if="remarksPopup" class="overlay active"> - <view class="popup" :class="{ 'popup-scale': isPopupAnimated }" @animationend="isPopupAnimated = false"> - <view class="popup-header"> - <h3 class="popup-title">淇敼涓嶅悎鏍兼弿杩�</h3> - <view class="close-btn" @click="remarksPopup = !remarksPopup">脳</view> - </view> - <form> - <view class="form-group"> - <label class="form-label">涓嶅悎鏍兼弿杩�:</label> - <input class="form-input" type="text" v-model="remarks" /> - </view> - <view class="button-group popup-buttons"> - <button :class="['action-btn', 'btn-danger']" @click="editRemarks"> - 淇敼 - </button> - <button :class="['action-btn', 'btn-light']" @click="remarksPopup = !remarksPopup"> - 鍙栨秷 - </button> - </view> - </form> - </view> - </view> - </view> + <view v-if="tableData.length > 0" class="inspection-list"> + <view v-for="(item, index) in tableData" :key="index" :class="{ 'item-completed': item.fcheckResu === '鍚堟牸', 'item-failed': item.fcheckResu === '涓嶅悎鏍�' }" + class="inspection-item"> + + <!-- 宸︿晶鐘舵�佹寚绀哄櫒 --> + <view :class="{ 'status-pass': item.fcheckResu === '鍚堟牸', 'status-fail': item.fcheckResu === '涓嶅悎鏍�', 'status-pending': item.fcheckResu === '鏈楠�' }" + class="status-indicator"> + </view> + + <!-- 涓昏鍐呭鍖哄煙 --> + <view class="item-content"> + <view class="item-header"> + <view class="item-title">{{ item.fcheckItem }}</view> + <view :class="{ 'badge-pass': item.fcheckResu === '鍚堟牸', 'badge-fail': item.fcheckResu === '涓嶅悎鏍�', 'badge-pending': item.fcheckResu === '鏈楠�' }" + class="status-badge"> + <text class="status-icon">{{ + item.fcheckResu === '鍚堟牸' ? '鉁�' : item.fcheckResu === '涓嶅悎鏍�' ? '鉁�' : '鈼�' + }} + </text> + <text class="status-text">{{ item.fcheckResu }}</text> + </view> + </view> + + <view v-if="item.fcheckItemDesc" class="item-description"> + <text class="description-text">{{ item.fcheckItemDesc }}</text> + </view> + + <view class="item-footer"> + <view class="progress-info"> + <text class="progress-label">妫�楠岃繘搴�:</text> + <view class="progress-bar"> + <view :class="{ 'progress-complete': item.fenterQty >= item.checkQyt, 'progress-incomplete': item.fenterQty < item.checkQyt }" + :style="{ width: (item.fenterQty / item.checkQyt * 100) + '%' }" + class="progress-fill"> + </view> + </view> + <text class="progress-text">{{ item.fenterQty }}/{{ item.checkQyt }}</text> + </view> + + <view :class="{ 'btn-complete': item.fenterQty >= item.checkQyt, 'btn-incomplete': item.fenterQty < item.checkQyt }" class="action-button" + @click="toDetail(item)"> + <text class="btn-text">{{ item.fenterQty >= item.checkQyt ? '鏌ョ湅璇︽儏' : '寮�濮嬫楠�' }}</text> + <text class="btn-icon">鈫�</text> + </view> + </view> + </view> + </view> + </view> + + <!-- 绌虹姸鎬� --> + <view v-else class="empty-state"> + <view class="empty-icon">馃搵</view> + <text class="empty-text">鏆傛棤妫�楠岄」鐩�</text> + <text class="empty-desc">璇峰厛鐢熸垚妫�楠岄」鐩�</text> + </view> + </view> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <view class="action-buttons"> + <button class="btn btn-primary" @click="submitInspection">鎻愪氦</button> + <button class="secondary-btn" @click="uploadImages">涓婁紶/鏌ョ湅鍥剧墖</button> + <button class="btn btn-secondary" @click="addDefectDescription">娣诲姞涓嶅悎鏍兼弿杩�</button> + </view> + + + <!-- 涓嶅悎鏍兼弿杩板脊鍑哄眰 --> + <view v-if="remarksPopup" class="overlay active"> + <view :class="{ 'popup-scale': isPopupAnimated }" class="popup" @animationend="isPopupAnimated = false"> + <view class="popup-header"> + <h3 class="popup-title">淇敼涓嶅悎鏍兼弿杩�</h3> + <view class="close-btn" @click="remarksPopup = !remarksPopup">脳</view> + </view> + <form> + <view class="form-group"> + <label class="form-label">涓嶅悎鏍兼弿杩�:</label> + <input v-model="remarks" class="form-input" type="text"/> + </view> + <view class="button-group popup-buttons"> + <button :class="['action-btn', 'btn-danger']" @click="editRemarks"> + 淇敼 + </button> + <button :class="['action-btn', 'btn-light']" @click="remarksPopup = !remarksPopup"> + 鍙栨秷 + </button> + </view> + </form> + </view> + </view> + </view> </template> <script> - export default { - data() { - return { - formData: {}, - tableData: [], - remarks: "", - remarksPopup: false, - isPopupAnimated: false, - } - }, - onLoad(options) { - //options涓寘鍚簡url闄勫甫鐨勫弬鏁� - let params = options; +export default { + data() { + return { + formData: {}, + tableData: [], + remarks: "", + remarksPopup: false, + isPopupAnimated: false, + } + }, + onLoad(options) { + //options涓寘鍚簡url闄勫甫鐨勫弬鏁� + let params = options; - if (params["id"]) { - this.formData.id = params["id"]; - this.init(); - } - }, - methods: { - init() { - let userName = this.$loginInfo.account; - this.$post({ - url: "/MesOqcItemsDetect02/getPage", - data: { - id: this.formData.id, - createUser: userName, - pageIndex: 1, - limit: 1, - } - }).then(res => { - let data = res.data[0]; - if (data) { - this.formData = data; - this.getDetail5(); - } - }); - }, + if (params["id"]) { + this.formData.id = params["id"]; + this.init(); + } + }, + methods: { + init() { + let userName = this.$loginInfo.account; + this.$post({ + url: "/MesOqcItemsDetect02/getPage", + data: { + id: this.formData.id, + createUser: userName, + pageIndex: 1, + limit: 1, + } + }).then(res => { + let data = res.data[0]; + if (data) { + this.formData = data; + this.getDetail5(); + } + }); + }, - getDetail5() { - let userName = this.$loginInfo.account; - this.$post({ - url: "/MesOqcItemsDetect02/GetDetail5", - data: { - id: this.formData.id, - createUser: userName, - releaseNo: this.formData.releaseNo, - } - }).then(res => { - let data = res.data; - this.tableData = data; - }); - }, - uploadImages() { - // 涓婁紶/鏌ョ湅鍥剧墖鐨勯�昏緫 - uni.navigateTo({ - url: 'ImageItem?id=' + this.formData.releaseNo - }); - }, - addDefectDescription() { - // 纭繚琛ㄥ崟鏁版嵁瀛樺湪 - if (!this.formData) return; + getDetail5() { + let userName = this.$loginInfo.account; + this.$post({ + url: "/MesOqcItemsDetect02/GetDetail5", + data: { + id: this.formData.id, + createUser: userName, + releaseNo: this.formData.releaseNo, + } + }).then(res => { + let data = res.data; + this.tableData = data; + }); + }, + uploadImages() { + // 涓婁紶/鏌ョ湅鍥剧墖鐨勯�昏緫 + uni.navigateTo({ + url: 'ImageItem?id=' + this.formData.id + }); + }, + addDefectDescription() { + // 纭繚琛ㄥ崟鏁版嵁瀛樺湪 + if (!this.formData) return; - this.remarksPopup = !this.remarksPopup; - this.remarks = this.formData.remeke || ''; - this.isPopupAnimated = true; - }, - toDetail(item) { + this.remarksPopup = !this.remarksPopup; + this.remarks = this.formData.remeke || ''; + this.isPopupAnimated = true; + }, + toDetail(item) { - uni.navigateTo({ - url: 'detail?mainId=' + item.id + '&releaseNo=' + this.formData - .releaseNo - }); + uni.navigateTo({ + url: 'detail?mainId=' + item.id + '&releaseNo=' + this.formData + .releaseNo + }); - }, - submitInspection() { - // 妫�楠屾彁浜ょ殑閫昏緫 - this.$post({ - url: "/MesOqcItemsDetect02/IqcQaSubmit", - data: { - userNo: this.$loginInfo.account, - releaseNo: this.formData.releaseNo - } - }).then(res => { - if (res.status == 0) { + }, + submitInspection() { + // 妫�楠屾彁浜ょ殑閫昏緫 + this.$post({ + url: "/MesOqcItemsDetect02/IqcQaSubmit", + data: { + userNo: this.$loginInfo.account, + releaseNo: this.formData.releaseNo + } + }).then(res => { + if (res.status == 0) { - uni.showToast({ - title: res.message.toString(), - icon: 'success', - duration: 2000 - }) - // 濡傛灉鏈夐〉闈㈣烦杞紝闇�瑕佺敤瀹氭椂鍣ㄥ欢杩� - setTimeout(() => { - uni.navigateTo({ - url: 'List' - }); - }, 2000); // 淇濇寔涓� duration 鐩稿悓鐨勬椂闀� + uni.showToast({ + title: res.message.toString(), + icon: 'success', + duration: 2000 + }) + // 濡傛灉鏈夐〉闈㈣烦杞紝闇�瑕佺敤瀹氭椂鍣ㄥ欢杩� + setTimeout(() => { + uni.navigateTo({ + url: 'List' + }); + }, 2000); // 淇濇寔涓� duration 鐩稿悓鐨勬椂闀� - } else { - uni.showModal({ - title: "鎻愮ず", - content: res.message.toString(), - confirmText: "纭畾", - showCancel: false, - success: (res) => { + } else { + uni.showModal({ + title: "鎻愮ず", + content: res.message.toString(), + confirmText: "纭畾", + showCancel: false, + success: (res) => { - } - }) - } - }) - }, - editRemarks() { - if (this.remarks && this.formData.id) { - this.$post({ - url: "/MesOqcItemsDetect02/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 = false; - this.$showMessage("淇濆瓨鎴愬姛"); - this.init(); - } else { - this.$showMessage("淇濆瓨澶辫触"); - } - }).catch(() => { - this.$showMessage("淇濆瓨澶辫触锛岃閲嶈瘯"); - }); - } else if (!this.formData.id) { - this.$showMessage("璇峰厛鐢熸垚妫�楠屽崟"); - } else { - this.$showMessage("璇疯緭鍏ヤ笉鍚堟牸鎻忚堪"); - } - }, - } - } + } + }) + } + }) + }, + editRemarks() { + if (this.remarks && this.formData.id) { + this.$post({ + url: "/MesOqcItemsDetect02/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 = false; + this.$showMessage("淇濆瓨鎴愬姛"); + this.init(); + } else { + this.$showMessage("淇濆瓨澶辫触"); + } + }).catch(() => { + this.$showMessage("淇濆瓨澶辫触锛岃閲嶈瘯"); + }); + } else if (!this.formData.id) { + this.$showMessage("璇峰厛鐢熸垚妫�楠屽崟"); + } else { + this.$showMessage("璇疯緭鍏ヤ笉鍚堟牸鎻忚堪"); + } + }, + } +} </script> <style scoped> @@ -342,13 +345,13 @@ /* 鎿嶄綔鎸夐挳鍖哄煙 */ .action-buttons { display: flex; - justify-content: space-between; - gap: 15px; + flex-direction: column; + gap: 12px; padding: 15px 0; } -.btn { - flex: 1; +.btn, .secondary-btn { + width: 100%; height: 45px; border-radius: 8px; border: none; @@ -386,6 +389,19 @@ background-color: #6D6D70; } +/* 澶у睆骞曟椂淇濇寔妯悜鎺掑垪 */ +@media (min-width: 768px) { + .action-buttons { + flex-direction: row; + gap: 15px; + } + + .btn, .secondary-btn { + flex: 1; + width: auto; + } +} + /* 妫�楠岄」鐩崱鐗� */ .inspection-card { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); @@ -414,7 +430,7 @@ left: 0; right: 0; bottom: 0; - background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%); + background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%); pointer-events: none; } @@ -699,41 +715,41 @@ margin: 0 -8px 24px -8px; border-radius: 12px; } - + .card-header { padding: 16px 20px; } - + .header-title { font-size: 16px; } - + .inspection-list { padding: 16px 20px; } - + .item-content { padding: 16px 20px; } - + .item-header { flex-direction: column; align-items: flex-start; gap: 8px; } - + .item-footer { flex-direction: column; align-items: stretch; gap: 12px; } - + .progress-info { flex-direction: column; align-items: stretch; gap: 8px; } - + .action-button { justify-content: center; } -- Gitblit v1.9.3