safetyCheck.vue 11 KB

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