indes.vue 16 KB

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