添加产品宽高搜索功能,优化销售台账数据处理逻辑,新增面积和数量列
已修改1个文件
58 ■■■■■ 文件已修改
src/views/salesManagement/salesLedger/index.vue 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue
@@ -32,6 +32,20 @@
                    prefix-icon="Search"
                    @change="handleQuery" />
        </el-form-item>
        <el-form-item label="产品宽(mm):">
          <el-input v-model="searchForm.width"
                    placeholder="请输入"
                    clearable
                    prefix-icon="Search"
                    @change="handleQuery" />
        </el-form-item>
        <el-form-item label="产品高(mm):">
          <el-input v-model="searchForm.height"
                    placeholder="请输入"
                    clearable
                    prefix-icon="Search"
                    @change="handleQuery" />
        </el-form-item>
        <el-form-item label="录入日期:">
          <el-date-picker v-model="searchForm.entryDate"
                          value-format="YYYY-MM-DD"
@@ -319,6 +333,14 @@
                         width="220"
                         show-overflow-tooltip
                         :formatter="formattedNumber" />
        <el-table-column label="面积"
                         prop="productTotalArea"
                         width="120"
                         show-overflow-tooltip />
        <el-table-column label="数量"
                         prop="productTotalQuantity"
                         width="120"
                         show-overflow-tooltip />
        <el-table-column label="发货状态"
                         width="140"
                         align="center">
@@ -1909,6 +1931,8 @@
      customerName: "", // 客户名称
      customerId: "", // 客户ID(查询下拉)
      salesContractNo: "", // 销售合同编号
      width: undefined, // 产品宽(mm)
      height: undefined, // 产品高(mm)
      entryDate: null, // 录入日期
      entryDateStart: undefined,
      entryDateEnd: undefined,
@@ -2867,14 +2891,44 @@
        delete params.customerName;
      }
    }
    const widthValue =
      params.width != null ? String(params.width).trim() : "";
    if (widthValue) {
      params.width = widthValue;
    } else {
      delete params.width;
    }
    const heightValue =
      params.height != null ? String(params.height).trim() : "";
    if (heightValue) {
      params.height = heightValue;
    } else {
      delete params.height;
    }
    const shouldAutoExpandBySize = Boolean(params.width || params.height);
    delete params.customerId;
    return ledgerListPage(params)
      .then(res => {
      .then(async res => {
        tableLoading.value = false;
        tableData.value = res.records;
        tableData.value.map(item => {
          item.children = [];
        });
        if (shouldAutoExpandBySize && tableData.value.length > 0) {
          const loadChildrenTasks = tableData.value.map(item =>
            productList({ salesLedgerId: item.id, type: 1 })
              .then(productRes => {
                item.children = Array.isArray(productRes?.data)
                  ? productRes.data
                  : [];
              })
              .catch(() => {
                item.children = [];
              })
          );
          await Promise.all(loadChildrenTasks);
          expandedRowKeys.value = tableData.value.map(item => item.id);
        }
        total.value = res.total;
        return res;
      })
@@ -3233,6 +3287,8 @@
  const summarizeMainTable = param => {
    return proxy.summarizeTable(param, [
      "contractAmount",
      "productTotalQuantity",
      "productTotalArea",
      "taxInclusiveTotalPrice",
      "taxExclusiveTotalPrice",
    ]);