Jelajahi Sumber

1. 合同支付,本期金额,直接输入金额时,应受本期限额控制
2. 合同支付,表达式,鼠标离开时,保存值
3. 合同支付,附件,修改其他值时,过滤更新附件值

MaiXinRong 5 tahun lalu
induk
melakukan
32001a94c9
3 mengubah file dengan 5 tambahan dan 4 penghapusan
  1. 1 1
      app/lib/pay_calc.js
  2. 2 1
      app/public/js/stage_pay.js
  3. 2 2
      app/view/stage/detail_modal.ejs

+ 1 - 1
app/lib/pay_calc.js

@@ -173,7 +173,7 @@ class PayCalculate {
                             p.tp = value;
                         }
                     } else if (p.tp && !this.ctx.helper.checkZero(p.tp)) {
-                        p.tp = this.ctx.helper.round(p.tp, this.decimal);
+                        p.tp = Math.min(this.ctx.helper.sub(p.rprice, p.pre_total_price), this.ctx.helper.round(p.tp, this.decimal));
                     }
                 } else {
                     p.tp = 0;

+ 2 - 1
app/public/js/stage_pay.js

@@ -21,6 +21,7 @@ function loadUpdateDealPays(newPay, fields) {
     for (const np of newPays) {
         const op = _.find(dealPay, {id: np.id});
         for (const prop in np) {
+            if (prop === 'attachment') continue;
             if (!fields || fields.indexOf(prop) >= 0) {
                 op[prop] = np[prop];
             }
@@ -497,7 +498,7 @@ $(document).ready(() => {
         $('#del').click(paySpreadObj.del);
         $('#up-move').click(paySpreadObj.upMove);
         $('#down-move').click(paySpreadObj.downMove);
-        $('#expr').change(function () {
+        $('#expr').bind('change mouseleave', function () {
             const expr = $(this);
             const select = SpreadJsObj.getSelectObject(paySpread.getActiveSheet());
             const field = expr.attr('field'), orgValue = expr.attr('org'), newValue = expr.val();

+ 2 - 2
app/view/stage/detail_modal.ejs

@@ -35,7 +35,7 @@
             </div>
             <div class="modal-footer">
                 <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
-                <% if (!stage.readOnly) { %>
+                <% if (!stage.readOnly && stage.user_id === ctx.session.sessionUser.accountId) { %>
                 <button type="button" class="btn btn-primary" id="choose-ok">重新生成</button>
                 <% } %>
             </div>
@@ -68,7 +68,7 @@
             </div>
             <div class="modal-footer">
                 <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
-                <% if (!stage.readOnly) { %>
+                <% if (!stage.readOnly && stage.user_id === ctx.session.sessionUser.accountId) { %>
                 <button type="button" class="btn btn-primary" id="choose2-ok">确定</button>
                 <% } %>
             </div>