|
@@ -118,6 +118,7 @@ $(document).ready(() => {
|
|
|
{title: '|调差金额', colSpan: '|1', rowSpan: '|1', field: 'm_tp', hAlign: 2, width: 80, type: 'Number', readOnly: true, getValue: 'getValue.m_tp'},
|
|
|
{title: '截止上期调差金额', colSpan: '1', rowSpan: '2', field: 'pre_tp', hAlign: 2, width: 120, type: 'Number', readOnly: true},
|
|
|
{title: '备注', colSpan: '1', rowSpan: '2', field: 'remark', hAlign: 0, width: 60, formatter: '@', readOnly: 'readOnly.remark'},
|
|
|
+ {title: '是否汇总', colSpan: '1', rowSpan: '2', field: 'is_summary', hAlign: 1, width: 60, cellType: 'checkbox', readOnly: 'readOnly.isEdit'},
|
|
|
],
|
|
|
emptyRows: 0,
|
|
|
headRows: 2,
|
|
@@ -280,6 +281,9 @@ $(document).ready(() => {
|
|
|
if (info.sheet.zh_setting) {
|
|
|
const select = SpreadJsObj.getSelectObject(info.sheet);
|
|
|
const col = info.sheet.zh_setting.cols[info.col];
|
|
|
+ if (col.field === 'is_summary') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 未改变值则不提交
|
|
|
const validText = is_numeric(info.editingText) ? parseFloat(info.editingText) : (info.editingText ? trimInvalidChar(info.editingText) : null);
|
|
|
const orgValue = select[col.field];
|
|
@@ -372,6 +376,30 @@ $(document).ready(() => {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ buttonClicked: function (e, info) {
|
|
|
+ if (info.sheet.zh_setting) {
|
|
|
+ const select = SpreadJsObj.getSelectObject(info.sheet);
|
|
|
+ const col = info.sheet.zh_setting.cols[info.col];
|
|
|
+ if (materialCol.readOnly.isEdit(select)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (col.field === 'is_summary') {
|
|
|
+ if (info.sheet.isEditing()) {
|
|
|
+ info.sheet.endEdit(true);
|
|
|
+ }
|
|
|
+ select.is_summary = info.sheet.getValue(info.row, info.col) ? 1 : 0;
|
|
|
+ // 更新至服务器
|
|
|
+ postData(window.location.pathname + '/save', { type:'update', updateData: select }, function (result) {
|
|
|
+ m_tp = result.m_tp;
|
|
|
+ resetTpTable();
|
|
|
+ SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
+ }, function () {
|
|
|
+ select.is_summary = info.sheet.getValue(info.row, info.col) ? 0 : 1;
|
|
|
+ SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
deletePress: function (sheet) {
|
|
|
return;
|
|
|
},
|
|
@@ -771,7 +799,9 @@ $(document).ready(() => {
|
|
|
$('#add').click(materialSpreadObj.add);
|
|
|
$('#del').click(materialSpreadObj.del);
|
|
|
materialSpread.bind(spreadNS.Events.EditEnded, materialSpreadObj.editEnded);
|
|
|
+ materialSpread.bind(spreadNS.Events.ButtonClicked, materialSpreadObj.buttonClicked);
|
|
|
materialMonthSpread.bind(spreadNS.Events.EditEnded, materialMonthSpreadObj.editEnded);
|
|
|
+
|
|
|
// 右键菜单
|
|
|
$.contextMenu({
|
|
|
selector: '#material-spread',
|