works.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. <template>
  2. <div class="index-container">
  3. <nav-bar :leftArrow="false"></nav-bar>
  4. <weather-box @tabsClassChange="tabsClassChange"></weather-box>
  5. <!-- 步骤条 -->
  6. <van-tabs :class="tabsClass" color="#008cd6" @click="tabClickHandler" v-if="workList && workList.length > 0">
  7. <van-tab
  8. :title="i.taskTypeText"
  9. :name="worksLink(1, i.taskType)"
  10. v-for="i in workList"
  11. :key="i.taskType"
  12. :badge="i.nums"
  13. >
  14. <template v-for="item in workList">
  15. <!-- 列表 -->
  16. <div class="cellMargin" v-if="item.taskType == i.taskType" :key="item.taskType">
  17. <!-- 标题区域 -->
  18. <!-- lz -->
  19. <van-cell
  20. :value="item.nums"
  21. is-link
  22. :to="{ path: worksLink(3, item.taskType) }"
  23. :id="worksLink(1, item.taskType)"
  24. >
  25. <!-- 使用 title 插槽来自定义标题 -->
  26. <template #title>
  27. <span class="titleLeft"> </span>
  28. <span class="custom-title">{{ item.taskTypeText }} </span>
  29. </template>
  30. </van-cell>
  31. <!-- 待办区域 -->
  32. <div class="marginCls" v-if="item.taskType == i.taskType">
  33. <!-- <van-empty description="暂无数据" /> -->
  34. <van-cell-group v-if="item.taskType!=2">
  35. <van-cell
  36. @click.stop="isFalgHandler(i, item.taskType, item.id)"
  37. v-for="(i, index) in item.dataList"
  38. :key="index"
  39. class="mainTitle"
  40. :value="worksLink(2, item.taskType, i.recStatus ? i.recStatus : i.status)"
  41. :label="
  42. i.startTime.substring(5, i.startTime.length - 3) +
  43. '至' +
  44. i.endTime.substring(5, i.endTime.length - 3)
  45. "
  46. :value-class="iColorClas(item.taskType, i.status)"
  47. >
  48. <template #title>
  49. <span class="custom-title">{{ i.taskName }}
  50. <!-- <van-tag
  51. class="resetDy"
  52. @click.stop="resetHandler(i.id)"
  53. v-if="i.status == 1 && item.taskType == 3"
  54. type="primary"
  55. >重新调阅</van-tag
  56. >-->
  57. </span>
  58. <div class="org-name-class">
  59. {{ i.orgName}}
  60. </div>
  61. </template>
  62. <template #right-icon>
  63. <van-icon name="arrow" class="rightIcon"/>
  64. </template>
  65. </van-cell>
  66. </van-cell-group>
  67. <van-collapse v-if="item.taskType==2" class="check-register list-item" v-model="activeNames">
  68. <van-collapse-item :name="v.id+i" v-for="(v,i) in item.dataList" :key="v.id+i">
  69. <template #title>
  70. <div class="item-title">
  71. <!-- <div class="textTitle">{{ v.taskName}}</div> -->
  72. <van-cell :title="v.taskName" :border="false" :label="v.startTime.substring(5, v.startTime.length - 3) +
  73. '至' +
  74. v.endTime.substring(5, v.endTime.length - 3)"></van-cell>
  75. <div class="collapse-title">
  76. <div :class="{'active':v.active==2}">
  77. <p>{{ v.uncompleted.length }}</p>
  78. </div>
  79. <!-- <div :class="{'active':v.active==1}" @click.stop="changeList(v,1)">
  80. <p>{{v.completed.length}}</p>
  81. <p>已检查</p>
  82. </div> -->
  83. </div>
  84. </div>
  85. </template>
  86. <div class="check-item-list">
  87. <van-cell
  88. v-for="(a,index) in v.uncompleted" :key="a.id"
  89. :title="a.orgName"
  90. @click.stop="isFalgHandler(a, item.taskType, item.id)">
  91. <template #right-icon>
  92. <div>
  93. <span :class="iColorClas(item.taskType, a.status)">
  94. {{ worksLink(2, item.taskType, a.recStatus ? a.recStatus : a.status) }}
  95. </span>
  96. </div>
  97. </template>
  98. </van-cell>
  99. </div>
  100. </van-collapse-item>
  101. </van-collapse>
  102. </div>
  103. </div>
  104. </template>
  105. </van-tab>
  106. </van-tabs>
  107. <!-- 扫描弹框 -->
  108. <scandialog ref="scandialog" @input="resultImg" @changeNFC="getNFC"></scandialog>
  109. </div>
  110. </template>
  111. <script>
  112. import scandialog from '@/components/nfcPopup/alone.vue'
  113. import TopBar from '@/components/TopBar'
  114. import WeatherBox from "@/components/weatherBox/index.vue";
  115. import {Toast, Dialog} from 'vant'
  116. import {base64ToBlob} from '@/utils/base64TurnImg.js'
  117. import {registration, resetTask,getMonitorStart} from '@/api/toConsult.js'
  118. import {upload} from '@/api/public'
  119. import {getPanelList} from '@/api/drillTask.js'
  120. export default {
  121. name: 'works',
  122. components: {TopBar, scandialog, WeatherBox},
  123. data() {
  124. return {
  125. big_box: 'big_box',
  126. active: 0,
  127. tabsClass: 'tab-tabs',
  128. taskId: '', //监控调阅ID
  129. workList: [], //工作台列表
  130. oldScrollTop: '',
  131. falg: false, //待调阅的时候 不进行跳转页面单独处理
  132. activeNames: [],
  133. }
  134. },
  135. mounted() {
  136. if (this.orgId) {
  137. this.$refs.topbar.getTheWeather()
  138. }
  139. // if (this.$refs.topbar.list?.length > 0) {
  140. // this.big_box = 'big_boxTwo'
  141. // }
  142. },
  143. created() {
  144. this.getList()
  145. },
  146. methods: {
  147. tabsClassChange(str) {
  148. this.tabsClass = str || 'tab-tabs'
  149. },
  150. iColorClas(type, status) {
  151. if (status == 0 || (type == 9 && status == 1) || (type == 9 && status == 10) || (type == 0 && status == 1) || (type == 2 && status == 1)) {
  152. return 'wj-title-blue'
  153. } else if (type == 9 && status == 13) {
  154. return 'wj-title-red'
  155. } else {
  156. return 'wj-title-orange'
  157. }
  158. },
  159. isFalgHandler(i, taskType, id) {
  160. // if (i.isExist != undefined && i.isExist == 0) {
  161. // return Dialog.alert({
  162. // message: '机构下没有主机摄像头,不能开启调阅任务!',
  163. // confirmButtonText: '关闭'
  164. // })
  165. // }
  166. //如果当前是待调阅任务 当前页面处理之后再跳转 不是则正常跳转
  167. if (taskType == 3) {
  168. let obj = {taskId: i.id}
  169. getMonitorStart(obj).then(res => {
  170. let {code, data, msg} = res
  171. let dayNums = data.dayNums;
  172. let noComplete = data.noComplete;
  173. if (noComplete > 0) {
  174. this.falg = true
  175. this.$router.push({path: this.worksLink(4, taskType, i.status, i.id, i)})
  176. } else {
  177. if (dayNums >= 5) {
  178. //提醒确认
  179. Dialog.confirm({
  180. title: '提示',
  181. message: `当前调阅任务今日调阅已达到${dayNums}次,是否继续调阅?`,
  182. }).then(() => {
  183. this.falg = false
  184. this.taskId = i.id
  185. this.$refs.scandialog.visible = true
  186. this.globalLoading = true
  187. })
  188. } else {
  189. this.falg = false
  190. this.taskId = i.id
  191. this.$refs.scandialog.visible = true
  192. this.globalLoading = true
  193. }
  194. }
  195. })
  196. } else {
  197. this.falg = true
  198. this.$router.push({path: this.worksLink(4, taskType, i.status, i.id, i)})
  199. }
  200. },
  201. getList() {
  202. getPanelList().then(res => {
  203. let {data, code, msg} = res
  204. this.workList = data
  205. })
  206. },
  207. worksLink(type, val, taskType = '', id = '', item) {
  208. //type 列表类型区分 //val 类型值 //taskType 具体列表项区分 //id 任务id
  209. let str = ''
  210. let strName = ''
  211. let path = ''
  212. let pathInfo = ''
  213. switch (val) {
  214. case 0:
  215. str = '/lz'
  216. strName = '待履职'
  217. path = '/resumption'
  218. pathInfo = `/resumption_detail`
  219. break
  220. case 3:
  221. str = '/dy'
  222. strName = '待调阅'
  223. path = '/monitoringCall'
  224. pathInfo = '/consultInfo_' + id
  225. break
  226. case 2:
  227. strName = '待检查'
  228. path = '/securityCheckRegister'
  229. pathInfo = '/securityDetail' + id
  230. str = '/jc'
  231. break
  232. case 4:
  233. str = '/yl'
  234. strName = '待登记'
  235. path = '/rehearsalTask'
  236. pathInfo = '/addRehearsalTask/' + id
  237. break
  238. case 5:
  239. str = '/px'
  240. strName = '待登记'
  241. path = '/training'
  242. pathInfo = '/Addtraining/' + id
  243. break
  244. case 7:
  245. str = '/py'
  246. strName = '待评优'
  247. path = '/rehearsaloptimal'
  248. pathInfo = '/commentSign/' + id
  249. break
  250. case 8:
  251. str = '/wbpj'
  252. strName = '待评价'
  253. path = '/resumptionEvaluate'
  254. pathInfo = '/evaluate/' + id + '_add'
  255. break
  256. case 9:
  257. str = '/wtzg'
  258. strName = '待确认'
  259. path = '/problemItem'
  260. pathInfo = '/problemDetail?id=' + id + '&type=confirm'
  261. break
  262. case '/qt':
  263. str = '/qt'
  264. case 10:
  265. str = '/lfsp'
  266. strName = '待审批'
  267. path = '/visitCheck'
  268. pathInfo = '/visitCheckDetail?id=' + id
  269. break
  270. }
  271. if (type == 1) {
  272. return str
  273. } else if (type == 2) {
  274. //返回跳转文字
  275. //履职
  276. if (val == 0 && taskType == 2) {
  277. strName = '进行中'
  278. }
  279. //安全检查
  280. if (val == 2 && taskType == 2) {
  281. strName = '进行中'
  282. }
  283. //监控调阅
  284. if (val == 3 && taskType == 1) {
  285. strName = '调阅中'
  286. }
  287. //演练登记
  288. if (val == 4 && taskType == 2) {
  289. strName = '待评价'
  290. } else if (val == 4 && taskType == 1) {
  291. strName = '待签名'
  292. } else if (val == 4 && taskType == 5) {
  293. strName = '待提交'
  294. } else if (val == 4 && taskType == 10) {
  295. strName = '待评优'
  296. }
  297. //教育培训
  298. if (val == 5 && taskType == 0) {
  299. strName = '待登记'
  300. } else if (val == 5 && taskType == 1) {
  301. strName = '待签名'
  302. } else if (val == 5 && taskType == 4) {
  303. strName = '待提交'
  304. }
  305. //问题整改
  306. if (val == 9 && taskType == 0) {
  307. strName = '待确认'
  308. } else if (val == 9 && taskType == 10) {
  309. strName = '待整改'
  310. } else if (val == 9 && taskType == 13) {
  311. strName = '已逾期'
  312. } else if (val == 9 && taskType == 1) {
  313. strName = '待审批'
  314. }
  315. return strName
  316. } else if (type == 3) {
  317. //返回列表路径
  318. return path
  319. } else {
  320. //返回详情路径
  321. //问题整改
  322. if (val == 9 && taskType == 1) {
  323. strName = '待审批'
  324. // pathInfo = '/consultInfo/' + id + '_1'
  325. pathInfo = '/problemDetail?id=' + id + '&type=confirmDissent'
  326. }
  327. if (val == 9 && taskType == 10) {
  328. strName = '待整改'
  329. pathInfo = '/problemDetail?id=' + id + '&type=reform'
  330. }
  331. if (val == 9 && taskType == 13) {
  332. strName = '已逾期'
  333. pathInfo = '/problemDetail?id=' + id + '&type=reform'
  334. }
  335. //监控调阅
  336. if (val == 3 && taskType == 1) {
  337. strName = '调阅中'
  338. pathInfo = '/consultInfo/' + id + '_1'
  339. }
  340. //演练登记评价跳转
  341. if (val == 4 && taskType == 2) {
  342. pathInfo = '/rehearsalTasinfo/' + id + '_evaluate'
  343. }
  344. //演练登记签名跳转
  345. if (val == 4 && taskType == 1) {
  346. pathInfo = '/rehearsalTaskSign/' + id + '_edit'
  347. }
  348. //评优推优跳转
  349. if (val == 7 && taskType == 10) {
  350. pathInfo = '/commentSign/' + id + '_comment'
  351. }
  352. //教育培训签名跳转
  353. if (val == 5 && taskType == 1) {
  354. pathInfo = '/personnelSignature/' + id + '_edit'
  355. }
  356. //安全检查跳转
  357. if ((val == 2 && taskType == 1) || (val == 2 && taskType == 2)) {
  358. pathInfo = `/securityAdd?id=${id}&enable=${taskType}`
  359. }
  360. //履职跳转
  361. if ((val == 0 && taskType == 1) || (val == 0 && taskType == 2)) {
  362. pathInfo = `/resumption_detail?id=${id}&enable=${taskType}&taskDate=${item.startTime.split(' ')[0]}
  363. `
  364. }
  365. return pathInfo
  366. }
  367. },
  368. //监控调阅待调阅弹框处理
  369. //文件上传
  370. resultImg(img) {
  371. this.photoHandler(img[0].url)
  372. },
  373. //上传NFC
  374. getNFC(nfc) {
  375. this.photoHandler('', nfc)
  376. },
  377. //扫描图片并上传到服务器和后端
  378. photoHandler(img = '', nfc = '') {
  379. //上传到服务器
  380. //开始调阅上传
  381. let obj = {
  382. startPicture: img,
  383. startNfc: nfc,
  384. taskId: this.taskId,
  385. monitorFlag: 0
  386. }
  387. registration(obj).then(res => {
  388. let {code, data, msg} = res
  389. if (code == 200) {
  390. Toast.success('扫描成功')
  391. this.$router.push('/consultInfo/' + this.taskId)
  392. }
  393. })
  394. },
  395. //tab栏点击
  396. tabClickHandler(name) {
  397. // const filePath = `/#${name}`
  398. // const tempLink = document.createElement('a')
  399. // tempLink.style.display = 'none'
  400. // tempLink.href = filePath
  401. // tempLink.setAttribute('target', '_self')
  402. // document.body.appendChild(tempLink)
  403. // tempLink.click()
  404. // document.body.removeChild(tempLink)
  405. },
  406. //重新调阅
  407. resetHandler(id) {
  408. Dialog.confirm({
  409. title: '提示',
  410. message: '确认要对该任务进行重新调阅吗?'
  411. }).then(() => {
  412. resetTask(id).then(res => {
  413. if (res.code == 200) {
  414. Toast.success('初始化任务成功')
  415. this.getList()
  416. }
  417. })
  418. })
  419. }
  420. },
  421. beforeDestroy() {
  422. window.removeEventListener('scroll', this.scrolling)
  423. }
  424. }
  425. </script>
  426. <style>
  427. .van-info {
  428. right: -12px;
  429. }
  430. .org-name-class {
  431. margin-top: 1.066667vw;
  432. color: #969799;
  433. font-size: 3.2vw;
  434. line-height: 4.8vw;
  435. }
  436. </style>
  437. <style lang="scss" scoped>
  438. .van-cell__right-icon {
  439. }
  440. .van-cell::after {
  441. background-color: #008cd6;
  442. }
  443. .titleLeft {
  444. display: inline-block;
  445. width: 8px;
  446. height: 40px;
  447. background-color: #008cd6;
  448. vertical-align: middle;
  449. margin-right: 10px;
  450. }
  451. .van-cell__title {
  452. color: #008cd6;
  453. }
  454. ::v-deep.van-cell__value {
  455. // width: 20%;
  456. float: right;
  457. display: -webkit-flex;
  458. -webkit-flex: none;
  459. flex: none;
  460. }
  461. .mainTitle {
  462. .van-cell__title {
  463. color: black;
  464. }
  465. }
  466. .cellMargin {
  467. margin: 20px;
  468. -margin-top: 0px;
  469. height: calc(100vh - 412px);
  470. box-shadow: 0 1px 4px #ccc;
  471. background-color: #fff;
  472. overflow-y: scroll;
  473. }
  474. .marginCls {
  475. min-height: 400px;
  476. width: 100%;
  477. background-color: #fff;
  478. // overflow-y: scroll;
  479. }
  480. .empty {
  481. width: 100%;
  482. height: 100%;
  483. box-sizing: border-box;
  484. }
  485. .index-container {
  486. }
  487. .big_box {
  488. height: calc(100vh - 520px);
  489. overflow: auto;
  490. }
  491. .tab-tabs {
  492. padding-top: 90px;
  493. }
  494. .tabs-padding-none {
  495. padding-top: 0px;
  496. }
  497. .big_boxTwo {
  498. height: calc(100vh - 570px);
  499. overflow: auto;
  500. }
  501. a {
  502. text-decoration: none;
  503. color: inherit;
  504. margin-right: 10px;
  505. }
  506. .rightIcon {
  507. color: #969799;
  508. line-height: 46px;
  509. font-size: 40px;
  510. }
  511. .van-collapse-item {
  512. ::v-deep .van-cell {
  513. align-items: center;
  514. }
  515. .van-collapse-item__title {
  516. .van-cell__title {
  517. .item-title {
  518. ::v-deep .van-cell {
  519. padding: 0px 0px 0px 0px !important;
  520. }
  521. }
  522. }
  523. }
  524. ::v-deep .van-cell__title {
  525. color: black !important;
  526. // padding:10px 5px 10px 5px !important;
  527. }
  528. }
  529. .check-register {
  530. .org-line {
  531. padding: 0 10px;
  532. background-color: #fff;
  533. }
  534. .search-flex {
  535. display: flex;
  536. align-items: center;
  537. justify-content: space-between;
  538. border-bottom: 1px solid #f5f5f5;
  539. > div {
  540. width: 50%;
  541. }
  542. }
  543. .org-label {
  544. height: 90px;
  545. width: 100%;
  546. display: flex;
  547. align-items: center;
  548. font-size: 28px;
  549. }
  550. .card-list {
  551. padding: 0 5px 0px 5px;
  552. height: calc(100vh - 370px);
  553. overflow: auto;
  554. }
  555. .list-item {
  556. margin: 20px 0px 20px 0px;
  557. // padding:20 0px 20px 0px;
  558. }
  559. .item-title {
  560. width: 100%;
  561. display: flex;
  562. justify-content: space-between;
  563. // border-bottom: 1px solid #f5f5f5;
  564. padding-bottom: 10px;
  565. }
  566. .check-item-list {
  567. -max-height: 500px;
  568. overflow: auto;
  569. }
  570. .card-num {
  571. display: flex;
  572. align-items: center;
  573. font-size: 28px;
  574. color: #008cd6;
  575. }
  576. .collapse-title {
  577. width: 10%;
  578. margin-left: 10px;
  579. float: right;
  580. display: -webkit-flex;
  581. // display: flex;
  582. align-items: center;
  583. justify-content: space-between;
  584. font-size: 28px;
  585. color: #ccc;
  586. > div {
  587. width: 100px;
  588. font-size: 24px;
  589. height: 90px;
  590. padding: 5px 10px;
  591. // border: 2px solid #ccc;
  592. // border-radius: 10px;
  593. // box-shadow: 0 3px 6px #eaeaea;
  594. > p {
  595. height: 90px;
  596. line-height: 90px;
  597. text-align: center;
  598. }
  599. }
  600. > div {
  601. color: #969799;
  602. // background-color: #008cd6;
  603. // border: 3px solid #008cd6;
  604. }
  605. }
  606. .flex-box {
  607. display: flex;
  608. align-items: center;
  609. > div {
  610. margin-right: 40px;
  611. }
  612. }
  613. .search-box {
  614. display: flex;
  615. justify-content: space-between;
  616. align-items: center;
  617. > div {
  618. width: 50%;
  619. }
  620. }
  621. }
  622. </style>