userInfo-add.jsp 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814
  1. <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
  2. <%@include file="/context/mytags.jsp" %>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>用户基本信息</title>
  7. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  8. <link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css"/>
  9. <script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.js"></script>
  10. <script src="plug-in/layer/layer.js"></script>
  11. </head>
  12. <%-- scroll="no"--%>
  13. <body style="overflow-x: hidden;">
  14. <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" tipSweep="true"
  15. action="personnelBaseArchivesManageController.do?saveUser">
  16. <input id="id" name="id" type="hidden" value="${userInfo.id }">
  17. <table style="width: 600px; " cellpadding="0" cellspacing="1" class="formtable">
  18. <tr>
  19. <td align="right" width="25%" nowrap>
  20. <label class="Validform_label"><font color="#FF0000"></font>员工工号: </label>
  21. </td>
  22. <%-- datatype s2-10--%>
  23. <td class="value" width="85%">
  24. <c:if test="${userInfo.id!=null }"> ${userInfo.userNum } </c:if>
  25. <c:if test="${userInfo.id==null }">
  26. <input id="userNum" class="inputxt" name="userNum" value="${userInfo.userNum }" />
  27. <span class="Validform_checktip"> 员工工号范围在2~10位字符</span>
  28. </c:if>
  29. </td>
  30. </tr>
  31. <tr>
  32. <td align="right" width="10%" nowrap>
  33. <label class="Validform_label"><span color="red" class="requiredIcon">*</span>员工姓名: </label>
  34. </td>
  35. <td class="value" width="10%">
  36. <input id="realName" class="inputxt" name="realName" value="${userInfo.realName }" datatype="*">
  37. <span class="Validform_checktip"><t:mutiLang langKey="fill.realname"/></span>
  38. </td>
  39. <script>
  40. $(function () {
  41. $("input[id^='realName']").keypress(function (event) {
  42. const eobj = event || e;
  43. const keyCode = eobj.keyCode || eobj.charCode || e.which;
  44. if ((keyCode >= 48 && keyCode <= 57)) {
  45. layer.msg("员工姓名不能输入数字")
  46. eobj.preventDefault();
  47. } else {
  48. eobj.returnValue = true;
  49. }
  50. });
  51. });
  52. </script>
  53. </tr>
  54. <tr>
  55. <td align="right">
  56. <label class="Validform_label">
  57. 附件照片:
  58. </label>
  59. </td>
  60. <td class="value">
  61. <input id="imgUrl" name="image" type="hidden">
  62. <t:webUploader name="okpath" auto="true" callback="uploadSucc" showImgDiv="" type="image"
  63. buttonStyle="btn-green" fileNumLimit="1"
  64. url="cgUploadController.do?ajaxSaveFile"></t:webUploader>
  65. </td>
  66. <td colspan="2" id="instructionfile" class="value">
  67. <div id="fileShow"></div>
  68. </td>
  69. </tr>
  70. <tr>
  71. <td align="right">
  72. <label class="Validform_label"><span color="red" class="requiredIcon">*</span>性别: </label>
  73. </td>
  74. <td class="value">
  75. <t:dictSelect field="gender" id="gender" type="list" typeGroupCode="sex" defaultVal="${userInfo.gender}"
  76. hasLabel="false" datatype="*" title="性别"></t:dictSelect>
  77. <span class="Validform_checktip"></span>
  78. <label class="Validform_label" style="display: none;">性别</label>
  79. </td>
  80. </tr>
  81. <tr>
  82. <td align="right">
  83. <label class="Validform_label"><font color="#FF0000"></font>民族: </label>
  84. </td>
  85. <td class="value">
  86. <t:dictSelect field="nation" id="nation" type="list" typeGroupCode="nation" defaultVal="hanzu"
  87. hasLabel="false" title="民族"></t:dictSelect>
  88. <span class="Validform_checktip"></span>
  89. <label class="Validform_label" style="display: none;">民族</label>
  90. </td>
  91. </tr>
  92. <tr>
  93. <td align="right" nowrap>
  94. <label class="Validform_label"><span color="red" class="requiredIcon">*</span>手机号码: </label>
  95. </td>
  96. <td class="value">
  97. <input class="inputxt" name="mobilePhone" value="${userInfo.mobilePhone}" datatype="m"
  98. errormsg="手机号码不正确" userInfoValidType="t_s_user,mobilePhone,id">
  99. <span class="Validform_checktip"></span>
  100. </td>
  101. </tr>
  102. <tr>
  103. <td align="right"><label class="Validform_label"> 座机号码: </label></td>
  104. <td class="value">
  105. <input class="inputxt" name="officePhone" value="${userInfo.officePhone}"
  106. errormsg="座机号码不正确" ignore="ignore">
  107. <span class="Validform_checktip"></span>
  108. </td>
  109. </tr>
  110. <tr>
  111. <td align="right"><label class="Validform_label"> 紧急联系人: </label></td>
  112. <td class="value">
  113. <input class="inputxt" name="contacts" value="${userInfo.contacts}" ignore="ignore">
  114. <span class="Validform_checktip"></span>
  115. </td>
  116. </tr>
  117. <tr>
  118. <td align="right"><label class="Validform_label"> 紧急联系人电话: </label></td>
  119. <td class="value">
  120. <input class="inputxt" name="contactsPhone" value="${userInfo.contactsPhone}"
  121. errormsg="手机号码不正确" ignore="ignore">
  122. <span class="Validform_checktip"></span>
  123. </td>
  124. </tr>
  125. <tr>
  126. <td align="right">
  127. <label class="Validform_label"><font color="#FF0000">*</font>身份证号码:</label>
  128. </td>
  129. <%-- s15-18--%>
  130. <td class="value">
  131. <input id="idcard" name="idcard" type="text" onfocusout="getBirthdayFromIdCard(this)"
  132. style="width: 149px" userInfoValidType="t_s_user,idcard,id" value='${userInfo.idcard}' datatype="*"
  133. placeholder="" errormsg="请填写正确的身份证号码!"/>
  134. <span class="Validform_checktip"></span>
  135. <label class="Validform_label" style="display: none;">身份证号码: </label>
  136. </td>
  137. </tr>
  138. <tr>
  139. <td align="right">
  140. <label class="Validform_label"><font color="#FF0000">*</font>出生日期: </label>
  141. </td>
  142. <td class="value">
  143. <%-- class="Wdate" datatype="date" value='<fmt:formatDate value='${userInfo.birthday}' type="date" pattern="yyyy-MM-dd"/>' readonly="readonly"--%>
  144. <input id="birthday" name="birthday" type="hidden" value='${userInfo.birthday}'/>
  145. <input id="birthday2" name="birthday2" type="text" datatype="*" style="width: 149px" disabled/>
  146. <span class="Validform_checktip">填写身份证号码自动获取值</span>
  147. <label class="Validform_label" style="display: none;">出生日期</label>
  148. </td>
  149. </tr>
  150. <tr>
  151. <td align="right">
  152. <label class="Validform_label"><font color="#FF0000">*</font>年龄: </label>
  153. </td>
  154. <td class="value">
  155. <input id="age" name="age" type="hidden" value='${userInfo.age}'/>
  156. <input id="age2" name="age2" type="text" style="width: 149px" datatype="*" disabled/>
  157. <span class="Validform_checktip">填写身份证号码自动获取值</span>
  158. <label class="Validform_label" style="display: none;">年龄</label>
  159. </td>
  160. </tr>
  161. <tr>
  162. <td align="right">
  163. <label class="Validform_label">户籍地址: </label>
  164. </td>
  165. <td class="value">
  166. <input id="hkaddress" name="hkaddress" type="text" style="width: 200px" value='${userInfo.hkaddress}'
  167. placeholder="" ignore="ignore" errormsg="户口户籍最多填写100文字!"/>
  168. <span class="Validform_checktip"></span>
  169. <label class="Validform_label" style="display: none;">户籍地址</label>
  170. </td>
  171. </tr>
  172. <tr>
  173. <td align="right">
  174. <label class="Validform_label"><font color="#FF0000"></font>户籍类别: </label>
  175. </td>
  176. <td class="value">
  177. <t:dictSelect field="hktype" id="hktype" type="list" typeGroupCode="hktype"
  178. defaultVal="${userInfo.hktype}" hasLabel="false" title="户籍类别"></t:dictSelect>
  179. <span class="Validform_checktip"></span>
  180. <label class="Validform_label" style="display: none;">户籍类别</label>
  181. </td>
  182. </tr>
  183. <tr>
  184. <td align="right">
  185. <label class="Validform_label">居住地址: </label>
  186. </td>
  187. <td class="value">
  188. <input id="address" name="address" type="text" style="width: 200px" value='${userInfo.address}'
  189. placeholder="" ignore="ignore" errormsg="居住地址最多填写100文字!"/>
  190. <span class="Validform_checktip"></span>
  191. <label class="Validform_label" style="display: none;">居住地址</label>
  192. </td>
  193. </tr>
  194. <!-- 所属部门 start -->
  195. <tr>
  196. <td align="right">
  197. <label class="Validform_label"><span color="red" class="requiredIcon">*</span>所属部门: </label>
  198. </td>
  199. <td class="value">
  200. <input id="departname" name="departname" type="text" readonly="readonly" class="inputxt"
  201. onclick="openDepartmentSelect()"
  202. placeholder="请选择" datatype="*" value="${departname}">
  203. <input id="orgIds" name="orgIds" type="hidden" value="${orgIds}">
  204. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="departSearch"
  205. onclick="openDepartmentSelect()">选择</a>
  206. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="departRedo"
  207. onclick="callbackClean()">清空</a>
  208. <%-- <span class="Validform_checktip">一线员工必须选择保安部、保洁部等部门;项目经理和内勤必须选择项目</span>--%>
  209. </td>
  210. </tr>
  211. <!-- 所属部门 end -->
  212. <tr>
  213. <td align="right">
  214. <label class="Validform_label">设备编号: </label>
  215. </td>
  216. <td class="value">
  217. <input id="deviceId" name="deviceId" type="text" style="width: 200px" value='${userInfo.deviceId}'
  218. placeholder="" ignore="ignore"/>
  219. <span class="Validform_checktip"></span>
  220. <label class="Validform_label" style="display: none;">设备编号</label>
  221. </td>
  222. </tr>
  223. <tr>
  224. <td align="right">
  225. <label class="Validform_label">
  226. <span color="red" class="requiredIcon">*</span>网格化区域(排班人员为必填):
  227. </label>
  228. </td>
  229. <td class="value">
  230. <t:dictSelect field="areaRegion" type="list" typeGroupCode="areaRegion" hasLabel="false" datatype="*" defaultVal="${userInfo.areaRegion}"
  231. title="网格化区域"></t:dictSelect>
  232. <span class="Validform_checktip"></span>
  233. <label class="Validform_label" style="display: none;">网格化区域</label>
  234. </td>
  235. </tr>
  236. <tr>
  237. <td align="right">
  238. <label class="Validform_label">
  239. <span color="red" class="requiredIcon">*</span>职务:
  240. </label>
  241. </td>
  242. <td class="value">
  243. <input id="dutiesId" name="dutiesId" type="hidden" datatype="*" value="${userInfo.dutiesId}">
  244. <input id="dutiesName" name="dutiesName" type="text" style="width: 150px" ignore="ignore"
  245. onclick="openDutiesSelect()" value='${dutiesName}' placeholder="请输入所属职务"/>
  246. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="dutiesSearch"
  247. onclick="openDutiesSelect()">选择</a>
  248. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="dutiesRedo"
  249. onclick="dutiesClean()">清空</a>
  250. <span class="Validform_checktip"></span>
  251. <label class="Validform_label" style="display: none;">职务</label>
  252. </td>
  253. </tr>
  254. <tr>
  255. <td align="right">
  256. <label class="Validform_label">
  257. <span color="red" class="requiredIcon">*</span>岗位:
  258. </label>
  259. </td>
  260. <td class="value">
  261. <input id="postId" name="postId" type="hidden" datatype="*" value='${userInfo.postId}'/>
  262. <input id="postName" name="postName" type="text" style="width: 150px" ignore="ignore"
  263. onclick="openPostSelect()" value='${postName}' placeholder="请输入所属岗位"/>
  264. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="postSearch"
  265. onclick="openPostSelect()">选择</a>
  266. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="postRedo"
  267. onclick="postClean()">清空</a>
  268. <span class="Validform_checktip"></span>
  269. <label class="Validform_label" style="display: none;">岗位</label>
  270. </td>
  271. </tr>
  272. <!-- 新增字段 -->
  273. <tr>
  274. <td align="right">
  275. <label class="Validform_label"><font color="#FF0000"></font>政治面貌</label>
  276. </td>
  277. <td class="value">
  278. <t:dictSelect field="outlook" id="outlook" type="list" typeGroupCode="outLook" hasLabel="false" title="政治面貌"></t:dictSelect>
  279. <span class="Validform_checktip"></span>
  280. <label class="Validform_label" style="display: none;">政治面貌</label>
  281. </td>
  282. </tr>
  283. <tr>
  284. <td align="right">
  285. <label class="Validform_label">学历</label>
  286. </td>
  287. <td class="value">
  288. <t:dictSelect field="education" id="education" type="list" typeGroupCode="education" hasLabel="false" title="学历"></t:dictSelect>
  289. <span class="Validform_checktip"></span>
  290. <label class="Validform_label" style="display: none;">学历</label>
  291. </td>
  292. </tr>
  293. <tr>
  294. <td align="right">
  295. <label class="Validform_label"><font color="#FF0000"></font>员工性质</label>
  296. </td>
  297. <td class="value">
  298. <t:dictSelect field="nature" id="nature" type="list" typeGroupCode="nature" hasLabel="false" title="员工性质"></t:dictSelect>
  299. <span class="Validform_checktip"></span>
  300. <label class="Validform_label" style="display: none;">员工性质</label>
  301. </td>
  302. </tr>
  303. <tr>
  304. <td align="right"><label class="Validform_label">邮箱: </label></td>
  305. <td class="value">
  306. <input class="inputxt" name="email" value="${userInfo.email}" errormsg="邮箱格式不正确!"
  307. ignore="ignore">
  308. <span class="Validform_checktip"></span>
  309. </td>
  310. </tr>
  311. <tr>
  312. <td align="right">
  313. <label class="Validform_label"><font color="#FF0000"></font>入职日期:</label>
  314. </td>
  315. <td class="value">
  316. <input id="employmentDate" name="employmentDate" type="text" style="width: 149px" class="Wdate"
  317. errormsg="请填写正确的入职日期!"
  318. value='<fmt:formatDate value='${userInfo.employmentDate}' type="date" pattern="yyyy-MM-dd"/>'
  319. readonly="readonly"/>
  320. <span class="Validform_checktip"></span>
  321. <label class="Validform_label" style="display: none;">入职日期</label>
  322. </td>
  323. </tr>
  324. <tr>
  325. <td align="right">
  326. <label class="Validform_label"><span color="red" class="requiredIcon">*</span>是否登录系统:</label>
  327. </td>
  328. <td class="value">
  329. <t:dictSelect field="userType" id="userType" type="list" typeGroupCode="userType"
  330. defaultVal="${userInfo.userType}" hasLabel="false" datatype=""
  331. title="员工登录类型"></t:dictSelect>
  332. <span class="Validform_checktip"></span>
  333. <label class="Validform_label" style="display: none;">是否登录系统</label>
  334. </td>
  335. </tr>
  336. <tr style="display: none">
  337. <td align="right"><label class="Validform_label"> <t:mutiLang langKey="common.common.dev"/>: </label></td>
  338. <td class="value">
  339. <c:if test="${userInfo.devFlag == null || userInfo.devFlag == ''}">
  340. <t:dictSelect id="devFlag" field="devFlag" typeGroupCode="dev_flag" hasLabel="false" datatype="*"
  341. defaultVal="0" type="radio"></t:dictSelect>
  342. </c:if>
  343. <c:if test="${userInfo.devFlag != null && userInfo.devFlag != ''}">
  344. <t:dictSelect id="devFlag" field="devFlag" typeGroupCode="dev_flag" hasLabel="false" datatype="*"
  345. defaultVal="${userInfo.devFlag}" type="radio"></t:dictSelect>
  346. </c:if>
  347. <span class="Validform_checktip"></span>
  348. </td>
  349. </tr>
  350. <tr style="display: none">
  351. <td align="right">
  352. <label class="Validform_label">
  353. 工作流引擎:
  354. </label>
  355. </td>
  356. <td class="value">
  357. <c:if test="${userInfo.activitiSync == null || userInfo.activitiSync == ''}">
  358. <input name="activitiSync" type="radio" datatype="min" min="1" value="1" checked="checked">
  359. 同步
  360. <input name="activitiSync" type="radio" value="0">
  361. 不同步
  362. <span class="Validform_checktip">是否同步工作流引擎</span>
  363. </c:if>
  364. <c:if test="${userInfo.activitiSync != null && userInfo.activitiSync != ''}">
  365. <input name="activitiSync" type="radio" datatype="min" min="1"
  366. <c:if test="${userInfo.activitiSync eq 1}">checked="true"</c:if> value="1">
  367. 同步
  368. <input name="activitiSync" type="radio"
  369. <c:if test="${userInfo.activitiSync eq 0}">checked="true"</c:if> value="0">
  370. 不同步
  371. <span class="Validform_checktip">是否同步工作流引擎</span>
  372. </c:if>
  373. </td>
  374. </tr>
  375. </table>
  376. </t:formvalid>
  377. </body>
  378. <script>
  379. function uploadSucc(response) {
  380. if (response.success) {
  381. $('#imgUrl').val(response.attributes.url);
  382. console.log(response.attributes.url);
  383. }
  384. }
  385. $(function () {
  386. $("input[name='birthday']").attr("class", "Wdate").click(function () {
  387. WdatePicker({dateFmt: 'yyyy-MM-dd'});
  388. });
  389. // $(":input[name='birthday']").css("width","150px");
  390. $("input[name='employmentDate']").attr("class", "Wdate").click(function () {
  391. WdatePicker({dateFmt: 'yyyy-MM-dd'});
  392. });
  393. })
  394. function openDepartmentSelect() {
  395. //--author:zhaohualong-----start----date: 2018年1月11日--------for:新代码------
  396. //*****************************
  397. //update-by yulong.zhao 17-12-14 按照choose标签生成代码进行修改原来js
  398. var windowapi;
  399. try {
  400. windowapi = frameElement.api, W = windowapi.opener;
  401. } catch (e) {
  402. }
  403. //$.dialog.setting.zIndex = getzIndex();
  404. var orgIds = $("#orgIds").val();
  405. if (typeof (windowapi) == 'undefined') {
  406. $.dialog({
  407. content: 'url:departController.do?departSelect&orgIds=' + orgIds,
  408. zIndex: getzIndex(),
  409. title: '所属部门列表',
  410. lock: true,
  411. width: '400px',
  412. height: '350px',
  413. opacity: 0.4,
  414. button: [
  415. {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelect, focus: true},
  416. //update-by yulong.zhao 改为function中调用close方法否则多层弹出框,遮罩效果会关闭一个窗口后消失
  417. //{name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  418. {
  419. name: '<t:mutiLang langKey="common.cancel"/>', callback: function () {
  420. close();
  421. }
  422. }
  423. ]
  424. })
  425. } else {
  426. $.dialog({
  427. content: 'url:departController.do?departSelect&orgIds=' + orgIds,
  428. zIndex: getzIndex(),
  429. title: '所属部门列表',
  430. lock: true,
  431. parent: windowapi,
  432. width: '400px',
  433. height: '350px',
  434. opacity: 0.4,
  435. button: [
  436. {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelect, focus: true},
  437. //update-by yulong.zhao 改为function中调用close方法否则多层弹出框,遮罩效果会关闭一个窗口后消失
  438. //{name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  439. {
  440. name: '<t:mutiLang langKey="common.cancel"/>', callback: function () {
  441. close();
  442. }
  443. }
  444. ]
  445. }).zindex();
  446. }
  447. //*****************************
  448. //--author:zhaohualong-----end----date: 2018年1月11日--------for:新代码------
  449. //--author:zhaohualong-----start----date: 2018年1月11日--------for:原代码------
  450. //================================
  451. /* $.dialog.setting.zIndex = getzIndex();
  452. var orgIds = $("#orgIds").val();
  453. $.dialog({content: 'url:departController.do?departSelect&orgIds='+orgIds, zIndex: 3101, title: '所属部门列表', lock: true, width: '400px', height: '350px', opacity: 0.4, button: [
  454. {name: '
  455. <t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelect, focus: true},
  456. {name: '
  457. <t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  458. ]}).zindex(); */
  459. //================================
  460. //--author:zhaohualong-----end----date: 2018年1月11日--------for:原代码------
  461. <%-- var orgIds = $("#orgIds").val();--%>
  462. <%-- $.dialog({--%>
  463. <%-- content: 'url:dialogDealController.do?projectDepartTableAllWithChild&ids='+orgIds, zIndex: getzIndex(), title: '项目名称列表', lock: true, width: '600px', height: '400px', opacity: 0.4, button: [--%>
  464. <%-- {name: '<t:mutiLang langKey="common.confirm"/>', callback: function (){--%>
  465. <%-- var iframe = this.iframe.contentWindow;--%>
  466. <%-- if(iframe.getReason().length>0){--%>
  467. <%-- var strData=eval(iframe.getReason());--%>
  468. <%-- for(var key in strData[0]){--%>
  469. <%-- if(key=="strPId"){--%>
  470. <%-- $("#orgIds").val(strData[0][key]);--%>
  471. <%-- }else if(key=="strDepartName"){--%>
  472. <%-- $("#departname").val(strData[0][key]);--%>
  473. <%-- }--%>
  474. <%-- }--%>
  475. <%-- }--%>
  476. <%-- }, focus: true},--%>
  477. <%-- {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){--%>
  478. <%-- $('#departname').val('');--%>
  479. <%-- $('#orgIds').val('');--%>
  480. <%-- }}--%>
  481. <%-- ]}).zindex();--%>
  482. }
  483. function callbackDepartmentSelect() {
  484. var iframe = this.iframe.contentWindow;
  485. var treeObj = iframe.$.fn.zTree.getZTreeObj("departSelect");
  486. var nodes = treeObj.getCheckedNodes(true);
  487. if (nodes.length > 0) {
  488. var ids = '', names = '';
  489. for (i = 0; i < nodes.length; i++) {
  490. var node = nodes[i];
  491. ids += node.id + ',';
  492. names += node.name + ',';
  493. }
  494. // 把最后的逗号去掉
  495. names = names.substring(0, names.length - 1);
  496. //判断兼容机构里有没有所属机构
  497. // if(ids.length>0 && $('#jzorgIds').val().length>0){
  498. // if($('#jzorgIds').val().indexOf(ids)>=0){
  499. // //console.info("ids:"+ids);
  500. // //console.info("orgIds:"+$('#orgIds').val());
  501. // $.messager.alert("错误","所属部门和兼容机构不能有重叠!!");
  502. // }else{
  503. // $('#departname').val(names);
  504. // $('#departname').blur();
  505. // $('#orgIds').val(ids);
  506. // }
  507. // }else{
  508. $('#departname').val(names);
  509. $('#departname').blur();
  510. $('#orgIds').val(ids);
  511. // }
  512. }
  513. }
  514. function callbackClean() {
  515. $('#departname').val('');
  516. $('#orgIds').val('');
  517. }
  518. $(function () {
  519. $("#departname").prev().hide();
  520. $("#jzdepartname").prev().hide();
  521. });
  522. //兼职机构 start
  523. function openDepartmentSelectjz() {
  524. /**
  525. $.dialog.setting.zIndex = getzIndex();
  526. var jzorgIds = $("#jzorgIds").val();
  527. $.dialog({content: 'url:departController.do?jzdepartSelect&jzorgIds='+jzorgIds, zIndex: 3100, title: '兼职机构列表', lock: true, width: '400px', height: '350px', opacity: 0.4, button: [
  528. {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelectjz, focus: true},
  529. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  530. ]}).zindex();
  531. */
  532. // var windowapi;
  533. // try {
  534. // windowapi = frameElement.api, W = windowapi.opener;
  535. // } catch (e) {
  536. // }
  537. // var jzorgIds = $("#jzorgIds").val();
  538. // if(typeof(windowapi) == 'undefined'){
  539. // $.dialog({content: 'url:departController.do?jzdepartSelect&jzorgIds='+jzorgIds, zIndex: getzIndex(), title: '兼职机构列表', lock: true, width: '400px', height: '350px', opacity: 0.4, button: [
  540. // {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelectjz, focus: true},
  541. // {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){close();}}
  542. // ]})
  543. // }else{
  544. // $.dialog({content: 'url:departController.do?jzdepartSelect&jzorgIds='+jzorgIds, zIndex: getzIndex(), title: '兼职机构列表', lock: true, parent : windowapi, width: '400px', height: '350px', opacity: 0.4,button: [
  545. // {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelectjz, focus: true},
  546. // {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){close();}}
  547. // ]})
  548. // }
  549. var orgIds = $("#jzorgIds").val();
  550. $.dialog({
  551. content: 'url:dialogDealController.do?projectDepartTableAllCheckbox&ids=' + orgIds,
  552. zIndex: getzIndex(),
  553. title: '兼职项目列表',
  554. lock: true,
  555. width: '600px',
  556. height: '400px',
  557. opacity: 0.4,
  558. button: [
  559. {
  560. name: '<t:mutiLang langKey="common.confirm"/>', callback: function () {
  561. var iframe = this.iframe.contentWindow;
  562. if (iframe.getReason().length > 0) {
  563. var strData = eval(iframe.getReason());
  564. for (var key in strData[0]) {
  565. if (key == "strPId") {
  566. $("#jzorgIds").val(strData[0][key]);
  567. } else if (key == "strDepartName") {
  568. $("#jzdepartname").val(strData[0][key]);
  569. }
  570. }
  571. }
  572. }, focus: true
  573. },
  574. {
  575. name: '<t:mutiLang langKey="common.cancel"/>', callback: function () {
  576. // $('#jzdepartname').val('');
  577. // $('#jzorgIds').val('');
  578. }
  579. }
  580. ]
  581. }).zindex();
  582. }
  583. function callbackDepartmentSelectjz() {
  584. // var iframe = this.iframe.contentWindow;
  585. // var treeObj = iframe.$.fn.zTree.getZTreeObj("jzdepartSelect");
  586. // var nodes = treeObj.getCheckedNodes(true);
  587. // if(nodes.length>0){
  588. // var ids='',names='';
  589. // for(i=0;i<nodes.length;i++){
  590. // var node = nodes[i];
  591. // ids += node.id+',';
  592. // names += node.name+',';
  593. // }
  594. // // 把最后的逗号去掉
  595. // names = names.substring(0,names.length - 1);
  596. // //判断兼容机构里有没有所属机构
  597. // if(ids.length>0 && $('#orgIds').val().length>0){
  598. // if(ids.indexOf( $('#orgIds').val() )>=0){
  599. // //console.info("ids:"+ids);
  600. // //console.info("orgIds:"+$('#orgIds').val());
  601. // $.messager.alert("错误","所属部门和兼容机构不能有重叠!");
  602. // }else{
  603. // $('#jzdepartname').val(names);
  604. // $('#jzdepartname').blur();
  605. // $('#jzorgIds').val(ids);
  606. // }
  607. // }else{
  608. // $('#jzdepartname').val(names);
  609. // $('#jzdepartname').blur();
  610. // $('#jzorgIds').val(ids);
  611. // }
  612. // }
  613. }
  614. function callbackCleanjz() {
  615. $('#jzdepartname').val('');
  616. $('#jzorgIds').val('');
  617. }
  618. //兼职机构 end
  619. function contains(arr, obj) {
  620. var i = arr.length;
  621. while (i--) {
  622. if (arr[i] === obj) {
  623. return true;
  624. }
  625. }
  626. return false;
  627. }
  628. function beforeSubmitCheck() {
  629. // var jzorgIds = $('#jzorgIds').val();
  630. // var orgids = $('#orgIds').val();
  631. // if(jzorgIds.indexOf(orgids) != -1){
  632. // layer.alert("兼职机构不能包含主所属部门");
  633. // return false;
  634. // }
  635. return true;
  636. }
  637. // 职务选择
  638. function openDutiesSelect() {
  639. $.dialog.setting.zIndex = getzIndex();
  640. var orgIds = $("#orgIds").val();
  641. $.dialog({
  642. content: 'url:dutiesController.do?departSelect&orgIds=' + orgIds,
  643. zIndex: getzIndex(),
  644. title: '职务列表',
  645. lock: true,
  646. width: '400px',
  647. height: '350px',
  648. opacity: 0.4,
  649. button: [
  650. {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDutiesSelect, focus: true},
  651. {
  652. name: '<t:mutiLang langKey="common.cancel"/>', callback: function () {
  653. }
  654. }
  655. ]
  656. }).zindex();
  657. }
  658. // 职务回调
  659. function callbackDutiesSelect() {
  660. var iframe = this.iframe.contentWindow;
  661. var treeObj = iframe.$.fn.zTree.getZTreeObj("departSelect");
  662. var nodes = treeObj.getCheckedNodes();
  663. // var nodes = treeObj.getSelectedNodes();
  664. // console.log(nodes);
  665. if (nodes.length > 0) {
  666. var ids = '', names = '';
  667. for (var i = 0; i < nodes.length; i++) {
  668. var node = nodes[i];
  669. ids += node.id + ',';
  670. names += node.name + ',';
  671. }
  672. ids = ids.substring(0, ids.length - 1);
  673. names = names.substring(0, names.length - 1);
  674. $("#dutiesName").val(names);
  675. $("#dutiesName").blur();
  676. $("#dutiesId").val(ids);
  677. }
  678. }
  679. function dutiesClean() {
  680. $("#dutiesId").val('');
  681. $("#dutiesName").val('');
  682. }
  683. //岗位选择
  684. function openPostSelect() {
  685. $.dialog.setting.zIndex = getzIndex();
  686. var orgIds = $("#orgIds").val();
  687. $.dialog({
  688. content: 'url:projectPostDetailController.do?postSelectNoCheckBox&orgIds=' + orgIds,
  689. zIndex: getzIndex(), title: '岗位列表', lock: true, width: '400px', height: '350px', opacity: 0.4, button: [
  690. {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackPostSelect, focus: true},
  691. {
  692. name: '<t:mutiLang langKey="common.cancel"/>', callback: function () {
  693. }
  694. }
  695. ]
  696. }).zindex();
  697. }
  698. // 岗位回调
  699. function callbackPostSelect() {
  700. var iframe = this.iframe.contentWindow;
  701. var treeObj = iframe.$.fn.zTree.getZTreeObj("postSelect");
  702. console.log(treeObj);
  703. var nodes = treeObj.getCheckedNodes(true);
  704. // var nodes = treeObj.getSelectedNodes(true);
  705. // console.log(nodes);
  706. if (nodes.length > 0) {
  707. var ids = '', names = '';
  708. for (i = 0; i < nodes.length; i++) {
  709. var node = nodes[i];
  710. ids += node.id + ',';
  711. names += node.name + ',';
  712. }
  713. ids = ids.substring(0, ids.length - 1);
  714. names = names.substring(0, names.length - 1);
  715. $("#postName").val(names);
  716. $("#postName").blur();
  717. $("#postId").val(ids);
  718. }
  719. }
  720. function postClean() {
  721. $("#postName").val('');
  722. $("#postId").val('');
  723. }
  724. function getBirthdayFromIdCard(t) {
  725. var idCard = $(t).val();
  726. var birthday = "";
  727. if (idCard != null && idCard != "") {
  728. if (idCard.length == 15) {
  729. birthday = "19" + idCard.substr(6, 6);
  730. } else if (idCard.length == 18) {
  731. birthday = idCard.substr(6, 8);
  732. }
  733. birthday = birthday.replace(/(.{4})(.{2})/, "$1-$2-");
  734. var age = idCard.substring(6,10);
  735. //获取当前年份
  736. var year = new Date().getFullYear();
  737. //获取月份
  738. var month = idCard.substring(10,12);
  739. //获取出生日
  740. var day = idCard.substring(12,14);
  741. // $("#age").val(year - age);
  742. // $("#age").val(year - age);
  743. document.getElementById("age").value = year - age;
  744. document.getElementById("age2").value = year - age;
  745. }
  746. $("#birthday").val(birthday);
  747. $("#birthday2").val(birthday);
  748. return birthday;
  749. }
  750. </script>
  751. </html>