--delete System_ModuleFormat where module='Dialog_DefineItem_List'
--插入[选择自定义项]界面格式
if(select count(1) from System_ModuleFormat where module='Dialog_DefineItem_List' and field='di_id')=0
begin
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'Dialog_DefineItem_List' as module,'di_id' as field,
	'ID' as field_name,'ID' as title,
	60 as width,10 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'Dialog_DefineItem_List' as module,'di_value' as field,
	'值' as field_name,'值' as title,
	200 as width,20 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
end
/**/GO
--插入自定义项档案_录入界面格式
--delete System_ModuleFormat where module='Dialog_DefineItem_Input'
if(select count(1) from System_ModuleFormat where module='Dialog_DefineItem_Input' and field='di_id')=0
begin
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'Dialog_DefineItem_Input' as module,'di_id' as field,
	'ID' as field_name,'ID' as title,
	120 as width,100 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'Dialog_DefineItem_Input' as module,'di_value' as field,
	'自定义项值' as field_name,'自定义项值' as title,
	200 as width,110 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
end
/**/GO

--插入[批次选择]界面格式
--delete System_ModuleFormat where module='Dialog_Batch_List'
if(select count(1) from System_ModuleFormat where module='Dialog_Batch_List' and field='batch')=0
begin
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'Dialog_Batch_List' as module,'i_code' as field,
	'存货编码' as field_name,'存货编码' as title,
	120 as width,100 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'Dialog_Batch_List' as module,'i_name' as field,
	'存货名称' as field_name,'存货名称' as title,
	100 as width,110 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'Dialog_Batch_List' as module,'free1' as field,
	'自由项1' as field_name,'自由项1' as title,
	70 as width,130 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'Dialog_Batch_List' as module,'free2' as field,
	'自由项2' as field_name,'自由项2' as title,
	70 as width,140 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'Dialog_Batch_List' as module,'batch' as field,
	'批次' as field_name,'批次' as title,
	80 as width,150 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'Dialog_Batch_List' as module,'quantity' as field,
	'结存数量' as field_name,'结存数量' as title,
	80 as width,200 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'Dialog_Batch_List' as module,'num' as field,
	'结存件数' as field_name,'结存件数' as title,
	80 as width,210 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,0 as can_edit;
end
/**/GO
--插入[员工选择]界面格式
--delete System_ModuleFormat where module='Dialog_Employee_List'
if(select count(1) from System_ModuleFormat where module='Dialog_Employee_List' and field='ele_id')=0
begin
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field)
	select 'Dialog_Employee_List' as module,'ele_id' as field,
	'员工ID' as field_name,'员工ID' as title,
	50 as width,100 as sort,0 as show,0 as hidden,0 as sum_field;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field)
	select 'Dialog_Employee_List' as module,'ele_code' as field,
	'员工编码' as field_name,'员工编码' as title,
	80 as width,110 as sort,1 as show,0 as hidden,0 as sum_field;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field)
	select 'Dialog_Employee_List' as module,'ele_name' as field,
	'员工名称' as field_name,'员工名称' as title,
	80 as width,120 as sort,1 as show,0 as hidden,0 as sum_field;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field)
	select 'Dialog_Employee_List' as module,'dep_name' as field,
	'所属部门' as field_name,'所属部门' as title,
	80 as width,130 as sort,1 as show,0 as hidden,0 as sum_field;
	end
/**/GO
