Merge remote-tracking branch 'origin/dev_NEW_pro_鹤壁' into dev_NEW_pro_鹤壁
| | |
| | | data, |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * @desc æ¥ä¿®éªæ¶ç¡®è®¤ |
| | | * @param {éªæ¶åæ°} data |
| | | * @returns |
| | | */ |
| | | export const repairAcceptance = (data) => { |
| | | return request({ |
| | | url: "/device/repair/acceptance", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }; |
| | | export const getSparePartsList = (params) => { |
| | | return request({ |
| | | url: "/spareParts/listPage", |
| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/equipmentManagement/repair/acceptance", |
| | | "style": { |
| | | "navigationBarTitleText": "è®¾å¤æ¥ä¿®éªæ¶", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/equipmentManagement/repair/detail", |
| | | "style": { |
| | | "navigationBarTitleText": "è®¾å¤æ¥ä¿®è¯¦æ
", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/equipmentManagement/upkeep/index", |
| | | "style": { |
| | | "navigationBarTitleText": "设å¤ä¿å
»", |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="repair-acceptance"> |
| | | <PageHeader title="è®¾å¤æ¥ä¿®éªæ¶" |
| | | @back="goBack" /> |
| | | <!-- æ¥ä¿®ä¿¡æ¯ --> |
| | | <view class="section"> |
| | | <view class="section-title">æ¥ä¿®ä¿¡æ¯</view> |
| | | <view class="info-item"> |
| | | <text class="info-label">设å¤åç§°</text> |
| | | <text class="info-value">{{ detail.deviceName || '-' }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">è§æ ¼åå·</text> |
| | | <text class="info-value">{{ detail.deviceModel || '-' }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">æ¥ä¿®æ¥æ</text> |
| | | <text class="info-value">{{ formatDate(detail.repairTime) || '-' }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">æ¥ä¿®äºº</text> |
| | | <text class="info-value">{{ detail.repairName || '-' }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">维修人</text> |
| | | <text class="info-value">{{ detail.maintenanceName || '-' }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">维修项ç®</text> |
| | | <text class="info-value">{{ detail.machineryCategory || '-' }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">æ
éç°è±¡</text> |
| | | <text class="info-value multi-line">{{ detail.remark || '-' }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">ç»´ä¿®ç»æ</text> |
| | | <text class="info-value multi-line">{{ detail.maintenanceResult || '-' }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">ç»´ä¿®æ¥æ</text> |
| | | <text class="info-value">{{ formatDateTime(detail.maintenanceTime) || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | <!-- éªæ¶è¡¨å --> |
| | | <u-form ref="formRef" |
| | | :model="form" |
| | | label-width="110"> |
| | | <u-cell-group title="éªæ¶ä¿¡æ¯"> |
| | | <u-form-item label="éªæ¶äºº" |
| | | prop="acceptanceName" |
| | | required |
| | | border-bottom> |
| | | <u-input v-model="form.acceptanceName" |
| | | disabled |
| | | placeholder="éªæ¶äºº" /> |
| | | </u-form-item> |
| | | <u-form-item label="éªæ¶æ¶é´" |
| | | prop="acceptanceTime" |
| | | required |
| | | border-bottom> |
| | | <u-input v-model="form.acceptanceTime" |
| | | placeholder="è¯·éæ©éªæ¶æ¶é´" |
| | | readonly |
| | | @click="showDatePicker = true" /> |
| | | <template #right> |
| | | <u-icon name="arrow-right" |
| | | @click="showDatePicker = true"></u-icon> |
| | | </template> |
| | | </u-form-item> |
| | | <u-form-item label="éªæ¶å¤æ³¨" |
| | | prop="acceptanceRemark" |
| | | required |
| | | border-bottom> |
| | | <u-textarea v-model="form.acceptanceRemark" |
| | | placeholder="请è¾å
¥éªæ¶å¤æ³¨" |
| | | :maxlength="200" |
| | | count |
| | | :autoHeight="true" /> |
| | | </u-form-item> |
| | | </u-cell-group> |
| | | <view class="footer-btns"> |
| | | <u-button class="cancel-btn" |
| | | @click="goBack">åæ¶</u-button> |
| | | <u-button class="save-btn" |
| | | type="primary" |
| | | @click="handleSubmit" |
| | | :loading="loading">éªæ¶ç¡®è®¤</u-button> |
| | | </view> |
| | | </u-form> |
| | | <up-datetime-picker :show="showDatePicker" |
| | | v-model="pickerDateValue" |
| | | mode="datetime" |
| | | title="éæ©éªæ¶æ¶é´" |
| | | @confirm="onDateConfirm" |
| | | @cancel="showDatePicker = false" /> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted } from "vue"; |
| | | import { onLoad } from "@dcloudio/uni-app"; |
| | | import PageHeader from "@/components/PageHeader.vue"; |
| | | import { repairAcceptance, getRepairById } from "@/api/equipmentManagement/repair"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | defineOptions({ name: "repair-acceptance" }); |
| | | |
| | | const showToast = message => { |
| | | uni.showToast({ title: message, icon: "none" }); |
| | | }; |
| | | |
| | | const userStore = useUserStore(); |
| | | const loading = ref(false); |
| | | const showDatePicker = ref(false); |
| | | const pickerDateValue = ref(Date.now()); |
| | | const repairId = ref(""); |
| | | const detail = ref({}); |
| | | |
| | | const form = ref({ |
| | | id: "", |
| | | acceptanceName: "", |
| | | acceptanceTime: dayjs().format("YYYY-MM-DD HH:mm:ss"), |
| | | acceptanceRemark: "", |
| | | }); |
| | | |
| | | const formatDate = dateStr => { |
| | | if (!dateStr) return ""; |
| | | return dayjs(dateStr).format("YYYY-MM-DD"); |
| | | }; |
| | | |
| | | const formatDateTime = dateStr => { |
| | | if (!dateStr) return ""; |
| | | return dayjs(dateStr).format("YYYY-MM-DD HH:mm:ss"); |
| | | }; |
| | | |
| | | const canAccept = item => { |
| | | const currentName = userStore.nickName || userStore.name || ""; |
| | | return currentName && item.acceptanceName === currentName; |
| | | }; |
| | | |
| | | const loadDetail = async id => { |
| | | try { |
| | | const cached = uni.getStorageSync("repairDetail"); |
| | | if (cached) { |
| | | detail.value = typeof cached === "string" ? JSON.parse(cached) : cached; |
| | | } |
| | | if (id && (!detail.value?.id || detail.value.id != id)) { |
| | | const { code, data } = await getRepairById(id); |
| | | if (code == 200) { |
| | | detail.value = data; |
| | | } |
| | | } |
| | | if (!canAccept(detail.value)) { |
| | | showToast("ä»
æå®éªæ¶äººå¯è¿è¡éªæ¶"); |
| | | setTimeout(() => uni.navigateBack(), 1500); |
| | | return; |
| | | } |
| | | form.value.id = detail.value.id; |
| | | form.value.acceptanceName = detail.value.acceptanceName || ""; |
| | | } catch (e) { |
| | | showToast("è·åæ¥ä¿®ä¿¡æ¯å¤±è´¥"); |
| | | } |
| | | }; |
| | | |
| | | const onDateConfirm = e => { |
| | | form.value.acceptanceTime = dayjs(e.value).format("YYYY-MM-DD HH:mm:ss"); |
| | | pickerDateValue.value = e.value; |
| | | showDatePicker.value = false; |
| | | }; |
| | | |
| | | const handleSubmit = async () => { |
| | | if (!form.value.acceptanceTime?.trim()) { |
| | | showToast("è¯·éæ©éªæ¶æ¶é´"); |
| | | return; |
| | | } |
| | | if (!form.value.acceptanceRemark?.trim()) { |
| | | showToast("请è¾å
¥éªæ¶å¤æ³¨"); |
| | | return; |
| | | } |
| | | try { |
| | | loading.value = true; |
| | | const { code } = await repairAcceptance({ |
| | | id: form.value.id, |
| | | acceptanceTime: form.value.acceptanceTime, |
| | | acceptanceRemark: form.value.acceptanceRemark, |
| | | }); |
| | | if (code == 200) { |
| | | showToast("éªæ¶æå"); |
| | | uni.removeStorageSync("repairDetail"); |
| | | setTimeout(() => uni.navigateBack(), 500); |
| | | } else { |
| | | loading.value = false; |
| | | } |
| | | } catch (e) { |
| | | loading.value = false; |
| | | showToast("éªæ¶æäº¤å¤±è´¥"); |
| | | } |
| | | }; |
| | | |
| | | const goBack = () => { |
| | | uni.removeStorageSync("repairDetail"); |
| | | uni.navigateBack(); |
| | | }; |
| | | |
| | | onLoad(options => { |
| | | if (options.id) { |
| | | repairId.value = options.id; |
| | | } |
| | | }); |
| | | |
| | | onMounted(async () => { |
| | | if (!userStore.nickName) { |
| | | await userStore.getInfo().catch(() => {}); |
| | | } |
| | | if (repairId.value) { |
| | | loadDetail(repairId.value); |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | @import "@/static/scss/form-common.scss"; |
| | | |
| | | .repair-acceptance { |
| | | min-height: 100vh; |
| | | background-color: #f8f9fa; |
| | | padding-bottom: 160rpx; |
| | | } |
| | | |
| | | .section { |
| | | background-color: #ffffff; |
| | | margin-bottom: 16px; |
| | | overflow: hidden; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); |
| | | } |
| | | |
| | | .section-title { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #333333; |
| | | padding: 16px 16px 12px; |
| | | border-bottom: 1px solid #f0f0f0; |
| | | } |
| | | |
| | | .info-item { |
| | | display: flex; |
| | | padding: 14px 16px; |
| | | border-bottom: 1px solid #f8f8f8; |
| | | align-items: flex-start; |
| | | } |
| | | |
| | | .info-item:last-child { |
| | | border-bottom: none; |
| | | } |
| | | |
| | | .info-label { |
| | | font-size: 14px; |
| | | color: #666666; |
| | | min-width: 80px; |
| | | flex-shrink: 0; |
| | | line-height: 22px; |
| | | } |
| | | |
| | | .info-value { |
| | | font-size: 14px; |
| | | color: #333333; |
| | | flex: 1; |
| | | line-height: 22px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .multi-line { |
| | | text-align: left; |
| | | word-break: break-all; |
| | | } |
| | | |
| | | .footer-btns { |
| | | position: fixed; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: #fff; |
| | | display: flex; |
| | | justify-content: space-around; |
| | | align-items: center; |
| | | padding: 0.75rem 0; |
| | | box-shadow: 0 -0.125rem 0.5rem rgba(0, 0, 0, 0.05); |
| | | z-index: 1000; |
| | | } |
| | | |
| | | .cancel-btn { |
| | | font-weight: 400; |
| | | font-size: 1rem; |
| | | color: #666; |
| | | background: #f5f5f5; |
| | | border: 1px solid #ddd; |
| | | width: 45%; |
| | | height: 2.5rem; |
| | | border-radius: 2.5rem; |
| | | } |
| | | |
| | | .save-btn { |
| | | font-weight: 500; |
| | | font-size: 1rem; |
| | | color: #fff; |
| | | background: linear-gradient(140deg, #00baff 0%, #006cfb 100%); |
| | | border: none; |
| | | width: 45%; |
| | | height: 2.5rem; |
| | | border-radius: 2.5rem; |
| | | } |
| | | </style> |
| | |
| | | placeholder="请è¾å
¥ç»´ä¿®äºº" |
| | | clearable /> |
| | | </u-form-item> |
| | | <u-form-item label="éªæ¶äºº" |
| | | prop="acceptanceName" |
| | | border-bottom> |
| | | <u-input v-model="form.acceptanceName" |
| | | placeholder="请è¾å
¥éªæ¶äºº" |
| | | clearable /> |
| | | </u-form-item> |
| | | <u-form-item label="维修项ç®" |
| | | prop="machineryCategory" |
| | | border-bottom> |
| | |
| | | repairTime: dayjs().format("YYYY-MM-DD"), // æ¥ä¿®æ¥æ |
| | | repairName: undefined, // æ¥ä¿®äºº |
| | | maintenanceName: undefined, // 维修人 |
| | | acceptanceName: undefined, // éªæ¶äºº |
| | | status: "0", // æ¥ä¿®ç¶æ |
| | | machineryCategory: undefined, // ç»´ä¿®é¡¹ç® |
| | | remark: undefined, // æ
éç°è±¡ |
| | | storageBlobDTOs: [], // å¾çéä»¶ |
| | |
| | | // æ¥ä¿®ç¶æé项 |
| | | const repairStatusOptions = ref([ |
| | | { name: "å¾
ç»´ä¿®", value: "0" }, |
| | | { name: "å®ç»", value: "1" }, |
| | | { name: "失败", value: "2" }, |
| | | { name: "宿", value: "1" }, |
| | | { name: "维修失败", value: "2" }, |
| | | { name: "å¾
éªæ¶", value: "3" }, |
| | | ]); |
| | | const repairStatusText = ref(""); |
| | | const repairStatusText = ref("å¾
ç»´ä¿®"); |
| | | |
| | | // æå¼æ¥ä¿®ç¶æéæ©å¨ |
| | | const openRepairStatusPicker = () => { |
| | |
| | | form.value.repairTime = dayjs(data.repairTime).format("YYYY-MM-DD"); |
| | | form.value.repairName = data.repairName; |
| | | form.value.maintenanceName = data.maintenanceName; |
| | | form.value.acceptanceName = data.acceptanceName; |
| | | form.value.status = String(data.status ?? "0"); |
| | | form.value.machineryCategory = data.machineryCategory; |
| | | form.value.remark = data.remark; |
| | | form.value.storageBlobDTOs = data.storageBlobVOs || []; |
| | | repairStatusText.value = |
| | | repairStatusOptions.value.find(item => item.value == data.status) |
| | | ?.name || ""; |
| | | repairStatusOptions.value.find( |
| | | item => item.value == String(data.status) |
| | | )?.name || ""; |
| | | // 设置设å¤åç§°æ¾ç¤º |
| | | const device = deviceOptions.value.find( |
| | | item => item.id === data.deviceLedgerId |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="repair-detail"> |
| | | <PageHeader title="è®¾å¤æ¥ä¿®è¯¦æ
" |
| | | @back="goBack" /> |
| | | <view class="content-container"> |
| | | <!-- 1. æ¥ä¿®ç»è®° --> |
| | | <view class="section"> |
| | | <view class="section-head"> |
| | | <view class="section-bar"></view> |
| | | <text class="section-head-text">1. æ¥ä¿®ç»è®°</text> |
| | | </view> |
| | | <view class="desc-table"> |
| | | <view class="desc-row"> |
| | | <view class="desc-cell"> |
| | | <text class="desc-label">设å¤åç§°</text> |
| | | <text class="desc-value">{{ detail.deviceName || '-' }}</text> |
| | | </view> |
| | | <view class="desc-cell"> |
| | | <text class="desc-label">è§æ ¼åå·</text> |
| | | <text class="desc-value">{{ detail.deviceModel || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="desc-row"> |
| | | <view class="desc-cell"> |
| | | <text class="desc-label">æ¥ä¿®æ¥æ</text> |
| | | <text class="desc-value">{{ formatDate(detail.repairTime) || '-' }}</text> |
| | | </view> |
| | | <view class="desc-cell"> |
| | | <text class="desc-label">æ¥ä¿®äºº</text> |
| | | <text class="desc-value">{{ detail.repairName || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="desc-row"> |
| | | <view class="desc-cell"> |
| | | <text class="desc-label">éªæ¶äºº</text> |
| | | <text class="desc-value">{{ detail.acceptanceName || '-' }}</text> |
| | | </view> |
| | | <view class="desc-cell"> |
| | | <text class="desc-label">维修人</text> |
| | | <text class="desc-value">{{ detail.maintenanceName || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="desc-row full"> |
| | | <view class="desc-cell full"> |
| | | <text class="desc-label">æ
éç°è±¡</text> |
| | | <text class="desc-value">{{ detail.remark || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="desc-row full"> |
| | | <view class="desc-cell full status-cell"> |
| | | <text class="desc-label">å½åç¶æ</text> |
| | | <view class="desc-value"> |
| | | <u-tag :type="getStatusType(detail.status)" |
| | | size="mini">{{ getStatusLabel(detail.status) }}</u-tag> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="image-block"> |
| | | <text class="image-block-title">设å¤é®é¢å¾ç</text> |
| | | <view v-if="imageList.length" |
| | | class="image-content"> |
| | | <CommonUpload :model-value="imageList" |
| | | disabled /> |
| | | </view> |
| | | <view v-else |
| | | class="image-empty"> |
| | | <up-icon name="photo" |
| | | size="40" |
| | | color="#c0c4cc"></up-icon> |
| | | <text class="image-empty-text">ææ è®¾å¤é®é¢å¾ç</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 2. ç»´ä¿®å¤ç --> |
| | | <view class="section"> |
| | | <view class="section-head"> |
| | | <view class="section-bar"></view> |
| | | <text class="section-head-text">2. ç»´ä¿®å¤ç</text> |
| | | </view> |
| | | <view class="desc-table"> |
| | | <view class="desc-row"> |
| | | <view class="desc-cell"> |
| | | <text class="desc-label">维修人</text> |
| | | <text class="desc-value">{{ detail.maintenanceName || '-' }}</text> |
| | | </view> |
| | | <view class="desc-cell"> |
| | | <text class="desc-label">ç»´ä¿®æ¶é´</text> |
| | | <text class="desc-value">{{ formatDateTime(detail.maintenanceTime) || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="desc-row full"> |
| | | <view class="desc-cell full"> |
| | | <text class="desc-label">ç»´ä¿®ç»æ</text> |
| | | <text class="desc-value">{{ detail.maintenanceResult || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 3. éªæ¶ --> |
| | | <view class="section"> |
| | | <view class="section-head"> |
| | | <view class="section-bar"></view> |
| | | <text class="section-head-text">3. éªæ¶</text> |
| | | </view> |
| | | <view class="desc-table"> |
| | | <view class="desc-row"> |
| | | <view class="desc-cell"> |
| | | <text class="desc-label">éªæ¶äºº</text> |
| | | <text class="desc-value">{{ detail.acceptanceName || '-' }}</text> |
| | | </view> |
| | | <view class="desc-cell"> |
| | | <text class="desc-label">éªæ¶æ¶é´</text> |
| | | <text class="desc-value">{{ formatDateTime(detail.acceptanceTime) || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="desc-row full"> |
| | | <view class="desc-cell full"> |
| | | <text class="desc-label">éªæ¶å¤æ³¨</text> |
| | | <text class="desc-value">{{ detail.acceptanceRemark || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, computed, onMounted } from "vue"; |
| | | import { onLoad } from "@dcloudio/uni-app"; |
| | | import PageHeader from "@/components/PageHeader.vue"; |
| | | import CommonUpload from "@/components/CommonUpload.vue"; |
| | | import { getRepairById } from "@/api/equipmentManagement/repair"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | defineOptions({ name: "repair-detail" }); |
| | | |
| | | const showToast = message => { |
| | | uni.showToast({ title: message, icon: "none" }); |
| | | }; |
| | | |
| | | const repairId = ref(""); |
| | | const detail = ref({}); |
| | | |
| | | const STATUS_MAP = { |
| | | 0: { label: "å¾
ç»´ä¿®", type: "error" }, |
| | | 1: { label: "宿", type: "success" }, |
| | | 2: { label: "维修失败", type: "warning" }, |
| | | 3: { label: "å¾
éªæ¶", type: "primary" }, |
| | | }; |
| | | |
| | | const getStatusLabel = status => STATUS_MAP[status]?.label || "-"; |
| | | const getStatusType = status => STATUS_MAP[status]?.type || "info"; |
| | | |
| | | const imageList = computed(() => { |
| | | return detail.value.storageBlobVOs || detail.value.storageBlobDTOs || []; |
| | | }); |
| | | |
| | | const formatDate = dateStr => { |
| | | if (!dateStr) return ""; |
| | | return dayjs(dateStr).format("YYYY-MM-DD"); |
| | | }; |
| | | |
| | | const formatDateTime = dateStr => { |
| | | if (!dateStr) return ""; |
| | | return dayjs(dateStr).format("YYYY-MM-DD HH:mm:ss"); |
| | | }; |
| | | |
| | | const loadDetail = async id => { |
| | | try { |
| | | const cached = uni.getStorageSync("repairDetail"); |
| | | if (cached) { |
| | | detail.value = typeof cached === "string" ? JSON.parse(cached) : cached; |
| | | } |
| | | if (id) { |
| | | const { code, data } = await getRepairById(id); |
| | | if (code == 200) { |
| | | detail.value = { ...detail.value, ...data }; |
| | | } |
| | | } |
| | | } catch (e) { |
| | | showToast("è·å详æ
失败"); |
| | | } |
| | | }; |
| | | |
| | | const goBack = () => { |
| | | uni.removeStorageSync("repairDetail"); |
| | | uni.navigateBack(); |
| | | }; |
| | | |
| | | onLoad(options => { |
| | | if (options.id) { |
| | | repairId.value = options.id; |
| | | } |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | loadDetail(repairId.value); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .repair-detail { |
| | | min-height: 100vh; |
| | | background-color: #f0f2f5; |
| | | padding-bottom: 24px; |
| | | } |
| | | |
| | | .content-container { |
| | | padding: 12px; |
| | | } |
| | | |
| | | .section { |
| | | background-color: #ffffff; |
| | | border-radius: 4px; |
| | | margin-bottom: 12px; |
| | | overflow: hidden; |
| | | border: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .section-head { |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 12px 16px; |
| | | border-bottom: 1px solid #ebeef5; |
| | | background: #fff; |
| | | } |
| | | |
| | | .section-bar { |
| | | width: 4px; |
| | | height: 16px; |
| | | background: #409eff; |
| | | border-radius: 2px; |
| | | margin-right: 8px; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .section-head-text { |
| | | font-size: 15px; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | } |
| | | |
| | | .desc-table { |
| | | border-top: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .desc-row { |
| | | display: flex; |
| | | border-bottom: 1px solid #ebeef5; |
| | | |
| | | &:last-child { |
| | | border-bottom: none; |
| | | } |
| | | |
| | | &.full { |
| | | .desc-cell.full { |
| | | flex: 1; |
| | | width: 100%; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .desc-cell { |
| | | flex: 1; |
| | | display: flex; |
| | | min-width: 0; |
| | | border-right: 1px solid #ebeef5; |
| | | |
| | | &:last-child { |
| | | border-right: none; |
| | | } |
| | | |
| | | &.full { |
| | | border-right: none; |
| | | } |
| | | } |
| | | |
| | | .desc-label { |
| | | width: 88px; |
| | | flex-shrink: 0; |
| | | padding: 10px 12px; |
| | | font-size: 13px; |
| | | color: #606266; |
| | | background: #f5f7fa; |
| | | border-right: 1px solid #ebeef5; |
| | | line-height: 20px; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .desc-value { |
| | | flex: 1; |
| | | padding: 10px 12px; |
| | | font-size: 13px; |
| | | color: #303133; |
| | | background: #ffffff; |
| | | line-height: 20px; |
| | | word-break: break-all; |
| | | min-width: 0; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .status-cell { |
| | | .desc-value { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | } |
| | | |
| | | .image-block { |
| | | padding: 12px 16px 16px; |
| | | border-top: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .image-block-title { |
| | | display: block; |
| | | font-size: 13px; |
| | | color: #606266; |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .image-content { |
| | | padding: 0; |
| | | } |
| | | |
| | | .image-empty { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | min-height: 120px; |
| | | background: #fafafa; |
| | | border: 1px dashed #dcdfe6; |
| | | border-radius: 4px; |
| | | gap: 8px; |
| | | } |
| | | |
| | | .image-empty-text { |
| | | font-size: 13px; |
| | | color: #c0c4cc; |
| | | } |
| | | |
| | | @media (max-width: 400px) { |
| | | .desc-row:not(.full) { |
| | | flex-direction: column; |
| | | |
| | | .desc-cell { |
| | | border-right: none; |
| | | border-bottom: 1px solid #ebeef5; |
| | | |
| | | &:last-child { |
| | | border-bottom: none; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <text class="item-id">设å¤åç§°ï¼{{ item.deviceName }}</text> |
| | | </view> |
| | | <view class="status-tag"> |
| | | <u-tag v-if="item.status === 1" |
| | | type="success">å®ç»</u-tag> |
| | | <u-tag v-if="item.status === 0" |
| | | type="error">å¾
ç»´ä¿®</u-tag> |
| | | <u-tag :type="getStatusType(item.status)" |
| | | size="mini">{{ getStatusLabel(item.status) }}</u-tag> |
| | | </view> |
| | | </view> |
| | | <up-divider></up-divider> |
| | |
| | | <text class="detail-value">{{ item.maintenanceName || '-' }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">éªæ¶äºº</text> |
| | | <text class="detail-value">{{ item.acceptanceName || '-' }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">维修项ç®</text> |
| | | <text class="detail-value">{{ item.machineryCategory || '-' }}</text> |
| | | </view> |
| | |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">ç»´ä¿®æ¥æ</text> |
| | | <text class="detail-value">{{ formatDate(item.maintenanceTime) || '-' }}</text> |
| | | <text class="detail-value">{{ formatDateTime(item.maintenanceTime) || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | <!-- æé®åºå --> |
| | | <view class="action-buttons"> |
| | | <u-button type="info" |
| | | size="small" |
| | | plain |
| | | class="action-btn" |
| | | @click="goDetail(item)"> |
| | | 详æ
|
| | | </u-button> |
| | | <u-button type="success" |
| | | size="small" |
| | | class="action-btn" |
| | | v-if="item.status === 3" |
| | | :disabled="!canAccept(item)" |
| | | @click="goAcceptance(item)"> |
| | | éªæ¶ |
| | | </u-button> |
| | | <u-button type="primary" |
| | | size="small" |
| | | class="action-btn" |
| | |
| | | |
| | | const userStore = useUserStore(); |
| | | |
| | | const STATUS_MAP = { |
| | | 0: { label: "å¾
ç»´ä¿®", type: "error" }, |
| | | 1: { label: "宿", type: "success" }, |
| | | 2: { label: "维修失败", type: "warning" }, |
| | | 3: { label: "å¾
éªæ¶", type: "primary" }, |
| | | }; |
| | | |
| | | const getStatusLabel = status => STATUS_MAP[status]?.label || "-"; |
| | | const getStatusType = status => STATUS_MAP[status]?.type || "info"; |
| | | |
| | | const canAccept = item => { |
| | | if (item.status !== 3) return false; |
| | | const currentName = userStore.nickName || userStore.name || ""; |
| | | return currentName && item.acceptanceName === currentName; |
| | | }; |
| | | |
| | | // æç´¢å
³é®è¯ |
| | | const searchKeyword = ref(""); |
| | | |
| | |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | return `${year}-${month}-${day}`; |
| | | }; |
| | | |
| | | const formatDateTime = dateStr => { |
| | | if (!dateStr) return ""; |
| | | const date = new Date(dateStr); |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | const hours = String(date.getHours()).padStart(2, "0"); |
| | | const minutes = String(date.getMinutes()).padStart(2, "0"); |
| | | const seconds = String(date.getSeconds()).padStart(2, "0"); |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | }; |
| | | |
| | | // æ¥è¯¢å表 |
| | |
| | | showToast("åæ°é误"); |
| | | return; |
| | | } |
| | | // 使ç¨uni.setStorageSyncåå¨id |
| | | uni.setStorageSync("repairId", id); |
| | | uni.navigateTo({ |
| | | url: "/pages/equipmentManagement/repair/maintain", |
| | |
| | | }); |
| | | }; |
| | | |
| | | // ç¼è¾ - 跳转å°add页é¢ï¼éè¿idåºåæ°å¢è¿æ¯ç¼è¾ |
| | | // ç¼è¾ |
| | | const edit = id => { |
| | | if (!id) return; |
| | | // 使ç¨uni.setStorageSyncåå¨id |
| | | // uni.setStorageSync("repairId", id); |
| | | uni.navigateTo({ |
| | | url: "/pages/equipmentManagement/repair/add?id=" + id, |
| | | }); |
| | | }; |
| | | |
| | | // 详æ
|
| | | const goDetail = item => { |
| | | uni.setStorageSync("repairDetail", JSON.stringify(item)); |
| | | uni.navigateTo({ |
| | | url: "/pages/equipmentManagement/repair/detail?id=" + item.id, |
| | | }); |
| | | }; |
| | | |
| | | // éªæ¶ |
| | | const goAcceptance = item => { |
| | | if (!canAccept(item)) { |
| | | showToast("ä»
æå®éªæ¶äººå¯è¿è¡éªæ¶"); |
| | | return; |
| | | } |
| | | uni.setStorageSync("repairDetail", JSON.stringify(item)); |
| | | uni.navigateTo({ |
| | | url: "/pages/equipmentManagement/repair/acceptance?id=" + item.id, |
| | | }); |
| | | }; |
| | | |
| | |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | if (!userStore.nickName) { |
| | | userStore.getInfo().catch(() => {}); |
| | | } |
| | | getList(); |
| | | }); |
| | | |
| | |
| | | <style scoped lang="scss"> |
| | | @import "@/styles/sales-common.scss"; |
| | | |
| | | // 设å¤ç»´ä¿®ç¹ææ ·å¼ |
| | | .sales-account { |
| | | padding-bottom: 80px; // ä¸ºæµ®å¨æé®çåºç©ºé´ |
| | | padding-bottom: 80px; |
| | | } |
| | | |
| | | .status-tag { |
| | |
| | | } |
| | | |
| | | .action-buttons { |
| | | gap: 8px; // ä¸å
Œ
±æ ·å¼ä¸ç 12px ä¸å |
| | | gap: 8px; |
| | | flex-wrap: wrap; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <u-cell-group title="维修信æ¯" |
| | | inset> |
| | | <u-form-item prop="maintenanceName" |
| | | label="æ¥ä¿®äºº" |
| | | label="维修人" |
| | | required> |
| | | <u-input v-model="form.maintenanceName" |
| | | placeholder="请è¾å
¥æ¥ä¿®äºº" |
| | | placeholder="请è¾å
¥ç»´ä¿®äºº" |
| | | clearable /> |
| | | </u-form-item> |
| | | <u-form-item prop="maintenanceResult" |
| | |
| | | // 表åéªè¯è§å |
| | | const formRules = { |
| | | maintenanceName: [ |
| | | { required: true, trigger: "blur", message: "请è¾å
¥æ¥ä¿®äºº" }, |
| | | { required: true, trigger: "blur", message: "请è¾å
¥ç»´ä¿®äºº" }, |
| | | ], |
| | | maintenanceResult: [ |
| | | { required: true, trigger: "blur", message: "请è¾å
¥ç»´ä¿®ç»æ" }, |
| | |
| | | }; |
| | | const repairStatusOptions = ref([ |
| | | { name: "å¾
ç»´ä¿®", value: "0" }, |
| | | { name: "å®ç»", value: "1" }, |
| | | { name: "失败", value: "2" }, |
| | | { name: "宿", value: "1" }, |
| | | { name: "维修失败", value: "2" }, |
| | | { name: "å¾
éªæ¶", value: "3" }, |
| | | ]); |
| | | const repairStatusText = ref("å®ç»"); |
| | | const repairStatusText = ref("å¾
éªæ¶"); |
| | | // æå¼æ¥ä¿®ç¶æéæ©å¨ |
| | | const openRepairStatusPicker = () => { |
| | | uni.showActionSheet({ |
| | |
| | | maintenanceName: userStore.nickName || "", // é»è®¤ä½¿ç¨å½åç¨æ·æµç§° |
| | | maintenanceResult: undefined, // ç»´ä¿®ç»æ |
| | | maintenanceTime: dayjs().format("YYYY-MM-DD HH:mm:ss"), // ç»´ä¿®æ¥æï¼åªæ¾ç¤ºæ¥æï¼ |
| | | status: "1", |
| | | status: "3", |
| | | sparePartsIds: [], |
| | | }); |
| | | |
| | |
| | | maintenanceName: userStore.nickName || "", |
| | | maintenanceResult: undefined, |
| | | maintenanceTime: dayjs().format("YYYY-MM-DD HH:mm:ss"), |
| | | status: "1", |
| | | status: "3", |
| | | sparePartsIds: [], |
| | | }; |
| | | selectedSpareParts.value = []; |
| | |
| | | |
| | | // åå§åè¡¨åæ°æ® |
| | | const initForm = async () => { |
| | | form.value.status = "1"; |
| | | form.value.status = "3"; |
| | | // 设置æ¥ä¿®äººä¸ºå½åç¨æ·æµç§° |
| | | form.value.maintenanceName = userStore.nickName || ""; |
| | | // 设置å½åæ¥æï¼åªå
å«å¹´ææ¥ï¼ |
| | |
| | | placeholder="请è¾å
¥åä½" |
| | | disabled /> |
| | | </up-form-item> |
| | | <up-form-item label="æ°é" |
| | | <up-form-item label="æ»æ°é" |
| | | prop="quantity" |
| | | required |
| | | border-bottom> |
| | | <up-input v-model="form.quantity" |
| | | type="number" |
| | | placeholder="请è¾å
¥æ°é" |
| | | placeholder="请è¾å
¥æ»æ°é" |
| | | :disabled="processQuantityDisabled" /> |
| | | </up-form-item> |
| | | <up-form-item label="åæ ¼æ°é" |
| | | prop="qualifiedQuantity" |
| | | required |
| | | border-bottom> |
| | | <up-input v-model="form.qualifiedQuantity" |
| | | type="number" |
| | | placeholder="请è¾å
¥åæ ¼æ°é" |
| | | clearable /> |
| | | </up-form-item> |
| | | <up-form-item label="ä¸åæ ¼æ°é" |
| | | prop="unqualifiedQuantity" |
| | | required |
| | | border-bottom> |
| | | <up-input v-model="form.unqualifiedQuantity" |
| | | type="number" |
| | | placeholder="请è¾å
¥ä¸åæ ¼æ°é" |
| | | clearable /> |
| | | </up-form-item> |
| | | <up-form-item label="æ£æµåä½" |
| | | prop="checkCompany" |
| | |
| | | <up-input v-model="form.checkCompany" |
| | | placeholder="请è¾å
¥æ£æµåä½" |
| | | clearable /> |
| | | </up-form-item> |
| | | <up-form-item label="æ£æµç»æ" |
| | | prop="checkResult" |
| | | required |
| | | border-bottom> |
| | | <up-input v-model="form.checkResult" |
| | | placeholder="è¯·éæ©æ£æµç»æ" |
| | | readonly |
| | | @click="showResultSheet" /> |
| | | <template #right> |
| | | <up-icon @click="showResultSheet = true" |
| | | name="arrow-right" /> |
| | | </template> |
| | | </up-form-item> |
| | | <up-form-item label="æ£éªå" |
| | | prop="checkName" |
| | |
| | | @select="selectModel" |
| | | @close="showModelSheet = false" |
| | | title="éæ©è§æ ¼åå·" /> |
| | | <!-- æ£æµç»æéæ© --> |
| | | <up-action-sheet :show="showResultSheet" |
| | | :actions="resultSheetOptions" |
| | | @select="selectResult" |
| | | @close="showResultSheet = false" |
| | | title="éæ©æ£æµç»æ" /> |
| | | <!-- æ£éªåéæ© --> |
| | | <up-action-sheet :show="showInspectorSheet" |
| | | :actions="userSheetOptions" |
| | |
| | | const showProductTree = ref(false); |
| | | // è§æ ¼åå·éæ© |
| | | const showModelSheet = ref(false); |
| | | // æ£æµç»æéæ© |
| | | const showResultSheet = ref(false); |
| | | // æ£éªåéæ© |
| | | const showInspectorSheet = ref(false); |
| | | // ææ éæ© |
| | |
| | | testStandardId: "", |
| | | unit: "", |
| | | quantity: "", |
| | | qualifiedQuantity: "", |
| | | unqualifiedQuantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | productMainId: null, |
| | | purchaseLedgerId: null, |
| | | }); |
| | |
| | | const modelOptions = ref([]); |
| | | // æ£éªåå表 |
| | | const userList = ref([]); |
| | | // æ£æµç»æé项 |
| | | const resultOptions = ref([ |
| | | { label: "åæ ¼", value: "åæ ¼" }, |
| | | { label: "ä¸åæ ¼", value: "ä¸åæ ¼" }, |
| | | ]); |
| | | // ææ é项 |
| | | const testStandardOptions = ref([]); |
| | | // å½å产åID |
| | |
| | | return modelOptions.value.map(item => ({ |
| | | name: item.model, |
| | | value: item.id, |
| | | })); |
| | | }); |
| | | |
| | | const resultSheetOptions = computed(() => { |
| | | return resultOptions.value.map(item => ({ |
| | | name: item.label, |
| | | value: item.value, |
| | | })); |
| | | }); |
| | | |
| | |
| | | ], |
| | | unit: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | quantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | qualifiedQuantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | unqualifiedQuantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkCompany: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkResult: [ |
| | | { required: true, message: "è¯·éæ©æ£æµç»æ", trigger: "change" }, |
| | | ], |
| | | }; |
| | | |
| | | // æ¯å¦ä¸ºç¼è¾æ¨¡å¼ |
| | |
| | | modelOptions.value.find(item => item.id == value)?.model || ""; |
| | | form.value.unit = |
| | | modelOptions.value.find(item => item.id == value)?.unit || ""; |
| | | }; |
| | | |
| | | // éæ©æ£æµç»æ |
| | | const selectResult = e => { |
| | | form.value.checkResult = e.value; |
| | | showResultSheet.value = false; |
| | | }; |
| | | |
| | | // éæ©æ£éªå |
| | |
| | | // return; |
| | | // } |
| | | if (!form.value.quantity) { |
| | | showToast("请è¾å
¥æ°é"); |
| | | showToast("请è¾å
¥æ»æ°é"); |
| | | return; |
| | | } |
| | | if (!form.value.qualifiedQuantity && form.value.qualifiedQuantity !== 0) { |
| | | showToast("请è¾å
¥åæ ¼æ°é"); |
| | | return; |
| | | } |
| | | if (!form.value.unqualifiedQuantity && form.value.unqualifiedQuantity !== 0) { |
| | | showToast("请è¾å
¥ä¸åæ ¼æ°é"); |
| | | return; |
| | | } |
| | | if (!form.value.productId) { |
| | |
| | | showToast("è¯·éæ©ææ "); |
| | | return; |
| | | } |
| | | if (!form.value.checkResult) { |
| | | showToast("è¯·éæ©æ£æµç»æ"); |
| | | return; |
| | | } |
| | | |
| | | loading.value = true; |
| | | |
| | | form.value.inspectType = 2; |
| | |
| | | |
| | | const data = { ...form.value, qualityInspectParams: tableData.value }; |
| | | data.quantity = Number(data.quantity); |
| | | data.qualifiedQuantity = Number(data.qualifiedQuantity); |
| | | data.unqualifiedQuantity = Number(data.unqualifiedQuantity); |
| | | if (isEdit.value) { |
| | | const res = await qualityInspectUpdate(data); |
| | | showToast("ä¿åæå"); |
| | |
| | | unit: "", |
| | | quantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | qualifiedQuantity: "", |
| | | unqualifiedQuantity: "", |
| | | productMainId: null, |
| | | purchaseLedgerId: null, |
| | | }; |
| | |
| | | unit: "kg", |
| | | quantity: 1000, |
| | | checkCompany: "ç¬¬ä¸æ¹æ£æµæºæ", |
| | | checkResult: "åæ ¼", |
| | | qualifiedQuantity: 0, |
| | | unqualifiedQuantity: 0, |
| | | productMainId: null, |
| | | purchaseLedgerId: null, |
| | | }; |
| | |
| | | testStandardId: "", |
| | | unit: "", |
| | | quantity: "", |
| | | qualifiedQuantity: "", |
| | | unqualifiedQuantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | productMainId: null, |
| | | purchaseLedgerId: null, |
| | | }; |
| | |
| | | </view> |
| | | <text class="header-title">{{ detailData.productName || '-' }}</text> |
| | | <view class="status-tags"> |
| | | <u-tag v-if="detailData.checkResult" |
| | | :type="getTagType(detailData.checkResult)" |
| | | <u-tag v-if="detailData.passRate != null && detailData.passRate !== ''" |
| | | type="primary" |
| | | size="small" |
| | | class="status-tag"> |
| | | {{ detailData.checkResult || '-' }} |
| | | åæ ¼ç {{ formatPassRate(detailData.passRate) }} |
| | | </u-tag> |
| | | <u-tag :type="getStateTagType(detailData.inspectState)" |
| | | size="small" |
| | |
| | | <text class="detail-value">{{ detailData.unit || '-' }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">æ°é</text> |
| | | <text class="detail-value">{{ detailData.quantity || 0 }}</text> |
| | | <text class="detail-label">æ»æ°é</text> |
| | | <text class="detail-value">{{ detailData.quantity ?? 0 }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">åæ ¼æ°é</text> |
| | | <text class="detail-value">{{ detailData.qualifiedQuantity ?? 0 }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">ä¸åæ ¼æ°é</text> |
| | | <text class="detail-value">{{ detailData.unqualifiedQuantity ?? 0 }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">åæ ¼ç</text> |
| | | <text class="detail-value">{{ formatPassRate(detailData.passRate) }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">æ£æµåä½</text> |
| | |
| | | }; |
| | | |
| | | // è·åæ ç¾ç±»å |
| | | const getTagType = result => { |
| | | switch (result) { |
| | | case "åæ ¼": |
| | | return "success"; |
| | | case "ä¸åæ ¼": |
| | | return "error"; |
| | | default: |
| | | return "info"; |
| | | } |
| | | 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}%`; |
| | | }; |
| | | |
| | | // è·åç¶ææ ç¾ç±»å |
| | |
| | | </view> |
| | | </view> |
| | | <view class="status-tags"> |
| | | <u-tag v-if="item.checkResult" |
| | | :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" |
| | |
| | | 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; |
| | |
| | | placeholder="请è¾å
¥åä½" |
| | | disabled /> |
| | | </up-form-item> |
| | | <up-form-item label="æ°é" |
| | | <up-form-item label="æ»æ°é" |
| | | prop="quantity" |
| | | required |
| | | border-bottom> |
| | | <up-input v-model="form.quantity" |
| | | type="number" |
| | | placeholder="请è¾å
¥æ°é" |
| | | placeholder="请è¾å
¥æ»æ°é" |
| | | :disabled="supplierQuantityDisabled" /> |
| | | </up-form-item> |
| | | <up-form-item label="åæ ¼æ°é" |
| | | prop="qualifiedQuantity" |
| | | required |
| | | border-bottom> |
| | | <up-input v-model="form.qualifiedQuantity" |
| | | type="number" |
| | | placeholder="请è¾å
¥åæ ¼æ°é" |
| | | clearable /> |
| | | </up-form-item> |
| | | <up-form-item label="ä¸åæ ¼æ°é" |
| | | prop="unqualifiedQuantity" |
| | | required |
| | | border-bottom> |
| | | <up-input v-model="form.unqualifiedQuantity" |
| | | type="number" |
| | | placeholder="请è¾å
¥ä¸åæ ¼æ°é" |
| | | clearable /> |
| | | </up-form-item> |
| | | <up-form-item label="æ£æµåä½" |
| | | prop="checkCompany" |
| | |
| | | <up-input v-model="form.checkCompany" |
| | | placeholder="请è¾å
¥æ£æµåä½" |
| | | clearable /> |
| | | </up-form-item> |
| | | <up-form-item label="æ£æµç»æ" |
| | | prop="checkResult" |
| | | required |
| | | border-bottom> |
| | | <up-input v-model="form.checkResult" |
| | | placeholder="è¯·éæ©æ£æµç»æ" |
| | | readonly |
| | | @click="showResultSheet" /> |
| | | <template #right> |
| | | <up-icon @click="showResultSheet = true" |
| | | name="arrow-right" /> |
| | | </template> |
| | | </up-form-item> |
| | | <up-form-item label="æ£éªå" |
| | | prop="checkName" |
| | |
| | | @select="selectModel" |
| | | @close="showModelSheet = false" |
| | | title="éæ©è§æ ¼åå·" /> |
| | | <!-- æ£æµç»æéæ© --> |
| | | <up-action-sheet :show="showResultSheet" |
| | | :actions="resultSheetOptions" |
| | | @select="selectResult" |
| | | @close="showResultSheet = false" |
| | | title="éæ©æ£æµç»æ" /> |
| | | <!-- æ£éªåéæ© --> |
| | | <up-action-sheet :show="showInspectorSheet" |
| | | :actions="userSheetOptions" |
| | |
| | | const showProductTree = ref(false); |
| | | // è§æ ¼åå·éæ© |
| | | const showModelSheet = ref(false); |
| | | // æ£æµç»æéæ© |
| | | const showResultSheet = ref(false); |
| | | // æ£éªåéæ© |
| | | const showInspectorSheet = ref(false); |
| | | // ææ éæ© |
| | |
| | | testStandardId: "", |
| | | unit: "", |
| | | quantity: "", |
| | | qualifiedQuantity: "", |
| | | unqualifiedQuantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | productMainId: null, |
| | | purchaseLedgerId: null, |
| | | }); |
| | |
| | | const modelOptions = ref([]); |
| | | // æ£éªåå表 |
| | | const userList = ref([]); |
| | | // æ£æµç»æé项 |
| | | const resultOptions = ref([ |
| | | { label: "åæ ¼", value: "åæ ¼" }, |
| | | { label: "ä¸åæ ¼", value: "ä¸åæ ¼" }, |
| | | ]); |
| | | // ææ é项 |
| | | const testStandardOptions = ref([]); |
| | | // å½å产åID |
| | |
| | | return modelOptions.value.map(item => ({ |
| | | name: item.model, |
| | | value: item.id, |
| | | })); |
| | | }); |
| | | |
| | | const resultSheetOptions = computed(() => { |
| | | return resultOptions.value.map(item => ({ |
| | | name: item.label, |
| | | value: item.value, |
| | | })); |
| | | }); |
| | | |
| | |
| | | ], |
| | | unit: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | quantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | qualifiedQuantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | unqualifiedQuantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkCompany: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkResult: [ |
| | | { required: true, message: "è¯·éæ©æ£æµç»æ", trigger: "change" }, |
| | | ], |
| | | }; |
| | | |
| | | // æ¯å¦ä¸ºç¼è¾æ¨¡å¼ |
| | |
| | | modelOptions.value.find(item => item.id == value)?.model || ""; |
| | | form.value.unit = |
| | | modelOptions.value.find(item => item.id == value)?.unit || ""; |
| | | }; |
| | | |
| | | // éæ©æ£æµç»æ |
| | | const selectResult = e => { |
| | | form.value.checkResult = e.value; |
| | | showResultSheet.value = false; |
| | | }; |
| | | |
| | | // éæ©æ£éªå |
| | |
| | | return; |
| | | } |
| | | if (!form.value.quantity) { |
| | | showToast("请è¾å
¥æ°é"); |
| | | showToast("请è¾å
¥æ»æ°é"); |
| | | return; |
| | | } |
| | | if (!form.value.qualifiedQuantity && form.value.qualifiedQuantity !== 0) { |
| | | showToast("请è¾å
¥åæ ¼æ°é"); |
| | | return; |
| | | } |
| | | if (!form.value.unqualifiedQuantity && form.value.unqualifiedQuantity !== 0) { |
| | | showToast("请è¾å
¥ä¸åæ ¼æ°é"); |
| | | return; |
| | | } |
| | | if (!form.value.productId) { |
| | |
| | | showToast("è¯·éæ©ææ "); |
| | | return; |
| | | } |
| | | if (!form.value.checkResult) { |
| | | showToast("è¯·éæ©æ£æµç»æ"); |
| | | return; |
| | | } |
| | | |
| | | loading.value = true; |
| | | |
| | | form.value.inspectType = 0; |
| | |
| | | |
| | | const data = { ...form.value, qualityInspectParams: tableData.value }; |
| | | data.quantity = Number(data.quantity); |
| | | data.qualifiedQuantity = Number(data.qualifiedQuantity); |
| | | data.unqualifiedQuantity = Number(data.unqualifiedQuantity); |
| | | if (isEdit.value) { |
| | | const res = await qualityInspectUpdate(data); |
| | | showToast("ä¿åæå"); |
| | |
| | | unit: "", |
| | | quantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | qualifiedQuantity: "", |
| | | unqualifiedQuantity: "", |
| | | productMainId: null, |
| | | purchaseLedgerId: null, |
| | | }; |
| | |
| | | unit: "kg", |
| | | quantity: 1000, |
| | | checkCompany: "ç¬¬ä¸æ¹æ£æµæºæ", |
| | | checkResult: "åæ ¼", |
| | | qualifiedQuantity: 0, |
| | | unqualifiedQuantity: 0, |
| | | productMainId: null, |
| | | purchaseLedgerId: null, |
| | | }; |
| | |
| | | testStandardId: "", |
| | | unit: "", |
| | | quantity: "", |
| | | qualifiedQuantity: "", |
| | | unqualifiedQuantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | productMainId: null, |
| | | purchaseLedgerId: null, |
| | | }; |
| | |
| | | </view> |
| | | <text class="header-title">{{ detailData.productName || '-' }}</text> |
| | | <view class="status-tags"> |
| | | <u-tag v-if="detailData.checkResult" |
| | | :type="getTagType(detailData.checkResult)" |
| | | <u-tag v-if="detailData.passRate != null && detailData.passRate !== ''" |
| | | type="primary" |
| | | size="small" |
| | | class="status-tag"> |
| | | {{ detailData.checkResult || '-' }} |
| | | åæ ¼ç {{ formatPassRate(detailData.passRate) }} |
| | | </u-tag> |
| | | <u-tag :type="getStateTagType(detailData.inspectState)" |
| | | size="small" |
| | |
| | | <text class="detail-value">{{ detailData.unit || '-' }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">æ°é</text> |
| | | <text class="detail-value">{{ detailData.quantity || 0 }}</text> |
| | | <text class="detail-label">æ»æ°é</text> |
| | | <text class="detail-value">{{ detailData.quantity ?? 0 }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">åæ ¼æ°é</text> |
| | | <text class="detail-value">{{ detailData.qualifiedQuantity ?? 0 }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">ä¸åæ ¼æ°é</text> |
| | | <text class="detail-value">{{ detailData.unqualifiedQuantity ?? 0 }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">åæ ¼ç</text> |
| | | <text class="detail-value">{{ formatPassRate(detailData.passRate) }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">æ£æµåä½</text> |
| | |
| | | return dayjs(date).format("YYYY-MM-DD"); |
| | | }; |
| | | |
| | | // è·åæ ç¾ç±»å |
| | | const getTagType = result => { |
| | | switch (result) { |
| | | case "åæ ¼": |
| | | return "success"; |
| | | case "ä¸åæ ¼": |
| | | return "error"; |
| | | default: |
| | | return "info"; |
| | | } |
| | | // æ ¼å¼ååæ ¼ç |
| | | 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}%`; |
| | | }; |
| | | |
| | | // è·åç¶ææ ç¾ç±»å |
| | |
| | | </view> |
| | | </view> |
| | | <view class="status-tags"> |
| | | <u-tag v-if="item.checkResult" |
| | | :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" |
| | |
| | | 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; |
| | |
| | | placeholder="请è¾å
¥åä½" |
| | | disabled /> |
| | | </up-form-item> |
| | | <up-form-item label="æ°é" |
| | | <up-form-item label="æ»æ°é" |
| | | prop="quantity" |
| | | required |
| | | border-bottom> |
| | | <up-input v-model="form.quantity" |
| | | type="number" |
| | | placeholder="请è¾å
¥æ°é" |
| | | placeholder="请è¾å
¥æ»æ°é" |
| | | :disabled="processQuantityDisabled" /> |
| | | </up-form-item> |
| | | <up-form-item label="åæ ¼æ°é" |
| | | prop="qualifiedQuantity" |
| | | required |
| | | border-bottom> |
| | | <up-input v-model="form.qualifiedQuantity" |
| | | type="number" |
| | | placeholder="请è¾å
¥åæ ¼æ°é" |
| | | clearable /> |
| | | </up-form-item> |
| | | <up-form-item label="ä¸åæ ¼æ°é" |
| | | prop="unqualifiedQuantity" |
| | | required |
| | | border-bottom> |
| | | <up-input v-model="form.unqualifiedQuantity" |
| | | type="number" |
| | | placeholder="请è¾å
¥ä¸åæ ¼æ°é" |
| | | clearable /> |
| | | </up-form-item> |
| | | <up-form-item label="æ£æµåä½" |
| | | prop="checkCompany" |
| | |
| | | <up-input v-model="form.checkCompany" |
| | | placeholder="请è¾å
¥æ£æµåä½" |
| | | clearable /> |
| | | </up-form-item> |
| | | <up-form-item label="æ£æµç»æ" |
| | | prop="checkResult" |
| | | required |
| | | border-bottom> |
| | | <up-input v-model="form.checkResult" |
| | | placeholder="è¯·éæ©æ£æµç»æ" |
| | | readonly |
| | | @click="showResultSheet" /> |
| | | <template #right> |
| | | <up-icon @click="showResultSheet = true" |
| | | name="arrow-right" /> |
| | | </template> |
| | | </up-form-item> |
| | | <up-form-item label="æ£éªå" |
| | | prop="checkName" |
| | |
| | | @select="selectModel" |
| | | @close="showModelSheet = false" |
| | | title="éæ©è§æ ¼åå·" /> |
| | | <!-- æ£æµç»æéæ© --> |
| | | <up-action-sheet :show="showResultSheet" |
| | | :actions="resultSheetOptions" |
| | | @select="selectResult" |
| | | @close="showResultSheet = false" |
| | | title="éæ©æ£æµç»æ" /> |
| | | <!-- æ£éªåéæ© --> |
| | | <up-action-sheet :show="showInspectorSheet" |
| | | :actions="userSheetOptions" |
| | |
| | | const showProductTree = ref(false); |
| | | // è§æ ¼åå·éæ© |
| | | const showModelSheet = ref(false); |
| | | // æ£æµç»æéæ© |
| | | const showResultSheet = ref(false); |
| | | // æ£éªåéæ© |
| | | const showInspectorSheet = ref(false); |
| | | // ææ éæ© |
| | |
| | | testStandardId: "", |
| | | unit: "", |
| | | quantity: "", |
| | | qualifiedQuantity: "", |
| | | unqualifiedQuantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | productMainId: null, |
| | | purchaseLedgerId: null, |
| | | }); |
| | |
| | | const modelOptions = ref([]); |
| | | // æ£éªåå表 |
| | | const userList = ref([]); |
| | | // æ£æµç»æé项 |
| | | const resultOptions = ref([ |
| | | { label: "åæ ¼", value: "åæ ¼" }, |
| | | { label: "ä¸åæ ¼", value: "ä¸åæ ¼" }, |
| | | ]); |
| | | // ææ é项 |
| | | const testStandardOptions = ref([]); |
| | | // å½å产åID |
| | |
| | | return modelOptions.value.map(item => ({ |
| | | name: item.model, |
| | | value: item.id, |
| | | })); |
| | | }); |
| | | |
| | | const resultSheetOptions = computed(() => { |
| | | return resultOptions.value.map(item => ({ |
| | | name: item.label, |
| | | value: item.value, |
| | | })); |
| | | }); |
| | | |
| | |
| | | ], |
| | | unit: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | quantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | qualifiedQuantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | unqualifiedQuantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkCompany: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkResult: [ |
| | | { required: true, message: "è¯·éæ©æ£æµç»æ", trigger: "change" }, |
| | | ], |
| | | }; |
| | | |
| | | // æ¯å¦ä¸ºç¼è¾æ¨¡å¼ |
| | |
| | | modelOptions.value.find(item => item.id == value)?.model || ""; |
| | | form.value.unit = |
| | | modelOptions.value.find(item => item.id == value)?.unit || ""; |
| | | }; |
| | | |
| | | // éæ©æ£æµç»æ |
| | | const selectResult = e => { |
| | | form.value.checkResult = e.value; |
| | | showResultSheet.value = false; |
| | | }; |
| | | |
| | | // éæ©æ£éªå |
| | |
| | | return; |
| | | } |
| | | if (!form.value.quantity) { |
| | | showToast("请è¾å
¥æ°é"); |
| | | showToast("请è¾å
¥æ»æ°é"); |
| | | return; |
| | | } |
| | | if (!form.value.qualifiedQuantity && form.value.qualifiedQuantity !== 0) { |
| | | showToast("请è¾å
¥åæ ¼æ°é"); |
| | | return; |
| | | } |
| | | if (!form.value.unqualifiedQuantity && form.value.unqualifiedQuantity !== 0) { |
| | | showToast("请è¾å
¥ä¸åæ ¼æ°é"); |
| | | return; |
| | | } |
| | | if (!form.value.productId) { |
| | |
| | | showToast("è¯·éæ©ææ "); |
| | | return; |
| | | } |
| | | if (!form.value.checkResult) { |
| | | showToast("è¯·éæ©æ£æµç»æ"); |
| | | return; |
| | | } |
| | | |
| | | loading.value = true; |
| | | |
| | | form.value.inspectType = 1; |
| | |
| | | |
| | | const data = { ...form.value, qualityInspectParams: tableData.value }; |
| | | data.quantity = Number(data.quantity); |
| | | data.qualifiedQuantity = Number(data.qualifiedQuantity); |
| | | data.unqualifiedQuantity = Number(data.unqualifiedQuantity); |
| | | if (isEdit.value) { |
| | | const res = await qualityInspectUpdate(data); |
| | | showToast("ä¿åæå"); |
| | |
| | | unit: "", |
| | | quantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | qualifiedQuantity: "", |
| | | unqualifiedQuantity: "", |
| | | productMainId: null, |
| | | purchaseLedgerId: null, |
| | | }; |
| | |
| | | unit: "kg", |
| | | quantity: 1000, |
| | | checkCompany: "ç¬¬ä¸æ¹æ£æµæºæ", |
| | | checkResult: "åæ ¼", |
| | | qualifiedQuantity: 0, |
| | | unqualifiedQuantity: 0, |
| | | productMainId: null, |
| | | purchaseLedgerId: null, |
| | | }; |
| | |
| | | testStandardId: "", |
| | | unit: "", |
| | | quantity: "", |
| | | qualifiedQuantity: "", |
| | | unqualifiedQuantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | productMainId: null, |
| | | purchaseLedgerId: null, |
| | | }; |
| | |
| | | </view> |
| | | <text class="header-title">{{ detailData.productName || '-' }}</text> |
| | | <view class="status-tags"> |
| | | <u-tag v-if="detailData.checkResult" |
| | | :type="getTagType(detailData.checkResult)" |
| | | <u-tag v-if="detailData.passRate != null && detailData.passRate !== ''" |
| | | type="primary" |
| | | size="small" |
| | | class="status-tag"> |
| | | {{ detailData.checkResult }} |
| | | åæ ¼ç {{ formatPassRate(detailData.passRate) }} |
| | | </u-tag> |
| | | <u-tag :type="getStateTagType(detailData.inspectState)" |
| | | size="small" |
| | |
| | | <text class="detail-value">{{ detailData.unit || '-' }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">æ°é</text> |
| | | <text class="detail-value">{{ detailData.quantity || 0 }}</text> |
| | | <text class="detail-label">æ»æ°é</text> |
| | | <text class="detail-value">{{ detailData.quantity ?? 0 }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">åæ ¼æ°é</text> |
| | | <text class="detail-value">{{ detailData.qualifiedQuantity ?? 0 }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">ä¸åæ ¼æ°é</text> |
| | | <text class="detail-value">{{ detailData.unqualifiedQuantity ?? 0 }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">åæ ¼ç</text> |
| | | <text class="detail-value">{{ formatPassRate(detailData.passRate) }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">æ£æµåä½</text> |
| | |
| | | }; |
| | | |
| | | // è·åæ ç¾ç±»å |
| | | const getTagType = result => { |
| | | switch (result) { |
| | | case "åæ ¼": |
| | | return "success"; |
| | | case "ä¸åæ ¼": |
| | | return "error"; |
| | | default: |
| | | return "info"; |
| | | } |
| | | 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}%`; |
| | | }; |
| | | |
| | | // è·åç¶ææ ç¾ç±»å |
| | |
| | | </view> |
| | | </view> |
| | | <view class="status-tags"> |
| | | <u-tag v-if="item.checkResult" |
| | | :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" |
| | |
| | | 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; |