| | |
| | | </view> |
| | | </view> |
| | | <view class="status-tags"> |
| | | <u-tag :type="getTagType(item.checkResult)" |
| | | <u-tag v-if="item.passRate != null && item.passRate !== ''" |
| | | type="primary" |
| | | size="mini" |
| | | class="status-tag"> |
| | | {{ item.checkResult }} |
| | | 合格率 {{ formatPassRate(item.passRate) }} |
| | | </u-tag> |
| | | <u-tag :type="getStateTagType(item.inspectState)" |
| | | size="mini" |
| | |
| | | </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)"> |
| | |
| | | :disabled="item.inspectState || item.checkName !== ''" |
| | | @click.stop="assignInspector(item)"> |
| | | 分配检验员 |
| | | </u-button> --> |
| | | </u-button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | </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" |
| | |
| | | return inspectState ? "checkmark-circle" : "time"; |
| | | }; |
| | | |
| | | // 获取标签类型 |
| | | const getTagType = checkResult => { |
| | | if (checkResult === "合格") return "success"; |
| | | if (checkResult === "不合格") return "error"; |
| | | return "default"; |
| | | // 格式化合格率 |
| | | const formatPassRate = rate => { |
| | | if (rate === null || rate === undefined || rate === "") return "-"; |
| | | const num = Number(rate); |
| | | if (isNaN(num)) return rate; |
| | | if (num <= 1) return `${(num * 100).toFixed(2)}%`; |
| | | return `${num}%`; |
| | | }; |
| | | |
| | | // 获取状态标签类型 |
| | |
| | | pendingCount.value = inspectionList.value.filter( |
| | | item => !item.inspectState |
| | | ).length; |
| | | qualifiedCount.value = inspectionList.value.filter( |
| | | item => item.checkResult === "合格" |
| | | ).length; |
| | | qualifiedCount.value = inspectionList.value.filter(item => { |
| | | const rate = Number(item.passRate); |
| | | if (isNaN(rate)) return false; |
| | | return rate <= 1 ? rate >= 1 : rate >= 100; |
| | | }).length; |
| | | }) |
| | | .catch(err => { |
| | | tableLoading.value = false; |