snapshotItems.vue 12 KB

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