From 06b919933d0aa639bebc616d2af3ee4372bdbe95 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 21 一月 2026 10:17:54 +0800
Subject: [PATCH] 新疆海川开心 1.生产报工单价默认值修改

---
 src/views/productionManagement/productionReporting/components/formDia.vue |   36 +++++++++++++++++++++---------------
 1 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/src/views/productionManagement/productionReporting/components/formDia.vue b/src/views/productionManagement/productionReporting/components/formDia.vue
index a10c6ef..e54adc7 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">
@@ -52,8 +52,8 @@
                 v-model="scope.row.unitPrice"
                 placeholder="璇疯緭鍏�"
                 :min="0"
-                :step="0.01"
-                :precision="2"
+                :step="0.001"
+                :precision="3"
                 clearable
                 style="width: 100%"
                 @change="() => calculateTotalPrice(scope.row)"
@@ -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) => {
@@ -142,7 +143,7 @@
 		const total = Number(row?.schedulingNum ?? 0);
 		const pendingFinish = Number(row?.pendingFinishNum ?? 0);
 		const autoFill = pendingFinish > 0 ? Math.min(pendingFinish, total) : total;
-		const unitPrice = row?.unitPrice ? Number(row.unitPrice) : 0.33;
+		const unitPrice = row?.unitPrice ? Number(row.unitPrice) : 0.033;
 		
 		return {
 			id: row?.id ?? null,
@@ -150,10 +151,10 @@
 			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),
+			totalPrice: (autoFill * unitPrice).toFixed(3),
 			schedulingUserId: row?.schedulingUserId ?? '',
 			schedulingDate: row?.schedulingDate ?? '',
 		};
@@ -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);
 }
 
@@ -175,7 +180,7 @@
 	const unitPrice = Number(row.unitPrice ?? 0);
 	
 	if (quantity > 0 && unitPrice > 0) {
-		row.totalPrice = (quantity * unitPrice).toFixed(2);
+		row.totalPrice = (quantity * unitPrice).toFixed(3);
 	} else {
 		row.totalPrice = '0.00';
 	}
@@ -194,6 +199,10 @@
 			proxy.$modal.msgError(`绗�${i + 1}琛屾湰娆$敓浜ф暟閲忎笉鍙ぇ浜庢帓浜ф暟閲廯);
 			return;
 		}
+		if (item.finishedNum > item.pendingFinishNum) {
+			proxy.$modal.msgError(`绗�${i + 1}琛屾湰娆$敓浜ф暟閲忎笉鍙ぇ浜庡緟鎶ュ伐鏁伴噺`);
+			return;
+		}
 		if (!item.schedulingUserId) {
 			proxy.$modal.msgError(`绗�${i + 1}琛岃閫夋嫨鐢熶骇浜篳);
 			return;
@@ -208,7 +217,7 @@
 	const payloadList = reportList.value.map(item => ({
 		id: item.id,
 		finishedNum: Number(item.finishedNum),
-		unitPrice: Number(item.unitPrice || 0.33),
+		unitPrice: Number(item.unitPrice || 0.033),
 		totalPrice: Number(item.totalPrice || 0),
 		schedulingUserId: item.schedulingUserId,
 		schedulingDate: item.schedulingDate,
@@ -237,9 +246,6 @@
 
 // 鍏抽棴寮规
 const closeDia = () => {
-  if (proxy.$refs.formRef) {
-    proxy.resetForm("formRef");
-  }
   dialogFormVisible.value = false;
   reportList.value = [];
   emit('close')

--
Gitblit v1.9.3