Browse Source

单据关闭提示调整/从表最小高度逻辑/

zhuth 7 years ago
parent
commit
e375d2e15a

+ 4 - 6
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -34,6 +34,7 @@ Ext.define('saas.view.core.form.FormPanel', {
     invalidText: '表单校验有误,请检查后重试', // 校验未通过提示内容
     dirtyAuditText: '表单数据有修改,是否先保存修改?', // 有修改时点击审核提示内容
     noDirtySaveText: '表单数据无修改', // 无修改点击保存提示内容
+    dirtyCloseText: '表单数据有修改,确认要离开吗?', // 有修改时点击关闭提示内容
 
     auditTexts: {
         auditCode: 'AUDITED',
@@ -617,15 +618,12 @@ Ext.define('saas.view.core.form.FormPanel', {
         controller = me.getController();
 
         if(me.isDirty()) {
-            return saas.util.BaseUtil.showConfirm('提示', '表单数据有修改,离开前要保存吗?', {
-                buttons: Ext.Msg.YESNOCANCEL
+            return saas.util.BaseUtil.showConfirm('提示', me.dirtyCloseText, {
+                buttons: Ext.Msg.YESNO
             }).then(function(yes) {
                 if(yes === 'yes') {
-                    controller.onSave();
-                    return false;
-                }else if(yes === 'no') {
                     return true;
-                }else {
+                }else if(yes === 'no') {
                     return false
                 }
             })

+ 1 - 0
frontend/saas-web/app/view/core/form/FormPanel.scss

@@ -74,6 +74,7 @@
             font-weight: bold;
             height: 100%;
             line-height: 100%;
+            font-size: 14px;
             vertical-align: middle;
 
             &:before {

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

@@ -68,15 +68,19 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             listeners: {
                 boxready: function(g) {
                     var f = g.ownerCt,
-                    ih = g.initialConfig.height,
+                    ih = g.initialConfig.height || 0,
+                    iminh = g.initialConfig.minHeight || 0,
+                    // 最小高度等于设定的最小高度或者设定的高度
+                    minh = ih ? (iminh ? Math.min(ih, iminh) : 0) : iminh,
                     c = f.detailCount || 1,
                     fb = f.getBox(),
                     fh = fb.height,
                     h = (fh * 0.5) / c;
 
-                    if(ih) {
-                        g.setMinHeight(ih);
-                        h = ih;
+                    // 当自适应高度比设定的最小高度还要小时取设定的最小高度
+                    if(minh && h < minh) {
+                        g.setMinHeight(minh);
+                        h = minh;
                     }
                     g.setHeight(h);
                 },

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

@@ -235,12 +235,13 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 name : "cu_remark",
                 columnWidth : 1
             }, {
-                xtype : "detailGridField", 
+                xtype : "detailGridField",
+                name: 'detailGridField',
                 storeModel:'saas.model.document.customercontact',
                 detnoColumn: 'cc_detno',
                 showCount: false,
                 deleteDetailUrl:'/api/document/customer/deletecontact',
-                // minHeight:145,
+                minHeight:145,
                 emptyRows: 3,
                 columns : [
                     {
@@ -300,12 +301,13 @@ Ext.define('saas.view.document.customer.FormPanel', {
                         xtype : "yncolumn"
                     }]
             } ,{
-                xtype : "detailGridField", 
+                xtype : "detailGridField",
+                name: 'detailGridField',
                 storeModel:'saas.model.document.customeraddress',
                 detnoColumn: 'ca_detno',
                 showCount: false,
                 deleteDetailUrl:'/api/document/customer/deleteaddress',
-                // height:145,
+                minHeight:145,
                 emptyRows: 3,
                 columns : [
                     {

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

@@ -397,6 +397,36 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 name: "sa_auditdate",
                 fieldLabel: "审核日期",
                 readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "sa_text1",
+                fieldLabel: "自定义字段1",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "sa_text2",
+                fieldLabel: "自定义字段2",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "sa_text3",
+                fieldLabel: "自定义字段3",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "sa_text4",
+                fieldLabel: "自定义字段4",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "sa_text5",
+                fieldLabel: "自定义字段5",
+                hidden: true,
+                initHidden: false
             }],
             toolBtns: [{
                 xtype: 'button',