|
@@ -478,6 +478,24 @@ $(document).ready(() => {
|
|
|
setObjEnable($('#up-move'), !readOnly && select && !payBase.isSpecial(select) && dealPay.indexOf(select) > 3);
|
|
|
setObjEnable($('#down-move'), !readOnly && select && !payBase.isSpecial(select) && dealPay.indexOf(select) < dealPay.length - 1);
|
|
|
},
|
|
|
+ loadExprToInput: function () {
|
|
|
+ const sheet = paySpread.getActiveSheet();
|
|
|
+ const sel = sheet.getSelections()[0];
|
|
|
+ const col = sheet.zh_setting.cols[sel.col];
|
|
|
+ const data = SpreadJsObj.getSelectObject(sheet);
|
|
|
+ if (col.field === 'tp') {
|
|
|
+ $('#expr').val(data.expr).attr('field', 'expr').attr('org', data.expr)
|
|
|
+ .attr('readOnly', readOnly|| payBase.isSpecial(data));
|
|
|
+ } else if (col.field === 'sprice') {
|
|
|
+ $('#expr').val(data.sexpr).attr('field', 'sexpr').attr('org', data.sexpr)
|
|
|
+ .attr('readOnly', readOnly|| payCol.readOnly.sprice(data));
|
|
|
+ } else if (col.field === 'rprice') {
|
|
|
+ $('#expr').val(data.rexpr).attr('field', 'rexpr').attr('org', data.rexpr)
|
|
|
+ .attr('readOnly', readOnly|| payCol.readOnly.rprice(data));
|
|
|
+ } else {
|
|
|
+ $('#expr').val('').attr('readOnly', true);
|
|
|
+ }
|
|
|
+ },
|
|
|
add: function () {
|
|
|
const sheet = paySpread.getActiveSheet();
|
|
|
postData(window.location.pathname + '/save', {type: 'add'}, function (result) {
|
|
@@ -555,21 +573,7 @@ $(document).ready(() => {
|
|
|
},
|
|
|
selectionChanged: function (e, info) {
|
|
|
paySpreadObj.refreshActn();
|
|
|
- const sel = info.sheet.getSelections()[0];
|
|
|
- const col = info.sheet.zh_setting.cols[sel.col];
|
|
|
- const data = SpreadJsObj.getSelectObject(info.sheet);
|
|
|
- if (col.field === 'tp') {
|
|
|
- $('#expr').val(data.expr).attr('field', 'expr').attr('org', data.expr)
|
|
|
- .attr('readOnly', readOnly|| payBase.isSpecial(data));
|
|
|
- } else if (col.field === 'sprice') {
|
|
|
- $('#expr').val(data.sexpr).attr('field', 'sexpr').attr('org', data.sexpr)
|
|
|
- .attr('readOnly', readOnly|| payCol.readOnly.sprice(data));
|
|
|
- } else if (col.field === 'rprice') {
|
|
|
- $('#expr').val(data.rexpr).attr('field', 'rexpr').attr('org', data.rexpr)
|
|
|
- .attr('readOnly', readOnly|| payCol.readOnly.rprice(data));
|
|
|
- } else {
|
|
|
- $('#expr').val('').attr('readOnly', true);
|
|
|
- }
|
|
|
+ paySpreadObj.loadExprToInput();
|
|
|
},
|
|
|
editEnded: function (e, info) {
|
|
|
if (info.sheet.zh_setting) {
|
|
@@ -645,6 +649,7 @@ $(document).ready(() => {
|
|
|
postData(window.location.pathname + '/save', data, function (result) {
|
|
|
loadUpdateDealPays(result, col.field === 'name' ? ['name'] : null);
|
|
|
SpreadJsObj.reLoadSheetData(paySpread.getActiveSheet());
|
|
|
+ paySpreadObj.loadExprToInput();
|
|
|
}, function () {
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
});
|
|
@@ -811,6 +816,7 @@ $(document).ready(() => {
|
|
|
postData(window.location.pathname + '/save', data, function (result) {
|
|
|
loadUpdateDealPays(result, col.field === 'name' ? ['name'] : null);
|
|
|
SpreadJsObj.reLoadSheetData(paySpread.getActiveSheet());
|
|
|
+ paySpreadObj.loadExprToInput();
|
|
|
}, function () {
|
|
|
SpreadJsObj.reLoadSheetData(paySpread.getActiveSheet());
|
|
|
});
|