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, });