grabSheet.vue 15 KB

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