Browse Source

自定义按钮默认隐藏

zhuth 7 years ago
parent
commit
3911cc1a63

+ 29 - 0
frontend/saas-web/app/model/report/Purchase.js

@@ -0,0 +1,29 @@
+Ext.define('saas.model.report.Purchase', {
+    extend: 'saas.model.Base',
+
+    fields: [
+
+        { name: 'id', type: 'int' },
+        { name: 'pu_code', type: 'string' },
+        { name: 'pu_vendcode', type: 'string' },
+        { name: 'pu_vendname', type: 'string' },
+        { name: 'pu_acceptstatus', type: 'string' },
+        { name: 'pu_buyername', type: 'string' },
+        { name: 'pu_date', type: 'date' },
+        { name: 'pd_detno', type: 'int' },
+        { name: 'pd_prodcode', type: 'string' },
+        { name: 'pr_detail', type: 'string' },
+        { name: 'pr_spec', type: 'string' },
+        { name: 'pr_brand', type: 'string' },
+        { name: 'pr_unit', type: 'string' },
+        { name: 'pd_qyt', type: 'float' },
+        { name: 'pd_price', type: 'float' },
+        { name: 'pd_taxrate', type: 'float' },
+        { name: 'pd_total', type: 'float' },
+        { name: 'pd_taxprice', type: 'float' },
+        { name: 'pd_taxtotal', type: 'float' },
+        { name: 'pd_acceptqty', type: 'float' },
+        { name: 'pd_accepttotal', type: 'float' },
+        { name: 'pd_remark', type: 'string' },
+    ],
+});

+ 4 - 0
frontend/saas-web/app/util/FormUtil.js

@@ -252,6 +252,10 @@ Ext.define('saas.util.FormUtil', {
                         }else {
                             throw new Error('请求单据编号错误');
                         }
+                    }else {
+                        return {
+                            main: {},
+                        }
                     }
                 }).then(function(formData) {
                     var initData = form.initData;

+ 9 - 0
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -95,9 +95,18 @@ Ext.define('saas.view.core.form.FormPanel', {
                 hidden:'{!showAuditBtn}'
             },
             handler: "auditBtnClick",
+        }, {
+            cls:'x-formpanel-btn-white',
+            text:'打印',
+            hidden: true,
+            bind: {
+                // hidden: '{!id}'
+            },
+            handler:"onPrint"
         }, {
             cls:'x-formpanel-btn-white',
             text:'操作日志',
+            hidden: true,
             bind: {
                 hidden: '{!id}'
             },

+ 5 - 1
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -365,5 +365,9 @@ Ext.define('saas.view.core.form.FormPanelController', {
             }));
         };
         win.show();
-    }
+    },
+
+    onPrint: function() {
+        console.log('print');
+    },
 });

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

@@ -74,7 +74,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                                     ext: 'xlsx'
                                 }
                             }, {
-                                text: 'Excel xlsx (include groups)',
+                                text: 'Excel xlsx (包含分组合计)',
                                 cfg: {
                                     type: 'excel07',
                                     ext: 'xlsx',
@@ -88,7 +88,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                                     ext: 'xml'
                                 }
                             }, {
-                                text: 'Excel xml (include groups)',
+                                text: 'Excel xml (包含分组合计)',
                                 cfg: {
                                     includeGroups: true,
                                     includeSummary: true
@@ -110,7 +110,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                                     type: 'html'
                                 }
                             }, {
-                                text: 'HTML (include groups)',
+                                text: 'HTML (包含分组合计)',
                                 cfg: {
                                     type: 'html',
                                     includeGroups: true,
@@ -179,6 +179,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
         var me = this;
         var store = Ext.create('Ext.data.Store', {
             fields: me.getFields(),
+            // model: me.reportModel,
             autoLoad: true,
             pageSize: 15,
             data: [],
@@ -326,71 +327,6 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return items;
     },
 
-    initToolBarItems: function () {
-        var me = this;
-
-        return ['->', {
-            ui: 'default-toolbar',
-            xtype: 'button',
-            text: '导出为...',
-            menu: {
-                defaults: {
-                    handler: 'exportTo'
-                },
-                items: [{
-                    text: 'Excel xlsx',
-                    cfg: {
-                        type: 'excel07',
-                        ext: 'xlsx'
-                    }
-                }, {
-                    text: 'Excel xlsx (include groups)',
-                    cfg: {
-                        type: 'excel07',
-                        ext: 'xlsx',
-                        includeGroups: true,
-                        includeSummary: true
-                    }
-                }, {
-                    text: 'Excel xml',
-                    cfg: {
-                        type: 'excel03',
-                        ext: 'xml'
-                    }
-                }, {
-                    text: 'Excel xml (include groups)',
-                    cfg: {
-                        includeGroups: true,
-                        includeSummary: true
-                    }
-                }, {
-                    text: 'CSV',
-                    cfg: {
-                        type: 'csv'
-                    }
-                }, {
-                    text: 'TSV',
-                    cfg: {
-                        type: 'tsv',
-                        ext: 'csv'
-                    }
-                }, {
-                    text: 'HTML',
-                    cfg: {
-                        type: 'html'
-                    }
-                }, {
-                    text: 'HTML (include groups)',
-                    cfg: {
-                        type: 'html',
-                        includeGroups: true,
-                        includeSummary: true
-                    }
-                }]
-            }
-        }]
-    },
-
     getConditions: function() {
         var me = this,
         formItems = me.searchItems,

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

@@ -27,6 +27,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
      toolBtns: [{
          xtype: 'button',
          text: '转采购验收单',
+         hidden: true,
          bind: {
             hidden: '{turnHidden}'
         },

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

@@ -27,6 +27,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
     toolBtns: [{
         xtype: 'button',
         text: '转采购验退单',
+        hidden: true,
         bind: {
            hidden: '{turnHidden}'
        },

+ 2 - 12
frontend/saas-web/app/view/purchase/report/Purchase.js

@@ -36,6 +36,8 @@ Ext.define('saas.view.purchase.report.Purchase', {
         ]
     }],
 
+    reportModel: 'saas.model.report.Purchase',
+
     reportColumns: [
     {
         text: 'id',
@@ -74,27 +76,15 @@ Ext.define('saas.view.purchase.report.Purchase', {
     }, {
         text: '物料名称',
         dataIndex: 'pr_detail', 
-        renderer: function (v, m, r) {
-            return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
-        }
     }, {
         text: '物料规格',
         dataIndex: 'pr_spec', 
-        renderer: function (v, m, r) {
-            return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
-        }
     }, {
         text: '品牌',
         dataIndex: 'pr_brand', 
-        renderer: function (v, m, r) {
-            return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
-        }
     }, {
         text: '单位',
         dataIndex: 'pr_unit', 
-        renderer: function (v, m, r) {
-            return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
-        }
     }, {
         text: '采购数量',
         dataIndex: 'pd_qty',

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

@@ -27,6 +27,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
      toolBtns: [{
          xtype: 'button',
          text: '转出货单',
+         hidden: true,
          handler: 'turnOut',
          bind: {
              hidden: '{sa_statuscode!="AUDITED"}'

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

@@ -28,6 +28,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
         xtype: 'button',
         text: '转销售退货',
         handler: 'turnProdIn',
+        hidden: true,
         bind: {
             hidden: '{pi_statuscode!="AUDITED"}'
         }