|
@@ -263,9 +263,9 @@ $(document).ready(() => {
|
|
|
checkRangeExpr(payNode, text, data) {
|
|
|
if (!payNode) return [false, '数据错误'];
|
|
|
|
|
|
- const num = text ? _.toNumber(text) : null;
|
|
|
- let expr = text ? (num ? null : text) : null;
|
|
|
- expr = expr ? $.trim(expr).replace('\t', '').replace('=', '').toLowerCase(): null;
|
|
|
+ const num = text ? _.toNumber(text) : 0;
|
|
|
+ let expr = text ? (num ? '' : text) : '';
|
|
|
+ expr = expr ? $.trim(expr).replace('\t', '').replace('=', '').toLowerCase() : '';
|
|
|
const [valid, msg] = this.checkExprValid(expr, ['bqwc', 'ybbqwc', 'bqht', 'bqbg', 'bqyf']);
|
|
|
if (!valid) return [valid, msg];
|
|
|
|
|
@@ -273,8 +273,8 @@ $(document).ready(() => {
|
|
|
if (payUtils.check.isSf(payNode)) {
|
|
|
const value = expr ? payCalc.calculateExpr(expr) : num;
|
|
|
if (payNode.pre_tp && value < payNode.pre_tp) return [false, '截止上期已计量' + payNode.pre_tp + ',扣款限额请勿少于改值'];
|
|
|
- data.rprice = num;
|
|
|
- data.rexpr = expr;
|
|
|
+ data.range_tp = num;
|
|
|
+ data.range_expr = expr;
|
|
|
return [true, ''];
|
|
|
} else {
|
|
|
// if (payNode.pre_finish) return [false, '已达扣款限额,请勿修改'];
|
|
@@ -285,17 +285,17 @@ $(document).ready(() => {
|
|
|
return [false, '已经开始使用,请勿修改扣款限额'];
|
|
|
}
|
|
|
} else {
|
|
|
- data.rprice = num;
|
|
|
- data.rexpr = expr;
|
|
|
+ data.range_tp = num;
|
|
|
+ data.range_expr = expr;
|
|
|
return [true, ''];
|
|
|
}
|
|
|
}
|
|
|
checkStartExpr(payNode, text, data) {
|
|
|
if (!payNode) return [false, '数据错误'];
|
|
|
|
|
|
- const num = text ? _.toNumber(text) : null;
|
|
|
- let expr = text ? (num ? null : text) : null;
|
|
|
- expr = expr ? $.trim(expr).replace('\t', '').replace('=', '').toLowerCase(): null;
|
|
|
+ const num = text ? _.toNumber(text) : 0;
|
|
|
+ let expr = text ? (num ? '' : text) : '';
|
|
|
+ expr = expr ? $.trim(expr).replace('\t', '').replace('=', '').toLowerCase() : '';
|
|
|
const [valid, msg] = this.checkExprValid(expr, ['bqwc', 'ybbqwc', 'bqht', 'bqbg', 'bqyf']);
|
|
|
if (!valid) return [valid, msg];
|
|
|
|
|
@@ -306,12 +306,12 @@ $(document).ready(() => {
|
|
|
const value = expr ? payCalc.calculateExpr(expr) : num;
|
|
|
if (this.addBase.pre_gather_tp && value < this.addBase.pre_gather_tp)
|
|
|
return [false, '起扣金额请勿少于本期完成截止上期计量金额' + this.addBase.pre_gather_tp];
|
|
|
- data.sprice = num;
|
|
|
- data.sexpr = expr;
|
|
|
+ data.start_tp = num;
|
|
|
+ data.start_expr = expr;
|
|
|
return [true, ''];
|
|
|
} else {
|
|
|
- data.sprice = num;
|
|
|
- data.sexpr = expr;
|
|
|
+ data.start_tp = num;
|
|
|
+ data.start_expr = expr;
|
|
|
return [true, ''];
|
|
|
}
|
|
|
}
|
|
@@ -420,12 +420,19 @@ $(document).ready(() => {
|
|
|
}
|
|
|
};
|
|
|
const select = SpreadJsObj.getSelectObject(sheet);
|
|
|
+ if (!select) {
|
|
|
+ setObjEnable($('a[name=base-opr][type=add]'), false);
|
|
|
+ setObjEnable($('a[name=base-opr][type=del]'), false);
|
|
|
+ setObjEnable($('a[name=base-opr][type=up-move]'), false);
|
|
|
+ setObjEnable($('a[name=base-opr][type=down-move]'), false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
const preNode = payTree.getPreSiblingNode(select);
|
|
|
setObjEnable($('a[name=base-opr][type=add]'), !readOnly && !payUtils.check.isSf(select) && !payUtils.check.isYf(select));
|
|
|
const delValid = !payUtils.check.isFixed(select) && !payUtils.check.isStarted(select);
|
|
|
- setObjEnable($('a[name=base-opr][type=del]'), !readOnly && select && delValid);
|
|
|
- setObjEnable($('a[name=base-opr][type=up-move]'), !readOnly && select && !payUtils.check.isFixed(select) && preNode);
|
|
|
- setObjEnable($('a[name=base-opr][type=down-move]'), !readOnly && select && !payUtils.check.isFixed(select) && !payTree.isLastSibling(select));
|
|
|
+ setObjEnable($('a[name=base-opr][type=del]'), !readOnly && delValid);
|
|
|
+ setObjEnable($('a[name=base-opr][type=up-move]'), !readOnly && !payUtils.check.isFixed(select) && preNode);
|
|
|
+ setObjEnable($('a[name=base-opr][type=down-move]'), !readOnly && !payUtils.check.isFixed(select) && !payTree.isLastSibling(select));
|
|
|
},
|
|
|
loadExprToInput: function() {
|
|
|
const sel = sheet.getSelections()[0];
|
|
@@ -634,6 +641,7 @@ $(document).ready(() => {
|
|
|
$('a[name="base-opr"]').click(function () {
|
|
|
payEvent.baseOpr(this.getAttribute('type'));
|
|
|
});
|
|
|
+ $('')
|
|
|
}
|
|
|
|
|
|
return { spread, sheet, payTree, loadDatas: payEvent.reloadPays }
|