safetyCheck.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <!-- 计划详情 -->
  2. <template>
  3. <view class="planDetail">
  4. <view class="header">
  5. <img class="header-bg" src="@/pages_safetyCheck/images/img_banner@1x.png">
  6. <view class="tabTitle">
  7. <view class="tabTitle_li" @tap="tabClick(index)" :key="index" v-for="(item,index) in tabText">
  8. <view class="tabTitle_text">
  9. <img :src="item.img">
  10. <view
  11. :id="curTab==index && curTab==0?'fontColor-A':(curTab==index && curTab==1?'fontColor-B':'')">
  12. {{item.name}}
  13. </view>
  14. <view>{{item.title}}</view>
  15. </view>
  16. <view class="line"></view>
  17. <view :class="{on:curTab==index}" class="tabTitle_across">
  18. <img src="@/pages_safetyCheck/images/img_xyzc_bg@1x.png">
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <!-- 列表部分 -->
  24. <scroll-view scroll-y @scrolltolower="scrollGet" class="for-max-box">
  25. <view class="list">
  26. <view class="list-li" @click="planClick(item)" v-for="(item,index) in dataList">
  27. <img src="@/pages_safetyCheck/images/icon_aqjc_jh@1x.png">
  28. <view>{{item.planTitle}}</view>
  29. <img src="@/pages_safetyCheck/images/icon_wd_gd@1x.png">
  30. </view>
  31. </view>
  32. <view class="get-data-p" v-if="!getDataType">
  33. <img class="get-data-img" src="@/pages_safetyCheck/images/icon_aqjc_sl.png">
  34. <view class="get-data-text">上拉加载</view>
  35. </view>
  36. <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
  37. </scroll-view>
  38. <!-- 弹窗部分 -->
  39. <view class="shade" v-if="dialogVisible">
  40. <view class="null-box" @click="dialogClose()"></view>
  41. <view class="shade_n">
  42. <view class="title">
  43. <view>检查批次</view>
  44. <img src="@/pages_safetyCheck/images/icon_06.png">
  45. </view>
  46. <view class="batch">
  47. <view class="batch-li" @click="batchClick(item)" v-for="(item,index) in batchList.checkPlanSetVoList">
  48. <view class="batch-li-l">
  49. <text>{{item.checkName}}</text>
  50. <text>开始检查日期:{{item.checkStartTime}}</text>
  51. </view>
  52. <view class="batch-li-r">检查进度{{item.checkSetProgress}}%
  53. <img src="@/pages_safetyCheck/images/icon_wd_gd@1x.png">
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import {
  63. config
  64. } from '@/api/request/config.js'
  65. import {
  66. securityAppCheckPlanTitleList,
  67. } from '@/pages_safetyCheck/api/index.js'
  68. export default {
  69. name: "planDetail",
  70. components: {
  71. },
  72. data() {
  73. return {
  74. baseUrl: config.base_url,
  75. pageType: 0,
  76. tabText: [{
  77. name: '校级检查',
  78. title: '学校检查计划',
  79. img: require('@/pages_safetyCheck/images/icon_aqjc_xjjc@1x.png'),
  80. },
  81. {
  82. name: '学院自查',
  83. title: '学院自查计划',
  84. img: require('@/pages_safetyCheck/images/icon_aqjc_xxzc@1x.png'),
  85. },
  86. // {
  87. // name: '现场检查',
  88. // title: '检查隐患草稿',
  89. // img: require('@/pages_safetyCheck/images/icon_aqjc_xcjc@1x.png'),
  90. // },
  91. {
  92. name: '随手拍',
  93. title: '隐患上报整改',
  94. img: require('@/pages_safetyCheck/images/icon_aqjc_ssp@1x.png'),
  95. },
  96. ],
  97. //校级/院级
  98. curTab: 0,
  99. queryParams: {
  100. page: 1,
  101. pageSize: 20,
  102. checkCategory:1,//1校院巡查 2学院自查
  103. },
  104. total: 0,
  105. dataList: [],
  106. getDataType: false,
  107. dialogVisible: false,
  108. batchList: [],
  109. batchData:{},
  110. }
  111. },
  112. onLoad(option) {
  113. },
  114. onShow() {
  115. },
  116. mounted() {
  117. this.getList()
  118. },
  119. methods: {
  120. //滚动加载事件
  121. scrollGet() {
  122. let self = this;
  123. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  124. this.$set(this, 'getDataType', true);
  125. } else {
  126. this.queryParams.page += 1;
  127. this.$nextTick(() => {
  128. this.getList();
  129. })
  130. }
  131. },
  132. //顶部tab点击
  133. tabClick(index) {
  134. if (this.curTab != index) {
  135. if (index == 0) {
  136. //校级检查
  137. this.$set(this, 'curTab', index);
  138. this.$set(this.queryParams, 'checkCategory', 1);
  139. this.getList()
  140. } else if (index == 1) {
  141. //学院自查
  142. this.$set(this, 'curTab', index);
  143. this.$set(this.queryParams, 'checkCategory', 2);
  144. this.getList()
  145. } else if (index == 2) {
  146. //随手拍
  147. uni.navigateTo({
  148. url: "/pages_safetyCheck/views/snapshotManage/snapshotList",
  149. });
  150. }
  151. }
  152. },
  153. //检查批次点击
  154. batchClick(row) {
  155. this.$set(this.batchData,'checkPlanSetVoList',row);
  156. this.$nextTick(()=>{
  157. uni.navigateTo({
  158. url: '/pages_safetyCheck/views/inspectManage/inspectList?infoData=' + encodeURIComponent(JSON.stringify(this.batchData))
  159. });
  160. })
  161. },
  162. planClick(row) {
  163. if(row.checkPlanSetVoList.length>1){
  164. this.$set(this,'batchData',{
  165. planId:row.planId,
  166. planTitle:row.planTitle,
  167. checkCategory:row.checkCategory,
  168. checkTypeName:row.checkTypeName,
  169. crossCheck:row.crossCheck,
  170. });
  171. this.$set(this, 'batchList', row);
  172. this.dialogVisible = true;
  173. }else{
  174. //如果只有1个检查批次不弹窗
  175. this.$set(this,'batchData',{
  176. planId:row.planId,
  177. planTitle:row.planTitle,
  178. checkCategory:row.checkCategory,
  179. checkTypeName:row.checkTypeName,
  180. crossCheck:row.crossCheck,
  181. checkPlanSetVoList:row.checkPlanSetVoList[0]
  182. });
  183. this.$nextTick(()=>{
  184. uni.navigateTo({
  185. url: '/pages_safetyCheck/views/inspectManage/inspectList?infoData=' + encodeURIComponent(JSON.stringify(this.batchData))
  186. });
  187. })
  188. }
  189. },
  190. dialogClose() {
  191. this.dialogVisible = false;
  192. },
  193. async getList() {
  194. let self = this;
  195. const {
  196. data
  197. } = await securityAppCheckPlanTitleList(this.queryParams);
  198. if (data.code == 200) {
  199. if (self.queryParams.page == 1) {
  200. this.dataList = data.data.records;
  201. this.total = data.data.total;
  202. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  203. this.$set(this, 'getDataType', true);
  204. }
  205. } else {
  206. this.dataList = [...this.dataList, ...data.data.records]
  207. this.total = data.data.total;
  208. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  209. this.$set(this, 'getDataType', true);
  210. }
  211. }
  212. }
  213. },
  214. }
  215. }
  216. </script>
  217. <style lang="stylus" scoped>
  218. .planDetail {
  219. height: 100%;
  220. display: flex;
  221. flex-direction: column;
  222. .header {
  223. width: 100%;
  224. height: 235px;
  225. // position: fixed;
  226. // top: 0rpx;
  227. // z-index: 100;
  228. .header-bg {
  229. width: 750rpx;
  230. height: 336rpx;
  231. position: absolute;
  232. }
  233. .tabTitle {
  234. width: 690rpx;
  235. height: 250rpx;
  236. background: #FFFFFF;
  237. border-radius: 20rpx 20rpx 20rpx 20rpx;
  238. display flex;
  239. justify-content: flex-start;
  240. align-items: center;
  241. position: absolute;
  242. left: 30rpx;
  243. top: 208rpx;
  244. .tabTitle_li {
  245. height: 250rpx;
  246. flex: 1;
  247. position: relative;
  248. text-align center;
  249. .line {
  250. width: 2rpx;
  251. height: 30rpx;
  252. background: #D8D8D8;
  253. border-radius: 0rpx 0rpx 0rpx 0rpx;
  254. position: absolute;
  255. top: 40%;
  256. }
  257. .tabTitle_text {
  258. display: flex;
  259. justify-content: center;
  260. flex-direction: column;
  261. align-items: center;
  262. >img {
  263. width: 80rpx;
  264. height: 80rpx;
  265. margin-top: 48rpx;
  266. }
  267. >view:nth-of-type(1) {
  268. font-size: 28rpx;
  269. color: #333333;
  270. line-height: 40rpx;
  271. text-align: left;
  272. margin-top: 8rpx;
  273. }
  274. >view:nth-of-type(2) {
  275. font-size: 22rpx;
  276. color: #666666;
  277. line-height: 30rpx;
  278. text-align: left;
  279. margin-top: 6rpx;
  280. }
  281. position: relative;
  282. &.on {}
  283. }
  284. .tabTitle_across {
  285. /* width: 50rpx;
  286. height: 4rpx;
  287. background: #0183FA;
  288. border-radius: 2rpx; */
  289. margin-left: 38%;
  290. margin-top: 37rpx;
  291. display none;
  292. >img {
  293. width: 40rpx;
  294. height: 26rpx;
  295. }
  296. &.on {
  297. display block;
  298. }
  299. }
  300. }
  301. }
  302. }
  303. .for-max-box {
  304. flex: 1;
  305. overflow-y scroll;
  306. .list {
  307. width: 690rpx;
  308. margin-left: 30rpx;
  309. background: #FFFFFF;
  310. border-radius: 20rpx 20rpx 20rpx 20rpx;
  311. .list-li:nth-child(1) {
  312. border-top: none;
  313. }
  314. .list-li {
  315. border-top: 1rpx dashed #E0E0E0;
  316. height: 80rpx;
  317. display: flex;
  318. justify-content: flex-start;
  319. align-items: center;
  320. padding: 0 30rpx;
  321. box-sizing: border-box;
  322. >view:nth-of-type(1) {
  323. flex: 1;
  324. font-size: 28rpx;
  325. color: #333333;
  326. line-height: 39rpx;
  327. text-align: left;
  328. margin: 0 52rpx 0 20rpx;
  329. overflow: hidden;
  330. text-overflow: ellipsis;
  331. white-space: nowrap;
  332. }
  333. >img:nth-of-type(1) {
  334. width: 42rpx;
  335. height: 42rpx;
  336. }
  337. >img:nth-of-type(2) {
  338. width: 24rpx;
  339. height: 24rpx;
  340. }
  341. }
  342. }
  343. .get-data-p {
  344. height: 100rpx;
  345. text-align: center;
  346. .get-data-img {
  347. width: 30rpx;
  348. height: 30rpx;
  349. margin: 0 auto;
  350. margin-top: 15rpx;
  351. }
  352. .get-data-text {
  353. text-align: center;
  354. }
  355. }
  356. .get-data-null-p {
  357. height: 100rpx;
  358. line-height: 100rpx;
  359. text-align: center;
  360. }
  361. }
  362. .shade {
  363. height: 100%;
  364. width: 100%;
  365. position: fixed;
  366. display: flex;
  367. flex-direction: column;
  368. z-index: 200;
  369. background: rgba(0, 0, 0, 0.2);
  370. .null-box {
  371. flex: 1;
  372. }
  373. .shade_n {
  374. position: absolute;
  375. bottom: 0;
  376. left: 0;
  377. width: 750rpx;
  378. height: 466rpx;
  379. background: #FFFFFF;
  380. border-radius: 20rpx 20rpx 0rpx 0rpx;
  381. overflow-y: auto;
  382. .title {
  383. display: flex;
  384. justify-content: space-between;
  385. align-items: center;
  386. padding: 0 50rpx 0 284rpx;
  387. box-sizing: border-box;
  388. border-bottom: 1rpx solid #E0E0E0;
  389. >view {
  390. font-size: 30rpx;
  391. color: #3D3D3D;
  392. line-height: 90rpx;
  393. text-align: left;
  394. }
  395. >img {
  396. width: 24rpx;
  397. height: 12rpx;
  398. }
  399. }
  400. .batch {
  401. padding: 0 30rpx;
  402. box-sizing: border-box;
  403. .batch-li {
  404. display: flex;
  405. justify-content: space-between;
  406. align-items: center;
  407. border-bottom: 1rpx solid #E0E0E0;
  408. padding: 20rpx 0 16rpx 0rpx;
  409. box-sizing: border-box;
  410. .batch-li-l {
  411. >text:nth-of-type(1) {
  412. display: block;
  413. font-size: 30rpx;
  414. color: #333333;
  415. line-height: 42rpx;
  416. text-align: left;
  417. }
  418. >text:nth-of-type(2) {
  419. display: block;
  420. font-size: 28rpx;
  421. color: #666666;
  422. line-height: 39rpx;
  423. text-align: left;
  424. margin-top: 6rpx;
  425. }
  426. }
  427. .batch-li-r {
  428. font-size: 28rpx;
  429. color: #666666;
  430. line-height: 39rpx;
  431. text-align: left;
  432. display: flex;
  433. justify-content: flex-start;
  434. align-items: center;
  435. >img {
  436. width: 24rpx;
  437. height: 24rpx;
  438. margin-left: 9rpx;
  439. }
  440. }
  441. }
  442. }
  443. }
  444. }
  445. #fontColor-A {
  446. color: #0040C1;
  447. }
  448. #fontColor-B {
  449. color: #009519;
  450. }
  451. #bgColor-A {
  452. color: #0183FA;
  453. background: rgba(1, 131, 250, 0.2);
  454. }
  455. #bgColor-B {
  456. color: #16B531;
  457. background: rgba(22, 181, 49, 0.2);
  458. }
  459. }
  460. </style>