grabSheet.vue 15 KB

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