From 77b603829628c942b54c00fb791e5e449ce60f44 Mon Sep 17 00:00:00 2001 From: caoxinyu Date: Tue, 24 Sep 2019 17:24:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssemblyQualityInspection/index.vue | 6 ++- .../index.vue | 10 ++-- .../PartsNumberMaintenance/index.vue | 48 ++++++++++++------- src/views/BasicData/ShiftManagement/index.vue | 43 +++++++++-------- .../SystemRrolemaintenance/index.vue | 11 +++-- .../WorkshopPersonnelRoleMana/index.vue | 31 +++++++----- .../PurchaseContractReview/index.vue | 3 +- .../PurchaseContractSearch/index.vue | 12 +++-- .../TechnologyCenter/QueryParts/index.vue | 14 ++++-- 9 files changed, 107 insertions(+), 71 deletions(-) diff --git a/src/views/Assembly/AssemblyQualityInspection/index.vue b/src/views/Assembly/AssemblyQualityInspection/index.vue index b49aecf2..f6475a73 100644 --- a/src/views/Assembly/AssemblyQualityInspection/index.vue +++ b/src/views/Assembly/AssemblyQualityInspection/index.vue @@ -34,11 +34,13 @@ :value="item.value"/> 查询 - 导出 + + 导出 + - + @@ -167,9 +167,14 @@ {{ scope.row.已付金额 }} + + + @@ -187,6 +192,7 @@ import { timeToStamp } from '@/utils/tool' export default { data() { return { + selectContents: [], getDate: null, tableData0: [], pickerOptions: { @@ -319,7 +325,7 @@ export default { this.tableData01 = response.data this.tableData01.map(v => { this.$set(v, '请款金额', 0) - v.请款金额 = v.含税总金额 - v.已付金额 + v.请款金额 = v.含税总金额 - v.已付金额 - v.申请中金额 return v }) }) @@ -331,6 +337,7 @@ export default { return parseInt(row.已请款) !== 1 // 已经请款 }, handleSelectionChange(val) { + this.selectContents = val this.SUM = 0 this.contractGroup = [] this.sumGroup = [] @@ -342,13 +349,31 @@ export default { }, submitRequestFund() { // 确认请款 if (this.supplierValue && this.contractGroup.length !== 0) { - submitRequestFund(this.contractGroup, this.sumGroup, this.supplierValue, this.SUM, this.id).then(response => { - if (response.data[0].result === '1') { - this.$message.success('请款成功') - this.searchTable1() - this.dialogVisible2 = false - } else { this.$message.error('请款失败') } - }) + this.SUM = 0 + this.contractGroup = [] + this.sumGroup = [] + for (let i = 0; i < this.tableData01.length; i++) { + for (let j = 0; j < this.selectContents.length; j++) { + if (this.selectContents[j].采购合同流水号 === this.tableData01[i].采购合同流水号) { + this.SUM += parseFloat(this.tableData01[i].请款金额) + this.contractGroup.push(this.tableData01[i].采购合同流水号) + this.sumGroup.push(this.tableData01[i].请款金额) + } + } + } + if (this.SUM === 0) { + this.$message.error('请款金额不能为0') + } else { + submitRequestFund(this.contractGroup, this.sumGroup, this.supplierValue, this.SUM, this.id).then(response => { + if (response.data[0].result === '1') { + this.$message.success('请款成功') + this.searchTable1() + this.dialogVisible2 = false + } else { + this.$message.error('请款失败') + } + }) + } } else { this.$message.error('请选择需要请款的合同') }