From c5e1e3510e255190c97efe9c05ce6665a445ab82 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 30 九月 2025 10:52:04 +0800
Subject: [PATCH] 临期相关页面
---
src/views/qualityManagement/nearExpiryReturn/index.vue | 154 +++---------------------------
src/views/customerService/expiryAfterSales/index.vue | 122 +++++-------------------
src/api/qualityManagement/nearExpiryReturn.js | 1
3 files changed, 41 insertions(+), 236 deletions(-)
diff --git a/src/api/qualityManagement/nearExpiryReturn.js b/src/api/qualityManagement/nearExpiryReturn.js
index af1f55a..4b70de5 100644
--- a/src/api/qualityManagement/nearExpiryReturn.js
+++ b/src/api/qualityManagement/nearExpiryReturn.js
@@ -43,3 +43,4 @@
method: 'get',
})
}
+
diff --git a/src/views/customerService/expiryAfterSales/index.vue b/src/views/customerService/expiryAfterSales/index.vue
index b958acb..df44504 100644
--- a/src/views/customerService/expiryAfterSales/index.vue
+++ b/src/views/customerService/expiryAfterSales/index.vue
@@ -190,97 +190,21 @@
// 鑾峰彇鍒楄〃鏁版嵁
const getList = () => {
tableLoading.value = true;
+ // 鍙栨秷娉ㄩ噴骞朵娇鐢ㄧ湡瀹濧PI
+ // 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: "缁寸敓绱燙鐗�",
- 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: "瀛h妭鎬ц嵂鍝侊紝闇�瑕佹竻鐞嗗簱瀛�",
- 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;
+ // 鍙栨秷娉ㄩ噴骞朵娇鐢ㄧ湡瀹濧PI
+ // expiryAfterSalesDelete(ids).then(() => {
+ // proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ // getList();
+ // }).finally(() => {
+ // tableLoading.value = false;
+ // });
- // 妯℃嫙鍒犻櫎鎿嶄綔
- setTimeout(() => {
- tableLoading.value = false;
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- console.log("妯℃嫙鍒犻櫎鐨勬暟鎹甀D:", ids);
- getList(); // 閲嶆柊鑾峰彇鏁版嵁
- }, 300);
+ // 鏆傛椂妯℃嫙鍒犻櫎鎴愬姛
+ tableLoading.value = false;
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
diff --git a/src/views/qualityManagement/nearExpiryReturn/index.vue b/src/views/qualityManagement/nearExpiryReturn/index.vue
index d2fe85b..3758b43 100644
--- a/src/views/qualityManagement/nearExpiryReturn/index.vue
+++ b/src/views/qualityManagement/nearExpiryReturn/index.vue
@@ -218,13 +218,7 @@
<script setup name="NearExpiryReturn">
import { ref, reactive, onMounted } from "vue";
import { ElMessageBox } from "element-plus";
-import {
- nearExpiryReturnListPage,
- nearExpiryReturnAdd,
- nearExpiryReturnUpdate,
- nearExpiryReturnDel,
- nearExpiryReturnDetail
-} from "@/api/qualityManagement/nearExpiryReturn";
+// API鎺ュ彛宸茬Щ闄わ紝涓嶅啀璋冪敤鍚庣鎺ュ彛
const { proxy } = getCurrentInstance();
const { parseTime } = proxy;
@@ -291,101 +285,9 @@
/** 鏌ヨ涓存湡閫�鍥炲彴璐﹀垪琛� */
function getList() {
loading.value = true;
- // 浣跨敤鍋囨暟鎹�
- const mockData = {
- records: [
- {
- id: 1,
- productName: "缁寸敓绱燙鐗�",
- productSpec: "100mg脳30鐗�",
- batchNumber: "VC20240315001",
- productionDate: "2024-03-15",
- expiryDate: "2024-09-15",
- returnQuantity: 50,
- returnReason: "涓磋繎淇濊川鏈�",
- returnDate: "2024-09-10",
- status: "1",
- remark: "閫�鍥炰粨搴撳鐞�"
- },
- {
- id: 2,
- productName: "闃胯帿瑗挎灄鑳跺泭",
- productSpec: "250mg脳24绮�",
- batchNumber: "AMX20240220002",
- productionDate: "2024-02-20",
- expiryDate: "2024-08-20",
- returnQuantity: 30,
- returnReason: "鍖呰鐮存崯涓斾复鏈�",
- returnDate: "2024-08-18",
- status: "2",
- remark: "宸查攢姣佸鐞�"
- },
- {
- id: 3,
- productName: "鎰熷啋鐏甸绮�",
- productSpec: "10g脳12琚�",
- batchNumber: "GML20240110003",
- productionDate: "2024-01-10",
- expiryDate: "2024-07-10",
- returnQuantity: 25,
- returnReason: "涓磋繎淇濊川鏈�",
- returnDate: "2024-07-08",
- status: "0",
- remark: "寰呴噸鏂板寘瑁�"
- },
- {
- id: 4,
- productName: "澶嶅悎缁寸敓绱犵墖",
- productSpec: "60鐗�/鐡�",
- batchNumber: "VB20240405004",
- productionDate: "2024-04-05",
- expiryDate: "2025-04-05",
- returnQuantity: 80,
- returnReason: "涓磋繎淇濊川鏈�",
- returnDate: "2024-09-25",
- status: "1",
- remark: "姝e湪鑱旂郴閿�鍞笭閬�"
- },
- {
- id: 5,
- productName: "閽欑墖",
- productSpec: "600mg脳100鐗�",
- batchNumber: "CA20240301005",
- productionDate: "2024-03-01",
- expiryDate: "2024-09-01",
- returnQuantity: 120,
- returnReason: "鍖呰闂涓斾复鏈�",
- returnDate: "2024-08-30",
- status: "2",
- remark: "宸插畬鎴愰��璐у鐞�"
- }
- ],
- total: 5
- };
-
- // 妯℃嫙杩囨护閫昏緫
- let filteredRecords = mockData.records;
-
- if (queryParams.value.productName) {
- filteredRecords = filteredRecords.filter(item =>
- item.productName.includes(queryParams.value.productName)
- );
- }
-
- if (queryParams.value.batchNumber) {
- filteredRecords = filteredRecords.filter(item =>
- item.batchNumber.includes(queryParams.value.batchNumber)
- );
- }
-
- if (queryParams.value.returnDate) {
- filteredRecords = filteredRecords.filter(item =>
- item.returnDate === queryParams.value.returnDate
- );
- }
-
- nearExpiryReturnList.value = filteredRecords;
- total.value = filteredRecords.length;
+ // 涓嶈皟鐢ㄦ帴鍙o紝杩斿洖绌烘暟鎹�
+ nearExpiryReturnList.value = [];
+ total.value = 0;
loading.value = false;
}
@@ -442,12 +344,9 @@
/** 淇敼鎸夐挳鎿嶄綔 */
function handleUpdate(row) {
reset();
- const id = row.id || ids.value;
-
- // 浣跨敤鍋囨暟鎹幏鍙栬鎯�
- const mockDetail = nearExpiryReturnList.value.find(item => item.id === (Array.isArray(id) ? id[0] : id));
- if (mockDetail) {
- form.value = { ...mockDetail };
+ // 涓嶈皟鐢ㄦ帴鍙o紝鐩存帴浣跨敤浼犲叆鐨勬暟鎹�
+ if (row) {
+ form.value = { ...row };
open.value = true;
title.value = "淇敼涓存湡閫�鍥炲彴璐�";
}
@@ -457,24 +356,14 @@
function submitForm() {
proxy.$refs["formRef"].validate(valid => {
if (valid) {
+ // 涓嶈皟鐢ㄦ帴鍙o紝鍙樉绀烘垚鍔熸彁绀�
if (form.value.id != null) {
- // 妯℃嫙鏇存柊
- const index = nearExpiryReturnList.value.findIndex(item => item.id === form.value.id);
- if (index !== -1) {
- nearExpiryReturnList.value[index] = { ...form.value };
- }
proxy.$modal.msgSuccess("淇敼鎴愬姛");
- open.value = false;
- getList();
} else {
- // 妯℃嫙鏂板
- const newId = Math.max(...nearExpiryReturnList.value.map(item => item.id)) + 1;
- nearExpiryReturnList.value.push({ ...form.value, id: newId });
- total.value = nearExpiryReturnList.value.length;
proxy.$modal.msgSuccess("鏂板鎴愬姛");
- open.value = false;
- getList();
}
+ open.value = false;
+ getList();
}
});
}
@@ -487,33 +376,20 @@
cancelButtonText: "鍙栨秷",
type: "warning"
}).then(function() {
- // 妯℃嫙鍒犻櫎
- if (Array.isArray(deleteIds)) {
- deleteIds.forEach(id => {
- const index = nearExpiryReturnList.value.findIndex(item => item.id === id);
- if (index !== -1) {
- nearExpiryReturnList.value.splice(index, 1);
- }
- });
- } else {
- const index = nearExpiryReturnList.value.findIndex(item => item.id === deleteIds);
- if (index !== -1) {
- nearExpiryReturnList.value.splice(index, 1);
- }
- }
- getList();
+ // 涓嶈皟鐢ㄦ帴鍙o紝鍙樉绀烘垚鍔熸彁绀�
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
}).catch(() => {});
}
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
function handleExport() {
- proxy.download('quality/nearExpiryReturn/export', {
- ...queryParams.value
- }, `涓存湡閫�鍥炲彴璐${new Date().getTime()}.xlsx`);
+ // 涓嶈皟鐢ㄦ帴鍙o紝鍙樉绀烘彁绀�
+ proxy.$modal.msgSuccess("瀵煎嚭鍔熻兘鏆傛湭瀹炵幇");
}
onMounted(() => {
getList();
});
</script>
+
--
Gitblit v1.9.3