|
@@ -42,7 +42,7 @@ var projectObj = {
|
|
|
};
|
|
|
let selected = tree.selected, that = projectObj;
|
|
|
let canUpLevel = function (node) {
|
|
|
- if (selected && selected.depth() > 0 && selected.canUpLevel()) {
|
|
|
+ if (selected && selected.depth() > 1 && selected.canUpLevel()) {
|
|
|
if (selected.sourceType === that.project.Bills.getSourceType()) {
|
|
|
return (!selected.nextSibling) || (selected.children.length === 0) || (selected.source.children.length > 0);
|
|
|
} else {
|
|
@@ -251,7 +251,7 @@ var projectObj = {
|
|
|
};*/
|
|
|
}
|
|
|
},
|
|
|
- updateCellValue: function (node, value, colSetting) {
|
|
|
+ updateCellValue: function (node, value, colSetting,editingText) {
|
|
|
let project = projectObj.project, fieldName = colSetting.data.field;
|
|
|
if(node.sourceType==project.ration_glj.getSourceType()){
|
|
|
project.ration_glj.updateFromMainSpread(value,node,fieldName);
|
|
@@ -269,7 +269,7 @@ var projectObj = {
|
|
|
else if (fieldName === 'quantity' || fieldName === 'marketUnitFee' || fieldName === 'programID' ||
|
|
|
fieldName === 'subType' || fieldName === 'calcBase' || fieldName === 'feesIndex.common.unitFee'){
|
|
|
if (fieldName === 'quantity') {
|
|
|
- project.quantity_detail.editMainTreeNodeQuantity(value,node,fieldName);
|
|
|
+ project.quantity_detail.editMainTreeNodeQuantity(value,node,fieldName,editingText);
|
|
|
return;
|
|
|
}
|
|
|
else if (fieldName === 'marketUnitFee' || fieldName === 'feesIndex.common.unitFee') {
|
|
@@ -352,7 +352,7 @@ var projectObj = {
|
|
|
let fieldName = projectObj.mainController.setting.cols[info.col].data.field;
|
|
|
// 检查输入类型等
|
|
|
let value = projectObj.checkSpreadEditingText(info.editingText, colSetting);
|
|
|
- projectObj.updateCellValue(node, value, colSetting);
|
|
|
+ projectObj.updateCellValue(node, value, colSetting,info.editingText);
|
|
|
|
|
|
// 自动行高
|
|
|
const autoHeight = project.property.displaySetting.autoHeight;
|
|
@@ -469,7 +469,6 @@ var projectObj = {
|
|
|
that.mainSpread.bind(GC.Spread.Sheets.Events.SelectionChanged, that.amountAreaNumber);
|
|
|
that.loadMainSpreadContextMenu();
|
|
|
that.loadFocusLocation();
|
|
|
- that.setRootsStyle();
|
|
|
let endTime = +new Date();
|
|
|
console.log("加载完成-----"+endTime);
|
|
|
}
|
|
@@ -803,29 +802,15 @@ var projectObj = {
|
|
|
}, 200);
|
|
|
};
|
|
|
},
|
|
|
- setRootsStyle: function () {
|
|
|
- let me = this;
|
|
|
- let style = new GC.Spread.Sheets.Style();
|
|
|
- // style.backColor = "#d5e8ee";
|
|
|
- style.font = 'bold 15px Arial';
|
|
|
- let count = me.project.mainTree.items.length;
|
|
|
- for (var i = 0; i < count; i++) {
|
|
|
- if (!me.project.mainTree.items[i].parent)
|
|
|
- me.mainSpread.getActiveSheet().setStyle(i, -1, style, GC.Spread.Sheets.SheetArea.viewport);
|
|
|
- }
|
|
|
-},
|
|
|
+
|
|
|
//根据节点获取行style(颜色、字体加粗)
|
|
|
getNodeColorStyle: function (node) {
|
|
|
- let type, backColor = null, font = null;
|
|
|
+ let type, backColor = null, foreColor = null;
|
|
|
if(!isDef(node)){
|
|
|
return null;
|
|
|
}
|
|
|
//清单大类
|
|
|
if(node.sourceType === this.project.Bills.getSourceType()){
|
|
|
- //大项费用
|
|
|
- if(node.data.type === billType.DXFY){
|
|
|
- type = 0;
|
|
|
- }
|
|
|
//分部
|
|
|
if(node.data.type === billType.FB){
|
|
|
type = 1;
|
|
@@ -855,18 +840,18 @@ var projectObj = {
|
|
|
type = 4;
|
|
|
}
|
|
|
switch (type){
|
|
|
- case 0: font = 'bold 15px "Arial"'; break;
|
|
|
+ //case 0: font = 'bold 13px "Arial"'; break;
|
|
|
case 1: backColor = '#c1d3e3'; break;
|
|
|
case 2: backColor = '#dae5ee'; break;
|
|
|
case 3: backColor = '#e5f3f2'; break;
|
|
|
- case 4: backColor = '#4DBCFB'; break;
|
|
|
+ case 4: foreColor = '#4D7BFF'; break;
|
|
|
}
|
|
|
- if(!font && !backColor){
|
|
|
+ if(!backColor && !foreColor){
|
|
|
return null;
|
|
|
}
|
|
|
let style = new GC.Spread.Sheets.Style();
|
|
|
- if(font){
|
|
|
- style.font = 'bold 15px "Arial"';
|
|
|
+ if(foreColor){
|
|
|
+ style.foreColor = foreColor;
|
|
|
}
|
|
|
if(backColor){
|
|
|
style.backColor = backColor;
|
|
@@ -875,8 +860,35 @@ var projectObj = {
|
|
|
style.borderRight = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
|
|
|
style.borderBottom = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
|
|
|
}
|
|
|
- return style;
|
|
|
-}
|
|
|
+ return style;
|
|
|
+ },
|
|
|
+ //大项费用则字体加粗,String 15px, Number 13px
|
|
|
+ getBoldFontStyle: function (node, colSetting) {
|
|
|
+ if(node.sourceType !== this.project.Bills.getSourceType() || node.data.type !== billType.DXFY){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ let style = new GC.Spread.Sheets.Style();
|
|
|
+ //备注暂无字段
|
|
|
+ let stringFields = [
|
|
|
+ 'code',
|
|
|
+ 'subType',
|
|
|
+ 'name',
|
|
|
+ 'unit',
|
|
|
+ 'itemCharacterText',
|
|
|
+ 'jobContentText',
|
|
|
+ 'adjustState',
|
|
|
+ 'calcBase',
|
|
|
+ 'programID',
|
|
|
+ 'ruleText'
|
|
|
+ ];
|
|
|
+ if(stringFields.indexOf(colSetting.data.field) > 0){
|
|
|
+ style.font = 'bold 15px Arial';
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ style.font = 'bold 13px Arial';
|
|
|
+ }
|
|
|
+ return style;
|
|
|
+ }
|
|
|
};
|
|
|
// 点击合计框中的复制
|
|
|
$("body").on("click", "#total-tips a", function() {
|