From c52a0824baaa86a719da04fba3ff65fc48a70422 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期四, 19 三月 2026 17:37:05 +0800
Subject: [PATCH] fix: 入库数量必填

---
 src/pages/consumablesLogistics/stockManagement/add.vue |   36 ++++++++++++++----
 src/pages/inventoryManagement/stockManagement/add.vue  |   31 +++++++++++++--
 2 files changed, 54 insertions(+), 13 deletions(-)

diff --git a/src/pages/consumablesLogistics/stockManagement/add.vue b/src/pages/consumablesLogistics/stockManagement/add.vue
index 38f9711..9df1db0 100644
--- a/src/pages/consumablesLogistics/stockManagement/add.vue
+++ b/src/pages/consumablesLogistics/stockManagement/add.vue
@@ -26,23 +26,23 @@
       <view class="form-section">
         <view class="section-title">杩囩淇℃伅</view>
         <view class="form-row">
-          <text class="form-label">杞︾墝鍙�</text>
+          <text class="form-label required">杞︾墝鍙�</text>
           <up-input v-model="form.licensePlateNo" placeholder="璇疯緭鍏ヨ溅鐗屽彿" />
         </view>
         <view class="form-row">
-          <text class="form-label">姣涢噸(鍚�)</text>
-          <up-input v-model="form.grossWeight" type="number" placeholder="璇疯緭鍏ユ瘺閲�" />
+          <text class="form-label required">姣涢噸(鍚�)</text>
+          <up-input v-model="form.grossWeight" type="digit" placeholder="璇疯緭鍏ユ瘺閲�" />
         </view>
         <view class="form-row">
-          <text class="form-label">鐨噸(鍚�)</text>
-          <up-input v-model="form.tareWeight" type="number" placeholder="璇疯緭鍏ョ毊閲�" />
+          <text class="form-label required">鐨噸(鍚�)</text>
+          <up-input v-model="form.tareWeight" type="digit" placeholder="璇疯緭鍏ョ毊閲�" />
         </view>
         <view class="form-row">
           <text class="form-label">鍑�閲�(鍚�)</text>
-          <up-input v-model="form.netWeight" type="number" disabled placeholder="鑷姩璁$畻" />
+          <up-input v-model="form.netWeight" type="digit" disabled placeholder="鑷姩璁$畻" />
         </view>
         <view class="form-row">
-          <text class="form-label">杩囩鏃ユ湡</text>
+          <text class="form-label required">杩囩鏃ユ湡</text>
           <view class="selector-trigger" @click="openWeighingDatePicker">
             <text class="selector-text" :class="{ placeholder: !form.weighingDate }">
               {{ form.weighingDate || "璇烽�夋嫨杩囩鏃ユ湡" }}
@@ -51,7 +51,7 @@
           </view>
         </view>
         <view class="form-row">
-          <text class="form-label">杩囩鍛�</text>
+          <text class="form-label required">杩囩鍛�</text>
           <up-input v-model="form.weighingOperator" placeholder="璇疯緭鍏ヨ繃纾呭憳" />
         </view>
       </view>
@@ -220,6 +220,26 @@
     uni.showToast({ title: "璇烽�夋嫨浜у搧", icon: "none" });
     return;
   }
+  if (!form.licensePlateNo) {
+    uni.showToast({ title: "璇疯緭鍏ヨ溅鐗屽彿", icon: "none" });
+    return;
+  }
+  if (!form.grossWeight || Number(form.grossWeight) <= 0) {
+    uni.showToast({ title: "璇疯緭鍏ユ瘺閲�", icon: "none" });
+    return;
+  }
+  if (!form.tareWeight || Number(form.tareWeight) <= 0) {
+    uni.showToast({ title: "璇疯緭鍏ョ毊閲�", icon: "none" });
+    return;
+  }
+  if (!form.weighingDate) {
+    uni.showToast({ title: "璇烽�夋嫨杩囩鏃ユ湡", icon: "none" });
+    return;
+  }
+  if (!form.weighingOperator) {
+    uni.showToast({ title: "璇疯緭鍏ヨ繃纾呭憳", icon: "none" });
+    return;
+  }
   const payload = {
     productId: form.productId,
     productModelId: form.productModelId,
diff --git a/src/pages/inventoryManagement/stockManagement/add.vue b/src/pages/inventoryManagement/stockManagement/add.vue
index ba8618e..cbfdbd1 100644
--- a/src/pages/inventoryManagement/stockManagement/add.vue
+++ b/src/pages/inventoryManagement/stockManagement/add.vue
@@ -35,11 +35,11 @@
       <view v-else class="form-section">
         <view class="section-title">杩囩淇℃伅</view>
         <view class="form-row">
-          <text class="form-label">杞︾墝鍙�</text>
+          <text class="form-label required">杞︾墝鍙�</text>
           <up-input v-model="form.licensePlateNo" placeholder="璇疯緭鍏ヨ溅鐗屽彿" />
         </view>
         <view class="form-row">
-          <text class="form-label">姣涢噸(鍚�)</text>
+          <text class="form-label required">姣涢噸(鍚�)</text>
           <up-input
             v-model="form.grossWeight"
             type="digit"
@@ -47,7 +47,7 @@
           />
         </view>
         <view class="form-row">
-          <text class="form-label">鐨噸(鍚�)</text>
+          <text class="form-label required">鐨噸(鍚�)</text>
           <up-input
             v-model="form.tareWeight"
             type="digit"
@@ -64,7 +64,7 @@
           />
         </view>
         <view class="form-row">
-          <text class="form-label">杩囩鏃ユ湡</text>
+          <text class="form-label required">杩囩鏃ユ湡</text>
           <view class="selector-trigger" @click="openWeighingDatePicker">
             <text class="selector-text" :class="{ placeholder: !form.weighingDate }">
               {{ form.weighingDate || '璇烽�夋嫨杩囩鏃ユ湡' }}
@@ -73,7 +73,7 @@
           </view>
         </view>
         <view class="form-row">
-          <text class="form-label">杩囩鍛�</text>
+          <text class="form-label required">杩囩鍛�</text>
           <up-input v-model="form.weighingOperator" placeholder="璇疯緭鍏ヨ繃纾呭憳" />
         </view>
       </view>
@@ -288,6 +288,27 @@
       uni.showToast({ title: '璇疯緭鍏ユ暟閲�', icon: 'none' })
       return
     }
+  } else {
+    if (!form.licensePlateNo) {
+      uni.showToast({ title: '璇疯緭鍏ヨ溅鐗屽彿', icon: 'none' })
+      return
+    }
+    if (!form.grossWeight || Number(form.grossWeight) <= 0) {
+      uni.showToast({ title: '璇疯緭鍏ユ瘺閲�', icon: 'none' })
+      return
+    }
+    if (!form.tareWeight || Number(form.tareWeight) <= 0) {
+      uni.showToast({ title: '璇疯緭鍏ョ毊閲�', icon: 'none' })
+      return
+    }
+    if (!form.weighingDate) {
+      uni.showToast({ title: '璇烽�夋嫨杩囩鏃ユ湡', icon: 'none' })
+      return
+    }
+    if (!form.weighingOperator) {
+      uni.showToast({ title: '璇疯緭鍏ヨ繃纾呭憳', icon: 'none' })
+      return
+    }
   }
 
   const base = {

--
Gitblit v1.9.3