From 62cb247da5cc1cc097c5afea402aabee05260431 Mon Sep 17 00:00:00 2001 From: xwt <2740516069@qq.com> Date: 星期四, 14 八月 2025 19:56:50 +0800 Subject: [PATCH] 首检巡检来料检入库检 --- pages/QC/LLJ/List.vue | 71 +++++++++++++++++++++++++++++++---- 1 files changed, 62 insertions(+), 9 deletions(-) diff --git a/pages/QC/LLJ/List.vue b/pages/QC/LLJ/List.vue index 79d303f..4b8dc8f 100644 --- a/pages/QC/LLJ/List.vue +++ b/pages/QC/LLJ/List.vue @@ -30,7 +30,6 @@ </view> </view> - <!-- 妫�楠屽崟鍒楄〃 --> <view class="inspection-list"> <!-- 妫�楠屽崟鍗$墖1 --> @@ -38,10 +37,16 @@ <view class="card-header"> <text class="badge urgent" v-if="item.urgentFlag == 1">鎬ユ枡</text> <text class="badge urgent" v-if="item.jycs == 1">瓒呮椂</text> + <text class="badge normal" v-if="item.ftype == 1">濮斿</text> <text class="badge normal" v-if="item.first == 1">棣栨鏉ユ枡</text> <text class="card-title">妫�楠屽崟鍙�: {{item.releaseNo}}</text> - <text class="status pending" v-if="item.userName==null && item.activeTab==0">寰呭垎閰�</text> + <view v-if="item.userName == null && item.activeTab == 0"> + <text class="status pending" :class="{ 'emergency-pending': item.lotNo1 === '绱ф�ユ斁琛岋紝璇峰嬁楠岄��!' }"> + {{ item.lotNo1 === '绱ф�ユ斁琛岋紝璇峰嬁楠岄��!' ? '绱ф�ユ斁琛�/' + getStatusText(item) : getStatusText(item) }} + </text> + + </view> <text class="status assigned" v-if="item.userName!=null && item.activeTab==0">宸插垎閰�</text> <text class="status pass" v-if="item.fcheckResu=='鍚堟牸' && item.activeTab==1">鍚堟牸</text> <text class="status Unqualified" v-if="item.fcheckResu=='涓嶅悎鏍�' && item.activeTab==1">涓嶅悎鏍�</text> @@ -176,26 +181,32 @@ result: result, SearchValue: this.searchValue, selectedIndex: this.optionsIndex, //涓嬫媺妗嗙瓫閫夋潯浠� - userIndex: this.projectIndex + userIndex: this.projectIndex, + emergency:this.meergency, } }).then(res => { + // 鍘婚噸澶勭悊 - 鏍规嵁 releaseNo 鍘婚噸 + const uniqueList = this.removeDuplicatesByReleaseNo(res.data.tbBillList); + if (this.pageIndex === 1) { // 濡傛灉鏄涓�椤碉紝鐩存帴瑕嗙洊鍘熸暟鎹� - this.inspectionList = res.data.tbBillList; + this.inspectionList = uniqueList; //娣诲姞Tab淇℃伅锛屽垽鏂槸宸叉杩樻槸鏈鏁版嵁 this.inspectionList.forEach((item, index) => { this.$set(item, 'activeTab', this.activeTab); this.$set(item, 'IQCJL', this.IQCJL); + this.$set(item, 'EMERGENCY', item.emergency || null); }); } else { - if (res.data.tbBillList.length > 0) { + if (uniqueList.length > 0) { // 濡傛灉鏄笅涓�椤碉紝杩藉姞鏂版暟鎹� - this.inspectionList = [...this.inspectionList, ...res.data.tbBillList]; + this.inspectionList = [...this.inspectionList, ...uniqueList]; //娣诲姞Tab淇℃伅锛屽垽鏂槸宸叉杩樻槸鏈鏁版嵁 this.inspectionList.forEach((item, index) => { this.$set(item, 'activeTab', this.activeTab); this.$set(item, 'IQCJL', this.IQCJL); + this.$set(item, 'EMERGENCY', item.emergency || null); }); } @@ -293,10 +304,19 @@ }, onShow() { //姣忔杩涘叆椤甸潰閮戒細鎵ц鐨勬柟娉� - // this.pageIndex = 1; - // this.data = []; - // //this.current = 0 + // 妫�鏌ユ槸鍚﹂渶瑕佸埛鏂版暟鎹� + const app = getApp(); + if (app.globalData && app.globalData.needRefreshList) { + // 娓呴櫎鏍囪 + app.globalData.needRefreshList = false; + // 寮哄埗鍒锋柊鏁版嵁 + this.pageIndex = 1; // 閲嶇疆椤电爜 + this.inspectionList = []; // 娓呯┖鍒楄〃鏁版嵁 + this.init(); // 閲嶆柊鍔犺浇鏁版嵁 + } else { + // 姝e父鍒锋柊 this.init(); + } }, async onLoad() { if (this.$loginInfo.roleid.indexOf("90134") != -1 || this.$loginInfo.account == "PL017") { @@ -306,6 +326,29 @@ } await this.init(); // 鑷畾涔夌殑鍒锋柊鍑芥暟 + }, + + // 鏍规嵁 releaseNo 鍘婚噸鐨勬柟娉� + removeDuplicatesByReleaseNo(array) { + const seen = new Set(); + return array.filter(item => { + const releaseNo = item.releaseNo; + if (seen.has(releaseNo)) { + return false; + } + seen.add(releaseNo); + return true; + }); + }, + + // 鏍规嵁妫�楠岄」鐩暟閲忚幏鍙栫姸鎬佹枃鏈� + getStatusText(item) { + // 濡傛灉娌℃湁妫�楠岄」鐩紝鏄剧ず"鏈淮鎶�" + if (!item.inspectionItemCount || item.inspectionItemCount === 0) { + return '鏈淮鎶�'; + } + // 濡傛灉鏈夋楠岄」鐩紝鏄剧ず"寰呮楠�" + return '寰呮楠�'; } } } @@ -470,6 +513,12 @@ color: white; } + .badge.emergency { + background-color: #ff4d4f; + color: white; + margin-right: 5px; + } + .status { font-size: 12px; padding: 4px 8px; @@ -610,5 +659,9 @@ order: 4; width: 100%; } */ + .status.emergency-pending { + background-color: #ff0000; /* 绾㈣壊鑳屾櫙 */ + color: white; + } } </style> \ No newline at end of file -- Gitblit v1.9.3