Commit 59080613 by 13420

销售开票bug调整

parent 6fa0e9d8
...@@ -24,10 +24,34 @@ $(function() { ...@@ -24,10 +24,34 @@ $(function() {
} }
], ],
loadComplete: function (grid) { loadComplete: function (grid) {
//此grid对象
$("#SELECT_BILL").on("click",addFunc); $("#SELECT_BILL").on("click",addFunc);
$("#SAVE").on("click",saveFunc);
$("#SUBMIT").on("click",submitFunc); $("#SUBMIT").on("click",submitFunc);
$("#BTN_BILL").on("click",billFunc); $("#BTN_BILL").on("click",billFunc);
$("#SAVE").on("click",saveFunc);
grid.dataSource.bind("change",function(e){
var item = e.items[0];
if(e.field == "taxPoints"){
if(item.taxPoints && item.totalContractPriceIncluding){
let thisSettlementTax = item.taxPoints*item.totalContractPriceIncluding/100;
resultGrid.setCellValue(item,'thisSettlementTax',thisSettlementTax)
}
if(item.thisSettlementTax && item.totalContractPriceIncluding){
let thisSettlementAmount = item.totalContractPriceIncluding+item.thisSettlementTax;
resultGrid.setCellValue(item,'thisSettlementAmount',thisSettlementAmount)
}
loadChange(grid,e,"price");
}
}
)
}, },
onSuccess: function (e) { onSuccess: function (e) {
...@@ -73,6 +97,9 @@ function addFunc() { ...@@ -73,6 +97,9 @@ function addFunc() {
}); });
} }
/** /**
* 保存 * 保存
*/ */
......
...@@ -8,7 +8,7 @@ $(function() { ...@@ -8,7 +8,7 @@ $(function() {
cancelFunc(); cancelFunc();
}); });
$("#btn_save").on("click", function () { $("#btn_save").on("click", function () {
btnSaveFunc(); saveFunc();
}); });
IPLATUI.EFGrid.result = { IPLATUI.EFGrid.result = {
pageable: { pageable: {
...@@ -45,36 +45,54 @@ function cancelFunc() { ...@@ -45,36 +45,54 @@ function cancelFunc() {
parent.JSColorbox.setValueCallback(); parent.JSColorbox.setValueCallback();
} }
function btnSaveFunc() { /**
* 保存
*/
function saveFunc() {
let rows = resultGrid.getCheckedRows(); let rows = resultGrid.getCheckedRows();
if (rows.length < 1) { if (rows.length < 1) {
message("请选择数据") message("请选择数据");
return; return;
} }
for (let i = 0; i < rows.length; i++) { let flag = true;
let thisAmount = rows[i]['thisAmount']; $.each(rows, function(index, item) {
let remainingAmount = rows[i]['remainingAmount']; let reviewStatus= item.get("reviewStatus");
if (!isNumber(thisAmount) && !isPositiveNumber(thisAmount)) { if((reviewStatus === "1")){
message("勾选的第" + (i + 1) + "行本次开票金额必须是大于0的数字"); message("数据已审核");
return; flag = false;
return false;
} }
if (parseFloat(thisAmount) > parseFloat(remainingAmount)) { });
message("第" + (i + 1) + "行本次开票金额不能大于剩余结算金额"); if(flag) {
return; JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW010", "save", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
} }
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成销售开票单吗? ", { } else {
ok: function () { NotificationUtil(ei, "error");
JSUtils.submitGridsData("result", "HGCW010", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
} }
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
} }
); });
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
} }
}); });
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment