indes.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. <template>
  2. <div class="fle bgColor">
  3. <!-- 头部导航栏 -->
  4. <div class="tav">
  5. <div @click="toRapir()">
  6. <i class="iconfont icon-xinjian"></i>
  7. <span>快速报修</span>
  8. </div>
  9. <div @click="toCheckNumber()" v-if="loginUser.account === 'ITIL_test2'||loginUser.account === 'Z0003865'||loginUser.account === 'wangyaxiang'||loginUser.account === 'Z0004571'">
  10. <i class="dash dash-chahao"></i>
  11. <span>电话查号</span>
  12. </div>
  13. <div @click="toChangePassword()">
  14. <i class="dash dash-xiugaimima"></i>
  15. <span>修改密码</span>
  16. </div>
  17. <div @click="toKnowList()">
  18. <i class="iconfont icon-message"></i>
  19. <span>常见问题</span>
  20. </div>
  21. <div @click.prevent="scan()" v-if="wxIncidentWithCmdb == 1">
  22. <i class="dash dash-saoyisao"></i>
  23. <span>扫一扫</span>
  24. </div>
  25. <!-- <div @click="toGuide()">
  26. <i class="iconfont icon-fuwuzhinan"></i>
  27. <span>服务指南</span>
  28. </div> -->
  29. </div>
  30. <div class="bigBody">
  31. <!-- 最新报修 -->
  32. <div class="newRepair">
  33. <div class="titHead">
  34. <span class="tit"
  35. ><i class="iconfont icon-zuixinbaoxiu newPapir"></i
  36. ><span>最新报修</span></span
  37. >
  38. <span class="link" @click="toIncidentList()"
  39. >更多<i class="iconfont icon-moren"></i
  40. ></span>
  41. </div>
  42. <div
  43. class="conentBox"
  44. v-for="v in newRapirData"
  45. @click="toIncidentDetails(v)"
  46. v-if="!newRapirNoData && !newRapirLoading"
  47. >
  48. <div class="conent">
  49. <div class="head">
  50. <!-- <span>{{v.requester.name}}</span> -->
  51. <span>报修编号:{{ v.bxcode }}</span>
  52. <span>{{ v.createTime }}</span>
  53. </div>
  54. <div class="cot">
  55. {{ v.description }}
  56. </div>
  57. </div>
  58. <div class="flowChart">
  59. <div class="pits">
  60. <div :class="state != 1 ? 'yesLine' : ''"></div>
  61. <div :class="state != 1 && state != 2 ? 'yesLine' : ''"></div>
  62. <div
  63. :class="state != 1 && state != 2 && state != 3 ? 'yesLine' : ''"
  64. ></div>
  65. <div
  66. :class="
  67. state != 1 && state != 2 && state != 3 && state != 4
  68. ? 'yesLine'
  69. : ''
  70. "
  71. ></div>
  72. <i class="iconfont icon-icon_weizuo shenqing no" v-if="false"></i>
  73. <i
  74. class="iconfont icon-icon_weizuo shouli no"
  75. v-if="state == 1"
  76. ></i>
  77. <i
  78. class="iconfont icon-icon_weizuo chuli no"
  79. v-if="state == 2 || state == 1"
  80. ></i>
  81. <i
  82. class="iconfont icon-icon_weizuo pingjia no"
  83. v-if="state == 3 || state == 2 || state == 1"
  84. ></i>
  85. <i
  86. class="iconfont icon-icon_weizuo wancheng no"
  87. v-if="state == 4 || state == 3 || state == 2 || state == 1"
  88. ></i>
  89. <i
  90. class="iconfont icon-icon_weizuo shenqing yes"
  91. v-if="state != 1"
  92. ></i>
  93. <i
  94. class="iconfont icon-icon_weizuo shouli yes"
  95. v-if="state != 1 && state != 2"
  96. ></i>
  97. <i
  98. class="iconfont icon-icon_weizuo chuli yes"
  99. v-if="state != 1 && state != 2 && state != 3"
  100. ></i>
  101. <i
  102. class="iconfont icon-icon_weizuo pingjia yes"
  103. v-if="state != 1 && state != 2 && state != 3 && state != 4"
  104. ></i>
  105. <i
  106. class="iconfont icon-icon_weizuo wancheng yes"
  107. v-if="false"
  108. ></i>
  109. <i
  110. class="iconfont icon-icon_zhengzaijinx shenqing now"
  111. v-if="state == 1"
  112. ></i>
  113. <i
  114. class="iconfont icon-icon_zhengzaijinx shouli now"
  115. v-if="state == 2"
  116. ></i>
  117. <i
  118. class="iconfont icon-icon_zhengzaijinx chuli now"
  119. v-if="state == 3"
  120. ></i>
  121. <i
  122. class="iconfont icon-icon_zhengzaijinx pingjia now"
  123. v-if="state == 4"
  124. ></i>
  125. <i
  126. class="iconfont icon-icon_zhengzaijinx wancheng now"
  127. v-if="state == 5"
  128. ></i>
  129. </div>
  130. <div class="words">
  131. <div>申请</div>
  132. <div>受理</div>
  133. <div>处理</div>
  134. <div>评价</div>
  135. <div>完成</div>
  136. </div>
  137. </div>
  138. </div>
  139. <!-- 无数据 -->
  140. <div class="wushuju" v-if="newRapirNoData">
  141. <img src="./../../static/images/wushuju.svg" alt="" />
  142. <div class="noDataFont">暂无数据</div>
  143. </div>
  144. <!-- loading -->
  145. <div class="loading" v-if="newRapirLoading">
  146. <cube-loading :size="30"></cube-loading>
  147. </div>
  148. </div>
  149. <!-- 最新公告 -->
  150. <div class="newNotice">
  151. <div class="titHead titHead1">
  152. <span class="tit"
  153. ><i class="iconfont icon-message newNoticeico"></i
  154. ><span>最新公告</span></span
  155. >
  156. <span class="link" @click="toNoticeList()"
  157. >更多<i class="iconfont icon-moren"></i
  158. ></span>
  159. </div>
  160. <div class="conentBox" v-if="!newNoticeNoData && !newNoticeLoading">
  161. <div
  162. class="conent"
  163. v-for="v in noticeData"
  164. @click="toNoticeDetails(v)"
  165. >
  166. <div class="head">
  167. <!-- <span>{{v.title}}</span> -->
  168. {{ v.title }}
  169. </div>
  170. <div class="cot">
  171. {{ v.createTime }}
  172. </div>
  173. </div>
  174. </div>
  175. <!-- 无数据 -->
  176. <div class="wushuju" v-if="newNoticeNoData">
  177. <img src="./../../static/images/wugonggao.svg" alt="" />
  178. <div class="noDataFont">暂无数据</div>
  179. </div>
  180. <!-- loading -->
  181. <div class="loading" v-if="newNoticeLoading">
  182. <cube-loading :size="30"></cube-loading>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. </template>
  188. <script>
  189. import { formatDate } from "./../components/js/date.js";
  190. import { SM } from "./../http/http";
  191. export default {
  192. data() {
  193. return {
  194. loginUser: JSON.parse(localStorage.getItem("loginUser")),
  195. incidentWithConsumable: localStorage.getItem("incidentWithConsumable"),//是否绑定耗材
  196. wxIncidentWithCmdb: localStorage.getItem("wxIncidentWithCmdb"),//是否绑定资产
  197. noticeData: "", //公告列表
  198. newRapirData: "", //最新报修
  199. state: "", //流程状态
  200. newRapirNoData: false, //最新报修无数据
  201. newNoticeNoData: false,
  202. newRapirLoading: true, //最新报修loading
  203. newNoticeLoading: true //最新公告loading
  204. };
  205. },
  206. methods: {
  207. scan(){
  208. SM(this).then((ress1) => {
  209. this.$router.push({name:'Repair',params:{data:ress1}});
  210. })
  211. },
  212. // 获取公告列表数据
  213. getNoticData() {
  214. var that = this;
  215. this.$http
  216. .post("service/user/data/fetchDataList/notice", {
  217. idx: 0,
  218. sum: 3,
  219. notice: {
  220. status: 1
  221. }
  222. })
  223. .then(function(res) {
  224. that.newNoticeLoading = false;
  225. if (res.data.list.length > 0) {
  226. that.newNoticeNoData = false;
  227. that.noticeData = res.data.list;
  228. } else {
  229. that.newNoticeNoData = true;
  230. }
  231. });
  232. },
  233. // 获取最新报修
  234. getNewRapir() {
  235. var that = this;
  236. this.$http
  237. .post("service/apply/bpm/fetchServiceTasks", {
  238. assignee: that.loginUser.account,
  239. idx: 0,
  240. sum: 1
  241. })
  242. .then(function(res) {
  243. that.newRapirLoading = false;
  244. if (res.data.data.length > 0) {
  245. that.newRapirNoData = false;
  246. that.newRapirData = res.data.data;
  247. that.newRapirData[0].createTime = formatDate(
  248. new Date(that.newRapirData[0].createTime),
  249. "MM-dd hh:mm"
  250. );
  251. if (that.newRapirData[0].state.name == "未受理" || that.newRapirData[0].state.name == "未受理") {
  252. that.state = 1;
  253. } else if (that.newRapirData[0].state.name == "已转换") {
  254. that.state = 2;
  255. } else if (that.newRapirData[0].state.name == "处理中") {
  256. that.state = 3;
  257. } else if (that.newRapirData[0].state.name == "待评价") {
  258. that.state = 4;
  259. } else if (that.newRapirData[0].state.name == "已解决") {
  260. that.state = 5;
  261. } else {
  262. that.state = 5;
  263. }
  264. if (
  265. that.newRapirData[0].incident.state &&
  266. that.newRapirData[0].incident.state.name
  267. ) {
  268. if (that.newRapirData[0].incident.state.name == "待接单") {
  269. that.state = 3;
  270. } else if (that.newRapirData[0].incident.state.name == "处理中") {
  271. that.state = 3;
  272. }
  273. }
  274. console.log(that.state);
  275. } else {
  276. that.newRapirNoData = true;
  277. }
  278. });
  279. },
  280. toRapir() {
  281. this.$router.push({name:'Repair',params:{data:''}});
  282. },
  283. toNoticeDetails(data) {
  284. this.$router.push({
  285. name: "NoticeDetails",
  286. params: {
  287. data: JSON.stringify(data)
  288. }
  289. });
  290. // this.$router.push({
  291. // name:'NoticeDetails',
  292. // params:{
  293. // data:data
  294. // }
  295. // })
  296. },
  297. toNoticeList() {
  298. this.$router.push({ path: "/noticeList" });
  299. },
  300. toIncidentList() {
  301. this.$router.push({ path: "/main/incidentList" });
  302. },
  303. toKnowList() {
  304. this.$router.push({ path: "/knowList" });
  305. },
  306. toCheckNumber() {
  307. this.$router.push({ path: "/checkNumber" });
  308. },
  309. toChangePassword() {
  310. this.$router.push({ path: "/changePassword" });
  311. },
  312. toGuide() {
  313. this.$router.push({ path: "/guide" });
  314. },
  315. toIncidentDetails(data) {
  316. this.$router.push({
  317. name: "IncidentDetails",
  318. params: {
  319. data: JSON.stringify(data)
  320. }
  321. });
  322. }
  323. },
  324. created() {
  325. this.getNoticData(), this.getNewRapir();
  326. },
  327. mounted() {}
  328. };
  329. </script>
  330. <style scoped>
  331. .bgColor {
  332. background-color: white;
  333. }
  334. .fle {
  335. display: flex;
  336. flex-direction: column;
  337. background-color: white;
  338. }
  339. .bigBody {
  340. display: flex;
  341. flex-direction: column;
  342. height: 100%;
  343. width: 100%;
  344. }
  345. /* 头部导航栏 */
  346. .tav {
  347. height: 2rem;
  348. background: linear-gradient(#005395, #226ca8, #003057);
  349. display: flex;
  350. width: 100%;
  351. }
  352. .tav div {
  353. flex: 1;
  354. text-align: center;
  355. display: flex;
  356. flex-direction: column;
  357. align-items: center;
  358. justify-content: center;
  359. }
  360. .tav div i {
  361. font-size: 0.6rem;
  362. color: white;
  363. }
  364. .tav div span {
  365. font-size: 0.32rem;
  366. color: white;
  367. display: inline-block;
  368. margin-top: 0.16rem;
  369. }
  370. /* .bigBody{
  371. height: auto;
  372. } */
  373. /* tit导航 */
  374. .titHead {
  375. display: flex;
  376. justify-content: space-between;
  377. padding: 0 0.24rem;
  378. height: 0.88rem;
  379. line-height: 0.88rem;
  380. border-bottom: 0.01rem rgb(238, 238, 238) solid;
  381. }
  382. .titHead1 {
  383. height: 1rem;
  384. }
  385. .titHead .tit .newPapir {
  386. font-size: 0.36rem;
  387. color: #a37200;
  388. }
  389. .titHead .tit .newNoticeico {
  390. font-size: 0.36rem;
  391. color: #005395;
  392. }
  393. .titHead .tit span {
  394. display: inline-block;
  395. margin-left: 0.08rem;
  396. font-size: 0.36rem;
  397. }
  398. .titHead .link {
  399. font-size: 0.24rem;
  400. color: #999999;
  401. }
  402. .titHead .link i {
  403. font-size: 0.24rem;
  404. color: #999999;
  405. display: inline-block;
  406. margin-left: 0.08rem;
  407. }
  408. /* 最新报修 */
  409. .newRepair {
  410. border-top: 0.16rem rgb(238, 238, 238) solid;
  411. }
  412. .newRepair .conentBox {
  413. padding: 0 0.16rem;
  414. height: auto;
  415. }
  416. .newRepair .conentBox .conent {
  417. padding: 0.24rem 0.48rem;
  418. }
  419. .newRepair .conentBox .conent .head {
  420. height: 0.45rem;
  421. line-height: 0.45rem;
  422. }
  423. .newRepair .conentBox .conent .head span:nth-child(1) {
  424. float: left;
  425. font-size: 0.32rem;
  426. font-weight: 400;
  427. color: #333333;
  428. }
  429. .newRepair .conentBox .conent .head span:nth-child(2) {
  430. float: right;
  431. font-size: 0.23rem;
  432. color: #999999;
  433. }
  434. .newRepair .conentBox .conent .cot {
  435. font-size: 0.28rem;
  436. color: #666666;
  437. line-height: 0.39rem;
  438. margin-top: 0.08rem;
  439. display: -webkit-box;
  440. -webkit-line-clamp: 2;
  441. -webkit-box-orient: vertical;
  442. word-break: break-all;
  443. overflow: hidden;
  444. }
  445. .newRepair .conentBox .flowChart {
  446. border-top: 0.01rem rgb(238, 238, 238) solid;
  447. padding: 0.24rem 0;
  448. }
  449. .newRepair .conentBox .flowChart .pits {
  450. display: flex;
  451. margin-top: 0.24rem;
  452. padding: 0 10%;
  453. position: relative;
  454. }
  455. .newRepair .conentBox .flowChart .pits i {
  456. font-size: 0.3rem;
  457. }
  458. .newRepair .conentBox .flowChart .pits div {
  459. border-top: 0.03rem rgb(224, 222, 222) solid;
  460. flex: 1;
  461. }
  462. .newRepair .conentBox .flowChart .pits .yesLine {
  463. border-top: 0.03rem rgb(1, 85, 157) solid;
  464. }
  465. .newRepair .conentBox .flowChart .pits .no {
  466. color: #cccccc;
  467. }
  468. .newRepair .conentBox .flowChart .pits .yes {
  469. color: #005359;
  470. }
  471. .newRepair .conentBox .flowChart .pits .now {
  472. color: #48a843;
  473. }
  474. .newRepair .conentBox .flowChart .pits .shenqing {
  475. position: absolute;
  476. left: 8%;
  477. top: -0.12rem;
  478. }
  479. .newRepair .conentBox .flowChart .pits .shouli {
  480. position: absolute;
  481. left: 28%;
  482. top: -0.12rem;
  483. }
  484. .newRepair .conentBox .flowChart .pits .chuli {
  485. position: absolute;
  486. left: 48%;
  487. top: -0.12rem;
  488. }
  489. .newRepair .conentBox .flowChart .pits .pingjia {
  490. position: absolute;
  491. left: 68%;
  492. top: -0.12rem;
  493. }
  494. .newRepair .conentBox .flowChart .pits .wancheng {
  495. position: absolute;
  496. left: 88%;
  497. top: -0.12rem;
  498. }
  499. .newRepair .conentBox .flowChart .words {
  500. display: flex;
  501. margin-top: 0.3rem;
  502. }
  503. .newRepair .conentBox .flowChart .words div {
  504. flex: 1;
  505. font-size: 0.32rem;
  506. text-align: center;
  507. color: #333333;
  508. }
  509. /* 最新公告 */
  510. .newNotice {
  511. border-top: 0.16rem rgb(238, 238, 238) solid;
  512. height: 100%;
  513. display: flex;
  514. flex-direction: column;
  515. min-height: 0;
  516. }
  517. .newNotice .conentBox {
  518. height: 100%;
  519. overflow: hidden;
  520. overflow-y: scroll;
  521. }
  522. .newNotice .conentBox .conent {
  523. padding: 0.24rem 0.64rem;
  524. border-bottom: 0.01rem rgb(238, 238, 238) solid;
  525. }
  526. .newNotice .conentBox .conent .head {
  527. line-height: 0.45rem;
  528. display: -webkit-box;
  529. -webkit-line-clamp: 2;
  530. -webkit-box-orient: vertical;
  531. word-break: break-all;
  532. overflow: hidden;
  533. font-size: 0.32rem;
  534. }
  535. /* .newNotice .conentBox .conent .head span{
  536. font-size: .32rem;
  537. } */
  538. .newNotice .conentBox .conent .cot {
  539. font-size: 0.24rem;
  540. color: #999999;
  541. line-height: 0.34rem;
  542. margin-top: 0.08rem;
  543. }
  544. .wushuju {
  545. text-align: center;
  546. }
  547. .wushuju img {
  548. width: 5.12rem;
  549. height: 2.84rem;
  550. }
  551. .loading {
  552. height: 2rem;
  553. display: flex;
  554. justify-content: center;
  555. align-items: center;
  556. }
  557. </style>