From c6acb9e3834984e6087010c48e0e4798fbb01887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Tue, 7 Nov 2017 21:11:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BF=9D=E5=AD=98=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=E5=A4=B1=E8=B4=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/js/pages/materials/in_out.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/webapp/js/pages/materials/in_out.js b/src/main/webapp/js/pages/materials/in_out.js index b0668305..2165ad48 100644 --- a/src/main/webapp/js/pages/materials/in_out.js +++ b/src/main/webapp/js/pages/materials/in_out.js @@ -1998,15 +1998,20 @@ OrganId = $('#OrganId').combobox('getValue'); } var accountMoneyList = $("#AccountId").attr("data-accountmoneyarr"); //账户金额列表-多账户 - accountMoneyList = accountMoneyList.replace("[","").replace("]","").toString(); - var reg=new RegExp("\"","g"); //创建正则RegExp对象 - accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号 - var accountMoneyArr = accountMoneyList.split(","); //转为数组 + var accountMoneyArr; + if(accountMoneyList) { + accountMoneyList = accountMoneyList.replace("[","").replace("]","").toString(); + var reg=new RegExp("\"","g"); //创建正则RegExp对象 + accountMoneyList = accountMoneyList.replace(reg,""); //替换所有的双引号 + accountMoneyArr = accountMoneyList.split(","); //转为数组 + } if(listSubType === "采购"||listSubType === "零售退货"||listSubType === "销售退货"){ //付款为负数 ChangeAmount = 0 - ChangeAmount; TotalPrice = 0 - TotalPrice; - accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数 + if(accountMoneyArr) { + accountMoneyArr = changeListFmtMinus(accountMoneyArr); //将数组单个金额中的数值转为负数 + } } //零售时候,可以从会员预付款中扣款 var thisPayType = "现付"; @@ -2054,7 +2059,7 @@ PayType: thisPayType, //现付/预付款 Remark: $.trim($("#Remark").val()), AccountIdList: $("#AccountId").attr("data-accountarr"), //账户列表-多账户 - AccountMoneyList: JSON.stringify(accountMoneyArr), //账户金额列表-多账户 + AccountMoneyList: accountMoneyArr ? JSON.stringify(accountMoneyArr):"", //账户金额列表-多账户 Discount: $.trim($("#Discount").val()), DiscountMoney: $.trim($("#DiscountMoney").val()), DiscountLastMoney: $.trim($("#DiscountLastMoney").val()),