Fork me on GitHub

portal开发"下拉框"“日期框”查询要怎么配置

下面的这些是我今天的成果!

总的来说是一步一步摸索出来的!还是等感谢超哥的耐心指导,犯了一些错误!

1.比如在wd配置文件中中写id=“check_it_two”,在java中写成 checki_it_two

2.页面实现水平布局用<FlowhPanel>

 1 <?xml version="1.0" encoding='UTF-8'?>
 2 <UIMeta flowmode="true" id="main" preferredHeight="" preferredWidth="">
 3     <FlowvLayout id="flowvLayout" widgetId="main">
 4         <FlowvPanel id="g_p_1">
 5             <CanvasLayout className="rightcanvas" id="listmenubarCanvas">
 6                 <CanvasPanel id="canvasp">
 7                     <Menubar height="100%" id="menu_list" left="0" position="relative" top="0" width="100%">
 8                     </Menubar>
 9                 </CanvasPanel>
10             </CanvasLayout>
11         </FlowvPanel>
12         <FlowhPanel id="panelv065281" widgetId="main">
13             <Label height="18" id="lable" left="0" position="relative" textAlign="left" top="0" widgetId="main">
14             </Label>
15         </FlowhPanel>
16          <FlowhPanel id="g_p_3" widgetId="main">
17             <TextField height="22" id="check_it_now" imgsrc="" left="0" position="relative" top="0" type="text" widgetId="main" width="15%">
18             </TextField>
19         </FlowhPanel> 
20         <FlowhPanel id="g_p_4" widgetId="main">
21             <Button height="23" id="select_confirm" left="0" position="relative" top="0" widgetId="main" width="64">
22             </Button>
23         </FlowhPanel>
24          <FlowhPanel id="panelv065282" widgetId="main">
25             <Label height="22" id="lable1" left="0" position="relative" textAlign="left" top="0" widgetId="main">
26             </Label>
27         </FlowhPanel>            
28            <FlowhPanel id="g_p_5" widgetId="main">
29             <TextField height="22" id="check_it_two" imgsrc="" left="0" position="relative" top="0" type="text" widgetId="main" width="100%">
30             </TextField>
31         </FlowhPanel>
32          <FlowhPanel id="g_p_6" widgetId="main">
33             <Button height="23" id="select_confirm_two" left="0" position="relative" top="0" widgetId="main" width="64">
34             </Button>
35         </FlowhPanel>
36         <FlowhPanel id="panelv065283" widgetId="main">
37             <Label height="22" id="lable2" left="0" position="relative" textAlign="left" top="0" widgetId="main">
38             </Label>
39         </FlowhPanel>    
40         <FlowhPanel id="g_p_7" widgetId="main">
41             <TextField height="22" id="check_it_three" imgsrc="" left="0" position="relative" top="0" type="text" widgetId="main" width="100%">
42             </TextField>
43         </FlowhPanel>
44         <FlowhPanel id="g_p_8" widgetId="main">
45             <Button height="23" id="select_confirm_three" left="0" position="relative" top="0" widgetId="main" width="64">
46             </Button>
47         </FlowhPanel>
48     
49         <FlowvPanel id="g_p_2">
50             <GridComp height="100%" id="leaveapply_grid" left="0" position="relative" top="0" width="100%">
51             </GridComp>
52         </FlowvPanel>
53     </FlowvLayout>
54     
55    
56 </UIMeta>
View Code

 

3.配置下拉框的时候要配置,数据来源,同时数据来源要配对应的数据来源,我当时配置到了另外一个数据源结果出来的数据是错误的!

第一个配置配置在 <Components>中,第二个配置在<Models>中

 1 <ComBoBoxComp i18nName="" langDir="" allowExtendValue="false" editorType="ComboBox" enabled="true" focus="false" id="check_it_two" refComboData="combo_leaveapply_approve_state" selectOnly="true" text="" textAlign="left" visible="true">
 2         </ComBoBoxComp>
 3         <ButtonComp i18nName="" langDir="" enabled="true" id="select_confirm_two" text="查询" visible="true">
 4             <Events>
 5                 <Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="onselect2" name="onclick" onserver="true">
 6                     <SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
 7                     </SubmitRule>
 8                     <Params>
 9                         <Param>
10                             <Name>mouseEvent</Name>
11                             <Value>
12                             </Value>
13                             <Desc>                                <![CDATA[nc.uap.lfw.core.event.MouseEvent]]>
14                             </Desc>
15                         </Param>
16                     </Params>
17                     <Action>
18                     </Action>
19                 </Event>
20             </Events>
21         </ButtonComp>
View Code
1 <ComboDatas>
2             <MDComboDataConf caption="单据状态" fullclassName="2ed33012-890c-4e5f-82a0-40ef0eeb4b45" id="combo_leaveapply_approve_state">
3             </MDComboDataConf>
4         </ComboDatas>
View Code

4.配置日期框是用的

<TextComp editorType="DateText" enabled="true" focus="false" i18nName="" id="check_it_three" langDir="" text="" textAlign="left" visible="true">
</TextComp>

在获取到日期框的时候还要转化类型

 1 public void onselect3(MouseEvent<MenuItem> mouseEvent){
 2         //获取相应的TextComp的值的方法
 3          TextComp checkComp = (TextComp) ViewUtil.getCurrentView().getViewComponents().getComponent("check_it_three");
 4          //对获取到的checkComp获取对象的value
 5          String checkname=checkComp.getValue()==null?"":checkComp.getValue();
 6         //日期类型转化--获取到的String先转化为long,转化为long之后再转化为Date,转化为Date之后再转化为String
 7          long l = Long.parseLong(checkname);
 8          Date date = new Date(l);
 9          SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
10          String checkname1=sdf.format(date)==null?"":sdf.format(date);         
11         //调用queryVOs2包中的方法查询到相应的数据
12          SuperVO[] vos = queryVOs4(checkname1);
13         //获取页面元素的util类
14             LfwView viewMain = ViewUtil.getCurrentView();
15             //获取对应的VO。这个应该是实体表的表名“leaveapply”,在配置文件中可以找到,要一一对应哦!
16             Dataset ds = viewMain.getViewModels().getDataset("leaveapply");
17             if (ds == null) {
18                 return;
19             }
20         //序列化
21          new SuperVO2DatasetSerializer().serialize(vos, ds, Row.STATE_NORMAL);        
22         
23     }
 1 /**
 2      * 按照日期by曾志伟
 3      * 
 4      * */
 5     protected SuperVO[] queryVOs4(String checkname1){
 6         //StringBuffer拼接数据库语句
 7         StringBuffer whereSQL=new StringBuffer();
 8         //拼接你传进来值
 9         whereSQL.append("apply_date='"+checkname1+"'");        
10         //实体对应的VO。我的理解相当于javabean
11         LeaveApplyVO[] hvos=null;
12         try{
13             //调用接口相应的查询方法---超哥跟我说过/要写接口,同时也要写实现类,接口是写在public中,
14             //实现类是写在private中,最后在/NC_HR_WEB6.3_150915/mw/META-INF中创建**.upm文件配置
15             hvos  = iLeaveApplyQueryMaintain.queryLeaveApplyVOByCondition(whereSQL.toString());
16 
17             
18         }catch(BusinessException e){
19             Logger.error(e.getMessage(),e);
20         }
21         
22         return hvos;
23     }

谢谢超哥的耐心指导,我会加把劲的!

出现这张截图是因为我当时那个下拉框没有配置数据来源

ctrl+H可以用关键词搜索 ,如下图

今天写的代码如下:

uimeta.um

 1 <?xml version="1.0" encoding='UTF-8'?>
 2 <UIMeta flowmode="true" id="main" preferredHeight="" preferredWidth="">
 3     <FlowvLayout id="flowvLayout" widgetId="main">
 4         <FlowvPanel id="g_p_1">
 5             <CanvasLayout className="rightcanvas" id="listmenubarCanvas">
 6                 <CanvasPanel id="canvasp">
 7                     <Menubar height="100%" id="menu_list" left="0" position="relative" top="0" width="100%">
 8                     </Menubar>
 9                 </CanvasPanel>
10             </CanvasLayout>
11         </FlowvPanel>
12         <FlowhPanel id="panelv065281" widgetId="main">
13             <Label height="18" id="lable" left="0" position="relative" textAlign="left" top="0" widgetId="main">
14             </Label>
15         </FlowhPanel>
16          <FlowhPanel id="g_p_3" widgetId="main">
17             <TextField height="22" id="check_it_now" imgsrc="" left="0" position="relative" top="0" type="text" widgetId="main" width="15%">
18             </TextField>
19         </FlowhPanel> 
20         <FlowhPanel id="g_p_4" widgetId="main">
21             <Button height="23" id="select_confirm" left="0" position="relative" top="0" widgetId="main" width="64">
22             </Button>
23         </FlowhPanel>
24          <FlowhPanel id="panelv065282" widgetId="main">
25             <Label height="22" id="lable1" left="0" position="relative" textAlign="left" top="0" widgetId="main">
26             </Label>
27         </FlowhPanel>            
28            <FlowhPanel id="g_p_5" widgetId="main">
29             <TextField height="22" id="check_it_two" imgsrc="" left="0" position="relative" top="0" type="text" widgetId="main" width="100%">
30             </TextField>
31         </FlowhPanel>
32          <FlowhPanel id="g_p_6" widgetId="main">
33             <Button height="23" id="select_confirm_two" left="0" position="relative" top="0" widgetId="main" width="64">
34             </Button>
35         </FlowhPanel>
36         <FlowhPanel id="panelv065283" widgetId="main">
37             <Label height="22" id="lable2" left="0" position="relative" textAlign="left" top="0" widgetId="main">
38             </Label>
39         </FlowhPanel>    
40         <FlowhPanel id="g_p_7" widgetId="main">
41             <TextField height="22" id="check_it_three" imgsrc="" left="0" position="relative" top="0" type="text" widgetId="main" width="100%">
42             </TextField>
43         </FlowhPanel>
44         <FlowhPanel id="g_p_8" widgetId="main">
45             <Button height="23" id="select_confirm_three" left="0" position="relative" top="0" widgetId="main" width="64">
46             </Button>
47         </FlowhPanel>
48     
49         <FlowvPanel id="g_p_2">
50             <GridComp height="100%" id="leaveapply_grid" left="0" position="relative" top="0" width="100%">
51             </GridComp>
52         </FlowvPanel>
53     </FlowvLayout>
54     
55    
56 </UIMeta>

