From 93a384dfdf5c997201cc033df3f5164990b5375f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Fri, 30 Apr 2021 00:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=87=87=E8=B4=AD=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E7=9A=84=E8=B4=A6=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jshERP-web/src/utils/util.js | 18 ++++++++++++++++++ .../src/views/bill/dialog/ManyAccountModal.vue | 6 +++--- .../src/views/bill/modules/PurchaseInModal.vue | 7 ++++--- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/jshERP-web/src/utils/util.js b/jshERP-web/src/utils/util.js index ddcd9e57..8b667acf 100644 --- a/jshERP-web/src/utils/util.js +++ b/jshERP-web/src/utils/util.js @@ -544,4 +544,22 @@ export function removeByVal(arrylist, val) { break; } } +} + +/** + * 将数组单个金额中的数值转为负数 + * @param arr + * @returns {Array} + */ +export function changeListFmtMinus(arr) { + var newArr = new Array(); + for(var i=0; i { diff --git a/jshERP-web/src/views/bill/modules/PurchaseInModal.vue b/jshERP-web/src/views/bill/modules/PurchaseInModal.vue index 588e338e..1ffc5c85 100644 --- a/jshERP-web/src/views/bill/modules/PurchaseInModal.vue +++ b/jshERP-web/src/views/bill/modules/PurchaseInModal.vue @@ -123,7 +123,7 @@ import { FormTypes } from '@/utils/JEditableTableUtil' import { JEditableTableMixin } from '@/mixins/JEditableTableMixin' import { BillModalMixin } from '../mixins/BillModalMixin' - import { getMpListShort } from "@/utils/util" + import { getMpListShort, changeListFmtMinus} from "@/utils/util" import JDate from '@/components/jeecg/JDate' import Vue from 'vue' export default { @@ -238,7 +238,8 @@ for(let item of detailArr){ totalPrice += item.allPrice-0 } - billMain.totalPrice = totalPrice + billMain.totalPrice = 0-totalPrice + billMain.changeAmount = 0-billMain.changeAmount if(billMain.accountId === 0) { billMain.accountId = '' } @@ -254,7 +255,7 @@ }, manyAccountModalFormOk(idList, moneyList, allPrice) { this.accountIdList = idList - this.accountMoneyList = moneyList + this.accountMoneyList = changeListFmtMinus(moneyList) this.$nextTick(() => { this.form.setFieldsValue({'changeAmount':allPrice}) });