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/detail.vue | 1623 ++++++++++++++++++++++++++++++--------------------------- 1 files changed, 865 insertions(+), 758 deletions(-) diff --git a/pages/QC/OQC/detail.vue b/pages/QC/OQC/detail.vue index d1af774..c4582b3 100644 --- a/pages/QC/OQC/detail.vue +++ b/pages/QC/OQC/detail.vue @@ -1,828 +1,935 @@ <template> - <view class="page-container"> - <!-- 妫�楠岄」鐩〃鍗曞崱鐗� --> - <view class="form-card"> - <view class="form-title"> - <view class="title-icon">馃搵</view> - <span>妫�楠岄」鐩鎯�</span> - </view> - <view class="form-container"> - <!-- 鍩烘湰淇℃伅妯″潡 --> - <view class="form-section"> - <view class="section-title">鍩烘湰淇℃伅</view> - <view class="form-grid"> - <view class="form-group"> - <label class="form-label">椤圭洰鍚嶇О:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.fcheckItem" /> - </view> - <view class="form-group"> - <label class="form-label">瑙勬牸瑕佹眰:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.fspecRequ" /> - </view> - <view class="form-group"> - <label class="form-label">妫�楠屾柟娉�:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.inspectionMethod" /> - </view> - <view class="form-group"> - <label class="form-label">妫�楠屽伐鍏�:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.fcheckTool" /> - </view> - </view> - </view> + <view class="page-container"> + <!-- 妫�楠岄」鐩〃鍗曞崱鐗� --> + <view class="form-card"> + <view class="form-title"> + <view class="title-icon">馃搵</view> + <span>妫�楠岄」鐩鎯�</span> + </view> + <view class="form-container"> + <!-- 鍩烘湰淇℃伅妯″潡 --> + <view class="form-section"> + <view class="section-title">鍩烘湰淇℃伅</view> + <view class="form-grid"> + <view class="form-group"> + <label class="form-label">椤圭洰鍚嶇О:</label> + <input v-model="formData.fcheckItem" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">瑙勬牸瑕佹眰:</label> + <input v-model="formData.fspecRequ" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">妫�楠屾柟娉�:</label> + <input v-model="formData.inspectionMethod" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">妫�楠屽伐鍏�:</label> + <input v-model="formData.fcheckTool" class="form-input" disabled="true" type="text"/> + </view> + </view> + </view> - <!-- 涓変釜妯″潡骞跺垪瀹瑰櫒 --> - <view class="three-modules-container"> - <!-- 妫�楠屽弬鏁版ā鍧� --> - <view class="module-item"> - <view class="module-header"> - <text class="module-title">妫�楠屽弬鏁�</text> - </view> - <view class="module-content"> - <view class="form-grid"> - <view class="form-group"> - <label class="form-label">妫�楠屾暟:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.checkQyt" /> - </view> - <view class="form-group"> - <label class="form-label">妫�楠屾爣鍑嗙紪鐮�:</label> - <input class="form-input" disabled="true" type="text" - v-model="formData.sampleSizeNo" /> - </view> - <view class="form-group"> - <label class="form-label">妫�楠屾按骞�:</label> - <input class="form-input" disabled="true" type="text" - v-model="formData.fcheckLevel" /> - </view> - <view class="form-group"> - <label class="form-label">鎺ユ敹姘村钩:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.facLevel" /> - </view> - </view> - </view> - </view> + <!-- 涓変釜妯″潡骞跺垪瀹瑰櫒 --> + <view class="three-modules-container"> + <!-- 妫�楠屽弬鏁版ā鍧� --> + <view class="module-item"> + <view class="module-header"> + <text class="module-title">妫�楠屽弬鏁�</text> + </view> + <view class="module-content"> + <view class="form-grid"> + <view class="form-group"> + <label class="form-label">妫�楠屾暟:</label> + <input v-model="formData.checkQyt" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">妫�楠屾爣鍑嗙紪鐮�:</label> + <input v-model="formData.sampleSizeNo" class="form-input" disabled="true" + type="text"/> + </view> + <view class="form-group"> + <label class="form-label">妫�楠屾按骞�:</label> + <input v-model="formData.fcheckLevel" class="form-input" disabled="true" + type="text"/> + </view> + <view class="form-group"> + <label class="form-label">鎺ユ敹姘村钩:</label> + <input v-model="formData.facLevel" class="form-input" disabled="true" type="text"/> + </view> + </view> + </view> + </view> - <!-- 鏁板�兼爣鍑嗘ā鍧� --> - <view class="module-item"> - <view class="module-header"> - <text class="module-title">鏁板�兼爣鍑�</text> - </view> - <view class="module-content"> - <view class="form-grid"> - <view class="form-group"> - <label class="form-label">涓嬮檺:</label> - <input class="form-input" disabled="true" type="text" - v-model="formData.fdownAllow" /> - </view> - <view class="form-group"> - <label class="form-label">鏍囧噯鍊�:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.fstand" /> - </view> - <view class="form-group"> - <label class="form-label">涓婇檺:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.fupAllow" /> - </view> - </view> - </view> - </view> + <!-- 鏁板�兼爣鍑嗘ā鍧� --> + <view class="module-item"> + <view class="module-header"> + <text class="module-title">鏁板�兼爣鍑�</text> + </view> + <view class="module-content"> + <view class="form-grid"> + <view class="form-group"> + <label class="form-label">涓嬮檺:</label> + <input v-model="formData.fdownAllow" class="form-input" disabled="true" + type="text"/> + </view> + <view class="form-group"> + <label class="form-label">鏍囧噯鍊�:</label> + <input v-model="formData.fstand" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">涓婇檺:</label> + <input v-model="formData.fupAllow" class="form-input" disabled="true" type="text"/> + </view> + </view> + </view> + </view> - <!-- 鍒ゅ畾鏍囧噯妯″潡 --> - <view class="module-item"> - <view class="module-header"> - <text class="module-title">鍒ゅ畾鏍囧噯</text> - </view> - <view class="module-content"> - <view class="form-grid"> - <view class="form-group"> - <label class="form-label">AC鏁�:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.facQty" /> - </view> - <view class="form-group"> - <label class="form-label">RE鏁�:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.freQty" /> - </view> - <view class="form-group"> - <label class="form-label">涓嶅悎鏍兼暟:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.fngQty" /> - </view> - <view class="form-group"> - <label class="form-label">棰勮缁撴灉:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.fcheckResu" /> - </view> - </view> - </view> - </view> - </view> + <!-- 鍒ゅ畾鏍囧噯妯″潡 --> + <view class="module-item"> + <view class="module-header"> + <text class="module-title">鍒ゅ畾鏍囧噯</text> + </view> + <view class="module-content"> + <view class="form-grid"> + <view class="form-group"> + <label class="form-label">AC鏁�:</label> + <input v-model="formData.facQty" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">RE鏁�:</label> + <input v-model="formData.freQty" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">涓嶅悎鏍兼暟:</label> + <input v-model="formData.fngQty" class="form-input" disabled="true" type="text"/> + </view> + <view class="form-group"> + <label class="form-label">棰勮缁撴灉:</label> + <input v-model="formData.fcheckResu" class="form-input" disabled="true" type="text"/> + </view> + </view> + </view> + </view> + </view> - <!-- 澶囨敞淇℃伅妯″潡 --> - <!-- <view class="form-section"> - <view class="section-title">澶囨敞淇℃伅</view> - <view class="form-grid"> - <view class="form-group"> - <label class="form-label">涓嶅悎鏍兼弿杩�:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.remarks" /> - </view> - </view> - </view> --> + <!-- 澶囨敞淇℃伅妯″潡 --> + <!-- <view class="form-section"> + <view class="section-title">澶囨敞淇℃伅</view> + <view class="form-grid"> + <view class="form-group"> + <label class="form-label">涓嶅悎鏍兼弿杩�:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.remarks" /> + </view> + </view> + </view> --> - <!-- 妫�娴嬬粨鏋滃尯鍩� --> - <view class="form-section"> - <view class="section-title">妫�娴嬬粨鏋�</view> - <view class="form-grid"> - <view class="form-group"> - <label class="form-label">妫�娴嬬粨鏋�:</label> - <input class="form-input" type="number" v-model="fcheckResuK" /> - </view> + <!-- 妫�娴嬬粨鏋滃尯鍩� --> + <view class="form-section"> + <view class="section-title">妫�娴嬬粨鏋�</view> + <view class="form-grid"> + <view class="form-group"> + <label class="form-label">妫�娴嬬粨鏋�:</label> + <input v-model="fcheckResuK" class="form-input" type="number"/> + </view> - <!-- 鎻愮ず璇嶄綔涓烘娴嬬粨鏋滅殑鎻愮ず --> - <view class="form-group tip-group"> - <view class="tip-box"> - <view class="tip-icon">鈿狅笍</view> - <view class="tip-text">娌℃湁鏈�澶у�煎拰鏈�灏忓�兼椂濉啓<span class="highlight">0锛堟湭閫氳繃妫�楠岋級</span>鎴�<span - class="highlight">1锛堥�氳繃妫�楠岋級</span></view> - </view> - </view> - </view> - </view> + <!-- 鎻愮ず璇嶄綔涓烘娴嬬粨鏋滅殑鎻愮ず --> + <view class="form-group tip-group"> + <view class="tip-box"> + <view class="tip-icon">鈿狅笍</view> + <view class="tip-text">娌℃湁鏈�澶у�煎拰鏈�灏忓�兼椂濉啓<span class="highlight">0锛堟湭閫氳繃妫�楠岋級</span>鎴�<span + class="highlight">1锛堥�氳繃妫�楠岋級</span></view> + </view> + </view> + </view> + </view> - <button :class="['action-btn', 'btn-primary', { 'btn-loading': isLoading }]" - v-if="tableData.length < formData.checkQyt" @click="submit" :disabled="isLoading"> - {{ isLoading ? '淇濆瓨涓�...' : '淇濆瓨' }} - </button> - </view> - </view> + <button v-if="tableData.length < formData.checkQyt" + :class="['action-btn', 'btn-primary', { 'btn-loading': isLoading }]" :disabled="isLoading" @click="submit"> + {{ isLoading ? '淇濆瓨涓�...' : '淇濆瓨' }} + </button> + </view> + </view> - <!-- 妫�楠岀粨鏋滆〃鏍煎崱鐗� --> - <view class="table-card"> - <view class="table-title"> - <view class="title-icon">馃搳</view> - <span>妫�楠岀粨鏋滃垪琛�</span> - </view> - <view class="list-container"> - <uni-table ref="table" border emptyText="鏆傛棤鏇村鏁版嵁"> - <uni-tr> - <uni-th width="80" align="center" class="th">缂栧彿</uni-th> - <uni-th width="120" align="center" class="th">鍒ゅ畾鏍囪瘑</uni-th> - <uni-th width="100" align="center" class="th">妫�楠岀粨鏋�</uni-th> - <uni-th width="120" align="center" class="th">鎿嶄綔</uni-th> - </uni-tr> - <uni-tr v-for="(item, index) in tableData" :key="index" class="table-row" - :class="{ 'hover-effect': isHoveringRow === index }" @mouseenter="isHoveringRow = index" - @mouseleave="isHoveringRow = -1"> - <uni-td align="center"> - {{ index + 1 }} - </uni-td> - <uni-td align="center"> - <input class="form-input" disabled="true" type="text" v-model="item.fstand" /> - </uni-td> - <uni-td align="center"> - <span class="result-badge" - :class="{ 'pass': item.fcheckResu === 'OK', 'fail': item.fcheckResu === 'NG' }"> + <!-- 妫�楠岀粨鏋滆〃鏍煎崱鐗� --> + <view class="table-card"> + <view class="table-title"> + <view class="title-icon">馃搳</view> + <span>妫�楠岀粨鏋滃垪琛�</span> + </view> + <view class="list-container"> + <uni-table ref="table" border emptyText="鏆傛棤鏇村鏁版嵁"> + <uni-tr> + <uni-th align="center" class="th" width="80">缂栧彿</uni-th> + <uni-th align="center" class="th" width="120">鍒ゅ畾鏍囪瘑</uni-th> + <uni-th align="center" class="th" width="100">妫�楠岀粨鏋�</uni-th> + <uni-th align="center" class="th" width="120">鎿嶄綔</uni-th> + </uni-tr> + <uni-tr v-for="(item, index) in tableData" :key="index" :class="{ 'hover-effect': isHoveringRow === index }" + class="table-row" @mouseenter="isHoveringRow = index" + @mouseleave="isHoveringRow = -1"> + <uni-td align="center"> + {{ index + 1 }} + </uni-td> + <uni-td align="center"> + <input v-model="item.fstand" class="form-input" disabled="true" type="text"/> + </uni-td> + <uni-td align="center"> + <span :class="{ 'pass': item.fcheckResu === 'OK', 'fail': item.fcheckResu === 'NG' }" + class="result-badge"> {{ item.fcheckResu || '鏈楠�' }} </span> - </uni-td> - <uni-td align="center"> - <view class="action-group"> - <button :class="['action-btn', 'btn-sm', 'btn-warn', { 'btn-disabled': isLoading }]" - v-if="isNumber" @click="toDetail(item)" :disabled="isLoading"> - {{ isLoading ? '澶勭悊涓�...' : '淇敼' }} - </button> - <button :class="['action-btn', 'btn-sm', 'btn-warn', { 'btn-disabled': isLoading }]" - v-if="!isNumber" @click="numberEdit(item)" :disabled="isLoading"> - {{ isLoading ? '澶勭悊涓�...' : editResult(item.fcheckResu) }} - </button> - </view> - </uni-td> - </uni-tr> - </uni-table> - </view> - </view> + </uni-td> + <uni-td align="center"> + <view class="action-group"> + <button v-if="isNumber" + :class="['action-btn', 'btn-sm', 'btn-warn', { 'btn-disabled': isLoading }]" :disabled="isLoading" @click="toDetail(item)"> + {{ isLoading ? '澶勭悊涓�...' : '淇敼' }} + </button> + <button v-if="!isNumber" + :class="['action-btn', 'btn-sm', 'btn-warn', { 'btn-disabled': isLoading }]" :disabled="isLoading" @click="numberEdit(item)"> + {{ isLoading ? '澶勭悊涓�...' : editResult(item.fcheckResu) }} + </button> + </view> + </uni-td> + </uni-tr> + </uni-table> + </view> + </view> - <!-- 鎿嶄綔鎸夐挳 --> - <view class="action-buttons"> - <view class="button-group"> - <button :class="['action-btn', 'btn-warn', { 'btn-disabled': isLoading }]" @click="saveRemarks" - :disabled="isLoading"> - {{ isLoading ? '澶勭悊涓�...' : '娣诲姞涓嶅悎鏍兼弿杩�' }} - </button> - </view> - </view> + <!-- 鎿嶄綔鎸夐挳 --> + <view class="action-buttons"> + <view class="button-group"> + <button :class="['action-btn', 'btn-warn', { 'btn-disabled': isLoading }]" :disabled="isLoading" + @click="saveRemarks"> + {{ isLoading ? '澶勭悊涓�...' : '娣诲姞涓嶅悎鏍兼弿杩�' }} + </button> + </view> + </view> - <!-- 淇敼妫�楠岀粨鏋滃脊鍑哄眰 --> - <view v-if="showPopup" 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="showPopup = !showPopup">脳</view> - </view> - <form :modelValue="editData"> - <view class="form-group"> - <label class="form-label">妫�楠岀粨鏋�:</label> - <input class="form-input" type="text" v-model="editData.fcheckResu" /> - </view> - <view class="button-group"> - <button :class="['action-btn', 'btn-warn', { 'btn-loading': isEditLoading }]" @click="eidt" - :disabled="isEditLoading"> - {{ isEditLoading ? '淇敼涓�...' : '淇敼' }} - </button> - <button @click="showPopup = !showPopup"> - 鍙栨秷 - </button> - </view> - </form> - </view> - </view> + <!-- 淇敼妫�楠岀粨鏋滃脊鍑哄眰 --> + <view v-if="showPopup" 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="showPopup = !showPopup">脳</view> + </view> + <form :modelValue="editData"> + <view class="form-group"> + <label class="form-label">妫�楠岀粨鏋�:</label> + <input v-model="editData.fcheckResu" class="form-input" type="text"/> + </view> + <view class="button-group"> + <button :class="['action-btn', 'btn-warn', { 'btn-loading': isEditLoading }]" :disabled="isEditLoading" + @click="eidt"> + {{ isEditLoading ? '淇敼涓�...' : '淇敼' }} + </button> + <button @click="showPopup = !showPopup"> + 鍙栨秷 + </button> + </view> + </form> + </view> + </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"> - <button :class="['action-btn', 'btn-warn', { 'btn-loading': isRemarksLoading }]" - @click="editRemarks" :disabled="isRemarksLoading"> - {{ isRemarksLoading ? '淇濆瓨涓�...' : '淇敼' }} - </button> - <button @click="remarksPopup = !remarksPopup"> - 鍙栨秷 - </button> - </view> - </form> - </view> - </view> - </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"> + <button :class="['action-btn', 'btn-warn', { 'btn-loading': isRemarksLoading }]" + :disabled="isRemarksLoading" @click="editRemarks"> + {{ isRemarksLoading ? '淇濆瓨涓�...' : '淇敼' }} + </button> + <button @click="remarksPopup = !remarksPopup"> + 鍙栨秷 + </button> + </view> + </form> + </view> + </view> + </view> </template> <script> - export default { - data() { - return { - formData: {}, - releaseNo: "", - isNumber: false, - checkItem: "", - id: 0, - gid: 0, - billNo: "", - showPopup: false, - editData: {}, - tableData: [], - remarks: "", - remarksPopup: false, - fcheckResuK: "", - isLoading: false, - isEditLoading: false, - isRemarksLoading: false, - isHoveringRow: -1, - isPopupAnimated: false - }; - }, - methods: { - editResult(fcheckResu) { - if (fcheckResu == "OK") { - return "鏀逛负涓嶅悎鏍�"; - } else { - return "鏀逛负鍚堟牸"; - } - }, - submit() { - this.isLoading = true; - let count = this.formData.checkQyt; - let fstand = "鈭�"; - if (Number(this.formData.fupAllow) && Number(this.formData.fdownAllow)) { - if (!this.fcheckResuK) { - this.$showMessage("璇疯緭鍏ユ楠屽��"); - this.isLoading = false; - return; - } - if ( - Number(this.fcheckResuK) >= Number(this.formData.fdownAllow) && - Number(this.fcheckResuK) <= Number(this.formData.fupAllow) - ) { - fstand = "鈭�"; - } else { - fstand = "脳"; - } - count = 1; - } else { - if (!this.fcheckResuK) { - this.formData.fcheckResu = 1; - } - if (this.fcheckResuK == 0 || this.fcheckResuK == 1) { - this.formData.isPass = this.fcheckResuK; - } else { - this.$showMessage("鏃犳爣鍑嗗�兼椂锛屾楠岀粨鏋滃彧鑳戒负0鎴�1!"); - this.isLoading = false; - return; - } - count = count - this.tableData.length; - } - this.formData.updater = this.$loginInfo.account; - this.$post({ - url: "/LLJ/SetQSItemDetail", - data: { - mainId: this.formData.id, - releaseNo: this.formData.releaseNo, - fstand: fstand, - fcheckResu: this.fcheckResuK, - LastupdateBy: this.$loginInfo.account, - count: count - } - }).then((res) => { - this.formData.fcheckResu = null; - this.$showMessage("淇濆瓨鎴愬姛"); - this.refreshResult(); - this.isLoading = false; - }).catch(() => { - this.$showMessage("淇濆瓨澶辫触锛岃閲嶈瘯"); - this.isLoading = false; - }); - }, - refreshResult() { - this.isLoading = true; - this.$post({ - url: "/MesOqcItemsDetect02/getXjDetail02ById", - data: { - id: this.id - } - }).then((res) => { - this.formData = res.data.tbBillList.itemXj01; - this.tableData = res.data.tbBillList.itemXj02s; - - if (this.formData.fupAllow && this.formData.fdownAllow && this.formData.fstand) { - this.isNumber = true; - } else { - this.isNumber = false; - } - this.isLoading = false; - }).catch(() => { - this.$showMessage("鑾峰彇鏁版嵁澶辫触"); - this.isLoading = false; - }); - }, - toDetail(item) { - this.showPopup = true; - this.editData = { - ...item - }; - }, - eidt() { - this.isEditLoading = true; - if (!this.editData.fcheckResu) { - this.$showMessage("璇疯緭鍏ユ楠岀粨鏋�"); - this.isEditLoading = false; - return; - } - if (this.formData.fcheckResu == this.editData.fcheckResu) { - this.$showMessage("淇敼鎴愬姛"); - this.showPopup = false; - this.isEditLoading = false; - return; - } - let fstand = "鈭�"; - if (this.formData.fupAllow && this.formData.fdownAllow) { - if (!this.editData.fcheckResu) { - this.$showMessage("璇疯緭鍏ユ楠屽��"); - this.isEditLoading = false; - return; - } - if ( - Number(this.editData.fcheckResu) >= Number(this.formData.fdownAllow) && - Number(this.editData.fcheckResu) <= Number(this.formData.fupAllow) - ) { - this.editData.isPass = 1; - fstand = "鈭�"; - } else { - this.editData.isPass = 0; - fstand = "脳"; - } - } else { - if (!this.editData.fcheckResu) { - this.editData.fcheckResu = 1; - } - if (this.editData.fcheckResu == 0 || this.editData.fcheckResu == 1) { - if (this.editData.fcheckResu == 0) { - fstand = "脳"; - } - } else { - this.$showMessage("鏃犳爣鍑嗗�兼椂锛屾楠岀粨鏋滃彧鑳戒负0鎴�1!"); - this.isEditLoading = false; - return; - } - } - this.editData.updater = this.$loginInfo.account; - this.$post({ - url: "/MesOqcItemsDetect02/UpdateQSItemDetail", - data: { - id: this.editData.id, - mainId: this.formData.id, - releaseNo: this.formData.releaseNo, - fstand: fstand, - fcheckResu: this.editData.fcheckResu, - lastupdateBy: this.$loginInfo.account - } - }).then((res) => { - this.showPopup = false; - this.$showMessage("淇敼鎴愬姛"); - this.refreshResult(); - this.isEditLoading = false; - }).catch(() => { - this.$showMessage("淇敼澶辫触锛岃閲嶈瘯"); - this.isEditLoading = false; - }); - }, - numberEdit(item) { - this.isLoading = true; - let fstand = "鈭�"; - let fcheckResu = "OK"; - if (item.fcheckResu == "OK") { - fstand = "脳"; - fcheckResu = "NG"; - } - this.$post({ - url: "/MesOqcItemsDetect02/UpdateQSItemDetail", - data: { - id: item.id, - mainId: this.formData.id, - releaseNo: this.formData.releaseNo, - fstand: fstand, - fcheckResu: fcheckResu, - lastupdateBy: this.$loginInfo.account - } - }).then((res) => { - this.$showMessage("淇敼鎴愬姛"); - this.refreshResult(); - this.isLoading = false; - }).catch(() => { - this.$showMessage("淇敼澶辫触锛岃閲嶈瘯"); - this.isLoading = false; - }); - }, - saveRemarks() { - this.remarksPopup = true; - this.remarks = this.formData.remarks || ""; - }, - editRemarks() { - this.isRemarksLoading = true; - if (this.remarks) { - this.$post({ - url: "/MesOqcItemsDetect02/saveRemarksPid", - data: { - pid: this.formData.id, - remarks: this.remarks - } - }).then((res) => { - if (res.data.tbBillList > 0) { - this.formData.remarks = this.remarks; - this.remarksPopup = false; - this.$showMessage("淇濆瓨鎴愬姛"); - } else { - this.$showMessage("淇濆瓨澶辫触"); - } - this.isRemarksLoading = false; - }).catch(() => { - this.$showMessage("淇濆瓨澶辫触锛岃閲嶈瘯"); - this.isRemarksLoading = false; - }); - } else { - this.$showMessage("璇疯緭鍏ヤ笉鍚堟牸鎻忚堪"); - this.isRemarksLoading = false; - } - } - }, - onLoad(options) { - let params = options; - this.id = params["mainId"]; - this.releaseNo = params["releaseNo"]; - this.refreshResult(); - } - }; +export default { + data() { + return { + formData: {}, + releaseNo: "", + isNumber: false, + checkItem: "", + id: 0, + gid: 0, + billNo: "", + showPopup: false, + editData: {}, + tableData: [], + remarks: "", + remarksPopup: false, + fcheckResuK: "", + isLoading: false, + isEditLoading: false, + isRemarksLoading: false, + isHoveringRow: -1, + isPopupAnimated: false + }; + }, + methods: { + editResult(fcheckResu) { + if (fcheckResu == "OK") { + return "鏀逛负涓嶅悎鏍�"; + } else { + return "鏀逛负鍚堟牸"; + } + }, + submit() { + this.isLoading = true; + let count = this.formData.checkQyt; + let fstand = "鈭�"; + if (Number(this.formData.fupAllow) && Number(this.formData.fdownAllow)) { + if (!this.fcheckResuK) { + this.$showMessage("璇疯緭鍏ユ楠屽��"); + this.isLoading = false; + return; + } + if ( + Number(this.fcheckResuK) >= Number(this.formData.fdownAllow) && + Number(this.fcheckResuK) <= Number(this.formData.fupAllow) + ) { + fstand = "鈭�"; + } else { + fstand = "脳"; + } + count = 1; + } else { + if (!this.fcheckResuK) { + this.formData.fcheckResu = 1; + } + if (this.fcheckResuK == 0 || this.fcheckResuK == 1) { + this.formData.isPass = this.fcheckResuK; + } else { + this.$showMessage("鏃犳爣鍑嗗�兼椂锛屾楠岀粨鏋滃彧鑳戒负0鎴�1!"); + this.isLoading = false; + return; + } + count = count - this.tableData.length; + } + this.formData.updater = this.$loginInfo.account; + this.$post({ + url: "/LLJ/SetQSItemDetail", + data: { + mainId: this.formData.id, + releaseNo: this.formData.releaseNo, + fstand: fstand, + fcheckResu: this.fcheckResuK, + LastupdateBy: this.$loginInfo.account, + count: count + } + }).then((res) => { + this.formData.fcheckResu = null; + this.$showMessage("淇濆瓨鎴愬姛"); + this.refreshResult(); + this.isLoading = false; + }).catch(() => { + this.$showMessage("淇濆瓨澶辫触锛岃閲嶈瘯"); + this.isLoading = false; + }); + }, + refreshResult() { + this.isLoading = true; + this.$post({ + url: "/MesOqcItemsDetect02/getXjDetail02ById", + data: { + id: this.id + } + }).then((res) => { + this.formData = res.data.tbBillList.itemXj01; + this.tableData = res.data.tbBillList.itemXj02s; + + if (this.formData.fupAllow && this.formData.fdownAllow && this.formData.fstand) { + this.isNumber = true; + } else { + this.isNumber = false; + } + this.isLoading = false; + }).catch(() => { + this.$showMessage("鑾峰彇鏁版嵁澶辫触"); + this.isLoading = false; + }); + }, + toDetail(item) { + this.showPopup = true; + this.editData = { + ...item + }; + }, + eidt() { + this.isEditLoading = true; + if (!this.editData.fcheckResu) { + this.$showMessage("璇疯緭鍏ユ楠岀粨鏋�"); + this.isEditLoading = false; + return; + } + if (this.formData.fcheckResu == this.editData.fcheckResu) { + this.$showMessage("淇敼鎴愬姛"); + this.showPopup = false; + this.isEditLoading = false; + return; + } + let fstand = "鈭�"; + if (this.formData.fupAllow && this.formData.fdownAllow) { + if (!this.editData.fcheckResu) { + this.$showMessage("璇疯緭鍏ユ楠屽��"); + this.isEditLoading = false; + return; + } + if ( + Number(this.editData.fcheckResu) >= Number(this.formData.fdownAllow) && + Number(this.editData.fcheckResu) <= Number(this.formData.fupAllow) + ) { + this.editData.isPass = 1; + fstand = "鈭�"; + } else { + this.editData.isPass = 0; + fstand = "脳"; + } + } else { + if (!this.editData.fcheckResu) { + this.editData.fcheckResu = 1; + } + if (this.editData.fcheckResu == 0 || this.editData.fcheckResu == 1) { + if (this.editData.fcheckResu == 0) { + fstand = "脳"; + } + } else { + this.$showMessage("鏃犳爣鍑嗗�兼椂锛屾楠岀粨鏋滃彧鑳戒负0鎴�1!"); + this.isEditLoading = false; + return; + } + } + this.editData.updater = this.$loginInfo.account; + this.$post({ + url: "/MesOqcItemsDetect02/UpdateQSItemDetail", + data: { + id: this.editData.id, + mainId: this.formData.id, + releaseNo: this.formData.releaseNo, + fstand: fstand, + fcheckResu: this.editData.fcheckResu, + lastupdateBy: this.$loginInfo.account + } + }).then((res) => { + this.showPopup = false; + this.$showMessage("淇敼鎴愬姛"); + this.refreshResult(); + this.isEditLoading = false; + }).catch(() => { + this.$showMessage("淇敼澶辫触锛岃閲嶈瘯"); + this.isEditLoading = false; + }); + }, + numberEdit(item) { + this.isLoading = true; + let fstand = "鈭�"; + let fcheckResu = "OK"; + if (item.fcheckResu == "OK") { + fstand = "脳"; + fcheckResu = "NG"; + } + this.$post({ + url: "/MesOqcItemsDetect02/UpdateQSItemDetail", + data: { + id: item.id, + mainId: this.formData.id, + releaseNo: this.formData.releaseNo, + fstand: fstand, + fcheckResu: fcheckResu, + lastupdateBy: this.$loginInfo.account + } + }).then((res) => { + this.$showMessage("淇敼鎴愬姛"); + this.refreshResult(); + this.isLoading = false; + }).catch(() => { + this.$showMessage("淇敼澶辫触锛岃閲嶈瘯"); + this.isLoading = false; + }); + }, + saveRemarks() { + this.remarksPopup = true; + this.remarks = this.formData.remarks || ""; + }, + editRemarks() { + this.isRemarksLoading = true; + if (this.remarks) { + this.$post({ + url: "/MesOqcItemsDetect02/saveRemarksPid", + data: { + pid: this.formData.id, + remarks: this.remarks + } + }).then((res) => { + if (res.data.tbBillList > 0) { + this.formData.remarks = this.remarks; + this.remarksPopup = false; + this.$showMessage("淇濆瓨鎴愬姛"); + } else { + this.$showMessage("淇濆瓨澶辫触"); + } + this.isRemarksLoading = false; + }).catch(() => { + this.$showMessage("淇濆瓨澶辫触锛岃閲嶈瘯"); + this.isRemarksLoading = false; + }); + } else { + this.$showMessage("璇疯緭鍏ヤ笉鍚堟牸鎻忚堪"); + this.isRemarksLoading = false; + } + } + }, + onLoad(options) { + let params = options; + this.id = params["mainId"]; + this.releaseNo = params["releaseNo"]; + this.refreshResult(); + } +}; </script> <style> - /* 椤甸潰瀹瑰櫒 */ - .page-container { - padding: 20px; - background-color: #f5f5f5; - min-height: 100vh; - } +/* 椤甸潰瀹瑰櫒 */ +.page-container { + padding: 20px; + background-color: #f5f5f5; + min-height: 100vh; +} - /* 琛ㄥ崟鍗$墖 */ - .form-card { - background-color: #fff; - border-radius: 12px; - padding: 20px; - margin-bottom: 20px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); - } +/* 琛ㄥ崟鍗$墖 */ +.form-card { + background-color: #fff; + border-radius: 12px; + padding: 20px; + margin-bottom: 20px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); +} - /* 琛ㄥ崟鏍囬 */ - .form-title { - display: flex; - align-items: center; - font-size: 18px; - color: #333; - margin-bottom: 15px; - } +/* 琛ㄥ崟鏍囬 */ +.form-title { + display: flex; + align-items: center; + font-size: 18px; + color: #333; + margin-bottom: 15px; +} - .title-icon { - font-size: 22px; - margin-right: 10px; - } +.title-icon { + font-size: 22px; + margin-right: 10px; +} - /* 琛ㄥ崟瀹瑰櫒 */ - .form-container { - padding-top: 10px; - } +/* 琛ㄥ崟瀹瑰櫒 */ +.form-container { + padding-top: 10px; +} - /* 琛ㄥ崟妯″潡鏍囬 */ - .form-section { - margin-bottom: 20px; - } +/* 琛ㄥ崟妯″潡鏍囬 */ +.form-section { + margin-bottom: 20px; +} - .section-title { - font-size: 16px; - font-weight: 600; - color: #333; - margin-bottom: 10px; - } +.section-title { + font-size: 16px; + font-weight: 600; + color: #333; + margin-bottom: 10px; +} - /* 琛ㄦ牸甯冨眬 */ - .form-grid { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 15px; - } +/* 琛ㄦ牸甯冨眬 */ +.form-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 15px; +} - /* 琛ㄥ崟椤� */ - .form-group { - display: flex; - align-items: center; - } +/* 琛ㄥ崟椤� */ +.form-group { + display: flex; + align-items: center; +} - .form-label { - width: 130px; - color: #333; - font-size: 14px; - font-weight: 500; - } +.form-label { + width: 130px; + color: #333; + font-size: 14px; + font-weight: 500; +} - .form-input { - flex: 1; - height: 40px; - padding: 0 10px; - border: 1px solid #e0e0e0; - border-radius: 8px; - background-color: #f8f8f8; - color: #666; - font-size: 14px; - } +.form-input { + flex: 1; + height: 40px; + padding: 0 10px; + border: 1px solid #e0e0e0; + border-radius: 8px; + background-color: #f8f8f8; + color: #666; + font-size: 14px; +} - .form-input:disabled { - background-color: #e9e9e9; - } +.form-input:disabled { + background-color: #e9e9e9; +} - .form-input:focus { - border-color: #007AFF; - outline: none; - } +.form-input:focus { + border-color: #007AFF; + outline: none; +} - /* 妫�楠岀粨鏋滃尯鍩� */ - .tip-group { - margin-top: 15px; - } +/* 妫�楠岀粨鏋滃尯鍩� */ +.tip-group { + margin-top: 15px; +} - .tip-box { - display: flex; - align-items: center; - background-color: #fff5d1; - padding: 10px; - border-radius: 8px; - border: 1px solid #f0e0a7; - } +.tip-box { + display: flex; + align-items: center; + background-color: #fff5d1; + padding: 10px; + border-radius: 8px; + border: 1px solid #f0e0a7; +} - .tip-icon { - font-size: 20px; - color: #f39c12; - margin-right: 10px; - } +.tip-icon { + font-size: 20px; + color: #f39c12; + margin-right: 10px; +} - .tip-text { - font-size: 14px; - color: #333; - } +.tip-text { + font-size: 14px; + color: #333; +} - .highlight { - color: #007AFF; - font-weight: 600; - } +.highlight { + color: #007AFF; + font-weight: 600; +} - /* 鎸夐挳鏍峰紡 */ - .action-btn { - width: 100%; - padding: 12px; - border-radius: 8px; - border: none; - color: #fff; - font-size: 16px; - font-weight: 500; - display: flex; - align-items: center; - justify-content: center; - cursor: pointer; - transition: background-color 0.3s ease; - } +/* 鎸夐挳鏍峰紡 */ +.action-btn { + width: 100%; + padding: 12px; + border-radius: 8px; + border: none; + color: #fff; + font-size: 16px; + font-weight: 500; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + transition: background-color 0.3s ease; +} - .btn-primary { - background-color: #007AFF; - } +.btn-primary { + background-color: #007AFF; +} - .btn-primary:hover { - background-color: #0056CC; - } +.btn-primary:hover { + background-color: #0056CC; +} - .btn-warn { - background-color: #f1b344; - } +.btn-warn { + background-color: #f1b344; +} - .btn-warn:hover { - background-color: #e6a135; - } +.btn-warn:hover { + background-color: #e6a135; +} - .btn-disabled { - background-color: #c0c0c0; - cursor: not-allowed; - } +.btn-disabled { + background-color: #c0c0c0; + cursor: not-allowed; +} - /* 寮瑰嚭灞傛牱寮� */ - .overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); - display: flex; - justify-content: center; - align-items: center; - z-index: 1000; - opacity: 0; - transition: opacity 0.3s ease; - } +/* 寮瑰嚭灞傛牱寮� */ +.overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; + opacity: 0; + transition: opacity 0.3s ease; +} - .overlay.active { - opacity: 1; - } +.overlay.active { + opacity: 1; +} - .popup { - background-color: #fff; - border-radius: 12px; - width: 90%; - max-width: 500px; - padding: 20px; - transform: scale(0.8); - transition: transform 0.3s ease; - } +.popup { + background-color: #fff; + border-radius: 12px; + width: 90%; + max-width: 500px; + padding: 20px; + transform: scale(0.8); + transition: transform 0.3s ease; +} - .popup-scale { - transform: scale(1); - } +.popup-scale { + transform: scale(1); +} - .popup-header { - display: flex; - justify-content: space-between; - align-items: center; - } +.popup-header { + display: flex; + justify-content: space-between; + align-items: center; +} - .popup-title { - font-size: 16px; - font-weight: 600; - color: #333; - } +.popup-title { + font-size: 16px; + font-weight: 600; + color: #333; +} - .close-btn { - font-size: 20px; - color: #333; - cursor: pointer; - } +.close-btn { + font-size: 20px; + color: #333; + cursor: pointer; +} - /* 鎿嶄綔鎸夐挳缁� */ - .button-group { - display: flex; - justify-content: space-between; - margin-top: 20px; - } +/* 鎿嶄綔鎸夐挳缁� */ +.button-group { + display: flex; + justify-content: space-between; + margin-top: 20px; +} - .button-group button { - width: 48%; - padding: 10px; - border-radius: 8px; - border: none; - font-size: 14px; - font-weight: 500; - cursor: pointer; - } +.button-group button { + width: 48%; + padding: 10px; + border-radius: 8px; + border: none; + font-size: 14px; + font-weight: 500; + cursor: pointer; +} - /* 妫�楠岀粨鏋滆〃鏍煎崱鐗� */ - .table-card { - background-color: #fff; - border-radius: 12px; - padding: 20px; - margin-bottom: 20px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); - } +/* 妫�楠岀粨鏋滆〃鏍煎崱鐗� */ +.table-card { + background-color: #fff; + border-radius: 12px; + padding: 20px; + margin-bottom: 20px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); +} - /* 琛ㄦ牸鏍囬 */ - .table-title { - display: flex; - align-items: center; - font-size: 16px; - color: #333; - font-weight: 600; - margin-bottom: 15px; - } +/* 琛ㄦ牸鏍囬 */ +.table-title { + display: flex; + align-items: center; + font-size: 16px; + color: #333; + font-weight: 600; + margin-bottom: 15px; +} - .title-icon { - font-size: 22px; - margin-right: 10px; - } +.title-icon { + font-size: 22px; + margin-right: 10px; +} - /* 琛ㄦ牸鏍峰紡 */ - .uni-table { - width: 100%; - border-collapse: collapse; - } +/* 琛ㄦ牸鏍峰紡 */ +.uni-table { + width: 100%; + border-collapse: collapse; +} - .uni-th, - .uni-td { - padding: 12px; - text-align: center; - } +.uni-th, +.uni-td { + padding: 12px; + text-align: center; +} - .uni-th { - background-color: #f5f5f5; - font-size: 14px; - color: #666; - font-weight: 500; - } +.uni-th { + background-color: #f5f5f5; + font-size: 14px; + color: #666; + font-weight: 500; +} - .table-row { - background-color: #fff; - border-bottom: 1px solid #e0e0e0; - } +.table-row { + background-color: #fff; + border-bottom: 1px solid #e0e0e0; +} - .table-row:hover { - background-color: #f9f9f9; - } +.table-row:hover { + background-color: #f9f9f9; +} - .result-badge { - padding: 5px 12px; - font-size: 12px; - border-radius: 10px; - color: #fff; - display: inline-block; - } +.result-badge { + padding: 5px 12px; + font-size: 12px; + border-radius: 10px; + color: #fff; + display: inline-block; +} - .pass { - background-color: #28a745; - } +.pass { + background-color: #28a745; +} - .fail { - background-color: #dc3545; - } +.fail { + background-color: #dc3545; +} - .pending { - background-color: #f1b344; - } +.pending { + background-color: #f1b344; +} - .action-group { - display: flex; - gap: 10px; - } +.action-group { + display: flex; + gap: 10px; +} - .action-btn.btn-sm { - width: auto; - padding: 6px 12px; - font-size: 12px; - } +.action-btn.btn-sm { + width: auto; + padding: 6px 12px; + font-size: 12px; +} - /* 鎻愮ず淇℃伅 */ - .hover-effect:hover { - background-color: #f9f9f9; - } +/* 鎻愮ず淇℃伅 */ +.hover-effect:hover { + background-color: #f9f9f9; +} - .btn-sm { - font-size: 14px; - } +.btn-sm { + font-size: 14px; +} - .btn-loading { - background-color: #c0c0c0; - cursor: not-allowed; - } +.btn-loading { + background-color: #c0c0c0; + cursor: not-allowed; +} + +/* 涓変釜妯″潡骞跺垪瀹瑰櫒鏍峰紡 */ +.three-modules-container { + display: flex; + flex-direction: column; + gap: 15px; + margin-bottom: 20px; +} + +/* 妯″潡椤规牱寮� */ +.module-item { + background-color: #f8f9fa; + border-radius: 8px; + padding: 15px; + border: 1px solid #e0e0e0; +} + +.module-header { + border-bottom: 1px solid #d0d0d0; + padding-bottom: 8px; + margin-bottom: 12px; +} + +.module-title { + font-size: 15px; + font-weight: 600; + color: #333; +} + +/* 鎵嬫満灞忓箷浼樺寲 */ +@media (max-width: 768px) { + .page-container { + padding: 10px; + } + + .form-card, .table-card { + padding: 15px; + border-radius: 8px; + } + + .form-grid { + grid-template-columns: 1fr; + gap: 12px; + } + + .form-group { + flex-direction: column; + align-items: flex-start; + } + + .form-label { + width: auto; + margin-bottom: 5px; + font-size: 13px; + } + + .form-input { + width: 100%; + height: 36px; + font-size: 13px; + } + + .three-modules-container { + gap: 12px; + } + + .module-item { + padding: 12px; + } + + .module-title { + font-size: 14px; + } + + .tip-box { + padding: 8px; + } + + .tip-text { + font-size: 13px; + } +} + +/* 瓒呭皬灞忓箷浼樺寲 */ +@media (max-width: 480px) { + .page-container { + padding: 8px; + } + + .form-card, .table-card { + padding: 12px; + } + + .form-input { + height: 34px; + font-size: 12px; + } + + .form-label { + font-size: 12px; + } + + .action-btn { + padding: 10px; + font-size: 14px; + } +} </style> \ No newline at end of file -- Gitblit v1.9.3