samelevelTransfer-add.jsp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  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. <script src="plug-in/layer/layer.js"></script>
  9. <script>
  10. function btn_ok(){
  11. $("#btnsub").click();
  12. }
  13. function callback(data){
  14. if(data.success){
  15. layer.alert(data.msg,{ icon: 0 , closeBtn: 0 } , function(index){
  16. window.location.href="activitiSamelevelTransferController.do?list";
  17. layer.close(index);
  18. });
  19. }
  20. else{
  21. layer.alert(data.msg);
  22. }
  23. }
  24. $(function(){
  25. $("#userid").next("input").next("a").next("a").attr("icon","icon-clean");
  26. $("#userid").next("input").next("a").next("a").children("span").children("span").attr("class","l-btn-text icon-clean l-btn-icon-left");
  27. var tem = getCurrentMonthLast().Format("yyyy-MM-dd");
  28. // $("#outTime").val(tem);
  29. // $("#inTime").val(getNextDayss(tem));
  30. layer.alert("一线员工调动时,要选择调入的部门(工程部、保洁部等)。否则无法排班!");
  31. });
  32. //取得当月的最后一天
  33. function getCurrentMonthLast(){
  34. var date=new Date();
  35. var currentMonth=date.getMonth();
  36. var nextMonth=++currentMonth;
  37. var nextMonthFirstDay=new Date(date.getFullYear(),nextMonth,1);
  38. var oneDay=1000*60*60*24;
  39. return new Date(nextMonthFirstDay-oneDay);
  40. }
  41. //取得后一天日期
  42. function getNextDayss(d){
  43. d = new Date(d);
  44. d = +d + 1000*60*60*24;
  45. d = new Date(d);
  46. //return d;
  47. //格式化
  48. var temp1 = d.getMonth()+1;
  49. var temp2 = d.getDate();
  50. if(temp1 < 10){
  51. temp1 = "0"+temp1;
  52. }
  53. if(temp2 < 10){
  54. temp2 = "0"+temp2;
  55. }
  56. return d.getFullYear()+"-"+temp1+"-"+temp2;
  57. }
  58. //日期格式化
  59. Date.prototype.Format = function (fmt) { //author: meizz
  60. var o = {
  61. "M+": this.getMonth() + 1, //月份
  62. "d+": this.getDate(), //日
  63. "h+": this.getHours(), //小时
  64. "m+": this.getMinutes(), //分
  65. "s+": this.getSeconds(), //秒
  66. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  67. "S": this.getMilliseconds() //毫秒
  68. };
  69. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  70. for (var k in o)
  71. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  72. return fmt;
  73. }
  74. </script>
  75. <script type="text/javascript">
  76. function updateoldDutiesid(){
  77. var userid = $("#userid").val();
  78. if(userid != ''){
  79. $.ajax({
  80. url:"activitiSamelevelTransferController.do?updateoldDutiesid",
  81. data:{id:userid},
  82. dataType:"json",
  83. type:"POST",
  84. success:function(result){
  85. $(".danwei").text(result.attributes.departName);
  86. $(".zhiwei").text(result.attributes.dutiesName);
  87. $(".gangwei").text(result.attributes.postName);
  88. $("#belongUnitid").val(result.attributes.departid);
  89. $("#oldDutiesid").val(result.attributes.dutiesid);
  90. $("#oldPostid").val(result.attributes.postid);
  91. }
  92. });
  93. }
  94. }
  95. function openDepartmentSelect() {
  96. var orgIds = $("#inUnitid").val();
  97. var projectUser = '${projectUser}';
  98. var params = '&ids=' + orgIds;
  99. if (projectUser == 'true') {
  100. $.dialog({
  101. content: 'url:dialogDealController.do?projectDepartTablePartChild' + params,
  102. zIndex: getzIndex(),
  103. title: '项目名称列表',
  104. lock: true,
  105. width: '600px',
  106. height: '400px',
  107. opacity: 0.4,
  108. button: [
  109. {
  110. name: '确定', callback: function () {
  111. var iframe = this.iframe.contentWindow;
  112. if (iframe.getReason().length > 0) {
  113. var strData = eval(iframe.getReason());
  114. for (var key in strData[0]) {
  115. if (key == "strPId") {
  116. $("#inUnitid").val(strData[0][key]);
  117. } else if (key == "strDepartName") {
  118. $("#duties").val(strData[0][key]);
  119. }
  120. }
  121. }
  122. }, focus: true
  123. },
  124. {
  125. name: '取消', callback: function () {
  126. $('#duties').val('');
  127. $('#inUnitid').val('');
  128. }
  129. }
  130. ]
  131. }).zindex();
  132. }else {
  133. $.dialog({
  134. content: 'url:dialogDealController.do?projectDepartTableAllWithChild'+ params,
  135. zIndex: getzIndex(),
  136. title: '项目名称列表',
  137. lock: true,
  138. width: '600px',
  139. height: '400px',
  140. opacity: 0.4,
  141. button: [
  142. {
  143. name: '<t:mutiLang langKey="common.confirm"/>', callback: function () {
  144. var iframe = this.iframe.contentWindow;
  145. if (iframe.getReason().length > 0) {
  146. var strData = eval(iframe.getReason());
  147. for (var key in strData[0]) {
  148. if (key == "strPId") {
  149. $("#inUnitid").val(strData[0][key]);
  150. } else if (key == "strDepartName") {
  151. $("#duties").val(strData[0][key]);
  152. }
  153. }
  154. }
  155. }, focus: true
  156. },
  157. {
  158. name: '<t:mutiLang langKey="common.cancel"/>', callback: function () {
  159. $('#duties').val('');
  160. $('#inUnitid').val('');
  161. }
  162. }
  163. ]
  164. }).zindex();
  165. }
  166. }
  167. function callbackDepartmentSelect() {
  168. // var iframe = this.iframe.contentWindow;
  169. // var treeObj = iframe.$.fn.zTree.getZTreeObj("departSelect");
  170. // // var nodes = treeObj.getSelectedNodes();
  171. // var nodes = treeObj.getCheckedNodes(true);
  172. // if(nodes.length>0){
  173. // var ids='',names='';
  174. // for(var i=0;i<nodes.length;i++){
  175. // var node = nodes[i];
  176. // ids += node.id+',';
  177. // names += node.name+',';
  178. // }
  179. // if(ids != ''){
  180. // $.ajax({
  181. // url:"modifyController.do?getorgid",
  182. // data:{orgid:ids},
  183. // dataType:"json",
  184. // type:"POST",
  185. // success:function(result){
  186. // $('#inUnitid').val(ids);
  187. // $('#duties').val(result.msg);
  188. // $('#duties').blur();
  189. // }
  190. // });
  191. // }
  192. // }
  193. }
  194. function callbackClean(){
  195. $('#duties').val('');
  196. $('#inUnitid').val('');
  197. }
  198. $(function(){
  199. $.Datatype.checkDutyType = function (val, obj, frm) {
  200. var msg = true;
  201. var userid = $('#userid').val();
  202. $.ajax({
  203. url: 'userActivitiController.do?dutyType'
  204. , data: {userid: userid}
  205. , dataType: 'json'
  206. , method: "POST"
  207. , async: false
  208. , success: function (d) {
  209. if(d!=1){
  210. msg='调动申请只允许一线员工';
  211. }
  212. }
  213. }
  214. )
  215. return msg;
  216. }
  217. })
  218. </script>
  219. <style type="text/css">
  220. .fixed-h{
  221. float:left;
  222. width:100%;
  223. min-height:630px;
  224. overflow:auto;
  225. background:#ffffff;
  226. }
  227. </style>
  228. </head>
  229. <body>
  230. <t:formvalid formid="formobj" dialog="false" tipSweep="true" usePlugin="password" layout="table" action="activitiSamelevelTransferController.do?doAdd" tiptype="1" callback="callback">
  231. <input id="id" name="id" type="hidden" value="${samelevelTransferPage.id }"/>
  232. <div class="fixed-h">
  233. <table style="width: 100%;" cellpadding="0" cellspacing="1" class="formtable">
  234. <tr>
  235. <td align="right" style="width: 15%;">
  236. <label class="Validform_label">
  237. <span color="red" class="requiredIcon">*</span>
  238. 调动方式:
  239. </label>
  240. </td>
  241. <td class="value" colspan="5">
  242. <label class="Validform_label">人事调动(平调)</label>
  243. </td>
  244. </tr>
  245. <tr>
  246. <td align="right"><label class="Validform_label"><span color="red" class="requiredIcon">*</span>调动员工:</label></td>
  247. <td class="value" colspan="5">
  248. <input id="userid" name="userid" type="hidden" value="" datatype="checkDutyType"/>
  249. <input name="realName" class="inputxt" value="" id="realName" readonly="readonly" datatype="*"/>
  250. <t:choose hiddenName="userid" hiddenid="id" left="50%" fun="updateoldDutiesid" width="670" height="450" url="correctionController.do?userWorkflow&type=samelevel_transfer" name="userList1" icon="icon-select" title="选择调动员工" textname="realName" isclear="true" isInit="true"></t:choose>
  251. <span class="Validform_checktip"></span>
  252. </td>
  253. </tr>
  254. <tr>
  255. <td align="right">
  256. <label class="Validform_label">
  257. 调出单位:
  258. </label>
  259. </td>
  260. <td class="value" style="width: 10%;">
  261. <label class="Validform_label danwei"></label>
  262. <input type="hidden" name="belongUnitid" id="belongUnitid"/>
  263. </td>
  264. <td align="right" style="width: 5%;">
  265. <label class="Validform_label">
  266. 原职级:
  267. </label>
  268. </td>
  269. <td class="value" style="width: 10%;">
  270. <label class="Validform_label zhiwei"></label>
  271. <input type="hidden" name="oldDutiesid" id="oldDutiesid"/>
  272. </td>
  273. <td align="right" style="width: 5%;">
  274. <label class="Validform_label">
  275. 原岗位:
  276. </label>
  277. </td>
  278. <td class="value" style="width: 55%;">
  279. <label class="Validform_label gangwei"></label>
  280. <input type="hidden" name="oldPostid" id="oldPostid"/>
  281. </td>
  282. </tr>
  283. <tr>
  284. <td align="right">
  285. <label class="Validform_label">
  286. <span color="red" class="requiredIcon">*</span>
  287. 调入单位:
  288. </label>
  289. </td>
  290. <td class="value" colspan="5">
  291. <%-- <t:departSelect hasLabel="true" selectedNamesInputId="orgNames"></t:departSelect> --%>
  292. <input id="duties" name="duties" type="text" readonly="readonly" datatype="*" nullmsg="调入单位不可为空!" class="inputxt"/>
  293. <input id="inUnitid" name="inUnitid" type="hidden" />
  294. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="departSearch" onclick="openDepartmentSelect()">选择</a>
  295. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="departRedo" onclick="callbackClean()">清空</a>
  296. </td>
  297. </tr>
  298. <tr style="height:30px;">
  299. <td align="right">
  300. <label class="Validform_label">
  301. <span color="red" class="requiredIcon">*</span>
  302. 调入日期:
  303. </label>
  304. </td>
  305. <td class="value">
  306. <input id="inTime" name="inTime" type="text" readonly="readonly" datatype="*"
  307. class="Wdate" onClick="WdatePicker({onpicking:clickIntime})" nullmsg="调入日期不可为空!" />
  308. <label class="Validform_label" style="display: none;">调入日期</label>
  309. </td>
  310. <td align="right">
  311. <label class="Validform_label">
  312. 调出日期:
  313. </label>
  314. </td>
  315. <td class="value">
  316. <%--outTime--%>
  317. <input type="hidden" id="outTime" name="outTime"/>
  318. <span id="outTimeText"></span>
  319. </td>
  320. </tr>
  321. <tr>
  322. <td align="right">
  323. <label class="Validform_label">
  324. <span color="red" class="requiredIcon">*</span>
  325. 新职务:
  326. </label>
  327. </td>
  328. <td class="value" colspan="5">
  329. <input id="duty" name="newDutiesid" type="hidden" datatype="*" value="${obj.newDutiesid}">
  330. <input id="dutyName" name="newDutyName" type="text" style="width: 300px" ignore="ignore" readonly="readonly" value='${obj.newDutyName}' placeholder="请输入所属职务"/>
  331. <c:if test="${empty param.load}">
  332. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="dutiesSearch" onclick="openDutiesSelect()">选择</a>
  333. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="dutiesRedo" onclick="dutiesClean()">清空</a>
  334. </c:if>
  335. <span class="Validform_checktip"></span>
  336. <label class="Validform_label" style="display: none;">新职务</label>
  337. </td>
  338. </tr>
  339. <tr>
  340. <td align="right">
  341. <label class="Validform_label">
  342. <span color="red" class="requiredIcon">*</span>
  343. 调动原因:
  344. </label>
  345. </td>
  346. <td class="value" colspan="5" >
  347. <textarea style="width:600px;height: 80px;" class="inputxt" rows="6" id="transferReason" maxlength="200" name="transferReason" datatype="*" nullmsg="调动原因不可为空!" placeholder="请输入调动原因(最多输入文字数200)"></textarea>
  348. <span class="Validform_checktip"></span>
  349. <label class="Validform_label" style="display: none;">调动原因</label>
  350. </td>
  351. </tr>
  352. <tr>
  353. <td height="100px" align="center" colspan="2">
  354. </td>
  355. </tr>
  356. <tr>
  357. <td height="50px" align="center" colspan="6">
  358. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-confirm" onclick="btn_ok()">确定</a>
  359. <div style="display:none"><input type="submit" id ="btnsub" value=""/></div>
  360. <a style="margin-left:0px" href="activitiSamelevelTransferController.do?list&transferType=1" class="easyui-linkbutton l-btn" plain="true" iconcls="icon-return">返回</a>
  361. </td>
  362. </tr>
  363. </table>
  364. </div>
  365. </t:formvalid>
  366. </body>
  367. <script src = "webpage/cn/com/lzt/sameleveltransfer/samelevelTransfer.js"></script>
  368. <script>
  369. // 职务选择
  370. function openDutiesSelect() {
  371. $.dialog.setting.zIndex = getzIndex();
  372. var orgIds = $("#duty").val();
  373. $.dialog({content: 'url:dutiesController.do?departSelect${dutyCodeFilter}&orgIds='+orgIds, zIndex: getzIndex(), title: '职务列表', lock: true, width: '400px', height: '350px', opacity: 0.4, button: [
  374. {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDutiesSelect, focus: true},
  375. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  376. ]}).zindex();
  377. }
  378. // 职务回调
  379. function callbackDutiesSelect() {
  380. var iframe = this.iframe.contentWindow;
  381. var treeObj = iframe.$.fn.zTree.getZTreeObj("departSelect");
  382. var nodes = treeObj.getCheckedNodes();
  383. // var nodes = treeObj.getSelectedNodes();
  384. // console.log(nodes);
  385. if(nodes.length>0){
  386. var ids='',names='';
  387. for(var i=0;i<nodes.length;i++){
  388. var node = nodes[i];
  389. ids += node.id+',';
  390. names += node.name+',';
  391. }
  392. ids = ids.substring(0,ids.length - 1);
  393. names = names.substring(0,names.length - 1);
  394. $("#dutyName").val(names);
  395. $("#dutyName").blur();
  396. $("#duty").val(ids);
  397. }
  398. }
  399. function dutiesClean(){
  400. $("#duty").val('');
  401. $("#dutyName").val('');
  402. }
  403. function clickIntime(dq){
  404. var inTimeSelect = dq.cal.getNewDateStr();//获取当前控件的日期
  405. inTimeSelect = inTimeSelect.replace(/-/g,"/");
  406. var date = new Date(inTimeSelect);//将当前的日期转换成系统格式的日期
  407. var preDate = new Date(date.getTime() - 24*60*60*1000); //前一天
  408. var month = preDate.getMonth()+1;
  409. if(month<10){
  410. month='0'+month;
  411. }
  412. var day = preDate.getDate();
  413. if(day<10){
  414. day = '0'+day;
  415. }
  416. var yesterday = preDate.getFullYear()+"-"+month+"-"+ day;
  417. console.log(yesterday)
  418. $("#outTime").val(yesterday);
  419. $("#outTimeText").html(yesterday);
  420. }
  421. </script>