snapSingleborrow-update.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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. if(daypayvalidfor()){
  12. $("#btnsub").click();
  13. }
  14. }
  15. function callback(data){
  16. if(data.success){
  17. layer.alert(data.msg,{ icon: 0 , closeBtn: 0 } , function(index){
  18. window.location.href="samelevelTransferController.do?list&transferType=4";
  19. layer.close(index);
  20. });
  21. }
  22. else{
  23. layer.alert(data.msg);
  24. }
  25. }
  26. function oncang(){
  27. var tem = $("#outTime").val();
  28. $("#inTime").val(getNextDay(new Date(tem).Format("yyyy-MM-dd")));
  29. var intem = $("#inTime").val();
  30. var start=new Date(intem.replace("-", "/").replace("-", "/"));
  31. var deadDate = $("#deadDate").val();
  32. var end=new Date(deadDate.replace("-", "/").replace("-", "/"));
  33. if(start > end){
  34. layer.alert("<调动终止日>必须在<调入日期>之后");
  35. $("#deadDate").val(intem);
  36. }
  37. }
  38. //取得后一天日期
  39. function getNextDay(d){
  40. d = new Date(d);
  41. d = +d + 1000*60*60*24;
  42. d = new Date(d);
  43. //return d;
  44. //格式化
  45. var temp1 = d.getMonth()+1;
  46. var temp2 = d.getDate();
  47. if(temp1 < 10){
  48. temp1 = "0"+temp1;
  49. }
  50. if(temp2 < 10){
  51. temp2 = "0"+temp2;
  52. }
  53. return d.getFullYear()+"-"+temp1+"-"+temp2;
  54. }
  55. //日期格式化
  56. Date.prototype.Format = function (fmt) { //author: meizz
  57. var o = {
  58. "M+": this.getMonth() + 1, //月份
  59. "d+": this.getDate(), //日
  60. "h+": this.getHours(), //小时
  61. "m+": this.getMinutes(), //分
  62. "s+": this.getSeconds(), //秒
  63. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  64. "S": this.getMilliseconds() //毫秒
  65. };
  66. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  67. for (var k in o)
  68. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  69. return fmt;
  70. }
  71. </script>
  72. <script type="text/javascript">
  73. function updateoldDutiesid(){
  74. var userid = $("#userid").val();
  75. if(userid != ''){
  76. $.ajax({
  77. url:"samelevelTransferController.do?updateoldDutiesid",
  78. data:{id:userid},
  79. dataType:"json",
  80. type:"POST",
  81. success:function(result){
  82. $(".danwei").text(result.attributes.departName);
  83. $(".zhiwei").text(result.attributes.dutiesName);
  84. $(".gangwei").text(result.attributes.postName);
  85. $("#belongUnitid").val(result.attributes.departid);
  86. $("#oldDutiesid").val(result.attributes.dutiesid);
  87. $("#oldPostid").val(result.attributes.postid);
  88. }
  89. });
  90. }
  91. }
  92. function openDepartmentSelect() {
  93. // $.dialog.setting.zIndex = getzIndex();
  94. // var orgIds = $("#inUnitid").val();
  95. // $.dialog({content: 'url:departController.do?departSelect&orgIds='+orgIds, zIndex: 2101, title: '入职单位', lock: true, width: '400px', height: '350px', opacity: 0.4, button: [
  96. // {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelect, focus: true},
  97. // {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  98. // ]}).zindex();
  99. var orgIds = $("#inUnitid").val();
  100. $.dialog({
  101. content: 'url:dialogDealController.do?projectDepartTableAll&ids='+orgIds, zIndex: getzIndex(), title: '项目名称列表', lock: true, width: '600px', height: '400px', opacity: 0.4, button: [
  102. {name: '<t:mutiLang langKey="common.confirm"/>', callback: function (){
  103. var iframe = this.iframe.contentWindow;
  104. if(iframe.getReason().length>0){
  105. var strData=eval(iframe.getReason());
  106. for(var key in strData[0]){
  107. if(key=="strPId"){
  108. $("#inUnitid").val(strData[0][key]);
  109. }else if(key=="strDepartName"){
  110. $("#duties").val(strData[0][key]);
  111. }
  112. }
  113. }
  114. }, focus: true},
  115. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){
  116. $('#duties').val('');
  117. $('#inUnitid').val('');
  118. }}
  119. ]}).zindex();
  120. }
  121. function callbackDepartmentSelect() {
  122. // var iframe = this.iframe.contentWindow;
  123. // var treeObj = iframe.$.fn.zTree.getZTreeObj("departSelect");
  124. // var nodes = treeObj.getCheckedNodes(true);
  125. // if(nodes.length>0){
  126. // var ids='',names='';
  127. // for(var i=0;i<nodes.length;i++){
  128. // var node = nodes[i];
  129. // ids += node.id+',';
  130. // names += node.name+',';
  131. // }
  132. // if(ids != ''){
  133. // $.ajax({
  134. // url:"modifyController.do?getorgid",
  135. // data:{orgid:ids},
  136. // dataType:"json",
  137. // type:"POST",
  138. // success:function(result){
  139. // $('#inUnitid').val(ids);
  140. // $('#duties').val(result.msg);
  141. // $('#duties').blur();
  142. // }
  143. // });
  144. // }
  145. // }
  146. }
  147. function callbackClean(){
  148. $('#duties').val('');
  149. $('#inUnitid').val('');
  150. }
  151. $(function(){
  152. $("#userid").next("input").next("a").next("a").attr("icon","icon-clean");
  153. $("#userid").next("input").next("a").next("a").children("span").children("span").attr("class","l-btn-text icon-clean l-btn-icon-left");
  154. })
  155. </script>
  156. <style type="text/css">
  157. .fixed-h{
  158. float:left;
  159. width:100%;
  160. min-height:630px;
  161. overflow:auto;
  162. background:#ffffff;
  163. }
  164. </style>
  165. </head>
  166. <body>
  167. <t:formvalid formid="formobj" dialog="false" tipSweep="true" usePlugin="password" layout="table" action="snapSingleborrowController.do?doUpdate" tiptype="1" callback="callback">
  168. <input id="id" name="id" type="hidden" value="${snapSingleborrowPage.id }"/>
  169. <div class="fixed-h">
  170. <table style="width: 100%;" cellpadding="0" cellspacing="1" class="formtable">
  171. <tr>
  172. <td align="right" style="width: 15%;">
  173. <label class="Validform_label">
  174. <span color="red" class="requiredIcon">*</span>
  175. 调动方式:
  176. </label>
  177. </td>
  178. <td class="value" colspan="5">
  179. <label class="Validform_label">临时调动(单次)</label>
  180. </td>
  181. </tr>
  182. <tr>
  183. <td align="right"><label class="Validform_label"><span color="red" class="requiredIcon">*</span>调动员工:</label></td>
  184. <td class="value" colspan="5">
  185. <input id="userid" name="userid" type="hidden" value="${user.id}"/>
  186. <input name="realName" class="inputxt" value="${user.realName}" id="realName" readonly="readonly" datatype="*"/>
  187. <t:choose hiddenName="userid" hiddenid="id" fun="updateoldDutiesid" left="50%" 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>
  188. <span class="Validform_checktip"></span>
  189. </td>
  190. </tr>
  191. <tr>
  192. <td align="right" >
  193. <label class="Validform_label">
  194. 调出单位:
  195. </label>
  196. </td>
  197. <td class="value" style="width: 22%;">
  198. <label class="Validform_label danwei">${map.departname}</label>
  199. <input type="hidden" name="belongUnitid" id="belongUnitid" value="${map.departid}"/>
  200. </td>
  201. <td align="right" style="width: 3%;">
  202. <label class="Validform_label">
  203. 原职级:
  204. </label>
  205. </td>
  206. <td class="value" style="width: 10%;">
  207. <label class="Validform_label zhiwei">${map.dutiesName}</label>
  208. <input type="hidden" name="oldDutiesid" id="oldDutiesid" value="${map.dutiesid}"/>
  209. </td>
  210. <td align="right" style="width: 5%;">
  211. <label class="Validform_label">
  212. 原岗位:
  213. </label>
  214. </td>
  215. <td class="value" style="width: 45%;">
  216. <label class="Validform_label gangwei">${map.postname}</label>
  217. <input type="hidden" name="oldPostid" id="oldPostid" value="${map.postid}"/>
  218. </td>
  219. </tr>
  220. <tr>
  221. <td align="right" >
  222. <label class="Validform_label">
  223. <span color="red" class="requiredIcon">*</span>
  224. 调入单位:
  225. </label>
  226. </td>
  227. <td class="value" colspan="5">
  228. <%-- <t:departSelect hasLabel="true" selectedNamesInputId="orgNames"></t:departSelect> --%>
  229. <input id="duties" name="duties" type="text" value="${tname}" readonly="readonly" datatype="*" nullmsg="调入单位不可为空!" class="inputxt"/>
  230. <input id="inUnitid" name="inUnitid" type="hidden" value="${tid}" />
  231. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="departSearch" onclick="openDepartmentSelect()">选择</a>
  232. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="departRedo" onclick="callbackClean()">清空</a>
  233. </td>
  234. </tr>
  235. <tr style="height:30px;">
  236. <td align="right" >
  237. <label class="Validform_label">
  238. <span color="red" class="requiredIcon">*</span>
  239. 调出日期:
  240. </label>
  241. </td>
  242. <td class="value">
  243. <input id="outTime" name="outTime" type="text" style="width: 150px" readonly="readonly" class="Wdate" onchange="oncang();" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" datatype="*" nullmsg="调出日期不可为空!" value='<fmt:formatDate pattern="yyyy-MM-dd" value="${snapSingleborrowPage.outTime}"/>'/>
  244. <span class="Validform_checktip"></span>
  245. <label class="Validform_label" style="display: none;">调出日期</label>
  246. </td>
  247. <td align="right">
  248. <label class="Validform_label">
  249. <span color="red" class="requiredIcon">*</span>
  250. 调入日期:
  251. </label>
  252. </td>
  253. <td class="value">
  254. <input id="inTime" name="inTime" type="text" style="width: 150px" readonly="readonly" datatype="*" nullmsg="调入日期不可为空!" value='<fmt:formatDate pattern="yyyy-MM-dd" value="${snapSingleborrowPage.inTime}"/>'/>
  255. <label class="Validform_label" style="display: none;">调入日期</label>
  256. </td>
  257. </tr>
  258. <tr>
  259. <td align="right">
  260. <label class="Validform_label">
  261. <span color="red" class="requiredIcon">*</span>
  262. 调动终止日:
  263. </label>
  264. </td>
  265. <td class="value">
  266. <input id="deadDate" name="deadDate" readonly="readonly" type="text" style="width: 150px" datatype="*" nullmsg="调动终止日不可为空!" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'inTime\')}'})" value='<fmt:formatDate value='${snapSingleborrowPage.deadDate}' type="date" pattern="yyyy-MM-dd"/>'/>
  267. <span class="Validform_checktip"></span>
  268. <label class="Validform_label" style="display: none;">调动终止日</label>
  269. </td>
  270. </tr>
  271. <tr>
  272. <td align="right">
  273. <label class="Validform_label">
  274. <span color="red" class="requiredIcon">*</span>
  275. 借调工资总额:
  276. </label>
  277. </td>
  278. <td class="value">
  279. <input id="dayPay" name="dayPay" type="test" style="width: 150px" datatype="*" class="inputxt" value="${snapSingleborrowPage.dayPay }" onchange="daypayvalidfor();" class="inputxt" maxlength="8" />
  280. <span class="Validform_checktip"></span>元
  281. <label class="Validform_label" style="display: none;"></label>
  282. </td>
  283. </tr>
  284. <tr>
  285. <td align="right" >
  286. <label class="Validform_label">
  287. <span color="red" class="requiredIcon">*</span>
  288. 调动原因:
  289. </label>
  290. </td>
  291. <td class="value" colspan="5" >
  292. <textarea style="width:600px;height: 80px;" class="inputxt" rows="6" id="transferReason" maxlength="200" name="transferReason" datatype="*" nullmsg="调动原因不可为空!" placeholder="请输入调动原因(最多输入文字数200)">${snapSingleborrowPage.transferReason}</textarea>
  293. <span class="Validform_checktip"></span>
  294. <label class="Validform_label" style="display: none;">调动原因</label>
  295. </td>
  296. </tr>
  297. <tr>
  298. <td height="100px" align="center" colspan="6">
  299. </td>
  300. </tr>
  301. <tr>
  302. <td height="50px" align="center" colspan="6">
  303. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-confirm" onclick="btn_ok()">确定</a>
  304. <div style="display:none"><input type="submit" id ="btnsub" value=""/></div>
  305. <a style="margin-left:0px" href="samelevelTransferController.do?list&transferType=4" class="easyui-linkbutton l-btn" plain="true" iconcls="icon-return">返回</a>
  306. </td>
  307. </tr>
  308. </table>
  309. </div>
  310. </t:formvalid>
  311. </body>
  312. <script src = "webpage/cn/com/lzt/snapsingleborrow/snapSingleborrow.js"></script>
  313. <script type="text/javascript">
  314. function daypayvalidfor(){
  315. var temp = true;
  316. var day = $("#dayPay").val();
  317. if(day != ''){
  318. if(!/^\d{1,6}(\.\d{1,2})?$/.test(day)){
  319. layer.alert("输入格式不正确!");
  320. temp = false;
  321. }
  322. }
  323. return temp;
  324. }
  325. </script>