recodeItem.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <meta name="format-detection"content="telephone=no">
  8. <title>记录列表</title>
  9. <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
  10. <link rel="stylesheet" type="text/css" href="../../css/popoPicker.css"/>
  11. <link rel="stylesheet" href="../../css/style.css">
  12. <style media="screen">
  13. body,html{
  14. margin: 0;
  15. background: #fff;
  16. overflow-x: hidden;
  17. }
  18. .hide{
  19. display: none;
  20. }
  21. /*name*/
  22. .date-lists{
  23. width: 100%;
  24. overflow-x: scroll;
  25. white-space: nowrap;
  26. box-sizing: border-box;
  27. }
  28. .date-lists::-webkit-scrollbar{
  29. display: none;
  30. }
  31. .date-wrap{
  32. width: 100%;
  33. position: fixed;
  34. top: 0;
  35. left: 0;
  36. box-sizing: border-box;
  37. z-index: 9999;
  38. background: #fff;
  39. }
  40. .date-lists li{
  41. margin-right: 20px;
  42. padding: 14px 10px;
  43. font-size: 16px;
  44. color: #333;
  45. position: relative;
  46. }
  47. .date-lists .active{
  48. color: #009FE8;
  49. }
  50. .date-lists .active:after{
  51. content: "";
  52. position: absolute;
  53. bottom: 0;
  54. left: 0;
  55. width: 100%;
  56. height: 2px;
  57. background: #009FE8;
  58. }
  59.  /*记录列表*/
  60. .recode-wraps{
  61. width: 95%;
  62. border: 1px dashed #ECF0F1;
  63. margin: auto;
  64. margin-top: 10px;
  65. border-radius: 5px;
  66. padding-bottom: 5px;
  67. }
  68. .time{
  69. background: #31A5FF;
  70. padding: 5px 10px;
  71. font-size: 14px;
  72. display: inline-block;
  73. color: #fff;
  74. border-radius: 10px;
  75. position: relative;
  76. margin-bottom: 5px;
  77. }
  78. .recodeTitle{
  79. display: block;
  80. margin-top: 3px;
  81. }
  82. .name{
  83. color: #000;
  84. font-size: 14px;
  85. /*font-weight: bold;*/
  86. line-height: 1.6;
  87. }
  88. .main{
  89. padding-left: 50px;
  90. position: relative;
  91. padding-bottom: 10px;
  92. }
  93. .main:after{
  94. content: '';
  95. position: absolute;
  96. top: 0;
  97. left: 30px;
  98. width:2px;
  99. background: #31A5FF;
  100. height: 100%;
  101. }
  102. .main:before{
  103. content: '';
  104. position: absolute;
  105. top: 5px;
  106. left:23px;
  107. width:15px;
  108. background: #31A5FF;
  109. height: 15px;
  110. border-radius: 50%;
  111. }
  112. /*三角形*/
  113. .Triangle{
  114. position: absolute;
  115. top: 5px;
  116. left: -14px;
  117. width: 0;
  118. height: 0;
  119. border-width: 8px;
  120. border-style: solid;
  121. border-color: transparent #31A5FF transparent transparent;
  122. transform: rotate(360deg);
  123. }
  124. .recode-img{
  125. display: inline-block;
  126. width: 38px;
  127. height: 46px;
  128. background: url("../../icon/recode.png") center no-repeat;
  129. background-size: contain;
  130. position: relative;
  131. left: 12px;
  132. top: 9px;
  133. }
  134. .state{
  135. padding-left: 50px;
  136. position: relative;
  137. }
  138. .stop{
  139. position: absolute;
  140. top: 6px;
  141. left: 23px;
  142. width: 15px;
  143. height: 15px;
  144. background: url("../../icon/stop.png") center no-repeat;
  145. background-size: contain;
  146. z-index: 800;
  147. }
  148. .state:after{
  149. content: '';
  150. position: absolute;
  151. top: -2px;
  152. left: 30px;
  153. width:2px;
  154. background: #31A5FF;
  155. height: 10px;
  156. }
  157. .recode-more{
  158. padding: 20px;
  159. text-align: center;
  160. }
  161. #recode_item{
  162. padding-top: 50px;
  163. }
  164. /*tool*/
  165. .tool_itme{
  166. padding: 10px;
  167. }
  168. .tool_time{
  169. display: flex;
  170. justify-content: space-between;
  171. }
  172. .tool_time input{
  173. border: 1px solid #ccc;
  174. padding: 8px 10px;
  175. border-radius: 3px;
  176. width: 46%;
  177. box-sizing: border-box;
  178. -webkit-appearance: none;
  179. text-align: center;
  180. }
  181. .tool_seacrh_export{
  182. padding: 10px 0;
  183. }
  184. .tool_seacrh_export button{
  185. padding: 10px 0;
  186. color: #fff;
  187. background: #009FE8;
  188. width: 100px;
  189. border-radius: 4px;
  190. text-align: center;
  191. cursor: pointer;
  192. }
  193. .tool_seacrh_export button{
  194. margin-right: 20px;
  195. }
  196. </style>
  197. </head>
  198. <body>
  199. <div class="date-wrap" id="date_wrap">
  200. </div>
  201. <div class="api_layout" id="recode_item">
  202. <div class="tool_itme">
  203. <div class="tool_time ">
  204. <input type="text" class="start_time" readonly placeholder="开始时间">
  205. <input type="text" class="end_time" readonly placeholder="结束时间">
  206. </div>
  207. <div class="tool_seacrh_export">
  208. <button type="button" onclick="searchRecode()">查询</button>
  209. <button type="button" onclick="exportRecode()">导出</button>
  210. </div>
  211. </div>
  212. <div id="recode_content">
  213. </div>
  214. </div>
  215. <div class="noText hide">
  216. <img src="../../image/noText.png" alt="">
  217. </div>
  218. <a href="javascript:;" class="upload_file"></a>
  219. </body>
  220. </html>
  221. <script type="text/template" id="recodeTemplate">
  222. {{~it:value}}
  223. <div class="recode-wraps">
  224. <span class="recode-img"></span>
  225. <div class="recode-list">
  226. {{ for (var t=0;t<value.length;t++) { }}
  227. <div class="main" onclick="openRecordDe('{{=value[t].recordParentId}}')">
  228. <p class="time">
  229. {{=value[t].createDate}}
  230. <span class="Triangle"></span>
  231. <span class="recodeTitle">{{=value[t].templateName}}</span>
  232. </p>
  233. <p class="name">{{=value[t].createName}}</p>
  234. <div class="name">
  235. {{?value[t].recordStatusInstanceList != null}}
  236. {{ for(var i= 0;i<value[t].recordStatusInstanceList.length;i++){ }}
  237. <div class="state-items">
  238. <p class="state-title" style="width:auto;display:{{=value[t].statusName == ""?'none':'inline-block'}}">{{=value[t].recordStatusInstanceList[i].statusName}}:</p>
  239. {{ for(var j= 0;j<value[t].recordStatusInstanceList[i].recordStatusInstanceItemList.length;j++){ }}
  240. {{?value[t].recordStatusInstanceList[i].recordStatusInstanceItemList.length == 1}}
  241. <span>{{=value[t].recordStatusInstanceList[i].recordStatusInstanceItemList[j].statusContent}}</span>
  242. {{??}}
  243. <span>{{=value[t].recordStatusInstanceList[i].recordStatusInstanceItemList[j].statusContent}},</span>
  244. {{?}}
  245. {{ } }}
  246. </div>
  247. {{ } }}
  248. {{??}}
  249. <div class="state-items">
  250. <p class="state-title" style="width:auto;display:{{=value[t].statusName == ""?'none':'inline-block'}}">{{=value[t].statusName}}:</p>
  251. <span>{{=value[t].statusContent}}</span>
  252. </div>
  253. {{?}}
  254. </div>
  255. </div>
  256. {{?t == value.length-1}}
  257. {{?value[value.length-1].continueStatus == false}}
  258. <div class="state">
  259. <p class="time">
  260. 结束:{{=value[t].createDate}}
  261. <span class="Triangle" style="top:6px;"></span>
  262. </p>
  263. <i class="stop"></i>
  264. </div>
  265. {{??}}
  266. <div class="state wait">
  267. <p class="time" style="background:#F7A329">
  268. 等待处理......
  269. <span class="Triangle" style="top:6px;border-color: transparent #F7A329 transparent transparent;"></span>
  270. </p>
  271. <i class="stop" style="background: url('../../icon/Continue.png') center no-repeat;background-size: contain;"></i>
  272. </div>
  273. {{?}}
  274. {{?}}
  275. {{ } }}
  276. </div>
  277. </div>
  278. {{~}}
  279. </script>
  280. <script type="text/template" id="TemplateName">
  281. <ul class="date-lists flex-start">
  282. {{~it:value:index}}
  283. {{?index == 0}}
  284. <li class="active" onclick="randomSwitchBtn(this,'{{=value.parentId}}','{{=value.templateId}}')">{{=value.templateName}}</li>
  285. {{??}}
  286. <li onclick="randomSwitchBtn(this,'{{=value.parentId}}','{{=value.templateId}}')">{{=value.templateName}}</li>
  287. {{?}}
  288. {{~}}
  289. </ul>
  290. </script>
  291. <script type="text/javascript" src="../../script/api.js"></script>
  292. <script type="text/javascript" src="../../script/doT.min.js"></script>
  293. <script type="text/javascript" src="../../script/zepto.js"></script>
  294. <script src="../../script/popoPicker.js"></script>
  295. <script src="../../script/config.js" charset="utf-8"></script>
  296. <script type="text/javascript">
  297. var pageId = "",departmentID="",name="",uuid="",isLoadding = false;
  298. var skip = 1,parentId = "",templateId="";
  299. var startTime = '',endTime = '',scrolltobottomFlat = true;
  300. apiready = function () {
  301. pageId = api.pageParam.id
  302. departmentID= api.pageParam.departmentID
  303. name= api.pageParam.name
  304. uuid= api.pageParam.uuid
  305. TemplateName(api.pageParam.id)
  306. // 上拉加载
  307. api.addEventListener({
  308. name : 'scrolltobottom',
  309. extra : {
  310. threshold : 0 //设置距离底部多少距离时触发,默认值为0,数字类型
  311. }
  312. }, function(ret, err) {
  313. if (!isLoadding && scrolltobottomFlat) {
  314. isLoadding = true;
  315. recodeList(parentId)
  316. }
  317. });
  318. }
  319. // TemplateName Nav
  320. var num=0;
  321. function TemplateName(pageID) {
  322. $http.fnReuestDataNologing(UrlRouter.selectRecordByGetPageId+pageID,'','get','',function (ret, err) {
  323. if (ret.code == '200' && ret.data != "") {
  324. $apis.html(date_wrap,'#TemplateName',ret.data);
  325. parentId = ret.data[0].parentId;
  326. templateId = ret.data[0].templateId
  327. recodeList(ret.data[0].parentId,false)
  328. }
  329. })
  330. }
  331. function recodeList(ParentId) {
  332. api.showProgress({
  333. title: '努力加载中...',
  334. text: '先喝杯茶...',
  335. modal: true
  336. });
  337. var parm= {
  338. pageId:pageId,
  339. pageRecordParentId: ParentId,
  340. startTime: startTime,
  341. endTime: endTime,
  342. pageNumber:skip,
  343. pageSize: 10
  344. }
  345. $http.fnReuestDataNologing(UrlRouter.getPageRecordInstanceList,'','get',parm,function (ret, err) {
  346. isLoadding = false;
  347. api.hideProgress();
  348. if (ret.data.length == 0 && skip == 1) {
  349. $api.removeCls($api.dom('.noText'), 'hide');
  350. $apis.html(recode_content,'#recodeTemplate','');
  351. isLoadding = true;
  352. return false;
  353. }else {
  354. $api.addCls($api.dom('.noText'), 'hide');
  355. }
  356. if (ret) {
  357. if (ret.data.length > 0) {
  358. skip += 1;
  359. $apis.append(recode_content,'#recodeTemplate',ret.data);
  360. // $api.addCls($api.dom('.noText'), 'hide');
  361. // $api.removeCls($api.dom('.noText'), 'hide');
  362. } else {
  363. isLoadding =true;
  364. api.toast({
  365. msg: '没有更多数据',
  366. duration: 2000,
  367. location: 'bottom'
  368. });
  369. }
  370. }else {
  371. api.toast({
  372. msg: '加载超时,请检查网络',
  373. duration: 2000,
  374. location: 'bottom'
  375. });
  376. }
  377. })
  378. }
  379. // 模版名称
  380. function randomSwitchBtn( tag ,ParentId,temId) {
  381. if( tag == $api.dom('.date-lists li.active') )return;
  382. var eFootLis = $api.domAll('.date-lists li');
  383. skip = 1;
  384. index = 0;
  385. $apis.html(recode_content,'#recodeTemplate','');
  386. for (var i = 0,len = eFootLis.length; i < len; i++) {
  387. if( tag == eFootLis[i] ){
  388. index = i;
  389. }else{
  390. $api.removeCls(eFootLis[i], 'active');
  391. }
  392. }
  393. $api.addCls( eFootLis[index], 'active');
  394. templateId = temId
  395. startTime = ''
  396. endTime = ''
  397. $('.start_time').val('')
  398. $('.end_time').val('')
  399. parentId = ParentId
  400. recodeList(ParentId)
  401. }
  402. // 记录详情
  403. function openRecordDe(id) {
  404. $event.openTabLayout('recodeDetails','recodeDetails','记录详情',{recordParentId:id});
  405. }
  406. new popoDateT('.start_time',{
  407. container:'.tool_time',
  408. background:'light',
  409. save:function (data) {
  410. startTime = data
  411. }
  412. });
  413. new popoDateT('.end_time',{
  414. container:'.tool_time',
  415. background:'light',
  416. save:function (data) {
  417. endTime = data
  418. }
  419. });
  420. // 查询
  421. function searchRecode() {
  422. scrolltobottomFlat = false
  423. var parm= {
  424. pageId:pageId,
  425. pageRecordParentId: parentId,
  426. startTime: startTime,
  427. endTime: endTime,
  428. pageNumber:0,
  429. pageSize: 0
  430. }
  431. $http.requestShowProgress(UrlRouter.getPageRecordInstanceList,'get',parm)
  432. .then(ret=>{
  433. if (ret.data.length > 0) {
  434. $api.addCls($api.dom('.noText'), 'hide');
  435. $apis.html(recode_content,'#recodeTemplate',ret.data);
  436. } else {
  437. api.toast({
  438. msg: '没有更多数据',
  439. duration: 2000,
  440. location: 'bottom'
  441. });
  442. $apis.html(recode_content,'#recodeTemplate',"");
  443. $api.removeCls($api.dom('.noText'), 'hide');
  444. }
  445. }).catch(err=>{
  446. api.toast({
  447. msg: '加载超时,请检查网络',
  448. duration: 2000,
  449. location: 'bottom'
  450. });
  451. })
  452. }
  453. // 导出
  454. function exportRecode(that) {
  455. if (startTime == "" && startTime =="") {
  456. api.toast({
  457. msg: '请选择时间',
  458. duration: 2000,
  459. location: 'top'
  460. });
  461. return false
  462. }
  463. var uploadFileElm=$('.upload_file')
  464. var url = UrlRouter.getRecordInstanceDetailListMobileExcel+"?startTime="+ startTime +"&endTime="+ endTime
  465. +"&templateId="+templateId
  466. $http.requestShowProgress(url,'get','')
  467. .then(ret=>{
  468. if (ret.code === '200') {
  469. var fileUrl= ret.data
  470. api.confirm({
  471. title: '提示',
  472. msg: '是否导出记录',
  473. buttons: ['确定', '取消']
  474. }, function(ret, err) {
  475. var index = ret.buttonIndex;
  476. if (index === 1) {
  477. uploadFileElm.attr('href',fileUrl)
  478. uploadFileElm.attr('download',fileUrl)
  479. uploadFileElm.click()
  480. }
  481. });
  482. }
  483. }).catch(err=>{
  484. api.toast({
  485. msg: '下载失败',
  486. duration: 2000,
  487. location: 'top'
  488. });
  489. })
  490. }
  491. </script>