widge.wd

  1 <?xml version="1.0" encoding='UTF-8'?>
  2 <Widget controllerClazz="nc.bs.hrss.hi.leave.LeaveApplyListWinMainViewCtrl" id="main" refId="main" sourcePackage="hi/src/public/">
  3     <PlugoutDescs>
  4     </PlugoutDescs>
  5     <PluginDescs>
  6         <PluginDesc id="inParam">
  7             <PluginDescItem clazztype="java.lang.String" id="appid">
  8             </PluginDescItem>
  9         </PluginDesc>
 10         <PluginDesc id="openMain">
 11         </PluginDesc>
 12         <PluginDesc id="refresh_plugin" methodName="pluginReSearch">
 13             <PluginDescItem clazztype="java.lang.String" id="OPERATE_ROW">
 14             </PluginDescItem>
 15         </PluginDesc>
 16     </PluginDescs>
 17     <Connectors>
 18         <Connector connType="6" id="listViewConnID" pluginId="refresh_plugin" plugoutId="proxyAfterSavePlugout" source="LeaveApplyList" sourceWindow="" target="main" targetWindow="">
 19         </Connector>
 20     </Connectors>
 21     <Events>
 22         <Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.DialogListener" methodName="onBeforeShow" name="beforeShow" onserver="true">
 23             <SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
 24             </SubmitRule>
 25             <Params>
 26                 <Param>
 27                     <Name>dialogEvent</Name>
 28                     <Value>
 29                     </Value>
 30                     <Desc> <![CDATA[nc.uap.lfw.core.event.DialogEvent]]> </Desc>
 31                 </Param>
 32             </Params>
 33             <Action>
 34             </Action>
 35         </Event>
 36         <!--<Event async="true" methodName="plugininParam" onserver="true">
 37             <Params>
 38                 <Param>
 39                     <Name>keys</Name>
 40                     <Value>
 41                     </Value>
 42                     <Desc> <![CDATA[java.util.Map]]> </Desc>
 43                 </Param>
 44             </Params>
 45             <Action>
 46             </Action>
 47         </Event>
 48         <Event async="true" methodName="pluginReSearch" onserver="true">
 49             <Params>
 50                 <Param>
 51                     <Name>keys</Name>
 52                     <Value>
 53                     </Value>
 54                     <Desc> <![CDATA[java.util.Map]]> </Desc>
 55                 </Param>
 56             </Params>
 57             <Action>
 58             </Action>
 59         </Event>-->
 60     </Events>
 61     <Models>
 62         <Datasets>
 63             <RefMdDataset caption="用户" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_user" lazyLoad="true" notNullBody="false" objMeta="uap.user" voMeta="nc.vo.sm.UserVO">
 64                 <Fields>
 65                 </Fields>
 66             </RefMdDataset>
 67             <MdDataset caption="休假申请" controlwidgetopeStatus="true" enabled="false" id="leaveapply" lazyLoad="true" notNullBody="false" objMeta="hrss.leaveapply" pageSize="15" voMeta="nc.vo.hrss.leaveapply.LeaveApplyVO">
 68                  <FieldRelations>
 69                     <FieldRelation id="transtypeid_rel" needProcess="true" refDataset="$refds_uap_BilltypeVO">
 70                         <MatchFields>
 71                             <Field readField="billtypename" writeField="transtypeid_name">
 72                             </Field>
 73                         </MatchFields>
 74                         <WhereField>
 75                             <Field key="pk_billtypeid" value="transtypeid">
 76                             </Field>
 77                         </WhereField>
 78                     </FieldRelation>
 79                     <FieldRelation id="pk_group_rel" needProcess="true" refDataset="$refds_uap_group" useCache="true">
 80                         <MatchFields>
 81                             <Field readField="name" writeField="pk_group_name">
 82                             </Field>
 83                         </MatchFields>
 84                         <WhereField>
 85                             <Field key="pk_group" value="pk_group">
 86                             </Field>
 87                         </WhereField>
 88                     </FieldRelation>
 89                     <FieldRelation id="pk_org_rel" needProcess="true" refDataset="$refds_uap_hrorg" useCache="true">
 90                         <MatchFields>
 91                             <Field readField="name" writeField="pk_org_name">
 92                             </Field>
 93                         </MatchFields>
 94                         <WhereField>
 95                             <Field key="pk_hrorg" value="pk_org">
 96                             </Field>
 97                         </WhereField>
 98                     </FieldRelation>
 99                     <FieldRelation id="billmaker_rel" needProcess="true" refDataset="$refds_uap_user" useCache="true">
