From 9581c0ae9f0d9a2e92744f3dca78960780b9a2df Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期一, 18 五月 2026 17:42:21 +0800
Subject: [PATCH] 附件
---
src/pages/qualityManagement/processInspection/index.vue | 66 +++++++++++++++++++++++---------
1 files changed, 47 insertions(+), 19 deletions(-)
diff --git a/src/pages/qualityManagement/processInspection/index.vue b/src/pages/qualityManagement/processInspection/index.vue
index 14e66ef..816143d 100644
--- a/src/pages/qualityManagement/processInspection/index.vue
+++ b/src/pages/qualityManagement/processInspection/index.vue
@@ -60,8 +60,7 @@
v-if="inspectionList.length > 0">
<view v-for="(item, index) in inspectionList"
:key="index">
- <view class="inspection-item"
- @click="viewDetail(item)">
+ <view class="inspection-item">
<view class="item-header">
<view class="item-left">
<!-- <view class="material-icon"
@@ -76,10 +75,11 @@
</view>
</view>
<view class="status-tags">
- <u-tag :type="getTagType(item.checkResult)"
+ <u-tag :type="getPassRateTagType(item.passRate)"
+ v-if="item.passRate != null && item.passRate !== ''"
size="mini"
class="status-tag">
- {{ item.checkResult }}
+ {{ formatPassRate(item.passRate) }}
</u-tag>
<u-tag :type="getStateTagType(item.inspectState)"
size="mini"
@@ -107,8 +107,16 @@
<text class="detail-value">{{ item.checkName || '-' }}</text>
</view>
<view class="detail-row">
- <text class="detail-label">鏁伴噺</text>
+ <text class="detail-label">鎬绘暟閲�</text>
<text class="detail-value">{{ item.quantity || 0 }} {{ item.unit || '' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">鍚堟牸鏁伴噺</text>
+ <text class="detail-value">{{ item.qualifiedQuantity ?? '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">涓嶅悎鏍兼暟閲�</text>
+ <text class="detail-value">{{ item.unqualifiedQuantity ?? '-' }}</text>
</view>
<view class="detail-row">
<text class="detail-label">妫�娴嬪崟浣�</text>
@@ -117,29 +125,29 @@
</view>
<!-- 鎿嶄綔鎸夐挳 -->
<view class="action-buttons">
- <!-- <u-button type="primary"
+ <u-button type="primary"
size="small"
class="action-btn"
:disabled="item.inspectState"
@click.stop="startInspection(item)">
缂栬緫
- </u-button> -->
+ </u-button>
<u-button type="info"
size="small"
class="action-btn"
@click.stop="viewDetail(item)">
璇︽儏
</u-button>
- <!-- <u-button type="success"
+ <u-button type="success"
size="small"
class="action-btn"
:disabled="item.inspectState"
@click.stop="submitInspection(item)">
鎻愪氦
- </u-button> -->
+ </u-button>
</view>
<view class="action-buttons">
- <!-- <u-button type="info"
+ <u-button type="info"
size="small"
class="action-btn"
@click.stop="viewFileList(item)">
@@ -151,7 +159,7 @@
:disabled="item.inspectState || item.checkName !== ''"
@click.stop="assignInspector(item)">
鍒嗛厤妫�楠屽憳
- </u-button> -->
+ </u-button>
</view>
</view>
</view>
@@ -163,12 +171,12 @@
</view>
<!-- 鍒嗛〉缁勪欢 -->
<!-- 娴姩鏂板鎸夐挳 -->
- <!-- <view class="fab-button"
+ <view class="fab-button"
@click="addInspection">
<up-icon name="plus"
size="24"
color="#ffffff"></up-icon>
- </view> -->
+ </view>
<!-- 鏃ユ湡閫夋嫨鍣� -->
<up-popup v-model:show="showDate"
mode="date"
@@ -315,11 +323,31 @@
return inspectState ? "checkmark-circle" : "time";
};
- // 鑾峰彇鏍囩绫诲瀷
- const getTagType = checkResult => {
- if (checkResult === "鍚堟牸") return "success";
- if (checkResult === "涓嶅悎鏍�") return "error";
- return "default";
+ const formatPassRate = val => {
+ if (val === null || val === undefined || val === "") return "-";
+ const n = Number(val);
+ if (Number.isNaN(n)) return String(val);
+ if (n > 0 && n <= 1) return `${(n * 100).toFixed(1)}%`;
+ return `${Number.isInteger(n) ? n : Number(n.toFixed(1))}%`;
+ };
+
+ const getPassRateTagType = val => {
+ if (val === null || val === undefined || val === "") return "default";
+ let n = Number(val);
+ if (Number.isNaN(n)) return "default";
+ if (n > 0 && n <= 1) n *= 100;
+ if (n >= 100) return "success";
+ if (n >= 60) return "warning";
+ return "error";
+ };
+
+ const isFullPassByPassRate = item => {
+ const v = item.passRate;
+ if (v === null || v === undefined || v === "") return false;
+ const n = Number(v);
+ if (Number.isNaN(n)) return false;
+ if (n > 0 && n <= 1) return n >= 1;
+ return n >= 100;
};
// 鑾峰彇鐘舵�佹爣绛剧被鍨�
@@ -383,7 +411,7 @@
item => !item.inspectState
).length;
qualifiedCount.value = inspectionList.value.filter(
- item => item.checkResult === "鍚堟牸"
+ isFullPassByPassRate
).length;
})
.catch(err => {
--
Gitblit v1.9.3