works.vue 16 KB

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