grabSheet.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. <template>
  2. <div class="grabSheet">
  3. <div class="conentBox">
  4. <div class="conent">
  5. <div class="header">处理方案</div>
  6. <div class="box" v-if="model.incident">
  7. <div class="navBar">
  8. <div class="fl">
  9. <a
  10. :class="{ active: actives == 'info' }"
  11. href="javascript:;"
  12. @click="toInfo('info')"
  13. >事件信息</a
  14. >
  15. </div>
  16. <div class="fl">
  17. <a
  18. :class="{ active: actives == 'progress' }"
  19. href="javascript:;"
  20. @click="toInfo('progress')"
  21. >处理进度</a
  22. >
  23. </div>
  24. </div>
  25. <div class="label headtop" id="info">事件信息</div>
  26. <div class="info">
  27. <EventInformation :model="model" :id="id"></EventInformation>
  28. <p class="info_hide">
  29. <span class="fl hide" @click="hides()" v-if="!item_hides"
  30. >展开详情 >></span
  31. >
  32. <span class="fl hide" @click="hides()" v-if="item_hides"
  33. >隐藏详情<<</span
  34. >
  35. </p>
  36. <ShowPicture :processInstanceId="processInstanceId" :wxIncidentId="wxIncidentId"></ShowPicture>
  37. <div class="label" id="progress">处理进度</div>
  38. <div
  39. :class="{ progress: true, progressHide: !pro_hides }"
  40. id="progressBox"
  41. >
  42. <div class="progress_info" v-for="item in progressInfo">
  43. <div class="progress_info_L">{{ item.activityName }}</div>
  44. <div class="progress_info_R">
  45. <div class="time">
  46. <i
  47. :class="{
  48. iconfont: true,
  49. 'icon-icon_weizuo': item.endTime != '',
  50. 'icon-icon_zhengzaijinx': item.endTime == '',
  51. }"
  52. ></i>
  53. <span class="text1">
  54. {{ item.startTime | timeFormat("MM-dd HH:mm:ss") }}
  55. <template v-if="item.userName">
  56. ,{{ item.userName }}
  57. </template>
  58. </span>
  59. </div>
  60. <div :class="{ cont: true, blue: item.endTime != '' }">
  61. <p class="text2" v-if="item.desc" v-html="item.desc"></p>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <p class="info_hide">
  67. <span class="fl hide" @click="proHides()">{{
  68. pro_hides ? "隐藏详情 <<" : "展开详情 >>"
  69. }}</span>
  70. </p>
  71. </div>
  72. <cube-form-group class="sub" v-if="model.incident.state.value != 1546 && !model.incident.handlerUser && jurisdiction && qiangdan">
  73. <cube-button type="submit" @click="subVali()">抢单</cube-button>
  74. </cube-form-group>
  75. </div>
  76. </div>
  77. <load-ing v-if="!model.incident"></load-ing>
  78. </div>
  79. </div>
  80. </template>
  81. <script>
  82. import LoadIng from "./../views/loading.vue";
  83. import EventInformation from './../components/EventInformation/index.vue'
  84. import ShowPicture from './../custom/ShowPicture.vue'
  85. import { formatDate } from "./../components/js/date.js";
  86. export default {
  87. data() {
  88. return {
  89. qiangdan: false,
  90. id: "",
  91. loginUser: JSON.parse(localStorage.getItem("loginUser")),
  92. menu: JSON.parse(localStorage.getItem("menu")),
  93. selected: 1,
  94. options: [
  95. {
  96. label: "接单",
  97. value: 1,
  98. },
  99. {
  100. label: "重新指派",
  101. value: 2,
  102. },
  103. ],
  104. resignComment: "", //重新指派原因
  105. item_hides: false,
  106. actives: "info",
  107. processInstanceId: "",
  108. wxIncidentId: "",
  109. progressInfo: [], //处理进度
  110. model: {}, //提交数据
  111. jurisdiction: false, //是否有抢单权限
  112. pro_hides: false, //展开/收起处理进度
  113. };
  114. },
  115. methods: {
  116. // 获取事件数据
  117. getParamsData() {
  118. var that = this;
  119. var groups = [];
  120. that.loginUser.group.forEach((element) => {
  121. groups.push(element.id);
  122. });
  123. console.log(groups);
  124. that.$http
  125. .get(
  126. "/service/form/renderForm/receiveform/" +
  127. that.processInstanceId +
  128. "/" +
  129. that.loginUser.id +
  130. "/" +
  131. that.id,
  132. {}
  133. )
  134. .then(function (res) {
  135. console.log(res.data);
  136. that.model = res.data.model;
  137. for (var i = 0; i < groups.length; i++) {
  138. if (groups[i] == that.model.incident.candidateGroups) {
  139. that.jurisdiction = true;
  140. }
  141. }
  142. //seimin
  143. that.wxIncidentId = res.data.model.incident.wxIncidentId;
  144. localStorage.setItem("modelData", JSON.stringify(that.model));
  145. that.getProgressInfo();
  146. });
  147. },
  148. // 获取处理进度
  149. getProgressInfo() {
  150. var that = this;
  151. that.$http
  152. .post(
  153. "/service/bpm/bpm/flowTracingCustom/" + that.processInstanceId,
  154. {}
  155. )
  156. .then(function (res) {
  157. console.log(res.data);
  158. that.progressInfo = res.data.data;
  159. //维修记录startcaca
  160. if (that.model.incident.handlerLogs) {
  161. //添加日志
  162. that.model.incident.handlerLogs.forEach((v) => {
  163. that.progressInfo.push({
  164. startTime: v.opTime,
  165. endTime: 1,
  166. desc: (v.repairType && v.expectedDate) ? `${v.repairType.name} ${formatDate(v.expectedDate, "MM月dd日前完成")}<br>${v.opValue}` : v.opValue,
  167. userName: v.userName,
  168. activityName: "事件处理",
  169. });
  170. });
  171. }
  172. //处理数据
  173. that.progressInfo.forEach((v) => {
  174. if (!v.endTime) {
  175. v.endTime = 1;
  176. }
  177. v.startTime = new Date(v.startTime).getTime();
  178. });
  179. var kaishi = that.progressInfo.shift();
  180. var jiedan = that.progressInfo.shift();
  181. that.progressInfo.sort(function (o, c) {
  182. return c.startTime - o.startTime;
  183. });
  184. that.progressInfo.length && (that.progressInfo[0].endTime = "");
  185. that.progressInfo.push(jiedan);
  186. that.progressInfo.push(kaishi);
  187. console.log(that.progressInfo);
  188. //维修记录end
  189. });
  190. },
  191. //隐藏显示详情
  192. hides() {
  193. this.item_hides = !this.item_hides;
  194. $("#shows").slideToggle();
  195. },
  196. // 处理进度隐藏/展开
  197. proHides() {
  198. if (!this.pro_hides) {
  199. $("#progressBox").animate({
  200. height: $("#progressBox")[0].scrollHeight,
  201. });
  202. } else {
  203. $("#progressBox").animate({ height: "1.7rem" });
  204. }
  205. this.pro_hides = !this.pro_hides;
  206. },
  207. subVali() {
  208. //数据提交
  209. var that = this;
  210. this.$createDialog({
  211. type: 'confirm',
  212. icon: 'cubeic-alert',
  213. title: '提示',
  214. content: '是否抢单?',
  215. confirmBtn: {
  216. text: '确定',
  217. active: true,
  218. disabled: false,
  219. href: 'javascript:;'
  220. },
  221. cancelBtn: {
  222. text: '取消',
  223. active: false,
  224. disabled: false,
  225. href: 'javascript:;'
  226. },
  227. onConfirm: () => {
  228. that.$http
  229. .post(
  230. "service/bpm/bpm/claimAndCompletedTask/" + that.model.incident.taskId,
  231. { receive_code: "handler", userId: that.loginUser.id }
  232. )
  233. .then(function (res) {
  234. console.log(res.data);
  235. if (res.data.status == 200) {
  236. that
  237. .$createDialog({
  238. type: "alert",
  239. title: "抢单成功",
  240. content: "点击返回首页",
  241. icon: "cubeic-right",
  242. onConfirm: (e, promptValue) => {
  243. that.$router.push({ path: "/main" });
  244. },
  245. })
  246. .show();
  247. }else{
  248. this.$createDialog({
  249. type: "alert",
  250. title: "系统错误,请稍后再试!",
  251. icon: "cubeic-wrong",
  252. }).show();
  253. }
  254. });
  255. },
  256. onCancel: () => {
  257. }
  258. }).show()
  259. },
  260. // 快速定位
  261. toInfo(id) {
  262. this.actives = id;
  263. $("body,html").animate(
  264. {
  265. scrollTop:
  266. $("#" + id).offset().top -
  267. $(".header")[0].offsetHeight -
  268. $(".navBar")[0].offsetHeight,
  269. },
  270. 260
  271. );
  272. },
  273. },
  274. components: {
  275. LoadIng,
  276. EventInformation,
  277. ShowPicture,
  278. },
  279. created() {
  280. if(this.menu){
  281. this.qiangdan = this.menu.some(v => v.link == 'shijianliebiao_qiangdan');
  282. }
  283. this.processInstanceId = this.$route.params.data
  284. ? this.$route.params.data.processInstanceId
  285. : JSON.parse(localStorage.getItem("modelData")).incident
  286. .processInstanceId;
  287. this.id = this.$route.params.data
  288. ? this.$route.params.data.id
  289. : JSON.parse(localStorage.getItem("modelData")).incident.id;
  290. this.getParamsData();
  291. },
  292. };
  293. </script>
  294. <style lang="less" scoped>
  295. // i.iconfont.green {
  296. // color: #48a843;
  297. // &::after {
  298. // content: "";
  299. // width: 0.01rem;
  300. // height: 0.4rem;
  301. // background: #005395;
  302. // position: relative;
  303. // display: block;
  304. // left: 0.14rem;
  305. // }
  306. // }
  307. .grabSheet {
  308. .header {
  309. width: 100%;
  310. height: 0.88rem;
  311. line-height: 0.88rem;
  312. text-align: center;
  313. color: #fff;
  314. font-size: 0.37rem;
  315. background: linear-gradient(#2e2f32, #414246);
  316. position: fixed;
  317. top: 0;
  318. z-index: 6;
  319. }
  320. .box {
  321. min-height: 9.7rem;
  322. position: relative;
  323. }
  324. .navBar {
  325. width: 100%;
  326. height: 0.96rem;
  327. line-height: 0.96rem;
  328. background-color: #fafafa;
  329. font-size: 0.28rem;
  330. position: fixed;
  331. top: 0.88rem;
  332. div {
  333. width: 49.99%;
  334. text-align: center;
  335. a {
  336. display: inline-block;
  337. height: 0.9rem;
  338. width: 1.7rem;
  339. padding: 0 0.1rem;
  340. &.active {
  341. color: #005395;
  342. border-bottom: 0.06rem solid #005395;
  343. }
  344. }
  345. }
  346. }
  347. .headtop {
  348. margin-top: 1.84rem;
  349. }
  350. .label {
  351. background-color: #eeeeee;
  352. height: 0.6rem;
  353. line-height: 0.58rem;
  354. padding-left: 0.2rem;
  355. font-size: 0.24rem;
  356. color: #666666;
  357. span {
  358. font-size: 0.2rem;
  359. display: inline-block;
  360. margin-left: 0.08rem;
  361. color: #999999;
  362. }
  363. &.formLabel {
  364. background-color: #fff;
  365. }
  366. }
  367. .conentBox {
  368. width: 100%;
  369. .conent {
  370. font-size: 0.32rem;
  371. font-weight: 400;
  372. line-height: 0.45rem;
  373. // border-bottom: 0.16rem solid #e5e5e5;
  374. .shows {
  375. display: none;
  376. }
  377. .boeder_B {
  378. border-bottom: 0.01rem solid #ccc;
  379. }
  380. p {
  381. &.desc {
  382. overflow: hidden;
  383. }
  384. .grayFont {
  385. width: 75%;
  386. text-align: right;
  387. overflow-x: scroll;
  388. }
  389. }
  390. .bottom {
  391. overflow: hidden;
  392. line-height: 0.86rem;
  393. border-bottom: 0.01rem solid #e6e6e6;
  394. font-size: 0.24rem;
  395. color: #999;
  396. padding: 0 0.24rem 0 0.48rem;
  397. }
  398. .info {
  399. color: #999;
  400. font-size: 0.28rem;
  401. overflow: hidden;
  402. padding-bottom: 1.3rem;
  403. .head {
  404. border-bottom: 0.01rem solid #e6e6e6;
  405. p {
  406. padding: 0.24rem 0.3rem;
  407. i {
  408. color: #00559d;
  409. }
  410. }
  411. }
  412. p {
  413. line-height: 0.4rem;
  414. padding: 0.1rem 0.24rem;
  415. overflow: hidden;
  416. .overflowEllipsis2 {
  417. margin-left: 1.96rem;
  418. }
  419. }
  420. .info_hide {
  421. padding: 0.2rem 0.24rem;
  422. border-bottom: 0.01rem solid #e6e6e6;
  423. .hide {
  424. color: #00559d;
  425. }
  426. }
  427. .progress {
  428. padding: 0.2rem 0.2rem;
  429. overflow: hidden;
  430. transition-duration: 0.2s;
  431. transition-timing-function: linear;
  432. &.progressHide {
  433. height: 1.7rem;
  434. }
  435. .progress_info {
  436. overflow: hidden;
  437. margin-bottom: 0.1rem;
  438. &:nth-last-child(1) {
  439. .cont {
  440. border: none !important;
  441. }
  442. }
  443. .progress_info_L {
  444. float: left;
  445. color: #333;
  446. max-width: 18%;
  447. }
  448. .progress_info_R {
  449. float: right;
  450. margin-left: 0.09rem;
  451. width: 80%;
  452. font-size: 0.25rem;
  453. .time {
  454. i {
  455. margin-left: -0.15rem;
  456. &.icon-icon_weizuo {
  457. color: #005495;
  458. }
  459. &.icon-icon_zhengzaijinx {
  460. color: #48a843;
  461. font-size: 0.37rem;
  462. }
  463. }
  464. span {
  465. margin-left: 0.15rem;
  466. }
  467. }
  468. .cont {
  469. border-left: 1px solid #999;
  470. padding-left: 0.4rem;
  471. min-height: 0.4rem;
  472. &.blue {
  473. border-left: 1px solid #005395;
  474. }
  475. }
  476. .text2 {
  477. color: #666;
  478. word-break: break-all;
  479. }
  480. p {
  481. padding: 0;
  482. }
  483. }
  484. }
  485. }
  486. }
  487. .txtLabel {
  488. width: 100%;
  489. overflow: hidden;
  490. padding: 0.32rem 0.24rem 0.32rem 0.32rem;
  491. .txt {
  492. width: 30%;
  493. color: #666;
  494. }
  495. .cube-textarea-wrapper {
  496. width: 62%;
  497. }
  498. }
  499. .sub {
  500. background: #ececec;
  501. position: absolute;
  502. bottom: 0;
  503. width: 100%;
  504. .cube-btn {
  505. background-color: #005395 !important;
  506. width: 90%;
  507. margin: 0.2rem auto;
  508. border-radius: 8px;
  509. }
  510. }
  511. }
  512. }
  513. .showwrap {
  514. width: 75%;
  515. text-align: right;
  516. }
  517. }
  518. </style>