From 0c4429a719f5c95a7690fae51efaaa799ef4e77d Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期一, 25 五月 2026 10:02:48 +0800
Subject: [PATCH] fix: 投入重量改成投入重量/数量

---
 src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue |   74 +++++++++++++++++++++++++++++++++++-
 1 files changed, 71 insertions(+), 3 deletions(-)

diff --git a/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue b/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
index 323953c..448b0c3 100644
--- a/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
+++ b/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -83,8 +83,14 @@
         </el-col>
       </el-row>
       <el-row v-if="isInventoryApproval">
-        
-        <el-col :span="24">
+        <el-col :span="12">
+          <el-form-item label="鏂欏彿锛�">
+            <el-tag type="info">
+              {{ currentStockIn.materialCode || '-' }}
+            </el-tag>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
           <el-form-item label="鐢熶骇璁㈠崟鍙凤細">
             <el-tag type="info">
               {{ currentStockIn.npsNo || '-' }}
@@ -206,6 +212,7 @@
                 <el-table :data="currentPurchase.productData || []" border style="width: 100%">
                   <el-table-column prop="productCategory" label="浜у搧鍚嶇О" />
                   <el-table-column prop="specificationModel" label="瑙勬牸鍨嬪彿" />
+                  <el-table-column prop="materialCode" label="鏂欏彿" />
                   <el-table-column prop="unit" label="鍗曚綅" />
                   <el-table-column prop="quantity" label="鏁伴噺" />
                   <el-table-column prop="taxInclusiveUnitPrice" label="鍚◣鍗曚环">
@@ -216,6 +223,40 @@
                   </el-table-column>
                 </el-table>
               </div>
+            </template>
+          </template>
+        </el-skeleton>
+      </div>
+
+      <!-- 鍙戣揣瀹℃壒锛氬睍绀哄搴斾骇鍝佷俊鎭� -->
+      <div v-if="isShipmentApproval" style="margin: 10px 0 18px;">
+        <el-divider content-position="left">浜у搧淇℃伅</el-divider>
+        <el-skeleton :loading="shipmentProductLoading" animated>
+          <template #template>
+            <el-skeleton-item variant="h3" style="width: 30%" />
+            <el-skeleton-item variant="text" style="width: 100%" />
+            <el-skeleton-item variant="text" style="width: 100%" />
+          </template>
+          <template #default>
+            <el-empty
+              v-if="!currentShipmentProduct || !currentShipmentProduct.id"
+              description="鏈煡璇㈠埌瀵瑰簲浜у搧淇℃伅"
+            />
+            <template v-else>
+              <el-descriptions :column="2" border>
+                <el-descriptions-item label="浜у搧澶х被">
+                  {{ currentShipmentProduct.productCategory || "-" }}
+                </el-descriptions-item>
+                <el-descriptions-item label="瑙勬牸鍨嬪彿">
+                  {{ currentShipmentProduct.specificationModel || "-" }}
+                </el-descriptions-item>
+                <el-descriptions-item label="鍗曚綅">
+                  {{ currentShipmentProduct.unit || "-" }}
+                </el-descriptions-item>
+                <el-descriptions-item label="鏁伴噺">
+                  {{ currentShipmentProduct.quantity ?? "-" }}
+                </el-descriptions-item>
+              </el-descriptions>
             </template>
           </template>
         </el-skeleton>
@@ -288,6 +329,7 @@
 import { getQuotationList } from "@/api/salesManagement/salesQuotation.js";
 import { getPurchaseByCode } from "@/api/procurementManagement/procurementLedger.js";
 import { getStockInRecordById } from "@/api/inventoryManagement/stockInRecord.js";
+import { getSalesProductById } from "@/api/salesManagement/salesLedger.js";
 const emit = defineEmits(['close'])
 const { proxy } = getCurrentInstance()
 
@@ -311,8 +353,11 @@
 const currentPurchase = ref({})
 const stockInLoading = ref(false)
 const currentStockIn = ref({})
+const shipmentProductLoading = ref(false)
+const currentShipmentProduct = ref({})
 const isQuotationApproval = computed(() => Number(props.approveType) === 6)
 const isPurchaseApproval = computed(() => Number(props.approveType) === 5)
+const isShipmentApproval = computed(() => Number(props.approveType) === 7)
 const isInventoryApproval = computed(() => Number(props.approveType) === 9)
 
 const data = reactive({
@@ -359,6 +404,7 @@
   currentQuotation.value = {}
   currentPurchase.value = {}
   currentStockIn.value = {}
+  currentShipmentProduct.value = {}
 	userListNoPageByTenantId().then((res) => {
 		userList.value = res.data;
 	});
@@ -416,6 +462,26 @@
       }).finally(() => {
         purchaseLoading.value = false
       })
+    }
+  }
+
+  // 鍙戣揣瀹℃壒锛氭牴鎹鎵瑰垪琛ㄤ腑鐨� recordId 鏌ヨ瀵瑰簲浜у搧璇︽儏
+  if (isShipmentApproval.value) {
+    const recordId = row?.recordId;
+    form.value.recordId = recordId ?? form.value.recordId;
+    if (recordId) {
+      shipmentProductLoading.value = true;
+      getSalesProductById({ id: recordId })
+        .then((res) => {
+          currentShipmentProduct.value = res?.data || res || {};
+        })
+        .catch((err) => {
+          console.error("鏌ヨ鍙戣揣浜у搧璇︽儏澶辫触:", err);
+          proxy.$modal.msgError("鏌ヨ鍙戣揣浜у搧璇︽儏澶辫触");
+        })
+        .finally(() => {
+          shipmentProductLoading.value = false;
+        });
     }
   }
 
@@ -503,6 +569,8 @@
   currentPurchase.value = {}
   stockInLoading.value = false
   currentStockIn.value = {}
+  shipmentProductLoading.value = false
+  currentShipmentProduct.value = {}
   emit('close')
 };
 defineExpose({
@@ -541,4 +609,4 @@
 	width: 200px;
 	height: 60px;
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3