Browse Source

主从表序号列自动构建,删除columns序号配置/查询列表移除序号列

zhuth 7 years ago
parent
commit
8f8250497c
22 changed files with 51 additions and 229 deletions
  1. 10 2
      frontend/saas-web/Readme.md
  2. 28 3
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  3. 2 26
      frontend/saas-web/app/view/document/customer/panel/FormPanel.js
  4. 1 13
      frontend/saas-web/app/view/document/vendor/panel/FormPanel.js
  5. 1 13
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  6. 1 1
      frontend/saas-web/app/view/purchase/purchase/FormPanelController.js
  7. 1 12
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  8. 0 10
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  9. 1 12
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  10. 0 10
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js
  11. 1 12
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  12. 0 8
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  13. 1 12
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  14. 0 10
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  15. 0 10
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  16. 1 12
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js
  17. 0 8
      frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js
  18. 1 13
      frontend/saas-web/app/view/stock/make/FormPanel.js
  19. 1 12
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  20. 0 10
      frontend/saas-web/app/view/stock/otherIn/QueryPanel.js
  21. 1 12
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  22. 0 8
      frontend/saas-web/app/view/stock/otherOut/QueryPanel.js

+ 10 - 2
frontend/saas-web/Readme.md

@@ -90,7 +90,7 @@ viewModel: view.core.form.FormPanelModel
 | 字段 | 说明 | 必填 | 样例 |
 | --- | --- | --- | --- |
 | storeModel | grid model | √ | "saas.model.purchase.purchasedetail" |
-| detnoColumn | 序号列 | √ | "pud_detno" |
+| detnoColumn | 序号列,配置该项后无需再columns定义序号列 | √ | "pud_detno" |
 | columns[i].ignore | 是否忽略,为真时在调用保存方法时不会取到该列值 | x | true |
 | deleteDetailUrl | 删除明细接口 | √ | basePath + "purchase/purchase/deleteItem" |
 - 需要根据columns在models文件夹下添加storeModel对应的Model
@@ -148,5 +148,13 @@ viewModel: view.core.query.QueryPanelModel
 
 ### 前端配置调整日志
 
-2018-10-20 deleteDetailUrl 配置调整 formpanel.form->formpanel.detailGridField
+- 2018-10-20
+
+deleteDetailUrl 配置调整 formpanel.form->formpanel.detailGridField
+
+- 2018-10-27 10:10:33
+
+主从表从表配置detnoColumn属性说明变更
+
+
 

