Browse Source

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

hy 7 years ago
parent
commit
d0bcaffd71

+ 81 - 0
frontend/saas-web/app/view/core/form/field/ConMonthField.js

@@ -0,0 +1,81 @@
+Ext.define('saas.view.core.form.field.ConMonthField', {
+    extend: 'Ext.form.FieldContainer',
+    alias: 'widget.conmonthfield',
+
+    layout: 'hbox',
+    items: [],
+    defaults: {
+        margin: '0 0 0 0'
+    },
+    columnWidth: 0.5,
+    defaultBindProperty: 'value',
+
+    combineErrors: true,
+
+    cls: 'x-conmonthfield',
+
+    initComponent : function(){
+        this.callParent(arguments);
+        var me = this, allowBlank = (Ext.isDefined(me.allowBlank) ? me.allowBlank : true);
+        me.from = me.insert(0, {
+            xtype: 'monthdatefield',
+            listeners: {
+                beforeChange: me.beforeFromChange,
+                change: me.fromChange
+            }
+        });
+        me.to = me.insert(1, {
+            xtype: 'monthdatefield',
+            listeners: {
+                beforeChange: me.beforeToChange,
+                change: me.toChange
+            }
+        });
+    },
+
+    setValue: function(value) {
+        this.value = value;
+        this.publishState('value', this.value);
+    },
+
+    beforeFromChange: function(picker, value) {
+        var container = picker.ownerCt,
+        toField = container.to,
+        toValue = toField.value;
+
+        if(Number(value) > Number(toValue)) {
+            toField.setValue('');
+        }
+        return true;
+    },
+
+    fromChange: function(picker, newValue, oldValue) {
+        var container = picker.ownerCt,
+        toField = container.to;
+        container.setValue({
+            from: newValue,
+            to: toField.value
+        });
+    },
+
+    beforeToChange: function(picker, value) {
+        var container = picker.ownerCt,
+        fromField = container.from,
+        fromValue = fromField.value;
+
+        if(Number(value) <= Number(fromValue)) {
+            return false;
+        }else {
+            return true;
+        }
+    },
+
+    toChange: function(picker, newValue, oldValue) {
+        var container = picker.ownerCt,
+        fromField = container.from;
+        container.setValue({
+            from: fromField.value,
+            to: newValue
+        });
+    }
+});

+ 12 - 9
frontend/saas-web/app/view/core/form/field/Month.js

@@ -80,25 +80,32 @@ Ext.define('saas.view.core.form.field.Month', {
             month = Number(month) + 1;
             month = month < 10 ? '0' + month : month;
             year = year == null ? new Date().getFullYear() : year;
+
+            var v = year + '' + month;
             if (this.minValue) {
-                if (Number(year + '' + month) < this.minYearMonth) {
+                if (Number(v) < this.minYearMonth) {
                     return;
                 }
             }
             if (this.maxValue) {
-                if (Number(year + '' + month) > this.maxYearMonth) {
+                if (Number(v) > this.maxYearMonth) {
                     return;
                 }
             }
-            this.setValue(year + '' + month);
+            if(!this.fireEvent('beforeChange', this, v)) {
+                this.monthPicker.hide();
+                return;
+            }
+            this.setValue(v);
+            this.fireEvent('select', this, v);
         }
-        me.onSelect();
+        this.monthPicker.hide();
     },
     getCurrentVal:function(){
         return Ext.Date.format(new Date(),this.format);
     },
     onCancelClick: function() {
-        this.onSelect();
+        this.monthPicker.hide();
     },
     getPickerValues:function() {
         var val = this.value, year, month;
@@ -118,8 +125,4 @@ Ext.define('saas.view.core.form.field.Month', {
         }
         this.callParent(arguments);
     },
-    onSelect: function() {
-        this.monthPicker.hide();
-    }
-
 });

+ 16 - 16
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -22,6 +22,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
     searchItems: [], // 查询字段
     reportTitle: '报表',
     autoLoad:true,
+    allowPaging: true,
     printAble: true,
     exportAble: true,
     queryMode: 'DETAIL',
@@ -162,23 +163,12 @@ Ext.define('saas.view.core.report.ReportPanel', {
                 }],
                 store: store,
                 columns: me.initColumns(),
-                dockedItems: [{
+                dockedItems: [me.allowPaging ? {
                     xtype: 'pagingtoolbar',
                     dock: 'bottom',
                     displayInfo: true,
                     store: store
-                }],
-                viewConfig: {
-                    deferEmptyText: false,
-                    listeners: {
-                        itemcontextmenu: function(view, rec, node, index, e) {
-                            e.stopEvent();
-                            me.getContextMenu().show().setLocalXY(e.getXY());
-                            me.selectedData = e.target.innerText;
-                            return false;
-                        }
-                    }
-                },
+                } : null],
             }]
         });
 
