From 18dba31d39dcb701c16979ed3f607767dbdae80f Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 02 七月 2026 17:10:10 +0800
Subject: [PATCH] Merge branch 'dev_NEW_pro' of http://114.132.189.42:9002/r/product-inventory-management into dev_NEW_pro

---
 src/views/procurementManagement/purchaseReturnOrder/New.vue |   41 +++++++++++++++--------------------------
 1 files changed, 15 insertions(+), 26 deletions(-)

diff --git a/src/views/procurementManagement/purchaseReturnOrder/New.vue b/src/views/procurementManagement/purchaseReturnOrder/New.vue
index 2c6801d..0453310 100644
--- a/src/views/procurementManagement/purchaseReturnOrder/New.vue
+++ b/src/views/procurementManagement/purchaseReturnOrder/New.vue
@@ -3,8 +3,10 @@
     <el-dialog
         v-model="isShow"
         title="鏂板閲囪喘閫�璐�"
-        width="1600"
+        width="70%"
+        top="3vh"
         @close="closeModal"
+        class="purchase-return-dialog"
     >
       <el-form label-width="140px" :model="formState" label-position="top" ref="formRef" :inline="true">
         <div class="section-title">
@@ -221,19 +223,19 @@
           <el-input style="width: 240px" v-model="formState.remark" :rows="1" type="textarea" placeholder="璇疯緭鍏ュ娉�"/>
         </el-form-item>
 
-        <div style="margin: 20px 0;">
+        <div style="margin:20px 0;min-width:0;">
             <div class="section-title">
               <span class="title-dot"></span>
               <span class="title-text">浜у搧鍒楄〃</span>
             </div>
-            <el-button type="primary" size="small" style="margin-bottom: 20px" @click="isShowProductsModal = true" :disabled="!formState.purchaseLedgerId">娣诲姞浜у搧</el-button>
-            <div class="product-table-scroll">
-            <el-table class="product-table-inner"
+            <el-button type="primary" size="small" style="margin-bottom:20px" @click="isShowProductsModal = true" :disabled="!formState.purchaseLedgerId">娣诲姞浜у搧</el-button>
+            <el-table
                       :data="formState.purchaseReturnOrderProductsDtos"
                       border
                       max-height="400"
                       show-summary
-                      :summary-method="summarizeChildrenTable">
+                      :summary-method="summarizeChildrenTable"
+                      style="width:100%;min-width:0;">
               <el-table-column align="center"
                                type="selection"
                                width="55" />
@@ -257,13 +259,16 @@
               <el-table-column label="鏁伴噺"
                                prop="stockInNum"
                                width="100" />
+              <el-table-column label="閿�鍞彂璐ф暟閲�"
+                               prop="saleOutQuantity"
+                               width="120" />
                                <el-table-column label="鍙��璐ф暟閲�"
                                prop="unQuantity"
                                width="130" />
               <el-table-column label="宸查��璐ф暟閲�"
                                width="130">
                 <template #default="scope">
-                  {{ calcAlreadyReturned(scope.row) }}
+                  {{ formattedNumber(scope.row, null, scope.row.totalReturnNum || 0) }}
                 </template>
               </el-table-column>
               <el-table-column label="閫�璐ф暟閲�"
@@ -324,7 +329,6 @@
                 </template>
               </el-table-column>
             </el-table>
-            </div>
           </div>
 
         <div class="section-title">
@@ -419,7 +423,7 @@
 <script setup>
 import {ref, computed, getCurrentInstance, watch, defineAsyncComponent} from "vue";
 import {createPurchaseReturnOrder} from "@/api/procurementManagement/purchase_return_order.js";
-import {getOptions, purchaseList} from "@/api/procurementManagement/procurementLedger.js";
+import {getOptions, purchaseReturnableList} from "@/api/procurementManagement/procurementLedger.js";
 import {userListNoPageByTenantId} from "@/api/system/user.js";
 const ProductList = defineAsyncComponent(() => import("@/views/procurementManagement/purchaseReturnOrder/ProductList.vue"));
 const props = defineProps({
@@ -527,14 +531,6 @@
 const toNumber = (val) => {
   const num = Number(val)
   return Number.isNaN(num) ? 0 : num
-}
-
-/** 宸查��璐ф暟閲� = 鍏ュ簱琛屾�绘暟閲� 鈭� 褰撳墠鍙��璐ф暟閲忥紙鍓╀綑锛� */
-const calcAlreadyReturned = (row) => {
-  const total = Number(row?.stockInNum ?? row?.totalQuantity ?? row?.quantity ?? 0)
-  const un = Number(row?.unQuantity ?? 0)
-  if (!Number.isFinite(total) || !Number.isFinite(un)) return 0
-  return Math.max(total - un, 0)
 }
 
 const getReturnTotal = (row) => {
@@ -673,7 +669,7 @@
 const fetchPurchaseLedgerOptions = () => {
   purchaseLedgerOptions.value = []
   if (formState.value.supplierId) {
-    purchaseList({supplierId: formState.value.supplierId,approvalStatus:3}).then((res) => {
+    purchaseReturnableList({ supplierId: formState.value.supplierId }).then((res) => {
       purchaseLedgerOptions.value = res.rows;
     });
   }
@@ -803,12 +799,5 @@
   margin-right: 8px;
 }
 
-.product-table-scroll {
-  width: 100%;
-  overflow-x: auto;
-}
 
-.product-table-inner {
-  min-width: 1280px;
-}
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3