order.vue 16 KB

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