From 1bbb64d8371bcb3572a7f7aaa73cfadbf13a5630 Mon Sep 17 00:00:00 2001 From: ycy <2861518472@qq.com> Date: Tue, 9 Apr 2024 10:48:03 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E2=9C=A8=20feat:=E7=A5=A8=E6=8D=AE?= =?UTF-8?q?=E6=A0=B8=E9=94=80=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 --- src/pages/finance-bill-manage/billDestroy.vue | 12 ++++++-- src/stores/billDestroy.js | 29 +++++++++++++++---- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/pages/finance-bill-manage/billDestroy.vue b/src/pages/finance-bill-manage/billDestroy.vue index 499baed..018893e 100644 --- a/src/pages/finance-bill-manage/billDestroy.vue +++ b/src/pages/finance-bill-manage/billDestroy.vue @@ -206,6 +206,13 @@ const columns = ref([ align: "center", width: "100", }, + { + colKey: "breakInfo", + title: "报损原因", + ellipsis: true, + align: "center", + width: "100", + }, { colKey: "status", title: "操作", @@ -337,12 +344,13 @@ const FORM_RULES = { const breakSub = async ({ validateResult, firstError }) => { if (validateResult === true) { dialogData.value = { - ...rowItem.row.value, + ...rowItem.value.row, + breakStatus: Number(dialogData.value.Status), }; await destroyList.auditDestroyList(dialogData.value); getNewTable(); - MessagePlugin.success("提交成功"); visiblePost.value = false; + MessagePlugin.success("提交成功"); } else { console.log("Validate Errors: ", firstError, validateResult); } diff --git a/src/stores/billDestroy.js b/src/stores/billDestroy.js index d4a463e..9cd9510 100644 --- a/src/stores/billDestroy.js +++ b/src/stores/billDestroy.js @@ -8,15 +8,32 @@ export const useDestroy = defineStore("destroyList", { }, actions: { async getDestroyList() { - this.destroyList = JSON.parse( - localStorage.getItem("breakageList") - ).destroyList; - console.log(this.destroyList); + const storedData = localStorage.getItem("breakageList"); + if (storedData) { + const parsedData = JSON.parse(storedData); + this.destroyList = parsedData.destroyList; + } return this.destroyList; }, auditDestroyList(item) { - console.log(item); - // let arr = thisz + const storedData = localStorage.getItem("breakageList"); + if (storedData) { + const parsedData = JSON.parse(storedData); + parsedData.destroyList = parsedData.destroyList.filter( + (i) => i.id !== item.id + ); + parsedData.breakageList = parsedData.breakageList.map((i) => { + console.log(i.id, item.id); + if (i.id === item.id) { + console.log(item.breakStatus); + return { ...i, breakStatus: item.breakStatus }; // 返回更新后的对象 + } + return i; // 保持其他项不变 + }); + console.log(parsedData.breakageList); + localStorage.setItem("breakageList", JSON.stringify(parsedData)); + this.destroyList = parsedData.destroyList; // 更新store中的destroyList状态 + } }, }, persist: true, From 44a85343a5ccb4f7495aae336a604ec2fa36b1fa Mon Sep 17 00:00:00 2001 From: sundongyu <2811054731@qq.com> Date: Tue, 9 Apr 2024 13:08:04 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E2=9C=A8=20feat:=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E5=9B=BE=E8=A1=A8=E8=A1=A8=E5=8F=AF=E4=BB=A5=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E5=A4=9A=E4=B8=AA=E7=BB=B4=E5=BA=A6=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/modules/sdy.js | 49 ++- package-lock.json | 28 ++ package.json | 1 + src/api/receivables-management/management.js | 11 +- src/layout/components/LayoutAside.vue | 3 + .../receivables-management/studentLoan.vue | 402 ++++++++++++++++++ src/router/modules/receivablesManagement.js | 6 + 7 files changed, 498 insertions(+), 2 deletions(-) create mode 100644 src/pages/receivables-management/studentLoan.vue diff --git a/mock/modules/sdy.js b/mock/modules/sdy.js index f748914..cf606e8 100644 --- a/mock/modules/sdy.js +++ b/mock/modules/sdy.js @@ -13,6 +13,20 @@ const data = Mock.mock({ } ] }) +const loans = Mock.mock({ + "list|45": [ + { + "id|+1": 1, + 'proposer': '@cname', + 'student': '@integer(100000000,999999999)', + 'allowance': '@integer(10000,50000)', + 'department': '@pick(["机电工程系","护理分院","建筑系","材料科学与工程系","环境科学与工程系"])', + 'cation': '@pick(["2021-2022学年度","2022-2023学年度"])', + 'loanTerm': '@pick(["已放款","未放款"])', + 'timeofapplication': '@date("yyyy-MM-dd")', + } + ] +}) export default [ { url: '/get-sdy-managment-list', @@ -58,5 +72,38 @@ export default [ code: 200, } } - } + }, + // 借款管理 + { + url: '/get-sdy-loan-list', + method: 'get', + response: () => { + return { + code: 200, + data: loans + } + } + }, + // 添加借款人 + { + url: '/post-sdy-loan-add', + method: 'post', + response: (req) => { + const newLoan = { + id: loans.list.length + 1, + proposer: req.body.proposer, + student: req.body.student, + allowance: req.body.allowance, + department: req.body.department, + cation: req.body.cation, + loanTerm: req.body.loanTerm, + timeofapplication: req.body.timeofapplication, + } + loans.list.push(newLoan) + return { + code: 200, + data: newLoan + } + } + }, ] \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7f33dcb..243e37f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "axios": "^1.6.8", "dayjs": "^1.11.10", + "echarts": "^5.5.0", "less": "^4.2.0", "mockjs": "^1.1.0", "pinia": "^2.1.7", @@ -1024,6 +1025,20 @@ "node": ">=0.4.0" } }, + "node_modules/echarts": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.5.0.tgz", + "integrity": "sha512-rNYnNCzqDAPCr4m/fqyUFv7fD9qIsd50S6GDFgO1DxZhncCsNsG7IfUlAlvZe5oSEQxtsjnHiUuppzccry93Xw==", + "dependencies": { + "tslib": "2.3.0", + "zrender": "5.5.0" + } + }, + "node_modules/echarts/node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + }, "node_modules/ee-first": { "version": "1.1.1", "license": "MIT" @@ -2058,6 +2073,19 @@ "version": "3.1.1", "dev": true, "license": "ISC" + }, + "node_modules/zrender": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.5.0.tgz", + "integrity": "sha512-O3MilSi/9mwoovx77m6ROZM7sXShR/O/JIanvzTwjN3FORfLSr81PsUGd7jlaYOeds9d8tw82oP44+3YucVo+w==", + "dependencies": { + "tslib": "2.3.0" + } + }, + "node_modules/zrender/node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" } } } diff --git a/package.json b/package.json index 98f0615..a027f07 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "axios": "^1.6.8", "dayjs": "^1.11.10", + "echarts": "^5.5.0", "less": "^4.2.0", "mockjs": "^1.1.0", "pinia": "^2.1.7", diff --git a/src/api/receivables-management/management.js b/src/api/receivables-management/management.js index f7740e3..317622d 100644 --- a/src/api/receivables-management/management.js +++ b/src/api/receivables-management/management.js @@ -1,8 +1,17 @@ import request from '@/utils/request' - +// 收款管理 export function APIReceivablesList() { return request.get('/get-sdy-managment-list') } +//查询收款 export function APIReceivablesAdd(data) { return request.post('/post-sdy-managment-find', data) +} +//贷款管理 +export function APILoansList() { + return request.get('/get-sdy-loan-list') +} +//查询贷款 +export function APILoansAdd(data) { + return request.post('/post-sdy-loan-add', data) } \ No newline at end of file diff --git a/src/layout/components/LayoutAside.vue b/src/layout/components/LayoutAside.vue index 7647ca5..133932b 100644 --- a/src/layout/components/LayoutAside.vue +++ b/src/layout/components/LayoutAside.vue @@ -42,6 +42,9 @@ 学生收款 + + 助学贷款 +