|
|
@@ -31,7 +31,12 @@ let taxTypeMap = {
|
|
|
1:"一般计税",
|
|
|
2:"简易计税"
|
|
|
};
|
|
|
-
|
|
|
+//文件类型:招标,投标
|
|
|
+const FileKind = {
|
|
|
+ tender: 1, //投标
|
|
|
+ bid: 2 //招标
|
|
|
+};
|
|
|
+let curTaxType = 1; //1:"一般计税",2:"简易计税"
|
|
|
/*
|
|
|
* 地区,同一费用定额下不同地区有不同单价,则新建单位工程时需要选择地区项
|
|
|
* 地区项为空的时候,前端不显示该下拉项,地区的赋值覆盖在over_write相关文件中
|
|
|
@@ -1654,6 +1659,9 @@ $(document).ready(function() {
|
|
|
projDialog.on('hidden.bs.modal', function () {
|
|
|
setDangerInfo($('#project-name-info'), '', false);
|
|
|
$('#project-name').val('');
|
|
|
+ //文件类型、计税方法恢复默认选项
|
|
|
+ $('input[name="fileKind"]:eq(0)').prop('checked', true);
|
|
|
+ $('input[name="taxType"]:eq(0)').prop('checked', true);
|
|
|
});
|
|
|
projDialog.on('show.bs.modal', function () {
|
|
|
infoData = null;
|
|
|
@@ -1700,6 +1708,11 @@ $(document).ready(function() {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ //单位工程-新建建设项目-选择计税方法
|
|
|
+ $('input[name="taxType-tender"]').click(function () {
|
|
|
+ curTaxType = parseInt($(this).val());
|
|
|
+ getStdCalcProgramFiles();
|
|
|
+ });
|
|
|
// 选择计价方式
|
|
|
$("input[name='valuation_type']").click(function() {
|
|
|
let type = $(this).val();
|
|
|
@@ -1749,10 +1762,17 @@ $(document).ready(function() {
|
|
|
let isExist = hasListName(nameList, pojName);
|
|
|
if(!isExist){
|
|
|
if(pojName !== ''){
|
|
|
+ //新建建设项目,显示文件类型、计税方法选项
|
|
|
+ $('#newProjectSet').show();
|
|
|
+ $('input[name="fileKind-tender"]:eq(0)').prop('checked', true);
|
|
|
+ $('input[name="taxType-tender"]:eq(0)').prop('checked', true);
|
|
|
+ curTaxType = 1;
|
|
|
+ getStdCalcProgramFiles();
|
|
|
replaceClass($('#poj-name-info'), 'text-danger', 'text-info');
|
|
|
setDangerInfo($('#poj-name-info'), `新建“${pojName}”`);
|
|
|
}
|
|
|
else {
|
|
|
+ $('#newProjectSet').hide();//隐藏文件类型、计税方法选项
|
|
|
$('#poj-name-info').hide();
|
|
|
}
|
|
|
//清空单项工程下拉和文件下拉
|
|
|
@@ -1850,6 +1870,10 @@ $(document).ready(function() {
|
|
|
$('#engineering-info').hide();
|
|
|
$('#unit-price').find('option:first-child').text('新建单价文件');
|
|
|
$('#tender-fee-rate').find('option:first-child').text('新建费率文件');
|
|
|
+ $('#newProjectSet').hide(); //隐藏文件类型、计税方法选项
|
|
|
+ $('input[name="fileKind-tender"]:eq(0)').prop('checked', true);
|
|
|
+ $('input[name="taxType-tender"]:eq(0)').prop('checked', true);
|
|
|
+ curTaxType = 1;
|
|
|
//获取建设项目
|
|
|
let selected = projTreeObj.tree.selected;
|
|
|
let projs = getProjs(selected);
|
|
|
@@ -2292,15 +2316,23 @@ $(document).ready(function() {
|
|
|
$("#copy-to-confirm").click(function() {
|
|
|
let originalNode = projTreeObj.tree.selected;
|
|
|
let toNode = projTreeObj.copySelected;
|
|
|
+ let projectNode; //建设项目节点
|
|
|
let parent = null,next = null,projectMap={};
|
|
|
if(toNode.data.projType == projectType.engineering){//复制为目标的子节点
|
|
|
+ projectNode = toNode.parent;
|
|
|
parent = toNode;
|
|
|
next = toNode.firstChild();
|
|
|
}else if(toNode.data.projType == projectType.tender){//复制为目标的后兄弟
|
|
|
+ projectNode = toNode.parent.parent;
|
|
|
parent = toNode.parent;
|
|
|
next = toNode.nextSibling;
|
|
|
projectMap['update'] = {query:{ID:toNode.id()}};//前一节点的下一个节点更新;
|
|
|
}
|
|
|
+ //目标建设项目的计税方法与单位工程的一致时,才可复制到,否则提示“当前单位工程计税方法与目标建设项目不一致,不可复制。 确定”。
|
|
|
+ if (projectNode.data.property.taxType != originalNode.data.property.taxType) {
|
|
|
+ alert('当前单位工程计税方法与目标建设项目不一致,不可复制。');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
let nextID = next?next.id():-1;
|
|
|
let projectData = _.cloneDeep(originalNode.data);
|
|
|
projectData['ParentID'] = parent.id();
|
|
|
@@ -2331,112 +2363,113 @@ $(document).ready(function() {
|
|
|
projTreeObj.confirmFileChange();
|
|
|
});
|
|
|
|
|
|
- function changeEngineering(){
|
|
|
- featureData = null;
|
|
|
- $('#engineering-info').hide();
|
|
|
- initFeeStandardSel();
|
|
|
- }
|
|
|
+ // 选择工程专业后动态更改费率文件等数据
|
|
|
+ $("#tender-engineering").change(function() {
|
|
|
+ changeEngineering()
|
|
|
+ });
|
|
|
+ $('#tender-feeStandard').change(function () {
|
|
|
+ changeFeeStandard();
|
|
|
+ });
|
|
|
+});
|
|
|
+function changeEngineering(){
|
|
|
+ featureData = null;
|
|
|
+ $('#engineering-info').hide();
|
|
|
+ initFeeStandardSel();
|
|
|
+}
|
|
|
|
|
|
- function changeFeeRate(engLib) {
|
|
|
- if(engLib){
|
|
|
- /*
|
|
|
- if (engLib.fee_lib !== undefined && engLib.fee_lib.length > 0) {
|
|
|
- $("#tender-fee-rate").children("option").first().val("newFeeRate-"+engLib.fee_lib[0].id);
|
|
|
- }*/
|
|
|
- //2018-08-29 费率改为和计税方式绑定在一起 所以在这里还不能确定标准费率库ID
|
|
|
- $("#tender-fee-rate").children("option").first().val("newFeeRate@@");
|
|
|
- $("#tender-engineering").parent().siblings('.hidden-area').slideDown('fast');
|
|
|
- }
|
|
|
- else {
|
|
|
- $("#tender-fee-rate").children("option").first().val($('#tender-name').val());
|
|
|
- }
|
|
|
+function changeFeeRate(engLib) {
|
|
|
+ if(engLib){
|
|
|
+ /*
|
|
|
+ if (engLib.fee_lib !== undefined && engLib.fee_lib.length > 0) {
|
|
|
+ $("#tender-fee-rate").children("option").first().val("newFeeRate-"+engLib.fee_lib[0].id);
|
|
|
+ }*/
|
|
|
+ //2018-08-29 费率改为和计税方式绑定在一起 所以在这里还不能确定标准费率库ID
|
|
|
+ $("#tender-fee-rate").children("option").first().val("newFeeRate@@");
|
|
|
+ $("#tender-engineering").parent().siblings('.hidden-area').slideDown('fast');
|
|
|
}
|
|
|
+ else {
|
|
|
+ $("#tender-fee-rate").children("option").first().val($('#tender-name').val());
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- function initFeeStandardSel() {
|
|
|
- $('#tender-feeStandard').empty();
|
|
|
- let feeStandards = [];
|
|
|
- let engineeringList = getEngineeringList();
|
|
|
- let currentEngName = $('#tender-engineering').val();
|
|
|
- for(let eng of engineeringList){
|
|
|
- if(eng.lib.name && eng.lib.name === currentEngName && eng.lib.feeName && eng.lib.feeName !== ''){
|
|
|
- feeStandards.push(eng.lib.feeName);
|
|
|
- }
|
|
|
- }
|
|
|
- for(let feeName of feeStandards){
|
|
|
- let $opt = $(`<option value="${feeName}">${feeName}</option>`);
|
|
|
- $('#tender-feeStandard').append($opt);
|
|
|
- }
|
|
|
- if(feeStandards.length > 0){
|
|
|
- if($('#feeStandard-info').is(':visible')){
|
|
|
- $('#feeStandard-info').hide();
|
|
|
- }
|
|
|
+function initFeeStandardSel() {
|
|
|
+ $('#tender-feeStandard').empty();
|
|
|
+ let feeStandards = [];
|
|
|
+ let engineeringList = getEngineeringList();
|
|
|
+ let currentEngName = $('#tender-engineering').val();
|
|
|
+ for(let eng of engineeringList){
|
|
|
+ if(eng.lib.name && eng.lib.name === currentEngName && eng.lib.feeName && eng.lib.feeName !== ''){
|
|
|
+ feeStandards.push(eng.lib.feeName);
|
|
|
}
|
|
|
- let currentEngLib = getEngineeringLib(currentEngName + $('#tender-feeStandard').val(), engineeringList);
|
|
|
- changeFeeRate(currentEngLib);
|
|
|
- setTaxGroupHtml();
|
|
|
- getStdCalcProgramFiles();
|
|
|
}
|
|
|
-
|
|
|
- function changeFeeStandard() {
|
|
|
- featureData = null;
|
|
|
- let currentEngLib = getEngineeringLib($('#tender-engineering').val() + $('#tender-feeStandard').val(), getEngineeringList());
|
|
|
- changeFeeRate(currentEngLib);
|
|
|
- setTaxGroupHtml();
|
|
|
- getStdCalcProgramFiles();
|
|
|
+ for(let feeName of feeStandards){
|
|
|
+ let $opt = $(`<option value="${feeName}">${feeName}</option>`);
|
|
|
+ $('#tender-feeStandard').append($opt);
|
|
|
}
|
|
|
-
|
|
|
- function setTaxGroupHtml() {
|
|
|
- let groups = getTaxGroupList();
|
|
|
- let taxTypeArray = [];
|
|
|
- let htmlString = "";
|
|
|
- if(groups && groups.length > 0){
|
|
|
- taxTypeArray = _.uniq(_.map(groups,'taxType'));
|
|
|
- }
|
|
|
- for(let t of taxTypeArray){
|
|
|
- htmlString += "<option value='"+t+"'>"+taxTypeMap[t]+"</option>"
|
|
|
- }
|
|
|
- $('#taxType').html(htmlString);
|
|
|
- if(taxTypeArray.length <2){
|
|
|
- $('#taxType_div').hide();
|
|
|
- }else {
|
|
|
- $('#taxType_div').show();
|
|
|
+ if(feeStandards.length > 0){
|
|
|
+ if($('#feeStandard-info').is(':visible')){
|
|
|
+ $('#feeStandard-info').hide();
|
|
|
}
|
|
|
}
|
|
|
+ let currentEngLib = getEngineeringLib(currentEngName + $('#tender-feeStandard').val(), engineeringList);
|
|
|
+ changeFeeRate(currentEngLib);
|
|
|
+ //setTaxGroupHtml();
|
|
|
+ getStdCalcProgramFiles();
|
|
|
+}
|
|
|
|
|
|
- function getStdCalcProgramFiles(){
|
|
|
- function getStdCPFilesHtml(taxGroups) {
|
|
|
- let result = '';
|
|
|
- if (taxGroups.length <= 0) {
|
|
|
- return result;
|
|
|
- };
|
|
|
+function changeFeeStandard() {
|
|
|
+ featureData = null;
|
|
|
+ let currentEngLib = getEngineeringLib($('#tender-engineering').val() + $('#tender-feeStandard').val(), getEngineeringList());
|
|
|
+ changeFeeRate(currentEngLib);
|
|
|
+ //setTaxGroupHtml();
|
|
|
+ getStdCalcProgramFiles();
|
|
|
+}
|
|
|
|
|
|
- for (let group of taxGroups){
|
|
|
- let groupString = ""; //把计算程序、清单模板、列设置的ID生成一个组合的值
|
|
|
- let p_id = group.program_lib?group.program_lib.id:"";
|
|
|
- let t_id = group.template_lib?group.template_lib.id:"";
|
|
|
- let c_id = group.col_lib?group.col_lib.id:"";
|
|
|
- let f_id = group.fee_lib?group.fee_lib.id:"";
|
|
|
- groupString = p_id + "|-|" +t_id+"|-|"+c_id+"|-|"+f_id;
|
|
|
- result += '<option value='+ groupString +'>'+ group.program_lib.name +'</option>';
|
|
|
- };
|
|
|
- return result;
|
|
|
- };
|
|
|
- let taxType = $("#taxType").val();
|
|
|
- let stdCPHtml = getStdCPFilesHtml(getTaxGroupList(taxType));
|
|
|
- $("#tender-calcProgram").html(stdCPHtml);
|
|
|
- if ($("#tender-calcProgram")[0].options.length > 1)
|
|
|
- $("#tender-calcProgram")[0].selectedIndex = 0;
|
|
|
+function setTaxGroupHtml() {
|
|
|
+ let groups = getTaxGroupList();
|
|
|
+ let taxTypeArray = [];
|
|
|
+ let htmlString = "";
|
|
|
+ if(groups && groups.length > 0){
|
|
|
+ taxTypeArray = _.uniq(_.map(groups,'taxType'));
|
|
|
}
|
|
|
+ for(let t of taxTypeArray){
|
|
|
+ htmlString += "<option value='"+t+"'>"+taxTypeMap[t]+"</option>"
|
|
|
+ }
|
|
|
+ $('#taxType').html(htmlString);
|
|
|
+ if(taxTypeArray.length <2){
|
|
|
+ $('#taxType_div').hide();
|
|
|
+ }else {
|
|
|
+ $('#taxType_div').show();
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- // 选择工程专业后动态更改费率文件等数据
|
|
|
- $("#tender-engineering").change(function() {
|
|
|
- changeEngineering()
|
|
|
- });
|
|
|
- $('#tender-feeStandard').change(function () {
|
|
|
- changeFeeStandard();
|
|
|
- });
|
|
|
-});
|
|
|
+function getStdCalcProgramFiles(){
|
|
|
+ function getStdCPFilesHtml(taxGroups) {
|
|
|
+ let result = '';
|
|
|
+ if (taxGroups.length <= 0) {
|
|
|
+ return result;
|
|
|
+ };
|
|
|
|
|
|
+ for (let group of taxGroups){
|
|
|
+ let groupString = ""; //把计算程序、清单模板、列设置的ID生成一个组合的值
|
|
|
+ let p_id = group.program_lib?group.program_lib.id:"";
|
|
|
+ let t_id = group.template_lib?group.template_lib.id:"";
|
|
|
+ let c_id = group.col_lib?group.col_lib.id:"";
|
|
|
+ let f_id = group.fee_lib?group.fee_lib.id:"";
|
|
|
+ groupString = p_id + "|-|" +t_id+"|-|"+c_id+"|-|"+f_id;
|
|
|
+ result += '<option value='+ groupString +'>'+ group.program_lib.name +'</option>';
|
|
|
+ };
|
|
|
+ return result;
|
|
|
+ };
|
|
|
+ //let taxType = $("#taxType").val();
|
|
|
+ let taxType = curTaxType; //计税方法取建设项目的
|
|
|
+ //let selected = projTreeObj.tree.selected;
|
|
|
+
|
|
|
+ let stdCPHtml = getStdCPFilesHtml(getTaxGroupList(taxType));
|
|
|
+ $("#tender-calcProgram").html(stdCPHtml);
|
|
|
+ if ($("#tender-calcProgram")[0].options.length > 1)
|
|
|
+ $("#tender-calcProgram")[0].selectedIndex = 0;
|
|
|
+}
|
|
|
//获取工作表总宽度
|
|
|
function getWorkBookWidth(){
|
|
|
return workBookWidth = $(window).width() - $('.pm-side').width() - 90;
|
|
|
@@ -2548,6 +2581,16 @@ function AddProject() {
|
|
|
return false;
|
|
|
}
|
|
|
name = whiteSpaceCollapse(name);
|
|
|
+ let fileKind = $('input[name="fileKind"]:checked').val();
|
|
|
+ if (!fileKind) {
|
|
|
+ setDangerInfo($('#fileKind-info'));
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ let taxType = $('input[name="taxType"]:checked').val();
|
|
|
+ if (!taxType) {
|
|
|
+ setDangerInfo($('#taxType-info'));
|
|
|
+ return false;
|
|
|
+ }
|
|
|
let existCallback = function () {
|
|
|
setDangerInfo($('#project-name-info'), `已存在“${$("#project-name").val()}”`);
|
|
|
};
|
|
|
@@ -2564,7 +2607,7 @@ function AddProject() {
|
|
|
(3)、当前定位在建设项目,新建建设项目为其后兄弟。
|
|
|
(4)、当前定位在单项工程或单位工程,新建项目为当前所属建设项目的后兄弟。
|
|
|
* */
|
|
|
- let property = {basicInformation: infoData ? infoData : []};
|
|
|
+ let property = {basicInformation: infoData ? infoData : [], fileKind: fileKind, taxType: taxType};
|
|
|
if(!selectedItem){
|
|
|
AddSiblingsItem(selectedItem, name, property, projectType.project, existCallback, sucCallback);
|
|
|
}
|
|
|
@@ -2673,7 +2716,8 @@ function AddTenderItems(selected, projName, engName, tenderName, property, callb
|
|
|
pre = selectedProj;
|
|
|
next = selectedProj ? selectedProj.nextSibling : projTreeObj.tree.firstNode();
|
|
|
}
|
|
|
- let updateProjs = GetUpdateData(pre, parent, next, projName, {basicInformation: infoData ? infoData : []}, projID, {updateType: 'new', projectType: projectType.project});
|
|
|
+ let fileKind = $('input[name="fileKind-tender"]:checked').val();
|
|
|
+ let updateProjs = GetUpdateData(pre, parent, next, projName, {basicInformation: infoData ? infoData : [], fileKind: parseInt(fileKind), taxType: curTaxType}, projID, {updateType: 'new', projectType: projectType.project});
|
|
|
let updateEng = {updateType: 'new', updateData: {ID: engID, ParentID: projID, NextSiblingID: -1, name: engName, projType: projectType.engineering}};
|
|
|
property.rootProjectID = projID;
|
|
|
let updateTender = {updateType: 'new', updateData: {ID: tenderID, ParentID: engID, NextSiblingID: -1, shareInfo: [], name: tenderName, projType: projectType.tender, property: property}};
|
|
|
@@ -3028,6 +3072,8 @@ function setProjOptions(projs, selected){
|
|
|
$("#poj-name").val("");
|
|
|
if(projs.length > 0){
|
|
|
let firstProj = selected && selected.data.projType === projectType.project ? selected: projs[0];
|
|
|
+ curTaxType = firstProj.data.property.taxType || 1;
|
|
|
+ getStdCalcProgramFiles();
|
|
|
$("#poj-name").val(firstProj.data.name);
|
|
|
setFileOptions(firstProj.data.ID);
|
|
|
setEngOptions(firstProj.data.ID);
|
|
|
@@ -3036,20 +3082,14 @@ function setProjOptions(projs, selected){
|
|
|
$proj.addClass("dropdown-item");
|
|
|
$proj.attr("href", "javascript:void(0);");
|
|
|
$proj.click(function () {
|
|
|
+ curTaxType = projs[i].data.property.taxType || 1;
|
|
|
+ getStdCalcProgramFiles();
|
|
|
+ $('#newProjectSet').hide();//隐藏文件类型、计税方法选项
|
|
|
$("#poj-name").val(projs[i].data.name);
|
|
|
setFileOptions(projs[i].data.ID);
|
|
|
setEngOptions(projs[i].data.ID);
|
|
|
$('#poj-name-info').hide();
|
|
|
});
|
|
|
- /*let proj = $("<button>").val(projs[i].data.ID).text(projs[i].data.name);
|
|
|
- proj.addClass("dropdown-item");
|
|
|
- proj.attr("type", "button");
|
|
|
- proj.click(function () {
|
|
|
- $("#poj-name").val(projs[i].data.name);
|
|
|
- setFileOptions(projs[i].data.ID);
|
|
|
- setEngOptions(projs[i].data.ID);
|
|
|
- $('#poj-name-info').hide();
|
|
|
- });*/
|
|
|
$("#poj-name-list").append($proj);
|
|
|
}
|
|
|
}
|
|
|
@@ -3141,7 +3181,9 @@ function replaceClass(selector, orgClass, newClass){
|
|
|
}
|
|
|
//设置提示信息
|
|
|
function setDangerInfo(area, info, show = true){
|
|
|
- area.text(info);
|
|
|
+ if (info) {
|
|
|
+ area.text(info);
|
|
|
+ }
|
|
|
if(show)
|
|
|
area.show();
|
|
|
else
|
|
|
@@ -3235,8 +3277,9 @@ function AddTender() {
|
|
|
setDangerInfo($('#feeStandard-info'), '请选择费用标准');
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
- let taxType = $("#taxType").val();
|
|
|
+ //
|
|
|
+ //计税方法由原本的跟单位工程绑定,改成跟建设项目绑定,为了减少项目出错几率,新建时保留单位工程的计税方法,值为建设项目的计税方法值
|
|
|
+ let taxTypeTender = curTaxType;
|
|
|
let IDGroup = $("#tender-calcProgram").val();
|
|
|
if (!IDGroup || IDGroup === '') {
|
|
|
setDangerInfo($('#calcProgram-info'), '请选择计算程序');
|
|
|
@@ -3309,7 +3352,7 @@ function AddTender() {
|
|
|
unitPriceFile: {name: unitPriceFileObj.name, id: unitPriceFileObj.id},
|
|
|
feeFile: {name: feeFileObj.name, id: feeFileObj.id},
|
|
|
calcProgram: {name: calcProgramName, id: calcProgram},
|
|
|
- taxType:taxType,
|
|
|
+ taxType:taxTypeTender,
|
|
|
templateLibID:templateLibID,
|
|
|
colLibID:colLibID,
|
|
|
featureLibID:featureLibID,
|