100                         <MatchFields>
101                             <Field readField="user_name" writeField="billmaker_user_name">
102                             </Field>
103                         </MatchFields>
104                         <WhereField>
105                             <Field key="cuserid" value="billmaker">
106                             </Field>
107                         </WhereField>
108                     </FieldRelation>
109                     <FieldRelation id="approver_rel" needProcess="true" refDataset="$refds_uap_user" useCache="true">
110                         <MatchFields>
111                             <Field readField="user_name" writeField="approver_user_name">
112                             </Field>
113                         </MatchFields>
114                         <WhereField>
115                             <Field key="cuserid" value="approver">
116                             </Field>
117                         </WhereField>
118                     </FieldRelation>
119                     <FieldRelation id="creator_rel" needProcess="true" refDataset="$refds_uap_user" useCache="true">
120                         <MatchFields>
121                             <Field readField="user_name" writeField="creator_user_name">
122                             </Field>
123                         </MatchFields>
124                         <WhereField>
125                             <Field key="cuserid" value="creator">
126                             </Field>
127                         </WhereField>
128                     </FieldRelation>
129                     <FieldRelation id="modifier_rel" needProcess="true" refDataset="$refds_uap_user" useCache="true">
130                         <MatchFields>
131                             <Field readField="user_name" writeField="modifier_user_name">
132                             </Field>
133                         </MatchFields>
134                         <WhereField>
135                             <Field key="cuserid" value="modifier">
136                             </Field>
137                         </WhereField>
138                     </FieldRelation>
139                 </FieldRelations>
140                 <Fields>
141                     <Field dataType="String" i18nName="" id="leavetype_name" langDir="node_rm-res" nullAble="true" primaryKey="false" text="">
142                     </Field>
143                 </Fields>
144                 <Events>
145                     <Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.DatasetListener"  methodName="onDataLoad" name="onDataLoad" onserver="true">
146                         <SubmitRule>
147                         </SubmitRule>
148                         <Params>
149                             <Param>
150                                 <Name>dataLoadEvent</Name>
151                                 <Value>
152                                 </Value>
153                                 <Desc>                                    <![CDATA[]]>
154                                 </Desc>
155                             </Param>
156                         </Params>
157                         <Action>
158                         </Action>
159                     </Event>
160                     <Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.DatasetListener"  methodName="onAfterRowSelect" name="onAfterRowSelect" onserver="true">
161                         <SubmitRule>
162                         </SubmitRule>
163                         <Params>
164                             <Param>
165                                 <Name>datasetEvent</Name>
166                                 <Value>
167                                 </Value>
168                                 <Desc>                                    <![CDATA[nc.uap.lfw.core.event.DatasetEvent]]>
169                                 </Desc>
170                             </Param>
171                         </Params>
172                         <Action>
173                         </Action>
174                     </Event>
175                 </Events>
176             </MdDataset>
177             <RefMdDataset caption="单据类型" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_BilltypeVO" lazyLoad="true" notNullBody="false" objMeta="uap.BilltypeVO" voMeta="nc.vo.pub.billtype.BilltypeVO">
178                 <Fields>
179                 </Fields>
180             </RefMdDataset>
181             <RefMdDataset caption="组织_集团" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_group" lazyLoad="true" notNullBody="false" objMeta="uap.group" voMeta="nc.vo.org.GroupVO">
182                 <Fields>
183                 </Fields>
184             </RefMdDataset>
185             <RefMdDataset caption="工作记录" controlwidgetopeStatus="false" enabled="false" id="$refds_hrhi_hi_psnjob" lazyLoad="true" notNullBody="false" objMeta="hrhi.hi_psnjob" voMeta="nc.vo.hi.psndoc.PsnJobVO">
186                 <Fields>
187                 </Fields>
188             </RefMdDataset>
189             <RefMdDataset caption="人员基本信息" controlwidgetopeStatus="false" enabled="false" id="$refds_hrhi_bd_psndoc" lazyLoad="true" notNullBody="false" objMeta="hrhi.bd_psndoc" voMeta="nc.vo.hi.psndoc.PsndocVO">
190                 <Fields>
191                 </Fields>
192             </RefMdDataset>
193             <RefMdDataset caption="组织_业务单元_人力资源组织" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_hrorg" lazyLoad="true" notNullBody="false" objMeta="uap.hrorg" voMeta="nc.vo.org.HROrgVO">
194                 <Fields>
195                 </Fields>
196             </RefMdDataset>
197             <RefMdDataset caption="岗位基本信息" controlwidgetopeStatus="false" enabled="false" id="$refds_hrjf_om_post" lazyLoad="true" notNullBody="false" objMeta="hrjf.om_post" voMeta="nc.vo.om.post.PostVO">
198                 <Fields>
199                 </Fields>
200             </RefMdDataset>
201            <!-- <RefMdDataset caption="请假类别(自定义档案)" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_leavetype" lazyLoad="true" notNullBody="false" objMeta="uap.Defdoc-bgy-23" voMeta="nc.vo.bd.defdoc.DefdocVO">
202                 <Fields>
203                 </Fields>
204             </RefMdDataset>-->
205             <RefMdDataset caption="休假类别" controlwidgetopeStatus="false" enabled="false" id="$refds_hrta_leavetype" lazyLoad="true" notNullBody="false" objMeta="hrta.leavetype" voMeta="nc.vo.ta.timeitem.LeaveTypeVO">
206                 <Fields>
207                 </Fields>
208             </RefMdDataset>
209             <RefMdDataset caption="职级(自定义档案)" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_psnrank" lazyLoad="true" notNullBody="false" objMeta="uap.Defdoc-BGY03" voMeta="nc.vo.bd.defdoc.DefdocVO">
210                 <Fields>
211                 </Fields>
212             </RefMdDataset>
213             <RefMdDataset caption="工作制(自定义档案)" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_working" lazyLoad="true" notNullBody="false" objMeta="uap.Defdoc-BGY20" voMeta="nc.vo.bd.defdoc.DefdocVO">
214                 <Fields>
215                 </Fields>
216             </RefMdDataset>
217         </Datasets>
218         <ComboDatas>
219             <MDComboDataConf caption="单据状态" fullclassName="2ed33012-890c-4e5f-82a0-40ef0eeb4b45" id="combo_leaveapply_approve_state">
220             </MDComboDataConf>
221         </ComboDatas>
222         <RefNodes>
223              <NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_creator_user_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="cuserid,user_name" refId="" refcode="用户" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="creator,creator_user_name">
224             </NCRefNode>
225             <NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_billmaker_user_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="cuserid,user_name" refId="" refcode="用户" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="billmaker,billmaker_user_name">
226             </NCRefNode>
227             <NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_psncode" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="pk_psndoc,pk_psnjob,code,name,org_orgs_name,org_dept_name,postname" refId="" refcode="人员工作记录" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="pk_psndoc,pk_psnjob,psncode,psnname,psnorg,psndept,psnpost">
228             </NCRefNode>
229             <NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_pk_org_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="pk_hrorg,name" refId="" refcode="人力资源组织" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="pk_org,pk_org_name">
230             </NCRefNode>
231             <NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_modifier_user_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="cuserid,user_name" refId="" refcode="用户" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="modifier,modifier_user_name">
232             </NCRefNode>
233             <!--<NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_leavetype_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="pk_defdoc,name" refId="" refcode="请假类别(自定义档案)" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="leavetype,leavetype_name">
234             </NCRefNode>-->
235             <NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_leavetype_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="pk_timeitem,timeitemname" refId="" refcode="休假类别" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="leavetype,leavetype_name">
236             </NCRefNode>
237             <NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_pk_group_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="pk_group,name" refId="" refcode="集团" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="pk_group,pk_group_name">
238             </NCRefNode>
239             <NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_approver_user_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="cuserid,user_name" refId="" refcode="用户" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="approver,approver_user_name">
240             </NCRefNode>
241             <NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_transtypeid_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" readDs="masterDs" readFields="pk_billtypeid,billtypename,pk_billtypecode" refId="" refcode="影响因素交 易类型" refnodeDelegator="" selLeafOnly="false" text="交易类型参照" usePower="false" writeDs="leaveapply" writeFields="transtypeid,transtypeid_name,transtype">
242             </NCRefNode>
243         </RefNodes>
244         
245      
246         <ComboDatas>
247             <DynamicComboData i18nName="" langDir="" caption="" className="nc.bs.hrss.mymsg.ctrl.BilltypeNameCombo" id="combo_billtypename">
248             </DynamicComboData>
249             
250         </ComboDatas>
251 
252     </Models>
253     <Components>
254         <GridComp autoRowHeight="false" canCopy="true" caption="leaveapply_grid" checkBoxModel="1" dataset="leaveapply" editable="true" enabled="true" expandTree="false" id="leaveapply_grid" multiSelect="false" multiSelectShow="true" onPaste="" pagenationTop="false" reference="false" selfDefImageBtnRender="" showColInfo="false" showForm="false" showHeader="true" showImageBtn="false" showNumCol="false" showSumRow="false" showTree="true" sortable="true" visible="true">
255             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="pk_group" fixedHeader="false" id="pk_group" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="所属集团" textAlign="left" visible="false" width="120">
256             </Column>
257             <Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="pk_group_name" fixedHeader="false" id="pk_group_name" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_pk_group_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="所属集团" textAlign="left" visible="false" width="120">
258             </Column>
259             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="pk_org" fixedHeader="false" id="pk_org" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="所属组织" textAlign="left" visible="false" width="120">
260             </Column>
261             <Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="pk_org_name" fixedHeader="false" id="pk_org_name" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_pk_org_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="所属组织" textAlign="left" visible="false" width="120">
262             </Column>
263             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="bill_code" fixedHeader="false" id="bill_code" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="LnkCompRender" showCheckBox="true" sortable="true" sumCol="false" text="申请单编码" textAlign="left" visible="true" width="250">
264             </Column>
265             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="name" fixedHeader="false" id="name" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="名称" textAlign="left" visible="false" width="120">
266             </Column>
267             <Column autoExpand="false" dataType="Integer" editable="true" editorType="ComboBox" field="approve_state" fixedHeader="false" id="approve_state" imageOnly="false" langDir="leaveapply" nullAble="true" refComboData="combo_leaveapply_approve_state" renderType="ComboRender" showCheckBox="true" sortable="true" sumCol="false" text="审批状态" textAlign="left" visible="true" width="250">
268             </Column>
269             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="pk_billtype" fixedHeader="false" id="pk_billtype" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="单据状态" textAlign="left" visible="false" width="120">
270             </Column>
271             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="transtypeid" fixedHeader="false" id="transtypeid" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="流程类型id" textAlign="left" visible="false" width="120">
272             </Column>
273             <Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="transtypeid_name" fixedHeader="false" id="transtypeid_name" imageOnly="false" langDir="leaveapply" nullAble="true" refNode="refnode_leaveapply_transtypeid_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="流程类型id" textAlign="left" visible="false" width="120">
274             </Column>
275             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="transtype" fixedHeader="false" id="transtype" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="流程类型" textAlign="left" visible="false" width="120">
276             </Column>
277             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="pk_psndoc" fixedHeader="false" id="pk_psndoc" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="人员主键" textAlign="left" visible="false" width="120">
278             </Column>
279             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="pk_psnjob" fixedHeader="false" id="pk_psnjob" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="人员工作主键" textAlign="left" visible="false" width="120">
280             </Column>
281             <Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="psncode" fixedHeader="false" id="psncode" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_psncode" renderType="DefaultRender" showCheckBox="true" sortable="false" sumCol="false" text="人员编码" textAlign="left" visible="false" width="120">
282             </Column>
283             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="psnname" fixedHeader="false" id="psnname" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="姓名" textAlign="left" visible="false" width="120">
284             </Column>
285             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="psnorg" fixedHeader="false" id="psnorg" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="组织" textAlign="left" visible="false" width="120">
286             </Column>
287             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="psndept" fixedHeader="false" id="psndept" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="部门" textAlign="left" visible="false" width="120">
288             </Column>
289             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="psnpost" fixedHeader="false" id="psnpost" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="岗位" textAlign="left" visible="false" width="120">
290             </Column>
291             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="psnrank" fixedHeader="false" id="psnrank" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="职级" textAlign="left" visible="false" width="120">
292             </Column>
293             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="billmaker" fixedHeader="false" id="billmaker" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="申请人" textAlign="left" visible="false" width="120">
294             </Column>
295             <Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="billmaker_user_name" fixedHeader="false" id="billmaker_user_name" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_billmaker_user_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="申请人" textAlign="left" visible="false" width="120">
296             </Column>
297             <Column autoExpand="false" dataType="UFLiteralDate" editable="true" editorType="DateText" field="apply_date" fixedHeader="false" id="apply_date" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="申请日期" textAlign="left" visible="true" width="250">
298             </Column>
299             <Column autoExpand="false" dataType="String" editable="true" editorType="DateTimeText" field="approver" fixedHeader="false" id="approver" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="审批人" textAlign="left" visible="false" width="120">
300             </Column>
301             <Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="approver_user_name" fixedHeader="false" id="approver_user_name" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_approver_user_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="审批人" textAlign="left" visible="false" width="120">
302             </Column>
303             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="approver_note" fixedHeader="false" id="approver_note" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="审批意见" textAlign="left" visible="false" width="120">
304             </Column>
305             <Column autoExpand="false" dataType="UFLiteralDate" editable="true" editorType="DateTimeText" field="approver_time" fixedHeader="false" id="approver_time" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DateTimeRender" showCheckBox="true" sortable="true" sumCol="false" text="审批时间" textAlign="left" visible="true" width="250">
306             </Column>
307             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="creator" fixedHeader="false" id="creator" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="创建人" textAlign="left" visible="false" width="120">
308             </Column>
309             <Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="creator_user_name" fixedHeader="false" id="creator_user_name" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_creator_user_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="创建人" textAlign="left" visible="false" width="120">
310             </Column>
311             <Column autoExpand="false" dataType="UFDateTime" editable="true" editorType="DateTimeText" field="creationtime" fixedHeader="false" id="creationtime" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DateTimeRender" showCheckBox="true" sortable="true" sumCol="false" text="创建时间" textAlign="left" visible="false" width="120">
312             </Column>
313             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="modifier" fixedHeader="false" id="modifier" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="最后修改人" textAlign="left" visible="false" width="120">
314             </Column>
315             <Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="modifier_user_name" fixedHeader="false" id="modifier_user_name" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_modifier_user_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="最后修改人" textAlign="left" visible="false" width="120">
316             </Column>
317             <Column autoExpand="false" dataType="UFDateTime" editable="true" editorType="DateTimeText" field="modifiedtime" fixedHeader="false" id="modifiedtime" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DateTimeRender" showCheckBox="true" sortable="true" sumCol="false" text="最后修改时间" textAlign="left" visible="false" width="120">
318             </Column>
319             <Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="vmemo" fixedHeader="false" id="vmemo" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="备注" textAlign="left" visible="false" width="120">
320             </Column>
321         </GridComp>
322        <TextComp editorType="StringText" enabled="true" focus="false" i18nName="" id="check_it_now" langDir="" text="" textAlign="left" visible="true">
323         </TextComp>
324         <ButtonComp i18nName="" langDir="" enabled="true" id="select_confirm" text="查询" visible="true">
325             <Events>
326                 <Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="onselect1" name="onclick" onserver="true">
327                     <SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
328                     </SubmitRule>
329                     <Params>
330                         <Param>
331                             <Name>mouseEvent</Name>
332                             <Value>
333                             </Value>
334                             <Desc>                                <![CDATA[nc.uap.lfw.core.event.MouseEvent]]>
335                             </Desc>
336                         </Param>
337                     </Params>
338                     <Action>
339                     </Action>
340                 </Event>
341             </Events>
342         </ButtonComp>
343         <ComBoBoxComp i18nName="" langDir="" allowExtendValue="false" editorType="ComboBox" enabled="true" focus="false" id="check_it_two" refComboData="combo_leaveapply_approve_state" selectOnly="true" text="" textAlign="left" visible="true">
344         </ComBoBoxComp>
345         <ButtonComp i18nName="" langDir="" enabled="true" id="select_confirm_two" text="查询" visible="true">
346             <Events>
347                 <Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="onselect2" name="onclick" onserver="true">
348                     <SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
349                     </SubmitRule>
350                     <Params>
351                         <Param>
352                             <Name>mouseEvent</Name>
353                             <Value>
354                             </Value>
355                             <Desc>                                <![CDATA[nc.uap.lfw.core.event.MouseEvent]]>
356                             </Desc>
357                         </Param>
358                     </Params>
359                     <Action>
360                     </Action>
361                 </Event>
362             </Events>
363         </ButtonComp>
364         <TextComp editorType="DateText" enabled="true" focus="false" i18nName="" id="check_it_three" langDir="" text="" textAlign="left" visible="true">
365         </TextComp>
366         <ButtonComp i18nName="" langDir="" enabled="true" id="select_confirm_three" text="查询" visible="true">
367             <Events>
368                 <Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="onselect3" name="onclick" onserver="true">
369                     <SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
370                     </SubmitRule>
371                     <Params>
372                         <Param>
373                             <Name>mouseEvent</Name>
374                             <Value>
375                             </Value>
376                             <Desc>                                <![CDATA[nc.uap.lfw.core.event.MouseEvent]]>
377                             </Desc>
378                         </Param>
379                     </Params>
380                     <Action>
381                     </Action>
382                 </Event>
383             </Events>
384         </ButtonComp>
385         <LabelComp i18nName="" langDir="" enabled="true" id="lable" text="麻烦输入编码查询" visible="true" >
386         </LabelComp>
387         <LabelComp i18nName="" langDir="" enabled="true" id="lable1" text="输入审批状态查询" visible="true">
388         </LabelComp>
389         <LabelComp i18nName="" langDir="" enabled="true" id="lable2" text="按照申请日期查询" visible="true">
390         </LabelComp>
391     </Components>
392     <Menus>
393         <MenuBarComp id="menu_list">
394             <MenuItem id="list_add" modifiers="2" showModel="1" stateManager="nc.uap.lfw.core.bm.dft.Init_Ss_Ms_StateManager" text="新增">
395                 <Events>
396                     <Event async="true" methodName="onAdd" name="onclick" onserver="true">
397                         <Action>
398                         </Action>
399                     </Event>
400                 </Events>
401             </MenuItem>
402             <!--<MenuItem id="edit" modifiers="2" showModel="1" stateManager="nc.bs.hrss.hi.leave.LeaveStateManager" text="修改">
403                 <Events>
404                     <Event async="true" methodName="onEdit" name="onclick" onserver="true">
405                         <Action>
406                         </Action>
407                     </Event>
408                 </Events>
409             </MenuItem>-->
410             <MenuItem id="list_delete" modifiers="2" showModel="1" stateManager="nc.bs.hrss.hi.leave.LeaveStateManager" text="删除">
411                 <Events>
412                     <Event async="true" methodName="onDelete" name="onclick" onserver="true">
413                         <SubmitRule>
414                             <Widget id="main">
415                             </Widget>
416                         </SubmitRule>
417                         <Action>
418                         </Action>
419                     </Event>
420                 </Events>
421             </MenuItem>
422             <MenuItem id="sep1" modifiers="2" sep="true" showModel="1">
423             </MenuItem>
424             <MenuItem id="list_submit" modifiers="2" showModel="1" stateManager="nc.bs.hrss.hi.leave.LeaveStateManager" text="提交">
425                 <Events>
426                     <Event async="true" methodName="onSubmit" name="onclick" onserver="true">
427                         <Action>
428                         </Action>
429                     </Event>
430                 </Events>
431             </MenuItem>
432             <MenuItem id="list_callback" modifiers="2" showModel="1" stateManager="nc.bs.hrss.hi.leave.LeaveStateManager" text="收回">
433                 <Events>
434                     <Event async="true" methodName="onBack" name="onclick" onserver="true">
435                         <Action>
436                         </Action>
437                     </Event>
438                 </Events>
439             </MenuItem>
440             <MenuItem id="list_apporvestate" modifiers="2" showModel="1"  stateManager="nc.uap.lfw.core.bm.dft.Ss_StateManager" text="查看流程">
441                 <Events>
442                     <Event async="true" methodName="onFlow" name="onclick" onserver="true">
443                         <Action>
444                         </Action>
445                     </Event>
446                 </Events>
447             </MenuItem>
448             <MenuItem id="sep2" modifiers="2" sep="true" showModel="1">
449             </MenuItem>
450             <MenuItem id="attachfile" modifiers="2" showModel="1" stateManager="nc.uap.lfw.core.bm.dft.Ss_StateManager" text="附件管理">
451                 <Events>
452                     <Event async="true" methodName="onAttchFile" name="onclick" onserver="true">
453                         <Action>
454                         </Action>
455                     </Event>
456                 </Events>
457             </MenuItem>
458             
459             <!-- shaochj begin -->
460             <MenuItem id="m_" modifiers="3" sep="true" text="m_">
461             </MenuItem>
462             <MenuItem id="copysend" i18nName="" langDir="" modifiers="2" stateManager="" text="设置抄送人">
463                 <Events>
464                     <Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="setCopySend" name="onclick" 
465                         onserver="true">
466                         <SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
467                         </SubmitRule>
468                         <Params>
469                             <Param>
470                                 <Name>mouseEvent</Name>
471                                 <Value>
472                                 </Value>
473                                 <Desc> <![CDATA[nc.uap.lfw.core.event.MouseEvent]]> </Desc>
474                             </Param>
475                         </Params>
476                         <Action>
477                         </Action>
478                     </Event>
479                 </Events>
480             </MenuItem>
481             <!-- shaochj end -->
482            <MenuItem id="m_" modifiers="3" sep="true" text="m_">
483             </MenuItem>
484             <MenuItem i18nName="" langDir="node_ta-res" id="onCopysend" modifiers="2" text="抄送" visible="true" enabled="false">
485                 <Events>
486                     <Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="selectCopysend" name="onclick" onserver="true">
487                         <SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
488                             <Dataset id="hi_stapply">
489                             </Dataset>
490                         </SubmitRule>
491                         <Params>
492                             <Param>
493                                 <Name>mouseEvent</Name>
494                                 <Value>
495                                 </Value>
496                                 <Desc>                                    <![CDATA[]]>
497                                 </Desc>
498                             </Param>
499                         </Params>
500                         <Action>
501                         </Action>
502                     </Event>
503                 </Events>
504             </MenuItem>
505             <MenuItem i18nName="" langDir="" id="tableAttach" modifiers="2" text="操作指引/表格模板" visible="true" enabled="true">
506                 <Events>
507                     <Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="addTableAttachment" name="onclick" onserver="true">
508                         <SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
509                             <Dataset id="hi_stapply">
510                             </Dataset>
511                         </SubmitRule>
512                         <Params>
513                             <Param>
514                                 <Name>mouseEvent</Name>
515                                 <Value>
516                                 </Value>
517                                 <Desc>                                    <![CDATA[]]>
518                                 </Desc>
519                             </Param>
520                         </Params>
521                         <Action>
522                         </Action>
523                     </Event>
524                 </Events>
525             </MenuItem>
526             
527             <MenuItem id="m_" modifiers="3" sep="true" text="m_">
528             </MenuItem>
529             <MenuItem  id="export"  modifiers="2"  stateManager="nc.bs.hrss.ta.common.dft.Init_StateManager" text="导出pdf文档">
530                 <Events>
531                     <Event async="true" methodName="exportPDF" name="onclick" onserver="true">
532                          <SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
533                             <Dataset id="entryapply">
534                             </Dataset>
535                         </SubmitRule>
536                         <Params>
537                             <Param>
538                                 <Name>mouseEvent</Name>
539                                 <Value>
540                                 </Value>
541                                 <Desc>                                    <![CDATA[nc.uap.lfw.core.event.MouseEvent]]>
542                                 </Desc>
543                             </Param>
544                         </Params>
545                         <Action>
546                         </Action>
547                     </Event>
548                 </Events>
549             </MenuItem>
550             <!-- shaochj end -->
551         </MenuBarComp>
552     </Menus>
553 </Widget>
  1 package nc.bs.hrss.hi.leave;
  2 
  3 import java.text.SimpleDateFormat;
  4 import java.util.Date;
  5 import java.util.HashMap;
  6 import java.util.Map;
  7 
  8 import nc.bs.framework.common.NCLocator;
  9 import nc.bs.hrss.hi.setcopysend.QueryCopySendVOUtil;
 10 import nc.bs.hrss.pub.HrssConsts;
 11 import nc.bs.hrss.pub.action.HrssPrintAction;
 12 import nc.bs.hrss.pub.action.HrssPrintMDDataSource;
 13 import nc.bs.hrss.pub.cmd.PFApproveInfoCmd;
 14 import nc.bs.hrss.pub.cmd.PFCommitCmd;
 15 import nc.bs.hrss.pub.cmd.PFDeleteCmd;
 16 import nc.bs.hrss.pub.cmd.PFReCallCmd;
 17 import nc.bs.hrss.pub.tool.CommonUtil;
 18 import nc.bs.hrss.pub.tool.DatasetUtil;
 19 import nc.bs.hrss.pub.tool.SessionUtil;
 20 import nc.bs.hrss.pub.tool.ViewUtil;
 21 import nc.bs.hrss.trn.PrintCodeForPortal;
 22 import nc.bs.hrss.trn.TrnUtil;
 23 import nc.bs.hrss.trn.pub.CirculateConsts;
 24 import nc.bs.logging.Logger;
 25 import nc.hr.frame.persistence.SimpleDocServiceTemplate;
 26 import nc.itf.hrss.hi.leave.ILeaveApplyManagerService;
 27 import nc.itf.hrss.hi.leave.ILeaveApplyQueryMaintain;
 28 import nc.itf.uap.pf.IPFConfig;
 29 import nc.uap.lfw.core.AppInteractionUtil;
 30 import nc.uap.lfw.core.AppSession;
 31 import nc.uap.lfw.core.LfwRuntimeEnvironment;
 32 import nc.uap.lfw.core.cmd.CmdInvoker;
 33 import nc.uap.lfw.core.cmd.UifDatasetAfterSelectCmd;
 34 import nc.uap.lfw.core.comp.MenuItem;
 35 import nc.uap.lfw.core.comp.MenubarComp;
 36 import nc.uap.lfw.core.comp.WebElement;
 37 import nc.uap.lfw.core.comp.text.ComboBoxComp;
 38 import nc.uap.lfw.core.comp.text.TextComp;
 39 import nc.uap.lfw.core.constants.AppConsts;
 40 import nc.uap.lfw.core.ctx.AppLifeCycleContext;
 41 import nc.uap.lfw.core.ctx.ApplicationContext;
 42 import nc.uap.lfw.core.ctx.OpenProperties;
 43 import nc.uap.lfw.core.ctx.WindowContext;
 44 import nc.uap.lfw.core.data.Dataset;
 45 import nc.uap.lfw.core.data.Row;
 46 import nc.uap.lfw.core.event.DataLoadEvent;
 47 import nc.uap.lfw.core.event.DatasetEvent;
 48 import nc.uap.lfw.core.event.DialogEvent;
 49 import nc.uap.lfw.core.event.MouseEvent;
 50 import nc.uap.lfw.core.event.ScriptEvent;
 51 import nc.uap.lfw.core.exception.LfwRuntimeException;
 52 import nc.uap.lfw.core.model.plug.TranslatedRow;
 53 import nc.uap.lfw.core.page.LfwView;
 54 import nc.uap.lfw.core.serializer.impl.Dataset2SuperVOSerializer;
 55 import nc.uap.lfw.core.serializer.impl.SuperVO2DatasetSerializer;
 56 import nc.uap.wfm.constant.WfmConstants;
 57 import nc.vo.hrss.hi.leave.AggLeaveApplyVO;
 58 import nc.vo.hrss.hi.leave.LeaveApplyVO;
 59 import nc.vo.hrss.hi.leave.LeaveEnum;
 60 import nc.vo.ml.NCLangRes4VoTransl;
 61 import nc.vo.pub.AggregatedValueObject;
 62 import nc.vo.pub.BusinessException;
 63 import nc.vo.pub.SuperVO;
 64 import nc.vo.pub.pf.IPfRetCheckInfo;
 65 
 66 import org.apache.commons.lang.StringUtils;
 67 
 68 import uap.lfw.core.itf.ctrl.AbstractMasterSlaveViewController;
 69 import uap.web.bd.pub.AppUtil;
 70  
 71 /** 
 72  * 信息列表默认逻辑
 73  * 
 74  */
 75 public class LeaveApplyListWinMainViewCtrl<T extends WebElement> extends
 76         AbstractMasterSlaveViewController {
 77 
 78     private static final String OPEN_WIDTH = "1100";
 79     private static final String OPEN_Height = "800";
 80     private static final String MAIN_VIEW_ID = "main";
 81     private static final String CARD_WIN_ID = "LeaveApplyCard";
 82     private static final String CARD_WIN_TITLE = "休假申请";
 83     
 84     private static ILeaveApplyManagerService iLeaveApplyManagerService = NCLocator
 85             .getInstance().lookup(ILeaveApplyManagerService.class);
 86     private static ILeaveApplyQueryMaintain iLeaveApplyQueryMaintain = NCLocator
 87             .getInstance().lookup(ILeaveApplyQueryMaintain.class);
 88     /**
 89      * onselect1点击按照“申请单编码查询”
 90      */
 91     
 92     public void onselect1(MouseEvent<MenuItem> mouseEvent){
 93         //获取相应的TextComp的值的方法
 94          TextComp checkComp = (TextComp) ViewUtil.getCurrentView().getViewComponents().getComponent("check_it_now");
 95          //对获取到的checkComp获取对象的value
 96          //String checkname=checkComp.getValue();
 97          String checkname = checkComp.getValue()==null?"":checkComp.getValue();
 98         //调用queryVOs2包中的方法查询到相应的数据
 99          SuperVO[] vos = queryVOs2(checkname);
100         //获取页面元素的util类
101             LfwView viewMain = ViewUtil.getCurrentView();
102             //获取对应的VO。这个应该是实体表的表名“leaveapply”,在配置文件中可以找到,要一一对应哦!
103             Dataset ds = viewMain.getViewModels().getDataset("leaveapply");
104             if (ds == null) {
105                 return;
106             }
107         //序列化
108          new SuperVO2DatasetSerializer().serialize(vos, ds, Row.STATE_NORMAL);        
109     }
110     /**
111      * 
112      * @param 点击按照审批状态查询
113      */
114     public void onselect2(MouseEvent<MenuItem> mouseEvent)
115     {
116         ComboBoxComp billtypenameComp = (ComboBoxComp) ViewUtil.getCurrentView().getViewComponents().getComponent("check_it_two");
117         String checkname = billtypenameComp.getValue()==null?"":billtypenameComp.getValue();
118         //String checkname=billtypenameComp.getValue();
119         System.out.println("___61252"+checkname);
120         
121         //调用queryVOs2包中的方法查询到相应的数据
122          SuperVO[] vos = queryVOs3(checkname);
123         //获取页面元素的util类
124             LfwView viewMain = ViewUtil.getCurrentView();
125             //获取对应的VO。这个应该是实体表的表名“leaveapply”,在配置文件中可以找到,要一一对应哦!
126             Dataset ds = viewMain.getViewModels().getDataset("leaveapply");
127             if (ds == null) {
128                 return;
129             }
130         //序列化
131          new SuperVO2DatasetSerializer().serialize(vos, ds, Row.STATE_NORMAL);        
132     }
133     /**
134      * 
135      * @param 按照提交日期查询
136      */
137     public void onselect3(MouseEvent<MenuItem> mouseEvent){
138         //获取相应的TextComp的值的方法
139          TextComp checkComp = (TextComp) ViewUtil.getCurrentView().getViewComponents().getComponent("check_it_three");
140          //对获取到的checkComp获取对象的value
141          String checkname=checkComp.getValue()==null?"":checkComp.getValue();
142         //日期类型转化--获取到的String先转化为long,转化为long之后再转化为Date,转化为Date之后再转化为String
143          long l = Long.parseLong(checkname);
144          Date date = new Date(l);
145          SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
146          String checkname1=sdf.format(date)==null?"":sdf.format(date);         
147         //调用queryVOs2包中的方法查询到相应的数据
148          SuperVO[] vos = queryVOs4(checkname1);
149         //获取页面元素的util类
150             LfwView viewMain = ViewUtil.getCurrentView();
151             //获取对应的VO。这个应该是实体表的表名“leaveapply”,在配置文件中可以找到,要一一对应哦!
152             Dataset ds = viewMain.getViewModels().getDataset("leaveapply");
153             if (ds == null) {
154                 return;
155             }
156         //序列化
157          new SuperVO2DatasetSerializer().serialize(vos, ds, Row.STATE_NORMAL);        
158         
159     }
160 
161     /**
162      * 重新刷新数据
163      * 
164      * @param mouseEvent
165      */
166     public void reloadData(ScriptEvent mouseEvent) {
167         LfwView view = ViewUtil.getCurrentView();
168         Dataset ds = ViewUtil.getDataset(view, getMasterDsId());
169         new SuperVO2DatasetSerializer().serialize(queryVOs(), ds, Row.STATE_NORMAL);
170     }
171     /**
172      * 页面显示事件
173      * 
174      * @param dialogEvent
175      */
176     public void onBeforeShow(DialogEvent dialogEvent) {
177         initData();
178         LfwView viewMain = AppLifeCycleContext.current().getViewContext().getView();
179         // add by shaochj@邵传军 Dec 12, 2014 begin
180         //根据用户pk查询角色pk,判断是否隐藏按钮
181         String pk_user = LfwRuntimeEnvironment.getLfwSessionBean().getPk_user();
182         QueryCopySendVOUtil.setVisisble(viewMain, pk_user);
183         // add by shaochj@邵传军 Dec 12, 2014 end
184     
185     }
186 
187     /**
188      * 主数据加载逻辑
189      * 
190      * @param dataLoadEvent
191      */
192     public void onDataLoad(DataLoadEvent dataLoadEvent) {
193         initData();
194     }
195 
196     /**
197      * 主数据选中逻辑
198      * 
199      * @param datasetEvent
200      */
201     public void onAfterRowSelect(DatasetEvent datasetEvent) {
202         Dataset ds = datasetEvent.getSource();
203         CmdInvoker.invoke(new UifDatasetAfterSelectCmd(ds.getId()));
204         Row row = ds.getSelectedRow();
205         if(row!=null){
206             Integer approve_state = (Integer) row.getValue(ds.nameToIndex("approve_state"));
207             MenubarComp comp = (MenubarComp) ViewUtil.getCurrentView().getViewMenus().getMenuBar("menu_list");
208             if(comp!=null){
209                 MenuItem item = comp.getElementById("onCopysend");
210                 if(item!=null){
211                     if(approve_state==-1){
212                         item.setEnabled(false);
213                     }else{
214                         item.setEnabled(true);
215                     }
216                 }
217             }
218         }
219     }
220 
221     /**
222      * 
223     * @author zhangxl@张晓亮 【碧桂园项目】 
224     * @date Nov 28, 2014
225     * 方法功能描述:新增
226     * @param mouseEvent
227      */
228     public void onAdd(MouseEvent<?> mouseEvent) {
229         OpenProperties props = new OpenProperties(CARD_WIN_ID, CARD_WIN_TITLE);
230         props.setButtonZone(false);
231         
232         Map<String, String> paramMap = new HashMap<String, String>(2);
233         paramMap.put(AppConsts.OPE_SIGN, AppConsts.OPE_ADD);
234         props.setParamMap(paramMap);
235         props.setWidth(OPEN_WIDTH);
236         props.setHeight(OPEN_Height);
237         this.getCurrentAppCtx().navgateTo(props);
238     }
239 
240     /**
241      * 
242     * @author zhangxl@张晓亮 【碧桂园项目】 
243     * @date Nov 28, 2014
244     * 方法功能描述:编辑
245     * @param mouseEvent
246      */
247     public void onEdit(MouseEvent<?> mouseEvent) {
248         Dataset ds = this.getMasterDs();
249         if (ds.getSelectedIndex() < 0) {
250             throw new LfwRuntimeException("请选中待编辑数据");
251         }
252         Row row = ds.getSelectedRow();
253         String pkValue = (String) row.getValue(ds.nameToIndex(ds
254                 .getPrimaryKeyField()));
255         OpenProperties props = new OpenProperties(CARD_WIN_ID, CARD_WIN_TITLE);
256         props.setButtonZone(false);
257         Map<String, String> paramMap = new HashMap<String, String>(2);
258         paramMap.put(AppConsts.OPE_SIGN, AppConsts.OPE_EDIT);
259         paramMap.put(AppConsts.OPEN_BILL_ID, pkValue);
260         paramMap.put(WfmConstants.WfmUrlConst_billID, pkValue);
261         props.setParamMap(paramMap);
262         props.setWidth(OPEN_WIDTH);
263         props.setHeight(OPEN_Height);
264         this.getCurrentAppCtx().navgateTo(props);
265     }
266 
267     /**
268      * 
269     * @author zhangxl@张晓亮 【碧桂园项目】 
270     * @date Nov 28, 2014
271     * 方法功能描述:查看
272 //    * @param scriptEvent
273      */
274     public void showDetail(ScriptEvent scriptEvent) {
275         String pkValue = AppLifeCycleContext.current().getParameter("dsMain_primaryKey");
276         String approve_state = AppLifeCycleContext.current().getParameter("approve_state");
277         OpenProperties props = new OpenProperties(CARD_WIN_ID, CARD_WIN_TITLE);
278         props.setButtonZone(false);
279         Map<String, String> paramMap = new HashMap<String, String>(2);
280         if ("-1".equals(approve_state)) {
281             paramMap.put(AppConsts.OPE_SIGN, AppConsts.OPE_EDIT);
282         }else{
283             paramMap.put(AppConsts.OPE_SIGN, LeaveConst.OPE_VIEW);
284         }
285         paramMap.put(AppConsts.OPEN_BILL_ID, pkValue);
286         paramMap.put(WfmConstants.WfmUrlConst_billID, pkValue);
287         props.setParamMap(paramMap);
288         props.setWidth(OPEN_WIDTH);
289         props.setHeight(OPEN_Height);
290         AppLifeCycleContext.current().getViewContext().navgateTo(props);
291         
292         
293 //        CommonUtil.showWindowDialog(CARD_WIN_ID, CARD_WIN_TITLE, OPEN_WIDTH, OPEN_Height, paramMap, ApplicationContext.TYPE_DIALOG, false, false);
294         
295     }
296     
297     /**
298      * 
299     * @author zhangxl@张晓亮 【碧桂园项目】 
300     * @date Nov 28, 2014
301     * 方法功能描述:删除
302     * @param mouseEvent
303      */
304     public void onDelete(MouseEvent<?> mouseEvent) {
305         Dataset ds = this.getMasterDs();
306         if (ds.getSelectedIndex() < 0) {
307             throw new LfwRuntimeException("请选中待删除数据");
308         }
309         Row row = ds.getSelectedRow();
310         Boolean resultBoolean = AppInteractionUtil.showConfirmDialog("删除","是否确定删除");  // 弹出确认提示
311         if(resultBoolean == Boolean.FALSE) return ;
312         String pk_form = (String) row.getValue(ds.nameToIndex(ds
313                 .getPrimaryKeyField()));
314         Integer approve_state = (Integer) row.getValue(ds.nameToIndex(LeaveApplyVO.APPROVE_STATE));
315         if (-1 != approve_state) {
316             throw new LfwRuntimeException("流程已启动,无法删除单据");
317         }
318         CmdInvoker.invoke(new PFDeleteCmd(getMasterDsId(),AggLeaveApplyVO.class));
319     }
320 
321     /**
322      * 
323     * @author zhangxl@张晓亮 【碧桂园项目】 
324     * @date Nov 28, 2014
325     * 方法功能描述:提交
326     * @param mouseEvent
327      */
328     public void onSubmit(MouseEvent<MenuItem> mouseEvent) {
329         LfwView view = ViewUtil.getCurrentView();
330         Dataset ds = ViewUtil.getDataset(view, getMasterDsId());
331         Row selRow = ds.getSelectedRow();
332         if (selRow == null) {
333             CommonUtil.showErrorDialog(
334                     nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID(
335                             "c_hi-res", "0c_hi-res0017")/*
336                                                          * @ res "提示信息"
337                                                          */,
338                     nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID(
339                             "c_pub-res", "0c_pub-res0186")/*
340                                                          * @ res "请选择待提交的记录!"
341                                                          */);
342         }
343         /*String primaryField = DatasetUtil.getPrimaryField(ds).getId();
344         String primarykey = selRow.getString(ds.nameToIndex(primaryField));
345         if(StringUtils.isEmpty(primarykey)){
346             return;
347         }
348         IFileSystemService service = NCLocator.getInstance().lookup(IFileSystemService.class);
349         try {
350             NCFileNode node=service.queryNCFileNodeTree(primarykey);
351             if (node == null) {
352                 CommonUtil.showErrorDialog("请维护附件");
353                 return;
354             }
355         } catch (BusinessException e) {
356             throw new LfwRuntimeException(e.getMessage());
357         }*/
358         
359         CmdInvoker.invoke(new PFCommitCmd(getMasterDsId(), null,
360                 AggLeaveApplyVO.class));
361     }
362 
363     /**
364      * 
365     * @author zhangxl@张晓亮 【碧桂园项目】 
366     * @date Nov 28, 2014
367     * 方法功能描述:收回
368     * @param mouseEvent
369      */
370     public void onBack(MouseEvent<MenuItem> mouseEvent) {
371         PFReCallCmd reCallCmd = new PFReCallCmd(getMasterDsId(), null,
372                 AggLeaveApplyVO.class);
373         CmdInvoker.invoke(reCallCmd);
374     }
375 
376     /**
377      * 
378     * @author zhangxl@张晓亮 【碧桂园项目】 
379     * @date Nov 28, 2014
380     * 方法功能描述:查看审批流
381     * @param mouseEvent
382      */
383     public void onFlow(MouseEvent<MenuItem> mouseEvent) {
384         PFApproveInfoCmd approveInfoCmd = new PFApproveInfoCmd(getMasterDsId(),
385                 AggLeaveApplyVO.class);
386         CmdInvoker.invoke(approveInfoCmd);
387     }
388 
389     /**
390      * 
391     * @author zhangxl@张晓亮 【碧桂园项目】 
392     * @date Nov 28, 2014
393     * 方法功能描述:附件管理
394     * @param mouseEvent
395      */
396     public void onAttchFile(MouseEvent<MenuItem> mouseEvent) {
397         LfwView view =ViewUtil.getCurrentView();
398         Dataset ds = ViewUtil.getDataset(view, getMasterDsId());
399         Row row = ds.getSelectedRow();
400         if (row == null) {
401             CommonUtil.showErrorDialog(
402                     nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID(
403                             "c_hi-res", "0c_hi-res0017")/*
404                                                          * @ res "提示信息"
405                                                          */,
406                     nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID(
407                             "c_hi-res", "0c_trn-res0040")/*
408                                                          * @ res
409                                                          */);
410         }
411         int approve_state = row.getInt(ds.nameToIndex(LeaveConst.APPROVE_STATE));
412         boolean isPower = false;
413         if (approve_state == IPfRetCheckInfo.NOSTATE)
414             isPower = true;
415         CommonUtil.Attachment(ds, isPower);
416     }
417 
418     @Override
419     protected String getMasterDsId() {
420         return "leaveapply";
421     }
422 
423     /**
424      * 
425     * @author zhangxl@张晓亮 【碧桂园项目】 
426     * @date Nov 28, 2014
427     * 方法功能描述:分类切换事件
428     * @param keys
429      */
430     public void plugininParam(Map<String, Object> keys) {
431         if (keys == null || keys.size() == 0) {
432             return;
433         }
434         TranslatedRow row = (TranslatedRow) keys.get("appid");
435         if (row == null) {
436             return;
437         }
438         String pk_node = (String) row.getValue("pk_node");
439         if (StringUtils.isEmpty(pk_node)) {
440             return;
441         }
442         ApplicationContext appCtx = AppLifeCycleContext.current()
443                 .getApplicationContext();
444         String nodecode = TrnUtil.getNodecodeByApp(pk_node);
445         String url = LfwRuntimeEnvironment.getRootPath() + "/app/" + pk_node
446                 + "?nodecode=" + nodecode;
447         appCtx.sendRedirect(url, nodecode);
448     }
449 
450     /**
451      * 
452     * @author zhangxl@张晓亮 【碧桂园项目】 
453     * @date Nov 28, 2014
454     * 方法功能描述:关闭弹出页面后的再查询操作
455     * @param keys
456      */
457     public void pluginReSearch(Map<String, Object> keys) {
458         LfwView view = ViewUtil.getCurrentView();
459         Dataset ds = ViewUtil.getDataset(view, getMasterDsId());
460         new SuperVO2DatasetSerializer().serialize(queryVOs(), ds, Row.STATE_NORMAL);
461     }
462     
463     /**
464      * 
465     * @author zhangxl@张晓亮 【碧桂园项目】 
466     * @date Dec 2, 2014
467     * 方法功能描述:页面初始化
468      */
469     public void initData(){
470         LfwView view = ViewUtil.getCurrentView();
471         if (view == null) {
472             return;
473         }
474         Dataset ds = ViewUtil.getDataset(view, getMasterDsId());
475         if (ds == null) {
476             return;
477         }
478         DatasetUtil.clearData(ds);
479         SuperVO[] vos = queryVOs();
480         new SuperVO2DatasetSerializer().serialize(vos, ds, Row.STATE_NORMAL);
481     }
482     /**
483      * 按照编码查询by曾志伟
484      * 
485      * */
486     protected SuperVO[] queryVOs2(String checkname){
487         //StringBuffer拼接数据库语句
488         StringBuffer whereSQL=new StringBuffer();
489         //拼接你传进来值
490         if(checkname=="")
491         {
492             String billmaker = LfwRuntimeEnvironment.getLfwSessionBean().getPk_user();
493             whereSQL.append(" billmaker = '" + billmaker + "'");
494               String pageId = getPageId();
495             if (LeaveConst.LEAVEAPPLY.equals(pageId)) {
496                 whereSQL.append(" and nodetype = "+LeaveEnum.TYPE_STAFF );
497             }else if(LeaveConst.SPECIALLEAVEAPPLY.equals(pageId)){
498                 whereSQL.append(" and nodetype = "+LeaveEnum.TYPE_SPECIAL );
499             }
500             whereSQL.append(" order by creationtime desc");
501             
502         }
503         else{
504             
505             whereSQL.append("bill_code='"+checkname+"'");
506             String id=SessionUtil.getPk_psndoc();
507             whereSQL.append("and pk_psndoc='"+id+"'");
508         }
509         
510         
511         //实体对应的VO。我的理解相当于javabean
512         LeaveApplyVO[] hvos=null;
513         try{
514             //调用接口相应的查询方法---超哥跟我说过/要写接口,同时也要写实现类,接口是写在public中,
515             //实现类是写在private中,最后在/NC_HR_WEB6.3_150915/mw/META-INF中创建**.upm文件配置
516             hvos  = iLeaveApplyQueryMaintain.queryLeaveApplyVOByCondition(whereSQL.toString());
517 
518             
519         }catch(BusinessException e){
520             Logger.error(e.getMessage(),e);
521         }
522         
523         return hvos;
524     }
525     /**
526      * 按照状态by曾志伟
527      * 
528      * */
529     protected SuperVO[] queryVOs3(String checkname){
530         //StringBuffer拼接数据库语句
531         StringBuffer whereSQL=new StringBuffer();
532     
533         if(checkname=="")
534         {
535             String billmaker = LfwRuntimeEnvironment.getLfwSessionBean().getPk_user();
536             whereSQL.append(" billmaker = '" + billmaker + "'");
537               String pageId = getPageId();
538             if (LeaveConst.LEAVEAPPLY.equals(pageId)) {
539                 whereSQL.append(" and nodetype = "+LeaveEnum.TYPE_STAFF );
540             }else if(LeaveConst.SPECIALLEAVEAPPLY.equals(pageId)){
541                 whereSQL.append(" and nodetype = "+LeaveEnum.TYPE_SPECIAL );
542             }
543             whereSQL.append(" order by creationtime desc");
544             
545         }
546         else{
547             //拼接你传进来值
548             whereSQL.append("approve_state='"+checkname+"'");
549              //拼接唯一标识
550             String id=SessionUtil.getPk_psndoc();
551             whereSQL.append("and pk_psndoc='"+id+"'");
552             
553         }
554         
555         
556         //实体对应的VO。我的理解相当于javabean
557         LeaveApplyVO[] hvos=null;
558         try{
559             //调用接口相应的查询方法---超哥跟我说过/要写接口,同时也要写实现类,接口是写在public中,
560             //实现类是写在private中,最后在/NC_HR_WEB6.3_150915/mw/META-INF中创建**.upm文件配置
561             hvos  = iLeaveApplyQueryMaintain.queryLeaveApplyVOByCondition(whereSQL.toString());
562 
563             
564         }catch(BusinessException e){
565             Logger.error(e.getMessage(),e);
566         }
567         
568         return hvos;
569     }
570     /**
571      * 按照日期by曾志伟
572      * 
573      * */
574     protected SuperVO[] queryVOs4(String checkname1){
575         //StringBuffer拼接数据库语句
576         StringBuffer whereSQL=new StringBuffer();
577         //拼接你传进来值
578         whereSQL.append("apply_date='"+checkname1+"'");        
579         //实体对应的VO。我的理解相当于javabean
580         LeaveApplyVO[] hvos=null;
581         try{
582             //调用接口相应的查询方法---超哥跟我说过/要写接口,同时也要写实现类,接口是写在public中,
583             //实现类是写在private中,最后在/NC_HR_WEB6.3_150915/mw/META-INF中创建**.upm文件配置
584             hvos  = iLeaveApplyQueryMaintain.queryLeaveApplyVOByCondition(whereSQL.toString());
585 
586             
587         }catch(BusinessException e){
588             Logger.error(e.getMessage(),e);
589         }
590         
591         return hvos;
592     }
593     /**
594      * 
595     * @author zhangxl@张晓亮 【碧桂园项目】 
596     * @date Dec 2, 2014
597     * 方法功能描述:查询
598     * @return
599      */
600     protected SuperVO[] queryVOs(){
601           String billmaker = LfwRuntimeEnvironment.getLfwSessionBean().getPk_user();
602           StringBuffer whereSQL = new StringBuffer();
603           whereSQL.append(" billmaker = '" + billmaker + "'");
604           String pageId = getPageId();
605         if (LeaveConst.LEAVEAPPLY.equals(pageId)) {
606             whereSQL.append(" and nodetype = "+LeaveEnum.TYPE_STAFF );
607         }else if(LeaveConst.SPECIALLEAVEAPPLY.equals(pageId)){
608             whereSQL.append(" and nodetype = "+LeaveEnum.TYPE_SPECIAL );
609         }
610         whereSQL.append(" order by creationtime desc");
611         LeaveApplyVO[] hvos = null ;
612         try {
613             hvos  = iLeaveApplyQueryMaintain.queryLeaveApplyVOByCondition(whereSQL.toString());
614         } catch (BusinessException e) {
615             Logger.error(e.getMessage(), e);
616         }
617         return hvos;
618     }
619     
620     /**
621      * 
622     * @author zhangxl@张晓亮 【碧桂园项目】 
623     * @date Nov 30, 2014
624     * 方法功能描述:
625     * @return
626      */
627     public String getPageId(){
628         AppSession session = SessionUtil.getAppSession();
629         return session.getPageId();
630     }
631 
632     /**
633      * @author shaochj@邵传军 【碧桂园项目】 
634      * @date Dec 10, 2014
635      * 方法功能描述:设置抄送人按钮事件
636      *
637      * @param mouseEvent
638      */
639     public void setCopySend(  MouseEvent<MenuItem> mouseEvent){
640         WindowContext wc = AppLifeCycleContext.current().getWindowContext();
641         // add by wangchao@王超 Mar 19, 2015 【碧桂园项目】 begin
642         String pageId = getPageId();
643         if (LeaveConst.LEAVEAPPLY.equals(pageId)) {
644             wc.addAppAttribute("billTypeCode","6139");
645         }else if(LeaveConst.SPECIALLEAVEAPPLY.equals(pageId)){
646             wc.addAppAttribute("billTypeCode","6140");
647         }
648         // add by wangchao@王超 Mar 19, 2015 end
649         OpenProperties arg = new OpenProperties();
650         arg.setOpenId("setcopysend");
651         arg.setType(ApplicationContext.TYPE_WINDOW);
652         arg.setHeight("800");
653         arg.setWidth("800");
654         arg.setTitle("设置抄送人");
655         wc.popView(arg);
656     }
657     public void selectCopysend(MouseEvent<MenuItem> mouseEvent){
658         Dataset ds = ViewUtil.getCurrentView().getViewModels().getDataset("leaveapply");
659         Row row = ds.getSelectedRow();
660         if(row==null){
661             return;
662         }
663         String billType = (String) row.getValue(ds.nameToIndex("pk_billtype"));
664         String billPk = (String)  row.getValue(ds.nameToIndex("pk_leave"));
665         ApplicationContext appCtx = AppLifeCycleContext.current().getApplicationContext();
666 //        String billType = (String) AppUtil.getAppAttr(HrssConsts.BILL_TYPE_CODE);
667 //        String billPk = (String) AppUtil.getAppAttr(WfmConstants.WfmAppAttr_BillID);
668         AggregatedValueObject aggVO = getBillVOByPk(billType, billPk);
669         appCtx.addAppAttribute("aggVO", aggVO);
670         appCtx.addAppAttribute("title", CirculateConsts.COPYSEND_NAME);
671         appCtx.addAppAttribute("votype", CirculateConsts.LEAVE_VO);
672         appCtx.addAppAttribute("msgrescode", CirculateConsts.SLEAVE_CODE);
673         CommonUtil.showViewDialog(CirculateConsts.CIRCULATE_SELECT_ID, CirculateConsts.COPYSEND_NAME, 400, 200);
674         //CmdInvoker.invoke(new UifOpenViewCmd(EntryApplyConsts.CIRCULATE_SELECT_ID, "400", "200", "选择传阅人"));
675     }
676 
677     /**
678      * 根据主键,查询VO
679      * 
680      * @param primaryKey
681      * @return
682      */
683     protected AggregatedValueObject getBillVOByPk(String billType, String billPk) {
684         if (StringUtils.isEmpty(billPk)) {
685             return null;
686         }
687         IPFConfig bsConfig = (IPFConfig) NCLocator.getInstance().lookup(IPFConfig.class.getName());
688         // 查询单据VO
689         AggregatedValueObject billVO = null;
690         try {
691             billVO = bsConfig.queryBillDataVO(billType, billPk);
692         } catch (BusinessException ex) {
693             Logger.error(ex.getMessage(), ex);
694             throw new LfwRuntimeException(NCLangRes4VoTransl.getNCLangRes().getStrByID("imp",
695                     "CpMockBillTemplateController-000000")/*
696                                                          * 查询元数据 出错 ,
697                                                          */
698                     + ex.getMessage());
699         }
700 
701         return billVO;
702     }
703 
704     /**
705      * 常用表格管理操作
706      * 
707      * @param mouseEvent
708      */
709     public void addTableAttachment(MouseEvent<MenuItem> mouseEvent) {
710         // add Jul 24, 2015 begin
711         //附件根据单据类型分类,用单据类型模拟单据主键
712         String primarykey = AppLifeCycleContext.current().getWindowContext().getApplicationContext().getAppId();
713         // add Jul 24, 2015 end
714         AppUtil.addAppAttr(HrssConsts.HRWEB_PRIMARY_KEY, primarykey);
715         CommonUtil.showWindowDialog(
716                 "HrssTableFileManager",
717                 nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID(
718                         "c_pe-res", "0c_pe-res0023")/*
719                                                      * @ res "文档管理"
720                                                      */, "750", "450", null,
721                 null);
722     }
723 
724     /**
725      * 导出pdf文档:临时新增
726      * @throws Exception 
727      */
728     @SuppressWarnings({ "unused", "rawtypes" })
729     public void exportPDF(MouseEvent mouseEvent) throws Exception {
730         HrssPrintMDDataSource hds = new HrssPrintMDDataSource();
731         hds.setSingleData(true);
732 //        String dsid = (String) ViewUtil.getCurrentView().getExtendAttributeValue(BillTemplateConst.MASTER_DS);
733         Dataset ds = ViewUtil.getCurrentView().getViewModels().getDataset("leaveapply");
734         
735         Row row = ds.getSelectedRow();
736         SuperVO[] aggVO = new Dataset2SuperVOSerializer().serialize(ds, ds.getSelectedRow());
737         AggLeaveApplyVO agg = new SimpleDocServiceTemplate("").queryByPk(AggLeaveApplyVO.class, aggVO[0].getPrimaryKey());
738         //查询打印的数据  
739 //        SuperVO[]aggVO = queryVOs();
740         String func_code = "";
741         String key = "";
742         String pageId = getPageId();
743         if (LeaveConst.LEAVEAPPLY.equals(pageId)) {
744             func_code = PrintCodeForPortal.leaveapply_funcode;
745             key = PrintCodeForPortal.leaveapply_nodekey;
746         }else if(LeaveConst.SPECIALLEAVEAPPLY.equals(pageId)){
747             func_code = PrintCodeForPortal.specialleaveapply_funcode;
748             key = PrintCodeForPortal.specialleaveapply_nodekey;
749         }
750         hds.setMDObjects(new AggLeaveApplyVO[]{agg});
751         SessionUtil.setAttribute(HrssPrintAction.DATA_SOURCE, hds);
752         SessionUtil.setAttribute(HrssPrintAction.FUNC_CODE, func_code);
753 //        SessionUtil.setAttribute(HrssPrintAction.NODE_KEY, "6009dimi");
754         
755         String Url=LfwRuntimeEnvironment.getRootPath() + "/pt/downloadPDF/downloadExportPdf?strNodeKey="+key;
756         AppLifeCycleContext.current().getApplicationContext().addExecScript("window.location='" + Url + "';");
757     }
758     // add renyuepeng Sep 12, 2015 end
759 }

 

posted @ 2015-11-11 19:49  ZZZZW  阅读(1548)  评论(0编辑  收藏  举报
AmazingCounters.com