资金计划表 付款和收款增加公式校验

dev_1.0.0
‘wangjiuyun 2024-11-13 16:42:38 +08:00
parent 182a9991cf
commit cf9c367577
4 changed files with 68 additions and 17 deletions

View File

@ -92,7 +92,10 @@ $(function () {
$("#collaboratorUrl").val($("#collaboratorUrl_span").text());
// checkIfFillIn();
if(!checkprojectPlan()){
$("#saveDraft").attr('disabled', false);
return;
}
var dataIncome = collectData("am-modal-prompt-input-income");
if (dataIncome.length <= 0) {
window.confirm('请填写收入明细表');
@ -211,7 +214,10 @@ $(function () {
$("#saveApprove").click(function () {
$("#saveApprove").attr('disabled', true);
$("#collaboratorUrl").val($("#collaboratorUrl_span").text());
if(!checkprojectPlan()){
$("#saveApprove").attr('disabled', false);
return
}
checkIfFillIn();
if (check === 1) {
$("#saveApprove").attr('disabled', false);
@ -388,8 +394,6 @@ function checkIfFillIn() {
var calculationCollectionBudget = $("#calculationCollectionBudget").val();
if (name.length <= 0) {
window.confirm('项目名称不能为空');
check = 1;
@ -1020,3 +1024,32 @@ function updateBudgetPlanDetailDataUnsubmit(data, returnData) {
updateCashFlow();
}
// 校验资金计划表
function checkprojectPlan() {
// 付款总计
let planPayTotal = f2($('.input-total-title-total-cost-budget-plan').val())
// 保证金付款总计
let planPayEarnest = f2($('.input-total-title-earnest-money-cost-budget-plan').val())
// 项目管理付款总计
let planPayProject = f2($('.input-total-title-project-manage-cost-budget-plan').val())
// 采购成本明细总计
let costTatol = f2($('.input-changeable-total-total-tax-include-cost').val())
if (planPayTotal != (planPayEarnest + planPayProject + costTatol)) {
layuiAlert('资金计划表的付款合计需=保证金付款+项目管理费用表总计+采购成本明细表总计')
return false;
}
// 收款总计
let saleTatol = f2($('.input-total-title-total-income-budget-plan').val())
// 保证金收款
let saleEarnest=f2($('.input-total-title-earnest-money-income-budget-plan').val())
// 收入明细表总计
let incomeTotal=f2($('.input-changeable-total-total-tax-include-income').val())
if (saleTatol != (saleEarnest + incomeTotal)) {
layuiAlert('资金计划表的收款合计需= 保证金收款+收入明细表总计')
return false;
}
return true
}

View File

@ -48,6 +48,8 @@ $(function () {
bindNum();
updateTotal("input-changeable-receive-income-plan", "input-changeable-total-receive-income-plan");
});
bindIncomePlanTotal();
});
@ -56,7 +58,23 @@ $(function () {
*/
function updateIncomePlanData(data,returnData) {
layuiAlert("保存成功");
$('.input-changeable-sale-income-budget-plan').val(0)
$('.input-changeable-sale-income-budget-plan').each( (index,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')
})
$('#my-prompt-income-plan-detail').modal('close');
}

View File

@ -395,7 +395,7 @@ function appendTrBudgetPlan() {
' <td style="display: block;"><input type="text" maxlength="16" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-project-manage-cost-budget-plan" ></td>\n' +
' <td style="display: block;"><input type="text" maxlength="16" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-earnest-money-cost-budget-plan" ></td>\n' +
' <td style="display: block;"><input type="text" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-total-cost-budget-plan" readonly></td>\n' +
' <td style="display: block;"><input type="text" maxlength="16" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-sale-income-budget-plan"></td>\n' +
' <td style="display: block;"><input type="text" maxlength="16" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-sale-income-budget-plan" readonly></td>\n' +
' <td style="display: block;"><input type="text" maxlength="16" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-earnest-money-income-budget-plan"></td>\n' +
' <td style="display: block;"><input type="text" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-total-income-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-fund-balance-budget-plan" readonly></td>\n' +
@ -440,7 +440,7 @@ function appendTrBudgetPlan2() {
' <td style="display: block;"><input type="text" maxlength="16" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-project-manage-cost-budget-plan"></td>\n' +
' <td style="display: block;"><input type="text" maxlength="16" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-earnest-money-cost-budget-plan"></td>\n' +
' <td style="display: block;"><input type="text" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-total-cost-budget-plan" readonly></td>\n' +
' <td style="display: block;"><input type="text" maxlength="16" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-sale-income-budget-plan"></td>\n' +
' <td style="display: block;"><input type="text" maxlength="16" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-sale-income-budget-plan" readonly></td>\n' +
' <td style="display: block;"><input type="text" maxlength="16" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-earnest-money-income-budget-plan"></td>\n' +
' <td style="display: block;"><input type="text" value="0.00" class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-total-income-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-fund-balance-budget-plan" readonly></td>\n' +

View File

@ -1771,7 +1771,7 @@
oninput="if(value.length>16)value=value.slice(0,16)"
maxlength="16"
class="number am-modal-prompt-input am-modal-prompt-input-budget-plan-detail input-changeable-sale-income-budget-plan"
value="${Utils.format(projectBudgetPlanDetail.saleIncome)}">
value="${Utils.format(projectBudgetPlanDetail.saleIncome)}" readonly>
</td>
<td style="display: block;"><input type="text"
oninput="if(value.length>16)value=value.slice(0,16)"