From d78a83092074fb7c6231f09607092419bc8a6449 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 12 六月 2026 16:31:45 +0800
Subject: [PATCH] Merge branch 'dev_pro_河南鹤壁' of http://114.132.189.42:9002/r/product-inventory-management into dev_pro_河南鹤壁

---
 src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue |   17 ++++++--
 src/components/PIMTable/PIMTable.vue                                       |    8 ++++
 src/views/qualityManagement/rawMaterialInspection/index.vue                |   29 ++++++++++----
 src/views/productionManagement/workOrderManagement/index.vue               |   18 ++++++---
 4 files changed, 54 insertions(+), 18 deletions(-)

diff --git a/src/components/PIMTable/PIMTable.vue b/src/components/PIMTable/PIMTable.vue
index d63c197..631d956 100644
--- a/src/components/PIMTable/PIMTable.vue
+++ b/src/components/PIMTable/PIMTable.vue
@@ -120,6 +120,7 @@
             <el-button v-show="o.type != 'upload'"
                        v-if="o.showHide ? o.showHide(scope.row) : true"
                        :disabled="isOperationDisabled(o, scope.row)"
+                       :loading="isOperationLoading(o, scope.row)"
                        :plain="o.plain"
                        type="primary"
                        :style="{
@@ -373,6 +374,13 @@
       : !!operation.disabled;
   };
 
+  const isOperationLoading = (operation, row) => {
+    if (!operation?.loading) return false;
+    return typeof operation.loading === "function"
+      ? !!operation.loading(row)
+      : !!operation.loading;
+  };
+
   const parseHexToRgb = hex => {
     const normalized = String(hex || "")
       .trim()
diff --git a/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue b/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
index 0605fe5..2a45701 100644
--- a/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
+++ b/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -295,8 +295,10 @@
                 v-if="operationType === 'approval'">
         <div class="dialog-footer">
           <el-button type="primary"
+                     :loading="submitLoading"
                      @click="submitForm(2)">涓嶉�氳繃</el-button>
           <el-button type="primary"
+                     :loading="submitLoading"
                      @click="submitForm(1)">閫氳繃</el-button>
           <el-button @click="closeDia">鍙栨秷</el-button>
         </div>
@@ -353,6 +355,7 @@
   const deliveryLoading = ref(false);
   const currentDelivery = ref({});
   const deliveryProductList = ref([]);
+  const submitLoading = ref(false);
   const isQuotationApproval = computed(() => Number(props.approveType) === 6);
   const isPurchaseApproval = computed(() => Number(props.approveType) === 5);
   const isDeliveryApproval = computed(() => Number(props.approveType) === 7);
@@ -581,10 +584,15 @@
     // 鍒ゆ柇鏄惁涓烘渶鍚庝竴姝�
     const isLast =
       activities.value.findIndex(a => a.isShen) === activities.value.length - 1;
-    updateApproveNode({ ...currentActivity, isLast }).then(() => {
-      proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
-      closeDia();
-    });
+    submitLoading.value = true;
+    updateApproveNode({ ...currentActivity, isLast })
+      .then(() => {
+        proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+        closeDia();
+      })
+      .finally(() => {
+        submitLoading.value = false;
+      });
   };
   // 鍏抽棴寮规
   const closeDia = () => {
@@ -594,6 +602,7 @@
     currentQuotation.value = {};
     purchaseLoading.value = false;
     currentPurchase.value = {};
+    submitLoading.value = false;
     emit("close");
   };
   defineExpose({
diff --git a/src/views/productionManagement/workOrderManagement/index.vue b/src/views/productionManagement/workOrderManagement/index.vue
index 44be8b7..a9cf39d 100644
--- a/src/views/productionManagement/workOrderManagement/index.vue
+++ b/src/views/productionManagement/workOrderManagement/index.vue
@@ -133,7 +133,7 @@
           <el-input v-model.number="reportForm.quantity"
                     type="number"
                     min="0"
-                    step="0.1"
+                    step="0.0001"
                     style="width: 300px"
                     placeholder="璇疯緭鍏ョ敓浜у悎鏍兼暟閲�"
                     @input="handleQuantityInput" />
@@ -143,7 +143,7 @@
           <el-input v-model.number="reportForm.scrapQty"
                     type="number"
                     min="0"
-                    step="0.1"
+                    step="0.0001"
                     style="width: 300px"
                     placeholder="璇疯緭鍏ユ姤搴熸暟閲�"
                     @input="handleScrapQtyInput" />
@@ -529,6 +529,12 @@
     if (n >= 100) return 100;
     return Math.round(n);
   };
+  const subtractQuantity = (minuend, subtrahend, precision = 4) => {
+    const factor = 10 ** precision;
+    const a = Math.round((Number(minuend) || 0) * factor);
+    const b = Math.round((Number(subtrahend) || 0) * factor);
+    return Math.max(0, (a - b) / factor);
+  };
   const progressColor = percentage => {
     const p = toProgressPercentage(percentage);
     if (p < 30) return "#f56c6c";
@@ -651,10 +657,10 @@
       }
     }
     currentReportRowData.value = row;
