Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

rainco 7 years ago
parent
commit
beee690ff0

+ 16 - 17
frontend/saas-web/app/view/document/kind/KindController.js

@@ -32,10 +32,10 @@ Ext.define('saas.view.document.kind.KindController', {
         if(store) store.reload();
         vm.set('title', button.typeText);
     },
-    onAdd:function(){
-        var me=this,
-            dataKind=me.getViewModel().getData()['dataKind'].value;
-        me.createDialog(dataKind);
+    onAdd:function(b){
+        var dk = b.ownerCt.ownerCt;
+        var dataKind=dk.getViewModel().getData()['dataKind'].value;
+        this.createDialog(dataKind,null,dk);
     },
     onRefresh:function(){
         var me = this;
@@ -64,20 +64,19 @@ Ext.define('saas.view.document.kind.KindController', {
         return columns;
     },
     onEdit:function(grid,row,col){
-        var me=this,
-            dataKind=me.getViewModel().getData()['dataKind'].value;
-            rec = grid.getStore().getAt(row);
-        this.createDialog(dataKind,rec);
+        var dk = grid.ownerCt.ownerCt;
+        var dataKind=dk.getViewModel().getData()['dataKind'].value,
+        rec = grid.getStore().getAt(row);
+        this.createDialog(dataKind,rec,dk);
     },
     onDelete:function(grid,row,col){
-        var me=this,
-            view=me.getView(),
-            dataKind=me.getViewModel().getData()['dataKind'].value;
+        var dk = grid.ownerCt.ownerCt;
+        var dataKind=dk.getViewModel().getData()['dataKind'].value,
         rec = grid.getStore().getAt(row);
-        var keyV=rec.get(view.etc[dataKind].keyField);
+        var keyV=rec.get(dk.etc[dataKind].keyField);
         //删除接口
         saas.util.BaseUtil.request({
-            url: view.etc[dataKind].delUrl+'/'+keyV,
+            url: dk.etc[dataKind].delUrl+'/'+keyV,
             method: 'POST'
         })
         .then(function(localJson) {
@@ -91,8 +90,8 @@ Ext.define('saas.view.document.kind.KindController', {
             saas.util.BaseUtil.showToast('删除失败: ' + res.message);
         });
     },
-    createDialog: function(dataKind,record) {
-        var view = this.getView();var me=this;
+    createDialog: function(dataKind,record,dk) {
+        var view = dk;
         this.isEdit = !!record;
         this.dialog = view.add({
             autoScroll:true,
@@ -101,8 +100,8 @@ Ext.define('saas.view.document.kind.KindController', {
                 title: record ? '修改{title}' : '新增{title}'
             },
             dataKind:dataKind,
-            belong:this.getView().etc[dataKind],
-            _parent:this.getView(),
+            belong:view.etc[dataKind],
+            _parent:view,
             record:record,
             session: true
         });

+ 4 - 4
frontend/saas-web/app/view/home/InfoCard.js

@@ -42,25 +42,25 @@ Ext.define('saas.view.home.InfoCard', {
                     title: '七天内待出货销售',
                     color: 'yellow',
                     viewType: 'sale-sale-querypanel',
-                    condition: 'sale.companyid=' + companyId + ' and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail where sd_said=sa_id and  IFNULL(sd_sendqty,0)<ifnull(sd_qty,0) and TO_DAYS(sd_delivery)-TO_DAYS(now()) <7)'
+                    condition: 'sale.companyid=' + companyId + ' and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail detail where sd_id=saledetail.sd_id and  IFNULL(sd_sendqty,0)<ifnull(sd_qty,0) and TO_DAYS(sd_delivery)-TO_DAYS(now()) between 0 and 7)'
                 },
                 unstorage: {
                     title: '七天内待入库采购',
                     color: 'purple',
                     viewType: 'purchase-purchase-querypanel',
-                    condition: 'purchase.companyId=' + companyId + ' and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail where pd_puid=pu_id and IFNULL(pd_acceptqty,0) < ifnull(pd_qty,0) and TO_DAYS(PD_DELIVERY)-TO_DAYS(now()) <7)'
+                    condition: 'purchase.companyId=' + companyId + ' and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail detail where pd_id=purchasedetail.pd_id and IFNULL(pd_acceptqty,0) < ifnull(pd_qty,0) and TO_DAYS(PD_DELIVERY)-TO_DAYS(now()) between 0 and 7)'
                 },
                 unpay: {
                     title: '七天内待付款',
                     color: 'red',
                     viewType: 'purchase-purchasein-querypanel',
-                    condition: 'pi_class in(\'采购验收单\',\'采购验退单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(ve_promisedays,0))-TO_DAYS(now()) < 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
+                    condition: 'pi_class in(\'采购验收单\',\'采购验退单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(ve_promisedays,0))-TO_DAYS(now()) between 0 and 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
                 },
                 unreceive: {
                     title: '七天内待收款',
                     color: 'pink',
                     viewType: 'sale-saleout-querypanel',
-                    condition: 'pi_class in(\'出货单\',\'销售退货单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(cu_promisedays,0))-TO_DAYS(now()) < 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=1 and ifnull(sl_namount,0)<>0)'
+                    condition: 'pi_class in(\'出货单\',\'销售退货单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(cu_promisedays,0))-TO_DAYS(now()) between 0 and 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
                 },
                 unauditcheck: {
                     title: '未审核验收',