|
@@ -18,7 +18,7 @@ function delayKeyup(callback) {
|
|
|
}, delayTime);
|
|
|
}
|
|
|
|
|
|
-$(document).ready(function() {
|
|
|
+$(document).ready(function () {
|
|
|
let isAdding = false;
|
|
|
let model = '';
|
|
|
let section = $(".nav-tabs li.active > a").text() === '建议估算' ? 'suggestion' : 'bill';
|
|
@@ -30,12 +30,12 @@ $(document).ready(function() {
|
|
|
}
|
|
|
|
|
|
// 计价类型选择
|
|
|
- $(".nav-tabs li > a").click(function() {
|
|
|
+ $(".nav-tabs li > a").click(function () {
|
|
|
section = $(this).attr("aria-controls");
|
|
|
});
|
|
|
|
|
|
// 新增编办
|
|
|
- $("#add-compilation").click(function() {
|
|
|
+ $("#add-compilation").click(function () {
|
|
|
try {
|
|
|
let data = getAndValidData(model);
|
|
|
let url = '/compilation/add'
|
|
@@ -44,14 +44,14 @@ $(document).ready(function() {
|
|
|
$.ajax({
|
|
|
url: url,
|
|
|
type: 'post',
|
|
|
- data: {name: data.name},
|
|
|
- error: function() {
|
|
|
+ data: { name: data.name },
|
|
|
+ error: function () {
|
|
|
isAdding = false;
|
|
|
},
|
|
|
- beforeSend: function() {
|
|
|
+ beforeSend: function () {
|
|
|
isAdding = true;
|
|
|
},
|
|
|
- success: function(response) {
|
|
|
+ success: function (response) {
|
|
|
isAdding = false;
|
|
|
if (response.err === 0) {
|
|
|
window.location.reload();
|
|
@@ -68,15 +68,15 @@ $(document).ready(function() {
|
|
|
id: data[model].id
|
|
|
};
|
|
|
// 判断是否有重复的数据
|
|
|
- if ($("input:hidden[name='"+ model +"_lib'][data-id='"+ addLib.id +"']").length > 0) {
|
|
|
+ if ($("input:hidden[name='" + model + "_lib'][data-id='" + addLib.id + "']").length > 0) {
|
|
|
alert('重复添加数据!');
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- let removeHtml = '<a class="pull-right text-danger remove-lib" data-model="'+model+'" ' +
|
|
|
+ let removeHtml = '<a class="pull-right text-danger remove-lib" data-model="' + model + '" ' +
|
|
|
'title="移除"><span class="glyphicon glyphicon-remove"></span></a>';
|
|
|
let tmpHtml = '<p class="form-control-static">' + removeHtml + addLib.name +
|
|
|
- '<input type="hidden" data-id="'+ addLib.id +'" name=\'' + model + '_lib\' value=\'' + JSON.stringify(addLib) + '\'>' + '</p>';
|
|
|
+ '<input type="hidden" data-id="' + addLib.id + '" name=\'' + model + '_lib\' value=\'' + JSON.stringify(addLib) + '\'>' + '</p>';
|
|
|
$("." + model + "-list").append(tmpHtml);
|
|
|
$('#addcompilation').modal('hide');
|
|
|
}
|
|
@@ -96,37 +96,37 @@ $(document).ready(function() {
|
|
|
});
|
|
|
|
|
|
//新增计税组合
|
|
|
- $("#add-group").click(function() {
|
|
|
- let taxMap = {"1":"一般计税","2":"简易计税" };
|
|
|
+ $("#add-group").click(function () {
|
|
|
+ let taxMap = { "1": "一般计税", "2": "简易计税" };
|
|
|
let actionType = $('#groupEditType').val();
|
|
|
let groupData = getTaxGroupData();
|
|
|
let groupIndex = getGroupIndex(groupData);//用来做重复判断
|
|
|
- if(!_.isEmpty(groupData)){
|
|
|
+ if (!_.isEmpty(groupData)) {
|
|
|
//重复判断 todo
|
|
|
- if($("input[data-id = "+groupIndex+"]").length <= 0){
|
|
|
- let taxName = groupData.taxType?taxMap[groupData.taxType]:'';
|
|
|
- let p_name = groupData.program_lib?groupData.program_lib.displayName:"";
|
|
|
- let t_name = groupData.template_lib?groupData.template_lib.name:"";
|
|
|
- let c_name = groupData.col_lib?groupData.col_lib.name:"";
|
|
|
- let f_name = groupData.fee_lib?groupData.fee_lib.name:"";
|
|
|
- let htmlString = "<tr class='taxGroup_tr'><td><span>"+taxName+"</span></td>" +
|
|
|
- "<td><span>"+p_name+"</span></td>" +
|
|
|
- "<td><span>"+t_name+"</span></td>" +
|
|
|
- "<td><span>"+c_name+"</span></td>" +
|
|
|
- "<td><span>"+f_name+"</span></td>" +
|
|
|
+ if ($("input[data-id = " + groupIndex + "]").length <= 0) {
|
|
|
+ let taxName = groupData.taxType ? taxMap[groupData.taxType] : '';
|
|
|
+ let p_name = groupData.program_lib ? groupData.program_lib.displayName : "";
|
|
|
+ let t_name = groupData.template_lib ? groupData.template_lib.name : "";
|
|
|
+ let c_name = groupData.col_lib ? groupData.col_lib.name : "";
|
|
|
+ let f_name = groupData.fee_lib ? groupData.fee_lib.name : "";
|
|
|
+ let htmlString = "<tr class='taxGroup_tr'><td><span>" + taxName + "</span></td>" +
|
|
|
+ "<td><span>" + p_name + "</span></td>" +
|
|
|
+ "<td><span>" + t_name + "</span></td>" +
|
|
|
+ "<td><span>" + c_name + "</span></td>" +
|
|
|
+ "<td><span>" + f_name + "</span></td>" +
|
|
|
"<td> <a class='btn btn-link btn-sm' style='padding: 0px' onclick='editTaxGroup(this)'> 编辑</a>/<a class='btn btn-link btn-sm ' style='padding: 0px' onclick='deleteTableTr(this,\"taxGroup_tr\")'>删除</a> " +
|
|
|
- "<input type='hidden' name='tax_group' data-id ='"+groupIndex+"' value='"+JSON.stringify(groupData)+"'>"+
|
|
|
+ "<input type='hidden' name='tax_group' data-id ='" + groupIndex + "' value='" + JSON.stringify(groupData) + "'>" +
|
|
|
"</td>" +
|
|
|
"</tr>";
|
|
|
- if(actionType == "add"){
|
|
|
+ if (actionType == "add") {
|
|
|
$("#tax_group_tbody").append(htmlString);
|
|
|
- }else if(actionType == "modify"){
|
|
|
+ } else if (actionType == "modify") {
|
|
|
let oldIndex = $("#groupIndex").val();
|
|
|
- let parentTr = $("input[data-id = "+oldIndex+"]").parents(".taxGroup_tr");
|
|
|
+ let parentTr = $("input[data-id = " + oldIndex + "]").parents(".taxGroup_tr");
|
|
|
parentTr.after(htmlString);
|
|
|
parentTr.remove();
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
alert("已存在相同的组合!");
|
|
|
}
|
|
|
}
|
|
@@ -240,12 +240,12 @@ $(document).ready(function() {
|
|
|
$(this).removeClass('highlight');
|
|
|
$(this).after($(dragged));
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
// 新增计价规则
|
|
|
- $("#add-valuation").click(function() {
|
|
|
+ $("#add-valuation").click(function () {
|
|
|
try {
|
|
|
if (id === '') {
|
|
|
throw '页面数据有误';
|
|
@@ -258,14 +258,14 @@ $(document).ready(function() {
|
|
|
$.ajax({
|
|
|
url: '/compilation/add-valuation',
|
|
|
type: 'post',
|
|
|
- data: {name: name, id: id, section: section},
|
|
|
- error: function() {
|
|
|
+ data: { name: name, id: id, section: section },
|
|
|
+ error: function () {
|
|
|
isAdding = false;
|
|
|
},
|
|
|
- beforeSend: function() {
|
|
|
+ beforeSend: function () {
|
|
|
isAdding = true;
|
|
|
},
|
|
|
- success: function(response) {
|
|
|
+ success: function (response) {
|
|
|
isAdding = false;
|
|
|
if (response.err === 0) {
|
|
|
window.location.reload();
|
|
@@ -282,7 +282,7 @@ $(document).ready(function() {
|
|
|
});
|
|
|
|
|
|
// 添加
|
|
|
- $(".add-compilation").click(function() {
|
|
|
+ $(".add-compilation").click(function () {
|
|
|
model = $(this).data('model');
|
|
|
$("#addcompilation .modal-body > div").hide();
|
|
|
switch (model) {
|
|
@@ -337,25 +337,25 @@ $(document).ready(function() {
|
|
|
case 'billCode':
|
|
|
$("#billCode-area").show();
|
|
|
$("#add-compilation-title").text('添加递延清单库');
|
|
|
- break;
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
$("#addcompilation").modal('show');
|
|
|
});
|
|
|
|
|
|
// 保存专业工程标准库
|
|
|
- $("#save-lib").click(function() {
|
|
|
+ $("#save-lib").click(function () {
|
|
|
if (validLib()) {
|
|
|
$("form").submit();
|
|
|
}
|
|
|
});
|
|
|
// 保存计价规则
|
|
|
- $("#save-valuation").click(function() {
|
|
|
+ $("#save-valuation").click(function () {
|
|
|
$("#saveValuation").submit();
|
|
|
});
|
|
|
|
|
|
// 移除操作
|
|
|
- $(".bill-list, .ration-list, .glj-list, .fee-list, .artificial-list, .program-list, .billsGuidance-list,.feature-list,.info-list,.progressive-list,.vvTax-list,.billCode-list").on("click", ".remove-lib", function() {
|
|
|
+ $(".bill-list, .ration-list, .glj-list, .fee-list, .artificial-list, .program-list, .billsGuidance-list,.feature-list,.info-list,.progressive-list,.vvTax-list,.billCode-list").on("click", ".remove-lib", function () {
|
|
|
$(this).parent().remove();
|
|
|
});
|
|
|
|
|
@@ -366,8 +366,8 @@ $(document).ready(function() {
|
|
|
url: '/compilation/setDescription',
|
|
|
type: 'post',
|
|
|
dataType: "json",
|
|
|
- data: {id: id, description: description},
|
|
|
- success: function(response) {
|
|
|
+ data: { id: id, description: description },
|
|
|
+ success: function (response) {
|
|
|
if (response.err !== 0) {
|
|
|
alert('更改失败');
|
|
|
}
|
|
@@ -378,13 +378,13 @@ $(document).ready(function() {
|
|
|
//更改代码覆盖路径
|
|
|
$('#overWriteUrl').change(function () {
|
|
|
let overWriteUrl = $(this).val();
|
|
|
- if(overWriteUrl=="") overWriteUrl = undefined;
|
|
|
+ if (overWriteUrl == "") overWriteUrl = undefined;
|
|
|
$.ajax({
|
|
|
url: '/compilation/setOverWriteUrl',
|
|
|
type: 'post',
|
|
|
dataType: "json",
|
|
|
- data: {id: id, overWriteUrl: overWriteUrl},
|
|
|
- success: function(response) {
|
|
|
+ data: { id: id, overWriteUrl: overWriteUrl },
|
|
|
+ success: function (response) {
|
|
|
if (response.err !== 0) {
|
|
|
alert('更改失败');
|
|
|
}
|
|
@@ -409,8 +409,8 @@ $(document).ready(function() {
|
|
|
url: '/compilation/setExample',
|
|
|
type: 'post',
|
|
|
dataType: "json",
|
|
|
- data: {id: id, example: example},
|
|
|
- success: function(response) {
|
|
|
+ data: { id: id, example: example },
|
|
|
+ success: function (response) {
|
|
|
if (response.err !== 0) {
|
|
|
alert('更改失败');
|
|
|
}
|
|
@@ -420,7 +420,7 @@ $(document).ready(function() {
|
|
|
});
|
|
|
|
|
|
// 计价规则启用/禁止
|
|
|
- $(".enable").click(function() {
|
|
|
+ $(".enable").click(function () {
|
|
|
let goingChangeStatus = switchChange($(this));
|
|
|
let id = $(this).data('id');
|
|
|
if (id === undefined || id === '' || isAdding) {
|
|
@@ -430,15 +430,15 @@ $(document).ready(function() {
|
|
|
url: '/compilation/valuation/' + section + '/enable',
|
|
|
type: 'post',
|
|
|
dataType: "json",
|
|
|
- data: {id: id, enable: goingChangeStatus},
|
|
|
- error: function() {
|
|
|
+ data: { id: id, enable: goingChangeStatus },
|
|
|
+ error: function () {
|
|
|
isAdding = false;
|
|
|
switchChange($(this));
|
|
|
},
|
|
|
- beforeSend: function() {
|
|
|
+ beforeSend: function () {
|
|
|
isAdding = true;
|
|
|
},
|
|
|
- success: function(response) {
|
|
|
+ success: function (response) {
|
|
|
isAdding = false;
|
|
|
if (response.err !== 0) {
|
|
|
switchChange($(this));
|
|
@@ -450,45 +450,45 @@ $(document).ready(function() {
|
|
|
|
|
|
|
|
|
// 设置适用类型
|
|
|
- $(".fileType").change(function() {
|
|
|
-
|
|
|
+ $(".fileType").change(function () {
|
|
|
+
|
|
|
let id = $(this).data('id');
|
|
|
if (id === undefined || id === '' || isAdding) {
|
|
|
return false;
|
|
|
}
|
|
|
let fileTypes = [];
|
|
|
let oldVal = $(this).attr("checked");
|
|
|
- if(oldVal){
|
|
|
- $(this).removeAttr("checked")
|
|
|
- }else{
|
|
|
- $(this).attr("checked","checked")
|
|
|
+ if (oldVal) {
|
|
|
+ $(this).removeAttr("checked")
|
|
|
+ } else {
|
|
|
+ $(this).attr("checked", "checked")
|
|
|
}
|
|
|
|
|
|
- if($('#'+id+'_suggest_gusuan').attr("checked")) fileTypes.push(16);
|
|
|
- if($('#'+id+'_gusuan').attr("checked")) fileTypes.push(15);
|
|
|
- if($('#'+id+'_estimate').attr("checked")) fileTypes.push(5);
|
|
|
- if($('#'+id+'_submission').attr("checked")) fileTypes.push(1);
|
|
|
- if($('#'+id+'_three_bill_budget').attr("checked")) fileTypes.push(18);
|
|
|
- if($('#'+id+'_bill_budget').attr("checked")) fileTypes.push(19);
|
|
|
- if($('#'+id+'_changeBudget').attr("checked")) fileTypes.push(4);
|
|
|
- if($('#'+id+'_settlement').attr("checked")) fileTypes.push(10);
|
|
|
+ if ($('#' + id + '_suggest_gusuan').attr("checked")) fileTypes.push(16);
|
|
|
+ if ($('#' + id + '_gusuan').attr("checked")) fileTypes.push(15);
|
|
|
+ if ($('#' + id + '_estimate').attr("checked")) fileTypes.push(5);
|
|
|
+ if ($('#' + id + '_submission').attr("checked")) fileTypes.push(1);
|
|
|
+ if ($('#' + id + '_three_bill_budget').attr("checked")) fileTypes.push(18);
|
|
|
+ if ($('#' + id + '_bill_budget').attr("checked")) fileTypes.push(19);
|
|
|
+ if ($('#' + id + '_changeBudget').attr("checked")) fileTypes.push(4);
|
|
|
+ if ($('#' + id + '_settlement').attr("checked")) fileTypes.push(10);
|
|
|
let current = $(this);
|
|
|
|
|
|
- console.log(id,this);
|
|
|
+ console.log(id, this);
|
|
|
$.ajax({
|
|
|
url: '/compilation/valuation/' + section + '/fileTypes',
|
|
|
type: 'post',
|
|
|
dataType: "json",
|
|
|
- data: {id: id, fileTypes: fileTypes},
|
|
|
- error: function() {
|
|
|
+ data: { id: id, fileTypes: fileTypes },
|
|
|
+ error: function () {
|
|
|
//恢复原值
|
|
|
- if(oldVal){
|
|
|
- current.attr("checked","checked")
|
|
|
- }else{
|
|
|
- current.removeAttr("checked")
|
|
|
- }
|
|
|
+ if (oldVal) {
|
|
|
+ current.attr("checked", "checked")
|
|
|
+ } else {
|
|
|
+ current.removeAttr("checked")
|
|
|
+ }
|
|
|
},
|
|
|
- success: function(response) {
|
|
|
+ success: function (response) {
|
|
|
if (response.err !== 0) {
|
|
|
switchChange($(this));
|
|
|
alert('更改失败');
|
|
@@ -509,7 +509,7 @@ $(document).ready(function() {
|
|
|
});
|
|
|
|
|
|
// 发布编办
|
|
|
- $("#release").click(function() {
|
|
|
+ $("#release").click(function () {
|
|
|
let id = $(this).data("id");
|
|
|
let status = $(this).data("status");
|
|
|
status = parseInt(status);
|
|
@@ -520,15 +520,15 @@ $(document).ready(function() {
|
|
|
$.ajax({
|
|
|
url: '/compilation/release',
|
|
|
type: 'post',
|
|
|
- data: {id: id, status: status},
|
|
|
+ data: { id: id, status: status },
|
|
|
dataType: "json",
|
|
|
- error: function() {
|
|
|
+ error: function () {
|
|
|
isAdding = false;
|
|
|
},
|
|
|
- beforeSend: function() {
|
|
|
+ beforeSend: function () {
|
|
|
isAdding = true;
|
|
|
},
|
|
|
- success: function(response) {
|
|
|
+ success: function (response) {
|
|
|
isAdding = false;
|
|
|
if (response.err === 0) {
|
|
|
window.location.reload();
|
|
@@ -542,24 +542,24 @@ $(document).ready(function() {
|
|
|
});
|
|
|
|
|
|
//添加工程专业
|
|
|
- $("#addEngineerConfirm").click(async function() {
|
|
|
- if($('#name').val() == ''){
|
|
|
+ $("#addEngineerConfirm").click(async function () {
|
|
|
+ if ($('#name').val() == '') {
|
|
|
$("#nameError").show();
|
|
|
return;
|
|
|
}
|
|
|
- if($('#feeName').val() == ''){
|
|
|
+ if ($('#feeName').val() == '') {
|
|
|
$("#feeNameError").show();
|
|
|
return;
|
|
|
}
|
|
|
- if($('#engineeringInput').val() == ''){
|
|
|
+ if ($('#engineeringInput').val() == '') {
|
|
|
$("#engineeringError").show();
|
|
|
return;
|
|
|
}
|
|
|
- if($('#projectEngineering').val() == ''){
|
|
|
+ if ($('#projectEngineering').val() == '') {
|
|
|
$("#projectError").show();
|
|
|
return;
|
|
|
}
|
|
|
- $("#addEngineerConfirm").attr("disabled",true);//防止重复提交
|
|
|
+ $("#addEngineerConfirm").attr("disabled", true);//防止重复提交
|
|
|
$("#addEngineerForm").submit();
|
|
|
});
|
|
|
//
|
|
@@ -569,9 +569,9 @@ $(document).ready(function() {
|
|
|
$.ajax({
|
|
|
url: '/compilation/changeCategory',
|
|
|
type: 'post',
|
|
|
- data: {id: id, category: $(this).val()},
|
|
|
+ data: { id: id, category: $(this).val() },
|
|
|
dataType: "json",
|
|
|
- success: function(response) {
|
|
|
+ success: function (response) {
|
|
|
if (response.error !== 0) {
|
|
|
alert('更改失败');
|
|
|
}
|
|
@@ -584,9 +584,9 @@ $(document).ready(function() {
|
|
|
$.ajax({
|
|
|
url: '/compilation/changeLocation',
|
|
|
type: 'post',
|
|
|
- data: {id: id, location: $(this).val()},
|
|
|
+ data: { id: id, location: $(this).val() },
|
|
|
dataType: "json",
|
|
|
- success: function(response) {
|
|
|
+ success: function (response) {
|
|
|
if (response.error !== 0) {
|
|
|
alert('更改失败');
|
|
|
}
|
|
@@ -599,9 +599,9 @@ $(document).ready(function() {
|
|
|
$.ajax({
|
|
|
url: '/compilation/changeFreeUse',
|
|
|
type: 'post',
|
|
|
- data: {id: id, freeUse: $(this).prop('checked')},
|
|
|
+ data: { id: id, freeUse: $(this).prop('checked') },
|
|
|
dataType: "json",
|
|
|
- success: function(response) {
|
|
|
+ success: function (response) {
|
|
|
if (response.error !== 0) {
|
|
|
alert('更改失败');
|
|
|
}
|
|
@@ -624,6 +624,22 @@ $(document).ready(function() {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+ //更改序号
|
|
|
+ $('#serialNumber').change(function () {
|
|
|
+ let serialNumber = Number($(this).val());
|
|
|
+ $.ajax({
|
|
|
+ url: '/compilation/setSerialNumber',
|
|
|
+ type: 'post',
|
|
|
+ dataType: "json",
|
|
|
+ data: { id: id, serialNumber: serialNumber },
|
|
|
+ success: function (response) {
|
|
|
+ if (response.err !== 0) {
|
|
|
+ alert('更改失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
/**
|
|
@@ -640,12 +656,12 @@ function initCompilation() {
|
|
|
let programData = programList === undefined ? [] : JSON.parse(programList);
|
|
|
let billsGuidanceData = billsGuidanceList === undefined ? [] : JSON.parse(billsGuidanceList);
|
|
|
let billTemplateData = billTemplateList == undefined ? [] : JSON.parse(billTemplateList);
|
|
|
- let mainTreeColData= mainTreeColList == undefined ? [] : JSON.parse(mainTreeColList);
|
|
|
- let featureData = featureList == undefined?[]: JSON.parse(featureList);
|
|
|
+ let mainTreeColData = mainTreeColList == undefined ? [] : JSON.parse(mainTreeColList);
|
|
|
+ let featureData = featureList == undefined ? [] : JSON.parse(featureList);
|
|
|
let infoData = infoList == undefined ? [] : JSON.parse(infoList);
|
|
|
- let progressiveData = progressiveList == undefined?[]: JSON.parse(progressiveList);
|
|
|
- let vvTaxData = vvTaxList == undefined?[]: JSON.parse(vvTaxList);
|
|
|
- let billCodeData = billCodeList == undefined?[]: JSON.parse(billCodeList);
|
|
|
+ let progressiveData = progressiveList == undefined ? [] : JSON.parse(progressiveList);
|
|
|
+ let vvTaxData = vvTaxList == undefined ? [] : JSON.parse(vvTaxList);
|
|
|
+ let billCodeData = billCodeList == undefined ? [] : JSON.parse(billCodeList);
|
|
|
/*mainTreeCol = mainTreeCol !== '' ? mainTreeCol.replace(/\n/g, '\\n') : mainTreeCol;
|
|
|
billsTemplateData = billsTemplateData.replace(/\n/g, '\\n');
|
|
|
|
|
@@ -667,14 +683,14 @@ function initCompilation() {
|
|
|
|
|
|
// 标准清单
|
|
|
let html = '';
|
|
|
- for(let tmp of billListData) {
|
|
|
+ for (let tmp of billListData) {
|
|
|
let tmpHtml = '<option value="' + tmp.id + '">' + tmp.name + '</option>';
|
|
|
html += tmpHtml;
|
|
|
}
|
|
|
$("select[name='standard_bill']").children("option").first().after(html);
|
|
|
// 定额库
|
|
|
html = '';
|
|
|
- for(let tmp of rationLibData) {
|
|
|
+ for (let tmp of rationLibData) {
|
|
|
let tmpHtml = '<option value="' + tmp.id + '">' + tmp.name + '</option>';
|
|
|
html += tmpHtml;
|
|
|
}
|
|
@@ -682,7 +698,7 @@ function initCompilation() {
|
|
|
|
|
|
// 工料机库
|
|
|
html = '';
|
|
|
- for(let tmp of gljLibData) {
|
|
|
+ for (let tmp of gljLibData) {
|
|
|
let tmpHtml = '<option value="' + tmp.id + '">' + tmp.name + '</option>';
|
|
|
html += tmpHtml;
|
|
|
}
|
|
@@ -690,7 +706,7 @@ function initCompilation() {
|
|
|
|
|
|
// 清单指引库
|
|
|
html = '';
|
|
|
- for(let tmp of billsGuidanceData) {
|
|
|
+ for (let tmp of billsGuidanceData) {
|
|
|
let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
|
|
|
html += tmpHtml;
|
|
|
}
|
|
@@ -699,7 +715,7 @@ function initCompilation() {
|
|
|
|
|
|
// 人工系数标准库
|
|
|
html = '';
|
|
|
- for(let tmp of artificialCoefficientData) {
|
|
|
+ for (let tmp of artificialCoefficientData) {
|
|
|
let tmpHtml = '<option value="' + tmp.id + '">' + tmp.name + '</option>';
|
|
|
html += tmpHtml;
|
|
|
}
|
|
@@ -707,7 +723,7 @@ function initCompilation() {
|
|
|
|
|
|
// 计算程序标准库
|
|
|
html = '';
|
|
|
- for(let tmp of programData) {
|
|
|
+ for (let tmp of programData) {
|
|
|
let tmpHtml = '<option value="' + tmp.id + '">' + tmp.displayName + '</option>';
|
|
|
html += tmpHtml;
|
|
|
}
|
|
@@ -715,14 +731,14 @@ function initCompilation() {
|
|
|
|
|
|
//模板库
|
|
|
html = '';
|
|
|
- for(let tmp of billTemplateData) {
|
|
|
+ for (let tmp of billTemplateData) {
|
|
|
let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
|
|
|
html += tmpHtml;
|
|
|
}
|
|
|
$("select[name='template_lib']").children("option").first().after(html);
|
|
|
//列设置
|
|
|
html = '';
|
|
|
- for(let tmp of mainTreeColData) {
|
|
|
+ for (let tmp of mainTreeColData) {
|
|
|
let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
|
|
|
html += tmpHtml;
|
|
|
}
|
|
@@ -730,7 +746,7 @@ function initCompilation() {
|
|
|
|
|
|
// 费率标准库
|
|
|
html = '';
|
|
|
- for(let tmp of feeLibData) {
|
|
|
+ for (let tmp of feeLibData) {
|
|
|
let tmpHtml = '<option value="' + tmp.id + '">' + tmp.name + '</option>';
|
|
|
html += tmpHtml;
|
|
|
}
|
|
@@ -738,7 +754,7 @@ function initCompilation() {
|
|
|
|
|
|
//工程特征库
|
|
|
html = '';
|
|
|
- for(let tmp of featureData){
|
|
|
+ for (let tmp of featureData) {
|
|
|
let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
|
|
|
html += tmpHtml;
|
|
|
}
|
|
@@ -746,15 +762,15 @@ function initCompilation() {
|
|
|
|
|
|
//基本信息库
|
|
|
html = '';
|
|
|
- for(let tmp of infoData){
|
|
|
+ for (let tmp of infoData) {
|
|
|
let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
|
|
|
html += tmpHtml;
|
|
|
}
|
|
|
$("select[name='info_lib']").children("option").first().after(html);
|
|
|
-
|
|
|
+
|
|
|
//累进区间库
|
|
|
html = '';
|
|
|
- for(let tmp of progressiveData){
|
|
|
+ for (let tmp of progressiveData) {
|
|
|
let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
|
|
|
html += tmpHtml;
|
|
|
}
|
|
@@ -762,19 +778,19 @@ function initCompilation() {
|
|
|
|
|
|
//车船税文件
|
|
|
html = '';
|
|
|
- for(let tmp of vvTaxData){
|
|
|
+ for (let tmp of vvTaxData) {
|
|
|
let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
|
|
|
html += tmpHtml;
|
|
|
}
|
|
|
$("select[name='vvTax_lib']").children("option").first().after(html);
|
|
|
|
|
|
- //递延清单库文件
|
|
|
- html = '';
|
|
|
- for(let tmp of billCodeData){
|
|
|
- let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
|
|
|
- html += tmpHtml;
|
|
|
- }
|
|
|
- $("select[name='billCode_lib']").children("option").first().after(html);
|
|
|
+ //递延清单库文件
|
|
|
+ html = '';
|
|
|
+ for (let tmp of billCodeData) {
|
|
|
+ let tmpHtml = '<option value="' + tmp.ID + '">' + tmp.name + '</option>';
|
|
|
+ html += tmpHtml;
|
|
|
+ }
|
|
|
+ $("select[name='billCode_lib']").children("option").first().after(html);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -788,7 +804,7 @@ function getAndValidData(model) {
|
|
|
let standardBill = $("select[name='standard_bill']").children("option:selected").val();
|
|
|
let rationLib = $("select[name='ration_lib']").children("option:selected").val();
|
|
|
let gljLib = $("select[name='glj_lib']").children("option:selected").val();
|
|
|
- // let feeLib = $("select[name='fee_lib']").children("option:selected").val();
|
|
|
+ // let feeLib = $("select[name='fee_lib']").children("option:selected").val();
|
|
|
let artificialLib = $("select[name='artificial_lib']").children("option:selected").val();
|
|
|
let programLib = $("select[name='program_lib']").children("option:selected").val();
|
|
|
let billsGuidanceLib = $("select[name='billsGuidance_lib']").children("option:selected").val();
|
|
@@ -803,7 +819,7 @@ function getAndValidData(model) {
|
|
|
throw '编办名字不能为空';
|
|
|
}
|
|
|
|
|
|
- if ( model === 'bill' && (standardBill === '' || standardBill === undefined)) {
|
|
|
+ if (model === 'bill' && (standardBill === '' || standardBill === undefined)) {
|
|
|
throw '请选择标准清单库';
|
|
|
}
|
|
|
|
|
@@ -843,7 +859,7 @@ function getAndValidData(model) {
|
|
|
let standardBillString = $("select[name='standard_bill']").children("option:selected").text();
|
|
|
let rationLibString = $("select[name='ration_lib']").children("option:selected").text();
|
|
|
let gljLibString = $("select[name='glj_lib']").children("option:selected").text();
|
|
|
- // let feeLibString = $("select[name='fee_lib']").children("option:selected").text();
|
|
|
+ // let feeLibString = $("select[name='fee_lib']").children("option:selected").text();
|
|
|
let artificialString = $("select[name='artificial_lib']").children("option:selected").text();
|
|
|
let programString = $("select[name='program_lib']").children("option:selected").text();
|
|
|
let billsGuidanceString = $("select[name='billsGuidance_lib']").children("option:selected").text();
|
|
@@ -868,10 +884,10 @@ function getAndValidData(model) {
|
|
|
id: gljLib,
|
|
|
name: gljLibString
|
|
|
},
|
|
|
- /* fee: {
|
|
|
- id: feeLib,
|
|
|
- name: feeLibString
|
|
|
- },*/
|
|
|
+ /* fee: {
|
|
|
+ id: feeLib,
|
|
|
+ name: feeLibString
|
|
|
+ },*/
|
|
|
artificial: {
|
|
|
id: artificialLib,
|
|
|
name: artificialString
|
|
@@ -884,17 +900,17 @@ function getAndValidData(model) {
|
|
|
id: billsGuidanceLib,
|
|
|
name: billsGuidanceString
|
|
|
},
|
|
|
- feature:{
|
|
|
- id:featureLib,
|
|
|
- name:featrueString
|
|
|
+ feature: {
|
|
|
+ id: featureLib,
|
|
|
+ name: featrueString
|
|
|
},
|
|
|
info: {
|
|
|
id: infoLib,
|
|
|
name: infoString
|
|
|
},
|
|
|
- progressive:{
|
|
|
- id:progressiveLib,
|
|
|
- name:progressiveString
|
|
|
+ progressive: {
|
|
|
+ id: progressiveLib,
|
|
|
+ name: progressiveString
|
|
|
},
|
|
|
vvTax: {
|
|
|
id: vvTaxLib,
|
|
@@ -927,33 +943,33 @@ function validLib() {
|
|
|
throw '请选择工程专业';
|
|
|
}
|
|
|
//按新需求,清单库、定额库等不做非空验证
|
|
|
- /* if ($("input:hidden[name='bill_lib']").length <= 0) {
|
|
|
- throw '请添加标准清单';
|
|
|
- }
|
|
|
-
|
|
|
- if ($("input:hidden[name='ration_lib']").length <= 0) {
|
|
|
- throw '请添加定额库';
|
|
|
- }
|
|
|
-
|
|
|
- if ($("input:hidden[name='glj_lib']").length <= 0) {
|
|
|
- throw '请添加人材机库';
|
|
|
- }
|
|
|
-
|
|
|
- if ($("input:hidden[name='fee_lib']").length <= 0) {
|
|
|
- throw '请添加费率标准';
|
|
|
- }
|
|
|
-
|
|
|
- if ($("input:hidden[name='artificial_lib']").length <= 0) {
|
|
|
- throw '请添加人工系数';
|
|
|
- }
|
|
|
-
|
|
|
- if ($("input:hidden[name='program_lib']").length <= 0) {
|
|
|
- throw '请添加计算程序';
|
|
|
- }
|
|
|
-
|
|
|
- if ($("input:hidden[name='billsGuidance_lib']").length <= 0) {
|
|
|
- throw '请添加清单指引库';
|
|
|
- }*/
|
|
|
+ /* if ($("input:hidden[name='bill_lib']").length <= 0) {
|
|
|
+ throw '请添加标准清单';
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($("input:hidden[name='ration_lib']").length <= 0) {
|
|
|
+ throw '请添加定额库';
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($("input:hidden[name='glj_lib']").length <= 0) {
|
|
|
+ throw '请添加人材机库';
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($("input:hidden[name='fee_lib']").length <= 0) {
|
|
|
+ throw '请添加费率标准';
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($("input:hidden[name='artificial_lib']").length <= 0) {
|
|
|
+ throw '请添加人工系数';
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($("input:hidden[name='program_lib']").length <= 0) {
|
|
|
+ throw '请添加计算程序';
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($("input:hidden[name='billsGuidance_lib']").length <= 0) {
|
|
|
+ throw '请添加清单指引库';
|
|
|
+ }*/
|
|
|
|
|
|
result = true;
|
|
|
} catch (error) {
|
|
@@ -993,54 +1009,54 @@ function switchChange(element) {
|
|
|
}
|
|
|
|
|
|
function editEngineer(selector) {
|
|
|
- let engineerName = $(selector).prev("span").text();
|
|
|
+ let engineerName = $(selector).prev("span").text();
|
|
|
let parentDiv = $(selector).parent("div");
|
|
|
parentDiv.next("div").find("input").val(engineerName);
|
|
|
parentDiv.hide();
|
|
|
parentDiv.next("div").show();
|
|
|
}
|
|
|
|
|
|
-function confirmUpdate(selector,engineerID) {
|
|
|
+function confirmUpdate(selector, engineerID) {
|
|
|
let inputDiv = $(selector).parents(".input_group_div");
|
|
|
let input = $(selector).parent(".input-group-btn").prev("input");
|
|
|
let oldValue = inputDiv.prev("div").find("span").text();
|
|
|
let newValue = input.val();
|
|
|
let key = input.attr("name");
|
|
|
- if(newValue == "" || newValue==oldValue || !engineerID){
|
|
|
+ if (newValue == "" || newValue == oldValue || !engineerID) {
|
|
|
inputDiv.prev("div").show();
|
|
|
inputDiv.hide();
|
|
|
return;
|
|
|
}
|
|
|
- let updateData = {};
|
|
|
- updateData[key] = newValue;
|
|
|
- updateEngineer(engineerID,updateData,function () {
|
|
|
+ let updateData = {};
|
|
|
+ updateData[key] = newValue;
|
|
|
+ updateEngineer(engineerID, updateData, function () {
|
|
|
inputDiv.prev("div").find("span").text(newValue);
|
|
|
- });
|
|
|
- inputDiv.prev("div").show();
|
|
|
- inputDiv.hide();
|
|
|
+ });
|
|
|
+ inputDiv.prev("div").show();
|
|
|
+ inputDiv.hide();
|
|
|
}
|
|
|
|
|
|
-function deleteEngineerClick(engineerID,element) {
|
|
|
+function deleteEngineerClick(engineerID, element) {
|
|
|
hintBox.infoBox('操作确认', '是否删除所选工程专业?', 2, async function () {
|
|
|
try {
|
|
|
- let result = await ajaxPost('/compilation/delete-engineer',{id:engineerID});
|
|
|
+ let result = await ajaxPost('/compilation/delete-engineer', { id: engineerID });
|
|
|
$(element).parent("td").parent("tr").remove();
|
|
|
- }catch (err){
|
|
|
+ } catch (err) {
|
|
|
console.log(err);
|
|
|
}
|
|
|
- }, null,['确定','取消'],false);
|
|
|
+ }, null, ['确定', '取消'], false);
|
|
|
}
|
|
|
|
|
|
|
|
|
-function engineerVisibleChange(checkBox,engineerID) {
|
|
|
- if(engineerID){
|
|
|
- updateEngineer(engineerID,{visible:checkBox.checked});
|
|
|
+function engineerVisibleChange(checkBox, engineerID) {
|
|
|
+ if (engineerID) {
|
|
|
+ updateEngineer(engineerID, { visible: checkBox.checked });
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function updateEngineer(engineerID,data,callback) {
|
|
|
- CommonAjax.post('/compilation/update-engineer',{id:engineerID,updateData:data},function (data) {
|
|
|
- if(callback){
|
|
|
+function updateEngineer(engineerID, data, callback) {
|
|
|
+ CommonAjax.post('/compilation/update-engineer', { id: engineerID, updateData: data }, function (data) {
|
|
|
+ if (callback) {
|
|
|
callback();
|
|
|
}
|
|
|
})
|
|
@@ -1050,13 +1066,13 @@ function editTaxGroup(ele) {
|
|
|
$('#groupEditType').val("modify");
|
|
|
let groupData = $(ele).nextAll("input[name = 'tax_group']").val();
|
|
|
groupData = JSON.parse(groupData);
|
|
|
- if(!_.isEmpty(groupData)){
|
|
|
- $("#taxType").val(groupData.taxType?groupData.taxType:"");
|
|
|
- $("#program_lib").val(groupData.program_lib?groupData.program_lib.id:"");
|
|
|
- $("#template_lib").val(groupData.template_lib?groupData.template_lib.id:"");
|
|
|
- $("#col_lib").val(groupData.col_lib?groupData.col_lib.id:"");
|
|
|
- $("#fee_lib").val(groupData.fee_lib?groupData.fee_lib.id:"");
|
|
|
- }else {
|
|
|
+ if (!_.isEmpty(groupData)) {
|
|
|
+ $("#taxType").val(groupData.taxType ? groupData.taxType : "");
|
|
|
+ $("#program_lib").val(groupData.program_lib ? groupData.program_lib.id : "");
|
|
|
+ $("#template_lib").val(groupData.template_lib ? groupData.template_lib.id : "");
|
|
|
+ $("#col_lib").val(groupData.col_lib ? groupData.col_lib.id : "");
|
|
|
+ $("#fee_lib").val(groupData.fee_lib ? groupData.fee_lib.id : "");
|
|
|
+ } else {
|
|
|
$("#taxType").val("");
|
|
|
$("#program_lib").val("");
|
|
|
$("#template_lib").val("");
|
|
@@ -1064,68 +1080,68 @@ function editTaxGroup(ele) {
|
|
|
$("#fee_lib").val("");
|
|
|
}
|
|
|
$("#groupIndex").val(getGroupIndex(groupData));
|
|
|
- $("#addTaxGroup").modal({show:true});
|
|
|
+ $("#addTaxGroup").modal({ show: true });
|
|
|
}
|
|
|
|
|
|
-function deleteTableTr(ele,classString) {
|
|
|
+function deleteTableTr(ele, classString) {
|
|
|
let parentTr = $(ele).parents(`.${classString}`);
|
|
|
parentTr.remove();
|
|
|
}
|
|
|
|
|
|
function getGroupIndex(groupData) {//用来做唯一标识
|
|
|
let index = "";
|
|
|
- if(groupData){
|
|
|
- if(groupData.taxType) index = index + groupData.taxType;
|
|
|
- if(groupData.program_lib) index = index + groupData.program_lib.id;
|
|
|
- if(groupData.template_lib) index = index + groupData.template_lib.id;
|
|
|
- if(groupData.col_lib) index = index + groupData.col_lib.id;
|
|
|
- if(groupData.fee_lib) index = index + groupData.fee_lib.id;
|
|
|
+ if (groupData) {
|
|
|
+ if (groupData.taxType) index = index + groupData.taxType;
|
|
|
+ if (groupData.program_lib) index = index + groupData.program_lib.id;
|
|
|
+ if (groupData.template_lib) index = index + groupData.template_lib.id;
|
|
|
+ if (groupData.col_lib) index = index + groupData.col_lib.id;
|
|
|
+ if (groupData.fee_lib) index = index + groupData.fee_lib.id;
|
|
|
}
|
|
|
return index;
|
|
|
}
|
|
|
function getTaxGroupData() {
|
|
|
let programData = programList === undefined ? [] : _.indexBy(JSON.parse(programList), 'id');
|
|
|
- let billTemplateData = billTemplateList == undefined ? [] : _.indexBy(JSON.parse(billTemplateList),'ID');
|
|
|
- let mainTreeColData= mainTreeColList == undefined ? [] : _.indexBy(JSON.parse(mainTreeColList),'ID');
|
|
|
- let feeLibData = feeRateList === undefined ? [] : _.indexBy(JSON.parse(feeRateList),'id');
|
|
|
+ let billTemplateData = billTemplateList == undefined ? [] : _.indexBy(JSON.parse(billTemplateList), 'ID');
|
|
|
+ let mainTreeColData = mainTreeColList == undefined ? [] : _.indexBy(JSON.parse(mainTreeColList), 'ID');
|
|
|
+ let feeLibData = feeRateList === undefined ? [] : _.indexBy(JSON.parse(feeRateList), 'id');
|
|
|
let groupData = {};
|
|
|
- if($("#taxType").val() !==""){
|
|
|
+ if ($("#taxType").val() !== "") {
|
|
|
groupData.taxType = $("#taxType").val();
|
|
|
}
|
|
|
- if($("#program_lib").val() !==""){
|
|
|
- let program = programData[$("#program_lib").val()];
|
|
|
- if(program){
|
|
|
+ if ($("#program_lib").val() !== "") {
|
|
|
+ let program = programData[$("#program_lib").val()];
|
|
|
+ if (program) {
|
|
|
groupData.program_lib = {
|
|
|
- id:program.id,
|
|
|
- name:program.name,
|
|
|
- displayName:program.displayName
|
|
|
+ id: program.id,
|
|
|
+ name: program.name,
|
|
|
+ displayName: program.displayName
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if($("#template_lib").val() !==""){
|
|
|
- let template = billTemplateData[$("#template_lib").val()];
|
|
|
- if(template){
|
|
|
+ if ($("#template_lib").val() !== "") {
|
|
|
+ let template = billTemplateData[$("#template_lib").val()];
|
|
|
+ if (template) {
|
|
|
groupData.template_lib = {
|
|
|
- id:template.ID,
|
|
|
- name:template.name
|
|
|
+ id: template.ID,
|
|
|
+ name: template.name
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if($("#col_lib").val() !==""){
|
|
|
- let col = mainTreeColData[$("#col_lib").val()];
|
|
|
- if(col){
|
|
|
+ if ($("#col_lib").val() !== "") {
|
|
|
+ let col = mainTreeColData[$("#col_lib").val()];
|
|
|
+ if (col) {
|
|
|
groupData.col_lib = {
|
|
|
- id:col.ID,
|
|
|
- name:col.name
|
|
|
+ id: col.ID,
|
|
|
+ name: col.name
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if($("#fee_lib").val() !==""){
|
|
|
- let feeRate = feeLibData[$("#fee_lib").val()];
|
|
|
- if(feeRate){
|
|
|
+ if ($("#fee_lib").val() !== "") {
|
|
|
+ let feeRate = feeLibData[$("#fee_lib").val()];
|
|
|
+ if (feeRate) {
|
|
|
groupData.fee_lib = {
|
|
|
- id:feeRate.id,
|
|
|
- name:feeRate.name
|
|
|
+ id: feeRate.id,
|
|
|
+ name: feeRate.name
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1133,12 +1149,12 @@ function getTaxGroupData() {
|
|
|
}
|
|
|
|
|
|
|
|
|
-function intChecking(e,elemt) {//限制输入正整数
|
|
|
+function intChecking(e, elemt) {//限制输入正整数
|
|
|
let code = e.which || e.keyCode;
|
|
|
- if(code == 46 || code == 45){//不能输入小数点和-号
|
|
|
+ if (code == 46 || code == 45) {//不能输入小数点和-号
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
- if( elemt.value == ""&&code == 48){//当输入框为空时不能输入0
|
|
|
+ if (elemt.value == "" && code == 48) {//当输入框为空时不能输入0
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
|