-    const planQuantity = Number(row.planQuantity || 0);
-    const completeQuantity = Number(row.completeQuantity || 0);
-    const remainingQuantity = Math.max(0, planQuantity - completeQuantity);
-    reportForm.planQuantity = remainingQuantity;
+    reportForm.planQuantity = subtractQuantity(
+      row.planQuantity,
+      row.completeQuantity
+    );
     reportForm.quantity =
       row.quantity !== undefined && row.quantity !== null ? row.quantity : null;
     reportForm.productProcessRouteItemId = row.productProcessRouteItemId;
diff --git a/src/views/qualityManagement/rawMaterialInspection/index.vue b/src/views/qualityManagement/rawMaterialInspection/index.vue
index 7ed40eb..d887989 100644
--- a/src/views/qualityManagement/rawMaterialInspection/index.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/index.vue
@@ -227,6 +227,7 @@
         clickFun: (row) => {
           submit(row.id);
         },
+        loading: (row) => submitLoadingId.value === row.id,
 				disabled: (row) => {
 					// 宸叉彁浜ゅ垯绂佺敤
 					if (row.inspectState == 1) return true;
@@ -257,6 +258,7 @@
         clickFun: (row) => {
           downLoadFile(row);
         },
+        loading: (row) => downloadLoadingId.value === row.id,
       },
     ],
   },
@@ -264,6 +266,8 @@
 const tableData = ref([]);
 const selectedRows = ref([]);
 const tableLoading = ref(false);
+const submitLoadingId = ref(null);
+const downloadLoadingId = ref(null);
 const userList = ref([]);
 const dialogFormVisible = ref(false);
 const form = ref({
@@ -369,12 +373,17 @@
       });
 };
 
-// 鎻愪环
+// 鎻愪氦
 const submit = async (id) => {
-  const res = await submitQualityInspect({id: id})
-  if (res.code === 200) {
-    proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
-    getList();
+  submitLoadingId.value = id;
+  try {
+    const res = await submitQualityInspect({ id });
+    if (res.code === 200) {
+      proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+      getList();
+    }
+  } finally {
+    submitLoadingId.value = null;
   }
 }
 
@@ -405,8 +414,10 @@
   dialogFormVisible.value = true
 }
 
-const downLoadFile = (row) => {
-  downloadQualityInspect({ id: row.id }).then((blobData) => {
+const downLoadFile = async (row) => {
+  downloadLoadingId.value = row.id;
+  try {
+    const blobData = await downloadQualityInspect({ id: row.id });
     const blob = new Blob([blobData], {
       type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
     })
@@ -420,7 +431,9 @@
 
     document.body.removeChild(link)
     window.URL.revokeObjectURL(downloadUrl)
-  })
+  } finally {
+    downloadLoadingId.value = null;
+  }
 };
 
 onMounted(() => {

--
Gitblit v1.9.3