|
@@ -14,7 +14,10 @@ let isSaving = false;
|
|
|
let projectProperty = [];
|
|
let projectProperty = [];
|
|
|
let fileDelObj = null;
|
|
let fileDelObj = null;
|
|
|
let curStep = 1; //当前在第几步
|
|
let curStep = 1; //当前在第几步
|
|
|
-let infoData = null; //建设项目基本信息数据
|
|
|
|
|
|
|
+let infoData = null; //建设项目基本信息数据 (完整)
|
|
|
|
|
+//需要的建设项目基本信息 (根据文件类型,因为需要切换文件类型获取不同的基本信息
|
|
|
|
|
+//为了减少请求,infoData获取完整的基本信息数据,needfulInfoData标记当前文件类型所需基本信息数据)
|
|
|
|
|
+let needfulInfoData = null;
|
|
|
let featureData = null; //工程特征数据
|
|
let featureData = null; //工程特征数据
|
|
|
let projectType = {
|
|
let projectType = {
|
|
|
folder: 'Folder',
|
|
folder: 'Folder',
|
|
@@ -37,6 +40,9 @@ const FileKind = {
|
|
|
bid: 2 //招标
|
|
bid: 2 //招标
|
|
|
};
|
|
};
|
|
|
let curTaxType = 1; //1:"一般计税",2:"简易计税"
|
|
let curTaxType = 1; //1:"一般计税",2:"简易计税"
|
|
|
|
|
+let curValutionType = 'bill', //计价方式默认只有清单计价
|
|
|
|
|
+ curValuation = billValuation[0].id, //计价规则初始取第一个
|
|
|
|
|
+ curValuationName = billValuation[0].name; //计价规则初始取第一个
|
|
|
/*
|
|
/*
|
|
|
* 地区,同一费用定额下不同地区有不同单价,则新建单位工程时需要选择地区项
|
|
* 地区,同一费用定额下不同地区有不同单价,则新建单位工程时需要选择地区项
|
|
|
* 地区项为空的时候,前端不显示该下拉项,地区的赋值覆盖在over_write相关文件中
|
|
* 地区项为空的时候,前端不显示该下拉项,地区的赋值覆盖在over_write相关文件中
|
|
@@ -1624,8 +1630,8 @@ $(document).ready(function() {
|
|
|
if (!validRequiredData($('#projInfoStep'))) {
|
|
if (!validRequiredData($('#projInfoStep'))) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (infoData && Array.isArray(infoData)) {
|
|
|
|
|
- updateRequiredData($('#projInfoStep'), infoData);
|
|
|
|
|
|
|
+ if (needfulInfoData && Array.isArray(needfulInfoData)) {
|
|
|
|
|
+ updateRequiredData($('#projInfoStep'), needfulInfoData);
|
|
|
}
|
|
}
|
|
|
AddProject();
|
|
AddProject();
|
|
|
});
|
|
});
|
|
@@ -1659,13 +1665,16 @@ $(document).ready(function() {
|
|
|
let requiredData = null;
|
|
let requiredData = null;
|
|
|
if (!infoData) {
|
|
if (!infoData) {
|
|
|
try {
|
|
try {
|
|
|
|
|
+ let fileKind = $('input[name="fileKind"]:checked').val();
|
|
|
infoData = await ajaxPost('/pm/api/getBasicInfo', {user_id: userID});
|
|
infoData = await ajaxPost('/pm/api/getBasicInfo', {user_id: userID});
|
|
|
|
|
+ //第一次默认是投标
|
|
|
|
|
+ needfulInfoData = getNeedfulBasicInfo(infoData, fileKind);
|
|
|
console.log(infoData);
|
|
console.log(infoData);
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
$('#add-project-dialog').modal('hide');
|
|
$('#add-project-dialog').modal('hide');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- requiredData = getRequired([], infoData);
|
|
|
|
|
|
|
+ requiredData = getRequired([], needfulInfoData);
|
|
|
if (requiredData.length > 0) {
|
|
if (requiredData.length > 0) {
|
|
|
$('#add-proj-next').show();
|
|
$('#add-proj-next').show();
|
|
|
} else {
|
|
} else {
|
|
@@ -1681,8 +1690,24 @@ $(document).ready(function() {
|
|
|
$('#addProjOk').show();
|
|
$('#addProjOk').show();
|
|
|
$('#projInfoStep').show();
|
|
$('#projInfoStep').show();
|
|
|
$('#project-required-warn').show();
|
|
$('#project-required-warn').show();
|
|
|
- showRequiredInfo($('#projInfoStep'), infoData);
|
|
|
|
|
|
|
+ showRequiredInfo($('#projInfoStep'), needfulInfoData);
|
|
|
}
|
|
}
|
|
|
|
|
+ //新建建设项目-文件类型选择 (影响到基本信息数据)
|
|
|
|
|
+ $('input[name="fileKind"]').click(function () {
|
|
|
|
|
+ if (infoData && infoData.length) {
|
|
|
|
|
+ let fileKind = $(this).val();
|
|
|
|
|
+ needfulInfoData = getNeedfulBasicInfo(infoData, fileKind);
|
|
|
|
|
+ }
|
|
|
|
|
+ let requiredData = getRequired([], needfulInfoData);
|
|
|
|
|
+ if (requiredData.length > 0) {
|
|
|
|
|
+ $('#addProjOk').hide();
|
|
|
|
|
+ $('#add-proj-next').show();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $('#projInfoStep').empty();
|
|
|
|
|
+ $('#add-proj-next').hide();
|
|
|
|
|
+ $('#addProjOk').show();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
//新建建设项目、新建单项工程、新建文件夹、重命名弹窗隐藏事件
|
|
//新建建设项目、新建单项工程、新建文件夹、重命名弹窗隐藏事件
|
|
|
function bindModalsHidden(projDialog, engDialog, folderDialog, renameDialog){
|
|
function bindModalsHidden(projDialog, engDialog, folderDialog, renameDialog){
|
|
@@ -1695,6 +1720,9 @@ $(document).ready(function() {
|
|
|
});
|
|
});
|
|
|
projDialog.on('show.bs.modal', function () {
|
|
projDialog.on('show.bs.modal', function () {
|
|
|
infoData = null;
|
|
infoData = null;
|
|
|
|
|
+ needfulInfoData = null;
|
|
|
|
|
+ $('#add-proj-prev').hide();
|
|
|
|
|
+ $('#add-proj-next').hide();
|
|
|
showProjFirstStep();
|
|
showProjFirstStep();
|
|
|
});
|
|
});
|
|
|
engDialog.on('hidden.bs.modal', function () {
|
|
engDialog.on('hidden.bs.modal', function () {
|
|
@@ -1756,7 +1784,6 @@ $(document).ready(function() {
|
|
|
html += `<option ${i === targetData.length -1 ? 'selected' : ''} value="${valuation.id}">${valuation.name}</option>`;
|
|
html += `<option ${i === targetData.length -1 ? 'selected' : ''} value="${valuation.id}">${valuation.name}</option>`;
|
|
|
}
|
|
}
|
|
|
$("#valuation").html(html);
|
|
$("#valuation").html(html);
|
|
|
- //$("#tender-engineering").html('<option value="">请选择对应的工程专业</option>');
|
|
|
|
|
let engineeringList = getEngineeringList();
|
|
let engineeringList = getEngineeringList();
|
|
|
let engineeringHtml = getEngineeringHtml(engineeringList);
|
|
let engineeringHtml = getEngineeringHtml(engineeringList);
|
|
|
$("#tender-engineering").html(engineeringHtml);
|
|
$("#tender-engineering").html(engineeringHtml);
|
|
@@ -1765,6 +1792,8 @@ $(document).ready(function() {
|
|
|
|
|
|
|
|
//选择计价规则
|
|
//选择计价规则
|
|
|
$("#valuation").change(function () {
|
|
$("#valuation").change(function () {
|
|
|
|
|
+ curValuation = $(this).val();
|
|
|
|
|
+ curValuationName = $(this).text();
|
|
|
let engineeringList = getEngineeringList();
|
|
let engineeringList = getEngineeringList();
|
|
|
console.log(engineeringList);
|
|
console.log(engineeringList);
|
|
|
let engineeringHtml = getEngineeringHtml(engineeringList);
|
|
let engineeringHtml = getEngineeringHtml(engineeringList);
|
|
@@ -1792,7 +1821,7 @@ $(document).ready(function() {
|
|
|
let isExist = hasListName(nameList, pojName);
|
|
let isExist = hasListName(nameList, pojName);
|
|
|
if(!isExist){
|
|
if(!isExist){
|
|
|
if(pojName !== ''){
|
|
if(pojName !== ''){
|
|
|
- //新建建设项目,显示文件类型、计税方法选项
|
|
|
|
|
|
|
+ //新建建设项目,显示计价规则、文件类型、计税方法选项
|
|
|
$('#newProjectSet').show();
|
|
$('#newProjectSet').show();
|
|
|
$('input[name="fileKind-tender"]:eq(0)').prop('checked', true);
|
|
$('input[name="fileKind-tender"]:eq(0)').prop('checked', true);
|
|
|
$('input[name="taxType-tender"]:eq(0)').prop('checked', true);
|
|
$('input[name="taxType-tender"]:eq(0)').prop('checked', true);
|
|
@@ -1891,6 +1920,7 @@ $(document).ready(function() {
|
|
|
//clear info
|
|
//clear info
|
|
|
curStep = 1; //当前在第几步
|
|
curStep = 1; //当前在第几步
|
|
|
infoData = null; //建设项目基本信息数据
|
|
infoData = null; //建设项目基本信息数据
|
|
|
|
|
+ needfulInfoData = null;
|
|
|
featureData = null; //工程特征数据
|
|
featureData = null; //工程特征数据
|
|
|
$('#poj-name-info').hide();
|
|
$('#poj-name-info').hide();
|
|
|
$('#eng-name-info').hide();
|
|
$('#eng-name-info').hide();
|
|
@@ -1908,7 +1938,8 @@ $(document).ready(function() {
|
|
|
let selected = projTreeObj.tree.selected;
|
|
let selected = projTreeObj.tree.selected;
|
|
|
let projs = getProjs(selected);
|
|
let projs = getProjs(selected);
|
|
|
setProjOptions(projs, selected);
|
|
setProjOptions(projs, selected);
|
|
|
- $($("input[name='valuation_type']")[0]).click();
|
|
|
|
|
|
|
+ //$($("input[name='valuation_type']")[0]).click();
|
|
|
|
|
+ initEngineering();
|
|
|
//设置地区选项
|
|
//设置地区选项
|
|
|
if(regions.length > 0){
|
|
if(regions.length > 0){
|
|
|
setRegionOpts(regions);
|
|
setRegionOpts(regions);
|
|
@@ -1922,6 +1953,14 @@ $(document).ready(function() {
|
|
|
$('#tender-name')[0].focus();
|
|
$('#tender-name')[0].focus();
|
|
|
}, 300);
|
|
}, 300);
|
|
|
});
|
|
});
|
|
|
|
|
+ //新建单位工程-文件类型选择变换(影响到基本信息数据)
|
|
|
|
|
+ $('input[name="fileKind-tender"]').click(function () {
|
|
|
|
|
+ if (infoData && infoData.length) {
|
|
|
|
|
+ let fileKind = $(this).val();
|
|
|
|
|
+ needfulInfoData = getNeedfulBasicInfo(infoData, fileKind);
|
|
|
|
|
+ $('#infoStep').empty(); //清空设置的基本信息必填数据
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
//新建单位工程-下一步
|
|
//新建单位工程-下一步
|
|
|
$('#add-tender-next').click(async function() {
|
|
$('#add-tender-next').click(async function() {
|
|
|
if (curStep === 1) {
|
|
if (curStep === 1) {
|
|
@@ -1974,7 +2013,7 @@ $(document).ready(function() {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
let path = getAddPath();
|
|
let path = getAddPath();
|
|
|
- let infoRequired = getRequired([], infoData);
|
|
|
|
|
|
|
+ let infoRequired = getRequired([], needfulInfoData);
|
|
|
let featureRequired = getRequired([], featureData);
|
|
let featureRequired = getRequired([], featureData);
|
|
|
if (path === addPath.p_e_t && infoRequired.length > 0) {
|
|
if (path === addPath.p_e_t && infoRequired.length > 0) {
|
|
|
showInfoStep();
|
|
showInfoStep();
|
|
@@ -2031,14 +2070,16 @@ $(document).ready(function() {
|
|
|
$('#add-tender-cancel').show();
|
|
$('#add-tender-cancel').show();
|
|
|
if (!infoData) {
|
|
if (!infoData) {
|
|
|
try {
|
|
try {
|
|
|
|
|
+ let fileKind = $('input[name="fileKind-tender"]:checked').val();
|
|
|
infoData = await ajaxPost('/pm/api/getBasicInfo', {user_id: userID});
|
|
infoData = await ajaxPost('/pm/api/getBasicInfo', {user_id: userID});
|
|
|
|
|
+ needfulInfoData = getNeedfulBasicInfo(infoData, fileKind);
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
$('#add-tender-dialog').modal('hide');
|
|
$('#add-tender-dialog').modal('hide');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (!featureData) {
|
|
if (!featureData) {
|
|
|
try{
|
|
try{
|
|
|
- let valuation = $("#valuation").val();
|
|
|
|
|
|
|
+ let valuation = curValuation;
|
|
|
let engineeringName = $("#tender-engineering").val();
|
|
let engineeringName = $("#tender-engineering").val();
|
|
|
let feeName = $('#tender-feeStandard').val();
|
|
let feeName = $('#tender-feeStandard').val();
|
|
|
featureData = await ajaxPost('/pm/api/getProjectFeature',
|
|
featureData = await ajaxPost('/pm/api/getProjectFeature',
|
|
@@ -2047,7 +2088,7 @@ $(document).ready(function() {
|
|
|
$('#add-tender-dialog').modal('hide');
|
|
$('#add-tender-dialog').modal('hide');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- let infoRequired = getRequired([], infoData),
|
|
|
|
|
|
|
+ let infoRequired = getRequired([], needfulInfoData),
|
|
|
featureRequired = getRequired([], featureData),
|
|
featureRequired = getRequired([], featureData),
|
|
|
path = getAddPath();
|
|
path = getAddPath();
|
|
|
if (path === addPath.p_e_t && infoRequired.length > 0 || featureRequired.length > 0) {
|
|
if (path === addPath.p_e_t && infoRequired.length > 0 || featureRequired.length > 0) {
|
|
@@ -2070,7 +2111,7 @@ $(document).ready(function() {
|
|
|
$('#add-tender-next').hide();
|
|
$('#add-tender-next').hide();
|
|
|
$('#add-tender-confirm').show();
|
|
$('#add-tender-confirm').show();
|
|
|
}
|
|
}
|
|
|
- showRequiredInfo($('#infoStep'), infoData);
|
|
|
|
|
|
|
+ showRequiredInfo($('#infoStep'), needfulInfoData);
|
|
|
}
|
|
}
|
|
|
//显示新建单位工程-工厂特征内容
|
|
//显示新建单位工程-工厂特征内容
|
|
|
function showFeatureStep() {
|
|
function showFeatureStep() {
|
|
@@ -2083,22 +2124,6 @@ $(document).ready(function() {
|
|
|
$('#tender-required-warn').show();
|
|
$('#tender-required-warn').show();
|
|
|
showRequiredInfo($('#featureStep'), featureData);
|
|
showRequiredInfo($('#featureStep'), featureData);
|
|
|
}
|
|
}
|
|
|
- function getRequired(rst, datas) {
|
|
|
|
|
- if (!datas) {
|
|
|
|
|
- return rst;
|
|
|
|
|
- }
|
|
|
|
|
- for (let data of datas) {
|
|
|
|
|
- let required = typeof data.required === 'string' ? JSON.parse(data.required) : data.required,
|
|
|
|
|
- readOnly = typeof data.readOnly === 'string' ? JSON.parse(data.readOnly) : data.readOnly;
|
|
|
|
|
- if (required && !readOnly) {
|
|
|
|
|
- rst.push(data);
|
|
|
|
|
- }
|
|
|
|
|
- if (data.items && data.items.length > 0) {
|
|
|
|
|
- getRequired(rst, data.items);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return rst;
|
|
|
|
|
- }
|
|
|
|
|
//显示必填信息(建设项目基本信息、单位工程工程特征)
|
|
//显示必填信息(建设项目基本信息、单位工程工程特征)
|
|
|
//必填信息:标记了必填required且不只读!readOnly
|
|
//必填信息:标记了必填required且不只读!readOnly
|
|
|
function showRequiredInfo($form, datas) {
|
|
function showRequiredInfo($form, datas) {
|
|
@@ -2186,8 +2211,8 @@ $(document).ready(function() {
|
|
|
if (!validRequiredData($('#featureStep'))) {
|
|
if (!validRequiredData($('#featureStep'))) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (infoData && Array.isArray(infoData)) {
|
|
|
|
|
- updateRequiredData($('#infoStep'), infoData);
|
|
|
|
|
|
|
+ if (needfulInfoData && Array.isArray(needfulInfoData)) {
|
|
|
|
|
+ updateRequiredData($('#infoStep'), needfulInfoData);
|
|
|
}
|
|
}
|
|
|
if (featureData && Array.isArray(featureData)) {
|
|
if (featureData && Array.isArray(featureData)) {
|
|
|
updateRequiredData($('#featureStep'), featureData);
|
|
updateRequiredData($('#featureStep'), featureData);
|
|
@@ -2404,8 +2429,16 @@ $(document).ready(function() {
|
|
|
//导入相关
|
|
//导入相关
|
|
|
importView.eventListen();
|
|
importView.eventListen();
|
|
|
});
|
|
});
|
|
|
-function changeEngineering(){
|
|
|
|
|
- featureData = null;
|
|
|
|
|
|
|
+
|
|
|
|
|
+//初始化工程专业库
|
|
|
|
|
+function initEngineering() {
|
|
|
|
|
+ let engineeringList = getEngineeringList();
|
|
|
|
|
+ let engineeringHtml = getEngineeringHtml(engineeringList);
|
|
|
|
|
+ $("#tender-engineering").html(engineeringHtml);
|
|
|
|
|
+ changeEngineering();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+async function changeEngineering(){
|
|
|
$('#engineering-info').hide();
|
|
$('#engineering-info').hide();
|
|
|
initFeeStandardSel();
|
|
initFeeStandardSel();
|
|
|
}
|
|
}
|
|
@@ -2425,7 +2458,62 @@ function changeFeeRate(engLib) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function initFeeStandardSel() {
|
|
|
|
|
|
|
+//根据文件类型筛选新的基本信息数据
|
|
|
|
|
+function getNeedfulBasicInfo(info, fileKind) {
|
|
|
|
|
+ let strMap = {
|
|
|
|
|
+ 1: 'tender', //投标
|
|
|
|
|
+ 2: 'bid', //招标
|
|
|
|
|
+ 3: 'control' //控制价
|
|
|
|
|
+ };
|
|
|
|
|
+ let needfulData = info.filter(data => !data.fileKind || data.fileKind === strMap[fileKind]);
|
|
|
|
|
+ needfulData.forEach(nData => {
|
|
|
|
|
+ let needfulSub = nData.items.filter(sData => !sData.fileKind || sData.fileKind === strMap[fileKind]);
|
|
|
|
|
+ nData.items = needfulSub;
|
|
|
|
|
+ });
|
|
|
|
|
+ return needfulData;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function getRequired(rst, datas) {
|
|
|
|
|
+ if (!datas) {
|
|
|
|
|
+ return rst;
|
|
|
|
|
+ }
|
|
|
|
|
+ for (let data of datas) {
|
|
|
|
|
+ let required = typeof data.required === 'string' ? JSON.parse(data.required) : data.required,
|
|
|
|
|
+ readOnly = typeof data.readOnly === 'string' ? JSON.parse(data.readOnly) : data.readOnly;
|
|
|
|
|
+ if (required && !readOnly) {
|
|
|
|
|
+ rst.push(data);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (data.items && data.items.length > 0) {
|
|
|
|
|
+ getRequired(rst, data.items);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return rst;
|
|
|
|
|
+}
|
|
|
|
|
+//变换专业工程、变换费用标准,重新获取工程库数据...
|
|
|
|
|
+async function changeFeature() {
|
|
|
|
|
+ let valuation = curValuation;
|
|
|
|
|
+ let engineeringName = $("#tender-engineering").val();
|
|
|
|
|
+ let feeName = $('#tender-feeStandard').val();
|
|
|
|
|
+ featureData = await ajaxPost('/pm/api/getProjectFeature',
|
|
|
|
|
+ {user_id: userID, valuationID: valuation, engineeringName: engineeringName, feeName: feeName});
|
|
|
|
|
+ updateAddState(needfulInfoData, featureData);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//更新当前新建单位工程是否需要下一步
|
|
|
|
|
+function updateAddState(needfulInfoData, featureData) {
|
|
|
|
|
+ let infoRequired = getRequired([], needfulInfoData),
|
|
|
|
|
+ featureRequired = getRequired([], featureData),
|
|
|
|
|
+ path = getAddPath();
|
|
|
|
|
+ if (path === addPath.p_e_t && infoRequired.length > 0 || featureRequired.length > 0) {
|
|
|
|
|
+ $('#add-tender-next').show();
|
|
|
|
|
+ $('#add-tender-confirm').hide();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $('#add-tender-next').hide();
|
|
|
|
|
+ $('#add-tender-confirm').show();
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+async function initFeeStandardSel() {
|
|
|
$('#tender-feeStandard').empty();
|
|
$('#tender-feeStandard').empty();
|
|
|
let feeStandards = [];
|
|
let feeStandards = [];
|
|
|
let engineeringList = getEngineeringList();
|
|
let engineeringList = getEngineeringList();
|
|
@@ -2444,14 +2532,21 @@ function initFeeStandardSel() {
|
|
|
$('#feeStandard-info').hide();
|
|
$('#feeStandard-info').hide();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //变换专业工程、变换费用标准,重新获取工程库数据...
|
|
|
|
|
+ if (curStep === 2) {
|
|
|
|
|
+ await changeFeature();
|
|
|
|
|
+ }
|
|
|
let currentEngLib = getEngineeringLib(currentEngName + $('#tender-feeStandard').val(), engineeringList);
|
|
let currentEngLib = getEngineeringLib(currentEngName + $('#tender-feeStandard').val(), engineeringList);
|
|
|
changeFeeRate(currentEngLib);
|
|
changeFeeRate(currentEngLib);
|
|
|
//setTaxGroupHtml();
|
|
//setTaxGroupHtml();
|
|
|
getStdCalcProgramFiles();
|
|
getStdCalcProgramFiles();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function changeFeeStandard() {
|
|
|
|
|
- featureData = null;
|
|
|
|
|
|
|
+async function changeFeeStandard() {
|
|
|
|
|
+ //变换专业工程、变换费用标准,重新获取工程库数据...
|
|
|
|
|
+ if (curStep === 2) {
|
|
|
|
|
+ await changeFeature();
|
|
|
|
|
+ }
|
|
|
let currentEngLib = getEngineeringLib($('#tender-engineering').val() + $('#tender-feeStandard').val(), getEngineeringList());
|
|
let currentEngLib = getEngineeringLib($('#tender-engineering').val() + $('#tender-feeStandard').val(), getEngineeringList());
|
|
|
changeFeeRate(currentEngLib);
|
|
changeFeeRate(currentEngLib);
|
|
|
//setTaxGroupHtml();
|
|
//setTaxGroupHtml();
|
|
@@ -2494,10 +2589,7 @@ function getStdCalcProgramFiles(){
|
|
|
};
|
|
};
|
|
|
return result;
|
|
return result;
|
|
|
};
|
|
};
|
|
|
- //let taxType = $("#taxType").val();
|
|
|
|
|
let taxType = curTaxType; //计税方法取建设项目的
|
|
let taxType = curTaxType; //计税方法取建设项目的
|
|
|
- //let selected = projTreeObj.tree.selected;
|
|
|
|
|
-
|
|
|
|
|
let stdCPHtml = getStdCPFilesHtml(getTaxGroupList(taxType));
|
|
let stdCPHtml = getStdCPFilesHtml(getTaxGroupList(taxType));
|
|
|
$("#tender-calcProgram").html(stdCPHtml);
|
|
$("#tender-calcProgram").html(stdCPHtml);
|
|
|
if ($("#tender-calcProgram")[0].options.length > 1)
|
|
if ($("#tender-calcProgram")[0].options.length > 1)
|
|
@@ -2508,31 +2600,6 @@ function getWorkBookWidth(){
|
|
|
return workBookWidth = $(window).width() - $('.pm-side').width() - 90;
|
|
return workBookWidth = $(window).width() - $('.pm-side').width() - 90;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/*function prepareInitialTimer(title, content) {
|
|
|
|
|
- $('#progress .modal-title').text(title);
|
|
|
|
|
- $('#progress .modal-body h5').text(content);
|
|
|
|
|
- $('#progressBar').css('width', `0%`);
|
|
|
|
|
- let outer = setInterval(function () {
|
|
|
|
|
- let curWidth = parseInt($('#progressBar')[0].style.width.replace('%', ''));
|
|
|
|
|
- curWidth = parseInt(curWidth + 2);
|
|
|
|
|
- $('#progressBar').css('width', `${curWidth}%`);
|
|
|
|
|
- if (curWidth >= 80) {
|
|
|
|
|
- clearInterval(outer);
|
|
|
|
|
- }
|
|
|
|
|
- }, 100);
|
|
|
|
|
- let inner = setInterval(function () {
|
|
|
|
|
- let curWidth = parseFloat($('#progressBar')[0].style.width.replace('%', ''));
|
|
|
|
|
- if (curWidth >= 80) {
|
|
|
|
|
- curWidth = parseFloat(curWidth + 0.1);
|
|
|
|
|
- $('#progressBar').css('width', `${curWidth}%`);
|
|
|
|
|
- if (curWidth >= 95) {
|
|
|
|
|
- clearInterval(inner);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }, 500);
|
|
|
|
|
- return {outer, inner};
|
|
|
|
|
-}*/
|
|
|
|
|
-
|
|
|
|
|
function initProjects(callback) {
|
|
function initProjects(callback) {
|
|
|
GetAllProjectData(function (datas) {
|
|
GetAllProjectData(function (datas) {
|
|
|
//设置工程专业
|
|
//设置工程专业
|
|
@@ -2616,6 +2683,12 @@ function AddProject() {
|
|
|
setDangerInfo($('#fileKind-info'));
|
|
setDangerInfo($('#fileKind-info'));
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
+ let valuation = $('#proj-valuation').val();
|
|
|
|
|
+ if (!valuation) {
|
|
|
|
|
+ setDangerInfo($('#proj-valuation-info'));
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ let valuationName = $('#proj-valuation').text().trim();
|
|
|
let taxType = $('input[name="taxType"]:checked').val();
|
|
let taxType = $('input[name="taxType"]:checked').val();
|
|
|
if (!taxType) {
|
|
if (!taxType) {
|
|
|
setDangerInfo($('#taxType-info'));
|
|
setDangerInfo($('#taxType-info'));
|
|
@@ -2637,7 +2710,13 @@ function AddProject() {
|
|
|
(3)、当前定位在建设项目,新建建设项目为其后兄弟。
|
|
(3)、当前定位在建设项目,新建建设项目为其后兄弟。
|
|
|
(4)、当前定位在单项工程或单位工程,新建项目为当前所属建设项目的后兄弟。
|
|
(4)、当前定位在单项工程或单位工程,新建项目为当前所属建设项目的后兄弟。
|
|
|
* */
|
|
* */
|
|
|
- let property = {basicInformation: infoData ? infoData : [], fileKind: fileKind, taxType: taxType};
|
|
|
|
|
|
|
+ let property = {basicInformation: needfulInfoData ? needfulInfoData : [],
|
|
|
|
|
+ fileKind: fileKind,
|
|
|
|
|
+ taxType: taxType,
|
|
|
|
|
+ valuation: valuation,
|
|
|
|
|
+ valuationName: valuationName,
|
|
|
|
|
+ valuationType: curValutionType
|
|
|
|
|
+ };
|
|
|
if(!selectedItem){
|
|
if(!selectedItem){
|
|
|
AddSiblingsItem(selectedItem, name, property, projectType.project, existCallback, sucCallback);
|
|
AddSiblingsItem(selectedItem, name, property, projectType.project, existCallback, sucCallback);
|
|
|
}
|
|
}
|
|
@@ -2747,7 +2826,10 @@ function AddTenderItems(selected, projName, engName, tenderName, property, callb
|
|
|
next = selectedProj ? selectedProj.nextSibling : projTreeObj.tree.firstNode();
|
|
next = selectedProj ? selectedProj.nextSibling : projTreeObj.tree.firstNode();
|
|
|
}
|
|
}
|
|
|
let fileKind = $('input[name="fileKind-tender"]:checked').val();
|
|
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 updateProjs = GetUpdateData(pre, parent, next, projName, {
|
|
|
|
|
+ basicInformation: needfulInfoData ? needfulInfoData : [],
|
|
|
|
|
+ fileKind: parseInt(fileKind), taxType: curTaxType, valuationType: curValutionType, valuation: curValuation, valuationName: curValuationName},
|
|
|
|
|
+ projID, {updateType: 'new', projectType: projectType.project});
|
|
|
let updateEng = {updateType: 'new', updateData: {ID: engID, ParentID: projID, NextSiblingID: -1, name: engName, projType: projectType.engineering}};
|
|
let updateEng = {updateType: 'new', updateData: {ID: engID, ParentID: projID, NextSiblingID: -1, name: engName, projType: projectType.engineering}};
|
|
|
property.rootProjectID = projID;
|
|
property.rootProjectID = projID;
|
|
|
let updateTender = {updateType: 'new', updateData: {ID: tenderID, ParentID: engID, NextSiblingID: -1, shareInfo: [], name: tenderName, projType: projectType.tender, property: property}};
|
|
let updateTender = {updateType: 'new', updateData: {ID: tenderID, ParentID: engID, NextSiblingID: -1, shareInfo: [], name: tenderName, projType: projectType.tender, property: property}};
|
|
@@ -2931,8 +3013,10 @@ function getEngineeringLib(cascadeName, engineeringList) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function getEngineeringList(){
|
|
function getEngineeringList(){
|
|
|
- let valuation = $("#valuation").val();
|
|
|
|
|
- let valuationType = $("input[name='valuation_type']:checked").val();
|
|
|
|
|
|
|
+ //let valuation = $("#valuation").val();
|
|
|
|
|
+ let valuation = curValuation;
|
|
|
|
|
+ //let valuationType = $("input[name='valuation_type']:checked").val();
|
|
|
|
|
+ let valuationType = curValutionType;
|
|
|
let valuationData = valuationType === 'bill' ? billValuation : rationValuation;
|
|
let valuationData = valuationType === 'bill' ? billValuation : rationValuation;
|
|
|
let engineeringList = [];
|
|
let engineeringList = [];
|
|
|
for(let tmp of valuationData) {
|
|
for(let tmp of valuationData) {
|
|
@@ -3103,6 +3187,16 @@ function setProjOptions(projs, selected){
|
|
|
if(projs.length > 0){
|
|
if(projs.length > 0){
|
|
|
let firstProj = selected && selected.data.projType === projectType.project ? selected: projs[0];
|
|
let firstProj = selected && selected.data.projType === projectType.project ? selected: projs[0];
|
|
|
curTaxType = firstProj.data.property.taxType || 1;
|
|
curTaxType = firstProj.data.property.taxType || 1;
|
|
|
|
|
+ if (firstProj.data.property.valuationType) {
|
|
|
|
|
+ curValutionType = firstProj.data.property.valuationType;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (firstProj.data.property.valuation) {
|
|
|
|
|
+ curValuation = firstProj.data.property.valuation;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (firstProj.data.property.valuationName) {
|
|
|
|
|
+ curValuationName = firstProj.data.property.valuationName;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (firstProj.data.property.valuation)
|
|
|
getStdCalcProgramFiles();
|
|
getStdCalcProgramFiles();
|
|
|
$("#poj-name").val(firstProj.data.name);
|
|
$("#poj-name").val(firstProj.data.name);
|
|
|
setFileOptions(firstProj.data.ID);
|
|
setFileOptions(firstProj.data.ID);
|
|
@@ -3113,6 +3207,15 @@ function setProjOptions(projs, selected){
|
|
|
$proj.attr("href", "javascript:void(0);");
|
|
$proj.attr("href", "javascript:void(0);");
|
|
|
$proj.click(function () {
|
|
$proj.click(function () {
|
|
|
curTaxType = projs[i].data.property.taxType || 1;
|
|
curTaxType = projs[i].data.property.taxType || 1;
|
|
|
|
|
+ if (projs[i].data.property.valuationType) {
|
|
|
|
|
+ curValutionType = projs[i].data.property.valuationType;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (projs[i].data.property.valuation) {
|
|
|
|
|
+ curValuation = projs[i].data.property.valuation;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (projs[i].data.property.valuationName) {
|
|
|
|
|
+ curValuationName = projs[i].data.property.valuationName;
|
|
|
|
|
+ }
|
|
|
getStdCalcProgramFiles();
|
|
getStdCalcProgramFiles();
|
|
|
$('#newProjectSet').hide();//隐藏文件类型、计税方法选项
|
|
$('#newProjectSet').hide();//隐藏文件类型、计税方法选项
|
|
|
$("#poj-name").val(projs[i].data.name);
|
|
$("#poj-name").val(projs[i].data.name);
|
|
@@ -3291,11 +3394,8 @@ function AddTender() {
|
|
|
let unitPriceFileObj = getAddTenderFile(tenderName, $('#unit-price'), $("#unit-price").children());
|
|
let unitPriceFileObj = getAddTenderFile(tenderName, $('#unit-price'), $("#unit-price").children());
|
|
|
let feeFileObj = getAddTenderFile(tenderName, $('#tender-fee-rate'), $("#tender-fee-rate").children());
|
|
let feeFileObj = getAddTenderFile(tenderName, $('#tender-fee-rate'), $("#tender-fee-rate").children());
|
|
|
|
|
|
|
|
- let valuation = $("#valuation").val();
|
|
|
|
|
- if(!valuation || valuation === ''){
|
|
|
|
|
- setDangerInfo($('#valuation-info'), '请选择计价规则');
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //let valuation = $("#valuation").val();
|
|
|
|
|
+ let valuation = curValuation; //跟建设项目一样的计价规则
|
|
|
|
|
|
|
|
let engineeringName = $("#tender-engineering").val();
|
|
let engineeringName = $("#tender-engineering").val();
|
|
|
if (!engineeringName || engineeringName === '') {
|
|
if (!engineeringName || engineeringName === '') {
|
|
@@ -3327,8 +3427,8 @@ function AddTender() {
|
|
|
}
|
|
}
|
|
|
//如果是新建费率的情况
|
|
//如果是新建费率的情况
|
|
|
if(feeFileObj.id.indexOf("newFeeRate")!=-1) feeFileObj.id +=feeLibID;
|
|
if(feeFileObj.id.indexOf("newFeeRate")!=-1) feeFileObj.id +=feeLibID;
|
|
|
- let valuationName = $("#valuation").children("option:selected").text();
|
|
|
|
|
- let valuationType = $("input[name='valuation_type']:checked").val();
|
|
|
|
|
|
|
+ let valuationName = curValuationName; //跟建设项目一样的计价方式
|
|
|
|
|
+ let valuationType = curValutionType; //跟建设项目一样的计价方式
|
|
|
|
|
|
|
|
let engineering = undefined;
|
|
let engineering = undefined;
|
|
|
let valuationData = valuationType === 'bill' ? billValuation : rationValuation;
|
|
let valuationData = valuationType === 'bill' ? billValuation : rationValuation;
|
|
@@ -3797,7 +3897,6 @@ function getUnitFile(parentID, callback) {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取费率文件
|
|
* 获取费率文件
|
|
|
*
|
|
*
|