snapshotItems.vue 12 KB

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