againAssign.vue 16 KB

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