|
@@ -27,6 +27,7 @@ function getExprInfo (field) {
|
|
|
function transExpr(expr) {
|
|
|
return $.trim(expr).replace('\t', '').replace('=', '').replace('%', '/100');
|
|
|
}
|
|
|
+const copyBlockTag = 'zh.calc.copyBlock';
|
|
|
|
|
|
$(document).ready(() => {
|
|
|
let stdXmj, stdGcl, searchLedger;
|
|
@@ -716,8 +717,8 @@ $(document).ready(() => {
|
|
|
self.refreshTree(sheet, result);
|
|
|
const sel = sheet.getSelections()[0];
|
|
|
if (sel) {
|
|
|
- sheet.setSelection(tree.nodes.indexOf(refreshData.create[0]), sel.col, sel.rowCount, sel.colCount);
|
|
|
- SpreadJsObj.reloadRowsBackColor(sheet, [sel.row, tree.nodes.indexOf(refreshData.create[0])]);
|
|
|
+ sheet.setSelection(tree.nodes.indexOf(result.create[0]), sel.col, sel.rowCount, sel.colCount);
|
|
|
+ SpreadJsObj.reloadRowsBackColor(sheet, [sel.row, tree.nodes.indexOf(result.create[0])]);
|
|
|
}
|
|
|
self.refreshOperationValid(sheet);
|
|
|
removeLocalCache(copyBlockTag);
|
|
@@ -917,192 +918,263 @@ $(document).ready(() => {
|
|
|
});
|
|
|
SpreadJsObj.addDeleteBind(billsSpread, billsTreeSpreadObj.deletePress);
|
|
|
SpreadJsObj.addCutEvents(billsSpread, billsTreeSpreadObj.cut);
|
|
|
- let batchInsertObj;
|
|
|
- $.contextMenu.types.batchInsert = function (item, opt, root) {
|
|
|
- const self = this;
|
|
|
- if ($.isFunction(item.icon)) {
|
|
|
- item._icon = item.icon.call(this, this, $t, key, item);
|
|
|
+ }
|
|
|
+ // 右键菜单
|
|
|
+ let batchInsertObj;
|
|
|
+ $.contextMenu.types.batchInsert = function (item, opt, root) {
|
|
|
+ const self = this;
|
|
|
+ if ($.isFunction(item.icon)) {
|
|
|
+ item._icon = item.icon.call(this, this, $t, key, item);
|
|
|
+ } else {
|
|
|
+ if (typeof(item.icon) === 'string' && item.icon.substring(0, 3) === 'fa-') {
|
|
|
+ // to enable font awesome
|
|
|
+ item._icon = root.classNames.icon + ' ' + root.classNames.icon + '--fa fa ' + item.icon;
|
|
|
} else {
|
|
|
- if (typeof(item.icon) === 'string' && item.icon.substring(0, 3) === 'fa-') {
|
|
|
- // to enable font awesome
|
|
|
- item._icon = root.classNames.icon + ' ' + root.classNames.icon + '--fa fa ' + item.icon;
|
|
|
- } else {
|
|
|
- item._icon = root.classNames.icon + ' ' + root.classNames.icon + '-' + item.icon;
|
|
|
- }
|
|
|
+ item._icon = root.classNames.icon + ' ' + root.classNames.icon + '-' + item.icon;
|
|
|
}
|
|
|
- this.addClass(item._icon);
|
|
|
- const $obj = $('<div>' + item.name + '<input class="text-right ml-1 mr-1" type="tel" max="20" min="1" value="' + item.value + '" style="width: 30px; height: 18px; padding-right: 4px;">行</div>')
|
|
|
- .appendTo(this);
|
|
|
- const $input = $obj.find('input');
|
|
|
-
|
|
|
- const event = () => {
|
|
|
- if (self.hasClass('context-menu-disabled')) return;
|
|
|
- item.batchInsert($input[0], root);
|
|
|
- };
|
|
|
- $obj.on('click', event).keypress(function (e) {if (e.keyCode === 13) { event(); }});
|
|
|
- $input.click((e) => {e.stopPropagation();})
|
|
|
- .keyup((e) => {if (e.keyCode === 13) item.batchInsert($input[0], root);})
|
|
|
- .on('input', function () {this.value = this.value.replace(/[^\d]/g, '');});
|
|
|
+ }
|
|
|
+ this.addClass(item._icon);
|
|
|
+ const $obj = $('<div>' + item.name + '<input class="text-right ml-1 mr-1" type="tel" max="20" min="1" value="' + item.value + '" style="width: 30px; height: 18px; padding-right: 4px;">行</div>')
|
|
|
+ .appendTo(this);
|
|
|
+ const $input = $obj.find('input');
|
|
|
+
|
|
|
+ const event = () => {
|
|
|
+ if (self.hasClass('context-menu-disabled')) return;
|
|
|
+ item.batchInsert($input[0], root);
|
|
|
};
|
|
|
- // 右键菜单
|
|
|
- $.contextMenu({
|
|
|
- selector: '#bills-spread',
|
|
|
- build: function ($trigger, e) {
|
|
|
- const target = SpreadJsObj.safeRightClickSelection($trigger, e, billsSpread);
|
|
|
- return target.hitTestType === spreadNS.SheetArea.viewport || target.hitTestType === spreadNS.SheetArea.rowHeader;
|
|
|
+ $obj.on('click', event).keypress(function (e) {if (e.keyCode === 13) { event(); }});
|
|
|
+ $input.click((e) => {e.stopPropagation();})
|
|
|
+ .keyup((e) => {if (e.keyCode === 13) item.batchInsert($input[0], root);})
|
|
|
+ .on('input', function () {this.value = this.value.replace(/[^\d]/g, '');});
|
|
|
+ };
|
|
|
+ const billsContextMenuOptions = {
|
|
|
+ selector: '#bills-spread',
|
|
|
+ build: function ($trigger, e) {
|
|
|
+ const target = SpreadJsObj.safeRightClickSelection($trigger, e, billsSpread);
|
|
|
+ return target.hitTestType === spreadNS.SheetArea.viewport || target.hitTestType === spreadNS.SheetArea.rowHeader;
|
|
|
+ },
|
|
|
+ items: {}
|
|
|
+ };
|
|
|
+ if (!readOnly) {
|
|
|
+ billsContextMenuOptions.items.create = {
|
|
|
+ name: '新增',
|
|
|
+ icon: 'fa-sign-in',
|
|
|
+ callback: function (key, opt) {
|
|
|
+ billsTreeSpreadObj.baseOpr(billsSheet, 'add');
|
|
|
},
|
|
|
- items: {
|
|
|
- 'create': {
|
|
|
- name: '新增',
|
|
|
- icon: 'fa-sign-in',
|
|
|
- callback: function (key, opt) {
|
|
|
- billsTreeSpreadObj.baseOpr(billsSheet, 'add');
|
|
|
- },
|
|
|
- disabled: function (key, opt) {
|
|
|
- const sheet = billsSheet;
|
|
|
- const selection = sheet.getSelections();
|
|
|
- const sel = selection ? selection[0] : sheet.getSelections()[0];
|
|
|
- const row = sel ? sel.row : -1;
|
|
|
- const tree = sheet.zh_tree;
|
|
|
- if (!tree) return true;
|
|
|
- const first = sheet.zh_tree.nodes[row];
|
|
|
- const valid = !sheet.zh_setting.readOnly;
|
|
|
- return !(valid && first && first.level > 1);
|
|
|
- }
|
|
|
- },
|
|
|
- 'delete': {
|
|
|
- name: '删除',
|
|
|
- icon: 'fa-remove',
|
|
|
- callback: function (key, opt) {
|
|
|
- billsTreeSpreadObj.baseOpr(billsSheet, 'delete');
|
|
|
- },
|
|
|
- disabled: function (key, opt) {
|
|
|
- const sheet = billsSheet;
|
|
|
- const selection = sheet.getSelections();
|
|
|
- const sel = selection ? selection[0] : sheet.getSelections()[0];
|
|
|
- const row = sel ? sel.row : -1;
|
|
|
- const tree = sheet.zh_tree;
|
|
|
- if (!tree) return true;
|
|
|
- const first = sheet.zh_tree.nodes[row];
|
|
|
- let last = first, sameParent = true, nodeUsed = first.used;
|
|
|
- if (sel.rowCount > 1 && first) {
|
|
|
- for (let r = 1; r < sel.rowCount; r++) {
|
|
|
- const rNode = tree.nodes[sel.row + r];
|
|
|
- if (!rNode) {
|
|
|
- sameParent = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- nodeUsed = nodeUsed || rNode.used;
|
|
|
- if (rNode.level > first.level) continue;
|
|
|
- if ((rNode.level < first.level) || (rNode.level === first.level && rNode.pid !== first.pid)) {
|
|
|
- sameParent = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- last = rNode;
|
|
|
- }
|
|
|
+ disabled: function (key, opt) {
|
|
|
+ const sheet = billsSheet;
|
|
|
+ const selection = sheet.getSelections();
|
|
|
+ const sel = selection ? selection[0] : sheet.getSelections()[0];
|
|
|
+ const row = sel ? sel.row : -1;
|
|
|
+ const tree = sheet.zh_tree;
|
|
|
+ if (!tree) return true;
|
|
|
+ const first = sheet.zh_tree.nodes[row];
|
|
|
+ const valid = !sheet.zh_setting.readOnly;
|
|
|
+ return !(valid && first && first.level > 1);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ billsContextMenuOptions.items.delete = {
|
|
|
+ name: '删除',
|
|
|
+ icon: 'fa-remove',
|
|
|
+ callback: function (key, opt) {
|
|
|
+ billsTreeSpreadObj.baseOpr(billsSheet, 'delete');
|
|
|
+ },
|
|
|
+ disabled: function (key, opt) {
|
|
|
+ const sheet = billsSheet;
|
|
|
+ const selection = sheet.getSelections();
|
|
|
+ const sel = selection ? selection[0] : sheet.getSelections()[0];
|
|
|
+ const row = sel ? sel.row : -1;
|
|
|
+ const tree = sheet.zh_tree;
|
|
|
+ if (!tree) return true;
|
|
|
+ const first = sheet.zh_tree.nodes[row];
|
|
|
+ let last = first, sameParent = true, nodeUsed = first.used;
|
|
|
+ if (sel.rowCount > 1 && first) {
|
|
|
+ for (let r = 1; r < sel.rowCount; r++) {
|
|
|
+ const rNode = tree.nodes[sel.row + r];
|
|
|
+ if (!rNode) {
|
|
|
+ sameParent = false;
|
|
|
+ break;
|
|
|
}
|
|
|
- const valid = !sheet.zh_setting.readOnly;
|
|
|
- return !(valid && first && sameParent && !(first.level === 1 && first.node_type) && !nodeUsed);
|
|
|
- }
|
|
|
- },
|
|
|
- 'sprBase': '-----------',
|
|
|
- 'batchInsert': {
|
|
|
- name: '批量插入',
|
|
|
- type: 'batchInsert',
|
|
|
- value: '2',
|
|
|
- icon: 'fa-sign-in',
|
|
|
- batchInsert: function (obj, root) {
|
|
|
- if (_.toNumber(obj.value) > _.toNumber(obj.max)) {
|
|
|
- obj.value = obj.max;
|
|
|
- toastr.warning('批量插入不可多于' + obj.max);
|
|
|
- } else if (_.toNumber(obj.value) < _.toNumber(obj.min)) {
|
|
|
- obj.value = obj.min;
|
|
|
- toastr.warning('批量插入不可少于' + obj.min);
|
|
|
- } else {
|
|
|
- billsTreeSpreadObj.baseOpr(billsSheet, 'add', parseInt(obj.value));
|
|
|
- root.$menu.trigger('contextmenu:hide');
|
|
|
+ nodeUsed = nodeUsed || rNode.used;
|
|
|
+ if (rNode.level > first.level) continue;
|
|
|
+ if ((rNode.level < first.level) || (rNode.level === first.level && rNode.pid !== first.pid)) {
|
|
|
+ sameParent = false;
|
|
|
+ break;
|
|
|
}
|
|
|
- },
|
|
|
- disabled: function (key, opt) {
|
|
|
- const sheet = billsSheet;
|
|
|
- const selection = sheet.getSelections();
|
|
|
- const sel = selection ? selection[0] : sheet.getSelections()[0];
|
|
|
- const row = sel ? sel.row : -1;
|
|
|
- const tree = sheet.zh_tree;
|
|
|
- if (!tree) return true;
|
|
|
- const first = sheet.zh_tree.nodes[row];
|
|
|
- const valid = !sheet.zh_setting.readOnly;
|
|
|
- return !(valid && first && first.level > 1);
|
|
|
+ last = rNode;
|
|
|
}
|
|
|
- },
|
|
|
- 'batchInsertBillsPos': {
|
|
|
- name: '批量插入清单-计量单元',
|
|
|
- icon: 'fa-sign-in',
|
|
|
- disabled: function (key, opt) {
|
|
|
- if (!isTz) return true;
|
|
|
- const select = SpreadJsObj.getSelectObject(billsSheet);
|
|
|
- if (select) {
|
|
|
- if (select.code && select.code !== '') {
|
|
|
- return !billsTree.isLeafXmj(select);
|
|
|
- } else {
|
|
|
- const parent = billsTree.getParent(select);
|
|
|
- return !(parent && billsTree.isLeafXmj(parent));
|
|
|
- }
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- },
|
|
|
- callback: function (key, opt) {
|
|
|
- if (!batchInsertObj) {
|
|
|
- batchInsertObj = new BatchInsertBillsPosObj($('#batch'));
|
|
|
- } else {
|
|
|
- batchInsertObj.initView();
|
|
|
- }
|
|
|
- $('#batch').modal('show');
|
|
|
+ }
|
|
|
+ const valid = !sheet.zh_setting.readOnly;
|
|
|
+ return !(valid && first && sameParent && !(first.level === 1 && first.node_type) && !nodeUsed);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ billsContextMenuOptions.items.sprBase = '-----------';
|
|
|
+ }
|
|
|
+ billsContextMenuOptions.items.copyBlock = {
|
|
|
+ name: '复制整块',
|
|
|
+ icon: 'fa-files-o',
|
|
|
+ callback: function (key, opt) {
|
|
|
+ const copyBlockList = [];
|
|
|
+ const sheet = billsSheet;
|
|
|
+ const sel = sheet.getSelections()[0];
|
|
|
+ let iRow = sel.row;
|
|
|
+ const pid = sheet.zh_tree.nodes[iRow].ledger_pid;
|
|
|
+ while (iRow < sel.row + sel.rowCount) {
|
|
|
+ const node = sheet.zh_tree.nodes[iRow];
|
|
|
+ if (node.ledger_pid !== pid) {
|
|
|
+ toastr.error('仅可同时选中同层节点');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const posterity = sheet.zh_tree.getPosterity(node);
|
|
|
+ iRow += posterity.length + 1;
|
|
|
+ posterity.unshift(node);
|
|
|
+ copyBlockList.push(sheet.zh_tree.getDefaultData(posterity));
|
|
|
+ }
|
|
|
+ const tenderId = _.toInteger(getTenderId());
|
|
|
+ for (const cbl of copyBlockList) {
|
|
|
+ const posRange = pos.getLedgerPos(cbl.id);
|
|
|
+ if (posRange && posRange.length > 0) cbl.pos = posRange;
|
|
|
+ }
|
|
|
+ setLocalCache(copyBlockTag, JSON.stringify({tid: tenderId, block: copyBlockList}));
|
|
|
+ },
|
|
|
+ visible: function (key, opt) {
|
|
|
+ const sheet = billsSheet;
|
|
|
+ const selection = sheet.getSelections();
|
|
|
+ const row = selection[0].row;
|
|
|
+ const select = billsTree.nodes[row];
|
|
|
+ return select;
|
|
|
+ },
|
|
|
+ disabled: function (key, opt) {
|
|
|
+ const sheet = billsSheet;
|
|
|
+ const selection = sheet.getSelections();
|
|
|
+ const row = selection[0].row;
|
|
|
+ const select = billsTree.nodes[row];
|
|
|
+ return select && select.level <= 1;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ if (!readOnly) {
|
|
|
+ billsContextMenuOptions.items.pasteBlock = {
|
|
|
+ name: '粘贴整块',
|
|
|
+ icon: 'fa-clipboard',
|
|
|
+ disabled: function (key, opt) {
|
|
|
+ //const block = treeOperationObj.block || [];
|
|
|
+ const copyInfo = JSON.parse(getLocalCache(copyBlockTag));
|
|
|
+ return !(copyInfo && copyInfo.tid && copyInfo.tid > 0 && copyInfo.block && copyInfo.block.length > 0);
|
|
|
+ },
|
|
|
+ callback: function (key, opt) {
|
|
|
+ //const block = treeOperationObj.block || [];
|
|
|
+ const copyInfo = JSON.parse(getLocalCache(copyBlockTag));
|
|
|
+ if (copyInfo.block.length > 0) {
|
|
|
+ billsTreeSpreadObj.pasteBlock(billsSpread, copyInfo);
|
|
|
+ } else {
|
|
|
+ document.execCommand('paste');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ visible: function (key, opt) {
|
|
|
+ return !readOnly;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ billsContextMenuOptions.items.sprBlock = '-----------';
|
|
|
+ }
|
|
|
+ if (!readOnly) {
|
|
|
+ billsContextMenuOptions.items.batchInsert = {
|
|
|
+ name: '批量插入',
|
|
|
+ type: 'batchInsert',
|
|
|
+ value: '2',
|
|
|
+ icon: 'fa-sign-in',
|
|
|
+ batchInsert: function (obj, root) {
|
|
|
+ if (_.toNumber(obj.value) > _.toNumber(obj.max)) {
|
|
|
+ obj.value = obj.max;
|
|
|
+ toastr.warning('批量插入不可多于' + obj.max);
|
|
|
+ } else if (_.toNumber(obj.value) < _.toNumber(obj.min)) {
|
|
|
+ obj.value = obj.min;
|
|
|
+ toastr.warning('批量插入不可少于' + obj.min);
|
|
|
+ } else {
|
|
|
+ billsTreeSpreadObj.baseOpr(billsSheet, 'add', parseInt(obj.value));
|
|
|
+ root.$menu.trigger('contextmenu:hide');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ disabled: function (key, opt) {
|
|
|
+ const sheet = billsSheet;
|
|
|
+ const selection = sheet.getSelections();
|
|
|
+ const sel = selection ? selection[0] : sheet.getSelections()[0];
|
|
|
+ const row = sel ? sel.row : -1;
|
|
|
+ const tree = sheet.zh_tree;
|
|
|
+ if (!tree) return true;
|
|
|
+ const first = sheet.zh_tree.nodes[row];
|
|
|
+ const valid = !sheet.zh_setting.readOnly;
|
|
|
+ return !(valid && first && first.level > 1);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ billsContextMenuOptions.items.batchInsertBillsPos = {
|
|
|
+ name: '批量插入清单-计量单元',
|
|
|
+ icon: 'fa-sign-in',
|
|
|
+ disabled: function (key, opt) {
|
|
|
+ if (!isTz) return true;
|
|
|
+ const select = SpreadJsObj.getSelectObject(billsSheet);
|
|
|
+ if (select) {
|
|
|
+ if (select.code && select.code !== '') {
|
|
|
+ return !billsTree.isLeafXmj(select);
|
|
|
+ } else {
|
|
|
+ const parent = billsTree.getParent(select);
|
|
|
+ return !(parent && billsTree.isLeafXmj(parent));
|
|
|
}
|
|
|
- },
|
|
|
- 'sprBatch': '-----------',
|
|
|
- 'importGclBills2Xmj': {
|
|
|
- name: '导入工程量清单至项目节',
|
|
|
- icon: 'fa-file-excel-o',
|
|
|
- disabled: function (key, opt) {
|
|
|
- const node = SpreadJsObj.getSelectObject(billsSheet);
|
|
|
- return readOnly
|
|
|
- || (node.children && node.children.length > 0)
|
|
|
- || (!_.isNil(node.b_code) && node.b_code !== '')
|
|
|
- || billsTree.checkNodeUsed(node, pos);
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ callback: function (key, opt) {
|
|
|
+ if (!batchInsertObj) {
|
|
|
+ batchInsertObj = new BatchInsertBillsPosObj($('#batch'));
|
|
|
+ } else {
|
|
|
+ batchInsertObj.initView();
|
|
|
+ }
|
|
|
+ $('#batch').modal('show');
|
|
|
+ }
|
|
|
+ };
|
|
|
+ billsContextMenuOptions.items.sprBatch = '-----------';
|
|
|
+ billsContextMenuOptions.items.importGclBills2Xmj = {
|
|
|
+ name: '导入工程量清单至项目节',
|
|
|
+ icon: 'fa-file-excel-o',
|
|
|
+ disabled: function (key, opt) {
|
|
|
+ const node = SpreadJsObj.getSelectObject(billsSheet);
|
|
|
+ return readOnly
|
|
|
+ || (node.children && node.children.length > 0)
|
|
|
+ || (!_.isNil(node.b_code) && node.b_code !== '')
|
|
|
+ || billsTree.checkNodeUsed(node, pos);
|
|
|
+ },
|
|
|
+ callback: function (key, opt) {
|
|
|
+ const node = SpreadJsObj.getSelectObject(billsSheet);
|
|
|
+ importExcel.doImport({
|
|
|
+ template: {
|
|
|
+ hint: '工程量清单',
|
|
|
+ url: '/template/导入工程量清单EXCEL格式.xls',
|
|
|
},
|
|
|
- callback: function (key, opt) {
|
|
|
- const node = SpreadJsObj.getSelectObject(billsSheet);
|
|
|
- importExcel.doImport({
|
|
|
- template: {
|
|
|
- hint: '工程量清单',
|
|
|
- url: '/template/导入工程量清单EXCEL格式.xls',
|
|
|
- },
|
|
|
- callback: function (sheet) {
|
|
|
- postDataCompress(window.location.pathname + '/upload-excel/gcl2xmj', {id: node.id, sheet: sheet}, function (result) {
|
|
|
- const sel = billsSheet.getSelections();
|
|
|
-
|
|
|
- const refreshNode = billsTree.loadPostData(result);
|
|
|
- billsTreeSpreadObj.refreshTree(billsSheet, refreshNode);
|
|
|
- if (refreshNode.create[0]) {
|
|
|
- if (sel && sel[0]) {
|
|
|
- billsSheet.setSelection(refreshNode.create[0].index, sel[0].col, sel[0].rowCount, sel[0].colCount);
|
|
|
- SpreadJsObj.reloadRowsBackColor(billsSheet, [sel[0].row, refreshNode.create[0].index]);
|
|
|
- } else {
|
|
|
- billsSheet.setSelection(refreshNode.create[0].index, 0, 1, 1);
|
|
|
- SpreadJsObj.reloadRowsBackColor(billsSheet, [refreshNode.create[0].index]);
|
|
|
- }
|
|
|
- }
|
|
|
- billsTreeSpreadObj.refreshOperationValid(billsSheet);
|
|
|
- }, null);
|
|
|
+ callback: function (sheet) {
|
|
|
+ postDataCompress(window.location.pathname + '/upload-excel/gcl2xmj', {id: node.id, sheet: sheet}, function (result) {
|
|
|
+ const sel = billsSheet.getSelections();
|
|
|
+
|
|
|
+ const refreshNode = billsTree.loadPostData(result);
|
|
|
+ billsTreeSpreadObj.refreshTree(billsSheet, refreshNode);
|
|
|
+ if (refreshNode.create[0]) {
|
|
|
+ if (sel && sel[0]) {
|
|
|
+ billsSheet.setSelection(refreshNode.create[0].index, sel[0].col, sel[0].rowCount, sel[0].colCount);
|
|
|
+ SpreadJsObj.reloadRowsBackColor(billsSheet, [sel[0].row, refreshNode.create[0].index]);
|
|
|
+ } else {
|
|
|
+ billsSheet.setSelection(refreshNode.create[0].index, 0, 1, 1);
|
|
|
+ SpreadJsObj.reloadRowsBackColor(billsSheet, [refreshNode.create[0].index]);
|
|
|
+ }
|
|
|
}
|
|
|
- });
|
|
|
+ billsTreeSpreadObj.refreshOperationValid(billsSheet);
|
|
|
+ }, null);
|
|
|
}
|
|
|
- },
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
+ };
|
|
|
}
|
|
|
+ $.contextMenu(billsContextMenuOptions);
|
|
|
+
|
|
|
// 计量单元 相关方法&绑定spreadjs事件
|
|
|
const posSpreadObj = {
|
|
|
refreshOperationValid: function (sheet, selection) {
|
|
@@ -1951,6 +2023,7 @@ $(document).ready(() => {
|
|
|
|
|
|
$('#batch-ok').click(function () {
|
|
|
const selection = billsSheet.getSelections();
|
|
|
+ const sel = selection[0];
|
|
|
const row = selection[0].row;
|
|
|
const select = billsTree.nodes[row];
|
|
|
if (select) {
|
|
@@ -1967,6 +2040,8 @@ $(document).ready(() => {
|
|
|
pos.updateDatas(data.pos);
|
|
|
const result = billsTree.loadPostData(data.ledger);
|
|
|
billsTreeSpreadObj.refreshTree(billsSheet, result);
|
|
|
+ billsSheet.setSelection(result.create[0].index, sel.col, sel.rowCount, sel.colCount);
|
|
|
+ SpreadJsObj.reloadRowsBackColor(billsSheet, [sel.row, result.create[0].index]);
|
|
|
billsTreeSpreadObj.refreshOperationValid(billsSheet, selection);
|
|
|
posSpreadObj.loadCurPosData();
|
|
|
self.obj.modal('hide');
|