js文件拆分,防止过大

master
xxssyyyyssxx 2021-11-03 18:02:44 +08:00
parent cd1186e843
commit 611be7df7c
3 changed files with 39 additions and 33 deletions

View File

@ -2,7 +2,24 @@
* 一个采购成本详情的字段
*/
COST_DETAIL_ARR=["type","category","name","unit","amount","price","taxRate","totalTaxInclude","totalTaxExclude"];
$(function () {
$("#cost-detail").click(function () {
$('#my-prompt-cost-detail').modal({
relatedTarget: this,
onConfirm: function(e) {
//不能使用e.data因为无法获取动态添加的
var data = collectData("am-modal-prompt-input-cost");
data = prepareAjaxData(data, COST_DETAIL_ARR, $("#id").val());
saveDetail("/fourcal/project/budgetEditSaveCostDetail", data, updateCostData);
},
onCancel: function(e) {
}
});
});
$("#costAddBtn").click(function () {
appendTrCost();
});
});
/**
* 采购成本增加一行
*/

View File

@ -3,6 +3,26 @@
*/
INCOME_DETAIL_ARR=["type","name","unit","amount","price","taxRate","totalTaxInclude","totalTaxExclude"];
$(function () {
$("#income-detail").click(function () {
$('#my-prompt-income-detail').modal({
relatedTarget: this,
onConfirm: function(e) {
//不能使用e.data因为无法获取动态添加的
var data = collectData("am-modal-prompt-input-income");
data = prepareAjaxData(data, INCOME_DETAIL_ARR, $("#id").val());
saveDetail("/fourcal/project/budgetEditSaveIncomeDetail", data, updateIncomeData);
},
onCancel: function(e) {
}
});
});
$("#incomeAddBtn").click(function () {
appendTrIncome();
});
});
/**
* 更新页面收入的数据累加
*/

View File

@ -562,39 +562,8 @@
$("#pmsForm").submit();
});
$("#income-detail").click(function () {
$('#my-prompt-income-detail').modal({
relatedTarget: this,
onConfirm: function(e) {
//不能使用e.data因为无法获取动态添加的
var data = collectData("am-modal-prompt-input-income");
data = prepareAjaxData(data, INCOME_DETAIL_ARR, $("#id").val());
saveDetail("${base}/project/budgetEditSaveIncomeDetail", data, updateIncomeData);
},
onCancel: function(e) {
}
});
});
$("#incomeAddBtn").click(function () {
appendTrIncome();
});
$("#cost-detail").click(function () {
$('#my-prompt-cost-detail').modal({
relatedTarget: this,
onConfirm: function(e) {
//不能使用e.data因为无法获取动态添加的
var data = collectData("am-modal-prompt-input-cost");
data = prepareAjaxData(data, COST_DETAIL_ARR, $("#id").val());
saveDetail("${base}/project/budgetEditSaveCostDetail", data, updateCostData);
},
onCancel: function(e) {
}
});
});
$("#costAddBtn").click(function () {
appendTrCost();
});
});
</script>
</@defaultLayout.layout>