solved.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. <template>
  2. <div class="solved">
  3. <div class="conentBox">
  4. <div class="header">处理方案</div>
  5. <div v-if="model.incident" class="conent">
  6. <div class="navBar">
  7. <div class="fl">
  8. <a
  9. :class="{ active: actives == 'info' }"
  10. href="javascript:;"
  11. @click="toInfo('info')"
  12. >事件信息</a
  13. >
  14. </div>
  15. <div class="fl">
  16. <a
  17. :class="{ active: actives == 'handlerInfo' }"
  18. href="javascript:;"
  19. @click="toInfo('handlerInfo')"
  20. >处理信息</a
  21. >
  22. </div>
  23. <!-- <div class="fl">
  24. <a
  25. :class="{ active: actives == 'handlerLog' }"
  26. href="javascript:;"
  27. @click="toInfo('handlerLog')"
  28. >维修记录</a
  29. >
  30. </div> -->
  31. <div class="fl">
  32. <a
  33. :class="{ active: actives == 'progress' }"
  34. href="javascript:;"
  35. @click="toInfo('progress')"
  36. >处理进度</a
  37. >
  38. </div>
  39. </div>
  40. <div class="label headtop" id="info">事件信息</div>
  41. <div class="info">
  42. <EventInformation :model="model" :id="id"></EventInformation>
  43. <p class="info_hide">
  44. <span class="fl hide" @click="hides()" v-if="!item_hides"
  45. >展开详情 >></span
  46. >
  47. <span class="fl hide" @click="hides()" v-if="item_hides"
  48. >隐藏详情<<</span
  49. >
  50. </p>
  51. <ShowPicture :processInstanceId="processInstanceId" :wxIncidentId="wxIncidentId"></ShowPicture>
  52. <div class="label" id="handlerInfo">处理信息</div>
  53. <p>
  54. <span class="fl">处理人</span>
  55. <span class="fr">{{
  56. model.incident.acceptUser ? model.incident.acceptUser.name : ""
  57. }}</span>
  58. </p>
  59. <p>
  60. <span class="fl">联系电话</span>
  61. <span class="fr" v-if="!model.incident.contactsInformation"></span>
  62. <span class="fr" v-if="model.incident.contactsInformation"
  63. ><a :href="'tel:' + model.incident.contactsInformation"
  64. ><i class="iconfont icon-shouji"></i
  65. >{{ model.incident.contactsInformation }}</a
  66. ></span
  67. >
  68. </p>
  69. <p>
  70. <span class="fl">处理方式</span>
  71. <span class="fr showwrap">{{
  72. model.incident.handleCategory
  73. ? model.incident.handleCategory.name
  74. : ""
  75. }}</span>
  76. </p>
  77. <p>
  78. <span class="fl">关闭代码</span>
  79. <span class="fr">{{
  80. model.incident.closecode ? model.incident.closecode.name : ""
  81. }}</span>
  82. </p>
  83. <p class="desc">
  84. <span class="fl">处理方案</span>
  85. <span
  86. class="fr grayFont"
  87. v-html="model.incident.handleDescription"
  88. ></span>
  89. </p>
  90. <!-- <p>
  91. <span class="fl" v-if="model.incident.synergeticReason">协同人员</span>
  92. <span class="fl" v-else-if="model.isupreason">升级对象</span>
  93. <span class="fl" v-else-if="model.transferReason">转派对象</span>
  94. <span class="fr">{{model.incident.handlerUser?model.incident.handlerUser.name:''}}</span>
  95. </p>
  96. <p v-if="model.incident.synergeticReason">
  97. <span class="fl" >协同原因</span>
  98. <span class="fr">{{model.incident.synergeticReason}}</span>
  99. </p>
  100. <p v-if="model.isupreason">
  101. <span class="fl">升级原因</span>
  102. <span class="fr">{{model.isupreason}}</span>
  103. </p>
  104. <p v-if="model.transferReason">
  105. <span class="fl">转派原因</span>
  106. <span class="fr" >{{model.transferReason}}</span>
  107. </p> -->
  108. <!-- <HandlerLog :data="model.incident.handlerLogs" id="handlerLog"></HandlerLog> -->
  109. <div class="label" id="progress">处理进度</div>
  110. <div
  111. :class="{ progress: true, progressHide: !pro_hides }"
  112. id="progressBox"
  113. >
  114. <div class="progress_info" v-for="item in progressInfo">
  115. <div class="progress_info_L">{{ item.activityName }}</div>
  116. <div class="progress_info_R">
  117. <div class="time">
  118. <i
  119. :class="{
  120. iconfont: true,
  121. 'icon-icon_weizuo': item.endTime != '',
  122. 'icon-icon_zhengzaijinx': item.endTime == '',
  123. }"
  124. ></i>
  125. <span class="text1">
  126. {{ item.startTime | timeFormat("MM-dd HH:mm:ss") }}
  127. <template v-if="item.userName">
  128. ,{{ item.userName }}
  129. </template>
  130. </span>
  131. </div>
  132. <div :class="{ cont: true, blue: item.endTime != '' }">
  133. <p class="text2" v-if="item.desc" v-html="item.desc"></p>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <p class="info_hide">
  139. <span class="fl hide" @click="proHides()">{{
  140. pro_hides ? "隐藏详情 <<" : "展开详情 >>"
  141. }}</span>
  142. </p>
  143. <div
  144. class="form"
  145. v-if="model.incident.handlerUser.id == loginUser.id"
  146. >
  147. <div class="txtLabel">
  148. <div class="txt fl handler">
  149. <span style="color: red">*</span>是否已解决:
  150. </div>
  151. <cube-select
  152. class="selectGroup fl"
  153. v-model="isclose"
  154. :options="iscloseArr"
  155. ></cube-select>
  156. </div>
  157. <div class="txtLabel">
  158. <div class="txt fl">
  159. <span style="color: red">*</span> 结果类型:
  160. </div>
  161. <cube-select
  162. class="selectGroup fl"
  163. v-model="handleResult"
  164. :options="handleResultArr"
  165. ></cube-select>
  166. </div>
  167. <div class="txtLabel">
  168. <div class="txt fl">满意度评价:</div>
  169. <cube-select
  170. class="selectGroup fl"
  171. v-model="degree"
  172. :options="degreeArr"
  173. ></cube-select>
  174. </div>
  175. <div class="txtLabel">
  176. <div class="txt fl">回访备注:</div>
  177. <cube-input v-model="model.incident.visitRemarks"></cube-input>
  178. </div>
  179. <div class="sub">
  180. <cube-button type="submit" @click="subVali()">提交</cube-button>
  181. <cube-button type="submit" @click="goToSummary()" v-if="model.incident.duty && model.incident.duty.addSummary == 1">查看汇总单</cube-button>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. <load-ing v-if="!model.incident"></load-ing>
  187. </div>
  188. </div>
  189. </template>
  190. <script>
  191. import LoadIng from "./../views/loading.vue";
  192. import EventInformation from './../components/EventInformation/index.vue'
  193. import ShowPicture from './../custom/ShowPicture.vue'
  194. import { formatDate } from "./../components/js/date.js";
  195. // import HandlerLog from "./../views/handlerLog.vue";
  196. export default {
  197. data() {
  198. return {
  199. id: "",
  200. loginUser: JSON.parse(localStorage.getItem("loginUser")),
  201. selected: 1,
  202. isclose: "close", //是否已解决
  203. iscloseArr: [
  204. {
  205. text: "已解决",
  206. value: "close",
  207. },
  208. {
  209. text: "未解决",
  210. value: "notsolved",
  211. },
  212. ],
  213. handleResult: "", //结果类型
  214. handleResultArr: [], //结果类型
  215. degree: "",
  216. degreeArr: [],
  217. visitRemarks: "", //回访备注
  218. item_hides: false,
  219. item_hides1: false,
  220. pro_hides: false, //展开/收起处理进度
  221. actives: "info",
  222. processInstanceId: "",
  223. wxIncidentId: "",
  224. progressInfo: [], //处理进度
  225. model: {}, //提交数据
  226. };
  227. },
  228. components: {
  229. LoadIng,
  230. EventInformation,
  231. ShowPicture,
  232. // HandlerLog
  233. },
  234. methods: {
  235. // 查看汇总单
  236. goToSummary(){
  237. if(this.model.incident.duty && this.model.incident.duty.addSummary == 1 && this.model.incident.state.value == "resolved"){
  238. // 责任科室【是否需要填写汇总单】开启,并且工单状态是已解决
  239. this.$router.push({
  240. path: `/summaryOrderDetail/${this.model.incident.id}`
  241. });
  242. }else if(this.model.incident.duty && this.model.incident.duty.addSummary == 1 && this.model.incident.state.value == "close"){
  243. // 责任科室【是否需要填写汇总单】开启,并且工单状态是已关闭
  244. this.$router.push({
  245. path: `/summaryOrderDetail/${this.model.incident.id}`
  246. });
  247. }
  248. },
  249. // 获取事件数据
  250. getParamsData() {
  251. var that = this;
  252. that.$http
  253. .get(
  254. "/service/form/renderForm/closeform/" +
  255. that.processInstanceId +
  256. "/" +
  257. that.loginUser.id +
  258. "/" +
  259. that.id,
  260. {}
  261. )
  262. .then(function (res) {
  263. console.log(res.data);
  264. that.model = res.data.model;
  265. that.model.msgflag = "已解决";
  266. //seimin
  267. that.wxIncidentId = res.data.model.incident.wxIncidentId;
  268. localStorage.setItem("modelData", JSON.stringify(that.model));
  269. that.getProgressInfo();
  270. });
  271. },
  272. // 获取处理进度
  273. getProgressInfo() {
  274. var that = this;
  275. that.$http
  276. .post(
  277. "/service/bpm/bpm/flowTracingCustom/" + that.processInstanceId,
  278. {}
  279. )
  280. .then(function (res) {
  281. console.log(res.data);
  282. that.progressInfo = res.data.data;
  283. //维修记录startcaca
  284. if (that.model.incident.handlerLogs) {
  285. //添加日志
  286. that.model.incident.handlerLogs.forEach((v) => {
  287. that.progressInfo.push({
  288. startTime: v.opTime,
  289. endTime: 1,
  290. desc: (v.repairType && v.expectedDate) ? `${v.repairType.name} ${formatDate(v.expectedDate, "MM月dd日前完成")}<br>${v.opValue}` : v.opValue,
  291. userName: v.userName,
  292. activityName: "事件处理",
  293. });
  294. });
  295. }
  296. //处理数据
  297. that.progressInfo.forEach((v) => {
  298. if (!v.endTime) {
  299. v.endTime = 1;
  300. }
  301. v.startTime = new Date(v.startTime).getTime();
  302. });
  303. var kaishi = that.progressInfo.shift();
  304. var jiedan = that.progressInfo.shift();
  305. that.progressInfo.sort(function (o, c) {
  306. return c.startTime - o.startTime;
  307. });
  308. that.progressInfo.length && (that.progressInfo[0].endTime = "");
  309. that.progressInfo.push(jiedan);
  310. that.progressInfo.push(kaishi);
  311. console.log(that.progressInfo);
  312. //维修记录end
  313. });
  314. },
  315. // 获取结果类型
  316. getHandlerRes() {
  317. var that = this;
  318. that.$http
  319. .post("/service/common/common/getDictionary", {
  320. type: "list",
  321. key: "incident_handleresult",
  322. })
  323. .then(function (res) {
  324. console.log(res.data);
  325. // that.handleResultArr = res.data;
  326. res.data.forEach(function (v, i) {
  327. that.handleResultArr.push({
  328. text: v.name,
  329. value: v.id,
  330. });
  331. });
  332. if (that.handleResultArr.length) {
  333. that.handleResult = that.handleResultArr[0].value;
  334. }
  335. });
  336. },
  337. // 获取满意度评价
  338. getDegree() {
  339. var that = this;
  340. that.$http
  341. .post("/service/common/common/getDictionary", {
  342. type: "list",
  343. key: "incident_degree",
  344. })
  345. .then(function (res) {
  346. console.log(res.data);
  347. // that.degreeArr = res.data;
  348. res.data.forEach(function (v, i) {
  349. that.degreeArr.push({
  350. text: v.name,
  351. value: v.id,
  352. });
  353. });
  354. });
  355. },
  356. //隐藏显示详情
  357. hides() {
  358. this.item_hides = !this.item_hides;
  359. $("#shows").slideToggle();
  360. },
  361. //隐藏显示详情
  362. hides1() {
  363. this.item_hides1 = !this.item_hides1;
  364. $("#shows1").slideToggle();
  365. },
  366. // 处理进度隐藏/展开
  367. proHides() {
  368. if (!this.pro_hides) {
  369. $("#progressBox").animate({
  370. height: $("#progressBox")[0].scrollHeight,
  371. });
  372. } else {
  373. $("#progressBox").animate({ height: "1.7rem" });
  374. }
  375. this.pro_hides = !this.pro_hides;
  376. },
  377. // 快速定位
  378. toInfo(id) {
  379. this.actives = id;
  380. $("body,html").animate(
  381. {
  382. scrollTop:
  383. $("#" + id).offset().top -
  384. $(".header")[0].offsetHeight -
  385. $(".navBar")[0].offsetHeight,
  386. },
  387. 260
  388. );
  389. },
  390. // 提交
  391. subVali() {
  392. var that = this;
  393. delete that.model.handlerCode;
  394. that.model.handler_code = "resolve";
  395. that.model.isclose = that.isclose;
  396. if (that.model.isclose == "close") {
  397. delete that.model.receive_code;
  398. }
  399. that.model.incident.handleResult = { id: that.handleResult };
  400. that.model.loginUser = that.loginUser;
  401. if (that.degree) {
  402. that.model.incident.degree = { id: that.degree };
  403. }
  404. console.log(that.model);
  405. if (!that.model.incident.handleResult) {
  406. $("#fade").fadeIn();
  407. that.promptingConent = "提交失败,请填写必填信息!";
  408. that.promptingStatus = false;
  409. setTimeout(function () {
  410. $("#fade").fadeOut();
  411. }, 2000);
  412. }
  413. that.$http
  414. .post(
  415. "service/bpm/bpm/completeTask/" +
  416. that.model.incident.taskId +
  417. "/" +
  418. that.loginUser.id,
  419. that.model
  420. )
  421. .then(function (res) {
  422. if (res.data.status == 200) {
  423. $("#fade").fadeIn();
  424. that.promptingConent = "恭喜您,提交成功!";
  425. that.promptingStatus = true;
  426. that.dialog = that
  427. .$createDialog({
  428. type: "alert",
  429. title: "提交成功",
  430. content: "点击返回首页",
  431. icon: "cubeic-right",
  432. onConfirm: (e, promptValue) => {
  433. that.$router.push({ path: "/main" });
  434. },
  435. })
  436. .show();
  437. setTimeout(function () {
  438. $("#fade").fadeOut();
  439. }, 2000);
  440. }
  441. });
  442. },
  443. },
  444. created() {
  445. this.processInstanceId = this.$route.params.data
  446. ? this.$route.params.data.processInstanceId
  447. : JSON.parse(localStorage.getItem("modelData")).incident
  448. .processInstanceId;
  449. this.id = this.$route.params.data
  450. ? this.$route.params.data.id
  451. : JSON.parse(localStorage.getItem("modelData")).incident.id;
  452. this.getParamsData();
  453. this.getHandlerRes();
  454. this.getDegree();
  455. },
  456. };
  457. </script>
  458. <style lang="less" scoped>
  459. i.iconfont {
  460. &.blue {
  461. color: #005395;
  462. // &::after {
  463. // content: "";
  464. // width: 0.01rem;
  465. // height: 0.4rem;
  466. // background: #005395;
  467. // position: relative;
  468. // display: block;
  469. // left: 0.14rem;
  470. // }
  471. }
  472. &.blue1 {
  473. color: #005395;
  474. }
  475. }
  476. .solved {
  477. .header {
  478. width: 100%;
  479. height: 0.88rem;
  480. line-height: 0.88rem;
  481. text-align: center;
  482. color: #fff;
  483. font-size: 0.37rem;
  484. background: linear-gradient(#2e2f32, #414246);
  485. position: fixed;
  486. top: 0;
  487. z-index: 6;
  488. }
  489. .navBar {
  490. width: 100%;
  491. height: 0.96rem;
  492. line-height: 0.96rem;
  493. background-color: #fafafa;
  494. font-size: 0.28rem;
  495. position: fixed;
  496. top: 0.88rem;
  497. div {
  498. width: 33.33%;
  499. text-align: center;
  500. a {
  501. display: inline-block;
  502. height: 0.9rem;
  503. width: 1.7rem;
  504. padding: 0 0.1rem;
  505. &.active {
  506. color: #005395;
  507. border-bottom: 0.06rem solid #005395;
  508. }
  509. }
  510. }
  511. }
  512. .headtop {
  513. margin-top: 1.84rem;
  514. }
  515. .label {
  516. background-color: #eeeeee;
  517. height: 0.6rem;
  518. line-height: 0.58rem;
  519. padding-left: 0.2rem;
  520. font-size: 0.24rem;
  521. color: #666666;
  522. span {
  523. font-size: 0.2rem;
  524. display: inline-block;
  525. margin-left: 0.08rem;
  526. color: #999999;
  527. }
  528. &.formLabel {
  529. background-color: #fff;
  530. }
  531. }
  532. .txtLabel {
  533. width: 100%;
  534. overflow: hidden;
  535. padding: 0.32rem 0.24rem 0.32rem 0.32rem;
  536. .txt {
  537. width: 25%;
  538. color: #666;
  539. &.handler {
  540. width: 40%;
  541. }
  542. }
  543. .selectGroup {
  544. width: 62%;
  545. }
  546. .cube-input {
  547. width: 62%;
  548. }
  549. }
  550. .conentBox {
  551. width: 100%;
  552. .conent {
  553. font-size: 0.32rem;
  554. font-weight: 400;
  555. line-height: 0.45rem;
  556. // border-bottom: 0.16rem solid #e5e5e5;
  557. .shows {
  558. display: none;
  559. }
  560. .shows1 {
  561. display: none;
  562. }
  563. .boeder_B {
  564. border-bottom: 0.01rem solid #ccc;
  565. }
  566. p {
  567. &.desc {
  568. overflow: hidden;
  569. }
  570. .grayFont {
  571. width: 75%;
  572. text-align: right;
  573. overflow-x: scroll;
  574. }
  575. }
  576. .bottom {
  577. overflow: hidden;
  578. line-height: 0.86rem;
  579. border-bottom: 0.01rem solid #e6e6e6;
  580. font-size: 0.24rem;
  581. color: #999;
  582. padding: 0 0.24rem 0 0.48rem;
  583. }
  584. .info {
  585. color: #999;
  586. font-size: 0.28rem;
  587. overflow: hidden;
  588. .head {
  589. border-bottom: 0.01rem solid #e6e6e6;
  590. p {
  591. padding: 0.24rem 0.3rem;
  592. i {
  593. color: #00559d;
  594. }
  595. }
  596. }
  597. p {
  598. line-height: 0.4rem;
  599. padding: 0.1rem 0.24rem;
  600. overflow: hidden;
  601. .overflowEllipsis2 {
  602. margin-left: 1.96rem;
  603. }
  604. }
  605. .info_hide {
  606. padding: 0.2rem 0.24rem;
  607. border-bottom: 0.01rem solid #e6e6e6;
  608. .hide {
  609. color: #00559d;
  610. }
  611. }
  612. .progress {
  613. padding: 0.2rem 0.2rem;
  614. overflow: hidden;
  615. transition-duration: 0.2s;
  616. transition-timing-function: linear;
  617. &.progressHide {
  618. height: 1.7rem;
  619. }
  620. .progress_info {
  621. overflow: hidden;
  622. margin-bottom: 0.1rem;
  623. &:nth-last-child(1) {
  624. .cont {
  625. border: none !important;
  626. }
  627. }
  628. .progress_info_L {
  629. float: left;
  630. color: #333;
  631. max-width: 18%;
  632. }
  633. .progress_info_R {
  634. float: right;
  635. margin-left: 0.09rem;
  636. width: 80%;
  637. font-size: 0.25rem;
  638. .time {
  639. i {
  640. margin-left: -0.15rem;
  641. &.icon-icon_weizuo {
  642. color: #005495;
  643. }
  644. &.icon-icon_zhengzaijinx {
  645. color: #48a843;
  646. font-size: 0.37rem;
  647. }
  648. }
  649. span {
  650. margin-left: 0.15rem;
  651. }
  652. }
  653. .cont {
  654. border-left: 1px solid #999;
  655. padding-left: 0.4rem;
  656. min-height: 0.4rem;
  657. &.blue {
  658. border-left: 1px solid #005395;
  659. }
  660. }
  661. .text2 {
  662. color: #666;
  663. word-break: break-all;
  664. }
  665. p {
  666. padding: 0;
  667. }
  668. }
  669. }
  670. }
  671. }
  672. .txtLabel {
  673. width: 100%;
  674. overflow: hidden;
  675. padding: 0.32rem 0.24rem 0.32rem 0.32rem;
  676. .txt {
  677. width: 30%;
  678. color: #666;
  679. }
  680. .cube-textarea-wrapper {
  681. width: 62%;
  682. }
  683. }
  684. .sub {
  685. background: #ececec;
  686. display: flex;
  687. .cube-btn {
  688. background-color: #005395 !important;
  689. flex: 1;
  690. margin: 0.2rem;
  691. border-radius: 8px;
  692. }
  693. }
  694. }
  695. }
  696. .showwrap {
  697. width: 75%;
  698. text-align: right;
  699. }
  700. }
  701. </style>