safetyCheck.vue 10 KB

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