From 9dffb46b18de459dd4b3d742b4d1ed2ee4474f70 Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Mon, 20 Jan 2025 17:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/cost/cost.js | 20 +- .../material/cost/component/applyDetail.vue | 200 +------ .../material/cost/component/applyHome.vue | 46 +- .../material/cost/component/examDetail.vue | 502 +++++++++++------- .../material/cost/component/examHome.vue | 139 +++-- src/views/material/cost/costExamList.vue | 7 +- 6 files changed, 471 insertions(+), 443 deletions(-) diff --git a/src/api/cost/cost.js b/src/api/cost/cost.js index a2fa8d03..2b9e393b 100644 --- a/src/api/cost/cost.js +++ b/src/api/cost/cost.js @@ -64,8 +64,24 @@ export function submitCosts(params){ }) } - - +// 查询结算审批列表 +export function getSltList(query) { + return request({ + url: '/material/slt_agreement_info/getSltList', + method: 'get', + params: query + }) +} + + +// 结算审批提交 +export function costExamine(params){ + return request({ + url: '/material/slt_agreement_info/costExamine', + method: 'post', + data: params + }) +} diff --git a/src/views/material/cost/component/applyDetail.vue b/src/views/material/cost/component/applyDetail.vue index d3d647d1..824ada2e 100644 --- a/src/views/material/cost/component/applyDetail.vue +++ b/src/views/material/cost/component/applyDetail.vue @@ -4,12 +4,12 @@ 租赁明细导出 - 丢失明细导出 维修明细导出 报废明细导出 + 丢失明细导出 全部明细导出 --> -
+ -
+
结算费用
@@ -169,87 +169,11 @@
合计:
- {{ costAll }} + {{ costAll.toFixed(2) }}
- - -
- - - - - - - - - - - - - - - - - - - - -
- -
@@ -281,7 +205,6 @@ export default { loseCost: 0, costAll: 0, deptName: undefined, - applyVisible: false, applyList: [], projectName: undefined, //结算工程 unitName: undefined, //结算单位 @@ -369,7 +292,7 @@ export default { .confirm('是否确认提交?') .then(() => { let params = { - 'agreementId': this.rowData[0].agreementId, 'agreementCode': this.rowData[0].agreementCode,'totalCostAll': this.costAll, + 'agreementId': this.rowData.agreementId, 'agreementCode': this.rowData.agreementCode,'totalCostAll': this.costAll, 'leaseList': this.leaseList, 'repairList': this.repairList, 'scrapList': this.scrapList,'loseList': this.loseList, } console.log('2222222222222',params) @@ -378,7 +301,7 @@ export default { type: 'success', message: '提交成功', }) - this.$emit('handleBack') + this.$emit('goBackPage') }) }) .catch(() => {}) @@ -421,104 +344,7 @@ export default { Number(row.addCost || 0) - Number(row.subCost || 0) }, - /** 费用增项时触发的事件 */ - onAddChange(row) { - this.$message.closeAll() - const isRegex = this.isNumRegex(row.addCost) - if (!isRegex && row.addCost != '') { - this.$message.error('请输入大于等于0或包含两位小数点的数字!') - row.addCost = 0 - } - if (row.addCost * 1 >= 100000000) { - this.$message.error('增项费用不能超过1亿') - row.addCost = 99999999 - } - - // 判断减免费用框里金额是否过大,如果过大直接清空为 0 避免负数情况 - if ( - row.leaseCost + - row.repairCost + - row.scrapCost + - row.loseCost + - row.addCost * 1 < - row.subCost * 1 - ) { - row.subCost = 0 - } - row.addCost = row.addCost * 1 - - this.$nextTick(() => { - row.cost = ( - row.leaseCost + - row.repairCost + - row.scrapCost + - row.loseCost + - row.addCost * 1 - - row.subCost * 1 - ).toFixed(2) - }) - }, - /** 费用减项时触发事件 */ - onSubChange(row) { - this.$message.closeAll() - const isRegex = this.isNumRegex(row.subCost) - if (!isRegex && row.subCost != '') { - this.$message.error('请输入大于等于0或包含两位小数点的数字!') - row.subCost = 0 - } - row.subCost = row.subCost * 1 - if (row.subCost > row.cost && this.costAll <= row.cost) { - this.$message.error('减免费用不能超过小计费用') - row.subCost = row.cost - } - if (row.subCost > row.cost && this.costAll > row.cost) { - this.$message.error('减免费用不能超过小计费用') - row.subCost = this.costAll - } - - if (row.cost == 0 && row.subCost != '') { - this.$message.error('小计费用已为0,无法再减免') - row.subCost = 0 - } - - this.$nextTick(() => { - row.cost = ( - row.leaseCost + - row.repairCost + - row.scrapCost + - row.loseCost + - row.addCost * 1 - - row.subCost * 1 - ).toFixed(2) - }) - }, - isNumRegex(val) { - const regex = /^(0|[1-9]\d*)(\.\d{2})?$/ - const isNum = regex.test(val) - return isNum - }, - //提交按钮 - submitApply() { - let costAll = 0 - this.applyList.forEach((item) => { - costAll = costAll + item.cost * 1 - }) - console.log(costAll) - let param = { - relations: this.applyList, - cost: costAll, - } - console.log(param) - submitFee(param).then((res) => { - console.log(res) - if (res.code == 200) { - this.$tab.closeOpenPage({ - path: '/cost/cost/costApplyList', - }) - } - }) - }, //返回 handleBack() { this.$emit('goBackPage') @@ -532,7 +358,7 @@ export default { /** 导出按钮操作 */ //租赁 handleExport1() { - const params = this.rowData[0] + const params = this.rowData this.download( 'material/slt_agreement_info/exportLease', {...params,}, @@ -541,7 +367,7 @@ export default { }, //丢失 handleExport2() { - const params = this.rowData[0] + const params = this.rowData this.download( 'material/slt_agreement_info/exportLose', {...params,}, @@ -550,7 +376,7 @@ export default { }, // 维修 handleExport3() { - const params = this.rowData[0] + const params = this.rowData this.download( 'material/slt_agreement_info/exportRepair', {...params,}, @@ -559,7 +385,7 @@ export default { }, //报废 handleExport4() { - const params = this.rowData[0] + const params = this.rowData this.download( 'material/slt_agreement_info/exportScrap', {...params,}, @@ -573,7 +399,7 @@ export default { }, handleExportAll() { - const params = this.rowData[0] + const params = this.rowData this.download( 'material/slt_agreement_info/exportAll', {...params,}, diff --git a/src/views/material/cost/component/applyHome.vue b/src/views/material/cost/component/applyHome.vue index f0bc7e44..3badc698 100644 --- a/src/views/material/cost/component/applyHome.vue +++ b/src/views/material/cost/component/applyHome.vue @@ -49,10 +49,10 @@ filterable > @@ -88,7 +88,7 @@ - + - diff --git a/src/views/material/cost/costExamList.vue b/src/views/material/cost/costExamList.vue index 1a544386..97e7ffe9 100644 --- a/src/views/material/cost/costExamList.vue +++ b/src/views/material/cost/costExamList.vue @@ -8,8 +8,7 @@ /> @@ -30,16 +29,14 @@ export default { return { isShowComponent: 'ExamHome', pageContent: '', - rowId:"", rowData: null, isView: false, } }, methods: { // 退料编辑 - goDetail(rowData,id) { + goDetail(rowData) { this.rowData = rowData; - this.rowId = id; this.pageContent = '结算详情'; this.isShowComponent = 'ExamDetail'; },