From 50f0b958546caee7f929b28c1f5ad0daa2637751 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 25 三月 2026 09:01:14 +0800
Subject: [PATCH] fix: 优化质量管理
---
src/pages/consumablesLogistics/stockReport/index.vue | 8 ++++
src/pages/qualityManagement/nonconformingManagement/form.vue | 55 ++++++++++++++++++++++++++-
src/pages/inventoryManagement/stockReport/index.vue | 8 ++++
src/pages/qualityManagement/nonconformingManagement/index.vue | 20 +++++++---
4 files changed, 82 insertions(+), 9 deletions(-)
diff --git a/src/pages/consumablesLogistics/stockReport/index.vue b/src/pages/consumablesLogistics/stockReport/index.vue
index 175c151..efbe3b2 100644
--- a/src/pages/consumablesLogistics/stockReport/index.vue
+++ b/src/pages/consumablesLogistics/stockReport/index.vue
@@ -252,6 +252,10 @@
openDatePicker("endMonth");
}, 300);
} else if (datePickerTarget.value === "endMonth") {
+ if (searchForm.value.startMonth && !dayjs(`${str}-01`).isAfter(dayjs(`${searchForm.value.startMonth}-01`))) {
+ uni.showToast({ title: "缁撴潫鏈堜唤蹇呴』澶т簬寮�濮嬫湀浠�", icon: "none" });
+ return;
+ }
searchForm.value.endMonth = str;
showDatePicker.value = false;
handleQuery();
@@ -262,6 +266,10 @@
openDatePicker("endDate");
}, 300);
} else if (datePickerTarget.value === "endDate") {
+ if (searchForm.value.startDate && !dayjs(str).isAfter(dayjs(searchForm.value.startDate))) {
+ uni.showToast({ title: "缁撴潫鏃ユ湡蹇呴』澶т簬寮�濮嬫棩鏈�", icon: "none" });
+ return;
+ }
searchForm.value.endDate = str;
showDatePicker.value = false;
handleQuery();
diff --git a/src/pages/inventoryManagement/stockReport/index.vue b/src/pages/inventoryManagement/stockReport/index.vue
index eba56c3..52b4783 100644
--- a/src/pages/inventoryManagement/stockReport/index.vue
+++ b/src/pages/inventoryManagement/stockReport/index.vue
@@ -274,6 +274,10 @@
openDatePicker('endMonth')
}, 300)
} else if (datePickerTarget.value === 'endMonth') {
+ if (searchForm.value.startMonth && !dayjs(`${str}-01`).isAfter(dayjs(`${searchForm.value.startMonth}-01`))) {
+ uni.showToast({ title: '缁撴潫鏈堜唤蹇呴』澶т簬寮�濮嬫湀浠�', icon: 'none' })
+ return
+ }
searchForm.value.endMonth = str
showDatePicker.value = false
handleQuery()
@@ -285,6 +289,10 @@
openDatePicker('endDate')
}, 300)
} else if (datePickerTarget.value === 'endDate') {
+ if (searchForm.value.startDate && !dayjs(str).isAfter(dayjs(searchForm.value.startDate))) {
+ uni.showToast({ title: '缁撴潫鏃ユ湡蹇呴』澶т簬寮�濮嬫棩鏈�', icon: 'none' })
+ return
+ }
searchForm.value.endDate = str
showDatePicker.value = false
handleQuery()
diff --git a/src/pages/qualityManagement/nonconformingManagement/form.vue b/src/pages/qualityManagement/nonconformingManagement/form.vue
index a28ae54..f13702b 100644
--- a/src/pages/qualityManagement/nonconformingManagement/form.vue
+++ b/src/pages/qualityManagement/nonconformingManagement/form.vue
@@ -189,6 +189,7 @@
const pageType = ref('add') // add | edit
const id = ref('')
const submitting = ref(false)
+const editFallback = ref({})
const isEdit = computed(() => pageType.value === 'edit')
const pageTitle = computed(() => (isEdit.value ? '缂栬緫涓嶅悎鏍肩鐞�' : '鏂板涓嶅悎鏍肩鐞�'))
@@ -366,6 +367,46 @@
if (!id.value) return
const res = await getQualityUnqualifiedInfo(id.value)
const d = res?.data || {}
+ const rawCheckType =
+ d.checkType ??
+ d.inspectType ??
+ d.check_type ??
+ d.inspect_type ??
+ d.checkTypeLabel ??
+ d.inspectTypeLabel
+ let normalizedCheckType = undefined
+ if (!(rawCheckType === undefined || rawCheckType === null || rawCheckType === '')) {
+ const rawText = String(rawCheckType).trim()
+ if (rawText === '鍏ュ巶妫�') normalizedCheckType = 0
+ else if (rawText === '杞﹂棿妫�') normalizedCheckType = 1
+ else if (rawText === '鍑哄巶妫�') normalizedCheckType = 2
+ else {
+ const n = Number(rawText)
+ normalizedCheckType = Number.isNaN(n) ? undefined : n
+ }
+ }
+ const normalizedBatchNo =
+ d.batchNo ??
+ d.batchNO ??
+ d.batchNum ??
+ d.batchNumber ??
+ d.batch ??
+ d.inboundBatches ??
+ d.lotNo ??
+ d.lotNumber ??
+ editFallback.value?.batchNo ??
+ ''
+ const fallbackCheckTypeRaw = editFallback.value?.checkType
+ if (normalizedCheckType === undefined && !(fallbackCheckTypeRaw === undefined || fallbackCheckTypeRaw === null || fallbackCheckTypeRaw === '')) {
+ const fallbackText = String(fallbackCheckTypeRaw).trim()
+ if (fallbackText === '鍏ュ巶妫�') normalizedCheckType = 0
+ else if (fallbackText === '杞﹂棿妫�') normalizedCheckType = 1
+ else if (fallbackText === '鍑哄巶妫�') normalizedCheckType = 2
+ else {
+ const n = Number(fallbackText)
+ normalizedCheckType = Number.isNaN(n) ? undefined : n
+ }
+ }
Object.assign(form, {
id: d.id,
productId: d.productId,
@@ -373,9 +414,10 @@
productModelId: d.productModelId ?? d.modelId ?? d.productModeId ?? '',
model: d.model,
unit: d.unit,
- batchNo: d.batchNo,
- // 鍏煎鍚庣杩斿洖瀛楁锛氫紭鍏� checkType锛屽叾娆� inspectType
- checkType: d.checkType ?? d.inspectType,
+ // 鍏煎鍚庣杩斿洖瀛楁锛歜atchNo/batchNum/lotNo 绛�
+ batchNo: normalizedBatchNo,
+ // 鍏煎鍚庣杩斿洖瀛楁锛歝heckType/inspectType 绛夛紝缁熶竴涓� number
+ checkType: normalizedCheckType,
checkName: d.checkName,
checkTime: d.checkTime,
defectivePhenomena: d.defectivePhenomena,
@@ -423,6 +465,13 @@
onLoad(async (options) => {
pageType.value = options?.type || 'add'
id.value = options?.id || ''
+ if (options?.fallback) {
+ try {
+ editFallback.value = JSON.parse(decodeURIComponent(options.fallback))
+ } catch (e) {
+ editFallback.value = {}
+ }
+ }
form.dealResult = getScrapDealResultValue()
await loadUsers()
if (isEdit.value) {
diff --git a/src/pages/qualityManagement/nonconformingManagement/index.vue b/src/pages/qualityManagement/nonconformingManagement/index.vue
index ca100c8..41e5478 100644
--- a/src/pages/qualityManagement/nonconformingManagement/index.vue
+++ b/src/pages/qualityManagement/nonconformingManagement/index.vue
@@ -377,14 +377,22 @@
};
const openForm = (type, row) => {
- if (type === 'edit' && !hasNonconformingEdit.value) return
- if (type !== 'add' && row?.inspectState == 1) {
- toast('宸插鐞嗙殑鏁版嵁涓嶈兘鍐嶇紪杈�')
- return
- }
+ // if (type === 'edit' && !hasNonconformingEdit.value) return
+ // if (type !== 'add' && row?.inspectState == 1) {
+ // toast('宸插鐞嗙殑鏁版嵁涓嶈兘鍐嶇紪杈�')
+ // return
+ // }
const id = row?.id
+ let fallback = ''
+ if (row) {
+ const fallbackData = {
+ batchNo: row.batchNo ?? '',
+ checkType: row.checkType ?? row.inspectType ?? ''
+ }
+ fallback = `&fallback=${encodeURIComponent(JSON.stringify(fallbackData))}`
+ }
uni.navigateTo({
- url: `/pages/qualityManagement/nonconformingManagement/form?type=${type}${id ? `&id=${id}` : ''}`
+ url: `/pages/qualityManagement/nonconformingManagement/form?type=${type}${id ? `&id=${id}` : ''}${fallback}`
})
}
--
Gitblit v1.9.3