gongchunyi
8 天以前 990257e90f992cccbfbdd5e3bebd27b0ae5402a8
src/views/salesManagement/salesLedger/index.vue
@@ -24,6 +24,18 @@
                    prefix-icon="Search"
                    @change="handleQuery" />
        </el-form-item>
        <el-form-item label="发货状态:">
          <el-select v-model="searchForm.shippingStatus"
                     placeholder="请选择"
                     clearable
                     style="width: 160px"
                     @change="handleQuery">
            <el-option label="未发货"
                       value="未发货" />
            <el-option label="已发货"
                       value="已发货" />
          </el-select>
        </el-form-item>
        <el-form-item label="录入日期:">
          <el-date-picker v-model="searchForm.entryDate"
                          value-format="YYYY-MM-DD"
@@ -123,15 +135,14 @@
              </el-table-column>
              <el-table-column label="快递公司"
                               prop="expressCompany"
                               v-if="false"
                               show-overflow-tooltip />
              <el-table-column label="快递单号"
                               prop="expressNumber"
                               v-if="false"
                               show-overflow-tooltip />
              <el-table-column label="发货车牌"
                               minWidth="100px"
                               align="center">
                               align="center"
                               v-if="false">
                <template #default="scope">
                  <div>
                    <el-tag type="success"
@@ -834,7 +845,7 @@
                    <span class="label">发货日期:</span>
                    <span class="value">{{ formatDate(item.createTime) }}</span>
                  </div>
                  <div>
                  <div v-if="false">
                    <span class="label">发货车牌号:</span>
                    <span class="value">{{ item.shippingCarNumber }}</span>
                  </div>
@@ -922,7 +933,7 @@
    <!-- 发货弹框 -->
    <el-dialog v-model="deliveryFormVisible"
               title="发货信息"
               width="40%"
               width="960px"
               @close="closeDeliveryDia">
      <el-form :model="deliveryForm"
               label-width="120px"
@@ -937,11 +948,10 @@
                         placeholder="请选择发货类型"
                         style="width: 100%"
                         @change="handleDeliveryTypeChange">
                <el-option label="快递"
                           value="快递" />
                <el-option label="货车"
                           value="货车" />
                <el-option label="快递"
                           v-if="false"
                           value="快递" />
              </el-select>
            </el-form-item>
          </el-col>
@@ -973,7 +983,7 @@
          </el-col>
        </el-row>
        <el-row :gutter="30"
                v-if="false">
                >
          <el-col :span="24">
            <el-form-item label="快递单号:"
                          prop="expressNumber">
@@ -1003,6 +1013,13 @@
                <el-table-column label="批号"
                                 prop="batchNo"
                                 min-width="180" />
                <el-table-column label="销售订单号"
                                 min-width="180"
                                 show-overflow-tooltip>
                  <template #default="scope">
                    {{ formatDeliveryBatchSalesOrderNo(scope.row) }}
                  </template>
                </el-table-column>
                <el-table-column label="产品大类"
                                 prop="productName"
                                 min-width="100" />
@@ -1122,6 +1139,8 @@
    searchForm: {
      customerName: "", // 客户名称
      salesContractNo: "", // 销售合同编号
      projectName: "", // 项目名称
      shippingStatus: "", // 发货状态(未发货/已发货)
      entryDate: null, // 录入日期
      entryDateStart: undefined,
      entryDateEnd: undefined,
@@ -1226,6 +1245,8 @@
      item?.stockQuantity;
    return quantity ?? 0;
  };
  const formatDeliveryBatchSalesOrderNo = item =>
    item?.salesContractNo || "--";
  const currentStock = ref(null);
  const fetchCurrentStock = async (productModelId) => {
    if (!productModelId) {
@@ -1233,7 +1254,7 @@
      return;
    }
    try {
      const res = await getStockInventoryByModelId(productModelId);
      const res = await getStockInventoryByModelId(productModelId, currentId.value);
      const rawList = Array.isArray(res?.data)
        ? res.data
        : res?.data?.records || res?.data?.rows || [];
@@ -1295,9 +1316,9 @@
      item => Number(item?.deliveryQuantity || 0) > 0
    );
  };
  const getDeliveryBatchNoList = async productModelId => {
  const getDeliveryBatchNoList = async (productModelId, salesLedgerId) => {
    if (!productModelId) return [];
    const res = await getStockInventoryByModelId(productModelId);
    const res = await getStockInventoryByModelId(productModelId, salesLedgerId);
    const rawList = Array.isArray(res?.data)
      ? res.data
      : res?.data?.records || res?.data?.rows || [];
@@ -1332,7 +1353,7 @@
      shippingCarNumber: "",
      expressCompany: "",
      expressNumber: "",
      type: "货车", // 货车, 快递
      type: "快递", // 货车, 快递
    },
    deliveryRules: {
      shippingCarNumber: [
@@ -2476,13 +2497,14 @@
    currentDeliveryRow.value = row;
    const batchNoList = await getDeliveryBatchNoList(
      row.productModelId || row.modelId
      row.productModelId || row.modelId,
      row.salesLedgerId
    );
    deliveryForm.value = {
      shippingCarNumber: "",
      expressCompany: "",
      expressNumber: "",
      type: "货车",
      type: "快递",
      batchNo: [],
      batchNoList,
    };
@@ -2807,4 +2829,4 @@
      page-break-after: avoid;
    }
  }
</style>
</style>