|
@@ -2731,23 +2731,12 @@ $(document).ready(function() {
|
|
|
posOperationObj.loadCurPosData();
|
|
|
});
|
|
|
});
|
|
|
+ }
|
|
|
+ const dealBillsPermission = $('[href="#upload-deal"]').length > 0;
|
|
|
+ if (!readOnly || dealBillsPermission) {
|
|
|
this.spread.bind(spreadNS.Events.EditEnded, this.OprObj.editEnded);
|
|
|
this.spread.bind(spreadNS.Events.ClipboardPasting, this.OprObj.clipboardPasting);
|
|
|
SpreadJsObj.addDeleteBind(this.spread, this.OprObj.deletePress);
|
|
|
- }
|
|
|
- $('#upload-deal-bills').click(function () {
|
|
|
- const file = $('#deal-bills-file')[0];
|
|
|
- const formData = new FormData();
|
|
|
- formData.append('file', file.files[0]);
|
|
|
- postDataWithFile(self.url+'/upload-excel', formData, function (data) {
|
|
|
- self.data = data;
|
|
|
- SpreadJsObj.loadSheetData(self.spread.getActiveSheet(), 'data', data);
|
|
|
- $('#upload-deal').modal('hide');
|
|
|
- }, function () {
|
|
|
- $('#upload-deal').modal('hide');
|
|
|
- });
|
|
|
- });
|
|
|
- if (!readOnly) {
|
|
|
$.contextMenu({
|
|
|
selector: selector,
|
|
|
build: function ($trigger, e) {
|
|
@@ -2797,7 +2786,7 @@ $(document).ready(function() {
|
|
|
icon: 'fa-magic',
|
|
|
disabled: function (key, opt) {
|
|
|
const sheet = self.spread.getActiveSheet();
|
|
|
- return sheet.getRowCount() === 0;
|
|
|
+ return sheet.getRowCount() === 0 || readOnly;
|
|
|
},
|
|
|
callback: function (key, opt) {
|
|
|
const datas = [], sourceData = self.spread.getActiveSheet().zh_data;
|
|
@@ -2820,11 +2809,23 @@ $(document).ready(function() {
|
|
|
} else {
|
|
|
toastr.warning('没有可应用的清单。');
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ $('#upload-deal-bills').click(function () {
|
|
|
+ const file = $('#deal-bills-file')[0];
|
|
|
+ const formData = new FormData();
|
|
|
+ formData.append('file', file.files[0]);
|
|
|
+ postDataWithFile(self.url+'/upload-excel', formData, function (data) {
|
|
|
+ self.data = data;
|
|
|
+ SpreadJsObj.loadSheetData(self.spread.getActiveSheet(), 'data', data);
|
|
|
+ $('#upload-deal').modal('hide');
|
|
|
+ }, function () {
|
|
|
+ $('#upload-deal').modal('hide');
|
|
|
+ });
|
|
|
+ });
|
|
|
this.initDealBillsSearch();
|
|
|
}
|
|
|
search(keyword) {
|