snapshotItems.vue 12 KB

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