Browse Source

单据日期默认值/显示合计栏支持配置

zhuth 7 years ago
parent
commit
b6a4730c83

+ 5 - 0
frontend/saas-web/Readme.md

@@ -93,6 +93,7 @@ viewModel: view.core.form.FormPanelModel
 | detnoColumn | 序号列,配置该项后无需再columns定义序号列 | √ | "pud_detno" |
 | deleteDetailUrl | 删除明细接口 | √ | "/api/purchase/purchase/deleteItem" |
 | allowEmpty | 是否允许从表数据为空,为真时表单校验不会校验从表非dirty数据,无数据时也可以保存 | x | false |
+| showCount | 是否显示合计栏 | x | true |
 | columns[i].ignore | 是否忽略,为真时在调用保存方法时不会取到该列值 | x | true |
 | columns[i].allowBlank | 是否必填列 | x | true |
 | columns[i].isValid | 自定义校验规则,传入value,返回boolean | x | function(v) { return v > 10; } |
@@ -168,5 +169,9 @@ deleteDetailUrl 配置调整 formpanel.form->formpanel.detailGridField
 
 从表默认值配置说明
 
+- 2018-11-1 17:52:58
+
+从表显示合计栏配置说明
+
 
 

+ 12 - 4
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -28,6 +28,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
     configUrl: '',
     editable: true,
     allowEmpty: false, // 校验时只校验dirty数据
+    showCount: true, // 显示合计栏
 
     initComponent: function() {
         var me = this;
@@ -110,6 +111,8 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         var me = this,
         columns = me.columns,
         detnoField = me.detnoColumn,
+        showCount = me.showCount,
+
         indexColumn = {
             text : "序号", 
             dataIndex : detnoField, 
@@ -118,12 +121,8 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             align : 'center',
             format:'0',
             allowBlank: true,
-            summaryType: 'count',
             locked:true,
             lockable: false,
-            summaryRenderer: function(value, summaryData, dataIndex) {
-                return Ext.String.format('合计', value);
-            },
             renderer: function(value, a, record, index) {
                 return '<div class="text">' + value + '</div>' +
                 '<div class="icons" style="height: 19px; display: none;">' + 
@@ -133,6 +132,15 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             },
         };
 
+        if(showCount) {
+            Ext.apply(indexColumn, {
+                summaryType: 'count',
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计', value);
+                },
+            });
+        }
+
         if (detnoField) {
             Ext.apply(me, { columns: [indexColumn].concat(columns) });
         }

+ 3 - 1
frontend/saas-web/app/view/document/bom/FormPanel.js

@@ -55,7 +55,9 @@ Ext.define('saas.view.document.bom.FormPanel', {
         name : "updateTime", 
         fieldLabel : "更新时间"
     }, {
-        xtype : "detailGridField", 
+        xtype : "detailGridField",
+        detnoColumn: 'bd_detno',
+        showCount: false,
         storeModel:'saas.model.document.bomdetail',
         deleteDetailUrl:'/api/document/bom/deleteDetail/',
         columns : [

+ 4 - 0
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -139,6 +139,8 @@ Ext.define('saas.view.document.customer.FormPanel', {
         height: 169,
         xtype : "detailGridField", 
         storeModel:'saas.model.document.customercontact',
+        detnoColumn: 'cc_detno',
+        showCount: false,
         deleteDetailUrl:'/api/document/customer/deletecontact/',
         columns : [
             {
@@ -230,6 +232,8 @@ Ext.define('saas.view.document.customer.FormPanel', {
         height: 169,
         xtype : "detailGridField", 
         storeModel:'saas.model.document.customeraddress',
+        detnoColumn: 'ca_detno',
+        showCount: false,
         deleteDetailUrl:'/api/document/customer/deleteaddress/',
         columns : [
             {

+ 2 - 0
frontend/saas-web/app/view/document/vendor/FormPanel.js

@@ -137,6 +137,8 @@ Ext.define('saas.view.document.vendor.FormPanel', {
     }, {
         xtype : "detailGridField", 
         storeModel:'saas.model.document.vendorcontact',
+        detnoColumn: 'vc_detno',
+        showCount: false,
         deleteDetailUrl:'/api/document/vendor/deleteContact/',
         columns : [
             {

+ 2 - 1
frontend/saas-web/app/view/money/fundtransfer/FormPanel.js

@@ -29,7 +29,8 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
     }, {
         xtype : "datefield", 
         name : "ft_date", 
-        fieldLabel : "单据日期"
+        fieldLabel : "单据日期",
+        defaultValue: new Date()
     }, {
         name : "detailGridField", 
         xtype : "detailGridField", 

+ 2 - 1
frontend/saas-web/app/view/money/payBalance/FormPanel.js

@@ -141,7 +141,8 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
             dataIndex: "pbd_slkind",
         }, {
             text: "单据日期",
-            dataIndex: "pbd_sldate"
+            dataIndex: "pbd_sldate",
+            defaultValue: new Date()
         }, {
             text: "单据金额",
             dataIndex: "pbd_amount"

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

@@ -81,7 +81,8 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         bind : "{pi_date}", 
         fieldLabel : "单据日期", 
         allowBlank : false, 
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        defaultValue: new Date()
     },{
         xtype : "textfield", 
         name : "pi_total", 

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

@@ -73,7 +73,8 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
         bind : "{pi_date}", 
         fieldLabel : "单据日期", 
         allowBlank : false, 
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        defaultValue: new Date()
     },{
         xtype : "textfield", 
         name : "pi_total", 

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

@@ -91,7 +91,8 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
         bind : "{pi_date}", 
         fieldLabel : "单据日期", 
         allowBlank : false, 
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        defaultValue: new Date()
     }
     // ,{
     //     xtype : "textfield", 

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

@@ -89,7 +89,8 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
         bind : "{pi_date}", 
         fieldLabel : "单据日期", 
         allowBlank : false, 
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        defaultValue: new Date()
     },{
         xtype : "textfield", 
         name : "pi_total",