snapshotItems.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. <!-- 隐患项 -->
  2. <template>
  3. <view class="hiddenDangerItems">
  4. <view class="header">
  5. <view class="line"></view>
  6. <view class="tabTitle_tow">
  7. <view class="tabTitle_tow_li" @tap="tabClickTow(item.value)" :key="index"
  8. v-for="(item,index) in tabTextTow">
  9. <view :class="{on:curTabTow==item.value}" class="tabTitle_tow_text">{{item.label}}</view>
  10. <view :class="{on:curTabTow==item.value}" class="tabTitle_tow_across"></view>
  11. </view>
  12. </view>
  13. <view class="line"></view>
  14. <view class="search">
  15. <view class="search-r" :class="(pageType == 0 && curTabTow == 0)||(pageType != 0) ?'search-r-margin':''"
  16. @click="checkItemModuleButton('open')">
  17. <img src="@/pages_safetyCheck/images/icon_aqjc_ss.png">
  18. {{newData.hazardCheckCode?newData.hazardCheckCode:''}}{{newData.hazardCheckName?newData.hazardCheckName:'搜索检查项'}}
  19. </view>
  20. </view>
  21. <view class="line"></view>
  22. </view>
  23. <scroll-view scroll-y style="overflow-y: scroll;flex:1;" @scrolltolower="scrollGet" class="info-max-box">
  24. <view class="list">
  25. <view class="total"
  26. :class="curTabTow == 0?'total-color-1':(curTabTow == 1?'total-color-2':(curTabTow == 2?'total-color-3':''))"
  27. v-if="pageType == 2">
  28. {{curTabTow == 0?'待整改共'+total+'项':(curTabTow == 1?'已整改共'+total+'项':(curTabTow == 2?'暂无法整改共'+total+'项':''))}}
  29. </view>
  30. <view class="list-li" v-for="(item,index) in dataList" :key="index">
  31. <view class="list-li-t" @click="itemsClick(item)">
  32. <view v-if="pageType == 2">
  33. <img v-if="curTabTow==2" src="@/pages_safetyCheck/images/icon_zg_zh@1x.png">
  34. <img v-if="curTabTow==1" src="@/pages_safetyCheck/images/icon_xz_zg@1x.png">
  35. <img v-if="curTabTow==4" src="@/pages_safetyCheck/images/icon_xz_fc@1x.png">
  36. </view>
  37. <view>{{item.hazardCheckCode}}{{item.hazardCheckName}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="get-data-p" v-if="!getDataType">
  42. <img class="get-data-img" src="@/pages_safetyCheck/images/icon_aqjc_sl.png">
  43. <view class="get-data-text">上拉加载</view>
  44. </view>
  45. <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
  46. </scroll-view>
  47. <checkItemModule :propsData="propsData" v-if="checkItemModuleType"></checkItemModule>
  48. </view>
  49. </template>
  50. <script>
  51. import {
  52. config
  53. } from '@/api/request/config.js'
  54. import {
  55. securityAppCheckPhotoList,
  56. } from '@/pages_safetyCheck/api/index.js'
  57. import {
  58. checkItemModule
  59. } from '@/pages_safetyCheck/component/checkItemModule.vue'
  60. export default {
  61. name: "hiddenDangerItems",
  62. components: {
  63. checkItemModule
  64. },
  65. data() {
  66. return {
  67. baseUrl: config.base_url,
  68. pageType: 1,
  69. tabTextTow: [],
  70. curTabTow: 0,
  71. form: {
  72. imgDtoList: [],
  73. },
  74. lotName: null,
  75. newData: {
  76. },
  77. dialogVisible: false,
  78. // 查询参数
  79. queryParams: {
  80. page: 1,
  81. pageSize: 10,
  82. },
  83. //符合/不符合
  84. checkFlag: null,
  85. total: 0,
  86. dataList: [],
  87. getDataType: false,
  88. searchIndex: 0,
  89. //检查项组件数据
  90. checkItemModuleType: false,
  91. propsData: {},
  92. }
  93. },
  94. onLoad(option) {
  95. let optionData = JSON.parse(decodeURIComponent(option.infoData));
  96. uni.setNavigationBarTitle({
  97. title: optionData.subName + '(' + optionData.subRoom + ')'
  98. })
  99. this.$set(this, 'pageType', optionData.pageType);
  100. this.$set(this, 'tabTextTow',[{
  101. value: '0',
  102. label: '待整改'
  103. }, {
  104. value: '1',
  105. label: '已整改'
  106. }, {
  107. value: '2',
  108. label: '暂无法整改'
  109. }])
  110. this.$set(this, 'newData', optionData);
  111. this.$nextTick(() => {
  112. this.getList()
  113. })
  114. },
  115. onShow() {
  116. },
  117. mounted() {
  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. tabClickTow(value) {
  134. this.$set(this, 'checkFlag', null);
  135. this.$set(this.queryParams, 'page', 1);
  136. this.$set(this, 'curTabTow', value);
  137. this.$set(this, 'total', 0);
  138. this.$set(this, 'dataList', []);
  139. this.$nextTick(()=>{
  140. this.getList();
  141. })
  142. },
  143. dialogOpen() {
  144. this.dialogVisible = true;
  145. },
  146. dialogClose() {
  147. this.dialogVisible = false;
  148. },
  149. checkItemModuleButton(type, item) {
  150. if (type == 'open') {
  151. let obj = {
  152. infoType: this.pageType,
  153. checkType: this.curTabTow,
  154. }
  155. if (this.pageType == 0) {
  156. //检查
  157. obj.manageId = this.newData.manageId
  158. } else if (this.pageType != 0) {
  159. //复查/整改
  160. obj.planId = this.newData.checkPlanSetVoList.planId;
  161. obj.planSetId = this.newData.checkPlanSetVoList.planSetId;
  162. obj.subId = this.newData.subId;
  163. }
  164. this.$set(this, 'propsData', obj);
  165. this.$set(this, 'checkItemModuleType', true);
  166. } else if (type == 'out') {
  167. this.$set(this, 'checkItemModuleType', false);
  168. this.$set(this, 'propsData', {});
  169. } else if (type == 'submit') {
  170. this.itemsClick(item);
  171. }
  172. },
  173. //检查项选中
  174. itemsClick(row) {
  175. let infoData = row;
  176. infoData.pageType = this.pageType;
  177. uni.navigateTo({
  178. url: '/pages_safetyCheck/views/snapshotManage/snapshotRectification?infoData=' + encodeURIComponent(JSON.stringify(infoData))
  179. });
  180. },
  181. hiddenDangerClick(row) {
  182. let infoData = row;
  183. infoData.pageType = this.pageType;
  184. uni.redirectTo({
  185. url: '/pages_safetyCheck/views/inspectManage/hiddenDangerRecord?infoData=' +
  186. encodeURIComponent(JSON.stringify(infoData))
  187. });
  188. },
  189. //
  190. async getList() {
  191. let self = this;
  192. let obj = JSON.parse(JSON.stringify(this.queryParams))
  193. //隐患整改
  194. obj.hazardCheckId = '';
  195. obj.searchValue = '';
  196. obj.subId = this.newData.subId;
  197. obj.rectifyStatus = this.curTabTow;
  198. const {
  199. data
  200. } = await securityAppCheckPhotoList(obj);
  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. .hiddenDangerItems {
  222. height: 100%;
  223. display flex;
  224. flex-direction: column;
  225. overflow: hidden;
  226. box-sizing: border-box;
  227. #totalColor-A {
  228. color: #0183FA;
  229. background: rgba(1, 131, 250, 0.2);
  230. }
  231. #totalColor-B {
  232. color: #16B531;
  233. background: rgba(22, 181, 49, 0.2);
  234. }
  235. #totalColor-C {
  236. color: #FF8C00;
  237. background: rgba(255, 140, 0, 0.2);
  238. }
  239. .header {
  240. width: 100%;
  241. height: 198rpx;
  242. overflow: hidden;
  243. background: #fff;
  244. .lotName {
  245. height: 70rpx;
  246. line-height: 70rpx;
  247. font-size: 28rpx;
  248. background: rgba(1, 131, 250, 0.2);
  249. color: #0183FA;
  250. text-align: center;
  251. }
  252. .lotNameOne {
  253. background: #F7E0C4;
  254. color: #FF8C00;
  255. }
  256. .tabTitle_tow {
  257. width: 520rpx;
  258. height: 80rpx;
  259. display flex;
  260. justify-content: flex-start;
  261. align-items: center;
  262. .tabTitle_tow_li {
  263. flex: 1;
  264. position: relative;
  265. text-align center;
  266. .tabTitle_tow_text {
  267. display: inline-block;
  268. font-size: 30rpx;
  269. font-family: PingFang SC;
  270. font-weight: 500;
  271. color: #333333;
  272. line-height: 46rpx;
  273. position: relative;
  274. &.on {
  275. color: #0183FA;
  276. }
  277. }
  278. .tabTitle_tow_across {
  279. width: 50rpx;
  280. height: 4rpx;
  281. background: #0183FA;
  282. border-radius: 2rpx;
  283. margin-left: 38%;
  284. display none;
  285. &.on {
  286. display block;
  287. }
  288. }
  289. }
  290. }
  291. .line {
  292. width: 100%;
  293. height: 13rpx;
  294. background: #F5F5F5;
  295. }
  296. .search {
  297. width: 750rpx;
  298. height: 80rpx;
  299. background: #FFFFFF;
  300. border-radius: 0rpx 0rpx 0rpx 0rpx;
  301. display: flex;
  302. justify-content: flex-start;
  303. align-items: center;
  304. .search-l {
  305. display: flex;
  306. justify-content: flex-start;
  307. align-items: center;
  308. margin: 0 20rpx 0 30rpx;
  309. .search-A {
  310. border-radius: 50rpx 50rpx 50rpx 50rpx;
  311. border: 1rpx solid #E0E0E0;
  312. width: 100rpx;
  313. height: 60rpx;
  314. background: #E0E0E0;
  315. font-weight: normal;
  316. font-size: 24rpx;
  317. color: #333333;
  318. line-height: 60rpx;
  319. text-align: center;
  320. margin-right: 10rpx;
  321. }
  322. .search-B {
  323. border-radius: 50rpx 50rpx 50rpx 50rpx;
  324. border: 1rpx solid #0183FA;
  325. width: 100rpx;
  326. height: 60rpx;
  327. background: #0183FA;
  328. font-weight: normal;
  329. font-size: 24rpx;
  330. color: #FFFFFF;
  331. line-height: 60rpx;
  332. text-align: center;
  333. margin-right: 10rpx;
  334. }
  335. }
  336. .search-r-margin {
  337. width: 700rpx !important;
  338. margin: 0 auto;
  339. }
  340. .search-r {
  341. width: 440rpx;
  342. height: 60rpx;
  343. background: #FFFFFF;
  344. border-radius: 50rpx 50rpx 50rpx 50rpx;
  345. border: 1rpx solid #E0E0E0;
  346. font-size: 24rpx;
  347. color: #999999;
  348. line-height: 60rpx;
  349. text-align: left;
  350. display: flex;
  351. justify-content: flex-start;
  352. align-items: center;
  353. padding: 0 20rpx;
  354. box-sizing: border-box;
  355. >img {
  356. width: 30rpx;
  357. height: 30rpx;
  358. margin-right: 20rpx;
  359. }
  360. }
  361. }
  362. }
  363. .list {
  364. width: 750rpx;
  365. background: #FFFFFF;
  366. padding-bottom: 20rpx;
  367. box-sizing: border-box;
  368. .total {
  369. display: inline-block;
  370. height: 50rpx;
  371. background: rgba(1, 131, 250, 0.2);
  372. border-radius: 0rpx 0rpx 20rpx 0rpx;
  373. font-size: 24rpx;
  374. color: #0183FA;
  375. line-height: 50rpx;
  376. text-align: left;
  377. padding: 0rpx 22rpx;
  378. box-sizing: border-box;
  379. margin-bottom: 20rpx;
  380. }
  381. .total-color-1 {
  382. background: rgba(1, 131, 250, 0.2);
  383. color: #0183FA;
  384. }
  385. .total-color-2 {
  386. background: rgba(22, 181, 49, 0.2);
  387. color: #16B531;
  388. }
  389. .total-color-3 {
  390. background: #F7E0C4;
  391. color: #FF8C00;
  392. }
  393. .list-li {
  394. margin: 0 30rpx;
  395. .list-li-t {
  396. width: 690rpx;
  397. background: #F5F5F5;
  398. border-radius: 10rpx 10rpx 10rpx 10rpx;
  399. display: flex;
  400. justify-content: flex-start;
  401. padding: 12rpx 20rpx 14rpx 14rpx;
  402. box-sizing: border-box;
  403. margin: 20rpx 0;
  404. >view:nth-of-type(1) {
  405. >img {
  406. width: 24rpx;
  407. height: 24rpx;
  408. margin-right: 30rpx;
  409. }
  410. }
  411. >view:nth-of-type(2) {
  412. flex: 1;
  413. font-size: 24rpx;
  414. color: #3D3D3D;
  415. line-height: 34rpx;
  416. text-align: left;
  417. }
  418. }
  419. .list-li-b {
  420. font-size: 24rpx;
  421. color: #3D3D3D;
  422. line-height: 24rpx;
  423. text-align: right;
  424. >text {
  425. color: #FF0000;
  426. }
  427. }
  428. }
  429. }
  430. .get-data-p {
  431. height: 100rpx;
  432. text-align: center;
  433. .get-data-img {
  434. width: 30rpx;
  435. height: 30rpx;
  436. margin: 0 auto;
  437. margin-top: 15rpx;
  438. }
  439. .get-data-text {
  440. text-align: center;
  441. }
  442. }
  443. .get-data-null-p {
  444. height: 100rpx;
  445. line-height: 100rpx;
  446. text-align: center;
  447. }
  448. .sub-btn {
  449. width: 686rpx;
  450. height: 100rpx;
  451. background: #0183FA;
  452. border-radius: 50rpx 50rpx 50rpx 50rpx;
  453. position: fixed;
  454. left: 30rpx;
  455. bottom: 30rpx;
  456. font-weight: 400;
  457. font-size: 30rpx;
  458. color: #FFFFFF;
  459. line-height: 100rpx;
  460. text-align: center;
  461. }
  462. }
  463. </style>