gaoluyang
2025-09-30 c5e1e3510e255190c97efe9c05ce6665a445ab82
src/views/customerService/expiryAfterSales/index.vue
@@ -190,97 +190,21 @@
// 获取列表数据
const getList = () => {
   tableLoading.value = true;
   // 取消注释并使用真实API
   // expiryAfterSalesListPage({
   //    ...searchForm.value,
   //    current: page.value.current,
   //    size: page.value.size
   // }).then(res => {
   //    tableData.value = res.data.records;
   //    page.value.total = res.data.total;
   //    tableLoading.value = false;
   // });
   
   // 模拟异步请求
   setTimeout(() => {
      // 假数据
      const mockData = [
         {
            id: 1,
            productName: "维生素C片",
            batchNumber: "VC20240801",
            expiryDate: "2024-12-15",
            stockQuantity: 150,
            customerName: "张三药店",
            problemDesc: "临近保质期需要处理",
            status: 1,
            handlerName: "",
            handleDate: "",
         },
         {
            id: 2,
            productName: "阿莫西林胶囊",
            batchNumber: "AM20240715",
            expiryDate: "2024-11-20",
            stockQuantity: 80,
            customerName: "李四医院",
            problemDesc: "库存积压,临期处理",
            status: 2,
            handlerName: "王五",
            handleDate: "2024-09-25",
         },
         {
            id: 3,
            productName: "感冒灵颗粒",
            batchNumber: "GM20240620",
            expiryDate: "2024-10-30",
            stockQuantity: 200,
            customerName: "赵六诊所",
            problemDesc: "季节性药品,需要清理库存",
            status: 1,
            handlerName: "",
            handleDate: "",
         },
         {
            id: 4,
            productName: "复合维生素片",
            batchNumber: "FH20240510",
            expiryDate: "2024-12-01",
            stockQuantity: 300,
            customerName: "钱七连锁",
            problemDesc: "临期产品退换申请",
            status: 2,
            handlerName: "孙八",
            handleDate: "2024-09-20",
         },
         {
            id: 5,
            productName: "板蓝根颗粒",
            batchNumber: "BL20240430",
            expiryDate: "2024-11-10",
            stockQuantity: 120,
            customerName: "周九药房",
            problemDesc: "批次问题,需要召回",
            status: 1,
            handlerName: "",
            handleDate: "",
         }
      ];
      // 简单的搜索过滤
      let filteredData = mockData;
      if (searchForm.value.status !== "" && searchForm.value.status !== null) {
         filteredData = filteredData.filter(item => item.status === searchForm.value.status);
      }
      if (searchForm.value.expiryDate) {
         filteredData = filteredData.filter(item => item.expiryDate === searchForm.value.expiryDate);
      }
      if (searchForm.value.handleDate) {
         filteredData = filteredData.filter(item => item.handleDate === searchForm.value.handleDate);
      }
      // 分页处理
      const start = (page.value.current - 1) * page.value.size;
      const end = start + page.value.size;
      const paginatedData = filteredData.slice(start, end);
      tableLoading.value = false;
      tableData.value = paginatedData;
      page.value.total = filteredData.length;
   }, 500); // 模拟网络延迟
   // 暂时返回空数据
   tableData.value = [];
   page.value.total = 0;
   tableLoading.value = false;
};
// 打开弹框
@@ -306,14 +230,18 @@
   })
      .then(() => {
         tableLoading.value = true;
         // 取消注释并使用真实API
         // expiryAfterSalesDelete(ids).then(() => {
         //    proxy.$modal.msgSuccess("删除成功");
         //    getList();
         // }).finally(() => {
         //    tableLoading.value = false;
         // });
         
         // 模拟删除操作
         setTimeout(() => {
            tableLoading.value = false;
            proxy.$modal.msgSuccess("删除成功");
            console.log("模拟删除的数据ID:", ids);
            getList(); // 重新获取数据
         }, 300);
         // 暂时模拟删除成功
         tableLoading.value = false;
         proxy.$modal.msgSuccess("删除成功");
         getList();
      })
      .catch(() => {
         proxy.$modal.msg("已取消");