|
@@ -221,7 +221,7 @@ let projectGljObject = {
|
|
sheetCommonObj.spreadDefaultStyle(this.infoPriceSpread);
|
|
sheetCommonObj.spreadDefaultStyle(this.infoPriceSpread);
|
|
this.infoPriceSheet = this.infoPriceSpread.getSheet(0);
|
|
this.infoPriceSheet = this.infoPriceSpread.getSheet(0);
|
|
this.initSheet(this.infoPriceSheet, this.infoPriceSetting);
|
|
this.initSheet(this.infoPriceSheet, this.infoPriceSetting);
|
|
- this.infoPriceSheet.bind(GC.Spread.Sheets.Events.TopRowChanged, _.debounce(this.onInfoTopRowChanged, 100));
|
|
|
|
|
|
+ this.infoPriceSheet.bind(GC.Spread.Sheets.Events.TopRowChanged, _.debounce(this.onInfoTopRowChanged, 100));
|
|
this.infoPriceSheet.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onInfoPriceDoubleClick);
|
|
this.infoPriceSheet.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onInfoPriceDoubleClick);
|
|
this.infoPriceSheet.name('infoPriceSheet');
|
|
this.infoPriceSheet.name('infoPriceSheet');
|
|
this.infoPriceSheet.setRowCount(0);
|
|
this.infoPriceSheet.setRowCount(0);
|
|
@@ -534,6 +534,15 @@ let projectGljObject = {
|
|
sheetCommonObj.showData(me.infoPriceSheet, me.infoPriceSetting, datas);
|
|
sheetCommonObj.showData(me.infoPriceSheet, me.infoPriceSetting, datas);
|
|
me.infoPriceSheet.setRowCount(datas.length);
|
|
me.infoPriceSheet.setRowCount(datas.length);
|
|
},
|
|
},
|
|
|
|
+ autoShowInfoPriceData: function () {
|
|
|
|
+ if (!$('#info-nav').hasClass('active')) return;
|
|
|
|
+ let projectGLJData = this.getProjectGLJSelected();
|
|
|
|
+ $('#info_search_name').val(projectGLJData.name);
|
|
|
|
+ let code = projectGLJData.code.substr(0, 4);
|
|
|
|
+ $('#info_glj_name').val(projectGLJData.name);
|
|
|
|
+ $('#info_glj_code').val(code);
|
|
|
|
+ this.searchInfoPrice(null);
|
|
|
|
+ },
|
|
getMixRatioSheetData: function (glj) {
|
|
getMixRatioSheetData: function (glj) {
|
|
let data = {
|
|
let data = {
|
|
id: glj.id,
|
|
id: glj.id,
|
|
@@ -647,6 +656,7 @@ let projectGljObject = {
|
|
sel.colCount = 1;
|
|
sel.colCount = 1;
|
|
me.showMixRatioData();
|
|
me.showMixRatioData();
|
|
me.showRelatedRationDatas();
|
|
me.showRelatedRationDatas();
|
|
|
|
+ me.autoShowInfoPriceData();
|
|
},
|
|
},
|
|
rightClickCallback: function (row) {
|
|
rightClickCallback: function (row) {
|
|
let me = projectGljObject;
|
|
let me = projectGljObject;
|
|
@@ -1642,16 +1652,17 @@ let projectGljObject = {
|
|
}
|
|
}
|
|
console.log(bottomRow);
|
|
console.log(bottomRow);
|
|
me.infoPriceLastLoadingRow = me.infoPriceData.length;
|
|
me.infoPriceLastLoadingRow = me.infoPriceData.length;
|
|
- me.searchInfoPrice(me.infoPriceData[me.infoPriceData.length - 1]._id)
|
|
|
|
|
|
+ //只有在空的搜索条件下才执行分页查询,其它情况无法分页
|
|
|
|
+ if ($('#info_search_name').val() == "") me.searchInfoPrice(me.infoPriceData[me.infoPriceData.length - 1]._id)
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
},
|
|
},
|
|
searchInfoPrice: async function (objectID) {
|
|
searchInfoPrice: async function (objectID) {
|
|
let year = $('#info_year').val();
|
|
let year = $('#info_year').val();
|
|
let month = $('#info_month').val();
|
|
let month = $('#info_month').val();
|
|
let areaID = $('#info_area').val();
|
|
let areaID = $('#info_area').val();
|
|
let keyWord = $('#info_search_name').val();
|
|
let keyWord = $('#info_search_name').val();
|
|
|
|
+ let name = $('#info_glj_name').val();
|
|
|
|
+ let code = $('#info_glj_code').val();
|
|
let me = projectGljObject;
|
|
let me = projectGljObject;
|
|
try {
|
|
try {
|
|
if (year != "" && month != "" && areaID != "") {
|
|
if (year != "" && month != "" && areaID != "") {
|
|
@@ -1663,7 +1674,9 @@ let projectGljObject = {
|
|
condition: condition
|
|
condition: condition
|
|
};
|
|
};
|
|
if (keyWord != "") data.keyWord = keyWord;
|
|
if (keyWord != "") data.keyWord = keyWord;
|
|
|
|
+ if (name !="") data.keyWord = name;
|
|
if (objectID) data.lastID = objectID;
|
|
if (objectID) data.lastID = objectID;
|
|
|
|
+ if (code !="" ) data.code = code;
|
|
let result = await ajaxPost("/infoPrice/getDataByCondition", data);
|
|
let result = await ajaxPost("/infoPrice/getDataByCondition", data);
|
|
if (objectID) { //分页查询
|
|
if (objectID) { //分页查询
|
|
sheetCommonObj.appendData(me.infoPriceSheet, me.infoPriceData.length, 0, me.infoPriceSetting, result.items);
|
|
sheetCommonObj.appendData(me.infoPriceSheet, me.infoPriceData.length, 0, me.infoPriceSetting, result.items);
|
|
@@ -1672,6 +1685,11 @@ let projectGljObject = {
|
|
me.infoPriceTotalSize = result.totalSize;
|
|
me.infoPriceTotalSize = result.totalSize;
|
|
me.infoPriceLastLoadingRow = 0;
|
|
me.infoPriceLastLoadingRow = 0;
|
|
me.showInforPriceData(result.items);
|
|
me.showInforPriceData(result.items);
|
|
|
|
+ if (result.totalSize == 0) {
|
|
|
|
+ $("#info-warning").text("当前材料没有信息价! ");
|
|
|
|
+ } else {
|
|
|
|
+ $("#info-warning").text("");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else { //当有任意一个为空时,都清空表格
|
|
} else { //当有任意一个为空时,都清空表格
|
|
me.infoPriceTotalSize = 0;
|
|
me.infoPriceTotalSize = 0;
|
|
@@ -2111,8 +2129,7 @@ $(function () {
|
|
$("#info-nav").on('shown.bs.tab', function () {
|
|
$("#info-nav").on('shown.bs.tab', function () {
|
|
$('#info_price_sheet').height($("#mix_ratio_sheet").height() - $("#infoToolDiv").height());
|
|
$('#info_price_sheet').height($("#mix_ratio_sheet").height() - $("#infoToolDiv").height());
|
|
projectGljObject.initInfoPriceSpread();
|
|
projectGljObject.initInfoPriceSpread();
|
|
- /*
|
|
|
|
- projectGljObject.showRelatedRationDatas(); */
|
|
|
|
|
|
+ projectGljObject.autoShowInfoPriceData();
|
|
});
|
|
});
|
|
$('#info_year').change(function () {
|
|
$('#info_year').change(function () {
|
|
let periodMap = projectGljObject.infoPriceOptions.periodMap;
|
|
let periodMap = projectGljObject.infoPriceOptions.periodMap;
|
|
@@ -2135,12 +2152,17 @@ $(function () {
|
|
projectGljObject.searchInfoPrice();
|
|
projectGljObject.searchInfoPrice();
|
|
});
|
|
});
|
|
$('#info_search_name').on('keypress', function (e) {
|
|
$('#info_search_name').on('keypress', function (e) {
|
|
|
|
+ $("#info-warning").text("");
|
|
if (e.keyCode === 13) {
|
|
if (e.keyCode === 13) {
|
|
|
|
+ $('#info_glj_name').val("");
|
|
|
|
+ $('#info_glj_code').val("");
|
|
projectGljObject.searchInfoPrice();
|
|
projectGljObject.searchInfoPrice();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
$('#info_search_btn').on('click', function (e) {
|
|
$('#info_search_btn').on('click', function (e) {
|
|
|
|
+ $('#info_glj_name').val("");
|
|
|
|
+ $('#info_glj_code').val("");
|
|
projectGljObject.searchInfoPrice();
|
|
projectGljObject.searchInfoPrice();
|
|
});
|
|
});
|
|
|
|
|