From dfc4cf59e31ca21e8e13873277af89dfc8f66fcd Mon Sep 17 00:00:00 2001 From: ycy <2861518472@qq.com> Date: Mon, 8 Apr 2024 10:37:44 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E7=A5=A8=E6=8D=AE=E9=A2=86?= =?UTF-8?q?=E7=94=A8=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/modules/ycy.js | 81 +++++++ src/api/finance-bill-manage/receiptList.js | 2 + src/pages/finance-bill-manage/billCancel.vue | 2 +- src/pages/finance-bill-manage/billReceipt.vue | 208 +++++++++++++++--- src/stores/billReceipt.js | 12 +- 5 files changed, 269 insertions(+), 36 deletions(-) diff --git a/mock/modules/ycy.js b/mock/modules/ycy.js index 5be9a75..da929f9 100644 --- a/mock/modules/ycy.js +++ b/mock/modules/ycy.js @@ -13,6 +13,60 @@ const StockList = Mock.mock({ }, ], }); +const ReceiptList = Mock.mock([ + { + "list|20-30": [ + { + "id|+1": 0, + billserial: "@integer(100000000,199999999)1", + proposer: "孙东宇", + billType: "@integer(0,4)", + receiptNum: "@integer(1,10)张", + receiptDate: "@date", + useInfo: "@csentence", + }, + ], + }, + { + "list|20-30": [ + { + "id|+1": 0, + billserial: "@integer(100000000,199999999)1", + proposer: "杨春宇", + billType: "@integer(0,4)", + receiptNum: "@integer(1,10)张", + receiptDate: "@date", + useInfo: "@csentence", + }, + ], + }, + { + "list|20-30": [ + { + "id|+1": 0, + billserial: "@integer(100000000,199999999)1", + proposer: "吕才卓", + billType: "@integer(0,4)", + receiptNum: "@integer(1,10)张", + receiptDate: "@date", + useInfo: "@csentence", + }, + ], + }, + { + "list|20-30": [ + { + "id|+1": 0, + billserial: "@integer(100000000,199999999)1", + proposer: "刘欣宇", + billType: "@integer(0,4)", + receiptNum: "@integer(1,10)张", + receiptDate: "@date", + useInfo: "@csentence", + }, + ], + }, +]); const personName = () => { return [ @@ -83,4 +137,31 @@ export default [ }; }, }, + { + url: "/api/receiptList", + method: "post", + response: (req) => { + if (req.body.name === "孙东宇") { + return { + code: 200, + data: ReceiptList[0].list, + }; + } else if (req.body.name === "杨春宇") { + return { + code: 200, + data: ReceiptList[1].list, + }; + } else if (req.body.name === "吕才卓") { + return { + code: 200, + data: ReceiptList[2].list, + }; + } else { + return { + code: 200, + data: ReceiptList[3].list, + }; + } + }, + }, ]; diff --git a/src/api/finance-bill-manage/receiptList.js b/src/api/finance-bill-manage/receiptList.js index 6ca8a2d..236e85b 100644 --- a/src/api/finance-bill-manage/receiptList.js +++ b/src/api/finance-bill-manage/receiptList.js @@ -2,6 +2,8 @@ import request from "@/utils/requestMock"; const API = { PERSON_LIST: "/personName", + RECEIPT_LIST: "/receiptList", }; export const reqPersonName = () => request.get(API.PERSON_LIST); +export const reqReceiptList = (data) => request.post(API.RECEIPT_LIST, data); diff --git a/src/pages/finance-bill-manage/billCancel.vue b/src/pages/finance-bill-manage/billCancel.vue index 176872a..1926e73 100644 --- a/src/pages/finance-bill-manage/billCancel.vue +++ b/src/pages/finance-bill-manage/billCancel.vue @@ -371,7 +371,7 @@ const headerQuery = () => { if ( scarchData.value.billserial === "" && scarchData.value.billType === "" && - scarchData.value.stockDate === "" + scarchData.value.appleDate === "" ) { arrList = item; } diff --git a/src/pages/finance-bill-manage/billReceipt.vue b/src/pages/finance-bill-manage/billReceipt.vue index 62d31cd..63a13f5 100644 --- a/src/pages/finance-bill-manage/billReceipt.vue +++ b/src/pages/finance-bill-manage/billReceipt.vue @@ -35,6 +35,28 @@ maxlength="10" > + + + + + + + + + 查询 @@ -75,32 +97,6 @@ }} - - @@ -110,35 +106,156 @@ diff --git a/src/stores/billReceipt.js b/src/stores/billReceipt.js index 6a73ca8..2de74cd 100644 --- a/src/stores/billReceipt.js +++ b/src/stores/billReceipt.js @@ -1,10 +1,14 @@ import { defineStore } from "pinia"; -import { reqPersonName } from "@/api/finance-bill-manage/receiptList"; +import { + reqPersonName, + reqReceiptList, +} from "@/api/finance-bill-manage/receiptList"; export const useReceiptList = defineStore("ReceiptList", { state: () => { return { personName: [], + receiptList: [], }; }, actions: { @@ -14,6 +18,12 @@ export const useReceiptList = defineStore("ReceiptList", { console.log(this.personName); return this.personName; }, + + async getReceiptList(obj) { + const { data } = await reqReceiptList(obj); + this.receiptList = data; + return this.receiptList; + }, }, persist: true, });