|
|
@@ -11,6 +11,7 @@ const billsGuidance = (function () {
|
|
|
function _isDef(v) {
|
|
|
return typeof v !== 'undefined' && v !== null;
|
|
|
}
|
|
|
+ const locked = lockUtil.getLocked();
|
|
|
let moduleName = 'stdBillsGuidance';
|
|
|
//上下拖动的拖动条高度
|
|
|
const verticalResize = 10;
|
|
|
@@ -111,7 +112,7 @@ const billsGuidance = (function () {
|
|
|
defaultRowHeight: 21,
|
|
|
cols: [{
|
|
|
width: 400,
|
|
|
- readOnly: false,
|
|
|
+ readOnly: locked,
|
|
|
head: {
|
|
|
titleNames: ["项目指引"],
|
|
|
spanCols: [1],
|
|
|
@@ -293,7 +294,7 @@ const billsGuidance = (function () {
|
|
|
}
|
|
|
else if(module === ration){
|
|
|
sheet.options.isProtected = true;
|
|
|
- sheet.getRange(-1, 0, -1, 1).locked(false);
|
|
|
+ sheet.getRange(-1, 0, -1, 1).locked(locked);
|
|
|
sheet.getRange(-1, 1, -1, -1).locked(true);
|
|
|
}
|
|
|
else if(module === guideItem){
|
|
|
@@ -303,6 +304,7 @@ const billsGuidance = (function () {
|
|
|
buildHeader(module.workBook.getActiveSheet(), module.headers);
|
|
|
bindEvent(module.workBook, module.events);
|
|
|
}
|
|
|
+ lockUtil.lockSpreads([module.workBook], locked);
|
|
|
}
|
|
|
//清空表数据
|
|
|
//@param {Object}sheet {Array}headers {Number}rowCount @return {void}
|
|
|
@@ -440,6 +442,9 @@ const billsGuidance = (function () {
|
|
|
//刷新按钮有效性
|
|
|
//@param {Object}node @return {void}
|
|
|
function refreshBtn(node){
|
|
|
+ if (locked) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
//全部设为无效
|
|
|
$('.tools-btn').children().addClass('disabled');
|
|
|
$('#insertRation').addClass('disabled');
|
|
|
@@ -1378,7 +1383,7 @@ const billsGuidance = (function () {
|
|
|
"copy": {
|
|
|
name: "复制整块",
|
|
|
disabled: function () {
|
|
|
- return !canCopyBlock(blockNodes);
|
|
|
+ return locked || !canCopyBlock(blockNodes);
|
|
|
},
|
|
|
icon: "fa-copy",
|
|
|
callback: function (key, opt) {
|
|
|
@@ -1388,7 +1393,7 @@ const billsGuidance = (function () {
|
|
|
name: "粘贴整块",
|
|
|
disabled: function () {
|
|
|
let pasteNode = bills.tree.selected.guidance.tree.items[target.row];
|
|
|
- return !canPasteBlock(pasteNode);
|
|
|
+ return locked || !canPasteBlock(pasteNode);
|
|
|
},
|
|
|
icon: "fa-paste",
|
|
|
callback: function (key, opt) {
|
|
|
@@ -1399,7 +1404,7 @@ const billsGuidance = (function () {
|
|
|
name: '删除',
|
|
|
disabled: function () {
|
|
|
let node = bills.tree.selected.guidance.tree.items[target.row];
|
|
|
- return !node
|
|
|
+ return locked || !node
|
|
|
},
|
|
|
icon: "fa-arrow-left",
|
|
|
callback: function (key, opt) {
|
|
|
@@ -1410,7 +1415,7 @@ const billsGuidance = (function () {
|
|
|
name: '插入行',
|
|
|
disabled: function () {
|
|
|
let node = bills.tree.selected.guidance.tree.items[target.row];
|
|
|
- return !node || node.data.type !== itemType.job;
|
|
|
+ return locked || !node || node.data.type !== itemType.job;
|
|
|
},
|
|
|
icon: "fa-arrow-left",
|
|
|
callback: function (key, opt) {
|
|
|
@@ -1421,7 +1426,7 @@ const billsGuidance = (function () {
|
|
|
name: '插入子项',
|
|
|
disabled: function () {
|
|
|
let node = bills.tree.selected.guidance.tree.items[target.row];
|
|
|
- return !node || node.data.type !== itemType.job || !allJobChildren(node);
|
|
|
+ return locked || !node || node.data.type !== itemType.job || !allJobChildren(node);
|
|
|
},
|
|
|
icon: 'fa-arrow-left',
|
|
|
callback: function (key, opt) {
|
|
|
@@ -1690,6 +1695,7 @@ const billsGuidance = (function () {
|
|
|
function initViews(){
|
|
|
let modules = [bills, guideItem, section, ration];
|
|
|
initWorkBooks(modules);
|
|
|
+ lockUtil.lockTools($(document.body), locked);
|
|
|
getLibWithBills(libID);
|
|
|
initBtn();
|
|
|
initContextMenu();
|