parent
e1b14e16ca
commit
ccebcc0885
|
@ -1053,3 +1053,64 @@ function checkprojectPlan() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//根据收款计划表和付款计划表更新资金计划表日期范围
|
||||||
|
function updataCostPlanMonth(data,key){
|
||||||
|
let nowMaxMonth = new Date($('.input-changeable-month-budget-plan:last-child').val()).getTime()
|
||||||
|
let nowMinMonth = new Date($('.input-changeable-month-budget-plan:first-child').val()).getTime()
|
||||||
|
let dataMonth = data.details
|
||||||
|
dataMonth.sort((a, b) => {
|
||||||
|
return new Date(b[key].slice(0, 7)).getTime() - new Date(a[key].slice(0, 7)).getTime()
|
||||||
|
})
|
||||||
|
let dataMax = new Date(dataMonth[0][key]).getTime()
|
||||||
|
let dataMin = new Date(dataMonth[dataMonth.length - 1][key]).getTime()
|
||||||
|
if (dataMax > nowMaxMonth) {
|
||||||
|
layui.use('laydate', function () {
|
||||||
|
var laydate = layui.laydate;
|
||||||
|
laydate.render({
|
||||||
|
elem: '#planEndStr',
|
||||||
|
type: 'month',
|
||||||
|
btns: ['confirm'],
|
||||||
|
trigger: 'click',
|
||||||
|
value: dataMonth[0][key].slice(0, 7),
|
||||||
|
ready: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
done: function () {
|
||||||
|
var time = $(this.elem).val();
|
||||||
|
appendMultiplePlan();
|
||||||
|
$("#planEndDate").val(time);
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
|
appendMultiplePlan();
|
||||||
|
$("#planEndDate").val(dataMonth[0][key].slice(0, 7));
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
if (nowMinMonth > dataMin) {
|
||||||
|
layui.use('laydate', function () {
|
||||||
|
var laydate = layui.laydate;
|
||||||
|
laydate.render({
|
||||||
|
elem: '#planStartStr',
|
||||||
|
type: 'month',
|
||||||
|
btns: ['confirm'],
|
||||||
|
trigger: 'click',
|
||||||
|
value: dataMonth[dataMonth.length - 1][key].slice(0, 7),
|
||||||
|
|
||||||
|
ready: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
done: function () {
|
||||||
|
var time = $(this.elem).val();
|
||||||
|
appendMultiplePlan();
|
||||||
|
$("#planStartDate").val(time);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
appendMultiplePlan();
|
||||||
|
$("#planStartDate").val(dataMonth[dataMonth.length - 1][key].slice(0, 7));
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -344,11 +344,11 @@ function updateCostData(data, returnData) {
|
||||||
|
|
||||||
|
|
||||||
//资金计划表中的
|
//资金计划表中的
|
||||||
$(".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())));
|
||||||
|
|
||||||
/* var costOtherOtherTaxInclude = f2($("input[name='costOtherOtherTaxInclude']").val());
|
/* var costOtherOtherTaxInclude = f2($("input[name='costOtherOtherTaxInclude']").val());
|
||||||
var costOtherOtherTaxExclude = f2($("input[name='costOtherOtherTaxExclude']").val());
|
var costOtherOtherTaxExclude = f2($("input[name='costOtherOtherTaxExclude']").val());
|
||||||
|
|
|
@ -139,9 +139,9 @@ function updateIncomeData(data, returnData) {
|
||||||
$("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();
|
||||||
|
|
|
@ -57,23 +57,27 @@ $(function () {
|
||||||
* 更新页面收入的数据【累加】
|
* 更新页面收入的数据【累加】
|
||||||
*/
|
*/
|
||||||
function updateIncomePlanData(data,returnData) {
|
function updateIncomePlanData(data,returnData) {
|
||||||
layuiAlert("保存成功");
|
updataCostPlanMonth(data,'receiveTime')
|
||||||
$('.input-changeable-sale-income-budget-plan').val(0)
|
setTimeout(()=>{
|
||||||
$('.input-changeable-sale-income-budget-plan').each( (index,ele) =>{
|
layuiAlert("保存成功");
|
||||||
let time=$(ele).parent().parent().find('.input-changeable-month-budget-plan').val()
|
$('.input-changeable-sale-income-budget-plan').val(0)
|
||||||
let total=0
|
$('.input-changeable-sale-income-budget-plan').each( (index,ele) =>{
|
||||||
data.details.forEach((ele)=>{
|
let time=$(ele).parent().parent().find('.input-changeable-month-budget-plan').val()
|
||||||
|
let total=0
|
||||||
|
data.details.forEach((ele)=>{
|
||||||
|
|
||||||
|
if(time==ele.receiveTime.slice(0, 7))
|
||||||
|
total+=ele.receiveAmount
|
||||||
|
})
|
||||||
|
$(ele).val(total)
|
||||||
|
var eventChange= new Event('change',{bubbles:true});
|
||||||
|
ele.dispatchEvent(eventChange);
|
||||||
|
updateTotal('input-changeable-sale-income-budget-plan','input-total-title-sale-income-budget-plan')
|
||||||
|
|
||||||
if(time==ele.receiveTime.slice(0, 7))
|
|
||||||
total+=ele.receiveAmount
|
|
||||||
})
|
})
|
||||||
$(ele).val(total)
|
$('#my-prompt-income-plan-detail').modal('close');
|
||||||
var eventChange= new Event('change',{bubbles:true});
|
},500)
|
||||||
ele.dispatchEvent(eventChange);
|
|
||||||
updateTotal('input-changeable-sale-income-budget-plan','input-total-title-sale-income-budget-plan')
|
|
||||||
|
|
||||||
})
|
|
||||||
$('#my-prompt-income-plan-detail').modal('close');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -217,56 +217,59 @@ function bindPayTotal() {
|
||||||
* 更新页面收入的数据【累加】
|
* 更新页面收入的数据【累加】
|
||||||
*/
|
*/
|
||||||
function updatePayData(data) {
|
function updatePayData(data) {
|
||||||
|
|
||||||
|
updataCostPlanMonth(data,'payTime')
|
||||||
// 更新资金计划表数据
|
// 更新资金计划表数据
|
||||||
$('.input-changeable-device-cost-budget-plan').val(0)
|
|
||||||
$('.input-changeable-project-cost-budget-plan').val(0)
|
|
||||||
$('.input-changeable-service-cost-budget-plan').val(0)
|
|
||||||
$('.input-changeable-other-cost-budget-plan').val(0)
|
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
$('.input-changeable-device-cost-budget-plan').val(0)
|
||||||
|
$('.input-changeable-project-cost-budget-plan').val(0)
|
||||||
|
$('.input-changeable-service-cost-budget-plan').val(0)
|
||||||
|
$('.input-changeable-other-cost-budget-plan').val(0)
|
||||||
|
data.details.forEach((ele) => {
|
||||||
|
let time = ele.payTime.slice(0, 7)
|
||||||
|
let type = ele.payProject
|
||||||
|
switch (type) {
|
||||||
|
case 1:
|
||||||
|
var input = $(`#tab6 .input-changeable-month-budget-plan[value="${time}"]`).parent().parent().find('.input-changeable-device-cost-budget-plan').get(0)
|
||||||
|
var val = parseFloat($(input).val())
|
||||||
|
$(input).val(f2(ele.payAmount + val))
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
var input = $(`#tab6 .input-changeable-month-budget-plan[value="${time}"]`).parent().parent().find('.input-changeable-project-cost-budget-plan')
|
||||||
|
var val = parseFloat($(input).val())
|
||||||
|
$(input).val(f2(ele.payAmount + val))
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
var input = $(`#tab6 .input-changeable-month-budget-plan[value="${time}"]`).parent().parent().find('.input-changeable-service-cost-budget-plan')
|
||||||
|
var val = parseFloat($(input).val())
|
||||||
|
$(input).val(f2(ele.payAmount + val))
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
var input = $(`#tab6 .input-changeable-month-budget-plan[value="${time}"]`).parent().parent().find('.input-changeable-other-cost-budget-plan')
|
||||||
|
var val = parseFloat($(input).val())
|
||||||
|
$(input).val(f2(ele.payAmount + val))
|
||||||
|
break;
|
||||||
|
|
||||||
data.details.forEach((ele) => {
|
}
|
||||||
let time = ele.payTime.slice(0, 7)
|
})
|
||||||
let type = ele.payProject
|
updateTotal("input-changeable-device-cost-budget-plan", "input-total-title-device-cost-budget-plan");
|
||||||
switch (type) {
|
updateTotal("input-changeable-project-cost-budget-plan", "input-total-title-projectCost-cost-budget-plan");
|
||||||
case 1:
|
updateTotal("input-changeable-service-cost-budget-plan", "input-total-title-serviceCost-cost-budget-plan");
|
||||||
var input = $(`#tab6 .input-changeable-month-budget-plan[value="${time}"]`).parent().parent().find('.input-changeable-device-cost-budget-plan').get(0)
|
updateTotal("input-changeable-other-cost-budget-plan", "input-total-title-otherCost-cost-budget-plan");
|
||||||
var val = parseFloat($(input).val())
|
$('.input-changeable-project-manage-cost-budget-plan').each((index, element) => {
|
||||||
$(input).val(f2(ele.payAmount + val))
|
var engineer1 = f2($(element).parent().parent().find(".input-changeable-device-cost-budget-plan").val())
|
||||||
break;
|
var engineer2 = f2($(element).parent().parent().find(".input-changeable-project-cost-budget-plan").val())
|
||||||
case 2:
|
var engineer3 = f2($(element).parent().parent().find(".input-changeable-service-cost-budget-plan").val())
|
||||||
var input = $(`#tab6 .input-changeable-month-budget-plan[value="${time}"]`).parent().parent().find('.input-changeable-project-cost-budget-plan')
|
var engineer4 = f2($(element).parent().parent().find(".input-changeable-other-cost-budget-plan").val())
|
||||||
var val = parseFloat($(input).val())
|
var projectManageCost = f2($(element).val());
|
||||||
$(input).val(f2(ele.payAmount + val))
|
var earnestMoneyCost = f2($(element).parent().parent().find(".input-changeable-earnest-money-cost-budget-plan").val());
|
||||||
break;
|
var engineerCost = f2(engineer1 + engineer2 + engineer3 + engineer4);
|
||||||
case 3:
|
$(element).parent().parent().find('.input-changeable-total-cost-budget-plan').val(f2Fixed(engineerCost + projectManageCost + earnestMoneyCost));
|
||||||
var input = $(`#tab6 .input-changeable-month-budget-plan[value="${time}"]`).parent().parent().find('.input-changeable-service-cost-budget-plan')
|
})
|
||||||
var val = parseFloat($(input).val())
|
updateTotal("input-changeable-total-cost-budget-plan", "input-total-title-total-cost-budget-plan");
|
||||||
$(input).val(f2(ele.payAmount + val))
|
layuiAlert("保存成功");
|
||||||
break;
|
}, 500)
|
||||||
case 4:
|
|
||||||
var input = $(`#tab6 .input-changeable-month-budget-plan[value="${time}"]`).parent().parent().find('.input-changeable-other-cost-budget-plan')
|
|
||||||
var val = parseFloat($(input).val())
|
|
||||||
$(input).val(f2(ele.payAmount + val))
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
updateTotal("input-changeable-device-cost-budget-plan", "input-total-title-device-cost-budget-plan");
|
|
||||||
updateTotal("input-changeable-project-cost-budget-plan", "input-total-title-projectCost-cost-budget-plan");
|
|
||||||
updateTotal("input-changeable-service-cost-budget-plan", "input-total-title-serviceCost-cost-budget-plan");
|
|
||||||
updateTotal("input-changeable-other-cost-budget-plan", "input-total-total-otherCost-cost-budget-plan");
|
|
||||||
$('.input-changeable-project-manage-cost-budget-plan').each((index, element) => {
|
|
||||||
var engineer1 = f2($(element).parent().parent().find(".input-changeable-device-cost-budget-plan").val())
|
|
||||||
var engineer2 = f2($(element).parent().parent().find(".input-changeable-project-cost-budget-plan").val())
|
|
||||||
var engineer3 = f2($(element).parent().parent().find(".input-changeable-service-cost-budget-plan").val())
|
|
||||||
var engineer4 = f2($(element).parent().parent().find(".input-changeable-other-cost-budget-plan").val())
|
|
||||||
var projectManageCost = f2($(element).val());
|
|
||||||
var earnestMoneyCost = f2($(element).parent().parent().find(".input-changeable-earnest-money-cost-budget-plan").val());
|
|
||||||
var engineerCost = f2(engineer1 + engineer2 + engineer3 + engineer4);
|
|
||||||
$(element).parent().parent().find('.input-changeable-total-cost-budget-plan').val(f2Fixed(engineerCost + projectManageCost + earnestMoneyCost));
|
|
||||||
})
|
|
||||||
updateTotal("input-changeable-total-cost-budget-plan", "input-total-title-total-cost-budget-plan");
|
|
||||||
layuiAlert("保存成功");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -125,6 +125,7 @@ layui.use('laydate', function(){
|
||||||
console.log("planStartStr:" + time)
|
console.log("planStartStr:" + time)
|
||||||
appendMultiplePlan();
|
appendMultiplePlan();
|
||||||
$("#planStartDate").val(time);
|
$("#planStartDate").val(time);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -145,6 +146,7 @@ layui.use('laydate', function(){
|
||||||
console.log("planEndStr:" + time);
|
console.log("planEndStr:" + time);
|
||||||
appendMultiplePlan();
|
appendMultiplePlan();
|
||||||
$("#planEndDate").val(time);
|
$("#planEndDate").val(time);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -159,6 +161,7 @@ function appendMultiplePlan() {
|
||||||
}
|
}
|
||||||
var planStartDate = $("#planStartDate").val();
|
var planStartDate = $("#planStartDate").val();
|
||||||
var planEndDate = $("#planEndDate").val();
|
var planEndDate = $("#planEndDate").val();
|
||||||
|
|
||||||
var startYear = planStartStr.substring(0, 4);
|
var startYear = planStartStr.substring(0, 4);
|
||||||
var startMonth = planStartStr.substring(5, 7);
|
var startMonth = planStartStr.substring(5, 7);
|
||||||
var totalStartMonth = startYear * 12 + parseInt(startMonth);
|
var totalStartMonth = startYear * 12 + parseInt(startMonth);
|
||||||
|
@ -214,7 +217,7 @@ function appendMultiplePlan() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (totalEndMonth > totalEndMonth2) {
|
} else if (totalEndMonth > totalEndMonth2) {
|
||||||
console.log("增加结束");
|
console.log("增加结束",totalEndMonth,totalEndMonth2);
|
||||||
diff = totalEndMonth - totalEndMonth2;
|
diff = totalEndMonth - totalEndMonth2;
|
||||||
while (planIndex < diff) {
|
while (planIndex < diff) {
|
||||||
appendTrBudgetPlan();
|
appendTrBudgetPlan();
|
||||||
|
@ -408,7 +411,8 @@ function appendTrBudgetPlan() {
|
||||||
' <td style="display: block;"><input type="text" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-repayment-plan-budget-plan" readonly></td>\n' +
|
' <td style="display: block;"><input type="text" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-repayment-plan-budget-plan" readonly></td>\n' +
|
||||||
' <td style="display: block;"><button type="button" class="am-btn am-btn-danger am-btn-xs am-round am-modal-line-delete-budget-plan"><span class="am-icon-minus"></span></button></td>\n' +
|
' <td style="display: block;"><button type="button" class="am-btn am-btn-danger am-btn-xs am-round am-modal-line-delete-budget-plan"><span class="am-icon-minus"></span></button></td>\n' +
|
||||||
' </tr>';
|
' </tr>';
|
||||||
$("#budgetPlanDetailTable").append(template);
|
console.log(123123123)
|
||||||
|
$("#budgetPlanDetailTable tbody").append(template);
|
||||||
// let width=0
|
// let width=0
|
||||||
// $('#budgetPlanDetailTable tr').each(function (){
|
// $('#budgetPlanDetailTable tr').each(function (){
|
||||||
// width+=$(this).width()
|
// width+=$(this).width()
|
||||||
|
|
Loading…
Reference in New Issue