|
@@ -500,7 +500,45 @@ $(document).ready(function() {
|
|
|
},
|
|
|
topRowChanged(e, info) {
|
|
|
SpreadJsObj.saveTopAndSelect(info.sheet, ckBillsSpread);
|
|
|
- }
|
|
|
+ },
|
|
|
+ cut: function (sheet, sel, callback) {
|
|
|
+ if (!sheet || !sel) return;
|
|
|
+
|
|
|
+ const sortData = SpreadJsObj.getSortData(sheet), datas = [];
|
|
|
+ for (let iRow = sel.row; iRow < sel.row + sel.rowCount; iRow++) {
|
|
|
+ const node = sortData[iRow];
|
|
|
+ if (node) {
|
|
|
+ const data = sheet.zh_tree.getNodeKeyData(node);
|
|
|
+ for (let iCol = sel.col; iCol < sel.col + sel.colCount; iCol++) {
|
|
|
+ const col = sheet.zh_setting.cols[iCol];
|
|
|
+ if (col.field === 'b_code' || col.field === 'sgfh_qty' || col.field === 'sgfh_tp' ||
|
|
|
+ col.field === 'sjcl_qty' || col.field === 'sjcl_tp' ||
|
|
|
+ col.field === 'qtcl_qty' || col.field === 'qtcl_tp') {
|
|
|
+ const lPos = pos.getLedgerPos(node.id);
|
|
|
+ if (lPos && lPos.length > 0) {
|
|
|
+ toast('不可剪切', 'warning');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const style = sheet.getStyle(iRow, iCol);
|
|
|
+ if (style.locked) {
|
|
|
+ toast('不可剪切', 'warning');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const colSetting = sheet.zh_setting.cols[iCol];
|
|
|
+ data[colSetting.field] = null;
|
|
|
+ }
|
|
|
+ datas.push(data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (datas.length > 0) {
|
|
|
+ sheet.zh_tree.update('/tender/' + getTenderId() + '/ledger/update', datas, function (result) {
|
|
|
+ callback();
|
|
|
+ treeOperationObj.refreshTree(sheet, result);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
};
|
|
|
// 绑定事件
|
|
|
ledgerSpread.bind(GC.Spread.Sheets.Events.SelectionChanged, treeOperationObj.selectionChanged);
|
|
@@ -513,7 +551,6 @@ $(document).ready(function() {
|
|
|
ledgerSpread.bind(GC.Spread.Sheets.Events.ClipboardPasted, treeOperationObj.clipboardPasted);
|
|
|
SpreadJsObj.addDeleteBind(ledgerSpread, treeOperationObj.deletePress);
|
|
|
ledgerSpread.bind(GC.Spread.Sheets.Events.ClipboardChanging, function (e, info) {
|
|
|
- console.log(info);
|
|
|
const copyText = SpreadJsObj.getFilterCopyText(info.sheet);
|
|
|
});
|
|
|
ledgerSpread.bind(GC.Spread.Sheets.Events.ClipboardChanged, function (e, info) {
|
|
@@ -521,6 +558,7 @@ $(document).ready(function() {
|
|
|
});
|
|
|
ledgerSpread.bind(GC.Spread.Sheets.Events.ClipboardPasting, function (e, info) {
|
|
|
});
|
|
|
+ SpreadJsObj.addCutEvents(ledgerSpread, treeOperationObj.cut);
|
|
|
|
|
|
// 绑定 删除等 顶部按钮
|
|
|
$('#insert').click(() => {
|