Compare commits
3 Commits
4f7ae569e9
...
fd43f2f71f
Author | SHA1 | Date |
---|---|---|
|
fd43f2f71f | |
|
09680c6b43 | |
|
8050f16a11 |
|
@ -107,8 +107,8 @@ $(function () {
|
||||||
|
|
||||||
//如果没有提交则自动计算预算信息
|
//如果没有提交则自动计算预算信息
|
||||||
dataIncome = prepareAjaxDataVerify(dataIncome, INCOME_DETAIL2, $("#id").val());
|
dataIncome = prepareAjaxDataVerify(dataIncome, INCOME_DETAIL2, $("#id").val());
|
||||||
if(dataIncome.details){
|
if (dataIncome.details) {
|
||||||
postAjax(base+"/project/budgetEditSaveIncomeDetail", dataIncome);
|
postAjax(base + "/project/budgetEditSaveIncomeDetail", dataIncome);
|
||||||
}
|
}
|
||||||
updateIncomeDataUnsubmit(dataIncomeCheck);
|
updateIncomeDataUnsubmit(dataIncomeCheck);
|
||||||
|
|
||||||
|
@ -127,8 +127,8 @@ $(function () {
|
||||||
|
|
||||||
//如果没有提交则自动计算预算信息
|
//如果没有提交则自动计算预算信息
|
||||||
dataCost = prepareAjaxDataVerify(dataCost, COST_DETAIL2, $("#id").val());
|
dataCost = prepareAjaxDataVerify(dataCost, COST_DETAIL2, $("#id").val());
|
||||||
if(dataCost){
|
if (dataCost) {
|
||||||
postAjax(base+"/project/budgetEditSaveCostDetail", dataCost);
|
postAjax(base + "/project/budgetEditSaveCostDetail", dataCost);
|
||||||
}
|
}
|
||||||
updateCostDataIfUnsubmit(dataCostCheck);
|
updateCostDataIfUnsubmit(dataCostCheck);
|
||||||
|
|
||||||
|
@ -146,17 +146,9 @@ $(function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
dataManage = prepareAjaxDataVerify(dataManage, COST_PROJECT_MANAGE_DETAIL2, $("#id").val());
|
dataManage = prepareAjaxDataVerify(dataManage, COST_PROJECT_MANAGE_DETAIL2, $("#id").val());
|
||||||
var totalTotal=dataManage.details.reduce((total,now)=>{
|
|
||||||
return now.total+total
|
if (dataManage) {
|
||||||
},0)
|
postAjax(base + "/project/budgetEditSaveCostProjectManageDetail", dataManage);
|
||||||
var projectGrossProfitA=$('[name="projectGrossProfitA"]').val()
|
|
||||||
if(Number(totalTotal)> (Number(projectGrossProfitA)*0.1) ){
|
|
||||||
layuiAlert(`总金额合计不能超过毛利A(${projectGrossProfitA})的10%`);
|
|
||||||
$("#saveDraft").attr('disabled', false)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if(dataManage){
|
|
||||||
postAjax(base+"/project/budgetEditSaveCostProjectManageDetail", dataManage);
|
|
||||||
}
|
}
|
||||||
updateCostProjectManageDataUnsubmit(dataManageCheck);
|
updateCostProjectManageDataUnsubmit(dataManageCheck);
|
||||||
|
|
||||||
|
@ -182,8 +174,8 @@ $(function () {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
dataPlan = prepareAjaxDataVerify(dataPlan, BUDGET_PLAN_DETAIL2, $("#id").val());
|
dataPlan = prepareAjaxDataVerify(dataPlan, BUDGET_PLAN_DETAIL2, $("#id").val());
|
||||||
if(dataPlan){
|
if (dataPlan) {
|
||||||
postAjax(base+"/project/budgetEditSaveBudgetPlanDetail", dataPlan);
|
postAjax(base + "/project/budgetEditSaveBudgetPlanDetail", dataPlan);
|
||||||
}
|
}
|
||||||
updateBudgetPlanDetailDataUnsubmit();
|
updateBudgetPlanDetailDataUnsubmit();
|
||||||
|
|
||||||
|
@ -195,15 +187,15 @@ $(function () {
|
||||||
// }
|
// }
|
||||||
// console.log(message);
|
// console.log(message);
|
||||||
// 保存付款计划表
|
// 保存付款计划表
|
||||||
var flagPay= verifyBudgetPay()
|
var flagPay = verifyBudgetPay()
|
||||||
if(!flagPay) {
|
if (!flagPay) {
|
||||||
$("#saveDraft").attr('disabled', false)
|
$("#saveDraft").attr('disabled', false)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var dataPay = collectData("am-modal-prompt-input-pay");
|
var dataPay = collectData("am-modal-prompt-input-pay");
|
||||||
dataPay = prepareAjaxDataVerify(dataPay, pay_DETAIL2, $("#id").val());
|
dataPay = prepareAjaxDataVerify(dataPay, pay_DETAIL2, $("#id").val());
|
||||||
if(dataPay){
|
if (dataPay) {
|
||||||
postAjax(base+"/project/budgetEditSaveBudgetPayPlan", dataPay);
|
postAjax(base + "/project/budgetEditSaveBudgetPayPlan", dataPay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -245,8 +237,8 @@ $(function () {
|
||||||
|
|
||||||
//如果没有提交则自动计算预算信息
|
//如果没有提交则自动计算预算信息
|
||||||
dataIncome = prepareAjaxDataVerify(dataIncome, INCOME_DETAIL, $("#id").val());
|
dataIncome = prepareAjaxDataVerify(dataIncome, INCOME_DETAIL, $("#id").val());
|
||||||
if(dataIncome.details){
|
if (dataIncome.details) {
|
||||||
postAjax(base+"/project/budgetEditSaveIncomeDetail", dataIncome);
|
postAjax(base + "/project/budgetEditSaveIncomeDetail", dataIncome);
|
||||||
}
|
}
|
||||||
updateIncomeDataUnsubmit(dataIncomeCheck);
|
updateIncomeDataUnsubmit(dataIncomeCheck);
|
||||||
|
|
||||||
|
@ -265,8 +257,8 @@ $(function () {
|
||||||
|
|
||||||
//如果没有提交则自动计算预算信息
|
//如果没有提交则自动计算预算信息
|
||||||
dataCost = prepareAjaxDataVerify(dataCost, COST_DETAIL, $("#id").val());
|
dataCost = prepareAjaxDataVerify(dataCost, COST_DETAIL, $("#id").val());
|
||||||
if(dataCost){
|
if (dataCost) {
|
||||||
postAjax(base+"/project/budgetEditSaveCostDetail", dataCost);
|
postAjax(base + "/project/budgetEditSaveCostDetail", dataCost);
|
||||||
}
|
}
|
||||||
updateCostDataIfUnsubmit(dataCostCheck);
|
updateCostDataIfUnsubmit(dataCostCheck);
|
||||||
|
|
||||||
|
@ -285,16 +277,21 @@ $(function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
dataManage = prepareAjaxDataVerify(dataManage, COST_PROJECT_MANAGE_DETAIL, $("#id").val());
|
dataManage = prepareAjaxDataVerify(dataManage, COST_PROJECT_MANAGE_DETAIL, $("#id").val());
|
||||||
var totalTotal=dataManage.details.reduce((total,now)=>{
|
var totalTotal = dataManage.details.reduce((total, now) => {
|
||||||
return now.total+total
|
return now.total + total
|
||||||
},0)
|
}, 0)
|
||||||
var projectGrossProfitA=$('[name="projectGrossProfitA"]').val()
|
var limitTotal = dataManage.details.reduce((total, now) => {
|
||||||
if(Number(totalTotal)> (Number(projectGrossProfitA)*0.1) ){
|
if (now.type == 2 && (now.name == 5 || now.name == 4))
|
||||||
layuiAlert(`总金额合计不能超过毛利A(${projectGrossProfitA})的10%`);
|
return now.total + total
|
||||||
|
else return total
|
||||||
|
}, 0)
|
||||||
|
var projectGrossProfitA = $('[name="projectGrossProfitA"]').val()
|
||||||
|
if (limitTotal > ((Number(projectGrossProfitA)-(totalTotal-limitTotal)) * 0.1)) {
|
||||||
|
layuiAlert(`差旅费+业务费总金额不超过【毛利A(${projectGrossProfitA})-(项目管理费用-差旅费-业务费)】*10%`);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(dataManage){
|
if (dataManage) {
|
||||||
postAjax(base+"/project/budgetEditSaveCostProjectManageDetail", dataManage);
|
postAjax(base + "/project/budgetEditSaveCostProjectManageDetail", dataManage);
|
||||||
}
|
}
|
||||||
updateCostProjectManageDataUnsubmit(dataManageCheck);
|
updateCostProjectManageDataUnsubmit(dataManageCheck);
|
||||||
|
|
||||||
|
@ -321,8 +318,8 @@ $(function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
dataPlan = prepareAjaxDataVerify(dataPlan, BUDGET_PLAN_DETAIL, $("#id").val());
|
dataPlan = prepareAjaxDataVerify(dataPlan, BUDGET_PLAN_DETAIL, $("#id").val());
|
||||||
if(dataPlan){
|
if (dataPlan) {
|
||||||
postAjax(base+"/project/budgetEditSaveBudgetPlanDetail", dataPlan);
|
postAjax(base + "/project/budgetEditSaveBudgetPlanDetail", dataPlan);
|
||||||
}
|
}
|
||||||
updateBudgetPlanDetailDataUnsubmit();
|
updateBudgetPlanDetailDataUnsubmit();
|
||||||
|
|
||||||
|
@ -333,15 +330,15 @@ $(function () {
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// 保存付款计划表
|
// 保存付款计划表
|
||||||
var flagPay= verifyBudgetPay()
|
var flagPay = verifyBudgetPay()
|
||||||
if(!flagPay) {
|
if (!flagPay) {
|
||||||
$("#saveDraft").attr('disabled', false)
|
$("#saveDraft").attr('disabled', false)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var dataPay = collectData("am-modal-prompt-input-pay");
|
var dataPay = collectData("am-modal-prompt-input-pay");
|
||||||
dataPay = prepareAjaxDataVerify(dataPay, pay_DETAIL2, $("#id").val());
|
dataPay = prepareAjaxDataVerify(dataPay, pay_DETAIL2, $("#id").val());
|
||||||
if(dataPay){
|
if (dataPay) {
|
||||||
postAjax(base+"/project/budgetEditSaveBudgetPayPlan", dataPay);
|
postAjax(base + "/project/budgetEditSaveBudgetPayPlan", dataPay);
|
||||||
}
|
}
|
||||||
|
|
||||||
var startTime = $("#startDate").val();
|
var startTime = $("#startDate").val();
|
||||||
|
@ -358,7 +355,7 @@ $(function () {
|
||||||
$("#pmsForm").submit();
|
$("#pmsForm").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
function checkName () {
|
function checkName() {
|
||||||
var name = $("#name").val();
|
var name = $("#name").val();
|
||||||
var id = $("#id").val();
|
var id = $("#id").val();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -412,8 +409,6 @@ function checkIfFillIn() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if (projectNo.length <= 0) {
|
// if (projectNo.length <= 0) {
|
||||||
// window.confirm('项目编号不能为空');
|
// window.confirm('项目编号不能为空');
|
||||||
// check = 1;
|
// check = 1;
|
||||||
|
@ -428,9 +423,6 @@ function checkIfFillIn() {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (underwrittenMode > 2 && (advanceInterestAmount == undefined || advanceInterestAmount.length <= 0)) {
|
if (underwrittenMode > 2 && (advanceInterestAmount == undefined || advanceInterestAmount.length <= 0)) {
|
||||||
window.confirm('垫资利息不能为空');
|
window.confirm('垫资利息不能为空');
|
||||||
check = 1;
|
check = 1;
|
||||||
|
@ -525,7 +517,7 @@ function checkIfFillIn() {
|
||||||
/**
|
/**
|
||||||
* 判断是否重名
|
* 判断是否重名
|
||||||
*/
|
*/
|
||||||
function checkName () {
|
function checkName() {
|
||||||
var name = $("#name").val();
|
var name = $("#name").val();
|
||||||
var id = $("#id").val();
|
var id = $("#id").val();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -590,12 +582,12 @@ function arr2ObjectVerify(line, arr, detailPropertyArr, detailProperty) {
|
||||||
}
|
}
|
||||||
//如果要求是数字类型的,进行转换
|
//如果要求是数字类型的,进行转换
|
||||||
var v = arr[i];
|
var v = arr[i];
|
||||||
if(o[2] === 'number' ){
|
if (o[2] === 'number') {
|
||||||
v = f2(v);
|
v = f2(v);
|
||||||
} else if(o[2] === 'price' ){
|
} else if (o[2] === 'price') {
|
||||||
v = f5(v);
|
v = f5(v);
|
||||||
}
|
}
|
||||||
obj[detailPropertyArr[i]]=v;
|
obj[detailPropertyArr[i]] = v;
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
@ -622,8 +614,8 @@ function arr2ObjectVerifyCheck(line, arr, detailPropertyArr, detailProperty, s)
|
||||||
function collectData(className) {
|
function collectData(className) {
|
||||||
var a = [];
|
var a = [];
|
||||||
$("." + className).each(function (t) {
|
$("." + className).each(function (t) {
|
||||||
if(!$(this).is(':hidden'))
|
if (!$(this).is(':hidden'))
|
||||||
a.push($(this).val());
|
a.push($(this).val());
|
||||||
});
|
});
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
@ -726,7 +718,7 @@ function bindChangeableInput() {
|
||||||
|
|
||||||
$(this).parent().parent().find(".input-changeable-total-tax-include").val(f2Fixed(amount * price));
|
$(this).parent().parent().find(".input-changeable-total-tax-include").val(f2Fixed(amount * price));
|
||||||
$(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(amount * price / (1 + taxRate / 100)));
|
$(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(amount * price / (1 + taxRate / 100)));
|
||||||
$(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(amount * price * taxRate /(100 + taxRate)));
|
$(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(amount * price * taxRate / (100 + taxRate)));
|
||||||
});
|
});
|
||||||
//单价改变
|
//单价改变
|
||||||
$(".input-changeable-price").change(function () {
|
$(".input-changeable-price").change(function () {
|
||||||
|
@ -738,21 +730,21 @@ function bindChangeableInput() {
|
||||||
|
|
||||||
$(this).parent().parent().find(".input-changeable-total-tax-include").val(f2Fixed(amount * price));
|
$(this).parent().parent().find(".input-changeable-total-tax-include").val(f2Fixed(amount * price));
|
||||||
$(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(amount * price / (1 + taxRate / 100)));
|
$(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(amount * price / (1 + taxRate / 100)));
|
||||||
$(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(amount * price * taxRate /(100 + taxRate)));
|
$(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(amount * price * taxRate / (100 + taxRate)));
|
||||||
$(this).val(f5Price(price));
|
$(this).val(f5Price(price));
|
||||||
console.log("单价:" + $(this).val());
|
console.log("单价:" + $(this).val());
|
||||||
});
|
});
|
||||||
//税率改变
|
//税率改变
|
||||||
$(".input-changeable-tax-rate").change(function () {
|
$(".input-changeable-tax-rate").change(function () {
|
||||||
var taxRate = f2($(this).val());
|
var taxRate = f2($(this).val());
|
||||||
var rowVal=$(this).parent().parent().find(".input-changeable-total-tax-include").val()
|
var rowVal = $(this).parent().parent().find(".input-changeable-total-tax-include").val()
|
||||||
$(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(rowVal * (1 - (taxRate / 100))));
|
$(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(rowVal * (1 - (taxRate / 100))));
|
||||||
$(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(rowVal * (taxRate / 100)));
|
$(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(rowVal * (taxRate / 100)));
|
||||||
});
|
});
|
||||||
// 不含税金额改变
|
// 不含税金额改变
|
||||||
$(".input-changeable-total-tax-include").change(function () {
|
$(".input-changeable-total-tax-include").change(function () {
|
||||||
var rowVal = f2($(this).val());
|
var rowVal = f2($(this).val());
|
||||||
var taxRate=$(this).parent().parent().find(".input-changeable-tax-rate").val()
|
var taxRate = $(this).parent().parent().find(".input-changeable-tax-rate").val()
|
||||||
$(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(rowVal * (1 - (taxRate / 100))));
|
$(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(rowVal * (1 - (taxRate / 100))));
|
||||||
$(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(rowVal * (taxRate / 100)));
|
$(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(rowVal * (taxRate / 100)));
|
||||||
});
|
});
|
||||||
|
@ -766,11 +758,11 @@ function bindChangeableInput() {
|
||||||
function updateTotal(className, totalClassName) {
|
function updateTotal(className, totalClassName) {
|
||||||
var total = 0;
|
var total = 0;
|
||||||
//找到本列所有的
|
//找到本列所有的
|
||||||
$("."+className).each(function (t) {
|
$("." + className).each(function (t) {
|
||||||
total += f2($(this).val());
|
total += f2($(this).val());
|
||||||
console.log("total2: " + total);
|
console.log("total2: " + total);
|
||||||
});
|
});
|
||||||
$("."+totalClassName).val(f2Fixed(total));
|
$("." + totalClassName).val(f2Fixed(total));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -781,18 +773,18 @@ function updateTotal(className, totalClassName) {
|
||||||
function updateAmount(className, totalClassName) {
|
function updateAmount(className, totalClassName) {
|
||||||
var total = 0;
|
var total = 0;
|
||||||
//找到本列所有的
|
//找到本列所有的
|
||||||
$("."+className).each(function (t) {
|
$("." + className).each(function (t) {
|
||||||
console.log(className + ": " + f2($(this).val()));
|
console.log(className + ": " + f2($(this).val()));
|
||||||
total += f2($(this).val());
|
total += f2($(this).val());
|
||||||
});
|
});
|
||||||
$("."+totalClassName).val(f2Fixed(total));
|
$("." + totalClassName).val(f2Fixed(total));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定序号
|
* 绑定序号
|
||||||
*/
|
*/
|
||||||
function bindNum() {
|
function bindNum() {
|
||||||
$(".input-budget-num").each(function(t) {
|
$(".input-budget-num").each(function (t) {
|
||||||
var prevIndex = $(this).parent().parent().prev("tr").find(".input-budget-num").val();
|
var prevIndex = $(this).parent().parent().prev("tr").find(".input-budget-num").val();
|
||||||
$(this).val(f2(prevIndex) + 1);
|
$(this).val(f2(prevIndex) + 1);
|
||||||
});
|
});
|
||||||
|
@ -864,19 +856,19 @@ function updateCostDataIfUnsubmit(details) {
|
||||||
var otherTaxInclude = 0;
|
var otherTaxInclude = 0;
|
||||||
var otherTaxExclude = 0;
|
var otherTaxExclude = 0;
|
||||||
details.forEach(function (t, number, ts) {
|
details.forEach(function (t, number, ts) {
|
||||||
if(t["type"] == "1"){
|
if (t["type"] == "1") {
|
||||||
//设备类
|
//设备类
|
||||||
deviceTaxInclude += f2(t["totalTaxInclude"]);
|
deviceTaxInclude += f2(t["totalTaxInclude"]);
|
||||||
deviceTaxExclude += f2(t["totalTaxExclude"]);
|
deviceTaxExclude += f2(t["totalTaxExclude"]);
|
||||||
}else if(t["type"] == "2"){
|
} else if (t["type"] == "2") {
|
||||||
//施工类
|
//施工类
|
||||||
buildTaxInclude += f2(t["totalTaxInclude"]);
|
buildTaxInclude += f2(t["totalTaxInclude"]);
|
||||||
buildTaxExclude += f2(t["totalTaxExclude"]);
|
buildTaxExclude += f2(t["totalTaxExclude"]);
|
||||||
}else if(t["type"] == "3"){
|
} else if (t["type"] == "3") {
|
||||||
//服务类
|
//服务类
|
||||||
serviceTaxInclude += f2(t["totalTaxInclude"]);
|
serviceTaxInclude += f2(t["totalTaxInclude"]);
|
||||||
serviceTaxExclude += f2(t["totalTaxExclude"]);
|
serviceTaxExclude += f2(t["totalTaxExclude"]);
|
||||||
}else if(t["type"] == "4"){
|
} else if (t["type"] == "4") {
|
||||||
//其他类
|
//其他类
|
||||||
otherTaxInclude += f2(t["totalTaxInclude"]);
|
otherTaxInclude += f2(t["totalTaxInclude"]);
|
||||||
otherTaxExclude += f2(t["totalTaxExclude"]);
|
otherTaxExclude += f2(t["totalTaxExclude"]);
|
||||||
|
@ -893,10 +885,10 @@ function updateCostDataIfUnsubmit(details) {
|
||||||
|
|
||||||
//资金计划表中的
|
//资金计划表中的
|
||||||
$(".input-total-title-device-cost-budget-plan").val(f2Fixed(deviceTaxInclude));
|
$(".input-total-title-device-cost-budget-plan").val(f2Fixed(deviceTaxInclude));
|
||||||
$(".input-total-title-engineer-cost-budget-plan").val(f2Fixed(f2(serviceTaxInclude)+f2(buildTaxInclude)+f2(otherTaxInclude)));
|
$(".input-total-title-engineer-cost-budget-plan").val(f2Fixed(f2(serviceTaxInclude) + f2(buildTaxInclude) + f2(otherTaxInclude)));
|
||||||
$(".input-total-title-total-cost-budget-plan").val(f2Fixed(f2(deviceTaxInclude)+f2(buildTaxInclude)+f2(serviceTaxInclude)+f2(otherTaxInclude)
|
$(".input-total-title-total-cost-budget-plan").val(f2Fixed(f2(deviceTaxInclude) + f2(buildTaxInclude) + f2(serviceTaxInclude) + f2(otherTaxInclude)
|
||||||
+f2($(".input-total-title-project-manage-cost-budget-plan").val())
|
+ f2($(".input-total-title-project-manage-cost-budget-plan").val())
|
||||||
+f2($(".input-total-title-earnest-money-cost-budget-plan").val())));
|
+ f2($(".input-total-title-earnest-money-cost-budget-plan").val())));
|
||||||
|
|
||||||
calCostExclude();
|
calCostExclude();
|
||||||
calCostInclude();
|
calCostInclude();
|
||||||
|
@ -922,15 +914,15 @@ function updateIncomeDataUnsubmit(incomeDetails) {
|
||||||
incomeDetails.forEach(function (t, number, ts) {
|
incomeDetails.forEach(function (t, number, ts) {
|
||||||
console.log("income cost " + t["type"] + ", " + t["taxRate"] + ", " + t["totalTaxInclude"] + ", " + t["totalTaxExclud"]);
|
console.log("income cost " + t["type"] + ", " + t["taxRate"] + ", " + t["totalTaxInclude"] + ", " + t["totalTaxExclud"]);
|
||||||
|
|
||||||
if(t["type"] == "1"){
|
if (t["type"] == "1") {
|
||||||
//设备类
|
//设备类
|
||||||
deviceTaxInclude += f2(t["totalTaxInclude"]);
|
deviceTaxInclude += f2(t["totalTaxInclude"]);
|
||||||
deviceTaxExclude += f2(t["totalTaxExclude"]);
|
deviceTaxExclude += f2(t["totalTaxExclude"]);
|
||||||
}else if(t["type"] == "2"){
|
} else if (t["type"] == "2") {
|
||||||
//工程类
|
//工程类
|
||||||
engineerTaxInclude += f2(t["totalTaxInclude"]);
|
engineerTaxInclude += f2(t["totalTaxInclude"]);
|
||||||
engineerTaxExclude += f2(t["totalTaxExclude"]);
|
engineerTaxExclude += f2(t["totalTaxExclude"]);
|
||||||
}else if(t["type"] == "3"){
|
} else if (t["type"] == "3") {
|
||||||
//服务类
|
//服务类
|
||||||
serviceTaxInclude += f2(t["totalTaxInclude"]);
|
serviceTaxInclude += f2(t["totalTaxInclude"]);
|
||||||
serviceTaxExclude += f2(t["totalTaxExclude"]);
|
serviceTaxExclude += f2(t["totalTaxExclude"]);
|
||||||
|
@ -943,15 +935,15 @@ function updateIncomeDataUnsubmit(incomeDetails) {
|
||||||
$("input[name='incomeServiceTaxInclude']").val(f2Fixed(serviceTaxInclude));
|
$("input[name='incomeServiceTaxInclude']").val(f2Fixed(serviceTaxInclude));
|
||||||
$("input[name='incomeServiceTaxExclude']").val(f2Fixed(serviceTaxExclude));
|
$("input[name='incomeServiceTaxExclude']").val(f2Fixed(serviceTaxExclude));
|
||||||
|
|
||||||
$("input[name='incomeTotalTaxInclude']").val(f2Fixed(deviceTaxInclude+engineerTaxInclude+serviceTaxInclude));
|
$("input[name='incomeTotalTaxInclude']").val(f2Fixed(deviceTaxInclude + engineerTaxInclude + serviceTaxInclude));
|
||||||
$("input[name='incomeTotalTaxExclude']").val(f2Fixed(deviceTaxExclude+engineerTaxExclude+serviceTaxExclude));
|
$("input[name='incomeTotalTaxExclude']").val(f2Fixed(deviceTaxExclude + engineerTaxExclude + serviceTaxExclude));
|
||||||
$("input[name='incomeTotalTax']").val(f2Fixed(deviceTaxInclude+engineerTaxInclude+serviceTaxInclude-(deviceTaxExclude+engineerTaxExclude+serviceTaxExclude)));
|
$("input[name='incomeTotalTax']").val(f2Fixed(deviceTaxInclude + engineerTaxInclude + serviceTaxInclude - (deviceTaxExclude + engineerTaxExclude + serviceTaxExclude)));
|
||||||
$("input[name='costCompanyManageTaxExclude']").val(f2Fixed(0.028*(deviceTaxExclude+engineerTaxExclude+serviceTaxExclude)));
|
$("input[name='costCompanyManageTaxExclude']").val(f2Fixed(0.028 * (deviceTaxExclude + engineerTaxExclude + serviceTaxExclude)));
|
||||||
|
|
||||||
|
|
||||||
$(".input-total-title-sale-income-budget-plan").val($("input[name='incomeTotalTaxInclude']").val());
|
$(".input-total-title-sale-income-budget-plan").val($("input[name='incomeTotalTaxInclude']").val());
|
||||||
$(".input-total-title-total-income-budget-plan").val(f2Fixed(f2($("input[name='incomeTotalTaxInclude']").val())
|
$(".input-total-title-total-income-budget-plan").val(f2Fixed(f2($("input[name='incomeTotalTaxInclude']").val())
|
||||||
+f2($(".input-total-title-earnest-money-income-budget-plan").val())));
|
+ f2($(".input-total-title-earnest-money-income-budget-plan").val())));
|
||||||
|
|
||||||
|
|
||||||
updateProjectContributionProfitRate();
|
updateProjectContributionProfitRate();
|
||||||
|
@ -983,9 +975,9 @@ function updateCostProjectManageDataUnsubmit(details) {
|
||||||
var buildTaxInclude = $("input[name='costPurchaseBuildTaxInclude']").val();
|
var buildTaxInclude = $("input[name='costPurchaseBuildTaxInclude']").val();
|
||||||
var serviceTaxInclude = $("input[name='costPurchaseServiceTaxInclude']").val();
|
var serviceTaxInclude = $("input[name='costPurchaseServiceTaxInclude']").val();
|
||||||
var otherTaxInclude = $("input[name='costPurchaseOtherTaxInclude']").val();
|
var otherTaxInclude = $("input[name='costPurchaseOtherTaxInclude']").val();
|
||||||
$(".input-total-title-total-cost-budget-plan").val(f2Fixed(f2(deviceTaxInclude)+f2(buildTaxInclude)+f2(serviceTaxInclude)+f2(otherTaxInclude)
|
$(".input-total-title-total-cost-budget-plan").val(f2Fixed(f2(deviceTaxInclude) + f2(buildTaxInclude) + f2(serviceTaxInclude) + f2(otherTaxInclude)
|
||||||
+total
|
+ total
|
||||||
+f2($(".input-total-title-earnest-money-cost-budget-plan").val())));
|
+ f2($(".input-total-title-earnest-money-cost-budget-plan").val())));
|
||||||
|
|
||||||
calCostExclude();
|
calCostExclude();
|
||||||
calCostInclude();
|
calCostInclude();
|
||||||
|
@ -996,7 +988,7 @@ function updateCostProjectManageDataUnsubmit(details) {
|
||||||
/**
|
/**
|
||||||
* 更新页面收入的数据
|
* 更新页面收入的数据
|
||||||
*/
|
*/
|
||||||
function updateBudgetPlanDetailDataUnsubmit(data,returnData) {
|
function updateBudgetPlanDetailDataUnsubmit(data, returnData) {
|
||||||
//var details = data.details;
|
//var details = data.details;
|
||||||
//主页面上的财务费用
|
//主页面上的财务费用
|
||||||
$("input[name='costExpropriationTaxExclude']").val($(".input-underwritten-plan-statistic-capital-interest-budget-plan").val());
|
$("input[name='costExpropriationTaxExclude']").val($(".input-underwritten-plan-statistic-capital-interest-budget-plan").val());
|
||||||
|
|
|
@ -445,7 +445,7 @@ function bindOtherOtherChangeable() {
|
||||||
*/
|
*/
|
||||||
function bindTypeSelectChange() {
|
function bindTypeSelectChange() {
|
||||||
//大类变化联动类别
|
//大类变化联动类别
|
||||||
$(".input-changeable-tax-rate-income-select").on('change',function () {
|
$(".input-changeable-tax-rate-cost-select").on('change',function () {
|
||||||
var nameSelect = $(this).parent().parent().find(".input-changeable-tax-rate-cost-select");
|
var nameSelect = $(this).parent().parent().find(".input-changeable-tax-rate-cost-select");
|
||||||
var nameInput = $(this).parent().parent().find(".input-changeable-tax-rate-cost-name");
|
var nameInput = $(this).parent().parent().find(".input-changeable-tax-rate-cost-name");
|
||||||
var type = $(this).val();
|
var type = $(this).val();
|
||||||
|
|
|
@ -119,8 +119,8 @@ $(function () {
|
||||||
var data = collectData("am-modal-prompt-input-pay");
|
var data = collectData("am-modal-prompt-input-pay");
|
||||||
//data = prepareAjaxData(data, COST_DETAIL_ARR, $("#id").val(),false);
|
//data = prepareAjaxData(data, COST_DETAIL_ARR, $("#id").val(),false);
|
||||||
data = prepareAjaxDataVerify(data, pay_DETAIL2, $("#id").val());
|
data = prepareAjaxDataVerify(data, pay_DETAIL2, $("#id").val());
|
||||||
var flag=verifyBudgetPay()
|
var flag = verifyBudgetPay()
|
||||||
if(!flag) return
|
if (!flag) return
|
||||||
if (data) {
|
if (data) {
|
||||||
postAjax(base + "/project/budgetEditSaveBudgetPayPlan", data, updateCostData);
|
postAjax(base + "/project/budgetEditSaveBudgetPayPlan", data, updateCostData);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,8 @@ $(function () {
|
||||||
|
|
||||||
//绑定删除按钮
|
//绑定删除按钮
|
||||||
bindDeleteBtnPay();
|
bindDeleteBtnPay();
|
||||||
|
//绑定总计值
|
||||||
|
bindPayTotal();
|
||||||
//初始化大类和类别的数据
|
//初始化大类和类别的数据
|
||||||
getAjax(base + "/procurement/type/map", null, initTypeCategory);
|
getAjax(base + "/procurement/type/map", null, initTypeCategory);
|
||||||
});
|
});
|
||||||
|
@ -160,7 +161,7 @@ function appendTrPay() {
|
||||||
'<option value="4">其他成本</option>' +
|
'<option value="4">其他成本</option>' +
|
||||||
'</select>' +
|
'</select>' +
|
||||||
'</td>' +
|
'</td>' +
|
||||||
'<td width="100px"><input type="text" class="am-modal-prompt-input am-modal-prompt-input-pay am-modal-prompt-input-pay-amount" ></td>' +
|
'<td width="100px"><input type="text" class="am-modal-prompt-input am-modal-prompt-input-pay am-modal-prompt-input-pay-amount input-changeable-pay-amount" ></td>' +
|
||||||
'<td width="100px"><input type="text" class="am-modal-prompt-input am-modal-prompt-input-pay am-modal-prompt-input-pay-supplier" ></td>' +
|
'<td width="100px"><input type="text" class="am-modal-prompt-input am-modal-prompt-input-pay am-modal-prompt-input-pay-supplier" ></td>' +
|
||||||
'<td width="60px"><button type="button" style="margin-top: 10px" class="am-btn am-btn-danger am-btn-xs am-round am-modal-line-delete"><span class="am-icon-minus"></span></button></td>' +
|
'<td width="60px"><button type="button" style="margin-top: 10px" class="am-btn am-btn-danger am-btn-xs am-round am-modal-line-delete"><span class="am-icon-minus"></span></button></td>' +
|
||||||
|
|
||||||
|
@ -341,17 +342,58 @@ function initTypeCategory(params, data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//校验付款明细表
|
//校验付款明细表
|
||||||
function verifyBudgetPay() {
|
function verifyBudgetPay(isApprove) {
|
||||||
|
// 时间必填校验
|
||||||
var timeValue = $(".input-changeable-pay-time");
|
var timeValue = $(".input-changeable-pay-time");
|
||||||
var flag=true
|
var flag = true
|
||||||
var timeFlag = true
|
var timeFlag = true
|
||||||
timeValue.each((index, element) => {
|
timeValue.each((index, element) => {
|
||||||
if ($(element).val().length != 10)
|
if ($(element).val().length != 10)
|
||||||
timeFlag = false
|
timeFlag = false
|
||||||
})
|
})
|
||||||
if (timeFlag == false) {
|
if (timeFlag == false) {
|
||||||
flag=false
|
flag = false
|
||||||
layuiAlert('付款计划表中付款时间为必填')
|
layuiAlert('付款计划表中付款时间为必填')
|
||||||
}
|
}
|
||||||
|
// 采购成本与付款金额校验
|
||||||
|
if (isApprove) {
|
||||||
|
var payData = prepareAjaxDataVerify(collectData("am-modal-prompt-input-pay"), pay_DETAIL2, $("#id").val())
|
||||||
|
var costData = prepareAjaxDataVerify(collectData("am-modal-prompt-input-cost"), COST_DETAIL2, $("#id").val())
|
||||||
|
|
||||||
|
var payTotal_equipment = calculateTotal(payData, 1,'payProject','payAmount');
|
||||||
|
var payTotal_project = calculateTotal(payData, 2,'payProject','payAmount');
|
||||||
|
var payTotal_server = calculateTotal(payData, 3,'payProject','payAmount');
|
||||||
|
var payTotal_other = calculateTotal(payData, 4,'payProject','payAmount');
|
||||||
|
|
||||||
|
var costTotal_equipment = calculateTotal(costData, 1,'type','totalTaxExclude');
|
||||||
|
var costTotal_project = calculateTotal(costData, 2,'type','totalTaxExclude');
|
||||||
|
var costTotal_server = calculateTotal(costData, 3,'type','totalTaxExclude');
|
||||||
|
var costTotal_other = calculateTotal(costData, 4,'type','totalTaxExclude');
|
||||||
|
|
||||||
|
console.log(2333,payTotal_equipment,payTotal_project,payTotal_server,payTotal_other)
|
||||||
|
console.log(3333,costTotal_equipment,costTotal_project,costTotal_server,costTotal_other)
|
||||||
|
|
||||||
|
|
||||||
|
if (payTotal_equipment != costTotal_equipment) {
|
||||||
|
flag = false
|
||||||
|
layuiAlert('[付款计划表中"设备"成本总金]额需要与[采购成本明细表中"设备"成本总金额]一致')
|
||||||
|
} else if (payTotal_project != costTotal_project) {
|
||||||
|
flag = false
|
||||||
|
layuiAlert('[付款计划表中"工程"成本总金]额需要与[采购成本明细表中"工程"成本总金额]一致')
|
||||||
|
} else if (payTotal_server != costTotal_server) {
|
||||||
|
flag = false
|
||||||
|
layuiAlert('[付款计划表中"服务"成本总金]额需要与[采购成本明细表中"服务"成本总金额]一致')
|
||||||
|
} else if (payTotal_other != costTotal_other) {
|
||||||
|
flag = false
|
||||||
|
layuiAlert('[付款计划表中"其他"成本总金]额需要与[采购成本明细表中"其他"成本总金额]一致')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return flag
|
return flag
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function calculateTotal(payData, type,key,value) {
|
||||||
|
return payData.details.reduce((total, now) => {
|
||||||
|
return now[key] == type ? now[value] + total : total;
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
|
@ -872,6 +872,9 @@
|
||||||
onclick="location.href='${base}/project/incomeTemplate'">
|
onclick="location.href='${base}/project/incomeTemplate'">
|
||||||
<span class="am-icon-archive"></span> 导入模板下载
|
<span class="am-icon-archive"></span> 导入模板下载
|
||||||
</button>
|
</button>
|
||||||
|
<span>销售合同配置清单</span>
|
||||||
|
<input id="file_upload_icon" type="file" name="files[]" accept=".xls,.xlsx">
|
||||||
|
<span id="collaboratorUrl"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1133,44 +1136,27 @@
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td width="150px">
|
||||||
<select <#if incomeDetail.name!='华智产品'&&incomeDetail.name!='华三产品'&&incomeDetail.name!='汇智产品'>style="display:none"</#if>
|
<select <#if costDetail.category!='华智产品'&&costDetail.category!='华三产品'&&costDetail.category!='汇智产品'>style="display:none"</#if>
|
||||||
class="am-modal-prompt-input am-modal-prompt-input am-modal-prompt-input-cost am-modal-prompt-input-cost-category input-changeable-tax-rate-cost-select">
|
class="am-modal-prompt-input am-modal-prompt-input am-modal-prompt-input-cost am-modal-prompt-input-cost-category input-changeable-tax-rate-cost-select">
|
||||||
<option value="华智产品"
|
<option value="华智产品"
|
||||||
<#if incomeDetail.name ="华智产品" >selected</#if>>
|
<#if costDetail.category ="华智产品" >selected</#if>>
|
||||||
华智产品
|
华智产品
|
||||||
</option>
|
</option>
|
||||||
<option value="华三产品"
|
<option value="华三产品"
|
||||||
<#if incomeDetail.name ="华三产品">selected</#if>>
|
<#if costDetail.category ="华三产品">selected</#if>>
|
||||||
华三产品
|
华三产品
|
||||||
</option>
|
</option>
|
||||||
<option value="汇智产品"
|
<option value="汇智产品"
|
||||||
<#if incomeDetail.name ="汇智产品">selected</#if>>
|
<#if costDetail.category ="汇智产品">selected</#if>>
|
||||||
汇智产品
|
汇智产品
|
||||||
</option>
|
</option>
|
||||||
<option value="自定义">自定义</option>
|
<option value="自定义">自定义</option>
|
||||||
</select>
|
</select>
|
||||||
<input <#if incomeDetail.name!='华智产品'&&incomeDetail.name!='华三产品'&&incomeDetail.name!='汇智产品'>type="text"
|
<input <#if costDetail.category!='华智产品'&&costDetail.category!='华三产品'&&costDetail.category!='汇智产品'>type="text"
|
||||||
<#else>type="hidden"</#if>
|
<#else>type="hidden"</#if>
|
||||||
class="am-modal-prompt-input am-modal-prompt-input-cost input-changeable-tax-rate-cost-name"
|
class="am-modal-prompt-input am-modal-prompt-input-cost input-changeable-tax-rate-cost-name"
|
||||||
value="${incomeDetail.name!}">
|
value="${costDetail.category!}">
|
||||||
</td>
|
|
||||||
<td width="150px">
|
|
||||||
<select style="float: left;"
|
|
||||||
class="am-modal-prompt-input am-modal-prompt-input-cost am-modal-prompt-input-cost-category">
|
|
||||||
<#--<option value="1" <#if costDetail.category == 1>selected</#if>>华智产品</option>
|
|
||||||
<option value="2" <#if costDetail.category == 2>selected</#if>>紫光其他产品</option>
|
|
||||||
<option value="3" <#if costDetail.category == 3>selected</#if>>外购产品</option>
|
|
||||||
<option value="4" <#if costDetail.category == 4>selected</#if>>外购工程</option>
|
|
||||||
<option value="5" <#if costDetail.category == 5>selected</#if>>华智服务</option>
|
|
||||||
<option value="6" <#if costDetail.category == 6>selected</#if>>紫光其他服务</option>
|
|
||||||
<option value="7" <#if costDetail.category == 7>selected</#if>>外购服务</option>
|
|
||||||
<option value="8" <#if costDetail.category == 8>selected</#if>>其他</option>-->
|
|
||||||
<#list procurementTypes as procurementType>
|
|
||||||
<option value="${procurementType.id}"
|
|
||||||
<#if costDetail.category == procurementType.id>selected</#if>>${procurementType.name}</option>
|
|
||||||
</#list>
|
|
||||||
</select>
|
|
||||||
</td>
|
</td>
|
||||||
<td width="100px"><input type="text" maxlength="5"
|
<td width="100px"><input type="text" maxlength="5"
|
||||||
class="number am-modal-prompt-input am-modal-prompt-input-cost input-changeable-tax-rate input-changeable-tax-rate-cost"
|
class="number am-modal-prompt-input am-modal-prompt-input-cost input-changeable-tax-rate input-changeable-tax-rate-cost"
|
||||||
|
@ -1534,7 +1520,7 @@
|
||||||
readonly/></td>
|
readonly/></td>
|
||||||
<td style="display: block;"><input type="text"
|
<td style="display: block;"><input type="text"
|
||||||
class="number am-modal-prompt-input input-total-title-device-cost-budget-plan"
|
class="number am-modal-prompt-input input-total-title-device-cost-budget-plan"
|
||||||
value="${Utils.format(projectBudgetPlanDetailTotalTitle.deviceCost)}"/>
|
value="${Utils.format(projectBudgetPlanDetailTotalTitle.deviceCost)}" readonly/>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td style="display: block;"><input type="text"
|
<td style="display: block;"><input type="text"
|
||||||
|
@ -1677,7 +1663,7 @@
|
||||||
oninput="if(value.length>16)value=value.slice(0,16)"
|
oninput="if(value.length>16)value=value.slice(0,16)"
|
||||||
maxlength="16"
|
maxlength="16"
|
||||||
class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-device-cost-budget-plan"
|
class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-device-cost-budget-plan"
|
||||||
value="${Utils.format(projectBudgetPlanDetail.deviceCost)}">
|
value="${Utils.format(projectBudgetPlanDetail.deviceCost)}" readonly>
|
||||||
</td>
|
</td>
|
||||||
<td style="display: block;"><input type="text"
|
<td style="display: block;"><input type="text"
|
||||||
oninput="if(value.length>16)value=value.slice(0,16)"
|
oninput="if(value.length>16)value=value.slice(0,16)"
|
||||||
|
@ -1940,8 +1926,8 @@
|
||||||
<#-- </tr>-->
|
<#-- </tr>-->
|
||||||
<tr>
|
<tr>
|
||||||
<td>合计</td>
|
<td>合计</td>
|
||||||
<td></td>
|
<#-- <td></td>-->
|
||||||
<td></td>
|
<#-- <td></td>-->
|
||||||
<td><input type="text" class="number" name="costTotalTaxInclude"
|
<td><input type="text" class="number" name="costTotalTaxInclude"
|
||||||
value="${Utils.format(budgetBean.costTotalTaxInclude,'0')}" readonly
|
value="${Utils.format(budgetBean.costTotalTaxInclude,'0')}" readonly
|
||||||
title="此列累计"></td>
|
title="此列累计"></td>
|
||||||
|
@ -2455,8 +2441,7 @@
|
||||||
console.log(data);
|
console.log(data);
|
||||||
//设置服务器返回的url
|
//设置服务器返回的url
|
||||||
$("#collaboratorUrlBudget").val(data.result.data.url);
|
$("#collaboratorUrlBudget").val(data.result.data.url);
|
||||||
$("#collaboratorUrl_span").text(data.result.data.url);
|
$("#collaboratorUrl_check").text(data.result.data.newName);
|
||||||
$("#collaboratorUrl_check").text("已上传");
|
|
||||||
// console.log("collboratorUrl: " + $("#collaboratorUrl").val());
|
// console.log("collboratorUrl: " + $("#collaboratorUrl").val());
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
progressArea.addClass("am-hide");
|
progressArea.addClass("am-hide");
|
||||||
|
@ -2515,7 +2500,7 @@
|
||||||
console.log(data);
|
console.log(data);
|
||||||
//设置服务器返回的url
|
//设置服务器返回的url
|
||||||
$("#collaboratorUrl").val(data.result.data.url);
|
$("#collaboratorUrl").val(data.result.data.url);
|
||||||
$("#collaboratorUrl_span").text(data.result.data.url);
|
$("#collaboratorUrl_check").text(data.result.newName);
|
||||||
// console.log("collboratorUrl: " + $("#collaboratorUrl").val());
|
// console.log("collboratorUrl: " + $("#collaboratorUrl").val());
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
progressArea.addClass("am-hide");
|
progressArea.addClass("am-hide");
|
||||||
|
|
Loading…
Reference in New Issue