safetyCheck.vue 11 KB

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