|
@@ -6,6 +6,7 @@
|
|
|
|
|
|
var rationLibObj = {
|
|
|
searchLimit: 50,
|
|
|
+ searchMode: 0,
|
|
|
libType: {complementary: 0, std: 1},
|
|
|
compleRationLibId: 'compleRationLib',
|
|
|
doAfterGetRationTree: null, //获取章节树回调
|
|
@@ -688,6 +689,7 @@ $('#rationSearchKeyword').keyup(function () {
|
|
|
|
|
|
//变换搜索本定额、全部定额状态
|
|
|
function switchRationSearchMode(mode) {
|
|
|
+ rationLibObj.searchMode = mode;
|
|
|
rationLibObj.resultCache = [];
|
|
|
//搜索本定额
|
|
|
if(mode === 0){
|
|
@@ -802,12 +804,35 @@ function seachRation(){
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
+ const searchCurRationSetting = _.cloneDeep(rationLibObj.sectionRationsSetting);
|
|
|
+ // 搜索全部定额,表格需要多显示一列定额库
|
|
|
+ const searchAllRationSetting = _.cloneDeep(rationLibObj.sectionRationsSetting);
|
|
|
+ searchAllRationSetting.cols.push({
|
|
|
+ "width": 100,
|
|
|
+ "readOnly": true,
|
|
|
+ "showHint": true,
|
|
|
+ "head": {
|
|
|
+ "titleNames": ["定额库"],
|
|
|
+ "spanCols": [1],
|
|
|
+ "spanRows": [1],
|
|
|
+ "vAlign": [1],
|
|
|
+ "hAlign": [1],
|
|
|
+ "font": ["Arial"]
|
|
|
+ },
|
|
|
+ "data": {
|
|
|
+ "field": "rationLibName",
|
|
|
+ "vAlign": 1,
|
|
|
+ "hAlign": 0,
|
|
|
+ "font": "Arial"
|
|
|
+ }
|
|
|
+ });
|
|
|
+ const rationSetting = rationLibObj.searchMode === 0 ? searchCurRationSetting : searchAllRationSetting;
|
|
|
var showResult = function (result) {
|
|
|
if(!rationLibObj.resultSpread){
|
|
|
let resultSpread = SheetDataHelper.createNewSpread($('.main-data-side-search')[0]);
|
|
|
rationLibObj.resultSpread = resultSpread;
|
|
|
bindContextmenuOpr(resultSpread.getActiveSheet());
|
|
|
- SheetDataHelper.loadSheetHeader(rationLibObj.sectionRationsSetting, resultSpread.getActiveSheet());
|
|
|
+ //SheetDataHelper.loadSheetHeader(rationLibObj.sectionRationsSetting, resultSpread.getActiveSheet());
|
|
|
if (!projectReadOnly) {
|
|
|
resultSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, rationLibObj.onRationSpreadCellDoubleClick);
|
|
|
}
|
|
@@ -815,7 +840,8 @@ function seachRation(){
|
|
|
}else {
|
|
|
rationLibObj.resultSpread.refresh();
|
|
|
}
|
|
|
- SheetDataHelper.loadSheetData(rationLibObj.sectionRationsSetting, rationLibObj.resultSpread.getActiveSheet(), result);
|
|
|
+ SheetDataHelper.loadSheetHeader(rationSetting, rationLibObj.resultSpread.getActiveSheet());
|
|
|
+ SheetDataHelper.loadSheetData(rationSetting, rationLibObj.resultSpread.getActiveSheet(), result);
|
|
|
rationLibObj.setTagForHint(rationLibObj.resultSpread.getActiveSheet(), result);
|
|
|
rationLibObj.resultCache = result;
|
|
|
};
|