1003410207_edit.jsp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <html>
  2. <head>
  3. <!--
  4. Vue 官网引用的是 animate.css 3.5 版本
  5. 不能引用 animate.css 最新版本
  6. vue 和 animate 版本兼容性问题会导致动画不起作用
  7. -->
  8. <link rel="stylesheet" href="/apps/space/css/mobile/animate@3.5.0.css" />
  9. <style>
  10. .animated {
  11. -webkit-animation-duration: .6s;
  12. animation-duration: .6s;
  13. }
  14. </style>
  15. </head>
  16. <body>
  17. <div id="space-content">
  18. <div class="content-wrap">
  19. <div id="mescroll" class="mescroll">
  20. <div class="main-contacts-list">
  21. <div v-for="(item, index) in backlog.auditData" :data-index="index">
  22. <!-- 动画 -->
  23. <transition name="fade" enter-active-class="animated fadeInDown"
  24. leave-active-class="animated fadeOutUp" v-for="(childItem, childIndex) in item.child">
  25. <!-- 卡片 -->
  26. <div class="vant-tabCard" v-show="childIndex == 0 || (item.expandActive)" v-if="item.child">
  27. <div class="vant-tabCard-wrap" :code="childItem.code" :allcode="childItem.allcode">
  28. <h2 class="vant-tabCard-title">
  29. <img :src="childItem.flowIcon" alt=""
  30. @click="flowInfo(childItem.token, childItem.auditInfoToken, childItem.code, childItem.allcode)" />
  31. <div style="width: 80%" v-if="childIndex == 0">
  32. <span
  33. @click="flowInfo(childItem.token, childItem.auditInfoToken)">{{childItem.flowTitle}}</span>
  34. </div>
  35. <span @click="flowInfo(childItem.token, childItem.auditInfoToken)"
  36. v-if="childIndex != 0">{{childItem.flowTitle}}</span>
  37. <div class="vant-tabCard-title-right" v-if="childIndex == 0">
  38. <div class="space-switch" :class="{'space-switch-right':item.expandActive}"
  39. @click="expandClick(index)">
  40. <span>收</span><span>开</span>
  41. <p>{{item.childNumber}}</p>
  42. </div>
  43. </div>
  44. </h2>
  45. <div class="vant-tabCard-iframe" style="opacity: 0.99;"
  46. @click="flowInfo(childItem.token, childItem.auditInfoToken, childItem.code, childItem.allcode)">
  47. <iframe :src="childIndex == 0 ? childItem.cardToken : '' " frameborder="0"
  48. :id="childItem.allcode + 'Frame'" v-if="childItem.cardToken"
  49. v-show="childIndex == 0 || (item.expandActive)"
  50. :data-src="childIndex == 0 ? '' : childItem.cardToken"
  51. style="width: 100%;position: relative;z-index: -1;"
  52. @load="childIndex == 0 ? loadFrame(childItem.allcode) : ''"></iframe>
  53. <!-- 遮罩 -->
  54. <div class="vant-tabCard-iframe-shade body-bg-white">
  55. <van-loading size="24px" style="text-align: center;margin-top: 52px;">
  56. </van-loading>
  57. </div>
  58. </div>
  59. <div class="vant-tabCard-bottom" v-if="!childItem.auditEntrance"
  60. @click="flowInfo(childItem.token, childItem.auditInfoToken, childItem.code, childItem.allcode)">
  61. <a href="javascript:;" style="font-size: 14px;">查看详情</a>
  62. <van-icon name="arrow" color="#aaa" class="vant-tabCard-bottom-right"
  63. style="margin-top: 3px;"></van-icon>
  64. </div>
  65. <div class="vant-tabCard-bottom">
  66. <div class="vant-tabCard-bottom-left">
  67. <span class="audit-time">{{childItem.time}}</span> 来自
  68. <span>{{childItem.applyPersonName}}</span>
  69. </div>
  70. <div class="vant-tabCard-bottom-right" v-if="!childItem.auditEntrance">
  71. <a href="javascript:;" @click="auditFlow(service.rejectURI, childItem.applyid, childItem.auditid)">退回</a>
  72. |
  73. <a href="javascript:;" @click="auditFlow(service.agreeURI, childItem.applyid, childItem.auditid)">同意</a>
  74. </div>
  75. <div class="vant-tabCard-bottom-right vant-tabCard-bottom-ckeck"
  76. v-if="childItem.auditEntrance"
  77. @click="flowInfo(childItem.token, childItem.auditInfoToken, childItem.code, childItem.allcode)">
  78. <a href="javascript:;">查看详情</a>
  79. <van-icon name="arrow"></van-icon>
  80. </div>
  81. </div>
  82. </div>
  83. <!-- 两层折叠 -->
  84. <div class="two-fold" v-if="!item.expandActive && childIndex == 0"></div>
  85. <div class="three-fold"
  86. v-if="!item.expandActive && childIndex == 0 && item.childNumber >= 3"></div>
  87. </div>
  88. </transition>
  89. <!-- 展开后显示 -->
  90. <img src="/apps/space/images/up.png" alt="" v-show="item.expandActive"
  91. @click="expandClick(index)" style="display:block;width: 40px;margin: -8px auto 0;">
  92. <!-- 卡片 -->
  93. <div class="vant-tabCard" v-if="!item.child">
  94. <div class="vant-tabCard-wrap" :code="item.code" :allcode="item.allcode">
  95. <h2 class="vant-tabCard-title"
  96. @click="flowInfo(item.token, item.auditInfoToken, item.code, item.allcode)">
  97. <img :src="item.flowIcon" alt="" />
  98. <span>{{item.flowTitle}}</span>
  99. </h2>
  100. <div class="vant-tabCard-iframe" style="opacity: 0.99;"
  101. @click="flowInfo(item.token, item.auditInfoToken, item.code, item.allcode)">
  102. <iframe :id="item.allcode + 'Frame'" :src="item.cardToken" frameborder="0"
  103. v-if="item.cardToken" @load="loadFrame(item.allcode)"
  104. style="width: 100%;position: relative;z-index: -1;"></iframe>
  105. <!-- 遮罩 -->
  106. <div class="vant-tabCard-iframe-shade body-bg-white">
  107. <van-loading size="24px" style="text-align: center;margin-top: 52px;">
  108. </van-loading>
  109. </div>
  110. </div>
  111. <div class="vant-tabCard-bottom" v-if="!item.auditEntrance"
  112. @click="flowInfo(item.token, item.auditInfoToken, item.code, item.allcode)">
  113. <a href="javascript:;" style="font-size: 14px;">查看详情</a>
  114. <van-icon name="arrow" color="#aaa" class="vant-tabCard-bottom-right"
  115. style="margin-top: 3px;"></van-icon>
  116. </div>
  117. <div class="vant-tabCard-bottom">
  118. <div class="vant-tabCard-bottom-left">
  119. <span>{{item.time}}</span> 来自
  120. <span>{{item.applyPersonName}}</span>
  121. </div>
  122. <div class="vant-tabCard-bottom-right" v-if="!item.auditEntrance">
  123. <a href="javascript:;" @click="auditFlow(service.rejectURI, item.applyid, item.auditid)">退回</a>
  124. |
  125. <a href="javascript:;" @click="auditFlow(service.agreeURI, item.applyid, item.auditid)">同意</a>
  126. </div>
  127. <div class="vant-tabCard-bottom-right vant-tabCard-bottom-ckeck"
  128. v-if="item.auditEntrance"
  129. @click="flowInfo(item.token, item.auditInfoToken, item.code, item.allcode)">
  130. <a href="javascript:;">查看详情</a>
  131. <van-icon name="arrow"></van-icon>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </body>
  142. <script type="text/javascript">
  143. space.vue = new Vue({
  144. el: space.appContent,
  145. data() {
  146. return {
  147. obj: {
  148. // rowCountPerPage: 10 // 每页的数据条数
  149. },
  150. service: {
  151. agreeURI: '@service{ name: `sys.sys_agree_audit_flow`, page: `toAuditResult` }@',
  152. rejectURI: '@service{ name: `sys.sys_reject_audit_flow`, page: `toAuditResult` }@',
  153. },
  154. // 待处理页面数据
  155. backlog: {
  156. auditData: [],
  157. // 是否初始化数据,默认进来就有数据,但不影响下拉刷新
  158. isInitData: false
  159. },
  160. prevOpenBacklog: {}, // 上一次打开的代办信息
  161. }
  162. },
  163. mounted: function () {
  164. this.initAuditData();
  165. this.initJumpBacklogData();
  166. },
  167. computed: {
  168. auditDataAry() {
  169. return this.backlog.auditData;
  170. }
  171. },
  172. watch: {
  173. auditDataAry(val) {
  174. $("body").removeClass('body-bg-gray');
  175. $("body").removeClass('body-bg-white');
  176. $("body").addClass(val.length > 0 ? 'body-bg-gray' : 'body-bg-white');
  177. this.autoOpenNextBacklog();
  178. }
  179. },
  180. methods: {
  181. /**
  182. * 初始化待办数据
  183. */
  184. initAuditData: function () {
  185. var that = this;
  186. space.plugin.paging.init({
  187. url: '@service{ name: `sys_audit_list_mobileTerminal` }@',
  188. data: that.obj,
  189. nodata: '<div class="no-data-search"><p>暂无数据</p></div>',
  190. up: function (resp) {
  191. that.initData(resp);
  192. that.refreshFlowNumber();
  193. },
  194. down: function () {
  195. // that.backlog.auditData = [];
  196. $(".van-loading").fadeIn(200);
  197. $(".vant-tabCard-iframe-shade").addClass("body-bg-white");
  198. }
  199. });
  200. },
  201. /**
  202. * 初始化待办数据
  203. * @param {Object} resp
  204. */
  205. initData: function (resp) {
  206. resp.auditListData.forEach(function (item) {
  207. item.expandActive = false; // 是否展开
  208. item.expandIcon = "expand-o"; // 展开与关闭的样式
  209. if (item.child) {
  210. item.child.forEach(function (childItem) {
  211. if (childItem.cardToken) {
  212. childItem.loading = true; // 加载动画
  213. }
  214. })
  215. }
  216. if (item.cardToken) {
  217. item.loading = true; // 加载动画
  218. }
  219. })
  220. this.backlog.auditData = resp.auditListData;
  221. window.parent.space.vue.setAuditNumber(resp.auditNumber);
  222. },
  223. /**
  224. * 多级卡片展开
  225. * @param {Object} index this.backlog.auditData 数组的索引
  226. */
  227. expandClick: function (index) {
  228. this.backlog.auditData[index].expandActive = !this.backlog.auditData[index].expandActive;
  229. // 展开
  230. if (this.backlog.auditData[index].expandActive) {
  231. var that = this;
  232. this.backlog.auditData[index].expandIcon = "shrink";
  233. var loadFrameAry = $("div[data-index='" + index + "']").find("iframe");
  234. for (let index = 1; index < loadFrameAry.length; index++) {
  235. var element = loadFrameAry[index];
  236. const elementConst = loadFrameAry[index];
  237. $(element).attr('src', $(element).attr('data-src'));
  238. $(element).removeAttr('data-src');
  239. $(element)[0].onload = function (e) {
  240. that.loadFrame($(elementConst)[0].id.replace("Frame", ""))
  241. };
  242. }
  243. }
  244. // 收起
  245. else {
  246. this.backlog.auditData[index].expandIcon = "expand-o";
  247. }
  248. // 重新设置,不然不生效
  249. Vue.set(this.backlog.auditData, index, this.backlog.auditData[index]);
  250. },
  251. /**
  252. * 审核流程(同意、退回)
  253. * @param {Object} url
  254. */
  255. auditFlow: function (url, applyid, auditid) {
  256. var _this = this;
  257. space.utils.ajax({
  258. url: url,
  259. data: {
  260. "applyid": applyid,
  261. "auditid": auditid
  262. },
  263. dataType: 'json',
  264. loadMsg: '审核中',
  265. callback: function (data) {
  266. if (data.code == "success") {
  267. space.plugin.paging.refresh();
  268. top.space.message.success('审核成功')
  269. } else {
  270. top.space.message.error('系统繁忙,请稍后再试')
  271. }
  272. }
  273. });
  274. },
  275. /**
  276. * 刷新流程数量
  277. */
  278. refreshFlowNumber: function () {
  279. var _this = this;
  280. space.utils.ajax({
  281. url: '@service{ name:`sys_flow_number` }@',
  282. dataType: 'json',
  283. loadLayer: false,
  284. callback: function (data) {
  285. window.parent.space.vue.setApplyNumber(data.applyNumber);
  286. window.parent.space.vue.setHaveDoneNumber(data.haveDoneNumber);
  287. window.parent.space.vue.setAuditNumber(data.auditNumber);
  288. window.parent.space.vue.refreshBacklogDot();
  289. }
  290. });
  291. },
  292. /**
  293. * 查看
  294. * @param {Object} url
  295. */
  296. flowInfo: function (url, auditInfoUrl, code, allcode) {
  297. if (auditInfoUrl) {
  298. space.utils.ajax({
  299. url: auditInfoUrl,
  300. dataType: 'json'
  301. });
  302. }
  303. space.plugin.appWindow.show({
  304. 'title': '查看',
  305. 'url': url,
  306. 'position': 'right',
  307. close: function () {
  308. space.plugin.paging.refresh();
  309. }
  310. });
  311. this.prevOpenBacklog = {
  312. code: code,
  313. allcode: allcode
  314. }
  315. },
  316. /**
  317. * 加载动画
  318. * @param {Object} allcode allcode
  319. */
  320. loadFrame: function (allcode) {
  321. var frameDom = $("#" + allcode + "Frame");
  322. frameDom[0].contentWindow.loadReady = function (params) {
  323. $(frameDom[0]).parents("div.vant-tabCard-iframe").css("height", params.height + "px");
  324. }
  325. var that = this;
  326. // 隐藏动画
  327. for (var index = 0; index <= 1; index++) {
  328. setTimeout(() => {
  329. that.hideFrameLoad(frameDom);
  330. }, 1000 * index);
  331. }
  332. },
  333. hideFrameLoad: function (frameDom) {
  334. var shadeEle = $(frameDom).next("div.vant-tabCard-iframe-shade");
  335. $(shadeEle).find(".van-loading").hide();
  336. $(shadeEle).removeClass('body-bg-white')
  337. },
  338. /**
  339. * 自动打开下一个办理页
  340. */
  341. autoOpenNextBacklog: function () {
  342. this.$nextTick(function () {
  343. // 上一次的办理信息
  344. if (!this.prevOpenBacklog.code) {
  345. return;
  346. }
  347. // 找同流程的所有节点
  348. var warpCardCodeAry = $(".vant-tabCard-wrap[code='" + this.prevOpenBacklog.code + "']");
  349. if (warpCardCodeAry.length == 0) {
  350. return;
  351. }
  352. // 找上一次的审核节点
  353. var warpCardAllCodeAry = $(".vant-tabCard-wrap[allcode='" + this.prevOpenBacklog.allcode + "']");
  354. if (warpCardAllCodeAry.length > 0) {
  355. return;
  356. }
  357. // 只有一个的时候才打开
  358. if (warpCardCodeAry.length == 1) {
  359. setTimeout(() => {
  360. $(warpCardCodeAry[0]).find(".vant-tabCard-title").click();
  361. }, 800);
  362. }
  363. })
  364. },
  365. /**
  366. * 初始化单点登录的待办(一般是微信消息点击进来的)
  367. **/
  368. initJumpBacklogData: function () {
  369. var mjb = space.localStorage.getItem("msgJumpBacklog");
  370. if (!mjb) {
  371. return;
  372. }
  373. space.localStorage.removeItem("msgJumpBacklog");
  374. this.prevOpenBacklog = mjb;
  375. }
  376. }
  377. })
  378. </script>
  379. </html>