|
@@ -584,6 +584,7 @@ var projectObj = {
|
|
|
this.mainSpread = SheetDataHelper.createNewSpread($('#billsSpread')[0]);
|
|
|
this.mainSpread.getActiveSheet().selectionPolicy(GC.Spread.Sheets.SelectionPolicy.muliRange);
|
|
|
this.mainSpread.getActiveSheet().name('mainSheet');
|
|
|
+ this.mainSpread.getActiveSheet().options.isProtected = true;
|
|
|
}
|
|
|
},
|
|
|
refreshMainSpread: function () {
|
|
@@ -600,6 +601,13 @@ var projectObj = {
|
|
|
this.project.loadDatas(function (err) {
|
|
|
let mTime = +new Date();
|
|
|
console.log(`get data时间——${mTime - startTime}`);
|
|
|
+ //快速列设置
|
|
|
+ if(!colSettingObj.getVisible('itemCharacterText') && !colSettingObj.getVisible('jobContentText')){
|
|
|
+ switchTznrHtml(true);
|
|
|
+ }
|
|
|
+ if(colSettingObj.getVisible('itemCharacterText') && colSettingObj.getVisible('jobContentText')){
|
|
|
+ switchTznrHtml(false);
|
|
|
+ }
|
|
|
if (!err) {
|
|
|
that.project.projectGLJ.calcQuantity(true);//计算分部分项和技术措施项目消耗量;
|
|
|
gljCol.initGljCol(that.project.projSetting.glj_col?that.project.projSetting.glj_col.showAdjustPrice:false);
|
|
@@ -683,7 +691,9 @@ var projectObj = {
|
|
|
that.mainSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, that.onCellDoubleClick);
|
|
|
|
|
|
//let loadOtherStartTime = +new Date();
|
|
|
- that.loadMainSpreadContextMenu();
|
|
|
+ if(!projectReadOnly){
|
|
|
+ that.loadMainSpreadContextMenu();
|
|
|
+ }
|
|
|
that.loadFocusLocation();
|
|
|
socketObject.connect();//连接socket服务器
|
|
|
let endTime = +new Date();
|
|
@@ -697,6 +707,9 @@ var projectObj = {
|
|
|
//定位到会话中的选项
|
|
|
let mainTabFocus = sessionStorage.getItem('mainTab') ? sessionStorage.getItem('mainTab') : '#tab_zaojiashu';
|
|
|
$(`${mainTabFocus}`).click();
|
|
|
+ if(projectReadOnly){
|
|
|
+ disableSpread(that.mainSpread);
|
|
|
+ }
|
|
|
$.bootstrapLoading.end();
|
|
|
}
|
|
|
else {
|
|
@@ -932,7 +945,15 @@ var projectObj = {
|
|
|
disabled: function () {
|
|
|
let selection = projectObj.mainSpread.getActiveSheet().getSelections()[0];
|
|
|
let firstNode = projectObj.project.mainTree.items[selection.row];//当多选的情况,用mainTree.selected判断不正确,要用第一个选中的节点
|
|
|
- return BlockController.copyBtnDisable(firstNode);
|
|
|
+ for(let i = 0;i< selection.rowCount;i++){ //多选的时候判断所有与第一个节点同级的节点
|
|
|
+ let temNode = projectObj.project.mainTree.items[selection.row + i];
|
|
|
+ if(firstNode.getParentID() == temNode.getParentID()){
|
|
|
+ if(BlockController.copyBtnDisable(temNode) == true){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
},
|
|
|
callback: function () {
|
|
|
$.bootstrapLoading.start();
|
|
@@ -1501,7 +1522,9 @@ $("a[name='lockBills']").click(function () {//
|
|
|
controller.refreshTreeNode(nodes);
|
|
|
projectObj.mainController.setTreeSelected(selected);//触发树节点选中事件
|
|
|
projectObj.loadLockBillsButton();
|
|
|
- pageCCOprObj.refreshRuleTools(lockBills);
|
|
|
+ if(!projectReadOnly){
|
|
|
+ pageCCOprObj.refreshRuleTools(lockBills);
|
|
|
+ }
|
|
|
});
|
|
|
});
|
|
|
$('#ZLFB_btn').click(function () {
|
|
@@ -1616,6 +1639,9 @@ $('#poj-set').on('show.bs.modal', function () {
|
|
|
setCalcFlag($('#billsPrice'), leafBillGetFeeType.billsPrice, ft);
|
|
|
setCalcFlag($('#zangu_common'), zanguCalcType.common, zg);
|
|
|
setCalcFlag($('#zangu_gatherMaterial'), zanguCalcType.gatherMaterial, zg);
|
|
|
+
|
|
|
+ let showAdjustPrice = projectObj.project.projSetting.glj_col?projectObj.project.projSetting.glj_col.showAdjustPrice:false;
|
|
|
+ showAdjustPrice === true ? $("#tab_poj-settings-6").show():$("#tab_poj-settings-6").hide();
|
|
|
projDisplayView.init();
|
|
|
calcOptions.init();
|
|
|
}
|
|
@@ -2142,4 +2168,96 @@ $(function () {
|
|
|
spread?spread.focus():'';
|
|
|
}
|
|
|
}
|
|
|
-});
|
|
|
+ //项目为只读
|
|
|
+ if(projectReadOnly){
|
|
|
+ disableTools();
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+//项目只读,处理不可操作的工具栏
|
|
|
+function disableTools(){
|
|
|
+ //造价书按钮
|
|
|
+ $('#delete').remove();
|
|
|
+ $('#upLevel').remove();
|
|
|
+ $('#downLevel').remove();
|
|
|
+ $('#upMove').remove();
|
|
|
+ $('#downMove').remove();
|
|
|
+ $('#ZLFB_btn').remove();
|
|
|
+ $('#switchTznr').remove();
|
|
|
+ $('a[name="lockBills"]').remove();
|
|
|
+ //关于计算
|
|
|
+ $('#poj-settings-4').find('input').prop('disabled', 'disabled');
|
|
|
+ //小数位数
|
|
|
+ $('#poj-settings-decimal').find('input').prop('disabled', 'disabled');
|
|
|
+ //人工单价调整
|
|
|
+ $('#std_labour_coe_files').prop('disabled', 'disabled');
|
|
|
+ //呈现选项
|
|
|
+ $('#display-setting').find('input').prop('disabled', 'disabled');
|
|
|
+ //项目属性确定
|
|
|
+ $('#property_ok').addClass('disabled');
|
|
|
+ //特征及内容
|
|
|
+ $('#add-rule').find('select').prop('disabled', 'disabled');
|
|
|
+ $('#use-to-current').addClass('disabled');
|
|
|
+ $('#use-to-all').addClass('disabled');
|
|
|
+ $('.bottom-tools').remove();
|
|
|
+ //导入
|
|
|
+ $('#uploadConfirm').addClass('disabled');
|
|
|
+ //选项
|
|
|
+ $('#generalOpts1').prop('disabled', 'disabled');
|
|
|
+ $('#generalOpts2').prop('disabled', 'disabled');
|
|
|
+ //补充库编辑器
|
|
|
+ $('#compleRationLib').addClass('disabled');
|
|
|
+ $('#compleGljLib').addClass('disabled')
|
|
|
+ //库
|
|
|
+ $('#stdBillsGuidanceTab').addClass('disabled');
|
|
|
+ $('#stdBillsTab').addClass('disabled');
|
|
|
+ $('#stdRationTab').addClass('disabled');
|
|
|
+ //人材机汇总,选择其他、另存使用
|
|
|
+ $('a[data-target="#change-unitFile"]').remove();
|
|
|
+ $('a[data-target="#unitFile-save-as"]').remove();
|
|
|
+ //费率,选择其他、另存使用、重选标准、统一设置相同参数
|
|
|
+ $('a[data-target="#change-lv"]').remove();
|
|
|
+ $('a[data-target="#copy-lv"]').remove();
|
|
|
+ $('#standardSelect').prop('disabled', 'disabled');
|
|
|
+ $('#cascadeSet').prop('disabled', 'disabled');
|
|
|
+ //计算程序标准
|
|
|
+ $('#calcProgramFileSelect').prop('disabled', 'disabled');
|
|
|
+ //调价
|
|
|
+ $('#calcPriceOption').prop('disabled', 'disabled');
|
|
|
+ $('#gljPriceTenderCoe').prop('disabled', 'disabled');
|
|
|
+ $('#tenderGLJQuantity').prop('disabled', 'disabled');
|
|
|
+ $('#tenderRationQuantity').prop('disabled', 'disabled');
|
|
|
+ $('#tenderPrice').prop('disabled', 'disabled');
|
|
|
+ $('#cleanTender').prop('disabled', 'disabled');
|
|
|
+}
|
|
|
+//项目只读,表格只读
|
|
|
+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);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.EditStarting);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.EditEnded);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.RangeChanged);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.ClipboardChanging);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.ClipboardChanged);
|
|
|
+ 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;
|
|
|
+ let rowCount = sheet.getRowCount();
|
|
|
+ let colCount = sheet.getColumnCount();
|
|
|
+ for(let row = 0; row < rowCount; row++){
|
|
|
+ for(let col = 0; col < colCount; col++){
|
|
|
+ sheet.getCell(row, col).locked(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sheet.resumePaint();
|
|
|
+ sheet.resumeEvent();
|
|
|
+ }
|
|
|
+}
|