|
@@ -12,6 +12,8 @@ var gljOprObj = {
|
|
coeSheet:null,
|
|
coeSheet:null,
|
|
assSheet:null,
|
|
assSheet:null,
|
|
assSheetData:[],
|
|
assSheetData:[],
|
|
|
|
+ detailSheet:null,
|
|
|
|
+ detailData:[],
|
|
setting: {
|
|
setting: {
|
|
header: [
|
|
header: [
|
|
{headerName: "编码", headerWidth: 100, dataCode: "code", dataType: "String", formatter: "@"},
|
|
{headerName: "编码", headerWidth: 100, dataCode: "code", dataType: "String", formatter: "@"},
|
|
@@ -55,7 +57,17 @@ var gljOprObj = {
|
|
lockColumns:[0,1]
|
|
lockColumns:[0,1]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ detailSetting:{
|
|
|
|
+ header:[
|
|
|
|
+ {headerName: "名称", headerWidth: 100, dataCode: "name", dataType: "String"},
|
|
|
|
+ {headerName: "计算式", headerWidth: 120, dataCode: "regex", dataType: "String"},
|
|
|
|
+ {headerName: "结果(C)", headerWidth: 120, dataCode: "result", dataType: "Number",formatter:"0.0000",tofix:4},
|
|
|
|
+ {headerName: "累加", headerWidth: 120, dataCode: "isSummation", dataType: "String",cellType:"checkBox"}
|
|
|
|
+ ],
|
|
|
|
+ view:{
|
|
|
|
+ lockColumns:[2,3]
|
|
|
|
+ }
|
|
|
|
+ },
|
|
initSheet: function(sheet) {
|
|
initSheet: function(sheet) {
|
|
var me = this;
|
|
var me = this;
|
|
me.sheet = sheet;
|
|
me.sheet = sheet;
|
|
@@ -81,6 +93,13 @@ var gljOprObj = {
|
|
sheet.name('ration_ass');
|
|
sheet.name('ration_ass');
|
|
me.bindSheetEvent(sheet);
|
|
me.bindSheetEvent(sheet);
|
|
},
|
|
},
|
|
|
|
+ initDetailSheet: function(sheet) {
|
|
|
|
+ var me = this;
|
|
|
|
+ me.detailSheet = sheet;
|
|
|
|
+ sheetCommonObj.initSheet(me.detailSheet, me.detailSetting, 30);
|
|
|
|
+ sheet.name('quantity_detail');
|
|
|
|
+ me.bindSheetEvent(sheet);
|
|
|
|
+ },
|
|
showCoeData:function(sheet,setting,datas){
|
|
showCoeData:function(sheet,setting,datas){
|
|
sheet.floatingObjects.remove("customerCoe");
|
|
sheet.floatingObjects.remove("customerCoe");
|
|
sheetCommonObj.showData(sheet,setting,datas);
|
|
sheetCommonObj.showData(sheet,setting,datas);
|
|
@@ -118,15 +137,33 @@ var gljOprObj = {
|
|
|
|
|
|
onEditEnded: function(sender,args){
|
|
onEditEnded: function(sender,args){
|
|
var me = gljOprObj;
|
|
var me = gljOprObj;
|
|
- if(subSpread.getActiveSheetIndex()==0){
|
|
|
|
|
|
+ if(args.sheetName=='ration_glj'){
|
|
me.onEditGLJSheet(args)
|
|
me.onEditGLJSheet(args)
|
|
}
|
|
}
|
|
- if(subSpread.getActiveSheetIndex()==1){
|
|
|
|
|
|
+ if(args.sheetName=='ration_ass'){
|
|
me.onEditAssSheet(args);
|
|
me.onEditAssSheet(args);
|
|
}
|
|
}
|
|
|
|
+ if(args.sheetName=='quantity_detail'){
|
|
|
|
+ me.onEditDetailSheet(args);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onEditDetailSheet:function(args){
|
|
|
|
+ var me = gljOprObj;
|
|
|
|
+ if(args.row>me.detailData.length){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if(args.row==me.detailData.length&&args.editingText==null){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if(args.row==me.detailData.length){
|
|
|
|
+ projectObj.project.quantity_detail.saveQuantityDetail(args,me.detailSetting.header[args.col].dataCode);
|
|
|
|
+ }
|
|
|
|
+ if(args.row<me.detailData.length){
|
|
|
|
+ projectObj.project.quantity_detail.updateQuantityDetail(args,me.detailSetting.header[args.col].dataCode,me.detailData[args.row]);
|
|
|
|
+ }
|
|
|
|
|
|
},
|
|
},
|
|
- onEditGLJSheet(args){
|
|
|
|
|
|
+ onEditGLJSheet:function(args){
|
|
var me = gljOprObj;
|
|
var me = gljOprObj;
|
|
if(args.row>=me.sheetData.length){
|
|
if(args.row>=me.sheetData.length){
|
|
me.sheet.getCell(args.row, args.col).value(null);
|
|
me.sheet.getCell(args.row, args.col).value(null);
|
|
@@ -142,7 +179,7 @@ var gljOprObj = {
|
|
}
|
|
}
|
|
me.updateRationGLJ(args,updateFunction);
|
|
me.updateRationGLJ(args,updateFunction);
|
|
},
|
|
},
|
|
- onEditAssSheet(args){
|
|
|
|
|
|
+ onEditAssSheet:function(args){
|
|
var me = gljOprObj;
|
|
var me = gljOprObj;
|
|
if(args.row>=me.assSheetData.length){
|
|
if(args.row>=me.assSheetData.length){
|
|
me.assSheet.getCell(args.row, args.col).value(null);
|
|
me.assSheet.getCell(args.row, args.col).value(null);
|
|
@@ -159,21 +196,26 @@ var gljOprObj = {
|
|
if (cellType instanceof GC.Spread.Sheets.CellTypes.Button) {
|
|
if (cellType instanceof GC.Spread.Sheets.CellTypes.Button) {
|
|
me.onCusButtonClick(sender,args);
|
|
me.onCusButtonClick(sender,args);
|
|
}else {
|
|
}else {
|
|
- me.onCoeCheckBoxClick(sender,args)
|
|
|
|
|
|
+ me.onCheckBoxClick(sender,args)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onCoeCheckBoxClick:function(sender,args){
|
|
|
|
- if(subSpread.getActiveSheetIndex()==2){
|
|
|
|
- var checkboxValue = gljOprObj.coeSheet.getCell(args.row, args.col).value();
|
|
|
|
- var newval = 0;
|
|
|
|
- if(checkboxValue){
|
|
|
|
- newval = 0;
|
|
|
|
- gljOprObj.coeSheet.getCell(args.row, args.col).value(newval);
|
|
|
|
- }else {
|
|
|
|
- newval=1
|
|
|
|
- gljOprObj.coeSheet.getCell(args.row, args.col).value(newval);
|
|
|
|
- }
|
|
|
|
|
|
+ onCheckBoxClick:function(sender,args){
|
|
|
|
+ if(args.sheetName=='ration_glj'){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ var checkboxValue = args.sheet.getCell(args.row, args.col).value();
|
|
|
|
+ var newval = 0;
|
|
|
|
+ if(checkboxValue){
|
|
|
|
+ newval = 0;
|
|
|
|
+ args.sheet.getCell(args.row, args.col).value(newval);
|
|
|
|
+ }else {
|
|
|
|
+ newval=1
|
|
|
|
+ args.sheet.getCell(args.row, args.col).value(newval);
|
|
|
|
+ }
|
|
|
|
+ if(args.sheetName=='ration_coe'){
|
|
gljOprObj.updateRationCoe(args,newval)
|
|
gljOprObj.updateRationCoe(args,newval)
|
|
|
|
+ }else {
|
|
|
|
+ projectObj.project.quantity_detail.isSummationUpdate(args,gljOprObj.detailData,newval);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onCusButtonClick:function (sender,args){
|
|
onCusButtonClick:function (sender,args){
|
|
@@ -396,6 +438,7 @@ var gljOprObj = {
|
|
this.showRationAssData(node);
|
|
this.showRationAssData(node);
|
|
isShow=true;
|
|
isShow=true;
|
|
}
|
|
}
|
|
|
|
+ this.showQuantityDetailData(node);
|
|
}else {
|
|
}else {
|
|
this.selectedNodeId=null;
|
|
this.selectedNodeId=null;
|
|
}
|
|
}
|
|
@@ -420,9 +463,9 @@ var gljOprObj = {
|
|
this.sheetData=gljList;
|
|
this.sheetData=gljList;
|
|
},
|
|
},
|
|
showRationCoeData:function (node) {
|
|
showRationCoeData:function (node) {
|
|
- let coeList = [];
|
|
|
|
- let ration_coe= projectObj.project.ration_coe;
|
|
|
|
- let ration = node.data;
|
|
|
|
|
|
+ var coeList = [];
|
|
|
|
+ var ration_coe= projectObj.project.ration_coe;
|
|
|
|
+ var ration = node.data;
|
|
if(ration_coe.datas&&ration_coe.datas.length>0){
|
|
if(ration_coe.datas&&ration_coe.datas.length>0){
|
|
coeList = _.filter(ration_coe.datas,{'projectID':ration.projectID,'rationID':ration.ID})
|
|
coeList = _.filter(ration_coe.datas,{'projectID':ration.projectID,'rationID':ration.ID})
|
|
}
|
|
}
|
|
@@ -430,17 +473,31 @@ var gljOprObj = {
|
|
this.coeSheetData=coeList;
|
|
this.coeSheetData=coeList;
|
|
},
|
|
},
|
|
showRationAssData:function (node) {
|
|
showRationAssData:function (node) {
|
|
- let assList = node.data.rationAssList;
|
|
|
|
|
|
+ var assList = node.data.rationAssList;
|
|
sheetCommonObj.showData(this.assSheet,this.assSetting,assList);
|
|
sheetCommonObj.showData(this.assSheet,this.assSetting,assList);
|
|
this.assSheetData =assList;
|
|
this.assSheetData =assList;
|
|
},
|
|
},
|
|
|
|
+ showQuantityDetailData:function (node) {
|
|
|
|
+ var details=[];
|
|
|
|
+ var quantity_detail =projectObj.project.quantity_detail;
|
|
|
|
+ if(node.sourceType==ModuleNames.ration){
|
|
|
|
+ details=_.filter(quantity_detail.datas,{'rationID':node.data.ID});
|
|
|
|
+ }else if(node.sourceType==ModuleNames.bills){
|
|
|
|
+ details=_.filter(quantity_detail.datas,{'billID':node.data.ID});
|
|
|
|
+ }
|
|
|
|
+ details=_.sortBy(details,'seq');
|
|
|
|
+ sheetCommonObj.showData(this.detailSheet,this.detailSetting,details);
|
|
|
|
+ this.detailData = details;
|
|
|
|
+ },
|
|
clearSheetData:function () {
|
|
clearSheetData:function () {
|
|
sheetCommonObj.showData(this.sheet,this.setting,[]);
|
|
sheetCommonObj.showData(this.sheet,this.setting,[]);
|
|
sheetCommonObj.showData(this.coeSheet,this.coeSetting,[]);
|
|
sheetCommonObj.showData(this.coeSheet,this.coeSetting,[]);
|
|
sheetCommonObj.showData(this.assSheet,this.assSetting,[]);
|
|
sheetCommonObj.showData(this.assSheet,this.assSetting,[]);
|
|
|
|
+ sheetCommonObj.showData(this.detailSheet,this.detailSetting,[]);
|
|
this.sheetData = [];
|
|
this.sheetData = [];
|
|
this.coeSheetData = [];
|
|
this.coeSheetData = [];
|
|
this.assSheetData = [];
|
|
this.assSheetData = [];
|
|
|
|
+ this.detailData=[];
|
|
},
|
|
},
|
|
/* lockRationGLJCell:function(){
|
|
/* lockRationGLJCell:function(){
|
|
sheetCommonObj.lockCells(this.sheet,this.setting);
|
|
sheetCommonObj.lockCells(this.sheet,this.setting);
|