huminmin
2026-07-02 18dba31d39dcb701c16979ed3f607767dbdae80f
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,12 +259,18 @@
              <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="已退货数量"
                               prop="totalReturnNum"
                               width="130" />
                               width="130">
                <template #default="scope">
                  {{ formattedNumber(scope.row, null, scope.row.totalReturnNum || 0) }}
                </template>
              </el-table-column>
              <el-table-column label="退货数量"
                               prop="returnQuantity"
                               width="180">
@@ -321,7 +329,6 @@
                </template>
              </el-table-column>
            </el-table>
            </div>
          </div>
        <div class="section-title">
@@ -416,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({
@@ -662,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;
    });
  }
@@ -689,7 +696,7 @@
    ...item,
    returnQuantity: undefined,
    taxInclusiveTotalPrice: 0,
    salesLedgerProductId: item.salesLedgerProductId ?? item.id,
    // salesLedgerProductId: item.salesLedgerProductId,
  }));
  formState.value.purchaseReturnOrderProductsDtos.push(...newProducts);
  syncTotalAmount()
@@ -792,12 +799,5 @@
  margin-right: 8px;
}
.product-table-scroll {
  width: 100%;
  overflow-x: auto;
}
.product-table-inner {
  min-width: 1280px;
}
</style>
</style>