patrolPlanList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <!-- 安全检查-发起巡查计划 -->
  2. <template>
  3. <view class="examine">
  4. <view class="tabTitle">
  5. <view class="tabTitle_li" @tap="tabClick(index)" :key="index" v-for="(item,index) in tabText">
  6. <view :class="{on:curTab==index}" class="tabTitle_text">{{item}}</view>
  7. <view :class="{on:curTab==index}" class="tabTitle_across"></view>
  8. </view>
  9. </view>
  10. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  11. <view>
  12. <view class="search">
  13. <input type="text" v-model="getData.searchValue" placeholder="计划标题" name="search"
  14. @confirm='searchBtn' confirm-type='search' maxlength="50"
  15. placeholder-style="color: #CCCCCC;font-size:26rpx;">
  16. <view class="search_btn" v-if="getData.searchValue>0" @click="clearBtn">
  17. <img src="@/pages_safetyExamine/images/clear.png" />
  18. </view>
  19. </view>
  20. <view class="list">
  21. <view class="list_li" v-for="(item,index) in dataList" :key="index"
  22. @click="handleClick(item,'edit')">
  23. <view class="list_li_t">
  24. <view class="list_li_t_l">
  25. <img v-if="item.checkRange==1" src="@/pages_safetyExamine/images/icon_xyxc_qx.png" />
  26. <img v-if="item.checkRange==2" src="@/pages_safetyExamine/images/icon_xyxc_xy.png" />
  27. <img v-if="item.checkRange==3" src="@/pages_safetyExamine/images/icon_xyxc_sys.png" />
  28. <text></text>
  29. </view>
  30. <view class="list_li_t_c">{{item.title}}</view>
  31. <view class="list_li_t_c2" v-if="item.isOverdue==1">已逾期</view>
  32. <view class="list_li_t_r"></view>
  33. </view>
  34. <view class="list_li_m">
  35. <view class="list_li_m_t">计划周期:{{item.cycleStartTime}}至{{item.cycleEndTime}}</view>
  36. <view class="list_li_m_b">
  37. <text class="blue_color" v-if="item.checkStatus==1">未开始</text>
  38. <text class="red_color" v-if="item.checkStatus==2">进行中</text>
  39. <text class="green_color" v-if="item.checkStatus==3">已结束</text>
  40. <text>{{item.checkType==1?'校院巡查':'实验室自查'}}-专项检查</text>
  41. </view>
  42. </view>
  43. <view class="list_li_b">
  44. <img src="@/pages_safetyExamine/images/icon_djcsys.png" />
  45. <text v-if="item.checkStatus==1">待检查实验室:</text>
  46. <text v-if="item.checkStatus==1">{{item.subjectNum}}间</text>
  47. <text v-if="item.checkStatus==2 || item.checkStatus==3">检查进度:</text>
  48. <text v-if="item.checkStatus==2 || item.checkStatus==3">{{item.checkSchedule}}间</text>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <img class="null-img" v-if="!dataList[0]" src="@/pages_safetyExamine/images/null-data-1.png">
  54. </scroll-view>
  55. <view class="bottom_btn" @click="handleClick('','subBtn')">{{subBtnTitle}}</view>
  56. </view>
  57. </template>
  58. <script>
  59. import {
  60. config
  61. } from '@/api/request/config.js'
  62. import {
  63. checkPlanList
  64. } from '@/pages_safetyExamine/api/index.js'
  65. export default {
  66. name: "rectifyList",
  67. components: {
  68. },
  69. data() {
  70. return {
  71. pageType: 0,
  72. //列表请求参数
  73. getData: {
  74. pageNum: 1,
  75. pageSize: 20,
  76. searchValue: '',
  77. checkType: '',
  78. },
  79. total: 0,
  80. tabText: ['全部', '未开始', '进行中', '已结束'],
  81. curTab: 0,
  82. dataList: [],
  83. subBtnTitle: '发起巡查计划',
  84. }
  85. },
  86. onLoad(option) {
  87. console.log(option.pageType)
  88. if (option.pageType == 1) {
  89. this.getData.checkType = option.pageType
  90. uni.setNavigationBarTitle({
  91. title: '校院巡查计划'
  92. })
  93. this.subBtnTitle = '发起巡查计划';
  94. } else if (option.pageType == 2) {
  95. this.getData.checkType = option.pageType
  96. uni.setNavigationBarTitle({
  97. title: '实验室自查计划'
  98. })
  99. this.subBtnTitle = '发起自查计划';
  100. }
  101. },
  102. onShow() {
  103. this.dataList = [];
  104. this.getList();
  105. },
  106. mounted() {
  107. },
  108. methods: {
  109. //实验室搜索
  110. searchBtn() {
  111. this.dataList = [];
  112. this.getList();
  113. },
  114. //清除按钮
  115. clearBtn() {
  116. this.getData.pageNum = 1;
  117. this.getData.searchValue = '';
  118. this.dataList = [];
  119. this.getList();
  120. },
  121. //滚动事件
  122. scrollGet() {
  123. let self = this;
  124. if (self.total / self.getData.pageSize <= self.getData.pageNum) {
  125. console.log('没有更多数据!')
  126. } else {
  127. setTimeout(function() {
  128. self.getData.pageNum += 1;
  129. self.getList();
  130. }, 1000)
  131. }
  132. },
  133. //顶部tab点击
  134. tabClick(index) {
  135. this.curTab = index;
  136. this.getData.pageNum = 1;
  137. this.dataList = [];
  138. this.getData.checkStatus = index;
  139. this.getList()
  140. },
  141. handleClick(row, doType) {
  142. let self = this;
  143. if (doType == 'subBtn') { //发起巡查计划
  144. uni.navigateTo({
  145. url: '/pages_safetyExamine/views/patrolPlan/patrolPlanAdd?pageType=' + this.getData
  146. .checkType
  147. });
  148. } else if (doType == 'edit') { //编辑
  149. uni.navigateTo({
  150. url: '/pages_safetyExamine/views/patrolPlan/patrolPlanEdit?pageType=' + row.checkType +
  151. '&id=' + row.id
  152. });
  153. }
  154. },
  155. async getList() {
  156. let self = this;
  157. const {
  158. data
  159. } = await checkPlanList(this.getData);
  160. if (data.code == 200) {
  161. this.dataList = [...this.dataList, ...data.data.records]
  162. this.total = data.data.total;
  163. }
  164. }
  165. }
  166. }
  167. </script>
  168. <style lang="stylus" scoped>
  169. .examine {
  170. height: 100%;
  171. display flex;
  172. .null-img {
  173. display block;
  174. width: 276rpx;
  175. height: 321rpx;
  176. margin: 100rpx 0 0 274rpx;
  177. }
  178. .info-max-box {
  179. flex: 1;
  180. overflow: scroll;
  181. padding-bottom: 128rpx;
  182. padding-top: 100rpx;
  183. }
  184. .blue_color {
  185. color: #0183FA;
  186. border: 1rpx solid #0183FA;
  187. }
  188. .red_color {
  189. color: #FF4545;
  190. border: 1rpx solid #FF4545;
  191. }
  192. .green_color {
  193. color: #1FA50D;
  194. border: 1rpx solid #1FA50D;
  195. }
  196. /* 切换按钮 */
  197. .tabTitle {
  198. width: 100%;
  199. height: 100rpx;
  200. background: #fff;
  201. display flex;
  202. justify-content: flex-start;
  203. align-items: center;
  204. position: fixed;
  205. top: 0;
  206. z-index: 100;
  207. .tabTitle_li {
  208. position: relative;
  209. width: 146rpx;
  210. text-align center;
  211. .tabTitle_text {
  212. display: inline-block;
  213. font-size: 30rpx;
  214. font-family: PingFang SC;
  215. font-weight: 500;
  216. color: #333333;
  217. line-height: 46rpx;
  218. position: relative;
  219. &.on {
  220. color: #0183FA;
  221. }
  222. }
  223. .tabTitle_across {
  224. width: 50rpx;
  225. height: 4rpx;
  226. background: #0183FA;
  227. border-radius: 2rpx;
  228. margin-left: 46rpx;
  229. display none;
  230. &.on {
  231. display block;
  232. }
  233. }
  234. }
  235. }
  236. .search {
  237. width: 750rpx;
  238. height: 100rpx;
  239. background: #FFFFFF;
  240. padding: 20rpx 30rpx;
  241. box-sizing: border-box;
  242. position: relative;
  243. margin-top: 20rpx;
  244. >input {
  245. position: absolute;
  246. top: 20rpx;
  247. left: 30rpx;
  248. width: 690rpx;
  249. height: 60rpx;
  250. border-radius: 50rpx;
  251. opacity: 1;
  252. border: 1rpx solid #E0E0E0;
  253. padding: 0 74rpx 0 30rpx;
  254. box-sizing: border-box;
  255. }
  256. .search_btn {
  257. width: 70rpx;
  258. height: 60rpx;
  259. position: absolute;
  260. top: 20rpx;
  261. right: 30rpx;
  262. z-index: 200;
  263. >img {
  264. width: 20rpx;
  265. height: 20rpx;
  266. position: absolute;
  267. top: 20rpx;
  268. left: 24rpx;
  269. }
  270. }
  271. }
  272. .list {
  273. padding: 0 30rpx;
  274. box-sizing: border-box;
  275. margin-top: 20rpx;
  276. .list_li {
  277. position: relative;
  278. width: 690rpx;
  279. height: 360rpx;
  280. background: #fff;
  281. border-radius: 10rpx;
  282. overflow: hidden;
  283. margin-bottom: 20rpx;
  284. .list_li_t {
  285. width: 100%;
  286. position: absolute;
  287. left: 0;
  288. top: 0;
  289. .list_li_t_l {
  290. >img {
  291. width: 70rpx;
  292. height: 70rpx;
  293. }
  294. >text {
  295. position: absolute;
  296. left: -15rpx;
  297. top: 76rpx;
  298. display: inline-block;
  299. width: 30rpx;
  300. height: 30rpx;
  301. background: #F5F5F5;
  302. border-radius: 15rpx;
  303. }
  304. }
  305. .list_li_t_c {
  306. width: 570rpx;
  307. height: 110rpx;
  308. position: absolute;
  309. left: 30rpx;
  310. top: 0;
  311. font-size: 30rpx;
  312. font-family: PingFang SC-Medium, PingFang SC;
  313. font-weight: 400;
  314. color: #333333;
  315. line-height: 110rpx;
  316. border-bottom: 1rpx dashed #D8D8D8;
  317. overflow: hidden;
  318. text-overflow: ellipsis;
  319. white-space: nowrap;
  320. padding-right: 60rpx;
  321. box-sizing: border-box;
  322. }
  323. .list_li_t_c2 {
  324. position: absolute;
  325. right: 20rpx;
  326. top: 38rpx;
  327. width: 120rpx;
  328. height: 40rpx;
  329. font-size: 28rpx;
  330. font-family: PingFang SC-Medium, PingFang SC;
  331. font-weight: 400;
  332. color: #FF5757;
  333. line-height: 40rpx;
  334. border: 1rpx solid #FF5757;
  335. border-radius: 6rpx;
  336. text-align: center;
  337. }
  338. .list_li_t_r {
  339. position: absolute;
  340. right: -15rpx;
  341. top: 76rpx;
  342. width: 30rpx;
  343. height: 30rpx;
  344. background: #F5F5F5;
  345. border-radius: 15rpx;
  346. }
  347. }
  348. .list_li_m {
  349. position: absolute;
  350. top: 110rpx;
  351. left: 0;
  352. width: 690rpx;
  353. height: 168rpx;
  354. border-bottom: 1rpx solid #E0E0E0;
  355. padding-left: 30rpx;
  356. box-sizing: border-box;
  357. .list_li_m_t {
  358. font-size: 28rpx;
  359. font-family: PingFang SC-Medium, PingFang SC;
  360. font-weight: 400;
  361. color: #666666;
  362. line-height: 40rpx;
  363. margin-top: 22rpx;
  364. }
  365. .list_li_m_b {
  366. margin-top: 26rpx;
  367. >text:nth-of-type(1) {
  368. font-size: 26rpx;
  369. font-family: PingFang SC-Medium, PingFang SC;
  370. font-weight: 400;
  371. line-height: 40rpx;
  372. border-radius: 6rpx;
  373. padding: 0 20rpx;
  374. margin-right: 14rpx;
  375. }
  376. >text:nth-of-type(2) {
  377. font-size: 26rpx;
  378. font-family: PingFang SC-Medium, PingFang SC;
  379. font-weight: 400;
  380. color: #0183FA;
  381. line-height: 40rpx;
  382. padding: 0 8rpx;
  383. border-radius: 6rpx;
  384. background: rgba(1, 131, 250, 0.1);
  385. }
  386. }
  387. }
  388. .list_li_b {
  389. height: 80rpx;
  390. position: absolute;
  391. top: 278rpx;
  392. left: 0;
  393. display: flex;
  394. justify-content: flex-start;
  395. align-items: center;
  396. >img {
  397. width: 24rpx;
  398. height: 30rpx;
  399. margin-right: 26rpx;
  400. margin-left: 30rpx;
  401. }
  402. >text:nth-of-type(1) {
  403. font-size: 28rpx;
  404. font-family: PingFang SC-Medium, PingFang SC;
  405. font-weight: 400;
  406. color: #333333;
  407. line-height: 28rpx;
  408. }
  409. >text:nth-of-type(2) {
  410. font-size: 28rpx;
  411. font-family: PingFang SC-Medium, PingFang SC;
  412. font-weight: 400;
  413. color: #0183FA;
  414. line-height: 28rpx;
  415. }
  416. }
  417. }
  418. }
  419. .bottom_btn {
  420. position: fixed;
  421. bottom: 26rpx;
  422. left: 30rpx;
  423. font-size: 30rpx;
  424. font-family: PingFang SC-Medium, PingFang SC;
  425. font-weight: 400;
  426. color: #FFFFFF;
  427. line-height: 90rpx;
  428. width: 690rpx;
  429. height: 90rpx;
  430. background: #0183FA;
  431. border-radius: 20rpx;
  432. text-align: center;
  433. }
  434. }
  435. </style>