src/views/inventoryManagement/receiptManagement/Record.vue
@@ -115,10 +115,9 @@
const {proxy} = getCurrentInstance();
const props = defineProps({
  type: {
    type: String,
    required: true,
    default: '0'
  productId: {
    type: [String, Number],
    default: ''
  }
})
@@ -160,7 +159,7 @@
const getList = () => {
  tableLoading.value = true;
  const params = {...page, type: props.type};
  const params = {...page, topParentProductId: props.productId};
  params.timeStr = searchForm.value.timeStr;
  params.productName = searchForm.value.productName;
  params.recordType = searchForm.value.recordType;
@@ -175,17 +174,20 @@
// 获取来源类型选项
const fetchStockRecordTypeOptions = () => {
  if (props.type === '0') {
    findAllQualifiedStockInRecordTypeOptions()
        .then(res => {
          stockRecordTypeOptions.value = res.data;
        })
    return
  }
  // 同时获取合格和不合格的来源类型选项
  Promise.all([
    findAllQualifiedStockInRecordTypeOptions(),
  findAllUnQualifiedStockInRecordTypeOptions()
      .then(res => {
        stockRecordTypeOptions.value = res.data;
      })
  ]).then(([qualifiedRes, unQualifiedRes]) => {
    const qualified = qualifiedRes.data || [];
    const unQualified = unQualifiedRes.data || [];
    // 合并并去重
    const allOptions = [...qualified, ...unQualified];
    const uniqueOptions = allOptions.filter((item, index, self) =>
      index === self.findIndex((t) => t.value === item.value)
    );
    stockRecordTypeOptions.value = uniqueOptions;
  });
}
// 表格选择数据
@@ -203,8 +205,7 @@
    type: "warning",
  })
      .then(() => {
        // 根据不同的 tab 类型调用不同的导出接口
        proxy.download("/stockInRecord/exportStockInRecord", {type: props.type}, props.type === '0' ? "合格入库.xlsx" : "不合格入库.xlsx");
        proxy.download("/stockInRecord/exportStockInRecord", { topParentProductId: props.productId }, "入库台账.xlsx");
      })
      .catch(() => {
        proxy.$modal.msg("已取消");