|
@@ -3377,17 +3377,17 @@ $(document).ready(function() {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- insertPos: function (sheet) {
|
|
|
|
|
|
|
+ insertPos: function (sheet, count = 1) {
|
|
|
const selection = sheet.getSelections();
|
|
const selection = sheet.getSelections();
|
|
|
const sortData = sheet.zh_data;
|
|
const sortData = sheet.zh_data;
|
|
|
const row = selection[0].row;
|
|
const row = selection[0].row;
|
|
|
const node = SpreadJsObj.getSelectObject(ledgerSpread.getActiveSheet());
|
|
const node = SpreadJsObj.getSelectObject(ledgerSpread.getActiveSheet());
|
|
|
const select = SpreadJsObj.getSelectObject(sheet);
|
|
const select = SpreadJsObj.getSelectObject(sheet);
|
|
|
const porder = select ? select.porder : sortData.length + 1;
|
|
const porder = select ? select.porder : sortData.length + 1;
|
|
|
- const data = {
|
|
|
|
|
- updateType: 'insert',
|
|
|
|
|
- updateData: [ { lid: node.id, tid: tender.id, porder } ],
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ const data = { updateType: 'insert', updateData: [], };
|
|
|
|
|
+ for (let i = 0; i < count; i++) {
|
|
|
|
|
+ data.updateData.push({ lid: node.id, tid: tender.id, porder: porder + i });
|
|
|
|
|
+ }
|
|
|
postData('/tender/' + getTenderId() + '/pos/update', data, function (result) {
|
|
postData('/tender/' + getTenderId() + '/pos/update', data, function (result) {
|
|
|
const updateRst = pos.updateDatas(result.pos);
|
|
const updateRst = pos.updateDatas(result.pos);
|
|
|
posOperationObj.loadCurPosData();
|
|
posOperationObj.loadCurPosData();
|
|
@@ -3664,6 +3664,28 @@ $(document).ready(function() {
|
|
|
return !readOnly;
|
|
return !readOnly;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ 'batchInsert': {
|
|
|
|
|
+ name: '批量插入',
|
|
|
|
|
+ type: 'batchInsert',
|
|
|
|
|
+ value: '2',
|
|
|
|
|
+ icon: 'fa-plus',
|
|
|
|
|
+ disabled: function (key, opt) {
|
|
|
|
|
+ const node = SpreadJsObj.getSelectObject(ledgerSpread.getActiveSheet());
|
|
|
|
|
+ return node && node.children && node.children.length > 0;
|
|
|
|
|
+ },
|
|
|
|
|
+ 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 {
|
|
|
|
|
+ posOperationObj.insertPos(posSheet, parseInt(obj.value));
|
|
|
|
|
+ root.$menu.trigger('contextmenu:hide');
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
'delete': {
|
|
'delete': {
|
|
|
name: '删除',
|
|
name: '删除',
|
|
|
icon: 'fa-remove',
|
|
icon: 'fa-remove',
|