|
@@ -40,6 +40,7 @@ projectGljObject={
|
|
header:[
|
|
header:[
|
|
{headerName: "编码", headerWidth: 120, dataCode: "code", dataType: "String"},
|
|
{headerName: "编码", headerWidth: 120, dataCode: "code", dataType: "String"},
|
|
{headerName: "名称", headerWidth: 120, dataCode: "name", dataType: "String"},
|
|
{headerName: "名称", headerWidth: 120, dataCode: "name", dataType: "String"},
|
|
|
|
+ {headerName: "规格型号", headerWidth: 120, dataCode: "specs", dataType: "String"},
|
|
{headerName: "单位", headerWidth: 120, dataCode: "unit", hAlign: "center", dataType: "String"},
|
|
{headerName: "单位", headerWidth: 120, dataCode: "unit", hAlign: "center", dataType: "String"},
|
|
{headerName: "类型", headerWidth: 120, dataCode: "short_name", hAlign: "center", dataType: "String"},
|
|
{headerName: "类型", headerWidth: 120, dataCode: "short_name", hAlign: "center", dataType: "String"},
|
|
{headerName: "定额价", headerWidth: 120, dataCode: "basePrice", hAlign: "right", dataType: "Number",decimalField:'glj.unitPrice',validator:"number"},
|
|
{headerName: "定额价", headerWidth: 120, dataCode: "basePrice", hAlign: "right", dataType: "Number",decimalField:'glj.unitPrice',validator:"number"},
|
|
@@ -48,7 +49,7 @@ projectGljObject={
|
|
{headerName: "消耗量", headerWidth: 120, dataCode: "consumption", hAlign: "right", dataType: "Number",decimalField:"glj.quantity",validator:"number"}
|
|
{headerName: "消耗量", headerWidth: 120, dataCode: "consumption", hAlign: "right", dataType: "Number",decimalField:"glj.quantity",validator:"number"}
|
|
],
|
|
],
|
|
view: {
|
|
view: {
|
|
- lockColumns: [0,1,2,3,4,5,6]
|
|
|
|
|
|
+ lockColumns: [0,1,2,3,4,5,6,7]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
materialTreeSetting:{
|
|
materialTreeSetting:{
|
|
@@ -136,6 +137,46 @@ projectGljObject={
|
|
getUsedTenderInfo:function() {
|
|
getUsedTenderInfo:function() {
|
|
return projectGljObject.usedTenderList.join("<br>");
|
|
return projectGljObject.usedTenderList.join("<br>");
|
|
},
|
|
},
|
|
|
|
+ filterLibGLJForMixRatio:function () {
|
|
|
|
+ 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)){//混凝土、砂浆、配合比
|
|
|
|
+ showTypes = [gljType.GENERAL_MATERIAL];
|
|
|
|
+ }else if(me.selectedProjectGLJ.type == gljType.GENERAL_MACHINE){//机械类型可添加机械组成物、机上人工
|
|
|
|
+ showTypes = [gljType.MACHINE_COMPOSITION,gljType.MACHINE_LABOUR];
|
|
|
|
+ }
|
|
|
|
+ gljOprObj.gljLibSheetData = _.filter(gljOprObj.gljLibSheetData, function (item) {
|
|
|
|
+ if(me.selectedProjectGLJ.type == gljType.MAIN_MATERIAL){
|
|
|
|
+ let p_index = gljOprObj.getIndex(me.selectedProjectGLJ,gljKeyArray);
|
|
|
|
+ let i_index = gljOprObj.getIndex(item,gljLibKeyArray);
|
|
|
|
+ return item.gljType == gljType.MAIN_MATERIAL &&item.component.length == 0 && p_index!=i_index
|
|
|
|
+ }else {
|
|
|
|
+ return _.includes(showTypes,item.gljType);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ addMixRatio:function () {
|
|
|
|
+ let me = this, projectGLJ = projectObj.project.projectGLJ;
|
|
|
|
+ for(let mix of me.mixRatioData){
|
|
|
|
+ let m_key = gljOprObj.getIndex(mix, gljKeyArray);
|
|
|
|
+ let t_index = gljOprObj.GLJSelection.indexOf(m_key);
|
|
|
|
+ t_index != -1?gljOprObj.GLJSelection.splice(t_index,1):'';
|
|
|
|
+ }
|
|
|
|
+ projectGLJ.addMixRatio(gljOprObj.GLJSelection,function (mixRatios) {
|
|
|
|
+ me.showMixRatioData();//这里添加的组成物的消耗量默认都是0,所以对父工料机的价格不会有影响,不用触发计算
|
|
|
|
+ projectGLJ.loadData(function () {
|
|
|
|
+ me.showProjectGljData();
|
|
|
|
+ gljOprObj.showRationGLJSheetData();
|
|
|
|
+ me.onUnitFileChange(me.selectedProjectGLJ);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ },
|
|
showMixRatioData:function () {
|
|
showMixRatioData:function () {
|
|
let me = this,gljId = null,gljType = null;
|
|
let me = this,gljId = null,gljType = null;
|
|
let sheet = me.projectGljSpread.getActiveSheet();
|
|
let sheet = me.projectGljSpread.getActiveSheet();
|
|
@@ -218,7 +259,7 @@ projectGljObject={
|
|
}
|
|
}
|
|
if(dataCode=='basePrice'||dataCode=='marketPrice'||dataCode=='supply'){//有组成物时,市场单价、定额价、供货方式不能修改
|
|
if(dataCode=='basePrice'||dataCode=='marketPrice'||dataCode=='supply'){//有组成物时,市场单价、定额价、供货方式不能修改
|
|
if (data.ratio_data && data.ratio_data.length > 0){
|
|
if (data.ratio_data && data.ratio_data.length > 0){
|
|
- return false;
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
if(dataCode=='basePrice'&&data.is_add!=1){//如果不是新增,定额价不可修改。
|
|
if(dataCode=='basePrice'&&data.is_add!=1){//如果不是新增,定额价不可修改。
|
|
return false;
|
|
return false;
|
|
@@ -226,7 +267,7 @@ projectGljObject={
|
|
}
|
|
}
|
|
if(dataCode == 'supply_quantity'){
|
|
if(dataCode == 'supply_quantity'){
|
|
if (data.supply != 1) {// 如果为部分甲供则甲供数量需要可编辑,其它的都不能编辑
|
|
if (data.supply != 1) {// 如果为部分甲供则甲供数量需要可编辑,其它的都不能编辑
|
|
- return false;
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(dataCode == 'materialCoe'){//三材类别为空时,三材系数应只读,不允许输入。
|
|
if(dataCode == 'materialCoe'){//三材类别为空时,三材系数应只读,不允许输入。
|
|
@@ -269,7 +310,7 @@ projectGljObject={
|
|
changeInfo.push({row:c.row,col:c.col,value:value});
|
|
changeInfo.push({row:c.row,col:c.col,value:value});
|
|
if(me.projectGljEditChecking(c.row,c.col)==false){//如果不能编辑
|
|
if(me.projectGljEditChecking(c.row,c.col)==false){//如果不能编辑
|
|
canChange = false;
|
|
canChange = false;
|
|
- }
|
|
|
|
|
|
+ }
|
|
if (canChange==true&&!me.checkData(c.col,me.projectGljSetting,value)) {
|
|
if (canChange==true&&!me.checkData(c.col,me.projectGljSetting,value)) {
|
|
alert('输入的数据类型不对,请重新输入!');
|
|
alert('输入的数据类型不对,请重新输入!');
|
|
canChange = false;
|
|
canChange = false;
|
|
@@ -278,7 +319,7 @@ projectGljObject={
|
|
if(canChange == false){//恢复原来的值
|
|
if(canChange == false){//恢复原来的值
|
|
info.sheetName =="materialTreeSheet"?me.showMaterialTreeData():me.showProjectGljData();
|
|
info.sheetName =="materialTreeSheet"?me.showMaterialTreeData():me.showProjectGljData();
|
|
}else if(info.sheetName =="projectGljSheet"){
|
|
}else if(info.sheetName =="projectGljSheet"){
|
|
- me.batchUpdatePrice(changeInfo);
|
|
|
|
|
|
+ me.batchUpdatePrice(changeInfo);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
batchUpdatePrice(changeInfo){
|
|
batchUpdatePrice(changeInfo){
|
|
@@ -293,6 +334,7 @@ projectGljObject={
|
|
showProjectGljData:function () {
|
|
showProjectGljData:function () {
|
|
this.projectGljSpread.setActiveSheetIndex(0);
|
|
this.projectGljSpread.setActiveSheetIndex(0);
|
|
let sel = this.projectGljSheet.getSelections()[0];
|
|
let sel = this.projectGljSheet.getSelections()[0];
|
|
|
|
+ let oldData = sel.row<this.projectGljSheetData.length?this.projectGljSheetData[sel.row]:'';
|
|
let projectGljSheetData = [];
|
|
let projectGljSheetData = [];
|
|
let gljList = projectObj.project.projectGLJ.datas.gljList;
|
|
let gljList = projectObj.project.projectGLJ.datas.gljList;
|
|
gljList = this.filterProjectGLJ(gljList);
|
|
gljList = this.filterProjectGLJ(gljList);
|
|
@@ -304,15 +346,19 @@ projectGljObject={
|
|
this.projectGljSheet.setRowCount(0);
|
|
this.projectGljSheet.setRowCount(0);
|
|
sheetCommonObj.showData(this.projectGljSheet, this.projectGljSetting,this.projectGljSheetData);
|
|
sheetCommonObj.showData(this.projectGljSheet, this.projectGljSetting,this.projectGljSheetData);
|
|
this.projectGljSheet.setRowCount(this.projectGljSheetData.length);
|
|
this.projectGljSheet.setRowCount(this.projectGljSheetData.length);
|
|
|
|
+ sel.row = _.findIndex(this.projectGljSheetData,{'id':oldData.id});
|
|
this.projectGljSheet.setSelection(sel.row==-1?0:sel.row,sel.col,sel.rowCount,sel.colCount);
|
|
this.projectGljSheet.setSelection(sel.row==-1?0:sel.row,sel.col,sel.rowCount,sel.colCount);
|
|
},
|
|
},
|
|
showMaterialTreeData:function () {
|
|
showMaterialTreeData:function () {
|
|
this.projectGljSpread.setActiveSheetIndex(1);
|
|
this.projectGljSpread.setActiveSheetIndex(1);
|
|
let sel = this.materialTreeSheet.getSelections()[0];
|
|
let sel = this.materialTreeSheet.getSelections()[0];
|
|
|
|
+ let oldNodeID = this.materialTree.selected?this.materialTree.selected.data.id:"";
|
|
let gljList = projectObj.project.projectGLJ.datas.gljList;
|
|
let gljList = projectObj.project.projectGLJ.datas.gljList;
|
|
gljList = _.sortByAll(gljList, [ 'code']);
|
|
gljList = _.sortByAll(gljList, [ 'code']);
|
|
this.createMaterialTree(gljList);
|
|
this.createMaterialTree(gljList);
|
|
this.materialTreeController.showTreeData();
|
|
this.materialTreeController.showTreeData();
|
|
|
|
+ let newNode = this.materialTree.getNodeByID(oldNodeID);
|
|
|
|
+ sel.row = newNode?newNode.serialNo():-1;
|
|
this.materialTreeSheet.setSelection(sel.row==-1?0:sel.row,sel.col,sel.rowCount,sel.colCount);
|
|
this.materialTreeSheet.setSelection(sel.row==-1?0:sel.row,sel.col,sel.rowCount,sel.colCount);
|
|
this.materialTreeController.setTreeSelected(this.materialTree.items[sel.row==-1?0:sel.row]);
|
|
this.materialTreeController.setTreeSelected(this.materialTree.items[sel.row==-1?0:sel.row]);
|
|
},
|
|
},
|
|
@@ -558,11 +604,12 @@ projectGljObject={
|
|
let prow = parentSheet.getActiveRowIndex();//取父机械或组成物的下标
|
|
let prow = parentSheet.getActiveRowIndex();//取父机械或组成物的下标
|
|
let prowData = parentSheet.name() == 'projectGljSheet'?me.projectGljSheetData[prow]:me.materialTree.items[prow].data;
|
|
let prowData = parentSheet.name() == 'projectGljSheet'?me.projectGljSheetData[prow]:me.materialTree.items[prow].data;
|
|
composition.updateConsumption(updateData,recode,prowData.id,function (sid) {
|
|
composition.updateConsumption(updateData,recode,prowData.id,function (sid) {
|
|
- /* if(parentSheet.name() == 'projectGljSheet'){ 之前是单行刷新,父工料机与组成物对应的工料机分开刷,发现这样比整个刷新慢所以先整个刷新,当以后数据量大的时候再测试
|
|
|
|
- me.refreshProjectGljRowByID(sid);
|
|
|
|
- }*/
|
|
|
|
|
|
+ /* if(parentSheet.name() == 'projectGljSheet'){ 之前是单行刷新,父工料机与组成物对应的工料机分开刷,发现这样比整个刷新慢所以先整个刷新,当以后数据量大的时候再测试
|
|
|
|
+ me.refreshProjectGljRowByID(sid);
|
|
|
|
+ }*/
|
|
projectObj.project.projectGLJ.calcQuantity();
|
|
projectObj.project.projectGLJ.calcQuantity();
|
|
me.refreshParentData(prow,prowData.id,sid);
|
|
me.refreshParentData(prow,prowData.id,sid);
|
|
|
|
+ me.onUnitFileChange(recode);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
refreshParentData:function (row,pid,sid) {
|
|
refreshParentData:function (row,pid,sid) {
|
|
@@ -571,11 +618,14 @@ projectGljObject={
|
|
let parantData = null;
|
|
let parantData = null;
|
|
if(sheet.name() == 'projectGljSheet'){
|
|
if(sheet.name() == 'projectGljSheet'){
|
|
me.showProjectGljData();// me.refreshProjectGljRow(row) 这里原来是分开刷新的,现在整个统一刷新,先留着
|
|
me.showProjectGljData();// me.refreshProjectGljRow(row) 这里原来是分开刷新的,现在整个统一刷新,先留着
|
|
- parantData = me.projectGljSheetData[row];
|
|
|
|
|
|
+ //parantData = _.find(); //me.projectGljSheetData[row];
|
|
}else {
|
|
}else {
|
|
me.showMaterialTreeData();
|
|
me.showMaterialTreeData();
|
|
- parantData = me.materialTree.items[row].data;
|
|
|
|
|
|
+ //parantData = me.materialTree.items[row].data;
|
|
}
|
|
}
|
|
|
|
+ let pglj = _.find(projectObj.project.projectGLJ.datas.gljList,{'id':pid});
|
|
|
|
+ parantData = pglj?me.getSheetDataByGLJ(pglj):null;
|
|
|
|
+ //projectObj.project.projectGLJ.datas.gljList
|
|
|
|
|
|
// 更新组成物缓存
|
|
// 更新组成物缓存
|
|
projectObj.project.composition.loadData();
|
|
projectObj.project.composition.loadData();
|
|
@@ -593,7 +643,7 @@ projectGljObject={
|
|
for(let r of rations){
|
|
for(let r of rations){
|
|
let r_node = projectObj.project.mainTree.getNodeByID(r.ID);
|
|
let r_node = projectObj.project.mainTree.getNodeByID(r.ID);
|
|
if(r_node){
|
|
if(r_node){
|
|
- r_node.data.marketUnitFee = parantData.marketPrice;//parentMarketPrice;//这里用显示的价格
|
|
|
|
|
|
+ r_node.data.marketUnitFee = parantData?parantData.marketPrice:'';//parentMarketPrice;//这里用显示的价格
|
|
updateNodes.push(r_node);
|
|
updateNodes.push(r_node);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -604,10 +654,15 @@ projectGljObject={
|
|
if(updateNodes.length>0){
|
|
if(updateNodes.length>0){
|
|
projectObj.project.calcProgram.calcRationsAndSave(updateNodes,function () {
|
|
projectObj.project.calcProgram.calcRationsAndSave(updateNodes,function () {
|
|
projectObj.mainController.refreshTreeNode(projectObj.project.mainTree.roots);
|
|
projectObj.mainController.refreshTreeNode(projectObj.project.mainTree.roots);
|
|
|
|
+ installationFeeObj.calcInstallationFee();//计算安装增加费
|
|
});
|
|
});
|
|
}
|
|
}
|
|
gljOprObj.refreshView();
|
|
gljOprObj.refreshView();
|
|
},
|
|
},
|
|
|
|
+ onUnitFileChange:function (data) {
|
|
|
|
+ socket.emit('unitFileChangeNotify', JSON.stringify(data));
|
|
|
|
+ projectObj.project.markUpdateProject({projectID:projectObj.project.ID(),'unitFileID':socketObject.getUnitFileRoomID()},"unitFile");
|
|
|
|
+ },
|
|
deleteMixRatio:function (row) {
|
|
deleteMixRatio:function (row) {
|
|
let me = this, deleteRecode = me.mixRatioData[row];
|
|
let me = this, deleteRecode = me.mixRatioData[row];
|
|
let consumption = deleteRecode.consumption;
|
|
let consumption = deleteRecode.consumption;
|
|
@@ -619,6 +674,7 @@ projectGljObject={
|
|
projectObj.project.composition.deleteComposition(updateData,deleteRecode,prowData.id,function () {
|
|
projectObj.project.composition.deleteComposition(updateData,deleteRecode,prowData.id,function () {
|
|
me.refreshParentData(prow,prowData.id);
|
|
me.refreshParentData(prow,prowData.id);
|
|
me.mixRatioSheet.deleteRows(row,1);
|
|
me.mixRatioSheet.deleteRows(row,1);
|
|
|
|
+ me.onUnitFileChange(deleteRecode);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
getCompositionSumPrice : function(scene, affectRow, newValue = 0) {
|
|
getCompositionSumPrice : function(scene, affectRow, newValue = 0) {
|
|
@@ -683,7 +739,6 @@ projectGljObject={
|
|
value= scMathUtil.roundForObj(value,getDecimal('glj.unitPrice'));//修改市场价和修改定额价时需要重新记算很多受影响的树节点,现在改成与定字额工料机那里调相同的方法。
|
|
value= scMathUtil.roundForObj(value,getDecimal('glj.unitPrice'));//修改市场价和修改定额价时需要重新记算很多受影响的树节点,现在改成与定字额工料机那里调相同的方法。
|
|
let editField = dataCode === 'basePrice'?"base_price":"market_price";
|
|
let editField = dataCode === 'basePrice'?"base_price":"market_price";
|
|
projectObj.project.projectGLJ.updatePrice(recode,editField,value,'pg',callback);
|
|
projectObj.project.projectGLJ.updatePrice(recode,editField,value,'pg',callback);
|
|
-
|
|
|
|
}else {
|
|
}else {
|
|
let extend = {};
|
|
let extend = {};
|
|
// 如果是供货方式则需要处理数据
|
|
// 如果是供货方式则需要处理数据
|
|
@@ -745,6 +800,22 @@ projectGljObject={
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
},
|
|
},
|
|
|
|
+ getProjectGLJSelected:function () {
|
|
|
|
+ let me = projectGljObject;
|
|
|
|
+ let sheet = me.projectGljSpread.getActiveSheet();
|
|
|
|
+ let selectedProjectGLJ = null;
|
|
|
|
+ if(sheet.name() == 'projectGljSheet'){//projectGljSheet/materialSheet 工料机汇总和三材汇总表
|
|
|
|
+ let sel = me.projectGljSheet.getSelections()[0];
|
|
|
|
+ if(sel.row != -1 && me.projectGljSheetData.length>sel.row){
|
|
|
|
+ selectedProjectGLJ = me.projectGljSheetData[sel.row]
|
|
|
|
+ }
|
|
|
|
+ }else if(sheet.name() == 'materialTreeSheet' ){
|
|
|
|
+ if(me.materialTree.selected){
|
|
|
|
+ selectedProjectGLJ = me.materialTree.selected.data;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return selectedProjectGLJ;
|
|
|
|
+ },
|
|
initRightClick : function() {
|
|
initRightClick : function() {
|
|
let activeSheet = this.mixRatioSheet;
|
|
let activeSheet = this.mixRatioSheet;
|
|
let me = this;
|
|
let me = this;
|
|
@@ -767,6 +838,18 @@ projectGljObject={
|
|
me.deleteMixRatio(row);
|
|
me.deleteMixRatio(row);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ "addMixRatio":{
|
|
|
|
+ name: '添加',
|
|
|
|
+ icon: 'fa-sign-in',
|
|
|
|
+ disabled: function () {
|
|
|
|
+ let projectGLJ = projectGljObject.getProjectGLJSelected();
|
|
|
|
+ return !_.includes(compositionTypes,projectGLJ.type);
|
|
|
|
+ },
|
|
|
|
+ callback: function (key, opt) {
|
|
|
|
+ me.selectedProjectGLJ = projectGljObject.getProjectGLJSelected();
|
|
|
|
+ getGLJData('addMix');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -788,13 +871,28 @@ projectGljObject={
|
|
},
|
|
},
|
|
calcPartASupplyFeeByProjectGLJs: function (projectGLJsArr) {
|
|
calcPartASupplyFeeByProjectGLJs: function (projectGLJsArr) {
|
|
for (let pGLJ of projectGLJsArr){
|
|
for (let pGLJ of projectGLJsArr){
|
|
- if (pGLJ.supply == supplyType.BFJG){
|
|
|
|
- let rations = calcTools.getRationsByProjectGLJ(pGLJ.id);
|
|
|
|
- projectObj.project.calcProgram.calcNodesAndSave(rations, function () {
|
|
|
|
- projectObj.mainController.refreshTreeNode(projectObj.project.mainTree.roots);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ if (pGLJ.supply == supplyType.BFJG){
|
|
|
|
+ let rations = calcTools.getRationsByProjectGLJ(pGLJ.id);
|
|
|
|
+ projectObj.project.calcProgram.calcNodesAndSave(rations, function () {
|
|
|
|
+ projectObj.mainController.refreshTreeNode(projectObj.project.mainTree.roots);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ checkUnitFileName:function (name,callback) {
|
|
|
|
+ let projectGLJ = projectObj.project.projectGLJ;
|
|
|
|
+ projectGLJ.checkUnitFileName(name,function (data) {
|
|
|
|
+ if(data){
|
|
|
|
+ $("#save-as-tips").text('已存在同名单价文件').show();
|
|
|
|
+ $('#save-as-confirm').attr("disabled","disabled");
|
|
|
|
+ }else {
|
|
|
|
+ $("#save-as-tips").hide();
|
|
|
|
+ $('#save-as-confirm').removeAttr("disabled");
|
|
|
|
+ if(callback){
|
|
|
|
+ callback();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -840,23 +938,23 @@ $(function () {
|
|
me.refreshDataSheet();
|
|
me.refreshDataSheet();
|
|
loadProjectGljSize();
|
|
loadProjectGljSize();
|
|
});
|
|
});
|
|
- /* $('#ration_link').on('shown.bs.tab', function (e) {
|
|
|
|
- let me = projectGljObject;
|
|
|
|
- me.showTag='ration';
|
|
|
|
- me.showProjectGljData();
|
|
|
|
- });
|
|
|
|
- $('#mix_ratio_link').on('shown.bs.tab', function (e) {
|
|
|
|
- let me = projectGljObject;
|
|
|
|
- me.showTag='mixRatio';
|
|
|
|
- me.showProjectGljData();
|
|
|
|
- me.initMixRatio();
|
|
|
|
- });
|
|
|
|
- $('#machine_ratio_link').on('shown.bs.tab', function (e) {
|
|
|
|
- let me = projectGljObject;
|
|
|
|
- me.showTag='machine';
|
|
|
|
- me.showProjectGljData();
|
|
|
|
- me.initMixRatio();
|
|
|
|
- });*/
|
|
|
|
|
|
+ /* $('#ration_link').on('shown.bs.tab', function (e) {
|
|
|
|
+ let me = projectGljObject;
|
|
|
|
+ me.showTag='ration';
|
|
|
|
+ me.showProjectGljData();
|
|
|
|
+ });
|
|
|
|
+ $('#mix_ratio_link').on('shown.bs.tab', function (e) {
|
|
|
|
+ let me = projectGljObject;
|
|
|
|
+ me.showTag='mixRatio';
|
|
|
|
+ me.showProjectGljData();
|
|
|
|
+ me.initMixRatio();
|
|
|
|
+ });
|
|
|
|
+ $('#machine_ratio_link').on('shown.bs.tab', function (e) {
|
|
|
|
+ let me = projectGljObject;
|
|
|
|
+ me.showTag='machine';
|
|
|
|
+ me.showProjectGljData();
|
|
|
|
+ me.initMixRatio();
|
|
|
|
+ });*/
|
|
$('#pop-used-list').popover({
|
|
$('#pop-used-list').popover({
|
|
placement: "bottom",
|
|
placement: "bottom",
|
|
html: true,
|
|
html: true,
|
|
@@ -879,6 +977,7 @@ $(function () {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
let data = response.data;
|
|
let data = response.data;
|
|
|
|
+ projectGljObject.changeInfo = data;
|
|
$("#current-project-name").text(data.currentProjectName);
|
|
$("#current-project-name").text(data.currentProjectName);
|
|
// 本项目中的单价文件
|
|
// 本项目中的单价文件
|
|
if (data.self.length > 0) {
|
|
if (data.self.length > 0) {
|
|
@@ -915,14 +1014,24 @@ $(function () {
|
|
let type = $("input[name='change-type']:checked").val();
|
|
let type = $("input[name='change-type']:checked").val();
|
|
type = parseInt(type);
|
|
type = parseInt(type);
|
|
let changeUnitPriceId = 0;
|
|
let changeUnitPriceId = 0;
|
|
|
|
+ $('#change-unitFile').modal("hide");
|
|
if (type === 0) {
|
|
if (type === 0) {
|
|
// 从本项目中选择
|
|
// 从本项目中选择
|
|
changeUnitPriceId = $("#self-file").val();
|
|
changeUnitPriceId = $("#self-file").val();
|
|
} else {
|
|
} else {
|
|
// 从其他项目中复制
|
|
// 从其他项目中复制
|
|
changeUnitPriceId = $("#other-file").val();
|
|
changeUnitPriceId = $("#other-file").val();
|
|
|
|
+ let newName = $("#other-file").children("option:selected").text();
|
|
|
|
+ let currentOption = _.find(projectGljObject.changeInfo.self,{name:newName});
|
|
|
|
+ if(currentOption){ //存在则说明有重名的文件
|
|
|
|
+ //rename-unitFile
|
|
|
|
+ $("#rename-unitFile").modal({show:true});
|
|
|
|
+ $("#newUnitFileID").val(changeUnitPriceId);
|
|
|
|
+ $("#newUnitFileName").val(newName);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
- $('#change-unitFile').modal("hide");
|
|
|
|
let data = {project_id: scUrlUtil.GetQueryString('project'), change_id: changeUnitPriceId, type: type};
|
|
let data = {project_id: scUrlUtil.GetQueryString('project'), change_id: changeUnitPriceId, type: type};
|
|
projectObj.project.projectGLJ.changeFile(data,function () {
|
|
projectObj.project.projectGLJ.changeFile(data,function () {
|
|
projectGljObject.changeFileCallback();
|
|
projectGljObject.changeFileCallback();
|
|
@@ -942,6 +1051,7 @@ $(function () {
|
|
$("#unitFile-save-as").on('shown.bs.modal', function () {
|
|
$("#unitFile-save-as").on('shown.bs.modal', function () {
|
|
// 获取当前建设项数据
|
|
// 获取当前建设项数据
|
|
$("#save-as-name").val(projectGljObject.usedUnitPriceInfo.name + '副本');
|
|
$("#save-as-name").val(projectGljObject.usedUnitPriceInfo.name + '副本');
|
|
|
|
+ projectGljObject.checkUnitFileName(projectGljObject.usedUnitPriceInfo.name + '副本');
|
|
});
|
|
});
|
|
|
|
|
|
// 从其他建设项目中复制 选择建设项目
|
|
// 从其他建设项目中复制 选择建设项目
|
|
@@ -957,17 +1067,56 @@ $(function () {
|
|
$("#other-file").html(otherFileHtml);
|
|
$("#other-file").html(otherFileHtml);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ $('#save-as-name').change(function () {
|
|
|
|
+ projectGljObject.checkUnitFileName(this.value);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $('#newUnitFileName').change(function () {
|
|
|
|
+ let projectGLJ = projectObj.project.projectGLJ;
|
|
|
|
+ projectGLJ.checkUnitFileName(this.value,function (data) {
|
|
|
|
+ if(data){
|
|
|
|
+ $("#renameError_unitFile").text('已存在同名单价文件').show();
|
|
|
|
+ $('#renameUnitFileConfirm').attr("disabled","disabled");
|
|
|
|
+ }else {
|
|
|
|
+ $("#renameError_unitFile").hide();
|
|
|
|
+ $('#renameUnitFileConfirm').removeAttr("disabled");
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ $("#renameUnitFileConfirm").click(function () {
|
|
|
|
+ let projectGLJ = projectObj.project.projectGLJ;
|
|
|
|
+ let newName = $('#newUnitFileName').val();
|
|
|
|
+ let changeUnitPriceId = $('#newUnitFileID').val();
|
|
|
|
+ projectGLJ.checkUnitFileName(newName,function (data) {
|
|
|
|
+ if(data){
|
|
|
|
+ $("#renameError_unitFile").text('已存在同名单价文件').show();
|
|
|
|
+ $('#renameUnitFileConfirm').attr("disabled","disabled");
|
|
|
|
+ }else {
|
|
|
|
+ $("#renameError_unitFile").hide();
|
|
|
|
+ $('#renameUnitFileConfirm').removeAttr("disabled");
|
|
|
|
+ let data = {project_id: scUrlUtil.GetQueryString('project'), change_id: changeUnitPriceId, type: 1,newName:newName};
|
|
|
|
+ projectObj.project.projectGLJ.changeFile(data,function () {
|
|
|
|
+ projectGljObject.changeFileCallback();
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
// 单价文件另存为操作
|
|
// 单价文件另存为操作
|
|
$("#save-as-confirm").click(function () {
|
|
$("#save-as-confirm").click(function () {
|
|
|
|
+ let projectGLJ = projectObj.project.projectGLJ;
|
|
let name = $("#save-as-name").val();
|
|
let name = $("#save-as-name").val();
|
|
if (name === '') {
|
|
if (name === '') {
|
|
$("#save-as-tips").text('请填写单价文件名称').show();
|
|
$("#save-as-tips").text('请填写单价文件名称').show();
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
let saveData = {name: name, project_id: scUrlUtil.GetQueryString('project')};
|
|
let saveData = {name: name, project_id: scUrlUtil.GetQueryString('project')};
|
|
- projectObj.project.projectGLJ.saveAs(saveData,function () {
|
|
|
|
- projectGljObject.changeFileCallback();
|
|
|
|
- $("#unitFile-save-as").modal("hide");
|
|
|
|
|
|
+ projectGljObject.checkUnitFileName(name,function () {
|
|
|
|
+ projectGLJ.saveAs(saveData,function () {
|
|
|
|
+ projectGljObject.changeFileCallback();
|
|
|
|
+ $("#unitFile-save-as").modal("hide");
|
|
|
|
+ });
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|