From bfffb0306f8e37ea39624499c55306837bf23ecf Mon Sep 17 00:00:00 2001 From: xwt <2740516069@qq.com> Date: 星期四, 21 八月 2025 17:55:42 +0800 Subject: [PATCH] 优化 --- pages/QC/LLJ/List.vue | 56 +++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 47 insertions(+), 9 deletions(-) diff --git a/pages/QC/LLJ/List.vue b/pages/QC/LLJ/List.vue index 4b8dc8f..3011dc8 100644 --- a/pages/QC/LLJ/List.vue +++ b/pages/QC/LLJ/List.vue @@ -16,7 +16,7 @@ </view> <!-- 鏂板鎼滅储妗嗗拰鎸夐挳 --> <view class="search-container"> - <input class="search-input" v-model="searchValue" :placeholder="'璇疯緭鍏�'+options[optionsIndex]" + <input class="search-input" v-model="searchValue" :placeholder="optionsIndex === 0 ? '閫夋嫨椤圭洰鏃舵樉绀哄叏閮ㄦ暟鎹�' : '璇疯緭鍏�'+options[optionsIndex]" @confirm="handleSearch" /> <button class="search-button" @click="handleSearch">鎼滅储</button> </view> @@ -42,7 +42,10 @@ <text class="badge normal" v-if="item.first == 1">棣栨鏉ユ枡</text> <text class="card-title">妫�楠屽崟鍙�: {{item.releaseNo}}</text> <view v-if="item.userName == null && item.activeTab == 0"> - <text class="status pending" :class="{ 'emergency-pending': item.lotNo1 === '绱ф�ユ斁琛岋紝璇峰嬁楠岄��!' }"> + <text class="status pending" :class="{ + 'emergency-pending': item.lotNo1 === '绱ф�ユ斁琛岋紝璇峰嬁楠岄��!', + 'unmaintained-not-emergency': isUnmaintainedAndNotEmergency(item) + }"> {{ item.lotNo1 === '绱ф�ユ斁琛岋紝璇峰嬁楠岄��!' ? '绱ф�ユ斁琛�/' + getStatusText(item) : getStatusText(item) }} </text> @@ -65,7 +68,7 @@ <view class="info-row"> <view class="info-item"> <text class="info-label">椤圭洰</text> - <text class="info-content">{{item.projectCodes}}</text> + <text class="info-content">{{item.DEPARTMENTNAME}}</text> </view> <view class="info-item" v-if="item.extendNo1!=null"> <text class="info-label">鎶�鏀圭姸鎬�</text> @@ -126,7 +129,7 @@ pageIndex: 1, limit: 20, IQCJL: 0, - options: ['椤圭洰', '鐗╂枡缂栧彿', '鐗╂枡鍚嶇О', '渚涘簲鍟�', '閲囪喘鍛�','鍒拌揣鍗曞彿','妫�楠屽崟鍙�','鐗╂枡瑙勬牸'], + options: ['椤圭洰', '鐗╂枡缂栧彿', '鐗╂枡鍚嶇О', '渚涘簲鍟�', '鍒拌揣鍗曞彿','妫�楠屽崟鍙�','鐗╂枡瑙勬牸'], searchValue: '' } @@ -139,21 +142,28 @@ //鎼滅储 onOptionsChange(e) { this.optionsIndex = e.detail.value; + // 褰撻�夋嫨椤圭洰鏃讹紝娓呯┖鎼滅储鍊� + if (this.optionsIndex === 0) { + this.searchValue = ''; + } // 鏍规嵁閫夋嫨鐨勯�夐」璁剧疆鎼滅储瀛楁 const fieldMap = { - 0: 'projectCodes', // 椤圭洰 + 0: 'DEPARTMENTNAME', // 椤圭洰 1: 'itemNo', // 鐗╂枡缂栧彿 2: 'itemName', // 鐗╂枡鍚嶇О 3: 'suppName', // 渚涘簲鍟� - 4: 'purchaser' ,// 閲囪喘鍛� - 5: 'lotNO' ,// 鍒拌揣鍗曞彿 - 6: 'releaseNO' ,// 妫�楠屽崟鍙� - 7: 'ItemModel',//鐗╂枡瑙勬牸 + 4: 'lotNo' ,// 鍒拌揣鍗曞彿 + 5: 'releaseNo' ,// 妫�楠屽崟鍙� + 6: 'itemModel',//鐗╂枡瑙勬牸 }; this.selectedField = fieldMap[this.optionsIndex]; }, //鎼滅储鎸夐挳鐐瑰嚮浜嬩欢 handleSearch() { + // 褰撻�夋嫨椤圭洰鏃讹紝娓呯┖鎼滅储鍊� + if (this.optionsIndex === 0) { + this.searchValue = ''; + } this.init(); }, init() { @@ -349,6 +359,23 @@ } // 濡傛灉鏈夋楠岄」鐩紝鏄剧ず"寰呮楠�" return '寰呮楠�'; + }, + + // 鍒ゆ柇鏄惁涓烘湭缁存姢涓旈潪绱ф�ユ斁琛� + isUnmaintainedAndNotEmergency(item) { + // 妫�鏌ユ槸鍚︿负鏈淮鎶わ紙娌℃湁妫�楠岄」鐩級 + const isUnmaintained = !item.inspectionItemCount || item.inspectionItemCount === 0; + // 妫�鏌ユ槸鍚︿负闈炵揣鎬ユ斁琛� + const isNotEmergency = item.lotNo1 !== '绱ф�ユ斁琛岋紝璇峰嬁楠岄��!'; + return isUnmaintained && isNotEmergency; + }, + + // 鍒ゆ柇鏄惁涓哄緟鍒嗛厤鐘舵�侊紙鐗╂枡娌℃湁缁存姢妫�楠屽憳鎴栬�呰鐗╂枡鏈湪V_LLJ_USER閲岋級 + isUnmaintainedItem(item) { + // 妫�鏌ョ墿鏂欐槸鍚﹀湪V_LLJ_USER瑙嗗浘涓紙鍗虫槸鍚︽湁缁存姢妫�楠屽憳锛� + // 濡傛灉item.fcode涓簄ull鎴杣ndefined锛岃鏄庤鐗╂枡鏈湪V_LLJ_USER瑙嗗浘涓� + // 鎴栬�呰鐗╂枡娌℃湁缁存姢妫�楠屽憳 + return !item.fcode || item.fcode === null || item.fcode === ''; } } } @@ -513,6 +540,11 @@ color: white; } + .badge.unmaintained { + background-color: #1e8449; + color: white; + } + .badge.emergency { background-color: #ff4d4f; color: white; @@ -663,5 +695,11 @@ background-color: #ff0000; /* 绾㈣壊鑳屾櫙 */ color: white; } + + .status.unmaintained-not-emergency { + background-color: #9c27b0; /* 绱壊鑳屾櫙 */ + color: white; + box-shadow: 0 0 8px rgba(156, 39, 176, 0.3); + } } </style> \ No newline at end of file -- Gitblit v1.9.3