From 4a239fc4c69be2a8824fa78e29e8f50504bfed72 Mon Sep 17 00:00:00 2001 From: xwt <2740516069@qq.com> Date: 星期一, 15 九月 2025 09:24:43 +0800 Subject: [PATCH] 首检穴模数 --- pages/QC/SJ/detail.vue | 211 ++++++++++++++++++++++++++++++++++++++++++++++++++-- store/index.js | 4 2 files changed, 202 insertions(+), 13 deletions(-) diff --git a/pages/QC/SJ/detail.vue b/pages/QC/SJ/detail.vue index 5cd7f31..1597e12 100644 --- a/pages/QC/SJ/detail.vue +++ b/pages/QC/SJ/detail.vue @@ -52,6 +52,14 @@ <view class="info-label">涓婇檺</view> <view class="info-value">{{ formData.maxValue }}</view> </view> + <view class="info-item" v-if="formData.mnum"> + <view class="info-label">寮�绌存�绘暟</view> + <view class="info-value">{{ formData.mnum }}</view> + </view> + <view class="info-item" v-if="formData.dnum"> + <view class="info-label">鍫电┐鍙�</view> + <view class="info-value">{{ formData.dnum }}</view> + </view> <view class="info-item" v-if="formData.updater"> <view class="info-label">鏇存柊浜�</view> <view class="info-value">{{ formData.updater }}</view> @@ -114,13 +122,13 @@ 涓嶅悎鏍兼弿杩� </button> - <input v-if="tableData.length < formData.levelNum" + <input v-if="!isAllCompleted" v-model="formData.fcheckResu" type="text" class="result-input" placeholder="娌℃湁鏈�澶у�煎拰鏈�灏忓�兼椂濉啓0锛堟湭閫氳繃妫�楠岋級鎴�1锛堥�氳繃妫�楠岋級" placeholder-class="placeholder" /> - <button v-if="(tableData.length < formData.levelNum)" + <button v-if="!isAllCompleted" style="margin: 0px;background-color: #3498db;color:#ffffff ;" class="btn primary-btn" @tap="submit">淇濆瓨缁撴灉</button> </view> @@ -129,28 +137,36 @@ </view> <!-- 缁撴灉琛ㄦ牸 --> - <view v-if="tableData.length > 0" class="table-container"> + <view v-if="formData.levelNum > 0" class="table-container"> <view class="table-header"> <view class="th">缂栧彿</view> + <view class="th">绌村彿</view> + <view class="th">璁板綍鍊�</view> <view class="th">妫�楠岀粨鏋�<i style="color: rgb(0 212 68);" - v-if="!(tableData.length < formData.levelNum)">锛堣緭鍏ュ凡瀹屾垚锛�</i></view> + v-if="isAllCompleted">锛堣緭鍏ュ凡瀹屾垚锛�</i></view> <view class="th">鎿嶄綔</view> </view> - <view v-for="(item, index) in tableData" :key="index" class="table-row"> + <view v-for="(item, index) in displayTableData" :key="index" class="table-row"> <view class="td">{{ index + 1 }}</view> + <view class="td">{{ getHoleNumber(index) }}</view> <view class="td"> - <view :class="['result-badge', getResultClass(item.fcheckResu, item.fstand)]"> - {{ item.fcheckResu }} + <view class="record-value">{{ getRecordValue(item, index) }}</view> + </view> + <view class="td"> + <view :class="['result-badge', getResultClass(item.fcheckResu, item.fstand, index)]"> + {{ getResultText(item.fcheckResu, item.fstand, index) }} </view> </view> <view class="td"> - <button v-if="!isNumber" class="btn danger-btn" @tap="numberEdit(item)"> + <button v-if="!isHoleBlocked(index) && item.fcheckResu && !isNumber" class="btn danger-btn" @tap="numberEdit(item)"> {{ editResult(item.fcheckResu) }} </button> - <button v-if="isNumber" class="btn danger-btn" @tap="toDetail(item)"> + <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> </view> </view> </view> @@ -228,8 +244,86 @@ tabs: [] } }, + computed: { + // 鏍规嵁绌村彿淇℃伅鐢熸垚瀹屾暣鐨勬樉绀烘暟鎹� + displayTableData() { + const result = []; + + // 濡傛灉鏈夌┐鍙蜂俊鎭紝浣跨敤绌村彿淇℃伅鐢熸垚鏁版嵁 + if (this.formData.holeNumbers && this.formData.holeNumbers.length > 0) { + this.formData.holeNumbers.forEach((holeInfo, index) => { + // 鏌ユ壘鏄惁鏈夊搴旂殑瀹為檯鏁版嵁 + const actualData = this.tableData.find(item => { + return this.tableData.indexOf(item) === index; + }); + + if (actualData) { + // 濡傛灉鏈夊疄闄呮暟鎹紝浣跨敤瀹為檯鏁版嵁 + result.push({ + ...actualData, + index: index, + holeInfo: holeInfo + }); + } else { + // 濡傛灉娌℃湁瀹為檯鏁版嵁锛屽垱寤虹┖璁板綍 + result.push({ + id: null, + fcheckResu: holeInfo.isBlocked ? "/" : null, + fstand: holeInfo.isBlocked ? "/" : null, + index: index, + pid: this.id, + gid: this.gid, + holeInfo: holeInfo + }); + } + }); + } else { + // 濡傛灉娌℃湁绌村彿淇℃伅锛屼娇鐢ㄥ師鏉ョ殑閫昏緫 + const levelNum = this.formData.levelNum || 0; + + for (let i = 0; i < levelNum; i++) { + const actualData = this.tableData.find(item => { + return this.tableData.indexOf(item) === i; + }); + + if (actualData) { + result.push({ + ...actualData, + index: i + }); + } else { + result.push({ + id: null, + fcheckResu: null, + fstand: null, + index: i, + pid: this.id, + gid: this.gid + }); + } + } + } + + return result; + }, + + // 鍒ゆ柇鏄惁鎵�鏈夋楠岄兘宸插畬鎴� + isAllCompleted() { + return this.displayTableData.every(item => item.fcheckResu !== null && item.fcheckResu !== undefined); + } + }, methods: { - getResultClass(fcheckResu, fstand) { + getResultClass(fcheckResu, fstand, index) { + // 妫�鏌ユ槸鍚﹁鍫电┐ + if (this.isHoleBlocked(index)) { + return 'BLOCKED'; + } + + // 濡傛灉娌℃湁璁板綍鍊硷紝鏄剧ず鏈楠屾牱寮� + if (!fcheckResu) { + return 'PENDING'; + } + // 鏍规嵁妫�楠岀粨鏋滃拰鍒ゅ畾鏍囪瘑纭畾鏍峰紡绫� if (fstand === '鈭�' || fcheckResu === 'OK') { return 'OK'; @@ -241,12 +335,75 @@ } }, + getResultText(fcheckResu, fstand, index) { + // 妫�鏌ユ槸鍚﹁鍫电┐ + if (this.isHoleBlocked(index)) { + return '/'; + } + + // 濡傛灉娌℃湁璁板綍鍊硷紝鏄剧ず鏈楠� + if (!fcheckResu) { + return '鏈楠�'; + } + + // 鏍规嵁璁板綍鍊煎垽鏂楠岀粨鏋滄槸鍚K + if (fstand === '鈭�') { + return 'OK'; + } else if (fstand === '脳') { + return 'NG'; + } else { + // 濡傛灉娌℃湁fstand锛屾牴鎹甪checkResu鐨勫�煎垽鏂� + if (fcheckResu === '1' || fcheckResu === 1) { + return 'OK'; + } else if (fcheckResu === '0' || fcheckResu === 0) { + return 'NG'; + } 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 'OK'; + } else { + return 'NG'; + } + } + } + return fcheckResu || '鏈娴�'; + } + } + }, + // ===== 鏂板鏍囩鍒囨崲鏂规硶 ===== switchTab(index, id) { this.currentTab = index; // 濡傛灉闇�瑕佸垏鎹㈡楠岄」鐩紝鍙互鍦ㄨ繖閲屾坊鍔犻�昏緫 // this.gid = id; // this.refreshResult(); + }, + + // ===== 绌村彿鐩稿叧鏂规硶 ===== + getHoleNumber(index) { + const item = this.displayTableData[index]; + if (item && item.holeInfo) { + return item.holeInfo.holeNumber; + } + return index + 1; + }, + + getRecordValue(item, index) { + if (this.isHoleBlocked(index)) { + return '/'; + } + return item.fcheckResu || '鏃�'; + }, + + isHoleBlocked(index) { + const item = this.displayTableData[index]; + if (item && item.holeInfo) { + return item.holeInfo.isBlocked; + } + return false; }, previewImage() { @@ -292,7 +449,7 @@ this.$showMessage("鏃犳爣鍑嗗�兼椂锛屾楠岀粨鏋滃彧鑳戒负0鎴�1!"); return; } - count = count - this.tableData.length; + count = 1; // 姣忔鍙~鍐欎竴涓褰� } this.formData.updater = this.$loginInfo.account; @@ -645,6 +802,38 @@ background-color: rgba($danger-color, 0.1); color: $danger-color; } + + &.PENDING { + background-color: rgba(#E6A23C, 0.1); + color: #E6A23C; + } + + &.BLOCKED { + background-color: rgba(#909399, 0.1); + color: #909399; + } +} + +.record-value { + font-family: 'Courier New', monospace; + font-weight: 500; + color: #333; + padding: 2px 4px; + background-color: #f8f9fa; + border-radius: 3px; + border: 1px solid #e9ecef; +} + +.no-data-text { + color: #E6A23C; + font-size: 12px; + font-style: italic; +} + +.blocked-text { + color: #909399; + font-size: 12px; + font-style: italic; } .spec-text { diff --git a/store/index.js b/store/index.js index d50ed24..4b4ac80 100644 --- a/store/index.js +++ b/store/index.js @@ -10,9 +10,9 @@ networkFlag:'鍐呯綉', serverURLInt:'http://192.168.11.251:10055',//鏈嶅姟鍣ㄤ綋妫� 10.0.1.104:10054 serverURL:'http://localhost:10055',//鏈湴璋冭瘯鍦板潃 - //serverAPI:'http://localhost:5184/api',//褰撳墠姝e湪浣跨敤鐨勬湇鍔″櫒,榛樿涓哄缃� localhost + serverAPI:'http://localhost:5184/api',//褰撳墠姝e湪浣跨敤鐨勬湇鍔″櫒,榛樿涓哄缃� localhost //serverAPI:'http://192.168.1.22:10054/api',//鍐呯綉 - serverAPI:'http://36.26.21.214:10055/api', + //serverAPI:'http://36.26.21.214:10054/api', ftpServer:'ftp://36.26.21.214',//FTP鏈嶅姟鍣ㄥ湴鍧� } }, -- Gitblit v1.9.3