|
@@ -524,9 +524,9 @@ var projectObj = {
|
|
|
let node = project.mainTree.items[info.row];
|
|
|
let fieldName = projectObj.mainController.setting.cols[info.col].data.field;
|
|
|
let value = info.sheet.getValue(info.row, info.col);
|
|
|
- if(fieldName === 'code' && node && calcTools.isRationItem(node) && isDef(node.data.code)){
|
|
|
+ if(fieldName === 'code' && node && calcTools.isRationItem(node) && isDef(node.data.code)&&isDef(value)){
|
|
|
if (isDef(node.data.prefix) && node.data.prefix !== rationPrefix.none){
|
|
|
- value = value.replace(new RegExp(node.data.prefix), '');
|
|
|
+ value = value.replace(new RegExp(node.data.prefix), '');
|
|
|
};
|
|
|
value = value.replace(new RegExp(rationPrefix.replace), '');
|
|
|
info.sheet.setValue(info.row, info.col, value);
|
|
@@ -545,6 +545,22 @@ var projectObj = {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
+ if(fieldName == 'code' && node){
|
|
|
+ projectObj.showBillOrRationLib(node)
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ showBillOrRationLib(node){
|
|
|
+ if(node.sourceType == ModuleNames.bills){//当清单是“分部分项工程”、“措施项目工程”时,要展开清单规则节点
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+ if(node){
|
|
|
+ if(!$("#qd").is(":visible")) $('#stdBillsTab').click();
|
|
|
+ }*/
|
|
|
},
|
|
|
onColumnWidthChanged: function (sender, info) { // CSL,2018.07.25
|
|
|
if (info.colList.includes(4) || info.colList.includes(5)){
|
|
@@ -600,7 +616,7 @@ var projectObj = {
|
|
|
let node = project.mainTree.items[changedCell.row];
|
|
|
let colSetting = setting.cols[changedCell.col];
|
|
|
let value = projectObj.checkSpreadEditingText(changedCell.text, colSetting)
|
|
|
- if(colSetting.data.field=='code' && value != '' && node.sourceType == project.Ration.getSourceType()&&node.data.type==rationType.ration){//如果是更新定额的编码
|
|
|
+ if(colSetting.data.field=='code' && node.sourceType == project.Ration.getSourceType()&&node.data.type==rationType.ration){//如果是更新定额的编码
|
|
|
updateRationCodes.push({'node':node,value:value});
|
|
|
}else {
|
|
|
projectObj.updateCellValue(node, value, colSetting,changedCell.text);
|
|
@@ -617,6 +633,7 @@ var projectObj = {
|
|
|
checkMainSpread: function () {
|
|
|
if (!this.mainSpread) {
|
|
|
this.mainSpread = SheetDataHelper.createNewSpread($('#billsSpread')[0]);
|
|
|
+ sheetCommonObj.spreadDefaultStyle(this.mainSpread);
|
|
|
this.mainSpread.getActiveSheet().selectionPolicy(GC.Spread.Sheets.SelectionPolicy.muliRange);
|
|
|
this.mainSpread.getActiveSheet().name('mainSheet');
|
|
|
this.mainSpread.getActiveSheet().options.isProtected = true;
|
|
@@ -728,7 +745,6 @@ var projectObj = {
|
|
|
that.mainSpread.bind(GC.Spread.Sheets.Events.ButtonClicked, that.onButtonClick);
|
|
|
that.mainSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, that.onCellDoubleClick);
|
|
|
that.mainSpread.bind(GC.Spread.Sheets.Events.ColumnWidthChanged, that.onColumnWidthChanged);
|
|
|
-
|
|
|
//let loadOtherStartTime = +new Date();
|
|
|
if(!projectReadOnly){
|
|
|
that.loadMainSpreadContextMenu();
|
|
@@ -749,6 +765,8 @@ var projectObj = {
|
|
|
if(projectReadOnly){
|
|
|
disableSpread(that.mainSpread);
|
|
|
}
|
|
|
+ let themeName = that.mainSpread.getSheet(0).currentTheme().name();
|
|
|
+ console.log(GC.Spread.Sheets.Themes[themeName]);
|
|
|
$.bootstrapLoading.end();
|
|
|
}
|
|
|
else {
|
|
@@ -876,7 +894,7 @@ var projectObj = {
|
|
|
newCol = codeCol;
|
|
|
}
|
|
|
sheet.setActiveCell(newRow, newCol);
|
|
|
- });
|
|
|
+ }, true);
|
|
|
}
|
|
|
//如果其后有定额空行,焦点跳动至定额空行的编码单元格
|
|
|
else if(nextSibling && !(isDef(nextSibling.data.code) && nextSibling.data.code.toString().trim() !== '')) {
|
|
@@ -1448,7 +1466,6 @@ var projectObj = {
|
|
|
node.changed = true;
|
|
|
projectObj.project.calcProgram.calcAndSave(node);
|
|
|
},
|
|
|
-
|
|
|
//根据节点获取行style(颜色、字体加粗)
|
|
|
getNodeColorStyle: function (sheet, node, tree) {
|
|
|
let colorSetting = optionsOprObj.getOption(optionsOprObj.optionsTypes.COLOROPTS);
|
|
@@ -1541,6 +1558,10 @@ var projectObj = {
|
|
|
if(node === tree.selected){
|
|
|
style.backColor = colorSetting[mapping.SELECTED]['backColor'];
|
|
|
}
|
|
|
+ //大项费用加粗(数字与中文字符大小不一问题由字体造成,暂时不考虑分别设置大小)
|
|
|
+ /* if(node.sourceType === this.project.Bills.getSourceType() && node.data.type === billType.DXFY){
|
|
|
+ style.font = 'bold 0.9rem Arial';
|
|
|
+ }*/
|
|
|
style.borderLeft = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
|
|
|
style.borderTop = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
|
|
|
style.borderRight = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
|
|
@@ -1567,13 +1588,13 @@ var projectObj = {
|
|
|
'programID',
|
|
|
'ruleText'
|
|
|
];
|
|
|
-
|
|
|
- if(stringFields.indexOf(colSetting.data.field) > 0){
|
|
|
- style.font = 'bold 15px Arial';
|
|
|
+ style.font = 'bold 0.9rem Arial';
|
|
|
+ /*if(stringFields.indexOf(colSetting.data.field) > 0){
|
|
|
+ style.font = 'bold 0.9rem Arial';
|
|
|
}
|
|
|
else {
|
|
|
style.font = 'bold 13px Arial';
|
|
|
- }
|
|
|
+ }*/
|
|
|
return style;
|
|
|
},
|
|
|
//设置节点style
|
|
@@ -2281,6 +2302,7 @@ $('#customFile').change(function () {
|
|
|
$('#uploadAlert').hide();
|
|
|
//读取各个表及表名
|
|
|
$.bootstrapLoading.start();
|
|
|
+ $('#loadingPage').css('z-index', '2000');
|
|
|
let fileReader = new FileReader();
|
|
|
fileReader.onload = function(ev) {
|
|
|
try {
|
|
@@ -2336,6 +2358,8 @@ $('#uploadConfirm').click(function () {
|
|
|
let matchBillLibId = projectInfoObj.projectInfo.engineeringInfo.bill_lib.length > 0 ? projectInfoObj.projectInfo.engineeringInfo.bill_lib[0].id : null;
|
|
|
formData.append('billsLibId', matchBillLibId);
|
|
|
let uploadS = +new Date();
|
|
|
+ $.bootstrapLoading.start();
|
|
|
+ $('#loadingPage').css('z-index', '2000');
|
|
|
$.ajax({
|
|
|
url: '/bills/upload',
|
|
|
type: 'POST',
|
|
@@ -2343,9 +2367,6 @@ $('#uploadConfirm').click(function () {
|
|
|
cache: false,
|
|
|
contentType: false,
|
|
|
processData: false,
|
|
|
- beforeSend: function() {
|
|
|
- $.bootstrapLoading.start();
|
|
|
- },
|
|
|
success: function(response){
|
|
|
if (response.err === 0) {
|
|
|
const message = response.msg !== undefined ? response.msg : '';
|
|
@@ -2368,8 +2389,8 @@ $('#uploadConfirm').click(function () {
|
|
|
}
|
|
|
$(me).removeClass('disabled');
|
|
|
},
|
|
|
- error: function(){
|
|
|
- alert("与服务器通信发生错误");
|
|
|
+ error: function(jqXHR){
|
|
|
+ alert(`与服务器通信发生错误${jqXHR.status} ${jqXHR.statusText}`);
|
|
|
$.bootstrapLoading.end();
|
|
|
$(me).removeClass('disabled');
|
|
|
}
|
|
@@ -2595,7 +2616,6 @@ function disableTools(){
|
|
|
function disableSpread(spread){
|
|
|
spread.unbind(GC.Spread.Sheets.Events.ButtonClicked);
|
|
|
let sheetCount = spread.getSheetCount();
|
|
|
- console.log(sheetCount);
|
|
|
for(let i = 0; i < sheetCount; i++){
|
|
|
let sheet = spread.getSheet(i);
|
|
|
sheet.unbind(GC.Spread.Sheets.Events.ButtonClicked);
|
|
@@ -2607,7 +2627,6 @@ function disableSpread(spread){
|
|
|
sheet.unbind(GC.Spread.Sheets.Events.CellDoubleClick);
|
|
|
sheet.unbind(GC.Spread.Sheets.Events.CellClick);
|
|
|
sheet.unbind(GC.Spread.Sheets.Events.ValueChanged);
|
|
|
- console.log(sheet.name());
|
|
|
sheet.suspendPaint();
|
|
|
sheet.suspendEvent();
|
|
|
sheet.options.isProtected = true;
|