order.vue 17 KB

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