|
@@ -325,10 +325,9 @@ var gljOprObj = {
|
|
},
|
|
},
|
|
onTopRowChanged: function (sender, args) {
|
|
onTopRowChanged: function (sender, args) {
|
|
const me = gljOprObj;
|
|
const me = gljOprObj;
|
|
- const topRow = args.newTopRow;
|
|
|
|
const bottomRow = args.sheet.getViewportBottomRow(1);
|
|
const bottomRow = args.sheet.getViewportBottomRow(1);
|
|
- const radioType = $("input[name='glj']:checked").val();
|
|
|
|
- const curRecord = radioType === 'stdGLJ' ? me.stdGLJ : me.complementaryGLJs;
|
|
|
|
|
|
+ const gljLibID = $('#glj-lib-select').val();
|
|
|
|
+ const curRecord = gljLibID === commonConstants.COMPLEMENTARY_LIB ? me.complementaryGLJs : me.stdGLJ;
|
|
// 当前表显示数据数大于等于当前筛选情况下最大数据数,不获取下一分页
|
|
// 当前表显示数据数大于等于当前筛选情况下最大数据数,不获取下一分页
|
|
if (curRecord.length >= me.curPageTotal ||
|
|
if (curRecord.length >= me.curPageTotal ||
|
|
me.loadingPagination) {
|
|
me.loadingPagination) {
|
|
@@ -340,7 +339,7 @@ var gljOprObj = {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
loadPageData: function (sheet, reset, index) {
|
|
loadPageData: function (sheet, reset, index) {
|
|
- let condition = this.getPagingCondition(false, reset, false, index);
|
|
|
|
|
|
+ let condition = this.getPagingCondition(false, reset, false, index, false, null);
|
|
let getPagingFun = typeof unitPriceObj != 'undefined' ? unitPriceObj.getGLJDataPaging:projectObj.project.ration_glj.getGLJDataPaging;
|
|
let getPagingFun = typeof unitPriceObj != 'undefined' ? unitPriceObj.getGLJDataPaging:projectObj.project.ration_glj.getGLJDataPaging;
|
|
getPagingFun(condition, function (data) {
|
|
getPagingFun(condition, function (data) {
|
|
sheetCommonObj.appendData(sheet, condition.index, 0, gljOprObj.gljLibSheetSetting, data);
|
|
sheetCommonObj.appendData(sheet, condition.index, 0, gljOprObj.gljLibSheetSetting, data);
|
|
@@ -1147,9 +1146,11 @@ var gljOprObj = {
|
|
* {Boolean}reset 是否重置数据 (点击分类树等)
|
|
* {Boolean}reset 是否重置数据 (点击分类树等)
|
|
* {Boolean}location 是否定位(替换初始化)
|
|
* {Boolean}location 是否定位(替换初始化)
|
|
* {Number}index 下一页数据开始索引,根据这个值获取上次分页最大的编码数据(不用skip进行分页,skip跳过大量数据会降低性能,用$gt: data.code)
|
|
* {Number}index 下一页数据开始索引,根据这个值获取上次分页最大的编码数据(不用skip进行分页,skip跳过大量数据会降低性能,用$gt: data.code)
|
|
|
|
+ * {Boolean}initLibs 是否初始化库列表
|
|
|
|
+ * {String||Null}gljLibID 选中的人材机库
|
|
* @return {Object}
|
|
* @return {Object}
|
|
* */
|
|
* */
|
|
- getPagingCondition: function (init, reset, location, index) {
|
|
|
|
|
|
+ getPagingCondition: function (init, reset, location, index, initLibs, gljLibID) {
|
|
// 上一次分页的最末人材机编码,index为0时,code为空
|
|
// 上一次分页的最末人材机编码,index为0时,code为空
|
|
const code = gljOprObj.AllRecode && gljOprObj.AllRecode[index - 1] ? gljOprObj.AllRecode[index - 1].code : '';
|
|
const code = gljOprObj.AllRecode && gljOprObj.AllRecode[index - 1] ? gljOprObj.AllRecode[index - 1].code : '';
|
|
// 初始化情况下的条件
|
|
// 初始化情况下的条件
|
|
@@ -1164,6 +1165,7 @@ var gljOprObj = {
|
|
limit: 50,
|
|
limit: 50,
|
|
// 初始化
|
|
// 初始化
|
|
init: init,
|
|
init: init,
|
|
|
|
+ initLibs,
|
|
// 所在部分(标准、补充)
|
|
// 所在部分(标准、补充)
|
|
type: this.pagingType.stdGLJ,
|
|
type: this.pagingType.stdGLJ,
|
|
// 替换数据,替换操作下有数据:编码、名称、规格、单位、类型
|
|
// 替换数据,替换操作下有数据:编码、名称、规格、单位、类型
|
|
@@ -1192,15 +1194,23 @@ var gljOprObj = {
|
|
} else if (actionType === 'addMix'|| actionType === 'unitPriceAddMix') {
|
|
} else if (actionType === 'addMix'|| actionType === 'unitPriceAddMix') {
|
|
condition.queryExtend = projectGljObject.getQueryExtForMixRatio();
|
|
condition.queryExtend = projectGljObject.getQueryExtForMixRatio();
|
|
}
|
|
}
|
|
|
|
+ if (gljLibID) {
|
|
|
|
+ condition.gljLibID = gljLibID;
|
|
|
|
+ } else {
|
|
|
|
+ if (condition.replace) {
|
|
|
|
+ const selected = gljOprObj.sheetData[gljContextMenu.selectedRow];
|
|
|
|
+ condition.gljLibID = selected.from === 'cpt' || !selected.repositoryId ? commonConstants.COMPLEMENTARY_LIB : selected.repositoryId;
|
|
|
|
+ } else {
|
|
|
|
+ condition.gljLibID = initLibs ? null : $('#glj-lib-select').val();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (condition.gljLibID === commonConstants.COMPLEMENTARY_LIB) {
|
|
|
|
+ condition.type = this.pagingType.complementaryGLJs;
|
|
|
|
+ }
|
|
if (init) {
|
|
if (init) {
|
|
return condition;
|
|
return condition;
|
|
}
|
|
}
|
|
condition.init = false;
|
|
condition.init = false;
|
|
- // 标准、补充的选择
|
|
|
|
- if ($('#glj_tree_div').is(':visible')) {
|
|
|
|
- let radioType = $("input[name='glj']:checked").val();
|
|
|
|
- condition.type = this.pagingType[radioType];
|
|
|
|
- }
|
|
|
|
// 选中的分类
|
|
// 选中的分类
|
|
if (this.treeObj) {
|
|
if (this.treeObj) {
|
|
let selNode = this.treeObj.getNodeByParam('ID', this.gljCurTypeId);
|
|
let selNode = this.treeObj.getNodeByParam('ID', this.gljCurTypeId);
|
|
@@ -1220,12 +1230,10 @@ var gljOprObj = {
|
|
},
|
|
},
|
|
filterLibGLJSheetData: function () {
|
|
filterLibGLJSheetData: function () {
|
|
let me = this;
|
|
let me = this;
|
|
- let val = $("input[name='glj']:checked").val();
|
|
|
|
- if (val == 'allGljs') {
|
|
|
|
- me.gljLibSheetData = me.stdGLJ.concat(me.complementaryGLJs);
|
|
|
|
- } else {
|
|
|
|
- me.gljLibSheetData = me[val];
|
|
|
|
- }
|
|
|
|
|
|
+ const selectLibID = $('#glj-lib-select').val();
|
|
|
|
+ me.gljLibSheetData = selectLibID === commonConstants.COMPLEMENTARY_LIB
|
|
|
|
+ ? me.complementaryGLJs
|
|
|
|
+ : me.stdGLJ;
|
|
if ($('#actionType').val() == 'replace' || $('#actionType').val() == 'm_replace') {
|
|
if ($('#actionType').val() == 'replace' || $('#actionType').val() == 'm_replace') {
|
|
me.filterLibGLJByType();
|
|
me.filterLibGLJByType();
|
|
}else if($('#actionType').val() == 'addMix' || $('#actionType').val() == 'unitPriceAddMix'){
|
|
}else if($('#actionType').val() == 'addMix' || $('#actionType').val() == 'unitPriceAddMix'){
|
|
@@ -1631,7 +1639,10 @@ var gljOprObj = {
|
|
let zTree = $.fn.zTree.getZTreeObj("gljTree");
|
|
let zTree = $.fn.zTree.getZTreeObj("gljTree");
|
|
let node = null;
|
|
let node = null;
|
|
if (ID) node = zTree.getNodesByParam('ID', ID, null)[0];
|
|
if (ID) node = zTree.getNodesByParam('ID', ID, null)[0];
|
|
- if (!node) node = zTree.getNodeByTId('gljTree_1');
|
|
|
|
|
|
+ if (!node) {
|
|
|
|
+ node = zTree.getNodeByTId('gljTree_1');
|
|
|
|
+ ID = node.ID;
|
|
|
|
+ }
|
|
zTree.selectNode(node);
|
|
zTree.selectNode(node);
|
|
gljOprObj.gljCurTypeId = ID;
|
|
gljOprObj.gljCurTypeId = ID;
|
|
//--gljOprObj.filterLibGLJSheetData();
|
|
//--gljOprObj.filterLibGLJSheetData();
|
|
@@ -1649,8 +1660,8 @@ var gljOprObj = {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//初始化分类树
|
|
//初始化分类树
|
|
- //@param {String}type(标准或补充) {Array}treeData(树数据)
|
|
|
|
- initClassTree: function (type, treeData, initSel = false) {
|
|
|
|
|
|
+ //@param {Array}treeData(树数据)
|
|
|
|
+ initClassTree: function (treeData, initSel = false) {
|
|
let me = this;
|
|
let me = this;
|
|
if (me.treeObj) {
|
|
if (me.treeObj) {
|
|
me.treeObj.destroy();
|
|
me.treeObj.destroy();
|
|
@@ -1744,7 +1755,8 @@ $(function () {
|
|
projectGljObject.subList = [];
|
|
projectGljObject.subList = [];
|
|
});
|
|
});
|
|
$('#glj_tree_div').on('shown.bs.modal', function (e) {
|
|
$('#glj_tree_div').on('shown.bs.modal', function (e) {
|
|
- if (gljOprObj.gljLibSpresd == undefined) {
|
|
|
|
|
|
+ gljContextMenu.initGLJSelectView();
|
|
|
|
+/* if (gljOprObj.gljLibSpresd == undefined) {
|
|
gljOprObj.gljLibSpresd = sheetCommonObj.buildSheet($('#gljLibSheet')[0], gljOprObj.gljLibSheetSetting, gljOprObj.stdGLJ.length + gljOprObj.complementaryGLJs.length);
|
|
gljOprObj.gljLibSpresd = sheetCommonObj.buildSheet($('#gljLibSheet')[0], gljOprObj.gljLibSheetSetting, gljOprObj.stdGLJ.length + gljOprObj.complementaryGLJs.length);
|
|
sheetCommonObj.spreadDefaultStyle(gljOprObj.gljLibSpresd);
|
|
sheetCommonObj.spreadDefaultStyle(gljOprObj.gljLibSpresd);
|
|
gljOprObj.gljLibSpresd.bind(GC.Spread.Sheets.Events.ButtonClicked, gljOprObj.onButtonClick);
|
|
gljOprObj.gljLibSpresd.bind(GC.Spread.Sheets.Events.ButtonClicked, gljOprObj.onButtonClick);
|
|
@@ -1785,6 +1797,7 @@ $(function () {
|
|
gljOprObj.initSelection({row: index});
|
|
gljOprObj.initSelection({row: index});
|
|
gljOprObj.gljLibSpresd.focus(true);
|
|
gljOprObj.gljLibSpresd.focus(true);
|
|
} else if (actionType === 'add' || actionType === 'addMix'|| actionType === 'unitPriceAddMix') {
|
|
} else if (actionType === 'add' || actionType === 'addMix'|| actionType === 'unitPriceAddMix') {
|
|
|
|
+ debugger;
|
|
gljOprObj.locateZTree(null);
|
|
gljOprObj.locateZTree(null);
|
|
sheetCommonObj.appendData(gljOprObj.gljLibSheet, 0, 0, gljOprObj.gljLibSheetSetting, gljOprObj.AllRecode);
|
|
sheetCommonObj.appendData(gljOprObj.gljLibSheet, 0, 0, gljOprObj.gljLibSheetSetting, gljOprObj.AllRecode);
|
|
gljOprObj.gljLibSheet.showRow(0, GC.Spread.Sheets.VerticalPosition.top);
|
|
gljOprObj.gljLibSheet.showRow(0, GC.Spread.Sheets.VerticalPosition.top);
|
|
@@ -1792,8 +1805,7 @@ $(function () {
|
|
gljOprObj.initSelection({row: 0});
|
|
gljOprObj.initSelection({row: 0});
|
|
} else {
|
|
} else {
|
|
gljOprObj.showLibGLJSheetData();
|
|
gljOprObj.showLibGLJSheetData();
|
|
- }
|
|
|
|
- console.timeEnd('getGLJData');
|
|
|
|
|
|
+ } */
|
|
});
|
|
});
|
|
|
|
|
|
$('#mreplace_next_div').on('shown.bs.modal', function (e) {
|
|
$('#mreplace_next_div').on('shown.bs.modal', function (e) {
|
|
@@ -1811,6 +1823,14 @@ $(function () {
|
|
}
|
|
}
|
|
gljOprObj.initSelection({row: 0});
|
|
gljOprObj.initSelection({row: 0});
|
|
});
|
|
});
|
|
|
|
+ $('#glj-lib-select').change(function () {
|
|
|
|
+ let getLibFun = null;
|
|
|
|
+ if (typeof unitPriceObj !='undefined') {
|
|
|
|
+ getLibFun = unitPriceObj.getGLJDataPaging;
|
|
|
|
+ }
|
|
|
|
+ const gljLibID = $(this).val();
|
|
|
|
+ getGLJData('change', getLibFun, false, gljLibID);
|
|
|
|
+ })
|
|
// 人材机选择页面搜索框
|
|
// 人材机选择页面搜索框
|
|
$('#gljSearchKeyword').bind('keyup', _.debounce(function() {
|
|
$('#gljSearchKeyword').bind('keyup', _.debounce(function() {
|
|
gljOprObj.loadPageData(gljOprObj.gljLibSheet, true, 0);
|
|
gljOprObj.loadPageData(gljOprObj.gljLibSheet, true, 0);
|