Explorar o código

资金模块-调整字段

huangx %!s(int64=7) %!d(string=hai) anos
pai
achega
14c7f6efd7

+ 2 - 1
frontend/saas-web/app/view/money/payBalance/FormPanel.js

@@ -101,7 +101,8 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
         }, {
             text: '期间',
             dataIndex: 'pd_ym',
-            hidden:true
+            hidden:true,
+            defaultValue: Ext.Date.format(new Date(), 'Ym'),
             // editor: {
             //     xtype: 'hidden',
                 // xtype: 'textfield,

+ 1 - 0
frontend/saas-web/app/view/money/recBalance/FormPanel.js

@@ -97,6 +97,7 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         }, {
             text: '期间',
             dataIndex: 'rd_ym',
+            defaultValue: Ext.Date.format(new Date(), 'Ym'),
             // editor: {
             //     xtype: 'numberfield'
             // },

+ 33 - 1
frontend/saas-web/app/view/money/recBalance/FormPanelController.js

@@ -349,5 +349,37 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
             console.error(res);
             showToast('转单失败: ' + res.message);
         });
-     }
+     },
+    onSave: function() {
+        var me = this,
+            form = me.getView(),
+            viewModel = me.getViewModel(),
+            store1 = viewModel.get('detail0').detailStore,
+            store2 = viewModel.get('detail1').detailStore;
+
+        var valid = form.isValid();
+        if(!valid) {
+            showToast(form.invalidText);
+            return false;
+        }
+
+        var sum_rd_amount = store1.sum('rd_amount'); // 付款金额合计
+        var rb_discounts = viewModel.get('rb_discounts'); // 折扣金额
+        var sum_rbd_nowbalance = store2.sum('rbd_nowbalance'); // 本次核销金额合计
+
+        var flag = sum_rd_amount + rb_discounts - sum_rbd_nowbalance;
+
+        if(flag != 0) {
+            var t = flag > 0 ? '大' : '小';
+
+            showConfirm('提示', '收款金额' + t + '于本次折扣后核销金额,是否仍要保存?')
+                .then(function(y) {
+                    if(y == 'yes') {
+                        me.save();
+                    }
+                });
+        }else {
+            me.save();
+        }
+    }
 });