huanjieyonghu.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>湖北智慧水运</title>
  5. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  6. <meta http-equiv="description" content="this is my page">
  7. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
  9. <link>
  10. <link href="../css/base.min.css" rel="stylesheet">
  11. <link rel="stylesheet" type="text/css" href="../css/mui.min.css">
  12. <link rel="stylesheet" href="../css/zTreeStyle/zTreeStyle.css" type="text/css">
  13. <script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script>
  14. <script type="text/javascript" src="../js/jquery.ztree.core-3.5.js"></script>
  15. <script type="text/javascript" src="../js/jquery.ztree.excheck-3.5.js"></script>
  16. <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  17. </head>
  18. <script type="text/javascript">
  19. var tempdata = parent.tempdata;
  20. var wxuserid = parent.wxuserid;
  21. if(tempdata==''||tempdata==null){
  22. tempdata = getQueryString("tempdata");
  23. }
  24. if(wxuserid==''||wxuserid==null){
  25. wxuserid = getQueryString("wxuserid");
  26. }
  27. function back(){
  28. parent.huanjiewanchengclose();
  29. }
  30. $(function(){
  31. $("#wancheng").live("click",function(){
  32. //alert("tempdata:"+tempdata+";wxuserid:"+wxuserid);
  33. var days = $("#dayss").val();
  34. if(bids==""){
  35. layer.open({
  36. content: '请选择下一环节办理人',
  37. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  38. time: 1
  39. });
  40. return;
  41. }
  42. if(days.replace(/\s+/g,"")!=""){
  43. if(days <=0 || days!=parseInt(days)||days>10 ){
  44. layer.open({
  45. content: '请填写正确待办天数',
  46. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  47. time: 1
  48. });
  49. $("#dayss").val("");
  50. return;
  51. }
  52. }
  53. $.ajax({
  54. type: 'post',
  55. url: '../../'+parent.controller+'/'+parent.wcmethd+'.do',
  56. data:{tempdata:tempdata,wxuserid:wxuserid,id:parent.idid,step:step,yj:parent.yj,usersStr:bids,days:days,uid:"402881e44e86c26d014e86c9ae8c0008",taskId:parent.taskId},
  57. dataType: 'json',
  58. success: function(data){
  59. if(data.resultCode==0){
  60. layer.open({
  61. content: '审批成功',
  62. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  63. time: 1
  64. });
  65. setTimeout(function(){
  66. window.location.href=parent.iframurl+"?tempdata="+tempdata+"&wxuserid="+wxuserid;
  67. },1000);
  68. }else{
  69. layer.open({
  70. content: '审批失败',
  71. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  72. time: 1
  73. });
  74. }
  75. }})
  76. })
  77. })
  78. </script>
  79. <SCRIPT type="text/javascript">
  80. var stepId;
  81. var step;
  82. var radiostepId;
  83. var bids = "";
  84. var bnames= "";
  85. function huanjiemingcheng(handlerNames,handlerIds,a,taskKey){
  86. step = taskKey;
  87. radiostepId = $(a).val();
  88. bids = handlerIds.substring(0, handlerIds.length-1)
  89. bnames = handlerNames.substring(0, handlerNames.length-2);
  90. $("#banliren").val('');
  91. //$("#banliren").val(bnames);
  92. }
  93. $(function(){
  94. $.ajax({
  95. type: 'post',
  96. url: '../../wfcontroller/chooseuserwf.do',
  97. data:{taskId:parent.taskId,wfid:parent.wfid,flag:"pass",id:parent.idid,tempdata:tempdata,wxuserid:wxuserid},
  98. dataType: 'json',
  99. success: function(data){
  100. stepId = data.stepId;
  101. step = data.step;
  102. //console.log(data)
  103. var result = "";
  104. for(var i=0;i<data.taskNodeList.length;i++){
  105. var handlerNames = "";
  106. var handlerIds = "";
  107. for(var j=0;j<data.taskNodeList[i].handlerNames.length;j++){
  108. handlerNames+=data.taskNodeList[i].handlerNames[j]+", "
  109. }
  110. for(var k=0;k<data.taskNodeList[i].handlerIds.length;k++){
  111. handlerIds+=data.taskNodeList[i].handlerIds[k]+","
  112. }
  113. if(data.stepId==data.taskNodeList[i].stepId){
  114. radiostepId = data.taskNodeList[i].stepId;
  115. bids = handlerIds.substring(0, handlerIds.length-1)
  116. bnames = handlerNames.substring(0, handlerNames.length-2)
  117. //$("#banliren").val(bnames);
  118. }
  119. result+='<span class="mui-radio">'+
  120. '<input name="style" onclick="huanjiemingcheng(\''+handlerNames+'\',\''+handlerIds+'\',this,\''+data.taskNodeList[i].taskKey+'\')" type="radio" '+(data.stepId==data.taskNodeList[i].stepId?"checked":"")+' value="'+data.taskNodeList[i].stepId+'">'+
  121. data.taskNodeList[i].taskName+
  122. '</span>' ;
  123. }
  124. $("#huanjiemingcheng").html(result);
  125. }})
  126. })
  127. var remindnames = "";
  128. function sumitrenyuan(){
  129. var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
  130. var nodes = treeObj.getCheckedNodes(true);
  131. bids="";
  132. bnames="";
  133. remindnames = "[";
  134. console.log(nodes);
  135. for(var i=0;i<nodes.length;i++){
  136. bids+=nodes[i].ids+",";
  137. bnames+=nodes[i].name+", ";
  138. if(nodes[i].DIY==nodes[i].name){
  139. remindnames+=nodes[i].DIY+",";
  140. }
  141. }
  142. bids = bids.substring(0, bids.length-1)
  143. bnames = bnames.substring(0, bnames.length-2);
  144. remindnames = remindnames.substring(0, remindnames.length-1);
  145. if(remindnames.length>1){
  146. layer.open({
  147. title: '提示',
  148. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  149. content: remindnames+'],等人员已在该环节审核过,确认要继续提交给该选择人员吗?',
  150. btn: ['是', '否'],
  151. yes: function(index){
  152. $("#div-alert").hide();
  153. $("#div-alert1").hide();
  154. $("#banliren").val(bnames);
  155. layer.close(index);
  156. }
  157. });
  158. }else{
  159. $("#div-alert").hide();
  160. $("#div-alert1").hide();
  161. $("#banliren").val(bnames);
  162. }
  163. }
  164. var setting = {
  165. check: {
  166. enable: true
  167. },
  168. data: {
  169. simpleData: {
  170. enable: true
  171. }
  172. },
  173. callback: {
  174. onCheck:zTreeOnCheck,
  175. onClick: zTreeOnClick
  176. }
  177. };
  178. function zTreeOnCheck(event, treeId, treeNode) {
  179. };
  180. function zTreeOnClick(event, treeId, treeNode) {
  181. var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
  182. var nodes = treeObj.getSelectedNodes();
  183. for (var i=0, l=nodes.length; i < l; i++) {
  184. if(nodes[i].checked==false)
  185. treeObj.checkNode(nodes[i], true, true);
  186. else
  187. treeObj.checkNode(nodes[i], false, true);
  188. }
  189. for (var i=0, l=nodes.length; i < l; i++) {
  190. if(nodes[i].open==false)
  191. treeObj.expandNode(nodes[i], true, true, true);
  192. else
  193. treeObj.expandNode(nodes[i], false, true, true);
  194. }
  195. }
  196. var code;
  197. function setCheck() {
  198. var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
  199. py = $("#py").attr("checked")? "p":"",
  200. sy = $("#sy").attr("checked")? "s":"",
  201. pn = $("#pn").attr("checked")? "p":"",
  202. sn = $("#sn").attr("checked")? "s":"",
  203. type = { "Y":py + sy, "N":pn + sn};
  204. zTree.setting.check.chkboxType = type;
  205. showCode('setting.check.chkboxType = { "Y" : "' + type.Y + '", "N" : "' + type.N + '" };');
  206. }
  207. function showCode(str) {
  208. if (!code) code = $("#code");
  209. code.empty();
  210. code.append("<li>"+str+"</li>");
  211. }
  212. </SCRIPT>
  213. <script type="text/javascript">
  214. $(function(){
  215. /* $("#baocuns").live("click",function(){
  216. layer.open({
  217. title: '提示',
  218. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  219. content: remindnames+'],等人员已在该环节审核过,确认要继续提交给该选择人员吗?',
  220. btn: ['是', '否'],
  221. yes: function(index){
  222. $("#div-alert").hide();
  223. $("#div-alert1").hide();
  224. layer.close(index);
  225. }
  226. });
  227. }); */
  228. $("#quxiaos").click(function(){
  229. $("#div-alert").hide();
  230. $("#div-alert1").hide();
  231. })
  232. $("#qxz").click(function(){
  233. var zNodes =[
  234. ];
  235. $.ajax({
  236. type: 'post',
  237. url: '../../wfcontroller/showUserTree.do',
  238. data:{stepId:radiostepId,ids:bids,tempdata:tempdata,wxuserid:wxuserid,businesskey:parent.idid,taskId:parent.taskId},
  239. dataType: 'json',
  240. success: function(data){
  241. //console.log(data);
  242. var remindname = "";
  243. for(var i=0;i<data.nodeList.length;i++){
  244. zNodes.push({ id:(i+1),pId:0,ids:data.nodeList[i].id,name:data.nodeList[i].text,nocheck:true});
  245. for(var j=0;j<data.nodeList[i].children.length;j++){
  246. //data.nodeList[3].children[3].attributes.entry[0].key
  247. var value = false;
  248. for(var num=0;num<data.nodeList[i].children[j].attributes.entry.length;num++){
  249. if(data.nodeList[i].children[j].attributes.entry[num].key=="chkDisabled"){
  250. value = data.nodeList[i].children[j].attributes.entry[num].value;
  251. }
  252. if(data.nodeList[i].children[j].attributes.entry[num].key=="remind"){
  253. remindname = data.nodeList[i].children[j].text;
  254. }
  255. }
  256. zNodes.push({ id:(i+1)+""+j,pId:(i+1),ids:data.nodeList[i].children[j].id,/* checked:data.nodeList[i].children[j].checked, */name:data.nodeList[i].children[j].text,chkDisabled:value,DIY:remindname});
  257. }
  258. }
  259. $.fn.zTree.init($("#treeDemo"), setting, zNodes);
  260. //alert("remindnames:"+remindnames);
  261. $("#div-alert").show();
  262. $("#div-alert1").show();
  263. }})
  264. })
  265. })
  266. function aaa(){
  267. layer.open({
  268. content: '审批完成',
  269. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  270. time: 1
  271. });
  272. }
  273. </script>
  274. <style type="text/css">
  275. *{padding: 0px;margin: 0px;}
  276. .header {
  277. width:100%;
  278. height:45px;
  279. line-height:45px;
  280. padding:0;
  281. color:#eee;
  282. font-size:22px;
  283. text-align:center;
  284. color:white;
  285. background: #2196f3;
  286. }
  287. .layermcont {
  288. padding: 20px 15px;
  289. line-height: 22px;
  290. border-radius: 5px;
  291. text-align: center;
  292. }
  293. #header {
  294. position:fixed; z-index:2;
  295. top:0; left:0;
  296. width:100%;
  297. height:45px;
  298. line-height:45px;
  299. text-align:center;
  300. padding:0;
  301. font-size:22px;
  302. color:white;
  303. background: #2196f3;
  304. color: white;
  305. }
  306. #header a{
  307. color:white;
  308. }
  309. body,button,input,div{margin: 0px;padding: 0px}
  310. .mui-input-group:after {
  311. position: absolute;
  312. right: 0;
  313. bottom: 0;
  314. left: 0;
  315. height: 0px;
  316. content: '';
  317. background-color: #c8c7cc;
  318. -webkit-transform: scaleY(.5);
  319. transform: scaleY(.5);
  320. }
  321. input::-webkit-outer-spin-button,
  322. input::-webkit-inner-spin-button{
  323. -webkit-appearance: none !important;
  324. margin: 0;
  325. }
  326. .load-bar-content, .modal-content, .modal-dialog, .modal-heading, .nav, .nav .a, .nav a, .nav li, .progress {
  327. position: fixed;
  328. }
  329. .mui-checkbox input[type=checkbox], .mui-radio input[type=radio] {
  330. position:static;
  331. top: 0px;
  332. right: 20px;
  333. display: inline-block;
  334. width: 28px;
  335. height: 26px;
  336. -webkit-appearance: none;
  337. background-color: transparent;
  338. border: 0;
  339. outline: 0!important;
  340. }
  341. .laymshade {
  342. background-color: rgba(0,0,0,.0);
  343. /* pointer-events: auto; */
  344. }
  345. .mui-card{margin: 0px}
  346. </style>
  347. </head>
  348. <body>
  349. <header class="header">
  350. <ul class="nav nav-list pull-left">
  351. <li><a href="javascript:void(0);" id="goback" onclick="back()" ><span class="icon icon-arrow-back icback"></span>
  352. </a></li>
  353. </ul>
  354. <a href="#">选择环节用户</a>
  355. </header>
  356. <div class="mui-content" style="margin-top: 45px;background: white;padding-right: 10px">
  357. <table style="width: 100%" >
  358. <tr>
  359. <td style="text-align: right;"><h5 class="mui-content-padded" style="padding-top: 10px;">环节名称</h5></td>
  360. <td id="huanjiemingcheng">
  361. </td>
  362. </tr>
  363. <tr style="height: 30px"></tr>
  364. <tr style="height: 100px">
  365. <td width="80px" style="text-align: right;"><h5 class="mui-content-padded" style="padding: 0px">办理人</h5></td>
  366. <td><div class="mui-card" style="height: 100px;width: 70%;float:left;">
  367. <textarea rows="" id="banliren" cols="" style="height: 100%;border: 0px" disabled="disabled"></textarea>
  368. </div>
  369. <button class="mui-btn mui-btn-primary" id="qxz" style="margin-top:68px;background:#2196f3;border:0px;margin-left:10px" onclick="return false;">选择</button>
  370. </td>
  371. </tr>
  372. <tr style="height: 120px">
  373. <td ><h5 class="mui-content-padded" style="text-align: right;margin-top: -2px">限办天数</h5></td>
  374. <td style="position: relative;"> <input type="tel" name="days" id="dayss" min="1" max="10" style="width: 60px" /><span style="color: red;">&nbsp;可不填,最多可以设置10天</span></td>
  375. </tr>
  376. <tr >
  377. <td ></td>
  378. <td> <div style="width: 100%;">
  379. <button class="mui-btn mui-btn-positive" type="button" style="width: 40%;background: #2196f3;border: 0px;" id="wancheng">完成 </button>&nbsp;&nbsp;
  380. <button class="mui-btn mui-btn-positive" type="button" style="width: 40%;background: #2196f3;border: 0px;" onclick="back()">取消</button>
  381. </div></td>
  382. </tr>
  383. </table>
  384. </div>
  385. <div id="div-alert" style="position:fixed;padding-bottom:10px;display:none;top: 10%;left: 10%;z-index: 100;height:80%;border:4px solid #2196f3;border-radius:10px;width: 82%;background:white;overflow: auto">
  386. <form id="jhform">
  387. <input type="hidden" name="jid" id="jid" value="" />
  388. <div id="title" style="width:100%;height:30px;text-align: center;background:#2196f3;line-height: 30px;color: white;margin-bottom: 20px;font-size:20px;">选择人员</div>
  389. <ul id="treeDemo" class="ztree" style="zoom:1.5;" ></ul>
  390. </form>
  391. <div style="width: 100%;text-align: center;">
  392. <button class="mui-btn mui-btn-positive" type="button" style="width: 40%;background: #2196f3;border: 0px;" id="baocuns" onclick="sumitrenyuan()">确定</button>&nbsp;&nbsp;
  393. <button class="mui-btn mui-btn-positive" type="button" style="width: 40%;background: #2196f3;border: 0px;" id="quxiaos">取消</button>
  394. </div>
  395. </div>
  396. <div id="div-alert1" style="position:absolute;display:none;width:100%;height: 100%;z-index: 50;top:0px;background: black; opacity:0.2; "></div>
  397. </body>
  398. </html>