|
@@ -82,6 +82,7 @@ $(document).ready(function() {
|
|
|
const preNode = tree.getPreSiblingNode(node);
|
|
|
const valid = !sheet.zh_setting.readOnly;
|
|
|
|
|
|
+ setObjEnable($('#insert'), valid);
|
|
|
setObjEnable($('#delete'), valid && node);
|
|
|
setObjEnable($('#up-move'), valid && node && preNode);
|
|
|
setObjEnable($('#down-move'), valid && node && !tree.isLastSibling(node));
|
|
@@ -94,6 +95,8 @@ $(document).ready(function() {
|
|
|
setObjEnable($('#up-level'), valid && node && tree.getParent(node));
|
|
|
setObjEnable($('#down-level'), valid && node && preNode);
|
|
|
}
|
|
|
+ setObjEnable($('#cut'), valid);
|
|
|
+ setObjEnable($('#paste'), valid);
|
|
|
},
|
|
|
refreshTree: function (sheet, data) {
|
|
|
SpreadJsObj.massOperationSheet(sheet, function () {
|
|
@@ -511,6 +514,9 @@ $(document).ready(function() {
|
|
|
});
|
|
|
|
|
|
// 绑定 删除等 顶部按钮
|
|
|
+ $('#insert').click(() => {
|
|
|
+ treeOperationObj.addNode(ledgerSpread);
|
|
|
+ });
|
|
|
$('#delete').click(function () {
|
|
|
treeOperationObj.deleteNode(ledgerSpread);
|
|
|
});
|
|
@@ -657,7 +663,11 @@ $(document).ready(function() {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ } else {
|
|
|
+ SpreadJsObj.forbiddenSpreadContextMenu('#ledger-spread', ledgerSpread);
|
|
|
}
|
|
|
+ SpreadJsObj.forbiddenSpreadContextMenu('#pos-spread', posSpread);
|
|
|
+
|
|
|
treeOperationObj.refreshOperationValid(ledgerSpread.getActiveSheet());
|
|
|
|
|
|
const posSearch = (function () {
|
|
@@ -1054,7 +1064,7 @@ $(document).ready(function() {
|
|
|
showSideTools(tab.hasClass('active'));
|
|
|
if (tab.attr('content') === '#std-chapter') {
|
|
|
if (!stdChapter) {
|
|
|
- stdChapter = new stdLib($('#std-chapter-spread')[0], 'chapter', {
|
|
|
+ stdChapter = new stdLib('#std-chapter-spread', 'chapter', {
|
|
|
id: 'chapter_id',
|
|
|
pid: 'pid',
|
|
|
order: 'order',
|
|
@@ -1078,7 +1088,7 @@ $(document).ready(function() {
|
|
|
stdChapter.spread.refresh();
|
|
|
} else if (tab.attr('content') === '#std-bills') {
|
|
|
if (!stdBills) {
|
|
|
- stdBills = new stdLib($('#std-bills-spread')[0], 'bills', {
|
|
|
+ stdBills = new stdLib('#std-bills-spread', 'bills', {
|
|
|
id: 'bill_id',
|
|
|
pid: 'pid',
|
|
|
order: 'order',
|
|
@@ -1102,7 +1112,7 @@ $(document).ready(function() {
|
|
|
stdBills.spread.refresh();
|
|
|
} else if (tab.attr('content') === '#deal-bills') {
|
|
|
if (!dealBills) {
|
|
|
- dealBills = new DealBills($('#deal-bills-spread')[0], {
|
|
|
+ dealBills = new DealBills('#deal-bills-spread', {
|
|
|
cols: [
|
|
|
{title: '清单编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
|
|
|
{title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
|
|
@@ -1150,14 +1160,15 @@ $(document).ready(function() {
|
|
|
});
|
|
|
|
|
|
class stdLib {
|
|
|
- constructor(obj, stdType, treeSetting, spreadSetting) {
|
|
|
- this.obj = obj;
|
|
|
+ constructor(selector, stdType, treeSetting, spreadSetting) {
|
|
|
+ this.obj = $(selector)[0];
|
|
|
this.url = '/std/' + stdType;
|
|
|
this.treeSetting = treeSetting;
|
|
|
treeSetting.preUrl = this.url;
|
|
|
this.spreadSetting = spreadSetting;
|
|
|
this.spread = SpreadJsObj.createNewSpread(this.obj);
|
|
|
SpreadJsObj.initSheet(this.spread.getActiveSheet(), this.spreadSetting);
|
|
|
+ SpreadJsObj.forbiddenSpreadContextMenu(selector, this.spread);
|
|
|
this.spread.getActiveSheet().bind(GC.Spread.Sheets.Events.CellDoubleClick, function (e, info) {
|
|
|
const stdSheet = info.sheet;
|
|
|
const mainSheet = ledgerSpread.getActiveSheet();
|
|
@@ -1191,9 +1202,9 @@ $(document).ready(function() {
|
|
|
}
|
|
|
}
|
|
|
class DealBills {
|
|
|
- constructor (obj, spreadSetting) {
|
|
|
+ constructor (selector, spreadSetting) {
|
|
|
const self = this;
|
|
|
- this.obj = obj;
|
|
|
+ this.obj = $(selector)[0];
|
|
|
this.url = '/tender/' + getTenderId() + '/deal';
|
|
|
this.spreadSetting = spreadSetting;
|
|
|
this.spread = SpreadJsObj.createNewSpread(this.obj);
|
|
@@ -1226,6 +1237,7 @@ $(document).ready(function() {
|
|
|
treeOperationObj.refreshOperationValid(mainSheet);
|
|
|
});
|
|
|
});
|
|
|
+ SpreadJsObj.forbiddenSpreadContextMenu(selector, this.spread);
|
|
|
$('#upload-deal-bills').click(function () {
|
|
|
const file = $('#deal-bills-file')[0];
|
|
|
const formData = new FormData();
|
|
@@ -1429,7 +1441,7 @@ $(document).ready(function() {
|
|
|
this.spreadSetting = spreadSetting;
|
|
|
this.spread = SpreadJsObj.createNewSpread($('#search-result', this.obj)[0]);
|
|
|
SpreadJsObj.initSheet(this.spread.getActiveSheet(), this.spreadSetting);
|
|
|
-
|
|
|
+ SpreadJsObj.forbiddenSpreadContextMenu('#search-result', this.spread);
|
|
|
$('#searchLedger', this.obj).bind('click', function () {
|
|
|
const keyword = $('input', self.obj).val();
|
|
|
this.searchResult = [];
|