@@ -187,12 +177,13 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
     listeners: {
         boxready: function(p) {
+            var allowPaging = p.allowPaging;
             var grid = p.down('grid');
             var store = grid.getStore();
             var gridBodyBox = grid.body.dom.getBoundingClientRect();
             var gridBodyBoxHeight = gridBodyBox.height;
 
-            var pageSize = Math.floor(gridBodyBoxHeight / 32);
+            var pageSize = allowPaging ? Math.floor(gridBodyBoxHeight / 32) : 99999;
 
             store.setPageSize(pageSize);
         }
@@ -501,6 +492,10 @@ Ext.define('saas.view.core.report.ReportPanel', {
             conditions.push(condition);
         }
 
+        return me.myGetConditions(conditions);
+    },
+
+    myGetConditions: function(conditions) {
         return conditions;
     },
 
@@ -511,7 +506,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
         if(me.isContainsAny(xtypes, ['numberfield'])) {
             type = 'number';
-        }else if(me.isContainsAny(xtypes, ['datefield', 'condatefield'])) {
+        }else if(me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
             type = 'date';
         }else if(me.isContainsAny(xtypes, ['dbfindtrigger'])) {
             type = 'string';
@@ -544,7 +539,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
         if(me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
             operation = '=';
-        }else if(me.isContainsAny(xtypes, ['condatefield'])) {
+        }else if(me.isContainsAny(xtypes, ['condatefield', 'conmonthfield'])) {
             operation = 'between';
         }else if(me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
             operation = 'in';
@@ -564,6 +559,11 @@ Ext.define('saas.view.core.report.ReportPanel', {
         conditionValue;
         if(me.isContainsAny(xtypes, ['datefield'])) {
             conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
+        }else if(me.isContainsAny(xtypes, ['conmonthfield'])) {
+            var from = value.from,
+            to = value.to;
+
+            conditionValue = from + ',' + to;
         }else if(me.isContainsAny(xtypes, ['condatefield'])) {
             var from = value.from,
             to = value.to;

+ 1 - 1
frontend/saas-web/app/view/document/product/BasePanel.js

@@ -27,7 +27,7 @@ Ext.define('saas.view.document.product.BasePanel', {
     }, {
         editable:true,
         hiddenBtn:true,
-        xtype : "remotecombo", 
+        xtype : "remotecombo",
         storeUrl:'/api/document/productbrand/getCombo',
         name : "pr_brand", 
         emptyText : "品牌", 

+ 6 - 9
frontend/saas-web/app/view/money/report/TotalPayDetail.js

@@ -14,8 +14,10 @@ Ext.define('saas.view.money.report.TotalPayDetail', {
     listUrl: '/api/money/report/vendormonthdetails',
     // listUrl: 'http://192.168.253.139:8560/api/money/report/vendormonthdetails',
     defaultCondition: null,
-    reportTitle: '应收总账明细表',
+    reportTitle: '应收总账',
     QueryWidth: 0.35,
+    allowPaging: false,
+
     searchItems: [{
         xtype: 'textfield',
         name: 'vm_vendcode',
@@ -25,15 +27,10 @@ Ext.define('saas.view.money.report.TotalPayDetail', {
             return "(upper(vm_vendcode) like '%"+v.toUpperCase()+"%' or upper(vm_vendname) like '%"+v.toUpperCase()+"%')";
         },
     }, {
-        xtype: 'monthdatefield',
+        xtype: 'conmonthfield',
+        fieldLabel: '期间',
         name: 'vm_yearmonth',
-        fieldLabel: '起始期间',
-        columnWidth: 0.2
-    }, {
-        xtype: 'monthdatefield',
-        name: 'vm_yearmonthTo',
-        fieldLabel: '结束期间',
-        columnWidth: 0.2
+        columnWidth: 0.4
     }],
 
     reportColumns: [{

+ 6 - 9
frontend/saas-web/app/view/money/report/TotalRecDetail.js

@@ -14,8 +14,10 @@ Ext.define('saas.view.money.report.TotalRecDetail', {
     listUrl: '/api/money/report/custormonthdetails',
     // listUrl: 'http://192.168.253.139:8560/api/money/report/custormonthdetails',
     defaultCondition: null,
-    reportTitle: '应收总账明细表',
+    reportTitle: '应收总账',
     QueryWidth: 0.35,
+    allowPaging: false,
+
     searchItems: [{
         xtype: 'textfield',
         name: 'cm_custcode',
@@ -25,15 +27,10 @@ Ext.define('saas.view.money.report.TotalRecDetail', {
             return "(upper(cm_custcode) like '%" + v.toUpperCase() + "%' or upper(cm_custname) like '%" + v.toUpperCase() + "%')";
         },
     }, {
-        xtype: 'monthdatefield',
+        xtype: 'conmonthfield',
+        fieldLabel: '期间',
         name: 'cm_yearmonth',
-        fieldLabel: '起始期间',
-        columnWidth: 0.2
-    }, {
-        xtype: 'monthdatefield',
-        name: 'cm_yearmonthTo',
-        fieldLabel: '结束期间',
-        columnWidth: 0.2
+        columnWidth: 0.4
     }],
 
     reportColumns: [{

+ 2 - 4
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -322,13 +322,11 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 xtype : "employeeDbfindTrigger", 
                 name : "pu_buyername", 
                 fieldLabel : "采购员",
-                columnWidth : 0.25,
-                defaultValue:saas.util.BaseUtil.getCurrentUser().realname
+                columnWidth : 0.25
             },{
                 xtype : "hidden", 
                 name : "pu_buyerid", 
-                fieldLabel : "采购员ID",
-                defaultValue:saas.util.BaseUtil.getCurrentUser().id
+                fieldLabel : "采购员ID"
             },
             {
                 xtype : "hidden", 

+ 1 - 1
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js

@@ -53,7 +53,7 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         }
     }, {
         xtype: 'multicombo',
-        name: 'pi_prstatus',
+        name: 'pi_prstatuscode',
         fieldLabel: '付款状态',
         emptyText :'全部',
         datas: [

+ 1 - 1
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js

@@ -53,7 +53,7 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
         }
     }, {
         xtype: 'multicombo',
-        name: 'pi_prstatus',
+        name: 'pi_prstatuscode',
         fieldLabel: '付款状态',
         emptyText :'全部',
         datas: [

+ 4 - 0
frontend/saas-web/app/view/sale/report/SaleProfit.js

@@ -120,6 +120,10 @@ Ext.define('saas.view.sale.report.SaleProfit', {
             var format = '0,000.' + xr.join();
             return Ext.util.Format.number(v, format);
         }
+    }, {
+        text: '不含税单价',
+        dataIndex: 'pd_netprice',
+        xtype: 'numbercolumn'
     }, {
         text: '成本单价',
         dataIndex: 'pw_costprice',

+ 9 - 7
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -280,21 +280,23 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 name : "sa_total", 
                 fieldLabel : "销售金额",
                 readOnly:true
+            },{
+                xtype : "employeeDbfindTrigger", 
+                name : "sa_seller", 
+                fieldLabel : "业务员"
+            },{
+                xtype : "hidden", 
+                name : "sa_sellerid", 
+                fieldLabel : "业务员ID"
             },{
                 xtype : "hidden", 
                 name : "sa_sellercode", 
                 fieldLabel : "业务员编号",
-            },{
-                xtype : "employeeDbfindTrigger", 
-                name : "sa_seller", 
-                fieldLabel : "业务员",
-                defaultValue:saas.util.BaseUtil.getCurrentUser().realname
             }, {
                 xtype : 'textfield', 
                 name : 'sa_sendstatus', 
                 fieldLabel : '出货状态', 
-                hidden : true,
-                defaultValue:saas.util.BaseUtil.getCurrentUser().id
+                hidden : true
              },{
                 xtype : "hidden", 
                 name : "creatorId", 

+ 3 - 1
frontend/saas-web/app/view/sale/sale/FormPanelController.js

@@ -27,12 +27,14 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                         }, {
                             from: 'cu_sellername',
                             to: 'sa_seller'
+                        }, {
+                            from:'cu_sellerid',to:'cu_sellerid'
                         }],
                     });
 
                 }
             }, // 主表-采购员名称
-            'dbfindtrigger[name=sa_sellercode]': {
+            'dbfindtrigger[name=sa_seller]': {
                 beforerender: function (f) {
                     Ext.apply(f, {
                         dbfinds: [{

+ 1 - 1
frontend/saas-web/app/view/sale/saleIn/QueryPanel.js

@@ -51,7 +51,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
         }
     }, {
         xtype: 'multicombo',
-        name: 'pi_prstatus',
+        name: 'pi_prstatuscode',
         fieldLabel: '付款状态',
         emptyText :'全部',
         datas: [

+ 1 - 1
frontend/saas-web/app/view/sale/saleOut/QueryPanel.js

@@ -51,7 +51,7 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
         }
     }, {
         xtype: 'multicombo',
-        name: 'pi_prstatus',
+        name: 'pi_prstatuscode',
         fieldLabel: '付款状态',
         emptyText :'全部',
         datas: [