huminmin
18 小时以前 7d1924d1924e2cafd77ca1ce3b7d5ca9336edb9c
src/views/inventoryManagement/receiptManagement/Record.vue
@@ -22,8 +22,8 @@
                  clearable>
          <el-option v-for="item in stockRecordTypeOptions"
                     :key="item.value"
                     :label="item.value"
                     :value="item.key"/>
                     :label="item.label"
                     :value="item.value"/>
        </el-select>
        <el-button type="primary"
                   @click="handleQuery"
@@ -54,10 +54,24 @@
                         label="序号"
                         type="index"
                         width="60"/>
        <el-table-column label="入库批次"
        <!-- <el-table-column label="入库批次"
                         prop="inboundBatches"
                         width="280"
                         show-overflow-tooltip/>
                         show-overflow-tooltip/> -->
        <el-table-column label="批号"
                         min-width="160"
                         show-overflow-tooltip>
          <template #default="scope">
            {{ scope.row.batchNo || '' }}
          </template>
        </el-table-column>
        <el-table-column label="供应商"
                         min-width="200"
                         show-overflow-tooltip>
          <template #default="scope">
            {{ scope.row.supplierName || scope.row.customer || '' }}
          </template>
        </el-table-column>
        <el-table-column label="入库时间"
                         prop="createTime"
                         show-overflow-tooltip/>
@@ -66,6 +80,9 @@
                         show-overflow-tooltip/>
        <el-table-column label="规格型号"
                         prop="model"
                         show-overflow-tooltip/>
        <el-table-column label="UID码"
                         prop="uidNo"
                         show-overflow-tooltip/>
        <el-table-column label="单位"
                         prop="unit"
@@ -108,7 +125,9 @@
  getStockInRecordListPage,
  batchDeleteStockInRecords,
} from "@/api/inventoryManagement/stockInRecord.js";
import {findAllStockRecordTypeOptions} from "@/api/basicData/enum.js";
import {
  findAllQualifiedStockInRecordTypeOptions, findAllUnQualifiedStockInRecordTypeOptions,
} from "@/api/basicData/enum.js";
const {proxy} = getCurrentInstance();
@@ -127,7 +146,7 @@
const stockRecordTypeOptions = ref([]);
const page = reactive({
  current: 1,
  size: 100,
  size: 10,
});
const total = ref(0);
@@ -147,7 +166,7 @@
};
const getRecordType = (recordType) => {
  return stockRecordTypeOptions.value.find(item => item.key === recordType)?.value || ''
  return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
}
const pageProductChange = obj => {
@@ -161,9 +180,11 @@
  const params = {...page, type: props.type};
  params.timeStr = searchForm.value.timeStr;
  params.productName = searchForm.value.productName;
  params.recordType = searchForm.value.recordType;
  getStockInRecordListPage(params)
      .then(res => {
        tableData.value = res.data.records;
        total.value = res.data.total || 0;
      }).finally(() => {
    tableLoading.value = false;
  })
@@ -171,7 +192,14 @@
// 获取来源类型选项
const fetchStockRecordTypeOptions = () => {
  findAllStockRecordTypeOptions()
  if (props.type === '0') {
    findAllQualifiedStockInRecordTypeOptions()
        .then(res => {
          stockRecordTypeOptions.value = res.data;
        })
    return
  }
  findAllUnQualifiedStockInRecordTypeOptions()
      .then(res => {
        stockRecordTypeOptions.value = res.data;
      })
@@ -193,8 +221,7 @@
  })
      .then(() => {
        // 根据不同的 tab 类型调用不同的导出接口
        let exportUrl = "/stockin/export";
        proxy.download(exportUrl, {}, "入库台账.xlsx");
        proxy.download("/stockInRecord/exportStockInRecord", {type: props.type}, props.type === '0' ? "合格入库.xlsx" : "不合格入库.xlsx");
      })
      .catch(() => {
        proxy.$modal.msg("已取消");