|
@@ -343,7 +343,7 @@ const billsGuidance = (function () {
|
|
|
sheet.setRowHeight(0, 30, GC.Spread.Sheets.SheetArea.colHeader);
|
|
|
sheet.setColumnWidth(0, sheet.getParent() === bills.workBook ? 15 : 25, GC.Spread.Sheets.SheetArea.rowHeader);
|
|
|
if(sheet.getParent() === elfItem.workBook || sheet.getParent() === guideItem.workBook){
|
|
|
- sheet.setRowHeight(0, 25, GC.Spread.Sheets.SheetArea.colHeader);
|
|
|
+ sheet.setRowHeight(0, 20, GC.Spread.Sheets.SheetArea.colHeader);
|
|
|
}
|
|
|
for(let i = 0, len = headers.length; i < len; i++){
|
|
|
sheet.setValue(0, i, headers[i].name, GC.Spread.Sheets.SheetArea.colHeader);
|
|
@@ -372,6 +372,7 @@ const billsGuidance = (function () {
|
|
|
//@param {Object}workBook {Number}workBookWidth {Array}headers @return {void}
|
|
|
function setColumnWidthByRate(workBook, workBookWidth, headers) {
|
|
|
if(workBook){
|
|
|
+ workBookWidth -= 48;
|
|
|
const sheet = workBook.getActiveSheet();
|
|
|
sheet.suspendEvent();
|
|
|
sheet.suspendPaint();
|
|
@@ -379,7 +380,7 @@ const billsGuidance = (function () {
|
|
|
if(headers[col]['rateWidth'] !== undefined && headers[col]['rateWidth'] !== null && headers[col]['rateWidth'] !== ''){
|
|
|
let width = workBookWidth * headers[col]['rateWidth'];
|
|
|
if(headers[col]['dataCode'] === 'options'){
|
|
|
- width = width - 70;
|
|
|
+ width = width;
|
|
|
}
|
|
|
sheet.setColumnWidth(col, width, GC.Spread.Sheets.SheetArea.colHeader)
|
|
|
}
|
|
@@ -452,8 +453,32 @@ const billsGuidance = (function () {
|
|
|
node = node.parent;
|
|
|
}
|
|
|
let recharge = node && node.data.recharge ? node.data.recharge : '无内容';
|
|
|
- $('#billsQuestionContent').html(recharge);
|
|
|
- $('#billsQuestionModal').modal('show');
|
|
|
+ node = bills.tree.items[row];
|
|
|
+ while (node && !node.data.ruleText){
|
|
|
+ node = node.parent;
|
|
|
+ }
|
|
|
+ let ruleText = node && node.data.ruleText ? node.data.ruleText : '无内容';
|
|
|
+
|
|
|
+ $('#questionTab1').text('补注');
|
|
|
+ $('#questionTab2').text('工程量计算规则');
|
|
|
+ $('#questionContent1').html(recharge);
|
|
|
+ $('#questionContent2').html(ruleText);
|
|
|
+ $('#questionModal').modal('show');
|
|
|
+ }
|
|
|
+ //节点链上含有补注或工程量计算规则数据
|
|
|
+ //@param {Number}row(行当前行) @return {Boolean}
|
|
|
+ function hasRechargeRuleText(row) {
|
|
|
+ let node = bills.tree.items[row];
|
|
|
+ if (!node) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ while (node) {
|
|
|
+ if (node.data.recharge || node.data.ruleText) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ node = node.parent;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
}
|
|
|
//初始化并输出树
|
|
|
//@param {Object}module {Object}sheet {Object}treeSetting {Array}datas
|
|
@@ -469,7 +494,7 @@ const billsGuidance = (function () {
|
|
|
setBillsHint(bills.tree.items, stdBillsJobData, stdBillsFeatureData);
|
|
|
renderSheetFunc(sheet, function () {
|
|
|
for(let i = 0; i < bills.tree.items.length; i++){
|
|
|
- sheet.setCellType(i, 1, TREE_SHEET_HELPER.getQuestionCellType(initRechargeModal));
|
|
|
+ sheet.setCellType(i, 1, TREE_SHEET_HELPER.getQuestionCellType(initRechargeModal, hasRechargeRuleText));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -754,8 +779,9 @@ const billsGuidance = (function () {
|
|
|
let height = cellRect.height;
|
|
|
top = top.replace('px', '');
|
|
|
let options = getOptions(node.data, bills.tree.selected.elf.datas);
|
|
|
+ top = options.length - 2 > 4 ? top - 4 * height : top - (options.length - 2) * height - 5;
|
|
|
let $editInput = $(`<div style="height: ${height}px; background: ${cellStyle.backColor};overflow: hidden; white-space: nowrap; text-overflow: ellipsis">${node.data.options}</div>`),
|
|
|
- $optDiv = $(`<div style="position: fixed; width: ${cellRect.width}px; top: ${top - (options.length - 2) * height - 5}px;background: ${cellStyle.backColor};border: 1px solid; overflow: auto; height: ${options.length > 6 ? height*6 : height*options.length+5}px; font-size: 0.9rem;"></div>`);
|
|
|
+ $optDiv = $(`<div style="position: fixed; width: ${cellRect.width}px; top: ${top}px;background: ${cellStyle.backColor};border: 1px solid; overflow: auto; height: ${options.length > 6 ? height*6 : height*options.length+5}px; font-size: 0.9rem;"></div>`);
|
|
|
for(let opt of options){
|
|
|
let $opt = $(`<div title="${opt.name ? opt.name : ''}" class="elf-options" style="height: ${height}px;overflow: hidden; white-space: nowrap; text-overflow: ellipsis"></div>`),
|
|
|
$optInput = $(`<input rank="${opt.rank}" value="${opt.ID}" style="margin-left: 5px; vertical-align: middle" type="checkbox"
|
|
@@ -764,14 +790,14 @@ const billsGuidance = (function () {
|
|
|
$opt.prepend($optInput);
|
|
|
$optDiv.append($opt);
|
|
|
//选项复选框点击监听
|
|
|
- $optInput.click(function () {
|
|
|
+ $opt.click(function () {
|
|
|
//单选
|
|
|
if(billsGuidanceSelMode === 0){
|
|
|
let $allInput = $optDiv.find('input');
|
|
|
for(let input of $allInput){
|
|
|
$(input).prop('checked', false);
|
|
|
}
|
|
|
- $(this).prop('checked', 'checked');
|
|
|
+ $($optInput).prop('checked', 'checked');
|
|
|
elfItem.workBook.getSheet(0).endEdit();
|
|
|
} else {//多选
|
|
|
|