From 74ba7fbd2d1da51bce2fb6e4244587c5e2db091f Mon Sep 17 00:00:00 2001 From: shawnzhang Date: Tue, 2 Jun 2020 17:39:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=BD=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 26 +++ src/lang/en.js | 4 +- src/lang/zh.js | 3 +- src/views/BasicSettings/ReviewPackage.vue | 1 + .../BasicSettings/components/MyApproval2.vue | 2 +- src/views/Expenses/ExpensesList.vue | 49 +++++ src/views/SaleContract/SaleContractList.vue | 4 +- src/views/SaleOrder/AddSaleOrder.vue | 12 +- .../SupplierAdjust/AddSupplierAdjust.vue | 9 +- .../SupplierAdjust/SupplierAdjustList.vue | 197 +++++++++++++++++- .../SupplierAdjust/components/MyDialog.vue | 12 +- src/views/Transfer/TransferList.vue | 36 ++++ 12 files changed, 328 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 46c1868d..b8345959 100644 --- a/README.md +++ b/README.md @@ -382,4 +382,30 @@ console.log(c); for (i in a){ a[i] = Object.assign(a[i],b[i]) } +``` + +#### json中key值相同时把其他值相加合并 + +``` +function trans (arr) { + let obj = {} + let result = [] + arr.forEach(({name, value}) => { + let cur = obj[name] + if (cur) { + let index = cur.index + result[index].value += value + } else { + let index = result.length + obj[name] = { + name, + index + } + result.push({name, value}) + } + }) + return result +} +var arr = [{name: "上海", value: 1},{name: "上海", value: 2},{name: "北京", value: 3},{name: "杭州", value: 2}] +trans(arr) ``` \ No newline at end of file diff --git a/src/lang/en.js b/src/lang/en.js index 37ca42c9..01a47ffd 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -4419,6 +4419,8 @@ export default { bmpx: 'Coding order', xhpx: 'Sort by number', isSecondApply: 'isSecondApply', - ecfqzzdywly: 'The second installment is only for non-sourced' + ecfqzzdywly: 'The second installment is only for non-sourced', + hzje: 'Aggregate amount' + } } diff --git a/src/lang/zh.js b/src/lang/zh.js index 1b64c786..953a6975 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -4419,6 +4419,7 @@ export default { bmpx: '编码排序', xhpx: '序号排序', isSecondApply: '是否二次分期', - ecfqzzdywly: '二次分期只针对于无来源' + ecfqzzdywly: '二次分期只针对于无来源', + hzje: '汇总金额' } } diff --git a/src/views/BasicSettings/ReviewPackage.vue b/src/views/BasicSettings/ReviewPackage.vue index 85d184b8..598c5dd2 100644 --- a/src/views/BasicSettings/ReviewPackage.vue +++ b/src/views/BasicSettings/ReviewPackage.vue @@ -366,6 +366,7 @@ export default { offset: 100 }) } + this.$refs.newApprovalTable.clear() this.saveloding = false this.clearNewParms() this.getlist() diff --git a/src/views/BasicSettings/components/MyApproval2.vue b/src/views/BasicSettings/components/MyApproval2.vue index 6bebfea5..b2a3403c 100644 --- a/src/views/BasicSettings/components/MyApproval2.vue +++ b/src/views/BasicSettings/components/MyApproval2.vue @@ -1,5 +1,5 @@ + + + @@ -356,7 +357,7 @@ export default { console.log(row) } } - row.newSalePrice = row.calcitem / 100 * row.newPrice + row.newSalePrice = row.calcitem / 100 * row.newIncludeTaxPrice }, // 计算单价 getprice(row) { @@ -543,9 +544,9 @@ export default { val.supplierDetailVos[i].oldPrice = val.supplierDetailVos[i].price val.supplierDetailVos[i].oldIncludeTaxPrice = val.supplierDetailVos[i].includeTaxPrice val.supplierDetailVos[i].oldTaxRate = val.supplierDetailVos[i].taxRate - val.supplierDetailVos[i].newPrice = 0 - val.supplierDetailVos[i].newIncludeTaxPrice = 0 - val.supplierDetailVos[i].newTaxRate = 0 + val.supplierDetailVos[i].newPrice = val.supplierDetailVos[i].price + val.supplierDetailVos[i].newIncludeTaxPrice = val.supplierDetailVos[i].includeTaxPrice + val.supplierDetailVos[i].newTaxRate = val.supplierDetailVos[i].taxRate this.$refs.editable.insert(val.supplierDetailVos[i]) } this.supplierId = val.supplierName diff --git a/src/views/SupplierAdjust/SupplierAdjustList.vue b/src/views/SupplierAdjust/SupplierAdjustList.vue index 24c6497c..57945c4c 100644 --- a/src/views/SupplierAdjust/SupplierAdjustList.vue +++ b/src/views/SupplierAdjust/SupplierAdjustList.vue @@ -24,7 +24,18 @@ {{ $t('public.export') }} + {{ $t('updates.drsj') }} + + + + 取 消 + + {{ $t('public.add') }} @@ -108,7 +119,7 @@