|
@@ -15,6 +15,10 @@ const billsGuidance = (function () {
|
|
|
|
|
|
//自执行函数全局变量定义
|
|
|
const libID = getQueryString('libID');
|
|
|
+ //总工作内容数据
|
|
|
+ let stdBillsJobData = [];
|
|
|
+ //总项目特征数据
|
|
|
+ let stdBillsFeatureData = [];
|
|
|
const bills = {
|
|
|
dom: $('#billsSpread'),
|
|
|
workBook: null,
|
|
@@ -30,6 +34,7 @@ const billsGuidance = (function () {
|
|
|
cols: [{
|
|
|
width: 200,
|
|
|
readOnly: true,
|
|
|
+ showHint: true,
|
|
|
head: {
|
|
|
titleNames: ["项目编码"],
|
|
|
spanCols: [1],
|
|
@@ -273,6 +278,7 @@ const billsGuidance = (function () {
|
|
|
module.workBook = new GC.Spread.Sheets.Workbook(module.dom[0], {sheetCount: 1});
|
|
|
let sheet = module.workBook.getActiveSheet();
|
|
|
if(module === bills){
|
|
|
+ sheet.name('stdBillsGuidance_bills');
|
|
|
//默认初始可控制焦点在清单表中
|
|
|
module.workBook.focus();
|
|
|
sheet.options.isProtected = true;
|
|
@@ -508,7 +514,7 @@ const billsGuidance = (function () {
|
|
|
if (setting.pos && text && text !== '') {
|
|
|
//固定不显示的div,存储文本获取固定div宽度,toolTipElement由于显示和隐藏,获取宽度不正确
|
|
|
if(!this._fixedTipElement){
|
|
|
- let div = $('#fixedTip')[0];
|
|
|
+ let div = $('#fixedTip1')[0];
|
|
|
if (!div) {
|
|
|
div = document.createElement("div");
|
|
|
$(div).css("padding", 5)
|
|
@@ -521,7 +527,7 @@ const billsGuidance = (function () {
|
|
|
$(this._fixedTipElement).width('');
|
|
|
$(this._fixedTipElement).html(text);
|
|
|
if (!this._toolTipElement) {
|
|
|
- let div = $('#autoTip')[0];
|
|
|
+ let div = $('#autoTip1')[0];
|
|
|
if (!div) {
|
|
|
div = document.createElement("div");
|
|
|
$(div).css("position", "absolute")
|
|
@@ -530,7 +536,7 @@ const billsGuidance = (function () {
|
|
|
.css("font", "0.9rem Calibri")
|
|
|
.css("background", "white")
|
|
|
.css("padding", 5)
|
|
|
- .attr("id", 'autoTip');
|
|
|
+ .attr("id", 'autoTip1');
|
|
|
$(div).hide();
|
|
|
document.body.insertBefore(div, null);
|
|
|
}
|
|
@@ -679,6 +685,84 @@ const billsGuidance = (function () {
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
+ //清单设置悬浮提示信息
|
|
|
+ //@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;
|
|
|
+ }
|
|
|
+ let tagInfo = [];
|
|
|
+ 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){
|
|
|
+ tagInfo.push({row: billsNode.serialNo(), value: hintArr.join('\n')});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let sheet = bills.workBook.getActiveSheet();
|
|
|
+ renderSheetFunc(sheet, function () {
|
|
|
+ for(let tagI of tagInfo){
|
|
|
+ sheet.setTag(tagI.row, 0, tagI.value);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //初始化清单的工作内容和项目特征
|
|
|
+ //@param {Number}billsLibId {Function}callback @return {void}
|
|
|
+ function initJobAndCharacter(billsLibId, callback){
|
|
|
+ CommonAjax.post('/stdBillsEditor/getJobContent', {billsLibId: billsLibId}, function (datas) {
|
|
|
+ stdBillsJobData = datas;
|
|
|
+ CommonAjax.post('/stdBillsEditor/getItemCharacter', {billsLibId: billsLibId}, function (datas) {
|
|
|
+ stdBillsFeatureData = datas;
|
|
|
+ if(callback){
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
//获取指引库信息及关联的清单
|
|
|
//@param {Number}libID {Function}callback @return {Object}
|
|
|
function getLibWithBills(libID, callback){
|
|
@@ -686,7 +770,7 @@ const billsGuidance = (function () {
|
|
|
initRationLibs(rstData.guidanceLib.compilationId);
|
|
|
bills.cache = rstData.bills;
|
|
|
initLibName(rstData.guidanceLib.name);
|
|
|
- initTree(bills, bills.workBook.getActiveSheet(), bills.treeSetting, bills.cache);
|
|
|
+ /*initTree(bills, bills.workBook.getActiveSheet(), bills.treeSetting, bills.cache);
|
|
|
//每一棵项目指引树挂在清单节点上
|
|
|
for(let node of bills.tree.items){
|
|
|
node.guidance = {tree: null, controller: null};
|
|
@@ -695,7 +779,20 @@ const billsGuidance = (function () {
|
|
|
billsInitSel(0);
|
|
|
if(callback){
|
|
|
callback(rstData);
|
|
|
- }
|
|
|
+ }*/
|
|
|
+ let initDataCallback = function () {
|
|
|
+ initTree(bills, bills.workBook.getActiveSheet(), bills.treeSetting, bills.cache);
|
|
|
+ //每一棵项目指引树挂在清单节点上
|
|
|
+ for(let node of bills.tree.items){
|
|
|
+ node.guidance = {tree: null, controller: null};
|
|
|
+ }
|
|
|
+ //默认初始节点
|
|
|
+ billsInitSel(0);
|
|
|
+ if(callback){
|
|
|
+ callback(rstData);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ initJobAndCharacter(rstData.guidanceLib.billsLibId, initDataCallback);
|
|
|
}, function (msg) {
|
|
|
window.location.href = '/billsGuidance/main';
|
|
|
});
|
|
@@ -707,6 +804,9 @@ const billsGuidance = (function () {
|
|
|
module.controller = TREE_SHEET_CONTROLLER.createNew(module.tree, sheet, treeSetting);
|
|
|
module.tree.loadDatas(datas);
|
|
|
module.controller.showTreeData();
|
|
|
+ if(module === bills){
|
|
|
+ setBillsHint(bills.tree.items, stdBillsJobData, stdBillsFeatureData);
|
|
|
+ }
|
|
|
}
|
|
|
//更新项目指引
|
|
|
//@param {Array}updateDatas {Function}callback @return {void}
|