From 7c2192a2f000d94add173b77b6bd4c8c4fc6a5e4 Mon Sep 17 00:00:00 2001 From: xwt <2740516069@qq.com> Date: 星期三, 17 九月 2025 09:41:47 +0800 Subject: [PATCH] SJ穴模数 --- pages/QC/XJ/Add.vue | 11 pages/QC/SJ/detail.vue | 233 +++++++++++--- pages/QC/SJ/List.vue | 47 ++ pages/QC/SJ/Add.vue | 607 +++++++++++++++++++++++---------------- 4 files changed, 577 insertions(+), 321 deletions(-) diff --git a/pages/QC/SJ/Add.vue b/pages/QC/SJ/Add.vue index a846c6d..4d7c0b9 100644 --- a/pages/QC/SJ/Add.vue +++ b/pages/QC/SJ/Add.vue @@ -96,53 +96,34 @@ <view v-if="item.result==null || item.result==''" class="watermark pending"> {{ getStatusText(item.result) }} </view> - <view class="description-text">妫�楠岄」鐩鎯�</view> + <view class="description-text">{{ getInspectionDescription(item) }}</view> </td> <td> <button class="record-btn" @click="toDetail(item)"> - {{ item.levelNum + '/' + item.isCheck }} + {{ getTotalCount(item) + '/' + item.isCheck }} </button> </td> </tr> </tbody> </table> </view> - <!-- 鎿嶄綔鎸夐挳鍖� --> - <view class="action-buttons"> - <button class="action-btn primary" v-if="isUpdate && !isShowTable" @click="save"> - 鍒涘缓妫�楠屽崟骞剁敓鎴愰儴鍒嗛粯璁ゅ�� - </button> - <button class="action-btn secondary" v-if="!isUpdate && !isShowTable" @click="toImage"> - 涓婁紶/鏌ョ湅鍥剧墖 - </button> - <button class="action-btn secondary" v-if="!isUpdate && !isShowTable" @click="fetchDrawingNumber(formData.itemNo)"> - 璋冨彇PLM鍥剧焊 - </button> - <button class="action-btn secondary" v-if="!isUpdate && !isShowTable" @click="getBom"> - Bom鐢ㄦ枡娓呭崟 - </button> - <button class="action-btn secondary" v-if="!isUpdate && !isShowTable && formData.xjGenFlag == 0" - @click="saveXJ"> - 鐢熸垚宸℃ - </button> - <button class="action-btn danger" v-if="!isUpdate && formData.result == '鏈畬鎴�' && !isShowTable" @click="removeXJ"> - 鍒犻櫎鍗曟嵁 - </button> - <button class="action-btn secondary" v-if="!isUpdate && !isShowTable" @click="saveRemarks"> - 娣诲姞涓嶅悎鏍兼弿杩� - </button> - <button class="action-btn primary" v-if="isShowTable" @click="getTable"> - 鑾峰彇妫�楠岄」鐩� - </button> - <button class="action-btn primary" v-if="isShowTable && isUpdate" @click="saveTable"> - 鐢熸垚妫�楠岄」鐩� - </button> - <button class="action-btn success" v-if="!isUpdate && formData.fsubmit == 0 && !isShowTable" @click="getGenUpdate"> - 鑾峰彇妫�楠岄」鐩� - </button> - <button class="action-btn success" v-if="!isUpdate && formData.fsubmit ==0 && !isShowTable" @click="submitInspection"> - 鎻愪氦妫�楠� - </button> + <!-- 琛ㄥ崟涓婃柟鎿嶄綔鎸夐挳鍖� --> + <view class="top-action-buttons"> + <button class="action-btn" v-if="isUpdate && !isShowTable" @click="save">鍒涘缓妫�楠屽崟骞剁敓鎴愰儴鍒嗛粯璁ゅ��</button> + <button class="action-btn" v-if="isShowTable" @click="getTable">鑾峰彇妫�楠岄」鐩�</button> + <button class="action-btn" v-if="isShowTable && isUpdate" @click="saveTable">鐢熸垚妫�楠岄」鐩�</button> + </view> + + <!-- 琛ㄥ崟涓嬫柟鎿嶄綔鎸夐挳鍖� --> + <view class="bottom-action-buttons"> + <button class="action-btn small" v-if="!isUpdate && !isShowTable" @click="toImage">涓婁紶/鏌ョ湅鍥剧墖</button> + <button class="action-btn small" v-if="!isUpdate && !isShowTable" @click="fetchDrawingNumber(formData.itemNo)">璋冨彇PLM鍥剧焊</button> + <button class="action-btn small" v-if="!isUpdate && !isShowTable" @click="getBom">Bom鐢ㄦ枡娓呭崟</button> + <button class="action-btn small" v-if="!isUpdate && !isShowTable && formData.xjGenFlag == 0" @click="saveXJ">鐢熸垚宸℃</button> + <button class="action-btn small" v-if="false" @click="removeXJ">鍒犻櫎鍗曟嵁</button> + <button class="action-btn small" v-if="!isUpdate && !isShowTable" @click="saveRemarks">娣诲姞涓嶅悎鏍兼弿杩�</button> + <button class="action-btn small" v-if="!isUpdate && formData.fsubmit == 0 && !isShowTable" @click="getGenUpdate">鑾峰彇妫�楠岄」鐩�</button> + <button class="action-btn small primary" v-if="!isUpdate && formData.fsubmit ==0 && !isShowTable" @click="submitInspection">鎻愪氦妫�楠�</button> </view> <view class="barcode"> @@ -316,6 +297,24 @@ if (status === '鍚堟牸') return '鍚堟牸'; if (status === '涓嶅悎鏍�') return '涓嶅悎鏍�'; return '鏈畬鎴�'; + }, + getTotalCount(item) { + // 濡傛灉鏈夌┐鍙蜂俊鎭紝浣跨敤绌村彿淇℃伅鐨勬�绘暟閲忓噺鍘诲牭绌存暟閲� + if (item.holeNumbers && item.holeNumbers.length > 0) { + // 璁$畻闈炲牭绌寸殑鏁伴噺 + const nonBlockedCount = item.holeNumbers.filter(hole => !hole.isBlocked).length; + return nonBlockedCount; + } + // 鍚﹀垯浣跨敤levelNum + return item.levelNum || 0; + }, + getInspectionDescription(item) { + // 鐩存帴鍙朓TEM_MOD瀛楁鐨勫�� + if (item.itemMod && item.itemMod.trim() !== '') { + return item.itemMod; + } else { + return '妫�楠岄」鐩鎯�'; + } }, removeXJ() { if (this.formData.id) { @@ -597,16 +596,28 @@ }, submitInspection() { if (this.formData.id) { - this.$post({ - url: "/SJ/SjSubmit", - data: { - id: this.formData.id, - userNo: this.$loginInfo.account - } - }).then(res => { - if (res.data.tbBillList) { - this.$showMessage("鎻愪氦鎴愬姛"); - this.init(); + // 鏄剧ず纭鎻愮ず妗� + uni.showModal({ + title: '纭鎻愪氦', + content: '纭畾瑕佹彁浜ゆ楠岀粨鏋滃悧锛熸彁浜ゅ悗灏嗘棤娉曚慨鏀广��', + confirmText: '纭畾鎻愪氦', + cancelText: '鍙栨秷', + success: (res) => { + if (res.confirm) { + // 鐢ㄦ埛纭鍚庢墽琛屾彁浜� + this.$post({ + url: "/SJ/SjSubmit", + data: { + id: this.formData.id, + userNo: this.$loginInfo.account + } + }).then(res => { + if (res.data.tbBillList) { + this.$showMessage("鎻愪氦鎴愬姛"); + this.init(); + } + }); + } } }); } @@ -863,19 +874,57 @@ this.$showMessage("璇峰厛淇濆瓨妫�楠屽崟锛�"); return; } + + // 鍏堣幏鍙栨楠屽崟鐨勮缁嗕俊鎭紝鍖呭惈mnum鍜宒num this.$post({ - url: "/SJ/GenUpdate", + url: "/SJ/getQSItems", data: { - id: this.formData.id, - no: this.formData.billNo, - user: this.$loginInfo.account + pid: this.formData.id } }).then(res => { - if (res.data.result === 0) { - this.$showMessage("鑾峰彇妫�楠岄」鐩垚鍔�"); - this.init(); + if (res.data.tbBillList && res.data.tbBillList.length > 0) { + // 浠庣涓�涓楠岄」鐩腑鑾峰彇mnum鍜宒num + const firstItem = res.data.tbBillList[0]; + const mnum = firstItem.mnum || 1; + const dnum = firstItem.dnum || ""; + + // 璋冪敤GenUpdate + this.$post({ + url: "/SJ/GenUpdate", + data: { + id: this.formData.id, + no: this.formData.billNo, + user: this.$loginInfo.account, + mnum: mnum, + dnum: dnum + } + }).then(genRes => { + if (genRes.data.result === 0) { + this.$showMessage("鑾峰彇妫�楠岄」鐩垚鍔�"); + this.init(); + } else { + this.$showMessage(genRes.data.message || "鑾峰彇澶辫触"); + } + }); } else { - this.$showMessage(res.data.message || "鑾峰彇澶辫触"); + // 濡傛灉娌℃湁妫�楠岄」鐩紝浣跨敤榛樿鍊� + this.$post({ + url: "/SJ/GenUpdate", + data: { + id: this.formData.id, + no: this.formData.billNo, + user: this.$loginInfo.account, + mnum: 1, + dnum: "" + } + }).then(genRes => { + if (genRes.data.result === 0) { + this.$showMessage("鑾峰彇妫�楠岄」鐩垚鍔�"); + this.init(); + } else { + this.$showMessage(genRes.data.message || "鑾峰彇澶辫触"); + } + }); } }); } @@ -890,328 +939,382 @@ <style scoped> /* 鍩虹鏍峰紡 */ .inspection-sheet { - padding: 10px; - background-color: #f5f7fa; - min-height: 100vh; + font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif; + max-width: 1000px; + margin: 0 auto; + padding: 20px 20px 100px 20px; /* 搴曢儴澧炲姞鍐呰竟璺濅负鍥哄畾鎸夐挳鐣欑┖闂� */ + background-color: #fff; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + min-height: 100vh; + position: relative; + transition: all 0.3s ease; } /* 澶撮儴鏍峰紡 */ .sheet-header { - background-color: white; - padding: 20px; - border-radius: 8px; - box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); - margin-bottom: 20px; + text-align: center; + margin-bottom: 20px; + padding-bottom: 15px; + border-bottom: 2px solid #e0e0e0; } .sheet-header h1 { - font-size: 24px; - font-weight: 600; - color: #2c3e50; - margin-bottom: 10px; + color: #2c3e50; + font-size: 24px; + margin-bottom: 5px; } .inspection-number { - font-size: 16px; - color: #3498db; - font-weight: 500; + font-size: 16px; + font-weight: bold; + color: #3498db; } -/* 鍩烘湰淇℃伅鍖� */ -.basic-info { - background-color: white; - padding: 20px; - border-radius: 8px; - box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); - margin-bottom: 20px; +/* 鍩烘湰淇℃伅鍖烘牱寮� */ +.basic-info, +.material-info { + margin-bottom: 20px; } .info-row { - display: flex; - align-items: center; - margin-bottom: 15px; + display: flex; + margin-bottom: 10px; + flex-wrap: wrap; } .info-label { - font-size: 14px; - color: #7f8c8d; - margin-right: 10px; - min-width: 80px; + font-weight: bold; + color: #34495e; + min-width: 80px; + margin-right: 5px; } .info-value { - font-size: 14px; - color: #2c3e50; - margin-right: 20px; + color: #2c3e50; + margin-right: 20px; } .info-picker { - padding: 8px 12px; - border: 1px solid #ddd; - border-radius: 4px; - background-color: white; - font-size: 14px; - margin-right: 20px; + padding: 8px 12px; + border: 1px solid #ddd; + border-radius: 4px; + background-color: white; + font-size: 14px; + margin-right: 20px; } -/* 鐗╂枡淇℃伅鍖� */ +/* 鐗╂枡淇℃伅鍖烘牱寮� */ .material-info { - background-color: white; - padding: 20px; - border-radius: 8px; - box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); - margin-bottom: 20px; + border: 1px solid #eee; + padding: 15px; + border-radius: 5px; } .info-block { - display: flex; - align-items: center; - margin-bottom: 15px; + display: flex; + align-items: center; + margin-bottom: 10px; + flex-wrap: wrap; } .info-block .info-label { - min-width: 100px; - font-size: 14px; - color: #7f8c8d; + min-width: 100px; + font-size: 14px; + color: #7f8c8d; } .info-block .info-value { - font-size: 14px; - color: #2c3e50; - flex: 1; + font-size: 14px; + color: #2c3e50; + flex: 1; } .info-picker-input { - flex: 1; - padding: 8px 12px; - border: 1px solid #ddd; - border-radius: 4px; - background-color: white; - font-size: 14px; + flex: 1; + padding: 8px 12px; + border: 1px solid #ddd; + border-radius: 4px; + background-color: white; + font-size: 14px; } .info-input { - flex: 1; - padding: 8px 12px; - border: 1px solid #ddd; - border-radius: 4px; - background-color: white; - font-size: 14px; + flex: 1; + padding: 8px 12px; + border: 1px solid #ddd; + border-radius: 4px; + background-color: white; + font-size: 14px; } .highlight { - font-weight: 600; - color: #e74c3c; - font-size: 16px; + font-weight: bold; + color: #e74c3c; } -/* 妫�楠岄」鐩〃鏍� */ +/* 琛ㄦ牸鏍峰紡 */ .inspection-table { - margin: 25px 0; + margin: 25px 0; } .inspection-table table { - width: 100%; - border-collapse: collapse; + width: 100%; + border-collapse: collapse; } .inspection-table th, .inspection-table td { - padding: 12px 15px; - border: 1px solid #ddd; - text-align: left; + padding: 12px 15px; + border: 1px solid #ddd; + text-align: left; } .inspection-table th { - background-color: #f8f9fa; - font-weight: bold; - color: #34495e; + background-color: #f8f9fa; + font-weight: bold; + color: #34495e; } .inspection-table tr:nth-child(even) { - background-color: #f9f9f9; + background-color: #f9f9f9; } .inspection-table tr:hover { - background-color: #f1f5f9; + background-color: #f1f5f9; } /* 姘村嵃鏍峰紡 */ .watermark { - position: absolute; - font-size: 40px; - font-weight: bold; - opacity: 1; - z-index: 1; - top: 50%; - left: 50%; - transform: translate(-50%, -50%) rotate(-15deg); + position: absolute; + font-size: 40px; + font-weight: bold; + opacity: 1; + z-index: 1; + pointer-events: none; + transform: rotate(-15deg); + width: 100%; + text-align: center; + top: 50%; + left: 50%; + transform: translate(-50%, -50%) rotate(-15deg); } .watermark.approved { - color: #2ecc71; + color: #2ecc71; + /* 缁胯壊 */ } .watermark.rejected { - color: #e74c3c; + color: #e74c3c; + /* 绾㈣壊 */ } .watermark.pending { - color: #f39c12; + color: #f39c12; + /* 姗欒壊 */ } /* 鎻忚堪鏂囨湰瀹瑰櫒 */ .description-text { - position: relative; - z-index: 2; - background-color: rgba(255, 255, 255, 0.7); - padding: 10px; - font-size: 14px; - color: #2c3e50; + position: relative; + z-index: 2; + padding: 25px; + background-color: rgba(255, 255, 255, 0.7); } /* 璋冩暣琛ㄦ牸鍗曞厓鏍� */ .inspection-table td:nth-child(2) { - position: relative; - overflow: hidden; - padding: 0; + position: relative; + overflow: hidden; + padding: 0; } -/* 鎸夐挳鏍峰紡 */ -.record-btn { - padding: 6px 12px; - background-color: #f8f9fa; - border: 1px solid #ddd; - cursor: pointer; - transition: all 0.2s; - font-size: 12px; +/* 琛ㄥ崟涓婃柟鎿嶄綔鎸夐挳鍖烘牱寮� */ +.top-action-buttons { + display: flex; + justify-content: flex-end; + gap: 10px; + margin: 20px 0; + padding: 15px; + background-color: #f8f9fa; + border-radius: 8px; + border: 1px solid #e9ecef; } -.record-btn:hover { - background-color: #e9ecef; -} - -/* 鎿嶄綔鎸夐挳鍖� */ -.action-buttons { - display: flex; - flex-direction: column; - gap: 10px; - margin-bottom: 20px; +/* 琛ㄥ崟涓嬫柟鎿嶄綔鎸夐挳鍖烘牱寮� */ +.bottom-action-buttons { + display: flex; + justify-content: center; + gap: 8px; + padding: 12px; + flex-wrap: wrap; + align-items: center; + position: fixed; /* 鍥哄畾鍦ㄥ睆骞曞簳閮� */ + bottom: 0; /* 璺濈搴曢儴0px */ + left: 0; /* 璺濈宸﹁竟0px */ + right: 0; /* 璺濈鍙宠竟0px */ + background-color: #fff; /* 鑳屾櫙鑹� */ + border-top: 1px solid #e9ecef; /* 椤堕儴杈规 */ + z-index: 1000; /* 纭繚鍦ㄦ渶涓婂眰 */ + box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* 椤堕儴闃村奖 */ } .action-btn { - padding: 12px 20px; - border: none; - border-radius: 6px; - font-size: 14px; - font-weight: 500; - transition: all 0.2s; - cursor: pointer; + background-color: #ecf0f1; + color: #34495e; + padding: 12px 15px; + border: none; + border-radius: 6px; + cursor: pointer; + font-size: 14px; + font-weight: 500; + transition: all 0.3s ease; + text-align: center; + min-height: 44px; + display: flex; + align-items: center; + justify-content: center; +} + +.action-btn:hover { + background-color: #d5dbdb; + transform: translateY(-1px); } .action-btn.primary { - background-color: #3498db; - color: white; + background-color: #3498db; + color: #fff; } .action-btn.primary:hover { - background-color: #2980b9; + background-color: #2980b9; } -.action-btn.secondary { - background-color: #95a5a6; - color: white; +/* 灏忓昂瀵告寜閽牱寮� */ +.action-btn.small { + padding: 10px 12px; + font-size: 14px; + min-height: 44px; + white-space: nowrap; + flex-shrink: 0; + min-width: 80px; + max-width: 120px; + flex: 1; } -.action-btn.secondary:hover { - background-color: #7f8c8d; +/* 鍘熸湁鎸夐挳鏍峰紡淇濇寔鍏煎 */ +.action-buttons { + display: flex; + gap: 10px; + margin: 15px 0; + justify-content: flex-end; } -.action-btn.danger { - background-color: #e74c3c; - color: white; +.record-btn { + padding: 6px 12px; + background-color: #f8f9fa; + border: 1px solid #ddd; + /* border-radius: 3px; */ + cursor: pointer; + transition: all 0.2s; } -.action-btn.danger:hover { - background-color: #c0392b; +.record-btn:hover { + background-color: #e9ecef; } -.action-btn.success { - background-color: #2ecc71; - color: white; -} - -.action-btn.success:hover { - background-color: #27ae60; -} - -/* 寮瑰嚭妗嗘牱寮� */ .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; + 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; /* 鎻愰珮灞傜骇锛岀‘淇濆湪鍥哄畾鎸夐挳涓婃柟 */ } +/* 寮圭獥鏁翠綋缇庡寲 */ .popup { - background-color: white; - border-radius: 8px; - box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); - width: 90%; - max-width: 400px; - max-height: 80vh; - overflow-y: auto; + background: #fff; + border-radius: 16px; + box-shadow: 0 8px 32px rgba(60,60,60,0.18); + padding: 28px 28px 18px 28px; + border: none; + position: relative; + min-width: 260px; + z-index: 1001; /* 纭繚寮圭獥鍐呭鍦ㄦ渶涓婂眰 */ + max-height: 80vh; /* 闄愬埗鏈�澶ч珮搴︼紝閬垮厤琚簳閮ㄦ寜閽伄鎸� */ + overflow-y: auto; /* 鍐呭杩囧鏃跺彲婊氬姩 */ } .popup-header { - padding: 20px; - border-bottom: 1px solid #eee; + padding: 20px; + border-bottom: 1px solid #eee; } .popup-header h3 { - font-size: 18px; - font-weight: 600; - color: #2c3e50; - margin: 0; + font-size: 18px; + font-weight: 600; + color: #2c3e50; + margin: 0; } .popup-content { - padding: 20px; + padding: 20px; } .popup-actions { - padding: 20px; - border-top: 1px solid #eee; - display: flex; - gap: 10px; - justify-content: flex-end; + padding: 20px; + border-top: 1px solid #eee; + display: flex; + gap: 10px; + justify-content: flex-end; } /* 鍝嶅簲寮忚璁� */ -@media (max-width: 768px) { - .info-row { - flex-direction: column; - align-items: flex-start; - } - - .info-label { - margin-bottom: 5px; - } - - .project-item { - flex-direction: column; - align-items: flex-start; - } - - .project-actions { - margin-top: 10px; - width: 100%; - } +@media (max-width: 500px) { + + .info-row, + .info-block { + flex-direction: column; + align-items: flex-start; + } + + .top-action-buttons { + flex-direction: column; + align-items: stretch; + } + + .bottom-action-buttons { + flex-direction: row; + align-items: center; + justify-content: center; + padding: 8px; + gap: 6px; + position: fixed; /* 淇濇寔鍥哄畾鍦ㄥ睆骞曞簳閮� */ + bottom: 0; + left: 0; + right: 0; + background-color: #fff; + border-top: 1px solid #e9ecef; + z-index: 1000; + box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); + } + + .action-btn.small { + min-width: 70px; + max-width: 100px; + padding: 8px 10px; + font-size: 13px; + min-height: 40px; + } + + .inspection-table table { + display: block; + overflow-x: auto; + } } </style> \ No newline at end of file diff --git a/pages/QC/SJ/List.vue b/pages/QC/SJ/List.vue index 6202f58..8268a6e 100644 --- a/pages/QC/SJ/List.vue +++ b/pages/QC/SJ/List.vue @@ -22,10 +22,10 @@ <!-- 鐘舵�佸垏鎹㈡爣绛� --> <view class="status-tabs"> <button :class="['tab-button', current === 0 ? 'active' : '']" @click="onClickItem({currentIndex: 0})"> - {{items[0]}} + 鏈畬鎴�({{uncheckedCount}}) </button> <button :class="['tab-button', current === 1 ? 'active' : '']" @click="onClickItem({currentIndex: 1})"> - {{items[1]}} + {{checkedCount}} </button> </view> </view> @@ -36,11 +36,19 @@ <!-- 妫�楠屽崟鍗$墖 --> <view class="inspection-card" v-for="item in data" :key="item.id" @click="navigateToDetail(item)"> <view class="card-header"> - <text class="badge normal" v-if="item.SJ_MJ">{{item.SJ_MJ}}</text> - <text class="card-title">妫�楠屽崟鍙�: {{item.billNo}}</text> - <text class="status pass" v-if="item.result === '鍚堟牸'">鍚堟牸</text> - <text class="status unqualified" v-if="item.result === '涓嶅悎鏍�'">涓嶅悎鏍�</text> - <text class="status pending" v-if="!item.result">寰呮楠�</text> + <view class="header-left"> + <text class="badge normal" v-if="item.SJ_MJ">{{item.SJ_MJ}}</text> + <text class="card-title">妫�楠屽崟鍙�: {{item.billNo}}</text> + </view> + <view class="header-right"> + <!-- 鏈畬鎴愭爣绛鹃〉鐨勭姸鎬佹樉绀� --> + <text class="status pending" v-if="current === 0 && (!item.result || item.result === '鏈畬鎴�')">寰呮楠�</text> + <text class="status pass" v-if="current === 0 && item.result === '鍚堟牸'">鍚堟牸</text> + <text class="status unqualified" v-if="current === 0 && item.result === '涓嶅悎鏍�'">涓嶅悎鏍�</text> + <!-- 宸插畬鎴愭爣绛鹃〉鐨勭姸鎬佹樉绀� --> + <text class="status pass" v-if="current === 1 && item.result === '鍚堟牸'">鍚堟牸</text> + <text class="status unqualified" v-if="current === 1 && item.result === '涓嶅悎鏍�'">涓嶅悎鏍�</text> + </view> </view> <view class="card-body"> @@ -124,7 +132,10 @@ // ===== 鏂板鎼滅储鍔熻兘鐩稿叧鏁版嵁 ===== optionsIndex: 0, // 褰撳墠閫夋嫨鐨勬煡璇㈡潯浠剁储寮� options: ['宸ュ崟', '妫�楠屽崟鍙�', '浜х嚎', '鐗╂枡缂栫爜', '鐗╂枡鍚嶇О'], // 鏌ヨ鏉′欢閫夐」 - selectedField: 'daa001' // 褰撳墠閫夋嫨鐨勬煡璇㈠瓧娈碉紝榛樿涓哄伐鍗� + selectedField: 'daa001', // 褰撳墠閫夋嫨鐨勬煡璇㈠瓧娈碉紝榛樿涓哄伐鍗� + // ===== 鏂板鏁伴噺缁熻鍙橀噺 ===== + uncheckedCount: 0, // 鏈畬鎴愭暟閲� + checkedCount: '宸叉楠�' // 宸插畬鎴愭暟閲忔樉绀烘枃鏈� }; }, onLoad() { @@ -175,6 +186,12 @@ } }).then(res => { this.data = res.data.tbBillList; + // 璁剧疆鏁伴噺缁熻 + if (this.current === 1) { + this.checkedCount = '宸叉楠岋紙' + res.totalCount + '锛�'; + } else { + this.uncheckedCount = res.totalCount; + } }) }, handleFabClick() { @@ -329,12 +346,24 @@ border-bottom: 1px solid #eee; display: flex; align-items: center; + justify-content: space-between; + position: relative; +} + +.header-left { + display: flex; + align-items: center; + flex: 1; +} + +.header-right { + display: flex; + align-items: center; } .card-title { font-size: 16px; font-weight: 600; - flex: 1; margin: 0 8px; } diff --git a/pages/QC/SJ/detail.vue b/pages/QC/SJ/detail.vue index 1597e12..023ce37 100644 --- a/pages/QC/SJ/detail.vue +++ b/pages/QC/SJ/detail.vue @@ -159,14 +159,16 @@ </view> </view> <view class="td"> + <!-- 淇敼鎸夐挳 - 宸插~鍐欏悗鏄剧ず --> <button v-if="!isHoleBlocked(index) && item.fcheckResu && !isNumber" class="btn danger-btn" @tap="numberEdit(item)"> {{ editResult(item.fcheckResu) }} </button> <button v-if="!isHoleBlocked(index) && item.fcheckResu && isNumber" class="btn danger-btn" @tap="toDetail(item)"> 淇敼 </button> + <!-- 鐘舵�佹樉绀� --> <span v-if="isHoleBlocked(index)" class="blocked-text">宸插牭绌�</span> - <span v-else-if="!item.fcheckResu" class="no-data-text">寰呭~鍐�</span> + <span v-else-if="!item.fcheckResu" class="ready-text">鍙~鍐�</span> </view> </view> </view> @@ -219,6 +221,7 @@ </view> </view> </view> + </view> </template> @@ -249,13 +252,23 @@ displayTableData() { const result = []; + console.log('displayTableData - formData:', this.formData); + console.log('displayTableData - tableData:', this.tableData); + // 濡傛灉鏈夌┐鍙蜂俊鎭紝浣跨敤绌村彿淇℃伅鐢熸垚鏁版嵁 if (this.formData.holeNumbers && this.formData.holeNumbers.length > 0) { + // 瀵规暟鎹簱璁板綍鎸夊垱寤烘椂闂存帓搴忥紝纭繚椤哄簭绋冲畾 + const sortedTableData = [...this.tableData].sort((a, b) => { + if (a.id && b.id) return a.id - b.id; + if (a.createDate && b.createDate) return new Date(a.createDate) - new Date(b.createDate); + return 0; + }); + + console.log('displayTableData - sortedTableData:', sortedTableData); + this.formData.holeNumbers.forEach((holeInfo, index) => { - // 鏌ユ壘鏄惁鏈夊搴旂殑瀹為檯鏁版嵁 - const actualData = this.tableData.find(item => { - return this.tableData.indexOf(item) === index; - }); + // 鐩存帴閫氳繃绱㈠紩鑾峰彇瀵瑰簲鐨勬暟鎹簱璁板綍 + const actualData = sortedTableData[index]; if (actualData) { // 濡傛灉鏈夊疄闄呮暟鎹紝浣跨敤瀹為檯鏁版嵁 @@ -281,10 +294,17 @@ // 濡傛灉娌℃湁绌村彿淇℃伅锛屼娇鐢ㄥ師鏉ョ殑閫昏緫 const levelNum = this.formData.levelNum || 0; + // 鎸夌収鍒涘缓鏃堕棿鎴朓D鎺掑簭锛岀‘淇濋『搴忕ǔ瀹� + const sortedTableData = [...this.tableData].sort((a, b) => { + if (a.id && b.id) return a.id - b.id; + if (a.createDate && b.createDate) return new Date(a.createDate) - new Date(b.createDate); + return 0; + }); + + console.log('displayTableData - sortedTableData (no holes):', sortedTableData); + for (let i = 0; i < levelNum; i++) { - const actualData = this.tableData.find(item => { - return this.tableData.indexOf(item) === i; - }); + const actualData = sortedTableData[i]; if (actualData) { result.push({ @@ -304,12 +324,21 @@ } } + console.log('displayTableData - result:', result); return result; }, // 鍒ゆ柇鏄惁鎵�鏈夋楠岄兘宸插畬鎴� isAllCompleted() { - return this.displayTableData.every(item => item.fcheckResu !== null && item.fcheckResu !== undefined); + // 鍙鏌ラ潪鍫电┐鐨勮鏄惁閮藉凡濉啓 + return this.displayTableData.every(item => { + // 濡傛灉鏄牭绌达紝璺宠繃妫�鏌� + if (item.holeInfo && item.holeInfo.isBlocked) { + return true; + } + // 闈炲牭绌寸殑琛屽繀椤绘湁妫�楠岀粨鏋� + return item.fcheckResu !== null && item.fcheckResu !== undefined; + }); } }, methods: { @@ -324,29 +353,7 @@ return 'PENDING'; } - // 鏍规嵁妫�楠岀粨鏋滃拰鍒ゅ畾鏍囪瘑纭畾鏍峰紡绫� - if (fstand === '鈭�' || fcheckResu === 'OK') { - return 'OK'; - } else if (fstand === '脳' || fcheckResu === 'NG') { - return 'NG'; - } else { - // 瀵逛簬鏁板瓧缁撴灉锛屾牴鎹甪stand鍒ゆ柇 - return fstand === '鈭�' ? 'OK' : 'NG'; - } - }, - - getResultText(fcheckResu, fstand, index) { - // 妫�鏌ユ槸鍚﹁鍫电┐ - if (this.isHoleBlocked(index)) { - return '/'; - } - - // 濡傛灉娌℃湁璁板綍鍊硷紝鏄剧ず鏈楠� - if (!fcheckResu) { - return '鏈楠�'; - } - - // 鏍规嵁璁板綍鍊煎垽鏂楠岀粨鏋滄槸鍚K + // 浼樺厛鏍规嵁fstand鍒ゆ柇 if (fstand === '鈭�') { return 'OK'; } else if (fstand === '脳') { @@ -369,6 +376,47 @@ } } } + // 榛樿杩斿洖OK鏍峰紡 + return 'OK'; + } + } + }, + + getResultText(fcheckResu, fstand, index) { + // 妫�鏌ユ槸鍚﹁鍫电┐ + if (this.isHoleBlocked(index)) { + return '/'; + } + + // 濡傛灉娌℃湁璁板綍鍊硷紝鏄剧ず鏈楠� + if (!fcheckResu) { + return '鏈楠�'; + } + + // 浼樺厛鏍规嵁fstand鍒ゆ柇 + if (fstand === '鈭�') { + return '鍚堟牸'; + } else if (fstand === '脳') { + return '涓嶅悎鏍�'; + } else { + // 濡傛灉娌℃湁fstand锛屾牴鎹甪checkResu鐨勫�煎垽鏂� + if (fcheckResu === '1' || fcheckResu === 1) { + return '鍚堟牸'; + } else if (fcheckResu === '0' || fcheckResu === 0) { + return '涓嶅悎鏍�'; + } else { + // 瀵逛簬鏈変笂涓嬮檺鐨勬暟鍊兼楠岋紝鏍规嵁fcheckResu鏄惁鍦ㄨ寖鍥村唴鍒ゆ柇 + if (this.formData.maxValue && this.formData.minValue) { + const value = parseFloat(fcheckResu); + if (!isNaN(value)) { + if (value >= this.formData.minValue && value <= this.formData.maxValue) { + return '鍚堟牸'; + } else { + return '涓嶅悎鏍�'; + } + } + } + // 濡傛灉鏄湁鏁板�肩殑妫�楠岀粨鏋滐紝鐩存帴鏄剧ず鏁板�� return fcheckResu || '鏈娴�'; } } @@ -405,6 +453,7 @@ } return false; }, + previewImage() { uni.previewImage({ @@ -445,23 +494,39 @@ if (this.formData.fcheckResu == 0 || this.formData.fcheckResu == 1) { this.formData.isPass = this.formData.fcheckResu + // 鏍规嵁fcheckResu璁剧疆fstand + if (this.formData.fcheckResu == 1) { + fstand = "鈭�"; // 鍚堟牸 + } else { + fstand = "脳"; // 涓嶅悎鏍� + } } else { this.$showMessage("鏃犳爣鍑嗗�兼椂锛屾楠岀粨鏋滃彧鑳戒负0鎴�1!"); return; } - count = 1; // 姣忔鍙~鍐欎竴涓褰� + + // 璁$畻瀹為檯闇�瑕佸~鍐欑殑鏁伴噺锛堣�冭檻绌村彿淇℃伅锛� + if (this.formData.holeNumbers && this.formData.holeNumbers.length > 0) { + // 濡傛灉鏈夌┐鍙蜂俊鎭紝璁$畻闈炲牭绌寸殑鏁伴噺 + const nonBlockedCount = this.formData.holeNumbers.filter(hole => !hole.isBlocked).length; + count = nonBlockedCount; + } else { + // 鍚﹀垯浣跨敤levelNum + count = this.formData.levelNum || 1; + } } this.formData.updater = this.$loginInfo.account; + // 鐩存帴鎵ц淇濆瓨锛屼笉鏄剧ず纭寮圭獥 this.$post({ url: "/SJ/SetQSItemDetail", data: { pid: this.id, gid: this.gid, - fstand: fstand, - fcheckResu: this.formData.fcheckResu, - updateBy: this.formData.updater, + Fstand: fstand, + FcheckResu: this.formData.fcheckResu, + UpdateBy: this.formData.updater, count: count } }).then(res => { @@ -472,9 +537,11 @@ }, refreshResult() { + // 鍏堣幏鍙栨楠岄」鐩熀鏈俊鎭� this.$post({ url: "/SJ/getQSItems", data: { + pid: this.gid, id: this.id } }).then(res => { @@ -487,17 +554,21 @@ if (this.formData.maxValue && this.formData.minValue && this.formData.standardValue) { this.isNumber = true; } - }) - - this.$post({ - url: "/SJ/getQSItemDetail", - data: { - pid: this.id, - gid: this.gid - } + + // 鐒跺悗鑾峰彇妫�楠岃鎯呮暟鎹� + return this.$post({ + url: "/SJ/getQSItemDetail", + data: { + pid: this.id, + gid: this.gid + } + }); }).then(res => { this.tableData = res.data.tbBillList; - }) + console.log('鍒锋柊鍚庣殑tableData:', this.tableData); + }).catch(error => { + console.error('鍒锋柊鏁版嵁澶辫触:', error); + }); }, toDetail(item) { this.showPopup = !this.showPopup; @@ -547,21 +618,33 @@ this.editData.updater = this.$loginInfo.account; - this.$post({ - url: "/SJ/UpdateQSItemDetail", - data: { - id: this.editData.id, - pid: this.id, - gid: this.gid, - fstand: fstand, - fcheckResu: this.editData.fcheckResu, - updateBy: this.editData.updater, + // 鏄剧ず纭鎻愮ず妗� + uni.showModal({ + title: '纭淇敼', + content: '纭畾瑕佷慨鏀规楠岀粨鏋滃悧锛�', + confirmText: '纭畾淇敼', + cancelText: '鍙栨秷', + success: (res) => { + if (res.confirm) { + // 鐢ㄦ埛纭鍚庢墽琛屼慨鏀� + this.$post({ + url: "/SJ/UpdateQSItemDetail", + data: { + id: this.editData.id, + pid: this.id, + gid: this.gid, + fstand: fstand, + fcheckResu: this.editData.fcheckResu, + updateBy: this.editData.updater, + } + }).then(res => { + this.showPopup = !this.showPopup; + this.$showMessage("淇敼鎴愬姛"); + this.refreshResult();//鍒锋柊椤甸潰 + }) + } } - }).then(res => { - this.showPopup = !this.showPopup; - this.$showMessage("淇敼鎴愬姛"); - this.refreshResult();//鍒锋柊椤甸潰 - }) + }); }, numberEdit(item) { @@ -836,6 +919,19 @@ font-style: italic; } +.waiting-text { + color: #E6A23C; + font-size: 12px; + font-style: italic; +} + +.ready-text { + color: #67C23A; + font-size: 12px; + font-weight: bold; +} + + .spec-text { font-size: 14px; color: #333; @@ -943,6 +1039,12 @@ color: #2c3e50; margin: 0; } + + .popup-subtitle { + font-size: 14px; + color: #7f8c8d; + margin: 5px 0 0 0; + } } .popup-content { @@ -967,6 +1069,19 @@ background-color: white; } } + + .input-hint { + margin-top: 8px; + padding: 8px 12px; + background-color: #f8f9fa; + border-radius: 4px; + border-left: 3px solid #409EFF; + + text { + font-size: 12px; + color: #666; + } + } } .popup-actions { diff --git a/pages/QC/XJ/Add.vue b/pages/QC/XJ/Add.vue index f8ba422..75c91a8 100644 --- a/pages/QC/XJ/Add.vue +++ b/pages/QC/XJ/Add.vue @@ -97,7 +97,7 @@ <view v-if="item.result==null || item.result=='鏈畬鎴�'" class="watermark pending"> {{ getStatusText(item.result) }} </view> - <view class="description-text">{{ item.projName }}</view> + <view class="description-text">{{ getInspectionDescription(item) }}</view> </td> <td> <button v-if="item.isCheck >= item.levelNum" class="record-btn" @click="toDetail(item)">鏌ョ湅</button> @@ -446,6 +446,15 @@ } }, + getInspectionDescription(item) { + // 鍙朓TEM_MOD瀛楁鐨勫�� + if (item.itemMod && item.itemMod.trim() !== '') { + return item.itemMod; + } else { + return '妫�楠岄」鐩鎯�'; + } + }, + removeXJ() { if (this.formData.id) { this.$post({ -- Gitblit v1.9.3