safetyCheck.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  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(batchList.checkPlanSetVoList)" v-for="(item,index) in batchList.checkPlanSetVoList">
  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. if(row.checkPlanSetVoList.length>1){
  162. this.dialogVisible = true;
  163. this.$set(this, 'batchList', row);
  164. }else{
  165. //如果只有1个检查批次不弹窗
  166. let infoData = row;
  167. infoData.pageType = this.curTab;
  168. uni.navigateTo({
  169. url: '/pages_safetyCheck/views/inspectManage/inspectList?infoData=' + encodeURIComponent(JSON
  170. .stringify(
  171. infoData))
  172. });
  173. }
  174. },
  175. dialogClose() {
  176. this.dialogVisible = false;
  177. },
  178. async getList() {
  179. let self = this;
  180. const {
  181. data
  182. } = await securityAppCheckPlanTitleList(this.queryParams);
  183. if (data.code == 200) {
  184. if (self.queryParams.page == 1) {
  185. this.dataList = data.data.records;
  186. this.total = data.data.total;
  187. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  188. this.$set(this, 'getDataType', true);
  189. }
  190. } else {
  191. this.dataList = [...this.dataList, ...data.data.records]
  192. this.total = data.data.total;
  193. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  194. this.$set(this, 'getDataType', true);
  195. }
  196. }
  197. }
  198. },
  199. }
  200. }
  201. </script>
  202. <style lang="stylus" scoped>
  203. .planDetail {
  204. height: 100%;
  205. display: flex;
  206. flex-direction: column;
  207. .header {
  208. width: 100%;
  209. height: 235px;
  210. // position: fixed;
  211. // top: 0rpx;
  212. // z-index: 100;
  213. .header-bg {
  214. width: 750rpx;
  215. height: 336rpx;
  216. position: absolute;
  217. }
  218. .tabTitle {
  219. width: 690rpx;
  220. height: 250rpx;
  221. background: #FFFFFF;
  222. border-radius: 20rpx 20rpx 20rpx 20rpx;
  223. display flex;
  224. justify-content: flex-start;
  225. align-items: center;
  226. position: absolute;
  227. left: 30rpx;
  228. top: 208rpx;
  229. .tabTitle_li {
  230. height: 250rpx;
  231. flex: 1;
  232. position: relative;
  233. text-align center;
  234. .line {
  235. width: 2rpx;
  236. height: 30rpx;
  237. background: #D8D8D8;
  238. border-radius: 0rpx 0rpx 0rpx 0rpx;
  239. position: absolute;
  240. top: 40%;
  241. }
  242. .tabTitle_text {
  243. display: flex;
  244. justify-content: center;
  245. flex-direction: column;
  246. align-items: center;
  247. >img {
  248. width: 80rpx;
  249. height: 80rpx;
  250. margin-top: 48rpx;
  251. }
  252. >view:nth-of-type(1) {
  253. font-size: 28rpx;
  254. color: #333333;
  255. line-height: 40rpx;
  256. text-align: left;
  257. margin-top: 8rpx;
  258. }
  259. >view:nth-of-type(2) {
  260. font-size: 22rpx;
  261. color: #666666;
  262. line-height: 30rpx;
  263. text-align: left;
  264. margin-top: 6rpx;
  265. }
  266. position: relative;
  267. &.on {}
  268. }
  269. .tabTitle_across {
  270. /* width: 50rpx;
  271. height: 4rpx;
  272. background: #0183FA;
  273. border-radius: 2rpx; */
  274. margin-left: 38%;
  275. margin-top: 37rpx;
  276. display none;
  277. >img {
  278. width: 40rpx;
  279. height: 26rpx;
  280. }
  281. &.on {
  282. display block;
  283. }
  284. }
  285. }
  286. }
  287. }
  288. .for-max-box {
  289. flex: 1;
  290. overflow-y scroll;
  291. .list {
  292. width: 690rpx;
  293. margin-left: 30rpx;
  294. background: #FFFFFF;
  295. border-radius: 20rpx 20rpx 20rpx 20rpx;
  296. .list-li:nth-child(1) {
  297. border-top: none;
  298. }
  299. .list-li {
  300. border-top: 1rpx dashed #E0E0E0;
  301. height: 80rpx;
  302. display: flex;
  303. justify-content: flex-start;
  304. align-items: center;
  305. padding: 0 30rpx;
  306. box-sizing: border-box;
  307. >view:nth-of-type(1) {
  308. flex: 1;
  309. font-size: 28rpx;
  310. color: #333333;
  311. line-height: 39rpx;
  312. text-align: left;
  313. margin: 0 52rpx 0 20rpx;
  314. overflow: hidden;
  315. text-overflow: ellipsis;
  316. white-space: nowrap;
  317. }
  318. >img:nth-of-type(1) {
  319. width: 42rpx;
  320. height: 42rpx;
  321. }
  322. >img:nth-of-type(2) {
  323. width: 24rpx;
  324. height: 24rpx;
  325. }
  326. }
  327. }
  328. .get-data-p {
  329. height: 100rpx;
  330. text-align: center;
  331. .get-data-img {
  332. width: 30rpx;
  333. height: 30rpx;
  334. margin: 0 auto;
  335. margin-top: 15rpx;
  336. }
  337. .get-data-text {
  338. text-align: center;
  339. }
  340. }
  341. .get-data-null-p {
  342. height: 100rpx;
  343. line-height: 100rpx;
  344. text-align: center;
  345. }
  346. }
  347. .shade {
  348. height: 100%;
  349. width: 100%;
  350. position: fixed;
  351. display: flex;
  352. flex-direction: column;
  353. z-index: 200;
  354. background: rgba(0, 0, 0, 0.2);
  355. .null-box {
  356. flex: 1;
  357. }
  358. .shade_n {
  359. position: absolute;
  360. bottom: 0;
  361. left: 0;
  362. width: 750rpx;
  363. height: 466rpx;
  364. background: #FFFFFF;
  365. border-radius: 20rpx 20rpx 0rpx 0rpx;
  366. overflow-y: auto;
  367. .title {
  368. display: flex;
  369. justify-content: space-between;
  370. align-items: center;
  371. padding: 0 50rpx 0 284rpx;
  372. box-sizing: border-box;
  373. border-bottom: 1rpx solid #E0E0E0;
  374. >view {
  375. font-size: 30rpx;
  376. color: #3D3D3D;
  377. line-height: 90rpx;
  378. text-align: left;
  379. }
  380. >img {
  381. width: 24rpx;
  382. height: 12rpx;
  383. }
  384. }
  385. .batch {
  386. padding: 0 30rpx;
  387. box-sizing: border-box;
  388. .batch-li {
  389. display: flex;
  390. justify-content: space-between;
  391. align-items: center;
  392. border-bottom: 1rpx solid #E0E0E0;
  393. padding: 20rpx 0 16rpx 0rpx;
  394. box-sizing: border-box;
  395. .batch-li-l {
  396. >text:nth-of-type(1) {
  397. display: block;
  398. font-size: 30rpx;
  399. color: #333333;
  400. line-height: 42rpx;
  401. text-align: left;
  402. }
  403. >text:nth-of-type(2) {
  404. display: block;
  405. font-size: 28rpx;
  406. color: #666666;
  407. line-height: 39rpx;
  408. text-align: left;
  409. margin-top: 6rpx;
  410. }
  411. }
  412. .batch-li-r {
  413. font-size: 28rpx;
  414. color: #666666;
  415. line-height: 39rpx;
  416. text-align: left;
  417. display: flex;
  418. justify-content: flex-start;
  419. align-items: center;
  420. >img {
  421. width: 24rpx;
  422. height: 24rpx;
  423. margin-left: 9rpx;
  424. }
  425. }
  426. }
  427. }
  428. }
  429. }
  430. #fontColor-A {
  431. color: #0040C1;
  432. }
  433. #fontColor-B {
  434. color: #009519;
  435. }
  436. #bgColor-A {
  437. color: #0183FA;
  438. background: rgba(1, 131, 250, 0.2);
  439. }
  440. #bgColor-B {
  441. color: #16B531;
  442. background: rgba(22, 181, 49, 0.2);
  443. }
  444. }
  445. </style>