From 4cb8f85788b227bbe6930fdecdd365d2ec7b2181 Mon Sep 17 00:00:00 2001
From: hanbo <2608504783@qq.com>
Date: Wed, 5 Jan 2022 11:29:47 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E7=AE=97=E9=A1=B5=E9=9D=A2=E4=BF=AE?=
 =?UTF-8?q?=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../static/assets/js/project_budget.js        | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/src/main/resources/static/assets/js/project_budget.js b/src/main/resources/static/assets/js/project_budget.js
index d47d3e2..f2f2f1c 100644
--- a/src/main/resources/static/assets/js/project_budget.js
+++ b/src/main/resources/static/assets/js/project_budget.js
@@ -124,6 +124,12 @@ $(function () {
             return;
         }
 
+        dataPlan = prepareAjaxDataVerify(dataPlan, BUDGET_PLAN_DETAIL, $("#id").val());
+        if(dataPlan){
+            postAjax(base+"/project/budgetEditSaveBudgetPlanDetail", dataPlan);
+        }
+        updateBudgetPlanDetailDataUnsubmit();
+
         $("#saveDraft").attr('disabled', true);
 
         var message = verifyProjectContributionProfitRate();
@@ -159,6 +165,13 @@ $(function () {
             return;
         }
 
+        //如果没有提交则自动计算预算信息
+        dataIncome = prepareAjaxDataVerify(dataIncome, INCOME_DETAIL, $("#id").val());
+        if(dataIncome.details){
+            postAjax(base+"/project/budgetEditSaveIncomeDetail", dataIncome);
+        }
+        updateIncomeDataUnsubmit(dataIncomeCheck);
+
         var dataCost = collectData("am-modal-prompt-input-cost");
         if (dataCost.length <= 0) {
             window.confirm('请填写采购成本明细表');
@@ -170,6 +183,13 @@ $(function () {
             return;
         }
 
+        //如果没有提交则自动计算预算信息
+        dataCost = prepareAjaxDataVerify(dataCost, COST_DETAIL, $("#id").val());
+        if(dataCost){
+            postAjax(base+"/project/budgetEditSaveCostDetail", dataCost);
+        }
+        updateCostDataIfUnsubmit(dataCostCheck);
+
         var dataManage = collectData("am-modal-prompt-input-cost-project-manage");
         if (dataManage.length <= 0) {
             window.confirm('请填写项目管理成本表');
@@ -181,6 +201,12 @@ $(function () {
             return;
         }
 
+        dataManage = prepareAjaxDataVerify(dataManage, COST_PROJECT_MANAGE_DETAIL, $("#id").val());
+        if(dataManage){
+            postAjax(base+"/project/budgetEditSaveCostProjectManageDetail", dataManage);
+        }
+        updateCostProjectManageDataUnsubmit(dataManageCheck);
+
         var dataPlan = collectData("am-modal-prompt-input-budget-plan-detail");
         if (dataPlan.length <= 0) {
             window.confirm('请填写项目资金计划表');