diff --git a/DSWeb/Areas/Account/Controllers/Chfee_settlementController.cs b/DSWeb/Areas/Account/Controllers/Chfee_settlementController.cs index 072c1a1c..421afe72 100644 --- a/DSWeb/Areas/Account/Controllers/Chfee_settlementController.cs +++ b/DSWeb/Areas/Account/Controllers/Chfee_settlementController.cs @@ -693,11 +693,30 @@ namespace DSWeb.Areas.Account.Controllers public ContentResult Lock(string bill, string remark,string billtype="0") { + var headData = ChsettlementDAL.GetData("BILLNO='" + bill + "'"); + var errstr = ""; + if (headData.AMOUNTRMB != 0 || headData.AMOUNTUSD != 0) + { + if (headData.ACCOUNTS_MONEY == 0 && headData.AHSR_MONEY == 0 && headData.PREPAY_MONEY == 0 && headData.FINANCIAL_MONEY == 0 && headData.ADVANCE_MONEY == 0) + { + errstr = errstr + " 预收付信息有错误不允许锁定!"; + } + + } + + if (!string.IsNullOrEmpty(errstr)) + { + var result2 = new DBResult(); + result2.Success = false; + result2.Message = errstr; + var json2 = JsonConvert.Serialize(result2); + return new ContentResult() { Content = json2 }; + } DBResult result = ChsettlementDAL.Lock(bill,remark); if (result.Success) { if (billtype == "2") { - var headData = ChsettlementDAL.GetData("BILLNO='"+ bill + "'"); + if (!string.IsNullOrEmpty(headData.INVOICENO) || !string.IsNullOrEmpty(headData.INVOICEDATE) || !string.IsNullOrEmpty(headData.INVOICEAMOUNT)) { T_ALL_DA T_ALL_DA = new T_ALL_DA(); @@ -746,6 +765,26 @@ namespace DSWeb.Areas.Account.Controllers public ContentResult LockListNew(string data) { var headList = JsonConvert.Deserialize>(data); + var errstr = ""; + foreach (var bill in headList) + { + if (bill.AMOUNTRMB != 0 || bill.AMOUNTUSD != 0) { + if (bill.ACCOUNTS_MONEY == 0 && bill.AHSR_MONEY == 0 && bill.PREPAY_MONEY == 0 && bill.FINANCIAL_MONEY == 0 && bill.ADVANCE_MONEY == 0) { + errstr = errstr + " 单号:" + bill.BILLNO + " 预收付信息有错误"; + } + + } + + } + if (!string.IsNullOrEmpty(errstr)) { + var result2 = new DBResult(); + result2.Success = false; + result2.Message = errstr+" 不能锁定"; + var json2 = JsonConvert.Serialize(result2); + return new ContentResult() { Content = json2 }; + } + + DBResult result = ChsettlementDAL.LockListNew(headList); var json = JsonConvert.Serialize(result); diff --git a/DSWeb/Areas/Account/Viewsjs/Chfee_settlement/ChRecvsettlementIndex.js b/DSWeb/Areas/Account/Viewsjs/Chfee_settlement/ChRecvsettlementIndex.js index 74a596b4..fccad7dd 100644 --- a/DSWeb/Areas/Account/Viewsjs/Chfee_settlement/ChRecvsettlementIndex.js +++ b/DSWeb/Areas/Account/Viewsjs/Chfee_settlement/ChRecvsettlementIndex.js @@ -1223,7 +1223,7 @@ Ext.extend(Shipping.MsChRecvsettlementIndex, Ext.Panel, { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectBillFirst, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } - + var bodyAddDatas = []; var BILLNOStr = ''; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; @@ -1235,6 +1235,7 @@ Ext.extend(Shipping.MsChRecvsettlementIndex, Ext.Panel, { BILLNOStr = BILLNOStr + ',' + BILLNO; } + bodyAddDatas.push(rec); } } @@ -1245,11 +1246,12 @@ Ext.extend(Shipping.MsChRecvsettlementIndex, Ext.Panel, { if (BILLNOStr == '') { } else { + var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.Ajax.request({ waitMsg: Zi.LAN.Msg_Adding, - url: '/Account/Chfee_settlement/LockList', + url: '/Account/Chfee_settlement/LockListNew', params: { - bills: BILLNOStr + data: jsonbodyAddDatas }, callback: function (options, success, response) { if (success) {