From b25e11bb1e76255b4c05e10022e1ca9be5c7cc99 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 19 三月 2026 16:53:56 +0800
Subject: [PATCH] 库存报表加日期选择

---
 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