From e45cbd63c19052fd87e12b14824b016cf0a887be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=98wangjiuyun?= <‘1595161655@qq.com>
Date: Tue, 29 Oct 2024 17:07:51 +0800
Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=9C=9F=E8=B0=83=E6=95=B4?=
=?UTF-8?q?=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../static/assets/js/project_budget.js | 19 +++
.../static/assets/js/project_budget_pay.js | 113 +++++++------
.../static/assets/js/project_budget_plan.js | 6 -
.../templates/admin/project_approve.ftl | 160 ++++--------------
.../templates/admin/project_budget_edit.ftl | 3 -
5 files changed, 118 insertions(+), 183 deletions(-)
diff --git a/src/main/resources/static/assets/js/project_budget.js b/src/main/resources/static/assets/js/project_budget.js
index 6196296..efbb258 100644
--- a/src/main/resources/static/assets/js/project_budget.js
+++ b/src/main/resources/static/assets/js/project_budget.js
@@ -152,6 +152,7 @@ $(function () {
var projectGrossProfitA=$('[name="projectGrossProfitA"]').val()
if(Number(totalTotal)> (Number(projectGrossProfitA)*0.1) ){
layuiAlert(`总金额合计不能超过毛利A(${projectGrossProfitA})的10%`);
+ $("#saveDraft").attr('disabled', false)
return
}
if(dataManage){
@@ -194,11 +195,18 @@ $(function () {
// }
// console.log(message);
// 保存付款计划表
+ var flagPay= verifyBudgetPay()
+ if(!flagPay) {
+ $("#saveDraft").attr('disabled', false)
+ return;
+ }
var dataPay = collectData("am-modal-prompt-input-pay");
dataPay = prepareAjaxDataVerify(dataPay, pay_DETAIL2, $("#id").val());
if(dataPay){
postAjax(base+"/project/budgetEditSaveBudgetPayPlan", dataPay);
}
+
+
var startTime = $("#startDate").val();
var endTime = $("#endDate").val();
if (startTime > endTime) {
@@ -324,6 +332,17 @@ $(function () {
// layuiAlert(message);
// return;
// }
+ // 保存付款计划表
+ var flagPay= verifyBudgetPay()
+ if(!flagPay) {
+ $("#saveDraft").attr('disabled', false)
+ return;
+ }
+ var dataPay = collectData("am-modal-prompt-input-pay");
+ dataPay = prepareAjaxDataVerify(dataPay, pay_DETAIL2, $("#id").val());
+ if(dataPay){
+ postAjax(base+"/project/budgetEditSaveBudgetPayPlan", dataPay);
+ }
var startTime = $("#startDate").val();
var endTime = $("#endDate").val();
diff --git a/src/main/resources/static/assets/js/project_budget_pay.js b/src/main/resources/static/assets/js/project_budget_pay.js
index 15253f8..fbce2d7 100644
--- a/src/main/resources/static/assets/js/project_budget_pay.js
+++ b/src/main/resources/static/assets/js/project_budget_pay.js
@@ -2,29 +2,29 @@
* 一个采购成本详情的字段
*/
//COST_DETAIL_ARR=["type","category","name","unit","amount","price","taxRate","totalTaxInclude","totalTaxExclude"];
-pay_DETAIL2={
- "num":[false,"序号","string"],
- "payPoint":[false,"付款节点","string"],
- "payTime":[false,"付款时间","string"],
- "payProject":[false,"采购成本项目","number"],
- "payAmount":[false,"付款金额","number"],
- "supplier":[false,"供应商","string"],
+pay_DETAIL2 = {
+ "num": [false, "序号", "string"],
+ "payPoint": [false, "付款节点", "string"],
+ "payTime": [false, "付款时间", "string"],
+ "payProject": [false, "采购成本项目", "number"],
+ "payAmount": [false, "付款金额", "number"],
+ "supplier": [false, "供应商", "string"],
};
-pay_DETAIL={
- "num":[false,"序号","string"],
- "payPoint":[false,"付款节点","string"],
- "payTime":[false,"付款时间","string"],
- "payProject":[false,"采购成本项目","number"],
- "payAmount":[false,"付款金额","number"],
- "supplier":[false,"供应商","string"],
+pay_DETAIL = {
+ "num": [false, "序号", "string"],
+ "payPoint": [false, "付款节点", "string"],
+ "payTime": [false, "付款时间", "string"],
+ "payProject": [false, "采购成本项目", "number"],
+ "payAmount": [false, "付款金额", "number"],
+ "supplier": [false, "供应商", "string"],
};
/*
[
{"id":"1","name":"xxx1"},{"id":"2","name":"xxx2"}
]
*/
-SELECT_TYPE_CATEGORY_DATA=[];
+SELECT_TYPE_CATEGORY_DATA = [];
/*{
"1":[
{
@@ -67,7 +67,7 @@ SELECT_TYPE_CATEGORY_DATA=[];
}
]
};*/
-SELECT_TYPE_CATEGORY_MAP_DATA={};
+SELECT_TYPE_CATEGORY_MAP_DATA = {};
/*{
"1":"1",
"2":"1",
@@ -79,7 +79,7 @@ SELECT_TYPE_CATEGORY_MAP_DATA={};
"8":"4"
};
*/
-SELECT_CATEGORY_TYPE_MAP_DATA={};
+SELECT_CATEGORY_TYPE_MAP_DATA = {};
/*$(function () {
$("#cost-detail").click(function () {
@@ -119,11 +119,12 @@ $(function () {
var data = collectData("am-modal-prompt-input-pay");
//data = prepareAjaxData(data, COST_DETAIL_ARR, $("#id").val(),false);
data = prepareAjaxDataVerify(data, pay_DETAIL2, $("#id").val());
- if(data){
- postAjax(base+"/project/budgetEditSaveBudgetPayPlan", data, updateCostData);
+ var flag=verifyBudgetPay()
+ if(!flag) return
+ if (data) {
+ postAjax(base + "/project/budgetEditSaveBudgetPayPlan", data, updateCostData);
}
});
-
$("#payAddBtn").click(function () {
appendTrPay();
$("#payAddBtn").blur();
@@ -133,7 +134,7 @@ $(function () {
bindDeleteBtnPay();
//初始化大类和类别的数据
- getAjax(base+"/procurement/type/map", null, initTypeCategory);
+ getAjax(base + "/procurement/type/map", null, initTypeCategory);
});
/**
@@ -143,25 +144,25 @@ function appendTrPay() {
//console.log(SELECT_TYPE_CATEGORY_DATA);
var options = '\r\n';
SELECT_TYPE_CATEGORY_DATA.forEach(function (e) {
- options+='\r\n';
+ options += '\r\n';
});
var template = '
' +
' | ' +
- ' | '+
- ' | '+
- ''+
+ ' | | ' +
+ ' | ' +
+ '' +
''+
- ' | '+
+ '' +
+ '' +
+ '' +
+ '' +
+ '' +
+ '' +
+ '' +
' | ' +
' | ' +
- ' | '+
+ ' | ' +
'
';
@@ -198,7 +199,7 @@ function bindDeleteBtnPay() {
$(this).parent().parent().remove();
bindNum();
updateTotal("input-changeable-pay-amount", "input-changeable-pay-amount-total");
- });
+ });
}
/**
@@ -231,22 +232,22 @@ function updateCostData(data, returnData) {
var costTaxRates = "";
var set = new Set();
details.forEach(function (t, number, ts) {
- if(t["type"] == "1"){
+ if (t["type"] == "1") {
//设备类
deviceTaxInclude += f2(t["totalTaxInclude"]);
deviceTaxExclude += f2(t["totalTaxExclude"]);
deviceTax += f2(t["totalTax"]);
- }else if(t["type"] == "2"){
+ } else if (t["type"] == "2") {
//施工类
buildTaxInclude += f2(t["totalTaxInclude"]);
buildTaxExclude += f2(t["totalTaxExclude"]);
buildTax += f2(t["totalTax"]);
- }else if(t["type"] == "3"){
+ } else if (t["type"] == "3") {
//服务类
serviceTaxInclude += f2(t["totalTaxInclude"]);
serviceTaxExclude += f2(t["totalTaxExclude"]);
serviceTax += f2(t["totalTax"]);
- }else if(t["type"] == "4"){
+ } else if (t["type"] == "4") {
//其他类
otherTaxInclude += f2(t["totalTaxInclude"]);
otherTaxExclude += f2(t["totalTaxExclude"]);
@@ -273,10 +274,10 @@ function updateCostData(data, returnData) {
//资金计划表中的
$(".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-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-earnest-money-cost-budget-plan").val())));
+ $(".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)
+ + f2($(".input-total-title-project-manage-cost-budget-plan").val())
+ + f2($(".input-total-title-earnest-money-cost-budget-plan").val())));
/* var costOtherOtherTaxInclude = f2($("input[name='costOtherOtherTaxInclude']").val());
var costOtherOtherTaxExclude = f2($("input[name='costOtherOtherTaxExclude']").val());
@@ -316,20 +317,20 @@ function initTypeCategory(params, data) {
var temp = [];
map[t].forEach(function (g) {
temp.push({
- name:g.name,
- id:g.id+""
+ name: g.name,
+ id: g.id + ""
});
});
- SELECT_TYPE_CATEGORY_MAP_DATA[t]= temp;
+ SELECT_TYPE_CATEGORY_MAP_DATA[t] = temp;
});
var procurementTypes = d.procurementTypes;
procurementTypes.forEach(function (e) {
SELECT_TYPE_CATEGORY_DATA.push({
- id:e.id+"",
- name:e.name
+ id: e.id + "",
+ name: e.name
});
- SELECT_CATEGORY_TYPE_MAP_DATA[e.id]=e.type;
+ SELECT_CATEGORY_TYPE_MAP_DATA[e.id] = e.type;
});
//--请选择--的映射
//SELECT_CATEGORY_TYPE_MAP_DATA["xxxx"]="xxxx";
@@ -338,3 +339,19 @@ function initTypeCategory(params, data) {
// console.log(SELECT_TYPE_CATEGORY_DATA);
// console.log(SELECT_CATEGORY_TYPE_MAP_DATA);
}
+
+//校验付款明细表
+function verifyBudgetPay() {
+ var timeValue = $(".input-changeable-pay-time");
+ var flag=true
+ var timeFlag = true
+ timeValue.each((index, element) => {
+ if ($(element).val().length != 10)
+ timeFlag = false
+ })
+ if (timeFlag == false) {
+ flag=false
+ layuiAlert('付款计划表中付款时间为必填')
+ }
+ return flag
+}
diff --git a/src/main/resources/static/assets/js/project_budget_plan.js b/src/main/resources/static/assets/js/project_budget_plan.js
index 0a7cb26..909505c 100644
--- a/src/main/resources/static/assets/js/project_budget_plan.js
+++ b/src/main/resources/static/assets/js/project_budget_plan.js
@@ -1051,9 +1051,3 @@ function updateCashFlow() {
$("input[name='financingCapitalCashflow']").val(f2Fixed(m));
$("input[name='netIncreaseMonetaryFunds']").val(f2Fixed(n));
}
-//校验付款明细表
-function verifyBudgetPay(){
- var timeValue = classVal("input-changeable-pay-time");
-
-
-}
\ No newline at end of file
diff --git a/src/main/resources/templates/admin/project_approve.ftl b/src/main/resources/templates/admin/project_approve.ftl
index 67b11e0..3821a01 100644
--- a/src/main/resources/templates/admin/project_approve.ftl
+++ b/src/main/resources/templates/admin/project_approve.ftl
@@ -954,7 +954,7 @@
<#list incomeDetails as incomeDetail>
${(incomeDetail_index+1)!} |
-
+ |
<#if incomeDetail.type ==1 >
设备类
<#elseif incomeDetail.type ==2>
@@ -992,7 +992,7 @@
#if>
|
总计 |
- |
+ |
|
|
|
|
- |
@@ -1193,22 +1192,13 @@
序号 |
- 费用项目 |
- 采购类别 |
- 名称 |
- 单位 |
- 数量 |
- 单价 |
+ 采购成本项目 |
+ 产品大类 |
税率(%) |
含税总金额(元) |
不含税金额(元) |
税金(元) |
- 签约方 |
- 是否垫资 |
- 预估垫资金额(元) |
- 支出时间 |
- 支出金额(元) |
- 付款方式 |
+ 供应商 |
备注 |
@@ -1218,17 +1208,6 @@
${(costDetail_index+1)!} |
- <#---->
<#if costDetail.type ==1 >
设备
<#elseif costDetail.type ==2>
@@ -1244,20 +1223,7 @@
<#if costDetail.category == procurementType.id>${procurementType.name}#if>
#list>
|
- |
- |
-
- |
-
- |
+
|
-
- <#---->
- <#if costDetail.isUnderwritten ==0 >
-
- <#elseif costDetail.isUnderwritten ==1>
- 是
- <#elseif costDetail.isUnderwritten ==2>
- 否
- #if>
- |
- |
- |
- |
- |
|
@@ -1333,13 +1264,6 @@
|
|
|
- |
- > |
- |
- |
|
- |
- |
- |
- |
- |
+
|
|
@@ -1394,7 +1308,7 @@
id="costProjectManageTable">
- 序号 |
+ 序号 |
费用类别 |
业务项目 |
项目明细 |
@@ -1413,7 +1327,7 @@
<#list costProjectManageDetails as costProjectManageDetail>
${(costProjectManageDetail_index+1)!} |
-
+ |
<#if costProjectManageDetail.type ==1 >
人工成本
<#elseif costProjectManageDetail.type ==2>
@@ -1460,29 +1374,16 @@
#list>
#if>
|
- 总计 |
- |
+ |
|
|
|
- > |
+ |
|
- |
- |
- |
+ |
|
|
|
- <#-- | -->
@@ -1528,27 +1429,27 @@
class="am-modal-prompt-input"
value="月份"
readonly>
- |
- |
- |
- |
- |
- |
@@ -1556,11 +1457,11 @@
class="am-modal-prompt-input"
value="付款合计"
readonly>
- |
- |
@@ -1974,6 +1875,13 @@
费用项目 |
不含税金额(元) |
+
+ 成本 |
+ 项目管理费用 |
+ |
+
财务费用 |
资金占用成本 |
@@ -1981,12 +1889,11 @@
value="${Utils.format(budgetBean.costExpropriationTaxExclude,'0.00')}"
required readonly title="资金占用成本不含税总额">
+
- 成本 |
- 项目管理费用 |
- |
+ 合计 |
+ |
+ |
<#-- -->
<#-- 公司管理费用 | -->
@@ -2017,7 +1924,7 @@
|
- 毛利A=收入明细表金额总计(不含税)-采购成本明细表金额总计(不含税) |
+ 项目毛利A=收入合计(不含税)-采购成本合计(不含税) |
项目毛利B(元) |
@@ -4172,6 +4079,7 @@
$('.am-modal-prompt-input-budget-plan-income').css('display', 'none');
$('.am-modal-prompt-input-budget-plan-cost').css('display', 'none');
};
+ closeDetail()
var openDetail = function () {
$('.am-modal-prompt-input-budget-plan-income').css('display', 'block');
diff --git a/src/main/resources/templates/admin/project_budget_edit.ftl b/src/main/resources/templates/admin/project_budget_edit.ftl
index ce21ca6..0a004bd 100644
--- a/src/main/resources/templates/admin/project_budget_edit.ftl
+++ b/src/main/resources/templates/admin/project_budget_edit.ftl
@@ -1054,9 +1054,6 @@
|
|
|
-<#-- | -->
-<#-- | -->
-<#-- | -->
|
|
|