|
@@ -232,8 +232,9 @@ $(document).ready(() => {
|
|
|
postData(window.location.pathname + '/save', {type: 'add'}, function (result) {
|
|
|
if (result) {
|
|
|
materialBillsData.push(result);
|
|
|
- sheet.addRows(materialBillsData.length - 1, 1);
|
|
|
- SpreadJsObj.reLoadRowData(sheet, materialBillsData.length - 1);
|
|
|
+ // sheet.addRows(materialBillsData.length - 1, 1);
|
|
|
+ // SpreadJsObj.reLoadRowData(sheet, materialBillsData.length - 1);
|
|
|
+ SpreadJsObj.loadSheetData(materialSpread.getActiveSheet(), SpreadJsObj.DataType.Data, materialBillsData);
|
|
|
sheet.setSelection(materialBillsData.length - 1, 0, 1, 1);
|
|
|
materialSpreadObj.refreshActn();
|
|
|
// 月信息价需要同时添加空白的list
|
|
@@ -710,6 +711,35 @@ $(document).ready(() => {
|
|
|
}
|
|
|
},
|
|
|
deletePress: function (sheet) {
|
|
|
+ // if (sheet.zh_setting && sheet.zh_data) {
|
|
|
+ // const sel = sheet.getSelections()[0];
|
|
|
+ // if (!sel) return;
|
|
|
+ //
|
|
|
+ // const col = sheet.zh_setting.cols[sel.col];
|
|
|
+ // const select = SpreadJsObj.getSelectObject(sheet);
|
|
|
+ // const orgValue = select[col.field];
|
|
|
+ // if (sel.colCount > 1 || sel.rowCount > 1) {
|
|
|
+ // toastr.warning('请勿同时删除多行或多列数据');
|
|
|
+ // }
|
|
|
+ // console.log(sel, select, col);
|
|
|
+ // if (orgValue === null || col.field === 'type' || col.field === 'is_summary') {
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // select[col.field] = null;
|
|
|
+ // select.calc_num = materialExponentCol.getValue.calc_num(select);
|
|
|
+ // console.log(select);
|
|
|
+ // 更新至服务器
|
|
|
+ // postData(window.location.pathname + '/save', { type:'update', updateData: select }, function (result) {
|
|
|
+ // ex_tp = result.ex_tp;
|
|
|
+ // ex_expr = result.ex_expr;
|
|
|
+ // resetExTpTable();
|
|
|
+ // SpreadJsObj.reLoadRowData(sheet, sel.row);
|
|
|
+ // materialExponentData.splice(sel.row, 1, select);
|
|
|
+ // }, function () {
|
|
|
+ // select[col.field] = orgValue;
|
|
|
+ // SpreadJsObj.reLoadRowData(sheet, sel.row);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
return;
|
|
|
},
|
|
|
clipboardPasted(e, info) {
|