主表字段

绑定单据类型

明细列表

添加字段同列表字段一样,需注意可编辑字段需选择允许编辑

// 删除选择行
tabPage.tabPage0.detailTable.deleteSelectRow(function(){
//解除对主表的控制
if(0==tabPage.tabPage0.detailTable.getData().length){
inputForm.disabled(‘WAREHOUSE_NAME’,false);
inputForm.disabled(‘COMPANY_NAME’,false);
}
});

增加费用tab


if(eventType==’getOptions’){
var opts = {};
//主表信息 必传
opts.inputForm = inputForm;
//选择记录 必传
opts.selectRows = tabPage.tabPage0.detailTable.getSelectRows();
//结算量字段 默认GOODS_WEIGHT
opts.weightCol = ‘GOODS_WEIGHT’;
return opts;
}

同理再增加工作量tab页

if(‘getOptions’==eventType){
var opts = {};
//主表
opts.inputForm = inputForm;
return opts;
}

设置打开界面初始化值


if(openType==’new’){
var user=gUtil.getUserInfo();
inputForm.set(‘OWNEROUT_DATE’,gUtil.formatDate(new Date(), ‘yyyy-MM-dd hh:mm’));
inputForm.set(‘ORG_CODE’,user.exts.ORG_CODE);
inputForm.set(‘DEPT_CODE’,user.exts.DEPT_CODE);
inputForm.set(‘EMPLOYEE_NAME’,user.userName);
inputForm.set(‘EMPLOYEE_CODE’,user.userId);
inputForm.set(‘OPERATOR_NAME’,user.userName);
inputForm.set(‘OPERATOR_CODE’,user.userId);
//获取机构名称
var param={‘tableId’:’BASIC_ORG’,’dataField0’:user.exts.ORG_CODE};
Gdpaas.doPlugin.post(‘com.golden.basic.cache.beanCache’,param,function(result){
inputForm.set(‘ORG_NAME’,result.bean.ORG_ABBREVIATE);
});
//获取部门名称
var param={‘tableId’:’BASIC_DEPT’,’dataField0’:user.exts.DEPT_CODE};
Gdpaas.doPlugin.post(‘com.golden.basic.cache.beanCache’,param,function(result){
inputForm.set(‘DEPT_NAME’,result.bean.DEPT_NAME);
});
}else if(openType==’audit’){
//设置按钮
$auditUtil.swapButton(self);
//赋值页面属性
selfPage.billParams = args;
}

设置修改时主表字段控制不可修改

用主表的aferload事件,是等主表加载完成后,可以获取主表值,有时候需要根据主表值来判断隐藏

inputForm.disabled(‘WAREHOUSE_NAME’,true);
inputForm.disabled(‘COMPANY_NAME’,true);

文档更新时间: 2021-06-28 10:23   作者:liweiyu