againAssign.vue 16 KB

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