againAssign.vue 18 KB

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