+ 28 - 3
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -28,6 +28,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
 
     initComponent: function() {
         var me = this;
+        me.initColumns();
         me.setSummary();
         Ext.apply(me, {
             dockedItems: [{
@@ -71,6 +72,30 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         }
     },
 
+    initColumns: function() {
+        // 构造序号列
+        var me = this,
+        columns = me.columns,
+        detnoField = me.detnoColumn,
+        indexColumn = {
+            text : "序号", 
+            dataIndex : detnoField, 
+            width : 60, 
+            xtype : "numbercolumn",
+            align : 'center',
+            format:'0',
+            summaryType: 'count',
+            locked:true,
+            summaryRenderer: function(value, summaryData, dataIndex) {
+                return Ext.String.format('合计', value);
+            },
+        };
+        if (detnoField) {
+            columns.unshift(indexColumn);
+            Ext.apply(me, { columns: columns });
+        }
+    },
+
     setSummary: function() {
         var me = this,
         columns = me.columns,
@@ -93,7 +118,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
 
     add10EmptyRow: function() {
         var me = this,
-        detnoColumn = me._detnoColumn,
+        detnoColumn = me.detnoColumn,
         store = me.getStore(),
         selectedRecord = me.selModel.lastSelected,
         datas = [];
@@ -111,7 +136,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
 
     addDetail: function() {
         var me = this,
-            detnoColumn = me._detnoColumn,
+            detnoColumn = me.detnoColumn,
             store = me.getStore(),
             selectedRecord = me.selModel.lastSelected,
             detno = 0;
@@ -187,7 +212,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         if(from && to) {
             var keys = me.getColumns().map(function(c) {
                 //剔除序号字段
-                if(c.dataIndex!=me._detnoColumn){
+                if(c.dataIndex!=me.detnoColumn){
                     return c.dataIndex 
                 }
             }),

+ 2 - 26
frontend/saas-web/app/view/document/customer/panel/FormPanel.js

@@ -147,22 +147,10 @@ Ext.define('saas.view.document.customer.panel.FormPanel', {
         columnWidth : 0.25
     }, {
         xtype : "detailGridField", 
-        _detnoColumn:  'cc_detno',
+        detnoColumn:  'cc_detno',
         storeModel:'saas.model.document.customercontact',
         _deleteDetailUrl:'http://192.168.253.228:9480/customer/deletecontact/',
         columns : [
-            {
-                text : "序号", 
-                dataIndex : "cc_detno", 
-                width : 100, 
-                xtype : "numbercolumn",
-                align : 'center',
-                format:'0',
-                summaryType: 'count',
-                summaryRenderer: function(value, summaryData, dataIndex) {
-                    return Ext.String.format('合计: {0}条', value);
-                },
-            },
             {
                 text : "ID", 
                 dataIndex : "id", 
@@ -250,22 +238,10 @@ Ext.define('saas.view.document.customer.panel.FormPanel', {
             }]
     } ,{
         xtype : "detailGridField", 
-        _detnoColumn:  'ca_detno',
+        detnoColumn:  'ca_detno',
         storeModel:'saas.model.document.customeraddress',
         _deleteDetailUrl:'http://192.168.253.228:9480/customer/deleteaddress/',
         columns : [
-            {
-                text : "序号", 
-                dataIndex : "ca_detno", 
-                width : 100, 
-                xtype : "numbercolumn",
-                align : 'center',
-                format:'0',
-                summaryType: 'count',
-                summaryRenderer: function(value, summaryData, dataIndex) {
-                    return Ext.String.format('合计: {0}条', value);
-                },
-            }, 
             {
                 text : "ID", 
                 dataIndex : "id", 

+ 1 - 13
frontend/saas-web/app/view/document/vendor/panel/FormPanel.js

@@ -147,22 +147,10 @@ Ext.define('saas.view.document.vendor.panel.FormPanel', {
         columnWidth : 0.25
     }, {
         xtype : "detailGridField", 
-        _detnoColumn:  'vc_detno',
+        detnoColumn:  'vc_detno',
         storeModel:'saas.model.document.vendorcontact',
         _deleteDetailUrl:'http://192.168.253.228:9480/vendor/deletecontact/',
         columns : [
-            {
-                text : "序号", 
-                dataIndex : "vc_detno", 
-                width : 100, 
-                xtype : "numbercolumn",
-                align : 'center',
-                format:'0',
-                summaryType: 'count',
-                summaryRenderer: function(value, summaryData, dataIndex) {
-                    return Ext.String.format('合计: {0}条', value);
-                },
-            },
             {
                 text : "ID", 
                 dataIndex : "id", 

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

@@ -91,21 +91,9 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
         name : "detailGridField", 
         xtype : "detailGridField", 
         storeModel:'saas.model.purchase.ProdIODetail',
-        _detnoColumn:  'pd_detno',
+        detnoColumn:  'pd_detno',
         columns : [
             {
-                text : "序号", 
-                dataIndex : "pd_detno", 
-                width : 100, 
-                xtype : "numbercolumn",
-                align : 'center',
-                format:'0',
-                summaryType: 'count',
-                locked:true,
-                summaryRenderer: function(value, summaryData, dataIndex) {
-                    return Ext.String.format('合计: {0}条', value);
-                },
-            }, {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn"

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

@@ -5,7 +5,7 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
         var me = this;
         this.control({
             //主表单选放大镜模板
-            'dbfindtrigger[name=pu_vendcode]':{
+            'dbfindtrigger[name=pu_vendname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         //数据接口

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

@@ -103,20 +103,9 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         name : "detailGridField", 
         xtype : "detailGridField",
         storeModel:'saas.model.document.Product', 
-        _detnoColumn:  'pd_pdno',
+        detnoColumn:  'pd_pdno',
         columns : [
             {
-                text : "序号", 
-                dataIndex : "pd_pdno", 
-                width : 100, 
-                xtype : "numbercolumn",
-                align : 'center',
-                format:'0',
-                summaryType: 'count',
-                summaryRenderer: function(value, summaryData, dataIndex) {
-                    return Ext.String.format('合计: {0}条', value);
-                },
-            }, {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn"

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

@@ -109,10 +109,6 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         defaultCondition:' pi_class = 采购验收单',
         baseVastUrl:"http://localhost:8800/prodinout/",
         baseColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
-        }, {
             text: 'id',
             dataIndex: 'id',
             width: 100,
@@ -155,12 +151,6 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
             flex: 1
         }],
         relativeColumn: [{
-            text : "序号", 
-            dataIndex : "pd_pdno", 
-            width : 100, 
-            xtype : "numbercolumn",
-            align : 'center'
-        }, {
             text: 'id',
             dataIndex: 'pu_id',
             width: 0,

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

@@ -101,20 +101,9 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
         name : "detailGridField", 
         xtype : "detailGridField", 
         storeModel:'saas.model.purchase.ProdIODetail', 
-        _detnoColumn:  'pd_pdno',
+        detnoColumn:  'pd_pdno',
         columns : [
             {
-                text : "序号", 
-                dataIndex : "pd_pdno", 
-                width : 100, 
-                xtype : "numbercolumn",
-                align : 'center',
-                format:'0',
-                summaryType: 'count',
-                summaryRenderer: function(value, summaryData, dataIndex) {
-                    return Ext.String.format('合计: {0}条', value);
-                },
-            }, {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn"

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

@@ -114,10 +114,6 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
         defaultCondition:' pi_class = \'采购验退单\'',
         baseVastUrl:basePath+'purchase/prodinout/',
         baseColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
-        }, {
             text: 'id',
             dataIndex: 'id',
             width: 100,
@@ -160,12 +156,6 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
             flex: 1
         }],
         relativeColumn: [{
-            text : "序号", 
-            dataIndex : "pd_pdno", 
-            width : 100, 
-            xtype : "numbercolumn",
-            align : 'center'
-        }, {
             text: 'id',
             dataIndex: 'pu_id',
             width: 0,

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

@@ -116,21 +116,10 @@ Ext.define('saas.view.sale.sale.FormPanel', {
         name : "detailGridField", 
         xtype : "detailGridField", 
         storeModel:'saas.model.sale.Saledetail',
-        _detnoColumn:  'sd_detno',
+        detnoColumn:  'sd_detno',
         columnWidth : 1,
         columns : [
             {
-                text : "序号", 
-                dataIndex : "sd_detno", 
-                width : 100, 
-                xtype : "numbercolumn",
-                align : 'center',
-                format:'0',
-                summaryType: 'count',
-                summaryRenderer: function(value, summaryData, dataIndex) {
-                    return Ext.String.format('合计: {0}条', value);
-                },
-            }, {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn"

+ 0 - 8
frontend/saas-web/app/view/sale/sale/QueryPanel.js

@@ -112,10 +112,6 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         defaultCondition:'',
         baseVastUrl: basePath+'sale/sale/',
         baseColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
-        }, {
             text: 'id',
             dataIndex: 'sa_id',
             width: 100,
@@ -144,10 +140,6 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             width: 120
         }],
         relativeColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
-        }, {
             text: 'id',
             dataIndex: 'sa_id',
             width: 100,

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

@@ -71,20 +71,9 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
         name : "detailGridField", 
         xtype : "detailGridField", 
         storeModel:'saas.model.sale.ProdIODetail',
-        _detnoColumn:  'pd_pdno',
+        detnoColumn:  'pd_pdno',
         columns : [
             {
-                text : "序号", 
-                dataIndex : "pd_pdno", 
-                width : 100, 
-                xtype : "numbercolumn",
-                align : 'center',
-                format:'0',
-                summaryType: 'count',
-                summaryRenderer: function(value, summaryData, dataIndex) {
-                    return Ext.String.format('合计: {0}条', value);
-                },
-            }, {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn"

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

@@ -95,10 +95,6 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
         defaultCondition:' pi_class = \'销售退货单\'',
         baseVastUrl: basePath+'sale/prodinout/',
         baseColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
-        }, {
             text: 'id',
             dataIndex: 'id',
             width: 100,
@@ -141,12 +137,6 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
             flex: 1
         }],
         relativeColumn: [{
-            text : "序号", 
-            dataIndex : "pd_pdno", 
-            width : 100, 
-            xtype : "numbercolumn",
-            align : 'center'
-        }, {
             text: 'id',
             dataIndex: 'pu_id',
             width: 0,

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

@@ -94,10 +94,6 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
         defaultCondition:' pi_class = \'销售出货单\'',
         baseVastUrl: basePath+'sale/prodinout/',
         baseColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
-        }, {
             text: 'id',
             dataIndex: 'id',
             width: 100,
@@ -140,12 +136,6 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
             flex: 1
         }],
         relativeColumn: [{
-            text : "序号", 
-            dataIndex : "pd_pdno", 
-            width : 100, 
-            xtype : "numbercolumn",
-            align : 'center'
-        }, {
             text: 'id',
             dataIndex: 'pu_id',
             width: 0,

+ 1 - 12
frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js

@@ -43,20 +43,9 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
         name : "detailGridField", 
         xtype : "detailGridField", 
         storeModel:'saas.model.stock.ProdIODetail',
-        _detnoColumn:  'pd_pdno',
+        detnoColumn:  'pd_pdno',
         columns : [
             {
-                text : "序号", 
-                dataIndex : "pd_pdno", 
-                width : 100, 
-                xtype : "numbercolumn",
-                align : 'center',
-                format:'0',
-                summaryType: 'count',
-                summaryRenderer: function(value, summaryData, dataIndex) {
-                    return Ext.String.format('合计: {0}条', value);
-                },
-            }, {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",

+ 0 - 8
frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js

@@ -119,10 +119,6 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
         defaultCondition:' pi_class = \'调拨单\'',
         baseVastUrl: basePath+'storage/prodinout/',
         baseColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
-        }, {
             text: 'id',
             dataIndex: 'id',
             width: 100,
@@ -157,10 +153,6 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
             flex: 1
         }],
         relativeColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
-        }, {
             text: 'id',
             dataIndex: 'id',
             width: 100,

+ 1 - 13
frontend/saas-web/app/view/stock/make/FormPanel.js

@@ -91,21 +91,9 @@ Ext.define('saas.view.stock.make.FormPanel', {
         name : "detailGridField", 
         xtype : "detailGridField", 
         storeModel:'saas.model.document.Product',
-        _detnoColumn:  'pd_detno',
+        detnoColumn:  'pd_detno',
         columns : [
             {
-                text : "序号", 
-                dataIndex : "mm_detno", 
-                width : 100, 
-                xtype : "numbercolumn",
-                align : 'center',
-                format:'0',
-                summaryType: 'count',
-                locked:true,
-                summaryRenderer: function(value, summaryData, dataIndex) {
-                    return Ext.String.format('合计: {0}条', value);
-                },
-            }, {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn"

+ 1 - 12
frontend/saas-web/app/view/stock/otherIn/FormPanel.js

@@ -45,20 +45,9 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
         name : "detailGridField", 
         xtype : "detailGridField", 
         storeModel:'saas.model.stock.ProdIODetail',
-        _detnoColumn:  'pd_pdno',
+        detnoColumn:  'pd_pdno',
         columns : [
             {
-                text : "序号", 
-                dataIndex : "pd_pdno", 
-                width : 100, 
-                xtype : "numbercolumn",
-                align : 'center',
-                format:'0',
-                summaryType: 'count',
-                summaryRenderer: function(value, summaryData, dataIndex) {
-                    return Ext.String.format('合计: {0}条', value);
-                },
-            }, {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",

+ 0 - 10
frontend/saas-web/app/view/stock/otherIn/QueryPanel.js

@@ -95,10 +95,6 @@ Ext.define('saas.view.stock.otherIn.QueryPanel', {
         defaultCondition:' pi_class = \'其它入库单\'',
         baseVastUrl: basePath+'storage/prodinout/',
         baseColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
-        }, {
             text: 'id',
             dataIndex: 'id',
             width: 100,
@@ -137,12 +133,6 @@ Ext.define('saas.view.stock.otherIn.QueryPanel', {
             flex: 1
         }],
         relativeColumn: [{
-            text : "序号", 
-            dataIndex : "pd_pdno", 
-            width : 100, 
-            xtype : "numbercolumn",
-            align : 'center'
-        }, {
             text: 'id',
             dataIndex: 'pu_id',
             width: 0,

+ 1 - 12
frontend/saas-web/app/view/stock/otherOut/FormPanel.js

@@ -45,20 +45,9 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
         name : "detailGridField", 
         xtype : "detailGridField", 
         storeModel:'saas.model.stock.ProdIODetail',
-        _detnoColumn:  'pd_pdno',
+        detnoColumn:  'pd_pdno',
         columns : [
             {
-                text : "序号", 
-                dataIndex : "pd_pdno", 
-                width : 100, 
-                xtype : "numbercolumn",
-                align : 'center',
-                format:'0',
-                summaryType: 'count',
-                summaryRenderer: function(value, summaryData, dataIndex) {
-                    return Ext.String.format('合计: {0}条', value);
-                },
-            }, {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",

+ 0 - 8
frontend/saas-web/app/view/stock/otherOut/QueryPanel.js

@@ -100,10 +100,6 @@ Ext.define('saas.view.stock.otherOut.QueryPanel', {
         defaultCondition:' pi_class = \'其它出库单\'',
         baseVastUrl: basePath+'storage/prodinout/',
         baseColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
-        }, {
             text: 'id',
             dataIndex: 'id',
             width: 100,
@@ -138,10 +134,6 @@ Ext.define('saas.view.stock.otherOut.QueryPanel', {
             flex: 1
         }],
         relativeColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
-        }, {
             text: 'id',
             dataIndex: 'id',
             width: 100,