Browse Source

代码提交

hy 7 years ago
parent
commit
bdd5a6064f

+ 38 - 4
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -9,23 +9,54 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
     modal: true,
     width: 500,
     //工具类
-    height: 260,
+    height: 280,
     listeners:{
       show:function(w){
-          if(w.record){
-              w.down('form').loadRecord(w.record);
-          }
           //自动适应窗口
           var items = w.down('form').items.items;
           var count = 0;
+          var codeField;
           Ext.Array.each(items,function(item) {
             if(item.xtype!='hidden'){
                 count++;
             }
+            if(item.autoCode){
+                codeField = item.name
+            }
           });
           if(count!=0&&count<4){
             w.setHeight(114+40*count)
           }
+          if(w.record){
+              w.down('form').loadRecord(w.record);
+          }else{
+              //判断是否有code字段
+              if(codeField){
+                w.setLoading(true);
+                //取后台编号
+                var caller = w._parent.caller;
+                saas.util.BaseUtil.request({
+                    url: '/api/commons/number/getMaxnumber',
+                    headers: {
+                        "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
+                    },
+                    params: {
+                        caller:caller
+                    },
+                    method: 'POST',
+                }).then(function(res) {
+                    w.setLoading(false);
+                    if(res.success){
+                        w.down('[name='+codeField+']').setValue(res.data);
+                    }else {
+                        saas.util.BaseUtil.showErrorToast(res.message);
+                    }
+                }).catch(function(res) {
+                    saas.util.BaseUtil.showErrorToast(res.message);
+                    w.setLoading(true);
+                })
+              }
+          }
       }
     },
     initComponent:function(){
@@ -107,6 +138,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 name:'bk_bankcode',
                 allowBlank:false,
                 fieldLabel:'账户编号',
+                autoCode:true,
                 maxLength: 20
             },{
                 xtype:'textfield',
@@ -389,6 +421,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 xtype:'textfield',
                 fieldLabel: '仓库编号',
                 name: 'wh_code',
+                autoCode:true,
                 allowBlank:false,
                 maxLength: 20
             },{
@@ -438,6 +471,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
             },{
                 xtype:'textfield',
                 fieldLabel: '人员编号',
+                autoCode:true,
                 name: 'em_code',
                 allowBlank:false,
                 maxLength: 20

+ 1 - 1
frontend/saas-web/app/view/document/kind/Kind.js

@@ -266,7 +266,7 @@ Ext.define('saas.view.document.kind.Kind', {
             },{
                 dataIndex: 'email',
             }],
-            reqUrl: 'http://192.168.253.31:8560/api/account/account/register/add',
+            reqUrl: '/api/account/account/register/add',
         },
         employee:{
             columns: [{

+ 1 - 0
frontend/saas-web/app/view/document/other/BankInformation.js

@@ -6,6 +6,7 @@ Ext.define('saas.view.document.other.BankInformation', {
     xtype: 'other-bankinformation',
     autoScroll: true,
     layout:'fit',
+    caller:'BankInformation',
     defaultType:'bankinformation',
     tbar: ['->',{
         xtype:'button',

+ 1 - 0
frontend/saas-web/app/view/document/other/Employee.js

@@ -3,6 +3,7 @@ Ext.define('saas.view.document.other.Employee', {
     xtype: 'other-employee',
     autoScroll: true,
     layout:'fit',
+    caller:'Employee',
     _openUrl:'/api/document/employee/open',
     _closeUrl:'/api/document/employee/close',
     defaultType:'employee',

+ 1 - 0
frontend/saas-web/app/view/document/other/Warehouse.js

@@ -3,6 +3,7 @@ Ext.define('saas.view.document.other.Warehouse', {
     xtype: 'other-warehouse',
     autoScroll: true,
     layout:'fit',
+    caller:'Warehouse',
     _openUrl:'/api/document/warehouse/open',
     _closeUrl:'/api/document/warehouse/close',
     defaultType:'warehouse',