snapshotItems.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  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. console.log(this.curTabTow)
  144. },
  145. dialogOpen() {
  146. this.dialogVisible = true;
  147. },
  148. dialogClose() {
  149. this.dialogVisible = false;
  150. },
  151. checkItemModuleButton(type, item) {
  152. if (type == 'open') {
  153. let obj = {
  154. infoType: this.pageType,
  155. checkType: this.curTabTow,
  156. }
  157. if (this.pageType == 0) {
  158. //检查
  159. obj.manageId = this.newData.manageId
  160. } else if (this.pageType != 0) {
  161. //复查/整改
  162. obj.planId = this.newData.checkPlanSetVoList.planId;
  163. obj.planSetId = this.newData.checkPlanSetVoList.planSetId;
  164. obj.subId = this.newData.subId;
  165. }
  166. this.$set(this, 'propsData', obj);
  167. this.$set(this, 'checkItemModuleType', true);
  168. } else if (type == 'out') {
  169. this.$set(this, 'checkItemModuleType', false);
  170. this.$set(this, 'propsData', {});
  171. } else if (type == 'submit') {
  172. this.itemsClick(item);
  173. }
  174. },
  175. //检查项选中
  176. itemsClick(row) {
  177. let infoData = row;
  178. infoData.pageType = this.pageType;
  179. if(this.curTabTow==0){
  180. uni.navigateTo({
  181. url: '/pages_safetyCheck/views/snapshotManage/snapshotRectification?infoData=' + encodeURIComponent(JSON.stringify(infoData))
  182. });
  183. }else if(this.curTabTow==1 || this.curTabTow==2){
  184. uni.navigateTo({
  185. url: '/pages_safetyCheck/views/snapshotManage/snapshotDetail?infoData=' + encodeURIComponent(JSON.stringify(infoData))
  186. });
  187. }
  188. },
  189. hiddenDangerClick(row) {
  190. let infoData = row;
  191. infoData.pageType = this.pageType;
  192. uni.redirectTo({
  193. url: '/pages_safetyCheck/views/inspectManage/hiddenDangerRecord?infoData=' +
  194. encodeURIComponent(JSON.stringify(infoData))
  195. });
  196. },
  197. //
  198. async getList() {
  199. let self = this;
  200. let obj = JSON.parse(JSON.stringify(this.queryParams))
  201. //隐患整改
  202. obj.hazardCheckId = '';
  203. obj.searchValue = '';
  204. obj.subId = this.newData.subId;
  205. obj.rectifyStatus = this.curTabTow;
  206. const {
  207. data
  208. } = await securityAppCheckPhotoList(obj);
  209. if (data.code == 200) {
  210. if (self.queryParams.page == 1) {
  211. this.dataList = data.data.records;
  212. this.total = data.data.total;
  213. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  214. this.$set(this, 'getDataType', true);
  215. }
  216. } else {
  217. this.dataList = [...this.dataList, ...data.data.records]
  218. this.total = data.data.total;
  219. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  220. this.$set(this, 'getDataType', true);
  221. }
  222. }
  223. }
  224. },
  225. }
  226. }
  227. </script>
  228. <style lang="stylus" scoped>
  229. .hiddenDangerItems {
  230. height: 100%;
  231. display flex;
  232. flex-direction: column;
  233. overflow: hidden;
  234. box-sizing: border-box;
  235. #totalColor-A {
  236. color: #0183FA;
  237. background: rgba(1, 131, 250, 0.2);
  238. }
  239. #totalColor-B {
  240. color: #16B531;
  241. background: rgba(22, 181, 49, 0.2);
  242. }
  243. #totalColor-C {
  244. color: #FF8C00;
  245. background: rgba(255, 140, 0, 0.2);
  246. }
  247. .header {
  248. width: 100%;
  249. height: 198rpx;
  250. overflow: hidden;
  251. background: #fff;
  252. .lotName {
  253. height: 70rpx;
  254. line-height: 70rpx;
  255. font-size: 28rpx;
  256. background: rgba(1, 131, 250, 0.2);
  257. color: #0183FA;
  258. text-align: center;
  259. }
  260. .lotNameOne {
  261. background: #F7E0C4;
  262. color: #FF8C00;
  263. }
  264. .tabTitle_tow {
  265. width: 520rpx;
  266. height: 80rpx;
  267. display flex;
  268. justify-content: flex-start;
  269. align-items: center;
  270. .tabTitle_tow_li {
  271. flex: 1;
  272. position: relative;
  273. text-align center;
  274. .tabTitle_tow_text {
  275. display: inline-block;
  276. font-size: 30rpx;
  277. font-family: PingFang SC;
  278. font-weight: 500;
  279. color: #333333;
  280. line-height: 46rpx;
  281. position: relative;
  282. &.on {
  283. color: #0183FA;
  284. }
  285. }
  286. .tabTitle_tow_across {
  287. width: 50rpx;
  288. height: 4rpx;
  289. background: #0183FA;
  290. border-radius: 2rpx;
  291. margin-left: 38%;
  292. display none;
  293. &.on {
  294. display block;
  295. }
  296. }
  297. }
  298. }
  299. .line {
  300. width: 100%;
  301. height: 13rpx;
  302. background: #F5F5F5;
  303. }
  304. .search {
  305. width: 750rpx;
  306. height: 80rpx;
  307. background: #FFFFFF;
  308. border-radius: 0rpx 0rpx 0rpx 0rpx;
  309. display: flex;
  310. justify-content: flex-start;
  311. align-items: center;
  312. .search-l {
  313. display: flex;
  314. justify-content: flex-start;
  315. align-items: center;
  316. margin: 0 20rpx 0 30rpx;
  317. .search-A {
  318. border-radius: 50rpx 50rpx 50rpx 50rpx;
  319. border: 1rpx solid #E0E0E0;
  320. width: 100rpx;
  321. height: 60rpx;
  322. background: #E0E0E0;
  323. font-weight: normal;
  324. font-size: 24rpx;
  325. color: #333333;
  326. line-height: 60rpx;
  327. text-align: center;
  328. margin-right: 10rpx;
  329. }
  330. .search-B {
  331. border-radius: 50rpx 50rpx 50rpx 50rpx;
  332. border: 1rpx solid #0183FA;
  333. width: 100rpx;
  334. height: 60rpx;
  335. background: #0183FA;
  336. font-weight: normal;
  337. font-size: 24rpx;
  338. color: #FFFFFF;
  339. line-height: 60rpx;
  340. text-align: center;
  341. margin-right: 10rpx;
  342. }
  343. }
  344. .search-r-margin {
  345. width: 700rpx !important;
  346. margin: 0 auto;
  347. }
  348. .search-r {
  349. width: 440rpx;
  350. height: 60rpx;
  351. background: #FFFFFF;
  352. border-radius: 50rpx 50rpx 50rpx 50rpx;
  353. border: 1rpx solid #E0E0E0;
  354. font-size: 24rpx;
  355. color: #999999;
  356. line-height: 60rpx;
  357. text-align: left;
  358. display: flex;
  359. justify-content: flex-start;
  360. align-items: center;
  361. padding: 0 20rpx;
  362. box-sizing: border-box;
  363. >img {
  364. width: 30rpx;
  365. height: 30rpx;
  366. margin-right: 20rpx;
  367. }
  368. }
  369. }
  370. }
  371. .list {
  372. width: 750rpx;
  373. background: #FFFFFF;
  374. padding-bottom: 20rpx;
  375. box-sizing: border-box;
  376. .total {
  377. display: inline-block;
  378. height: 50rpx;
  379. background: rgba(1, 131, 250, 0.2);
  380. border-radius: 0rpx 0rpx 20rpx 0rpx;
  381. font-size: 24rpx;
  382. color: #0183FA;
  383. line-height: 50rpx;
  384. text-align: left;
  385. padding: 0rpx 22rpx;
  386. box-sizing: border-box;
  387. margin-bottom: 20rpx;
  388. }
  389. .total-color-1 {
  390. background: rgba(1, 131, 250, 0.2);
  391. color: #0183FA;
  392. }
  393. .total-color-2 {
  394. background: rgba(22, 181, 49, 0.2);
  395. color: #16B531;
  396. }
  397. .total-color-3 {
  398. background: #F7E0C4;
  399. color: #FF8C00;
  400. }
  401. .list-li {
  402. margin: 0 30rpx;
  403. .list-li-t {
  404. width: 690rpx;
  405. background: #F5F5F5;
  406. border-radius: 10rpx 10rpx 10rpx 10rpx;
  407. display: flex;
  408. justify-content: flex-start;
  409. padding: 12rpx 20rpx 14rpx 14rpx;
  410. box-sizing: border-box;
  411. margin: 20rpx 0;
  412. >view:nth-of-type(1) {
  413. >img {
  414. width: 24rpx;
  415. height: 24rpx;
  416. margin-right: 30rpx;
  417. }
  418. }
  419. >view:nth-of-type(2) {
  420. flex: 1;
  421. font-size: 24rpx;
  422. color: #3D3D3D;
  423. line-height: 34rpx;
  424. text-align: left;
  425. }
  426. }
  427. .list-li-b {
  428. font-size: 24rpx;
  429. color: #3D3D3D;
  430. line-height: 24rpx;
  431. text-align: right;
  432. >text {
  433. color: #FF0000;
  434. }
  435. }
  436. }
  437. }
  438. .get-data-p {
  439. height: 100rpx;
  440. text-align: center;
  441. .get-data-img {
  442. width: 30rpx;
  443. height: 30rpx;
  444. margin: 0 auto;
  445. margin-top: 15rpx;
  446. }
  447. .get-data-text {
  448. text-align: center;
  449. }
  450. }
  451. .get-data-null-p {
  452. height: 100rpx;
  453. line-height: 100rpx;
  454. text-align: center;
  455. }
  456. .sub-btn {
  457. width: 686rpx;
  458. height: 100rpx;
  459. background: #0183FA;
  460. border-radius: 50rpx 50rpx 50rpx 50rpx;
  461. position: fixed;
  462. left: 30rpx;
  463. bottom: 30rpx;
  464. font-weight: 400;
  465. font-size: 30rpx;
  466. color: #FFFFFF;
  467. line-height: 100rpx;
  468. text-align: center;
  469. }
  470. }
  471. </style>