snapSingleborrow-add.jsp 12 KB

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