项目管理成本修改
parent
b136ca95f6
commit
8aed9549a8
|
@ -16,6 +16,20 @@ COST_PROJECT_MANAGE_DETAIL={
|
||||||
"deletable":[true,"是否可删除"]
|
"deletable":[true,"是否可删除"]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SELECT_TYPE_CATEGORY_MAP_DATA_MANAGER={};
|
||||||
|
/*{
|
||||||
|
"1":"1",
|
||||||
|
"2":"1",
|
||||||
|
"3":"1",
|
||||||
|
"4":"2",
|
||||||
|
"5":"3",
|
||||||
|
"6":"3",
|
||||||
|
"7":"3",
|
||||||
|
"8":"4"
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
SELECT_CATEGORY_TYPE_MAP_DATA_MANAGER={};
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
$("#cost-project-manage-detail").click(function () {
|
$("#cost-project-manage-detail").click(function () {
|
||||||
$('#my-prompt-cost-project-manage-detail').modal({
|
$('#my-prompt-cost-project-manage-detail').modal({
|
||||||
|
@ -37,9 +51,11 @@ $(function () {
|
||||||
$("#costProjectManageAddBtn").click(function () {
|
$("#costProjectManageAddBtn").click(function () {
|
||||||
appendTrCostProjectManage();
|
appendTrCostProjectManage();
|
||||||
});
|
});
|
||||||
|
bindTypeSelectChangeManager();
|
||||||
//绑定项目管理明细输入框
|
//绑定项目管理明细输入框
|
||||||
bindChangeableInputProjectManage();
|
bindChangeableInputProjectManage();
|
||||||
|
|
||||||
|
initTypeCategoryManage();
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
* 采购成本增加一行
|
* 采购成本增加一行
|
||||||
|
@ -69,10 +85,105 @@ function appendTrCostProjectManage() {
|
||||||
//重新绑定删除事件和input修改事件
|
//重新绑定删除事件和input修改事件
|
||||||
bindDeleteBtn();
|
bindDeleteBtn();
|
||||||
bindChangeableInputProjectManage();
|
bindChangeableInputProjectManage();
|
||||||
|
bindTypeSelectChangeManager();
|
||||||
//绑定数字输入框保留两位小数
|
//绑定数字输入框保留两位小数
|
||||||
bindNumberInput();
|
bindNumberInput();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 大类类别联动效果
|
||||||
|
*/
|
||||||
|
function bindTypeSelectChangeManager() {
|
||||||
|
//大类变化联动类别
|
||||||
|
$(".am-modal-prompt-input-cost-project-manage-type").on('change',function () {
|
||||||
|
var categorySelect = $(this).parent().parent().find(".am-modal-prompt-input-cost-project-manage-category");
|
||||||
|
var type = $(this).val();
|
||||||
|
//删除后重新添加对应的类别
|
||||||
|
categorySelect.empty();
|
||||||
|
|
||||||
|
//console.log(SELECT_TYPE_CATEGORY_MAP_DATA);
|
||||||
|
|
||||||
|
if(SELECT_TYPE_CATEGORY_MAP_DATA_MANAGER[type]){
|
||||||
|
categorySelect.append("<option value='xxxx' disabled selected>--请选择--</option>");
|
||||||
|
SELECT_TYPE_CATEGORY_MAP_DATA_MANAGER[type].forEach(function (d) {
|
||||||
|
categorySelect.append("<option value='"+d.id+"'>"+d.name+"</option>");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
//类别变化联动大类
|
||||||
|
$(".am-modal-prompt-input-cost-project-manage-category").on('change',function () {
|
||||||
|
var typeSelect = $(this).parent().parent().find(".am-modal-prompt-input-cost-project-manage-type");
|
||||||
|
var category = $(this).val();
|
||||||
|
//设置他选中类别对应的大类
|
||||||
|
|
||||||
|
//console.log(SELECT_CATEGORY_TYPE_MAP_DATA);
|
||||||
|
|
||||||
|
typeSelect.val(SELECT_CATEGORY_TYPE_MAP_DATA_MANAGER[category]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function initTypeCategoryManage() {
|
||||||
|
var temp1 = [];
|
||||||
|
temp1.push({
|
||||||
|
name:"人工费",
|
||||||
|
id:"1"
|
||||||
|
},{
|
||||||
|
name:"总部支撑人力费用",
|
||||||
|
id:"2"
|
||||||
|
});
|
||||||
|
SELECT_TYPE_CATEGORY_MAP_DATA_MANAGER[1] = temp1;
|
||||||
|
var temp2 = [];
|
||||||
|
temp2.push({
|
||||||
|
name:"人员差旅费",
|
||||||
|
id:"4"
|
||||||
|
},{
|
||||||
|
name:"业务费用",
|
||||||
|
id:"5"
|
||||||
|
},{
|
||||||
|
name:"商务及专项验收费用",
|
||||||
|
id:"6"
|
||||||
|
},{
|
||||||
|
name:"办公费用",
|
||||||
|
id:"7"
|
||||||
|
});
|
||||||
|
SELECT_TYPE_CATEGORY_MAP_DATA_MANAGER[2] = temp2;
|
||||||
|
|
||||||
|
SELECT_CATEGORY_TYPE_MAP_DATA_MANAGER[1] = 1;
|
||||||
|
SELECT_CATEGORY_TYPE_MAP_DATA_MANAGER[2] = 1;
|
||||||
|
// SELECT_CATEGORY_TYPE_MAP_DATA_MANAGER[3] = 1;
|
||||||
|
SELECT_CATEGORY_TYPE_MAP_DATA_MANAGER[4] = 2;
|
||||||
|
SELECT_CATEGORY_TYPE_MAP_DATA_MANAGER[5] = 2;
|
||||||
|
SELECT_CATEGORY_TYPE_MAP_DATA_MANAGER[6] = 2;
|
||||||
|
SELECT_CATEGORY_TYPE_MAP_DATA_MANAGER[7] = 2;
|
||||||
|
// SELECT_CATEGORY_TYPE_MAP_DATA_MANAGER[8] = 2;
|
||||||
|
|
||||||
|
// var d = data.data;
|
||||||
|
// var map = d.map;
|
||||||
|
//
|
||||||
|
// Object.keys(map).forEach(function (t, number) {
|
||||||
|
// var temp = [];
|
||||||
|
// map[t].forEach(function (g) {
|
||||||
|
// temp.push({
|
||||||
|
// name:g.name,
|
||||||
|
// id:g.id+""
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// SELECT_TYPE_CATEGORY_MAP_DATA_MANAGER[t]= temp;
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// var procurementTypes = d.procurementTypes;
|
||||||
|
// procurementTypes.forEach(function (e) {
|
||||||
|
// SELECT_TYPE_CATEGORY_DATA.push({
|
||||||
|
// id:e.id+"",
|
||||||
|
// name:e.name
|
||||||
|
// });
|
||||||
|
// SELECT_CATEGORY_TYPE_MAP_DATA_MANAGER[e.id]=e.type;
|
||||||
|
// });
|
||||||
|
// //--请选择--的映射
|
||||||
|
// //SELECT_CATEGORY_TYPE_MAP_DATA["xxxx"]="xxxx";
|
||||||
|
|
||||||
|
console.log("type to category: " + SELECT_TYPE_CATEGORY_MAP_DATA_MANAGER);
|
||||||
|
console.log("category to type: " + SELECT_CATEGORY_TYPE_MAP_DATA_MANAGER);
|
||||||
|
}
|
||||||
function bindChangeableInputProjectManage() {
|
function bindChangeableInputProjectManage() {
|
||||||
//数量改变
|
//数量改变
|
||||||
$(".input-changeable-amount-project-manage").change(function () {
|
$(".input-changeable-amount-project-manage").change(function () {
|
||||||
|
|
|
@ -570,33 +570,27 @@
|
||||||
<td>备注</td>
|
<td>备注</td>
|
||||||
<td>操作</td>
|
<td>操作</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<#if costProjectManageDetails??>
|
<#if costProjectManageDetails??>
|
||||||
<#list costProjectManageDetails as costProjectManageDetail>
|
<#list costProjectManageDetails as costProjectManageDetail>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<#--<select style="width: 80px;float: left;" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" <#if costProjectManageDetail.deletable==0>readonly</#if>>
|
<select style="width: 80px;float: left;" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage am-modal-prompt-input-cost-project-manage-type">
|
||||||
<option value="1" <#if costProjectManageDetail.type == 1>selected</#if>>人工成本</option>
|
|
||||||
<option value="2" <#if costProjectManageDetail.type == 2>selected</#if>>业务费用</option>
|
|
||||||
<option value="3" <#if costProjectManageDetail.type == 3>selected</#if>>其他费用</option>
|
|
||||||
</select>-->
|
|
||||||
<#if costProjectManageDetail.deletable==0>
|
|
||||||
<#if costProjectManageDetail.type ==1 >
|
|
||||||
<input readonly type="hidden" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="1">人工成本
|
|
||||||
<#elseif costProjectManageDetail.type ==2>
|
|
||||||
<input readonly type="hidden" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="2">业务费用
|
|
||||||
<#elseif costProjectManageDetail.type ==3>
|
|
||||||
<input readonly type="hidden" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="3">其他费用
|
|
||||||
</#if>
|
|
||||||
<#elseif costProjectManageDetail.deletable!=0>
|
|
||||||
<select style="width: 80px;float: left;" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage">
|
|
||||||
<option value="1" <#if costProjectManageDetail.type == 1>selected</#if>>人工成本</option>
|
<option value="1" <#if costProjectManageDetail.type == 1>selected</#if>>人工成本</option>
|
||||||
<option value="2" <#if costProjectManageDetail.type == 2>selected</#if>>业务费用</option>
|
<option value="2" <#if costProjectManageDetail.type == 2>selected</#if>>业务费用</option>
|
||||||
<option value="3" <#if costProjectManageDetail.type == 3>selected</#if>>其他费用</option>
|
<option value="3" <#if costProjectManageDetail.type == 3>selected</#if>>其他费用</option>
|
||||||
</select>
|
</select>
|
||||||
</#if>
|
|
||||||
</td>
|
</td>
|
||||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.name!}" <#if costProjectManageDetail.deletable==0>readonly</#if>></td>
|
<td>
|
||||||
|
<select style="width: 80px;float: left;" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage am-modal-prompt-input-cost-project-manage-category">
|
||||||
|
<option value="1" <#if costProjectManageDetail.name == "人工费">selected</#if>>人工费</option>
|
||||||
|
<option value="2" <#if costProjectManageDetail.name == "总部支撑人力费用">selected</#if>>总部支撑人力费用</option>
|
||||||
|
<option value="4" <#if costProjectManageDetail.name == "人员差旅费">selected</#if>>人员差旅费</option>
|
||||||
|
<option value="5" <#if costProjectManageDetail.name == "业务费用">selected</#if>>业务费用</option>
|
||||||
|
<option value="6" <#if costProjectManageDetail.name == "商务及专项验收费用">selected</#if>>商务及专项验收费用</option>
|
||||||
|
<option value="7" <#if costProjectManageDetail.name == "办公费用">selected</#if>>办公费用</option>
|
||||||
|
</select>
|
||||||
|
<#-- <input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.name!}" <#if costProjectManageDetail.deletable==0>readonly</#if>>-->
|
||||||
|
</td>
|
||||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.detail!}"></td>
|
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.detail!}"></td>
|
||||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.unit!}"></td>
|
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.unit!}"></td>
|
||||||
<td><input type="number" min="0" max="99999999" step="1" maxlength="8" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage input-changeable-amount-project-manage" value="${costProjectManageDetail.amount!0}" <#--onkeyup="integerNumber(this)"--> oninput="if(value.length>8)value=value.slice(0,8)"></td>
|
<td><input type="number" min="0" max="99999999" step="1" maxlength="8" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage input-changeable-amount-project-manage" value="${costProjectManageDetail.amount!0}" <#--onkeyup="integerNumber(this)"--> oninput="if(value.length>8)value=value.slice(0,8)"></td>
|
||||||
|
@ -605,7 +599,7 @@
|
||||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.predictMethod!}"></td>
|
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.predictMethod!}"></td>
|
||||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.predictWhy!}"></td>
|
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.predictWhy!}"></td>
|
||||||
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.remark!}"></td>
|
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.remark!}"></td>
|
||||||
<td><#if costProjectManageDetail.deletable==1><button type="button" class="am-btn am-btn-danger am-btn-xs am-round am-modal-line-delete"><span class="am-icon-minus"></span></button></#if>
|
<td><button type="button" class="am-btn am-btn-danger am-btn-xs am-round am-modal-line-delete"><span class="am-icon-minus"></span></button>
|
||||||
<input type="hidden" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.deletable!}">
|
<input type="hidden" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.deletable!}">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue