|
@@ -43,6 +43,13 @@ projectGljObject={
|
|
|
mixRatioData:[],
|
|
|
usedTenderList:[],
|
|
|
usedUnitPriceInfo:null,
|
|
|
+ displayTypeMap:[
|
|
|
+ {ID:'LABOUR',text:'人工'},
|
|
|
+ {ID:'GENERAL_MATERIAL',text:'材料'},
|
|
|
+ {ID:'GENERAL_MACHINE',text:'机械'},
|
|
|
+ {ID:'MAIN_MATERIAL',text:'主材'},
|
|
|
+ {ID:'EQUIPMENT',text:'设备'}
|
|
|
+ ],
|
|
|
initProjectGljSpread:function () {
|
|
|
if(!this.projectGljSpread){
|
|
|
this.projectGljSpread = SheetDataHelper.createNewSpread($("#project_glj_sheet")[0],2);
|
|
@@ -129,13 +136,12 @@ projectGljObject={
|
|
|
let me = this;
|
|
|
if(me.selectedProjectGLJ){
|
|
|
let showTypes = [];
|
|
|
- let materialArr = [202, 203, 204];//混凝土、砂浆、配合比,
|
|
|
if(me.selectedProjectGLJ.type == gljType.MAIN_MATERIAL){//对于主材,只显示没有组成物并且除了自已的主材
|
|
|
showTypes = [gljType.MAIN_MATERIAL];
|
|
|
- }else if(_.includes(materialArr,me.selectedProjectGLJ.type)){//混凝土、砂浆、配合比
|
|
|
+ }else if(_.includes(gljUtil.hasCompMaterial,me.selectedProjectGLJ.type)){//混凝土、砂浆、配合比
|
|
|
showTypes = [gljType.GENERAL_MATERIAL];
|
|
|
- }else if(me.selectedProjectGLJ.type == gljType.GENERAL_MACHINE){//机械类型可添加机械组成物、机上人工
|
|
|
- showTypes = [gljType.MACHINE_COMPOSITION,gljType.MACHINE_LABOUR];
|
|
|
+ }else if(me.selectedProjectGLJ.type == gljType.GENERAL_MACHINE){//机械中有组成物的类型可添加机械组成物、机上人工
|
|
|
+ showTypes = gljUtil.machineComposition;
|
|
|
}
|
|
|
gljOprObj.gljLibSheetData = _.filter(gljOprObj.gljLibSheetData, function (item) {
|
|
|
if(me.selectedProjectGLJ.type == gljType.MAIN_MATERIAL){
|
|
@@ -162,7 +168,6 @@ projectGljObject={
|
|
|
gljOprObj.showRationGLJSheetData();
|
|
|
me.onUnitFileChange(me.selectedProjectGLJ);
|
|
|
});
|
|
|
-
|
|
|
});
|
|
|
},
|
|
|
showMixRatioData:function () {
|
|
@@ -346,7 +351,6 @@ projectGljObject={
|
|
|
info.sheet.getCell(info.row, info.col).text(0);
|
|
|
return ;
|
|
|
}
|
|
|
-
|
|
|
for(let c of info.changedCells){
|
|
|
let value = info.sheet.getCell(c.row, c.col).text();
|
|
|
if (!me.checkData(c.col,me.mixRatioSetting,value)) {
|
|
@@ -357,15 +361,12 @@ projectGljObject={
|
|
|
changeInfo.push({row:c.row,col:c.col,value:value});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if(canChange == false){//数据类型不对
|
|
|
me.showMixRatioData();
|
|
|
}
|
|
|
if(changeInfo.length > 0){
|
|
|
me.batchUpdateConsumption(changeInfo);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
batchUpdateProjectGLJ:function(changeInfo,sheetName){
|
|
|
let projectGLJ = projectObj.project.projectGLJ;
|
|
@@ -396,7 +397,6 @@ projectGljObject={
|
|
|
me.showMaterialTreeData();
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
batchUpdateGLJProperty:function (changeInfo,sheetName,callback) {
|
|
|
let me = projectGljObject,updateMap = {};
|
|
|
let projectGLJ = projectObj.project.projectGLJ;
|
|
@@ -481,7 +481,6 @@ projectGljObject={
|
|
|
});
|
|
|
|
|
|
},
|
|
|
-
|
|
|
showProjectGljData:function () {
|
|
|
this.projectGljSpread.setActiveSheetIndex(0);
|
|
|
let sel = this.projectGljSheet.getSelections()[0];
|
|
@@ -515,7 +514,6 @@ projectGljObject={
|
|
|
},
|
|
|
refreshDataSheet:function () {
|
|
|
let me = projectGljObject;
|
|
|
- //------------5;
|
|
|
let quantityCol = _.findIndex(me.projectGljSetting.header,function (header) {
|
|
|
return header.dataCode == 'quantity'|| header.dataCode == 'techQuantity' || header.dataCode =='subdivisionQuantity';
|
|
|
});
|
|
@@ -536,7 +534,6 @@ projectGljObject={
|
|
|
me.showMixRatioData();
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
createMaterialTree:function (gljList) {
|
|
|
let me = projectGljObject;
|
|
|
let q_decimal = getDecimal("glj.quantity");
|
|
@@ -574,7 +571,6 @@ projectGljObject={
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
for(let mkey in sumMap){
|
|
|
if(mkey == materialTypeMap.GC && sumMap[materialTypeMap.GJ]){//钢材汇总要加上钢筋的总量
|
|
|
parentMap['GC'].data.materialQuantity = scMathUtil.roundToString(sumMap[mkey]+sumMap[materialTypeMap.GJ],q_decimal);
|
|
@@ -582,16 +578,13 @@ projectGljObject={
|
|
|
parentMap[materialTypeMap[mkey]].data.materialQuantity = scMathUtil.roundToString(sumMap[mkey],q_decimal);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
this.materialTree.sortTreeItems();
|
|
|
-
|
|
|
function createMaterialNode(data,parent,next) {
|
|
|
let newNode = me.materialTree.addNode(parent, next, data.id);
|
|
|
newNode.data = data;
|
|
|
return newNode;
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
getMaterialSheetDataByGLJ:function (glj) {
|
|
|
let q_decimal = getDecimal("glj.quantity");
|
|
|
let m_decimal = getDecimal("material");
|
|
@@ -618,13 +611,11 @@ projectGljObject={
|
|
|
};
|
|
|
if(glj.materialCoe){
|
|
|
data.materialCoe = scMathUtil.roundForObj(glj.materialCoe,m_decimal);
|
|
|
- //data.materialCoe = scMathUtil.roundToString(glj.materialCoe,m_decimal);
|
|
|
data.materialQuantity = scMathUtil.roundForObj(glj.materialCoe * glj.quantity,q_decimal);//还要做汇总,汇总完再转成string
|
|
|
}
|
|
|
gljOprObj.setGLJPrice(data,glj);
|
|
|
data.basePrice = scMathUtil.roundToString(data.basePrice,p_decimal);
|
|
|
data.marketPrice = scMathUtil.roundToString(data.marketPrice,p_decimal);
|
|
|
-
|
|
|
return data;
|
|
|
},
|
|
|
filterProjectGLJ:function (gljList) {
|
|
@@ -702,7 +693,7 @@ projectGljObject={
|
|
|
if(data.basePrice == data.marketPrice){//如果定额价等于市场价时,改底色。 优先度低于有组成物时的底色
|
|
|
data.bgColour = "#C4CAFB";
|
|
|
}
|
|
|
- if (notEditType.indexOf(glj.type) >= 0) {
|
|
|
+ if (gljUtil.notEditType.indexOf(glj.type) >= 0) {
|
|
|
if (data.ratio_data && data.ratio_data.length > 0){//有组成物时
|
|
|
//设置底色
|
|
|
data.bgColour = "#E0E0E0";
|
|
@@ -917,9 +908,7 @@ projectGljObject={
|
|
|
value = scMathUtil.roundForObj(value,getDecimal("material"));
|
|
|
}
|
|
|
extend = Object.keys(extend).length > 0 ? JSON.stringify(extend) : '';
|
|
|
-
|
|
|
if(recode[dataCode] == value) return;
|
|
|
-
|
|
|
let updateData = {id: recode.id, field: dataCode, value: value, extend: extend};
|
|
|
projectGLJ.pGljUpdate(updateData,callback);
|
|
|
};
|
|
@@ -1043,11 +1032,16 @@ projectGljObject={
|
|
|
}else {
|
|
|
$("#save-as-tips").hide();
|
|
|
$('#save-as-confirm').removeAttr("disabled");
|
|
|
- if(callback){
|
|
|
- callback();
|
|
|
- }
|
|
|
+ if(callback) callback();
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ initFilterTypeList:function () {//初始化人材机汇总工料机类型过滤列表
|
|
|
+ let htmlString = '';
|
|
|
+ for(let t of this.displayTypeMap){
|
|
|
+ htmlString += '<li class="nav-item li_sub"><a class="nav-link" href="javascript:void(0)" id="'+t.ID+'">'+t.text+'</a></li>';
|
|
|
+ }
|
|
|
+ $('#ALL').after(htmlString);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -1097,7 +1091,6 @@ function getFileHierarchyInfo(treeData){
|
|
|
return rst;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
$(function () {
|
|
|
let pojGljResizeEles = getProjectResizeEles();
|
|
|
slideResize(pojGljResizeEles, {min: 170, max: 700}, 'height', function () {
|
|
@@ -1223,7 +1216,6 @@ $(function () {
|
|
|
$("#newUnitFileName").val(newName);
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
let data = {project_id: scUrlUtil.GetQueryString('project'), change_id: changeUnitPriceId, type: type};
|
|
|
projectObj.project.projectGLJ.changeFile(data,function () {
|
|
@@ -1295,7 +1287,6 @@ $(function () {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
-
|
|
|
// 单价文件另存为操作
|
|
|
$("#save-as-confirm").click(function () {
|
|
|
let projectGLJ = projectObj.project.projectGLJ;
|
|
@@ -1314,13 +1305,11 @@ $(function () {
|
|
|
});
|
|
|
|
|
|
$("#filterType").on("click","ul li a",function(e){
|
|
|
-
|
|
|
let children = $('#filterType a');
|
|
|
for(let c of children){
|
|
|
$(c).removeClass('active');
|
|
|
}
|
|
|
$(this).addClass('active');
|
|
|
-
|
|
|
let me = projectGljObject;
|
|
|
me.displayType = filterType[this.id];
|
|
|
me.refreshDataSheet();
|