|
|
@@ -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
|