|
@@ -376,24 +376,24 @@ var gljOprObj = {
|
|
|
},
|
|
},
|
|
|
onCellDoubleClick:function (sender, args) {
|
|
onCellDoubleClick:function (sender, args) {
|
|
|
// 含组成物的材料市场价改为只读,改为双击无反应不提示
|
|
// 含组成物的材料市场价改为只读,改为双击无反应不提示
|
|
|
- /* var me = gljOprObj;
|
|
|
|
|
- var header = me.setting.header;
|
|
|
|
|
- if (args.row >= me.sheetData.length) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (header[args.col] && header[args.col].dataCode == 'marketPrice') {
|
|
|
|
|
- if(me.hasComposition(me.sheetData[args.row])){
|
|
|
|
|
- alert("当前工料机的市场价由组成物计算得出,不可直接修改。");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (header[args.col] && header[args.col].dataCode == 'basePrice') {
|
|
|
|
|
- var isAdd = me.sheetData[args.row].isAdd;
|
|
|
|
|
- if(isAdd==1){//是新增但没有组成物时允许修改定额价
|
|
|
|
|
- if(me.hasComposition(me.sheetData[args.row])){//如果有组成物,不可修改
|
|
|
|
|
- alert("当前工料机的定额价由组成物计算得出,不可直接修改。");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }*/
|
|
|
|
|
|
|
+ /* var me = gljOprObj;
|
|
|
|
|
+ var header = me.setting.header;
|
|
|
|
|
+ if (args.row >= me.sheetData.length) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (header[args.col] && header[args.col].dataCode == 'marketPrice') {
|
|
|
|
|
+ if(me.hasComposition(me.sheetData[args.row])){
|
|
|
|
|
+ alert("当前工料机的市场价由组成物计算得出,不可直接修改。");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (header[args.col] && header[args.col].dataCode == 'basePrice') {
|
|
|
|
|
+ var isAdd = me.sheetData[args.row].isAdd;
|
|
|
|
|
+ if(isAdd==1){//是新增但没有组成物时允许修改定额价
|
|
|
|
|
+ if(me.hasComposition(me.sheetData[args.row])){//如果有组成物,不可修改
|
|
|
|
|
+ alert("当前工料机的定额价由组成物计算得出,不可直接修改。");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }*/
|
|
|
},
|
|
},
|
|
|
onClipboardChanged: function (sender, info) {
|
|
onClipboardChanged: function (sender, info) {
|
|
|
let cDatas = sheetCommonObj.getTableData(info.sheet, null);
|
|
let cDatas = sheetCommonObj.getTableData(info.sheet, null);
|
|
@@ -407,7 +407,7 @@ var gljOprObj = {
|
|
|
if (_.includes(me.setting.view.lockColumns, args.col)) return false;//如果是锁定的列,不能编辑
|
|
if (_.includes(me.setting.view.lockColumns, args.col)) return false;//如果是锁定的列,不能编辑
|
|
|
if(recode != undefined){
|
|
if(recode != undefined){
|
|
|
if(recode.isMixRatio){//对于组成物列
|
|
if(recode.isMixRatio){//对于组成物列
|
|
|
- return dataCode == 'marketPrice'//允许修改组成物市单价,其它的不可以
|
|
|
|
|
|
|
+ return dataCode == 'marketPrice'//允许修改组成物市单价,其它的不可以
|
|
|
}else {
|
|
}else {
|
|
|
if (dataCode && dataCode == 'marketPrice') {
|
|
if (dataCode && dataCode == 'marketPrice') {
|
|
|
return !me.marketPriceReadOnly({data:me.sheetData[args.row]});
|
|
return !me.marketPriceReadOnly({data:me.sheetData[args.row]});
|
|
@@ -514,7 +514,7 @@ var gljOprObj = {
|
|
|
if($('#linkGLJ').hasClass('active')){
|
|
if($('#linkGLJ').hasClass('active')){
|
|
|
this.showRationGLJData(node);
|
|
this.showRationGLJData(node);
|
|
|
subObj.showGljSubTabData();
|
|
subObj.showGljSubTabData();
|
|
|
- // MaterialController.showReplaceDiv(node);
|
|
|
|
|
|
|
+ // MaterialController.showReplaceDiv(node);
|
|
|
}
|
|
}
|
|
|
if($('#linkAZZJF').hasClass('active')) installationFeeObj.showRationInstallationData(node);
|
|
if($('#linkAZZJF').hasClass('active')) installationFeeObj.showRationInstallationData(node);
|
|
|
if($('#linkMBZM').hasClass('active')) mbzm_obj.showMBZMData(node);
|
|
if($('#linkMBZM').hasClass('active')) mbzm_obj.showMBZMData(node);
|
|
@@ -552,13 +552,13 @@ var gljOprObj = {
|
|
|
if(node.sourceType==ModuleNames.ration){
|
|
if(node.sourceType==ModuleNames.ration){
|
|
|
this.calcMixRationTotalQuantity(gljList,node.data.quantity);
|
|
this.calcMixRationTotalQuantity(gljList,node.data.quantity);
|
|
|
}else {
|
|
}else {
|
|
|
- let totalQuantity = this.getTotalQuantity(node.data);
|
|
|
|
|
- this.calcMixRationTotalQuantity(gljList,totalQuantity)
|
|
|
|
|
|
|
+ let totalQuantity = this.getTotalQuantity(node.data);
|
|
|
|
|
+ this.calcMixRationTotalQuantity(gljList,totalQuantity)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
this.sheetData = gljList;
|
|
this.sheetData = gljList;
|
|
|
this.sheet.setRowCount(0);
|
|
this.sheet.setRowCount(0);
|
|
|
- this.sheetData = sortRationGLJ(this.sheetData);
|
|
|
|
|
|
|
+ this.sheetData = gljUtil.sortRationGLJ(this.sheetData);
|
|
|
this.sheet.getRange(-1, 0, -1, 1).cellType(this.getTreeNodeCellType([]));
|
|
this.sheet.getRange(-1, 0, -1, 1).cellType(this.getTreeNodeCellType([]));
|
|
|
sheetCommonObj.showData(this.sheet, this.setting, this.sheetData);
|
|
sheetCommonObj.showData(this.sheet, this.setting, this.sheetData);
|
|
|
//初始选择
|
|
//初始选择
|
|
@@ -587,7 +587,7 @@ var gljOprObj = {
|
|
|
let selected = this.sheet.getSelections();
|
|
let selected = this.sheet.getSelections();
|
|
|
this.combineWithProjectGlj(this.sheetData);
|
|
this.combineWithProjectGlj(this.sheetData);
|
|
|
this.sheet.setRowCount(0);
|
|
this.sheet.setRowCount(0);
|
|
|
- this.sheetData = sortRationGLJ(this.sheetData);
|
|
|
|
|
|
|
+ this.sheetData = gljUtil.sortRationGLJ(this.sheetData);
|
|
|
this.sumQuantity();//计算总消耗量
|
|
this.sumQuantity();//计算总消耗量
|
|
|
this.addMixRatioToShow();//显示组成物信息
|
|
this.addMixRatioToShow();//显示组成物信息
|
|
|
this.initRationTree(init,this.getUnitPriceCodeMap());
|
|
this.initRationTree(init,this.getUnitPriceCodeMap());
|
|
@@ -622,7 +622,7 @@ var gljOprObj = {
|
|
|
if(codeMap[preCode]) {
|
|
if(codeMap[preCode]) {
|
|
|
codeMap[preCode].push({text:displayText,value:connectKey});
|
|
codeMap[preCode].push({text:displayText,value:connectKey});
|
|
|
}else {
|
|
}else {
|
|
|
- codeMap[preCode]=[{text:displayText ,value:connectKey}];
|
|
|
|
|
|
|
+ codeMap[preCode]=[{text:displayText ,value:connectKey}];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -648,9 +648,9 @@ var gljOprObj = {
|
|
|
},
|
|
},
|
|
|
getCodeOptions:function (recode,codeMap) {
|
|
getCodeOptions:function (recode,codeMap) {
|
|
|
let options = [];
|
|
let options = [];
|
|
|
- if(recode.isMixRatio ===true){
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if(recode.isMixRatio ===true){
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
let code = recode.code;
|
|
let code = recode.code;
|
|
|
if(code) {
|
|
if(code) {
|
|
|
let preCode = code.split("-")[0];
|
|
let preCode = code.split("-")[0];
|
|
@@ -827,7 +827,7 @@ var gljOprObj = {
|
|
|
}
|
|
}
|
|
|
temRationGLJs.push(tem);
|
|
temRationGLJs.push(tem);
|
|
|
}
|
|
}
|
|
|
- temRationGLJs = _.sortBy(temRationGLJs, 'code');
|
|
|
|
|
|
|
+ temRationGLJs = gljUtil.sortRationGLJ(temRationGLJs);
|
|
|
return temRationGLJs;
|
|
return temRationGLJs;
|
|
|
},
|
|
},
|
|
|
showQuantityDetailData: function (node) {
|
|
showQuantityDetailData: function (node) {
|
|
@@ -931,7 +931,7 @@ var gljOprObj = {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return false;
|
|
|
|
|
|
|
+ return false;
|
|
|
},
|
|
},
|
|
|
updateRationTypeGLJ: function (value, node, fieldName,editingText) {
|
|
updateRationTypeGLJ: function (value, node, fieldName,editingText) {
|
|
|
let newval;
|
|
let newval;
|
|
@@ -1184,14 +1184,14 @@ var gljOprObj = {
|
|
|
let node = project.ration_glj.updateGLJNodeAfterReplace(data);
|
|
let node = project.ration_glj.updateGLJNodeAfterReplace(data);
|
|
|
if(node) nodes.push(node);
|
|
if(node) nodes.push(node);
|
|
|
/*if (project.ration_glj.needShowToTree(data)) {//当替换的是主材或设备时,刷新对应的树节点
|
|
/*if (project.ration_glj.needShowToTree(data)) {//当替换的是主材或设备时,刷新对应的树节点
|
|
|
- var node = project.ration_glj.findGLJNodeByID(data.ID);
|
|
|
|
|
- if (node) {
|
|
|
|
|
- project.ration_glj.transferToNodeData(data);
|
|
|
|
|
- node.source = data;
|
|
|
|
|
- node.data = data;
|
|
|
|
|
- }
|
|
|
|
|
- node ? nodes.push(node) : "";
|
|
|
|
|
- }*/
|
|
|
|
|
|
|
+ var node = project.ration_glj.findGLJNodeByID(data.ID);
|
|
|
|
|
+ if (node) {
|
|
|
|
|
+ project.ration_glj.transferToNodeData(data);
|
|
|
|
|
+ node.source = data;
|
|
|
|
|
+ node.data = data;
|
|
|
|
|
+ }
|
|
|
|
|
+ node ? nodes.push(node) : "";
|
|
|
|
|
+ }*/
|
|
|
//project.ration_glj.addToMainTree(data);
|
|
//project.ration_glj.addToMainTree(data);
|
|
|
selected.data.adjustState = result.adjustState;
|
|
selected.data.adjustState = result.adjustState;
|
|
|
selected.data.name = result.name;
|
|
selected.data.name = result.name;
|
|
@@ -1217,7 +1217,7 @@ var gljOprObj = {
|
|
|
//let n_index = me.getIndex(data.query, gljKeyArray);
|
|
//let n_index = me.getIndex(data.query, gljKeyArray);
|
|
|
let nodes = [];
|
|
let nodes = [];
|
|
|
_.forEach(project.ration_glj.datas, function (t) {
|
|
_.forEach(project.ration_glj.datas, function (t) {
|
|
|
- // let t_index = me.getIndex(t, gljKeyArray);
|
|
|
|
|
|
|
+ // let t_index = me.getIndex(t, gljKeyArray);
|
|
|
if (updateMap[t.ID]) {
|
|
if (updateMap[t.ID]) {
|
|
|
me.updateProperty(t, data.doc);
|
|
me.updateProperty(t, data.doc);
|
|
|
me.updateProperty(t, updateMap[t.ID]);
|
|
me.updateProperty(t, updateMap[t.ID]);
|
|
@@ -1456,12 +1456,12 @@ $(function () {
|
|
|
gljOprObj.GLJSelection = [];
|
|
gljOprObj.GLJSelection = [];
|
|
|
projectGljObject.filterLibGLJForMixRatio();
|
|
projectGljObject.filterLibGLJForMixRatio();
|
|
|
/*selections = projectGljObject.mixRatioData; 添加组成物的时候先不选中
|
|
/*selections = projectGljObject.mixRatioData; 添加组成物的时候先不选中
|
|
|
- gljOprObj.GLJSelection = [];
|
|
|
|
|
- for(let s of selections){
|
|
|
|
|
- let s_key = gljOprObj.getIndex(s, gljKeyArray);
|
|
|
|
|
- selectMap[s_key] = true;
|
|
|
|
|
- gljOprObj.GLJSelection.push(s_key);
|
|
|
|
|
- }*/
|
|
|
|
|
|
|
+ gljOprObj.GLJSelection = [];
|
|
|
|
|
+ for(let s of selections){
|
|
|
|
|
+ let s_key = gljOprObj.getIndex(s, gljKeyArray);
|
|
|
|
|
+ selectMap[s_key] = true;
|
|
|
|
|
+ gljOprObj.GLJSelection.push(s_key);
|
|
|
|
|
+ }*/
|
|
|
}
|
|
}
|
|
|
for(let item of gljOprObj.gljLibSheetData){
|
|
for(let item of gljOprObj.gljLibSheetData){
|
|
|
let item_key = gljOprObj.getIndex(item, gljLibKeyArray);
|
|
let item_key = gljOprObj.getIndex(item, gljLibKeyArray);
|
|
@@ -1502,21 +1502,21 @@ $(function () {
|
|
|
gljOprObj.initSelection({row: 0});
|
|
gljOprObj.initSelection({row: 0});
|
|
|
//gljOprObj.gljLibSheetData = gljOprObj[val];
|
|
//gljOprObj.gljLibSheetData = gljOprObj[val];
|
|
|
/*gljOprObj.filterLibGLJSheetData();
|
|
/*gljOprObj.filterLibGLJSheetData();
|
|
|
- gljOprObj.showLibGLJSheetData();*/
|
|
|
|
|
|
|
+ gljOprObj.showLibGLJSheetData();*/
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-/* //工料机搜索
|
|
|
|
|
- $('#gljSearchKeyword').change(function () {
|
|
|
|
|
- gljOprObj.filterLibGLJSheetData();
|
|
|
|
|
- gljOprObj.showLibGLJSheetData();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ /* //工料机搜索
|
|
|
|
|
+ $('#gljSearchKeyword').change(function () {
|
|
|
|
|
+ gljOprObj.filterLibGLJSheetData();
|
|
|
|
|
+ gljOprObj.showLibGLJSheetData();
|
|
|
|
|
+ });
|
|
|
$('#gljSearchKeyword').bind('keypress', function (e) {
|
|
$('#gljSearchKeyword').bind('keypress', function (e) {
|
|
|
- if(e.keyCode === 13){
|
|
|
|
|
- alert('2');
|
|
|
|
|
- $(this).blur();
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- });*/
|
|
|
|
|
|
|
+ if(e.keyCode === 13){
|
|
|
|
|
+ alert('2');
|
|
|
|
|
+ $(this).blur();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });*/
|
|
|
$('#gljSearchKeyword').bind('keyup', function (e) {
|
|
$('#gljSearchKeyword').bind('keyup', function (e) {
|
|
|
gljOprObj.filterLibGLJSheetData();
|
|
gljOprObj.filterLibGLJSheetData();
|
|
|
gljOprObj.showLibGLJSheetData();
|
|
gljOprObj.showLibGLJSheetData();
|
|
@@ -1644,13 +1644,6 @@ function getDecimal(fieldID, node) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-function sortRationGLJ(list) {
|
|
|
|
|
- list = _.sortByAll(list, [function (item) {
|
|
|
|
|
- return _.indexOf(gljTypeSeq,item.type)
|
|
|
|
|
- }, "code"])
|
|
|
|
|
- return list;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
function compareRationGLJ(a, b) {
|
|
function compareRationGLJ(a, b) {
|
|
|
if ((a.type + "") < (b.type + "")) {
|
|
if ((a.type + "") < (b.type + "")) {
|
|
|
return true
|
|
return true
|