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/SJ/Add.vue | 607 ++++++++++++++++++++++++++++++++---------------------- 1 files changed, 355 insertions(+), 252 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 -- Gitblit v1.9.3