|
@@ -2,37 +2,136 @@
|
|
|
* Created by zhang on 2018/11/16.
|
|
|
*/
|
|
|
let locateObject={
|
|
|
+ bills_setting:{
|
|
|
+ header:[
|
|
|
+ {headerName: "编码", headerWidth: 120, dataCode: "code", dataType: "String"},
|
|
|
+ {headerName: "项目名称", headerWidth: 100, dataCode: "name", dataType: "String"},
|
|
|
+ {headerName: "单位", headerWidth: 50, dataCode: "unit", dataType: "String",hAlign: "center"},
|
|
|
+ {headerName: "工程量", headerWidth: 65, dataCode: "quantity", dataType: "Number", hAlign: "right"},
|
|
|
+ {headerName: "综合单价", headerWidth: 65, dataCode: "unitPrice", dataType: "Number", hAlign: "right"},
|
|
|
+ {headerName: "综合合价", headerWidth: 65, dataCode: "totalPrice", dataType: "Number", hAlign: "right"}
|
|
|
+ ],
|
|
|
+ view: {
|
|
|
+ lockColumns: [0,1,2,3,4],
|
|
|
+ rowHeaderWidth:25
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ration_setting:{
|
|
|
+ header:[
|
|
|
+ {headerName: "定额编码", headerWidth: 100, dataCode: "code", dataType: "String"},
|
|
|
+ {headerName: "定额名称", headerWidth: 180, dataCode: "name", dataType: "String"},
|
|
|
+ {headerName: "单位", headerWidth: 50, dataCode: "unit", dataType: "String",hAlign: "center"},
|
|
|
+ {headerName: "工程量", headerWidth: 65, dataCode: "quantity", dataType: "Number", hAlign: "right",decimalField: "ration.quantity"}
|
|
|
+ ],
|
|
|
+ view: {
|
|
|
+ lockColumns: [0,1,2,3],
|
|
|
+ rowHeaderWidth:25
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ration_glj_setting:{
|
|
|
+ header:[
|
|
|
+ {headerName: "编码", headerWidth: 120, dataCode: "code", dataType: "String"},
|
|
|
+ {headerName: "名称", headerWidth: 80, dataCode: "name", dataType: "String"},
|
|
|
+ {headerName: "规格型号", headerWidth: 80, dataCode: "code", dataType: "String"},
|
|
|
+ {headerName: "单位", headerWidth: 50, dataCode: "unit", dataType: "String",hAlign: "center"},
|
|
|
+ {headerName: "市场价", headerWidth: 65, dataCode: "marketPrice", dataType: "Number", hAlign: "right"}
|
|
|
+ ],
|
|
|
+ view: {
|
|
|
+ lockColumns: [0,1,2,3],
|
|
|
+ rowHeaderWidth:25
|
|
|
+ }
|
|
|
+ },
|
|
|
+ initMainSpread:function(){
|
|
|
+ if(!this.mainSpread){
|
|
|
+ this.mainSpread = SheetDataHelper.createNewSpread($("#locate_result")[0],3);
|
|
|
+ sheetCommonObj.spreadDefaultStyle(this.mainSpread);
|
|
|
+ this.initMainSheet();
|
|
|
+ }else {
|
|
|
+ this.mainSpread.refresh();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ initMainSheet:function () {
|
|
|
+ // this.mainSheet = this.mainSpread .getSheet(0);
|
|
|
+ //this.spread.bind(GC.Spread.Sheets.Events.ButtonClicked, this.onReplaceButtonClick);
|
|
|
+ //初始化清单表格
|
|
|
+ sheetCommonObj.initSheet(this.mainSpread .getSheet(0),this.bills_setting);
|
|
|
+ this.mainSpread .getSheet(0).setRowCount(0);
|
|
|
+ //初始化定额表格
|
|
|
+ sheetCommonObj.initSheet(this.mainSpread .getSheet(1),this.ration_setting);
|
|
|
+ this.mainSpread .getSheet(1).setRowCount(0);
|
|
|
|
|
|
-
|
|
|
+ //初始化人材机表格
|
|
|
+ sheetCommonObj.initSheet(this.mainSpread.getSheet(2),this.ration_glj_setting);
|
|
|
+ this.mainSpread .getSheet(2).setRowCount(0);
|
|
|
+ },
|
|
|
+ initSubSpread:function () {
|
|
|
+ if(!this.subSpread){
|
|
|
+ this.subSpread = SheetDataHelper.createNewSpread($("#locate_sub")[0]);
|
|
|
+ sheetCommonObj.spreadDefaultStyle(this.subSpread);
|
|
|
+ this.initSubSheet();
|
|
|
+ }else {
|
|
|
+ this.subSpread.refresh();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ initSubSheet:function () {
|
|
|
+ this.subSheet = this.subSpread .getSheet(0);
|
|
|
+ sheetCommonObj.initSheet( this.subSheet, this.ration_setting);
|
|
|
+ this.subSheet.setRowCount(0);
|
|
|
+ //this.spread.bind(GC.Spread.Sheets.Events.ButtonClicked, this.onReplaceButtonClick);
|
|
|
+ this.subSheet.name('locate_sub');
|
|
|
+ },
|
|
|
+ showMainData:function () {
|
|
|
+ let datas = [];
|
|
|
+ //sheetCommonObj.showData(this.mainSheet,this.mainSettiong,datas);
|
|
|
+ this.mainSpread.getActiveSheet().setRowCount(datas.length);
|
|
|
+ },
|
|
|
init:function () {
|
|
|
- let tab_content = $('#locate').parent();
|
|
|
- $('#locate_result').height(tab_content.height()*0.6);
|
|
|
- $('#locate_sub').height(tab_content.height()*0.4);
|
|
|
-
|
|
|
+ let me = this;
|
|
|
+ let options = $("input[name='content_type']:checked").val();
|
|
|
+ let callback = function () {
|
|
|
+ let mainHeight = $(window).height()-$(".header").height()-$(".toolsbar").height()-$("#searchPanel").height();
|
|
|
+ let subHeight = 0;
|
|
|
+ if(options == "ration_glj"){
|
|
|
+ subHeight = mainHeight*0.4;
|
|
|
+ mainHeight = mainHeight*0.6;
|
|
|
+ }
|
|
|
+ console.log(mainHeight);
|
|
|
+ $('#locate_result').height(mainHeight);
|
|
|
+ $('#locate_sub').height(subHeight - 7);
|
|
|
+ me.initMainSpread();
|
|
|
+ me.initSubSpread();
|
|
|
+ me.showMainData();
|
|
|
+ };
|
|
|
+ options == "bills"?$("#outstandingOptions").show(0,callback):$("#outstandingOptions").hide(0,callback);
|
|
|
|
|
|
},
|
|
|
+ findRecodes:function () {
|
|
|
|
|
|
+ },
|
|
|
onshow:function () {
|
|
|
-
|
|
|
locateObject.init();
|
|
|
- console.log('#locate is now visible');
|
|
|
- console.log($("#locate").is(':visible'))
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
|
+$("#locate_btn").click(function () {
|
|
|
+ locateObject.findRecodes();
|
|
|
+});
|
|
|
|
|
|
-
|
|
|
-/*
|
|
|
-$("input[name='install_setting_radios']").each(function(){
|
|
|
+$("input[name='content_type']").each(function(){
|
|
|
$(this).click(function(){
|
|
|
- var settingVal = $(this).val();
|
|
|
- let installSetting = projectInfoObj.projectInfo.property.installSetting;
|
|
|
- if(installSetting==settingVal){
|
|
|
- return;
|
|
|
+ let optins = $(this).val();
|
|
|
+ switch (optins){
|
|
|
+ case "bills":
|
|
|
+ locateObject.mainSpread.setActiveSheetIndex(0);
|
|
|
+ break;
|
|
|
+ case "ration":
|
|
|
+ locateObject.mainSpread.setActiveSheetIndex(1);
|
|
|
+ break;
|
|
|
+ case "ration_glj":
|
|
|
+ locateObject.mainSpread.setActiveSheetIndex(2);
|
|
|
+ break;
|
|
|
}
|
|
|
- projectObj.project.installation_fee.updateInstallSetting(settingVal);
|
|
|
- installationFeeObj.cleanPositionIfNeed(settingVal);
|
|
|
+ locateObject.init();
|
|
|
});
|
|
|
-});*/
|
|
|
+});
|