src/views/inventoryManagement/dispatchLog/Record.vue
@@ -129,10 +129,9 @@
const total = ref(0);
const props = defineProps({
  type: {
    type: String,
    required: true,
    default: '0'
  productId: {
    type: [String, Number],
    default: ''
  }
})
@@ -163,7 +162,7 @@
};
const getList = () => {
   tableLoading.value = true;
   getStockOutPage({ ...searchForm.value, ...page, type: props.type })
   getStockOutPage({ ...searchForm.value, ...page, topParentProductId: props.productId })
      .then((res) => {
         tableLoading.value = false;
         tableData.value = res.data.records;
@@ -183,17 +182,20 @@
// 获取来源类型选项
const fetchStockRecordTypeOptions = () => {
  if (props.type === '0') {
    findAllQualifiedStockOutRecordTypeOptions()
        .then(res => {
          stockRecordTypeOptions.value = res.data;
        })
    return
  }
  findAllUnQualifiedStockOutRecordTypeOptions()
      .then(res => {
        stockRecordTypeOptions.value = res.data;
      })
  // 同时获取合格和不合格的来源类型选项
  Promise.all([
    findAllQualifiedStockOutRecordTypeOptions(),
    findAllUnQualifiedStockOutRecordTypeOptions()
  ]).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;
  });
}
// 表格选择数据
@@ -212,7 +214,7 @@
      type: "warning",
   })
      .then(() => {
         proxy.download("/stockOutRecord/exportStockOutRecord", {type: props.type}, props.type === '0' ? "合格出库台账.xlsx" : "不合格出库台账.xlsx");
         proxy.download("/stockOutRecord/exportStockOutRecord", { topParentProductId: props.productId }, "出库台账.xlsx");
      })
      .catch(() => {
         proxy.$modal.msg("已取消");