55 lines
2.9 KiB
JavaScript
55 lines
2.9 KiB
JavaScript
|
|
/**
|
|||
|
|
* 一个资金计划的字段
|
|||
|
|
*/
|
|||
|
|
BUDGET_PLAN_DETAIL_ARR=["type","name","detail","unit","amount","price","total","predictMethod","predictWhy","remark","deletable"];
|
|||
|
|
$(function () {
|
|||
|
|
$(".budget-plan-detail").click(function () {
|
|||
|
|
$('#my-prompt-budget-detail').modal({
|
|||
|
|
relatedTarget: this,
|
|||
|
|
onConfirm: function(e) {
|
|||
|
|
//不能使用e.data,因为无法获取动态添加的
|
|||
|
|
var data = collectData("am-modal-prompt-input-budget-plan");
|
|||
|
|
data = prepareAjaxData(data, BUDGET_PLAN_DETAIL_ARR, $("#id").val());
|
|||
|
|
saveDetail("/fourcal/project/budgetEditSaveBudgetPlanDetail", data, updateBudgetPlanData);
|
|||
|
|
},
|
|||
|
|
onCancel: function(e) {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
$("#budgetPlanAddBtn").click(function () {
|
|||
|
|
appendTrBudgetPlan();
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
/**
|
|||
|
|
* 资金计划增加一行
|
|||
|
|
*/
|
|||
|
|
function appendTrBudgetPlan() {
|
|||
|
|
var template = '<tr>\n' +
|
|||
|
|
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
|||
|
|
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
|||
|
|
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
|||
|
|
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
|||
|
|
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
|||
|
|
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" readonly></td>\n' +
|
|||
|
|
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
|||
|
|
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
|||
|
|
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan" readonly></td>\n' +
|
|||
|
|
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
|||
|
|
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
|||
|
|
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
|||
|
|
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-budget-plan"></td>\n' +
|
|||
|
|
' <td><button type="button" class="am-btn am-btn-warning am-btn-xs am-round am-modal-line-delete"><span class="am-icon-minus"></span></button></td>\n' +
|
|||
|
|
' </tr>';
|
|||
|
|
$("#budgetPlanTable").append(template);
|
|||
|
|
//重新绑定删除事件和input修改事件
|
|||
|
|
bindDeleteBtn();
|
|||
|
|
bindChangeableInputBudgetPlan();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function bindChangeableInputBudgetPlan() {
|
|||
|
|
}
|
|||
|
|
/**
|
|||
|
|
* 更新页面收入的数据
|
|||
|
|
*/
|
|||
|
|
function updateBudgetPlanData(details) {
|
|||
|
|
}
|