From 3ea1ff641e1c680a5a1727fb4034797bfe65d93e Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 18 三月 2026 15:29:17 +0800
Subject: [PATCH] fix: 质量、耗材物流
---
src/pages/qualityManagement/InspectItem/index.vue | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/src/pages/qualityManagement/InspectItem/index.vue b/src/pages/qualityManagement/InspectItem/index.vue
index 92ae99c..822abb6 100644
--- a/src/pages/qualityManagement/InspectItem/index.vue
+++ b/src/pages/qualityManagement/InspectItem/index.vue
@@ -64,7 +64,7 @@
<view class="dialog-header">
<text class="dialog-title">{{ operationType === 'add' ? '鏂板妫�娴嬮」鐩�' : '淇敼妫�娴嬮」鐩�' }}</text>
</view>
- <up-form :model="form" ref="formRef" label-width="100" label-position="top">
+ <up-form :model="form" :rules="rules" ref="formRef" label-width="100" label-position="top">
<up-form-item label="妫�娴嬮」鐩�" prop="name" required borderBottom>
<up-input v-model="form.name" placeholder="璇疯緭鍏ユ娴嬮」鐩悕绉�" border="surround" />
</up-form-item>
@@ -204,25 +204,27 @@
dialogVisible.value = false;
};
-const submitForm = () => {
- formRef.value.validate().then(res => {
- submitLoading.value = true;
- qualityInspectItemSave(form).then(() => {
+const submitForm = async () => {
+ if (!formRef.value) return
+ const valid = await formRef.value.validate().catch(() => false)
+ if (!valid) return
+ submitLoading.value = true;
+ qualityInspectItemSave(form)
+ .then(() => {
toast(operationType.value === 'add' ? '鏂板鎴愬姛' : '淇敼鎴愬姛');
dialogVisible.value = false;
handleQuery();
- }).finally(() => {
+ })
+ .finally(() => {
submitLoading.value = false;
});
- }).catch(errors => {
- console.log('楠岃瘉澶辫触', errors);
- });
};
const handleDelete = (row) => {
showConfirm('纭鍒犻櫎璇ユ娴嬮」鐩悧锛�').then(res => {
if (res.confirm) {
- qualityInspectItemDelete({ id: row.id }).then(() => {
+ // 瀵归綈 PC 绔細鍒犻櫎鎺ュ彛鎺ユ敹 id 鏁扮粍
+ qualityInspectItemDelete([row.id]).then(() => {
toast('鍒犻櫎鎴愬姛');
handleQuery();
});
--
Gitblit v1.9.3