From 67569b8d234da7ca2d0131226392410c6ae35635 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 05 一月 2026 11:54:47 +0800
Subject: [PATCH] 海川开心: 1.销售管理、仓储物流一些字段赋默认值 2.生产报工改成可以多个报工

---
 src/views/productionManagement/productionDispatching/components/autoDispatchDia.vue |    3 ---
 src/views/productionManagement/productionReporting/components/formDia.vue           |   24 +++++++++++++++---------
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/views/productionManagement/productionDispatching/components/autoDispatchDia.vue b/src/views/productionManagement/productionDispatching/components/autoDispatchDia.vue
index bfbc5ca..c0a4f12 100644
--- a/src/views/productionManagement/productionDispatching/components/autoDispatchDia.vue
+++ b/src/views/productionManagement/productionDispatching/components/autoDispatchDia.vue
@@ -116,9 +116,6 @@
   
   // 鏋勯�犳彁浜ゆ暟鎹� - 鐩存帴浼犻�掓暟缁勶紝涓嶈繃婊�
   const submitData = dispatchList.value
-  
-  console.log('鎻愪氦鑷姩娲惧伐鏁版嵁:', submitData)
-  
   // 璋冪敤API锛堣繖閲岄渶瑕佹牴鎹疄闄呮帴鍙h皟鏁达級
   productionDispatchList(submitData).then(res => {
     proxy.$modal.msgSuccess(res.msg);
diff --git a/src/views/productionManagement/productionReporting/components/formDia.vue b/src/views/productionManagement/productionReporting/components/formDia.vue
index a10c6ef..18df18d 100644
--- a/src/views/productionManagement/productionReporting/components/formDia.vue
+++ b/src/views/productionManagement/productionReporting/components/formDia.vue
@@ -7,7 +7,7 @@
 				draggable
         @close="closeDia"
     >
-      <el-form label-width="140px" label-position="top" :rules="rules" ref="formRef">
+      <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
         <el-table
           :data="reportList"
           border
@@ -27,9 +27,9 @@
               <span>{{ scope.row.schedulingNum }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="寰呯敓浜ф暟閲�" prop="pendingNum" width="100">
+          <el-table-column label="寰呯敓浜ф暟閲�" prop="pendingFinishNum" width="100">
             <template #default="scope">
-              <span>{{ scope.row.pendingNum }}</span>
+              <span>{{ scope.row.pendingFinishNum }}</span>
             </template>
           </el-table-column>
           <el-table-column label="鏈鐢熶骇鏁伴噺" prop="finishedNum" width="150">
@@ -122,11 +122,12 @@
 const operationType = ref('')
 const reportList = ref([])
 const data = reactive({
+  form: {},
   rules: {
 		schedulingNum: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" },],
   },
 });
-const { rules } = toRefs(data);
+const { form, rules } = toRefs(data);
 
 // 鎵撳紑寮规
 const openDialog = (type, rows) => {
@@ -150,7 +151,7 @@
 			productCategory: row?.productCategory ?? '',
 			specificationModel: row?.specificationModel ?? '',
 			schedulingNum: total,
-			pendingNum: Math.max(total - autoFill, 0),
+			pendingFinishNum: pendingFinish, // 淇濆瓨鍘熷鐨勫緟鎶ュ伐鏁伴噺
 			finishedNum: autoFill,
 			unitPrice: unitPrice,
 			totalPrice: (autoFill * unitPrice).toFixed(2),
@@ -165,7 +166,11 @@
 		row.finishedNum = row.schedulingNum;
 		proxy.$modal.msgWarning('鏈鐢熶骇鏁伴噺涓嶅彲澶т簬鎺掍骇鏁伴噺')
 	}
-	row.pendingNum = row.schedulingNum - row.finishedNum;
+	// 楠岃瘉鏈鐢熶骇鏁伴噺涓嶈兘澶т簬寰呮姤宸ユ暟閲�
+	if (value > row.pendingFinishNum) {
+		row.finishedNum = row.pendingFinishNum;
+		proxy.$modal.msgWarning('鏈鐢熶骇鏁伴噺涓嶅彲澶т簬寰呮姤宸ユ暟閲�')
+	}
 	calculateTotalPrice(row);
 }
 
@@ -192,6 +197,10 @@
 		}
 		if (item.finishedNum > item.schedulingNum) {
 			proxy.$modal.msgError(`绗�${i + 1}琛屾湰娆$敓浜ф暟閲忎笉鍙ぇ浜庢帓浜ф暟閲廯);
+			return;
+		}
+		if (item.finishedNum > item.pendingFinishNum) {
+			proxy.$modal.msgError(`绗�${i + 1}琛屾湰娆$敓浜ф暟閲忎笉鍙ぇ浜庡緟鎶ュ伐鏁伴噺`);
 			return;
 		}
 		if (!item.schedulingUserId) {
@@ -237,9 +246,6 @@
 
 // 鍏抽棴寮规
 const closeDia = () => {
-  if (proxy.$refs.formRef) {
-    proxy.resetForm("formRef");
-  }
   dialogFormVisible.value = false;
   reportList.value = [];
   emit('close')

--
Gitblit v1.9.3