|
@@ -38,6 +38,7 @@ const billsGuidance = (function () {
|
|
|
cols: [{
|
|
|
width: 140,
|
|
|
readOnly: true,
|
|
|
+ showHint: true,
|
|
|
head: {
|
|
|
titleNames: ["项目编码"],
|
|
|
spanCols: [1],
|
|
@@ -409,7 +410,11 @@ const billsGuidance = (function () {
|
|
|
sheet.suspendPaint();
|
|
|
for(let col = 0; col < headers.length; col++){
|
|
|
if(headers[col]['rateWidth'] !== undefined && headers[col]['rateWidth'] !== null && headers[col]['rateWidth'] !== ''){
|
|
|
- sheet.setColumnWidth(col, workBookWidth * headers[col]['rateWidth'], GC.Spread.Sheets.SheetArea.colHeader)
|
|
|
+ let width = workBookWidth * headers[col]['rateWidth'];
|
|
|
+ if(headers[col]['dataCode'] === 'options'){
|
|
|
+ width = width - 70;
|
|
|
+ }
|
|
|
+ sheet.setColumnWidth(col, width, GC.Spread.Sheets.SheetArea.colHeader)
|
|
|
}
|
|
|
else {
|
|
|
if(headers[col]['headerWidth'] !== undefined && headers[col]['headerWidth'] !== null && headers[col]['headerWidth'] !== ''){
|
|
@@ -449,7 +454,6 @@ const billsGuidance = (function () {
|
|
|
setOptions(module.workBook, options);
|
|
|
buildHeader(module.workBook.getActiveSheet(), module.headers);
|
|
|
if(module === elfItem){
|
|
|
- console.log($('#zy').width());
|
|
|
setColumnWidthByRate(elfItem.workBook, $('#zy').width(), elfItem.headers)
|
|
|
}
|
|
|
bindEvent(module.workBook, module.events);
|
|
@@ -480,6 +484,7 @@ const billsGuidance = (function () {
|
|
|
module.tree.loadDatas(datas);
|
|
|
if(module === bills){
|
|
|
initExpandStat();
|
|
|
+ setBillsHint(bills.tree.items, stdBillsJobData, stdBillsFeatureData);
|
|
|
}
|
|
|
module.controller.showTreeData();
|
|
|
}
|
|
@@ -913,13 +918,16 @@ const billsGuidance = (function () {
|
|
|
return new OptionsCellType();
|
|
|
}
|
|
|
//初始化清单的工作内容和项目特征
|
|
|
- //@param {Number}billsLibId @return {void}
|
|
|
- function initJobAndCharacter(billsLibId){
|
|
|
+ //@param {Number}billsLibId {Function}callback @return {void}
|
|
|
+ function initJobAndCharacter(billsLibId, callback){
|
|
|
CommonAjax.post('/stdBillsEditor/getJobContent', {userId: userID, billsLibId: billsLibId}, function (datas) {
|
|
|
stdBillsJobData = datas;
|
|
|
- });
|
|
|
- CommonAjax.post('/stdBillsEditor/getItemCharacter', {userId: userID, billsLibId: billsLibId}, function (datas) {
|
|
|
- stdBillsFeatureData = datas;
|
|
|
+ CommonAjax.post('/stdBillsEditor/getItemCharacter', {userId: userID, billsLibId: billsLibId}, function (datas) {
|
|
|
+ stdBillsFeatureData = datas;
|
|
|
+ if(callback){
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
//初始化清单展开收起状态
|
|
@@ -945,7 +953,7 @@ const billsGuidance = (function () {
|
|
|
});
|
|
|
}
|
|
|
//根据编码定位至清单精灵库中
|
|
|
- //
|
|
|
+ //@param {String}code @return {void}
|
|
|
function locateAtBills(code) {
|
|
|
let nineCode = code.substring(0, 9);
|
|
|
let items = bills.tree.items;
|
|
@@ -962,6 +970,64 @@ const billsGuidance = (function () {
|
|
|
billsInitSel(locateRow);
|
|
|
sheet.showRow(locateRow, GC.Spread.Sheets.VerticalPosition.center);
|
|
|
}
|
|
|
+ //清单设置悬浮提示信息
|
|
|
+ //@param {Array}billsNodes(清单节点) {Array}jobs(总的工作内容数据) {Array}items(总的项目特征数据)
|
|
|
+ function setBillsHint(billsNodes, jobs, items) {
|
|
|
+ let jobsMapping = {},
|
|
|
+ itemsMapping = {};
|
|
|
+ for(let job of jobs){
|
|
|
+ jobsMapping[job.id] = job;
|
|
|
+ }
|
|
|
+ for(let item of items){
|
|
|
+ itemsMapping[item.id] = item;
|
|
|
+ }
|
|
|
+ for(let billsNode of billsNodes){
|
|
|
+ let hintArr = [];
|
|
|
+ let billsItems = billsNode.data.items;
|
|
|
+ if(billsItems.length > 0){
|
|
|
+ //项目特征
|
|
|
+ hintArr.push('项目特征:');
|
|
|
+ }
|
|
|
+ let itemCount = 1,
|
|
|
+ jobCount = 1;
|
|
|
+ for(let billsItem of billsItems){
|
|
|
+ let itemData = itemsMapping[billsItem.id];
|
|
|
+ if(itemData){
|
|
|
+ //特征值
|
|
|
+ let eigens = [];
|
|
|
+ for(let eigen of itemData.itemValue){
|
|
|
+ eigens.push(eigen.value);
|
|
|
+ }
|
|
|
+ eigens = eigens.join(';');
|
|
|
+ hintArr.push(`${itemCount}.${itemData.content}${eigens === '' ? '' : ': ' + eigens}`);
|
|
|
+ itemCount ++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //工作内容
|
|
|
+ let billsJobs = billsNode.data.jobs;
|
|
|
+ if(billsJobs.length > 0){
|
|
|
+ hintArr.push('工作内容:');
|
|
|
+ }
|
|
|
+ for(let billsJob of billsJobs){
|
|
|
+ let jobData = jobsMapping[billsJob.id];
|
|
|
+ if(jobData){
|
|
|
+ hintArr.push(`${jobCount}.${jobData.content}`);
|
|
|
+ jobCount ++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /*if(billsNode.data.ruleText && billsNode.data.ruleText !== ''){
|
|
|
+ hintArr.push('工程量计算规则:');
|
|
|
+ hintArr.push(billsNode.data.ruleText);
|
|
|
+ }
|
|
|
+ if(billsNode.data.recharge && billsNode.data.recharge !== ''){
|
|
|
+ hintArr.push('补注:');
|
|
|
+ hintArr.push(billsNode.data.recharge);
|
|
|
+ }*/
|
|
|
+ if(hintArr.length > 0){
|
|
|
+ bills.workBook.getActiveSheet().setTag(billsNode.serialNo(), 0, hintArr.join('\n'));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
//初始选择清单指引库
|
|
|
//@param {Number}libID @return {void}
|
|
|
function libInitSel(libID){
|
|
@@ -978,32 +1044,34 @@ const billsGuidance = (function () {
|
|
|
elfItem.workBook = null;
|
|
|
}
|
|
|
initViews();
|
|
|
- //获取清单库中的工作内容和项目特征
|
|
|
- initJobAndCharacter(rstData.guidanceLib.billsLibId);
|
|
|
- initTree(bills, bills.workBook.getActiveSheet(), bills.treeSetting, rstData.bills);
|
|
|
- //清单精灵
|
|
|
- if(rstData.guidanceLib.type && rstData.guidanceLib.type == libType.elf){
|
|
|
- $('#stdBillsGuidanceTab').text('清单精灵');
|
|
|
- //每一个清单节点下挂载一棵清单精灵树
|
|
|
- for(let node of bills.tree.items){
|
|
|
- node.elf = {tree: null, controller: null, datas: []}; //挂载全部数据,数据不一定全成为树节点
|
|
|
+ let callback = function () {
|
|
|
+ initTree(bills, bills.workBook.getActiveSheet(), bills.treeSetting, rstData.bills);
|
|
|
+ //清单精灵
|
|
|
+ if(rstData.guidanceLib.type && rstData.guidanceLib.type == libType.elf){
|
|
|
+ $('#stdBillsGuidanceTab').text('清单精灵');
|
|
|
+ //每一个清单节点下挂载一棵清单精灵树
|
|
|
+ for(let node of bills.tree.items){
|
|
|
+ node.elf = {tree: null, controller: null, datas: []}; //挂载全部数据,数据不一定全成为树节点
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- //清单指引
|
|
|
- else {
|
|
|
- $('#stdBillsGuidanceTab').text('清单指引');
|
|
|
- //每一棵项目指引树挂在清单节点上
|
|
|
- for(let node of bills.tree.items){
|
|
|
- node.guidance = {tree: null, controller: null};
|
|
|
+ //清单指引
|
|
|
+ else {
|
|
|
+ $('#stdBillsGuidanceTab').text('清单指引');
|
|
|
+ //每一棵项目指引树挂在清单节点上
|
|
|
+ for(let node of bills.tree.items){
|
|
|
+ node.guidance = {tree: null, controller: null};
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- setTagForHint(bills.tree.items);
|
|
|
- //默认初始节点
|
|
|
- billsInitSel(0);
|
|
|
- if(doAfterLoadGuidance){
|
|
|
- doAfterLoadGuidance();
|
|
|
- }
|
|
|
- $.bootstrapLoading.end();
|
|
|
+ //setTagForHint(bills.tree.items);
|
|
|
+ //默认初始节点
|
|
|
+ billsInitSel(0);
|
|
|
+ if(doAfterLoadGuidance){
|
|
|
+ doAfterLoadGuidance();
|
|
|
+ }
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ };
|
|
|
+ //获取清单库中的工作内容和项目特征
|
|
|
+ initJobAndCharacter(rstData.guidanceLib.billsLibId, callback);
|
|
|
}, function () {
|
|
|
$.bootstrapLoading.end();
|
|
|
});
|