Commit 670e2dcf by yukang

部分BUG处理:账期维护、合同管理金额自动计算

parent cb2d4d4f
......@@ -71,6 +71,8 @@ public class ServiceHGCW001 extends ServiceBase {
HGCW001 HGCW001 = new HGCW001();
HGCW001.fromMap(resultRows.get(i));
HGCW001.setAccountPeriod(DateUtils.formatShort(HGCW001.getAccountPeriod()));
HGCW001.setAccountPeriodDateStart(DateUtils.formatShort(HGCW001.getAccountPeriodDateStart()));
HGCW001.setAccountPeriodDateEnd(DateUtils.formatShort(HGCW001.getAccountPeriodDateEnd()));
if (HGCW001.getId() == null || HGCW001.getId() == 0) {
this.add(HGCW001);
} else {
......
......@@ -71,8 +71,8 @@ function saveFunc() {
let companyCode= item.get("companyCode");
let accountYear= item.get("accountYear");
let accountPeriod= item.get("accountPeriod");
let accountPeriodDateStart= item.get("accountPeriodStatus");
let accountPeriodDateEnd= item.get("accountPeriodStatus");
let accountPeriodDateStart= item.get("accountPeriodDateStart");
let accountPeriodDateEnd= item.get("accountPeriodDateEnd");
if(isBlank(companyCode)){
message("选中的第"+(index+1)+"行\"公司名称\",不能为空!");
......@@ -99,6 +99,13 @@ function saveFunc() {
flag = false;
return false;
}
if(accountPeriodDateStart > accountPeriodDateEnd){
message("选中的第"+(index+1)+"行\"账期开始日期\"不能大于\"账期结束日期\"!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
......@@ -108,7 +108,43 @@ $(function() {
$("#result-0-mainContractNumber").val("");
}
}
},
"result-0-taxPoints": {
// 点击下拉选项时触发
select: function (e) { //获取勾选值
var allRows = detail1Grid.getDataItems();
if (allRows.length > 0) {
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
if (valueField) {
var taxPoints = valueField / 100;
var totalContractPriceIncluding = 0;
var valueAddedTax = 0;
//更新表格含税金额
for (var i = 0; i < allRows.length; i++) {
var row = allRows[i];
var totalPriceIncluding = row.totalPriceExcluding * (1 + parseFloat(taxPoints));
detail1Grid.setCellValue(row, 'totalPriceIncluding', totalPriceIncluding);
totalContractPriceIncluding += totalPriceIncluding;
}
$("#result-0-totalContractPriceIncluding").val(totalContractPriceIncluding.toFixed(3))
var totalPriceExcluding = $("#result-0-totalContractPriceExcluding").val();
valueAddedTax = parseFloat(totalContractPriceIncluding.toFixed(3)) - parseFloat(totalPriceExcluding);
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
} else {
var totalContractPriceExcluding = 0;
var valueAddedTax = 0;
for (var i = 0; i < allRows.length; i++) {
var row = allRows[i];
detail1Grid.setCellValue(row, 'totalPriceIncluding', row.totalPriceExcluding);
totalContractPriceExcluding += parseFloat(row.totalPriceExcluding);
}
$("#result-0-totalContractPriceIncluding").val(totalContractPriceExcluding.toFixed(3))
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
}
}
}
},
}
IPLATUI.EFPopupInput = {
......@@ -359,6 +395,41 @@ function fieldValidation() {
return;
}
}
var projCode = $("#result-0-projCode").val();
if (isBlank(projCode)) {
message("请选择项目!");
return;
}
var contractName = $("#result-0-contractName").val();
if (isBlank(contractName)) {
message("请填写合同名称!");
return;
}
var partyA = $("#result-0-partyA").val();
if (isBlank(partyA)) {
message("请选择甲方!");
return;
}
var planStartDate = $("#result-0-planStartDate").val();
if (isBlank(planStartDate)) {
message("请选择计划开工日期!");
return;
}
var planEndDate = $("#result-0-planEndDate").val();
if (isBlank(planEndDate)) {
message("请选择计划竣工日期!");
return;
}
var engineeringAddress = $("#result-0-engineeringAddress").val();
if (isBlank(engineeringAddress)) {
message("请填写工程地址!");
return;
}
var contractContent = $("#result-0-engineeringAddress").val();
if (isBlank(contractContent)) {
message("请填写合同内容!");
return;
}
}
function calculateAmount(item) {
......
......@@ -119,7 +119,43 @@ $(function() {
$("#result-0-partyA").val("");
$("#result-0-partyB").val("");
}
}
},
"result-0-taxPoints": {
// 点击下拉选项时触发
select: function (e) { //获取勾选值
var allRows = detail1Grid.getDataItems();
if (allRows.length > 0) {
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
if (valueField) {
var taxPoints = valueField / 100;
var totalContractPriceIncluding = 0;
var valueAddedTax = 0;
//更新表格含税金额
for (var i = 0; i < allRows.length; i++) {
var row = allRows[i];
var totalPriceIncluding = row.totalPriceExcluding * (1 + parseFloat(taxPoints));
detail1Grid.setCellValue(row, 'totalPriceIncluding', totalPriceIncluding);
totalContractPriceIncluding += totalPriceIncluding;
}
$("#result-0-totalContractPriceIncluding").val(totalContractPriceIncluding.toFixed(3))
var totalPriceExcluding = $("#result-0-totalContractPriceExcluding").val();
valueAddedTax = parseFloat(totalContractPriceIncluding.toFixed(3)) - parseFloat(totalPriceExcluding);
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
} else {
var totalContractPriceExcluding = 0;
var valueAddedTax = 0;
for (var i = 0; i < allRows.length; i++) {
var row = allRows[i];
detail1Grid.setCellValue(row, 'totalPriceIncluding', row.totalPriceExcluding);
totalContractPriceExcluding += parseFloat(row.totalPriceExcluding);
}
$("#result-0-totalContractPriceIncluding").val(totalContractPriceExcluding.toFixed(3))
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
}
}
}
},
}
IPLATUI.EFPopupInput = {
......@@ -496,5 +532,40 @@ function fieldValidation() {
return;
}
}
var projCode = $("#result-0-projCode").val();
if (!projCode) {
message("请选择项目!");
return;
}
var contractName = $("#result-0-contractName").val();
if (!contractName) {
message("请填写合同名称!");
return;
}
var partyA = $("#result-0-partyA").val();
if (!partyA) {
message("请选择甲方!");
return;
}
var planStartDate = $("#result-0-planStartDate").val();
if (!planStartDate) {
message("请选择计划开工日期!");
return;
}
var planEndDate = $("#result-0-planEndDate").val();
if (!planEndDate) {
message("请选择计划竣工日期!");
return;
}
var engineeringAddress = $("#result-0-engineeringAddress").val();
if (!engineeringAddress) {
message("请填写工程地址!");
return;
}
var contractContent = $("#result-0-engineeringAddress").val();
if (!contractContent) {
message("请填写合同内容!");
return;
}
}
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