Browse Source

mothdatefield

zhuth 7 years ago
parent
commit
3a4af07a32

+ 6 - 5
frontend/saas-web/app/view/core/form/field/Month.js

@@ -5,7 +5,7 @@ Ext.define('saas.view.core.form.field.Month', {
     extend:'Ext.form.field.Picker',
     alias: 'widget.monthdatefield',
     requires: ['Ext.picker.Month'],
-    format : "m/Y",
+    format : "Y-m",
     disabledDaysText : "Disabled",
     disabledDatesText : "Disabled",
     triggerCls : Ext.baseCSSPrefix + 'form-date-trigger',
@@ -84,12 +84,12 @@ Ext.define('saas.view.core.form.field.Month', {
                     return;
                 }
             }
-            this.setValue(year + '' + month);
+            this.setValue(year + '-' + month);
         }
         me.onSelect();
     },
     getCurrentVal:function(){
-        return Ext.Date.format(new Date(),'Ym');
+        return Ext.Date.format(new Date(), this.format);
     },
     onCancelClick: function() {
         this.onSelect();
@@ -108,9 +108,10 @@ Ext.define('saas.view.core.form.field.Month', {
     },
     setValue : function(value) {
        if (Ext.isEmpty(value)) {
-            value =me.getCurrentVal();
+            value =this.getCurrentVal();
         }
-        this.callParent(arguments);
+        value = Ext.Date.format(new Date(value), this.format);
+        this.callParent([value]);
     },
     onSelect: function() {
         this.monthPicker.hide();

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

@@ -303,6 +303,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
             }
         });
 
+        viewModel.notify();
+
         return items;
     },
 

+ 2 - 3
frontend/saas-web/app/view/stock/report/ProdinoutCount.js

@@ -25,11 +25,10 @@ Ext.define('saas.view.stock.report.ProdinoutCount', {
         columnWidth: 0.2
     }, {
         //xtype: 'datefield',
-        xtype: 'textfield',
+        xtype: 'monthdatefield',
         name: 'pwm_yearmonth',
         fieldLabel: '单据日期',
-        format: 'YYYYMM',
-       // defaultValue: new Date(),
+       defaultValue: new Date(),
         columnWidth: 0.2
     }],
     reportColumns: [{