hiddenDangerItems.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072
  1. <!-- 隐患项 -->
  2. <template>
  3. <view class="hiddenDangerItems">
  4. <view class="header">
  5. <view class="lotName" :class="pageType != 0?'lotNameOne':''" v-if="lotName">{{lotName}}</view>
  6. <view class="line"></view>
  7. <view class="tabTitle_tow" :style="pageType==0?'width:320rpx;':'width:520rpx;'">
  8. <view class="tabTitle_tow_li" @tap="tabClickTow(item.value)" :key="index"
  9. v-for="(item,index) in tabTextTow">
  10. <view :class="{on:curTabTow==item.value}" class="tabTitle_tow_text">{{item.label}}</view>
  11. <view :class="{on:curTabTow==item.value}" class="tabTitle_tow_across"></view>
  12. </view>
  13. </view>
  14. <view class="line"></view>
  15. <view class="search">
  16. <view class="search-r search-r-margin" @click="checkItemModuleButton('open')">
  17. <img :src="imagesUrl('commonality/icon_aqjc_ss.png')">
  18. 搜索检查项
  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 == 2?'total-color-3':(curTabTow == 1?'total-color-2':''))"
  27. v-if="pageType == 0">
  28. {{curTabTow == 0?'待检查共'+total+'项':(curTabTow == 1?'已检查共'+total+'项':'')}}
  29. </view>
  30. <view class="total"
  31. :class="curTabTow == 0?'total-color-1':(curTabTow == 1?'total-color-2':(curTabTow == 2?'total-color-3':''))"
  32. v-if="pageType == 1">
  33. {{curTabTow == 0?'待复查共'+total+'项':(curTabTow == 1?'复查完毕共'+total+'项':(curTabTow == 2?'退回整改共'+total+'项':''))}}
  34. </view>
  35. <view class="total"
  36. :class="curTabTow == 2?'total-color-1':(curTabTow == 0?'total-color-2':(curTabTow == 4?'total-color-3':''))"
  37. v-if="pageType == 2">
  38. {{curTabTow == 2?'待整改共'+total+'项':(curTabTow == 1?'已整改共'+total+'项':(curTabTow == 4?'暂无法整改共'+total+'项':''))}}
  39. </view>
  40. <view class="list-li" v-for="(item,index) in dataList" :key="index">
  41. <view class="list-li-t" @click="itemsClick(item)">
  42. <view v-if="pageType == 0">
  43. <img v-if="item.checkFlag==null" :src="imagesUrl('safetyCheck/icon_zg_zh@1x.png')">
  44. <img v-if="item.checkFlag==false" :src="imagesUrl('safetyCheck/icon_xz_zg@1x.png')">
  45. <img v-if="item.checkFlag==true" :src="imagesUrl('safetyCheck/icon_xz_fc@1x.png')">
  46. </view>
  47. <view v-if="pageType == 1">
  48. <img v-if="curTabTow==0" :src="imagesUrl('safetyCheck/icon_zg_zh@1x.png')">
  49. <img v-if="curTabTow==1" :src="imagesUrl('safetyCheck/icon_xz_fc@1x.png')">
  50. <img v-if="curTabTow==2" :src="imagesUrl('safetyCheck/icon_xz_zg@1x.png')">
  51. </view>
  52. <view v-if="pageType == 2">
  53. <img v-if="curTabTow==2" :src="imagesUrl('safetyCheck/icon_zg_zh@1x.png')">
  54. <img v-if="curTabTow==1" :src="imagesUrl('safetyCheck/icon_xz_zg@1x.png')">
  55. <img v-if="curTabTow==4" :src="imagesUrl('safetyCheck/icon_xz_fc@1x.png')">
  56. </view>
  57. <view>{{item.hazardCheckCode}}{{item.hazardCheckName}}</view>
  58. </view>
  59. <view v-if="pageType == 1 && item.hazardNum" class="list-li-b" @click="hiddenDangerClick(item)">
  60. 此检查项在当前实验室累计出现<text>{{item.hazardNum}}</text>次隐患
  61. </view>
  62. <view v-if="pageType == 2 && item.dangerNum" class="list-li-b" @click="hiddenDangerClick(item)">
  63. 此检查项在当前实验室累计出现<text>{{item.dangerNum}}</text>次隐患
  64. </view>
  65. </view>
  66. </view>
  67. <view class="get-data-p" v-if="!getDataType">
  68. <img class="get-data-img" :src="imagesUrl('safetyCheck/icon_aqjc_sl.png')">
  69. <view class="get-data-text">上拉加载</view>
  70. </view>
  71. <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
  72. </scroll-view>
  73. <checkItemModule :propsData="propsData" v-if="checkItemModuleType"></checkItemModule>
  74. <!-- <view class="sub-btn" @click="submitBtn(1)" v-if="pageType==0 && inspectRemporary">开展检查</view> -->
  75. <view class="subBtn">
  76. <img @click="saoCode()" v-if="pageType==0" :src="imagesUrl('safetyCheck/icon_aqjc_saoma.png')">
  77. <img @click="submitBtn(1)" v-if="pageType==0 && inspectRemporary" style="margin-left: 184rpx;"
  78. :src="imagesUrl('safetyCheck/icon_aqjc_jiancha.png')" />
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import {
  84. config
  85. } from '@/api/request/config.js'
  86. import {
  87. securityAppCheckSetOptionList,
  88. securityAppCheckDangerReviewList,
  89. securityAppCheckDangerGetCheckDangerSubId,
  90. securityAppCheckSetOptionFinishCheck,
  91. securityAppCheckDangerGetCheckDangerSubList,
  92. securityAppCheckDangerReviewSubList,
  93. securityAppCheckManageList,
  94. securityAppCheckPlanSetGetOptionList,
  95. securityCheckOptionSelAllList,
  96. } from '@/pages_safetyCheck/api/index.js'
  97. import {
  98. checkItemModule
  99. } from '@/pages_safetyCheck/component/checkItemModule.vue'
  100. export default {
  101. name: "hiddenDangerItems",
  102. components: {
  103. checkItemModule
  104. },
  105. data() {
  106. return {
  107. baseUrl: config.base_url,
  108. pageType: 1,
  109. tabTextTow: [],
  110. curTabTow: null,
  111. form: {
  112. imgDtoList: [],
  113. },
  114. lotName: null,
  115. optionData: {
  116. },
  117. dialogVisible: false,
  118. // 查询参数
  119. queryParams: {
  120. page: 1,
  121. pageSize: 20,
  122. },
  123. //符合/不符合
  124. checkFlag: null,
  125. total: 0,
  126. dataList: [],
  127. getDataType: false,
  128. searchIndex: 0,
  129. //检查项组件数据
  130. checkItemModuleType: false,
  131. propsData: {},
  132. inspectRemporary: false, //待检查
  133. inspectRemporaryList: [], //待检查
  134. optionData: {},
  135. checkPlanList:[],
  136. }
  137. },
  138. onLoad(option) {
  139. let optionData = JSON.parse(decodeURIComponent(option.infoData));
  140. console.log('检查项列表', optionData)
  141. uni.setNavigationBarTitle({
  142. title: optionData.subName + '(' + (optionData.pageType == 0 ? (optionData.roomNum ? optionData
  143. .roomNum : '-') : (optionData
  144. .subRoom ? optionData
  145. .subRoom : '-')) + ')'
  146. })
  147. this.$set(this, 'pageType', optionData.pageType);
  148. this.$set(this, 'lotName',
  149. optionData.pageType == 0 ? optionData.checkPlanSetVoList.checkName :
  150. (optionData.checkPlanSetVoList.overdueUnrectify ? '整改期限' + optionData.checkPlanSetVoList.rectifyDeadline +'(逾期未完成整改关闭实验室)' : '整改期限' + optionData.checkPlanSetVoList.rectifyDeadline));
  151. this.$set(this, 'tabTextTow',
  152. optionData.pageType == 0 ? (optionData.manageStatus == 2 ? [{
  153. value: '1',
  154. label: '已检查'
  155. }] : [
  156. // {
  157. // value: '0',
  158. // label: '待检查'
  159. // },
  160. {
  161. value: '1',
  162. label: '已检查'
  163. }]) : (
  164. optionData.pageType == 1 ? [{
  165. value: '0',
  166. label: '待复查'
  167. }, {
  168. value: '1',
  169. label: '复查完毕'
  170. }, {
  171. value: '2',
  172. label: '退回整改'
  173. }] : (
  174. optionData.pageType == 2 ? [{
  175. value: '2',
  176. label: '待整改'
  177. }, {
  178. value: '1',
  179. label: '已整改'
  180. }, {
  181. value: '4',
  182. label: '暂无法整改'
  183. }] : []
  184. )))
  185. if (optionData.pageType == 0) {
  186. if (optionData.manageStatus == 2) {
  187. this.$set(this, 'curTabTow', '1');
  188. }else{
  189. this.$set(this, 'curTabTow',
  190. optionData.pageType == 0 ? (optionData.curTabTow == 1 ? '1' : '1') : (
  191. optionData.pageType == 1 ? '0' : (
  192. optionData.pageType == 2 ? '2' : '')));
  193. }
  194. } else {
  195. this.$set(this, 'curTabTow',
  196. optionData.pageType == 0 ? (optionData.curTabTow == 1 ? '1' : '0') : (
  197. optionData.pageType == 1 ? '0' : (
  198. optionData.pageType == 2 ? '2' : '')));
  199. }
  200. this.$set(this, 'optionData', optionData);
  201. this.$nextTick(() => {
  202. this.getList()
  203. })
  204. },
  205. onShow() {
  206. },
  207. mounted() {
  208. if (this.optionData.pageType == 0) {
  209. this.securityCheckOptionSelAllList();
  210. if (this.optionData.manageStatus == 2) {
  211. this.securityAppCheckSetOptionList(this.optionData, 1)
  212. } else {
  213. this.securityAppCheckSetOptionList(this.optionData, 0)
  214. }
  215. }
  216. },
  217. methods: {
  218. //滚动事件
  219. scrollGet() {
  220. let self = this;
  221. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  222. this.$set(this, 'getDataType', true);
  223. } else {
  224. this.queryParams.page += 1;
  225. this.$nextTick(() => {
  226. this.getList();
  227. })
  228. }
  229. },
  230. //顶部tab点击
  231. tabClickTow(value) {
  232. if(this.curTabTow != value){
  233. this.$set(this, 'checkFlag', null);
  234. this.$set(this.queryParams, 'page', 1);
  235. this.$set(this, 'curTabTow', value);
  236. this.$set(this, 'total', 0);
  237. this.$set(this, 'dataList', []);
  238. this.$nextTick(() => {
  239. this.getList();
  240. })
  241. }
  242. },
  243. dialogOpen() {
  244. this.dialogVisible = true;
  245. },
  246. dialogClose() {
  247. this.dialogVisible = false;
  248. },
  249. //符合/不符合
  250. checkFlagChange(type) {
  251. if (this.checkFlag == type) {
  252. this.$set(this, 'checkFlag', null);
  253. } else {
  254. this.$set(this, 'checkFlag', type);
  255. }
  256. this.$set(this.queryParams, 'page', 1);
  257. this.getList()
  258. },
  259. checkItemModuleButton(type, item) {
  260. if (type == 'open') {
  261. let obj = {
  262. infoType: this.pageType,
  263. checkType: this.curTabTow,
  264. }
  265. if (this.pageType == 0) {
  266. //检查
  267. obj.manageId = this.optionData.manageId
  268. if (this.optionData.manageStatus == 2) {
  269. obj.checkType = 1
  270. }
  271. } else if (this.pageType != 0) {
  272. //复查/整改
  273. obj.planId = this.optionData.checkPlanSetVoList.planId;
  274. obj.planSetId = this.optionData.checkPlanSetVoList.planSetId;
  275. obj.subId = this.optionData.subId;
  276. }
  277. this.$set(this, 'propsData', obj);
  278. this.$set(this, 'checkItemModuleType', true);
  279. } else if (type == 'out') {
  280. this.$set(this, 'checkItemModuleType', false);
  281. this.$set(this, 'propsData', {});
  282. } else if (type == 'submit') {
  283. this.itemsClick(item);
  284. }
  285. },
  286. /******调用摄像头******/
  287. saoCode() {
  288. let self = this;
  289. uni.scanCode({
  290. onlyFromCamera: true,
  291. success: function(res) {
  292. let list = res.result.split("?")[1].split("&");
  293. let codeData = {};
  294. list.forEach((item) => {
  295. codeData[item.split("=")[0]] = item.split("=")[1];
  296. })
  297. if (codeData.code) {
  298. self.saoList(codeData.subId);
  299. } else {
  300. uni.showToast({
  301. title: '请扫描正确的二维码',
  302. icon: "none",
  303. mask: true,
  304. duration: 2000
  305. });
  306. }
  307. }
  308. });
  309. },
  310. //扫一扫查询数据
  311. async saoList(subId) {
  312. let obj = {
  313. planSetId: this.optionData.checkPlanSetVoList.planSetId,
  314. subId: subId,
  315. }
  316. if (this.pageType == 0) {
  317. //检查计划
  318. const {
  319. data
  320. } = await securityAppCheckManageList(obj);
  321. if (data.code == 200) {
  322. if (data.data.records[0]) {
  323. this.securityAppCheckSetOptionListTow(data.data.records[0], 0)
  324. //跳转检查项列表页面
  325. /* let infoData = data.data.records[0];
  326. infoData.pageType = this.tabIndexTow;
  327. infoData.checkPlanSetVoList = this.optionData.checkPlanSetVoList;
  328. uni.navigateTo({
  329. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' +
  330. encodeURIComponent(
  331. JSON.stringify(infoData))
  332. }); */
  333. } else {
  334. //未找到数据提示
  335. uni.showToast({
  336. title: '未找到该实验室与本计划批次关联的数据',
  337. icon: "none",
  338. mask: true,
  339. duration: 2000
  340. });
  341. }
  342. }
  343. } else if (this.pageType == 1) {
  344. //复查计划
  345. obj.planId = this.optionData.checkPlanSetVoList.planId;
  346. obj.userId = uni.getStorageSync('userId');
  347. const {
  348. data
  349. } = await securityAppCheckDangerReviewSubList(obj);
  350. if (data.code == 200) {
  351. if (data.data[0] && data.data[0].stayExamineCheckNum != 0) {
  352. //跳转检查项列表页面
  353. let infoData = data.data[0];
  354. infoData.pageType = this.pageType;
  355. infoData.checkPlanSetVoList = this.optionData.checkPlanSetVoList;
  356. uni.navigateTo({
  357. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' +
  358. encodeURIComponent(
  359. JSON.stringify(infoData))
  360. });
  361. } else {
  362. //未找到数据提示
  363. uni.showToast({
  364. title: '未找到该实验室与本计划批次关联的数据',
  365. icon: "none",
  366. mask: true,
  367. duration: 2000
  368. });
  369. }
  370. }
  371. } else if (this.pageType == 2) {
  372. //整改计划
  373. obj.planId = this.optionData.checkPlanSetVoList.planId;
  374. obj.userId = uni.getStorageSync('userId');
  375. const {
  376. data
  377. } = await securityAppCheckDangerGetCheckDangerSubList(obj);
  378. if (data.code == 200) {
  379. if (data.data[0]) {
  380. //跳转检查项列表页面
  381. let infoData = data.data[0];
  382. infoData.pageType = this.tabIndexTow;
  383. infoData.checkPlanSetVoList = this.optionData.checkPlanSetVoList;
  384. uni.navigateTo({
  385. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' +
  386. encodeURIComponent(
  387. JSON.stringify(infoData))
  388. });
  389. } else {
  390. //未找到数据提示
  391. uni.showToast({
  392. title: '未找到该实验室与本计划批次关联的数据',
  393. icon: "none",
  394. mask: true,
  395. duration: 2000
  396. });
  397. }
  398. }
  399. }
  400. },
  401. //检查项选中
  402. itemsClick(row) {
  403. let infoData = this.optionData;
  404. infoData.pageType = this.pageType;
  405. infoData.checkDraftVo = row.checkDraftVo;
  406. infoData.itemsStatus = this.curTabTow;
  407. infoData.setOptionId = row.setOptionId;
  408. infoData.hazardCheckPro = row.hazardCheckPro;
  409. /* infoData.checkCategory = this.optionData.checkCategory;
  410. infoData.checkPlanSetVoList = this.optionData.checkPlanSetVoList; */
  411. if (this.pageType == 0 && this.curTabTow == 0) {
  412. //待检查
  413. uni.redirectTo({
  414. url: '/pages_safetyCheck/views/inspectManage/conductInspections?infoData=' +
  415. encodeURIComponent(
  416. JSON
  417. .stringify(infoData))
  418. });
  419. }
  420. if (this.pageType == 0 && this.curTabTow == 1) {
  421. //已检查
  422. uni.redirectTo({
  423. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  424. encodeURIComponent(JSON
  425. .stringify(infoData))
  426. });
  427. } else if (this.pageType == 1 && this.curTabTow == 0) {
  428. //待复查
  429. uni.redirectTo({
  430. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerRectification?infoData=' +
  431. encodeURIComponent(JSON
  432. .stringify(infoData))
  433. });
  434. } else if (this.pageType == 1 && this.curTabTow == 1) {
  435. //复查完毕
  436. uni.redirectTo({
  437. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  438. encodeURIComponent(JSON
  439. .stringify(infoData))
  440. });
  441. } else if (this.pageType == 1 && this.curTabTow == 2) {
  442. //退回整改
  443. uni.redirectTo({
  444. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  445. encodeURIComponent(JSON
  446. .stringify(infoData))
  447. });
  448. } else if (this.pageType == 2 && this.curTabTow == 2) {
  449. //待整改
  450. uni.redirectTo({
  451. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerRectification?infoData=' +
  452. encodeURIComponent(JSON
  453. .stringify(infoData))
  454. });
  455. } else if (this.pageType == 2 && this.curTabTow == 1) {
  456. //已完成
  457. uni.redirectTo({
  458. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  459. encodeURIComponent(JSON
  460. .stringify(infoData))
  461. });
  462. } else if (this.pageType == 2 && this.curTabTow == 4) {
  463. //暂无法整改
  464. uni.redirectTo({
  465. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  466. encodeURIComponent(JSON
  467. .stringify(infoData))
  468. });
  469. }
  470. },
  471. hiddenDangerClick(row) {
  472. let infoData = this.optionData;
  473. infoData.hazardCheckPro = row.hazardCheckPro;
  474. infoData.pageType = this.pageType;
  475. infoData.itemsStatus = this.curTabTow;
  476. infoData.hiddenDangerRecordStatus = true; //判断是否跳转隐患列表
  477. uni.redirectTo({
  478. url: '/pages_safetyCheck/views/inspectManage/hiddenDangerRecord?infoData=' +
  479. encodeURIComponent(JSON.stringify(infoData))
  480. });
  481. },
  482. //
  483. async getList() {
  484. let self = this;
  485. let obj = JSON.parse(JSON.stringify(this.queryParams))
  486. if (this.pageType == 0) {
  487. //检查任务
  488. obj.manageId = this.optionData.manageId;
  489. obj.checkFlag = this.checkFlag;
  490. if (this.optionData.pageType == 0) {
  491. if (this.optionData.manageStatus == 2) {
  492. obj.checkStatus = 1
  493. } else {
  494. obj.checkStatus = this.curTabTow;
  495. }
  496. }
  497. const {
  498. data
  499. } = await securityAppCheckSetOptionList(obj);
  500. if (data.code == 200) {
  501. if (self.queryParams.page == 1) {
  502. this.dataList = data.data.records;
  503. this.total = data.data.total;
  504. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  505. this.$set(this, 'getDataType', true);
  506. }
  507. } else {
  508. this.dataList = [...this.dataList, ...data.data.records]
  509. this.total = data.data.total;
  510. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  511. this.$set(this, 'getDataType', true);
  512. }
  513. }
  514. }
  515. } else if (this.pageType == 1) {
  516. //复查验证
  517. obj.planId = this.optionData.checkPlanSetVoList.planId;
  518. obj.planSetId = this.optionData.checkPlanSetVoList.planSetId;
  519. obj.subId = this.optionData.subId;
  520. obj.appReviewStatus = this.curTabTow;
  521. obj.pageFlag = true;
  522. const {
  523. data
  524. } = await securityAppCheckDangerReviewList(obj);
  525. if (data.code == 200) {
  526. if (self.queryParams.page == 1) {
  527. this.dataList = data.data.records;
  528. this.total = data.data.total;
  529. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  530. this.$set(this, 'getDataType', true);
  531. }
  532. } else {
  533. this.dataList = [...this.dataList, ...data.data.records]
  534. this.total = data.data.total;
  535. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  536. this.$set(this, 'getDataType', true);
  537. }
  538. }
  539. }
  540. } else if (this.pageType == 2) {
  541. //隐患整改
  542. obj.planId = this.optionData.checkPlanSetVoList.planId;
  543. obj.planSetId = this.optionData.checkPlanSetVoList.planSetId;
  544. obj.subId = this.optionData.subId;
  545. obj.rectifyStatus = this.curTabTow;
  546. obj.pageFlag = true;
  547. const {
  548. data
  549. } = await securityAppCheckDangerGetCheckDangerSubId(obj);
  550. if (data.code == 200) {
  551. if (self.queryParams.page == 1) {
  552. this.dataList = data.data.records;
  553. this.total = data.data.total;
  554. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  555. this.$set(this, 'getDataType', true);
  556. }
  557. } else {
  558. this.dataList = [...this.dataList, ...data.data.records]
  559. this.total = data.data.total;
  560. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  561. this.$set(this, 'getDataType', true);
  562. }
  563. }
  564. }
  565. }
  566. },
  567. //查询当前实验室检查项
  568. async securityAppCheckSetOptionList(item, checkStatus) {
  569. let self = this;
  570. let upData = item;
  571. let obj = {
  572. page: 1,
  573. pageSize: 20,
  574. checkStatus: checkStatus,
  575. manageId: upData.manageId,
  576. }
  577. this.inspectRemporaryList = [];
  578. const {
  579. data
  580. } = await securityAppCheckSetOptionList(obj);
  581. if (data.code == 200 && checkStatus == 0) { //先查询待检查数据
  582. if (data.data.records[0]) {
  583. self.inspectRemporary = true;
  584. this.inspectRemporaryList = JSON.parse(JSON.stringify(data.data.records))
  585. }
  586. }
  587. },
  588. //查询扫码进入的实验室检查项
  589. async securityAppCheckSetOptionListTow(item, checkStatus) {
  590. let self = this;
  591. let upData = item;
  592. let obj = {
  593. page: 1,
  594. pageSize: 20,
  595. checkStatus: checkStatus,
  596. manageId: upData.manageId,
  597. }
  598. this.inspectRemporaryList = [];
  599. const {
  600. data
  601. } = await securityAppCheckSetOptionList(obj);
  602. if (data.code == 200 && checkStatus == 0) { //先查询待检查数据
  603. if (data.data.records[0]) {
  604. let infoData = self.optionData;
  605. infoData.pageType = 0;
  606. infoData.subName = upData.subName;
  607. infoData.roomNum = upData.roomNum;
  608. infoData.subId = data.data.records[0].subId;
  609. infoData.manageId = data.data.records[0].manageId;
  610. infoData.setOptionId = data.data.records[0].setOptionId;
  611. infoData.hazardCheckPro = data.data.records[0].hazardCheckPro;
  612. infoData.checkCategory = data.data.records[0].checkCategory;
  613. uni.navigateTo({
  614. url: '/pages_safetyCheck/views/inspectManage/conductInspections?infoData=' +
  615. encodeURIComponent(
  616. JSON
  617. .stringify(infoData))
  618. });
  619. } else {
  620. uni.showToast({
  621. title: '该实验室暂无检查工作!',
  622. icon: "none",
  623. mask: true,
  624. duration: 2000
  625. });
  626. }
  627. }
  628. },
  629. //检查完成
  630. async submitBtn(status) {
  631. if (status == 1) {
  632. //开展检查
  633. let infoData = this.checkPlanList[0];
  634. infoData.manageId = this.optionData.manageId;
  635. infoData.planSetId = this.optionData.planSetId;
  636. infoData.hazardCheckPro = this.checkPlanList[0].hazardCheckPro;
  637. infoData.pageType = this.pageType;
  638. infoData.itemsStatus = this.curTabTow;
  639. infoData.checkCategory = this.optionData.checkCategory;
  640. infoData.checkPlanSetVoList = this.optionData.checkPlanSetVoList;
  641. infoData.subId = this.optionData.subId;
  642. infoData.subName = this.optionData.subName;
  643. infoData.roomNum = this.optionData.roomNum;
  644. infoData.subRoom = this.optionData.subRoom;
  645. uni.redirectTo({
  646. url: '/pages_safetyCheck/views/inspectManage/conductInspections?infoData=' +
  647. encodeURIComponent(
  648. JSON
  649. .stringify(infoData))
  650. });
  651. }
  652. },
  653. //基础检查项检查
  654. async securityCheckOptionSelAllList() {
  655. let self = this;
  656. const {
  657. data
  658. } = await securityCheckOptionSelAllList({});
  659. if (data.code == 200) {
  660. let maxList = this.getCascaderData(JSON.parse(JSON.stringify(data.data)), 2)
  661. this.$nextTick(() => {
  662. this.securityAppCheckPlanSetGetOptionList(maxList);
  663. })
  664. }
  665. },
  666. //查询批次下-检查项
  667. async securityAppCheckPlanSetGetOptionList(maxList){
  668. let self = this;
  669. const {
  670. data
  671. } = await securityAppCheckPlanSetGetOptionList({
  672. planSetId:this.optionData.planSetId,
  673. searchValue: this.searchValue
  674. });
  675. if (data.code == 200) {
  676. if (data.data[0]) {
  677. let minList = JSON.parse(JSON.stringify(data.data))
  678. this.newCascadeData(maxList, minList);
  679. }
  680. }
  681. },
  682. newCascadeData(maxList, minList) {
  683. let list = [];
  684. for (let i = 0; i < maxList.length; i++) {
  685. for (let o = 0; o < maxList[i].children.length; o++) {
  686. for (let x = 0; x < minList.length; x++) {
  687. if (maxList[i].children[o].id == minList[x].parentId) {
  688. // //三级
  689. minList[x].level = 3;
  690. minList[x].hazardCheckPro = minList[x].id
  691. minList[x].hazardCheckCode = minList[x].code
  692. minList[x].hazardCheckName = minList[x].name
  693. minList[x].hazardCheckPro2 = maxList[i].children[o].id
  694. minList[x].hazardCheckCode2 = maxList[i].children[o].code
  695. minList[x].hazardCheckName2 = maxList[i].children[o].name
  696. minList[x].hazardCheckPro1 = maxList[i].id
  697. minList[x].hazardCheckCode1 = maxList[i].code
  698. minList[x].hazardCheckName1 = maxList[i].name
  699. minList[x].hazardCheckPoint = minList[x].mainPoint.split('#')[0]
  700. list.push(minList[x])
  701. }
  702. }
  703. }
  704. }
  705. this.$set(this, 'checkPlanList', JSON.parse(JSON.stringify(list)));
  706. },
  707. /********************** 检查项格式处理 **********************/
  708. getCascaderData(list, type) {
  709. let self = this
  710. for (let i = 0; i < list.length; i++) {
  711. if (list[i].level == type) {
  712. delete list[i].children
  713. } else if (list[i].children) {
  714. if (list[i].children[0]) {
  715. list[i].children = self.getCascaderData(list[i].children, type)
  716. } else {
  717. list.splice(i, 1)
  718. i--
  719. }
  720. } else {
  721. list.splice(i, 1)
  722. i--
  723. }
  724. }
  725. for (let i = 0; i < list.length; i++) {
  726. if (list[i].level == type) {
  727. delete list[i].children
  728. } else if (list[i].children) {
  729. if (list[i].children[0]) {
  730. list[i].children = self.getCascaderData(list[i].children, type)
  731. } else {
  732. list.splice(i, 1)
  733. i--
  734. }
  735. } else {
  736. list.splice(i, 1)
  737. i--
  738. }
  739. }
  740. for (let i = 0; i < list.length; i++) {
  741. if (list[i].level == type) {
  742. delete list[i].children
  743. } else if (list[i].children) {
  744. if (list[i].children[0]) {
  745. list[i].children = self.getCascaderData(list[i].children, type)
  746. } else {
  747. list.splice(i, 1)
  748. i--
  749. }
  750. } else {
  751. list.splice(i, 1)
  752. i--
  753. }
  754. }
  755. return list
  756. },
  757. }
  758. }
  759. </script>
  760. <style lang="stylus" scoped>
  761. .hiddenDangerItems {
  762. height: 100%;
  763. display flex;
  764. flex-direction: column;
  765. overflow: hidden;
  766. box-sizing: border-box;
  767. #totalColor-A {
  768. color: #0183FA;
  769. background: rgba(1, 131, 250, 0.2);
  770. }
  771. #totalColor-B {
  772. color: #16B531;
  773. background: rgba(22, 181, 49, 0.2);
  774. }
  775. #totalColor-C {
  776. color: #FF8C00;
  777. background: rgba(255, 140, 0, 0.2);
  778. }
  779. .header {
  780. width: 100%;
  781. height: 268rpx;
  782. overflow: hidden;
  783. background: #fff;
  784. .lotName {
  785. height: 70rpx;
  786. line-height: 70rpx;
  787. font-size: 28rpx;
  788. background: rgba(1, 131, 250, 0.2);
  789. color: #0183FA;
  790. text-align: center;
  791. }
  792. .lotNameOne {
  793. background: #F7E0C4;
  794. color: #FF8C00;
  795. }
  796. .tabTitle_tow {
  797. width: 320rpx;
  798. height: 80rpx;
  799. display flex;
  800. justify-content: flex-start;
  801. align-items: center;
  802. .tabTitle_tow_li {
  803. flex: 1;
  804. position: relative;
  805. text-align center;
  806. .tabTitle_tow_text {
  807. display: inline-block;
  808. font-size: 30rpx;
  809. font-family: PingFang SC;
  810. font-weight: 500;
  811. color: #333333;
  812. line-height: 46rpx;
  813. position: relative;
  814. &.on {
  815. color: #0183FA;
  816. }
  817. }
  818. .tabTitle_tow_across {
  819. width: 50rpx;
  820. height: 4rpx;
  821. background: #0183FA;
  822. border-radius: 2rpx;
  823. margin:0 auto 0;
  824. display none;
  825. &.on {
  826. display block;
  827. }
  828. }
  829. }
  830. }
  831. .line {
  832. width: 100%;
  833. height: 13rpx;
  834. background: #F5F5F5;
  835. }
  836. .search {
  837. width: 750rpx;
  838. height: 80rpx;
  839. background: #FFFFFF;
  840. border-radius: 0rpx 0rpx 0rpx 0rpx;
  841. display: flex;
  842. justify-content: flex-start;
  843. align-items: center;
  844. .search-l {
  845. display: flex;
  846. justify-content: flex-start;
  847. align-items: center;
  848. margin: 0 20rpx 0 30rpx;
  849. .search-A {
  850. border-radius: 50rpx 50rpx 50rpx 50rpx;
  851. border: 1rpx solid #E0E0E0;
  852. width: 100rpx;
  853. height: 60rpx;
  854. background: #E0E0E0;
  855. font-weight: normal;
  856. font-size: 24rpx;
  857. color: #333333;
  858. line-height: 60rpx;
  859. text-align: center;
  860. margin-right: 10rpx;
  861. }
  862. .search-B {
  863. border-radius: 50rpx 50rpx 50rpx 50rpx;
  864. border: 1rpx solid #0183FA;
  865. width: 100rpx;
  866. height: 60rpx;
  867. background: #0183FA;
  868. font-weight: normal;
  869. font-size: 24rpx;
  870. color: #FFFFFF;
  871. line-height: 60rpx;
  872. text-align: center;
  873. margin-right: 10rpx;
  874. }
  875. }
  876. .search-r-margin {
  877. width: 700rpx !important;
  878. margin: 0 auto;
  879. }
  880. .search-r {
  881. width: 440rpx;
  882. height: 60rpx;
  883. background: #FFFFFF;
  884. border-radius: 50rpx 50rpx 50rpx 50rpx;
  885. border: 1rpx solid #E0E0E0;
  886. font-size: 24rpx;
  887. color: #999999;
  888. line-height: 60rpx;
  889. text-align: left;
  890. display: flex;
  891. justify-content: flex-start;
  892. align-items: center;
  893. padding: 0 20rpx;
  894. box-sizing: border-box;
  895. >img {
  896. width: 30rpx;
  897. height: 30rpx;
  898. margin-right: 20rpx;
  899. }
  900. }
  901. }
  902. }
  903. .list {
  904. width: 750rpx;
  905. background: #FFFFFF;
  906. padding-bottom: 20rpx;
  907. box-sizing: border-box;
  908. .total {
  909. display: inline-block;
  910. height: 50rpx;
  911. background: rgba(1, 131, 250, 0.2);
  912. border-radius: 0rpx 0rpx 20rpx 0rpx;
  913. font-size: 24rpx;
  914. color: #0183FA;
  915. line-height: 50rpx;
  916. text-align: left;
  917. padding: 0rpx 22rpx;
  918. box-sizing: border-box;
  919. margin-bottom: 20rpx;
  920. }
  921. .total-color-1 {
  922. background: rgba(1, 131, 250, 0.2);
  923. color: #0183FA;
  924. }
  925. .total-color-2 {
  926. background: rgba(22, 181, 49, 0.2);
  927. color: #16B531;
  928. }
  929. .total-color-3 {
  930. background: #F7E0C4;
  931. color: #FF8C00;
  932. }
  933. .list-li {
  934. margin: 0 30rpx;
  935. .list-li-t {
  936. width: 690rpx;
  937. background: #F5F5F5;
  938. border-radius: 10rpx 10rpx 10rpx 10rpx;
  939. display: flex;
  940. justify-content: flex-start;
  941. padding: 12rpx 20rpx 14rpx 14rpx;
  942. box-sizing: border-box;
  943. margin: 20rpx 0;
  944. >view:nth-of-type(1) {
  945. >img {
  946. width: 24rpx;
  947. height: 24rpx;
  948. margin-right: 30rpx;
  949. }
  950. }
  951. >view:nth-of-type(2) {
  952. flex: 1;
  953. font-size: 28rpx;
  954. color: #3D3D3D;
  955. line-height: 40rpx;
  956. text-align: left;
  957. }
  958. }
  959. .list-li-b {
  960. font-size: 28rpx;
  961. color: #3D3D3D;
  962. line-height: 40rpx;
  963. text-align: right;
  964. >text {
  965. color: #FF0000;
  966. }
  967. }
  968. }
  969. }
  970. .get-data-p {
  971. height: 100rpx;
  972. text-align: center;
  973. .get-data-img {
  974. width: 30rpx;
  975. height: 30rpx;
  976. margin: 0 auto;
  977. margin-top: 15rpx;
  978. }
  979. .get-data-text {
  980. text-align: center;
  981. }
  982. }
  983. .get-data-null-p {
  984. height: 100rpx;
  985. line-height: 100rpx;
  986. text-align: center;
  987. }
  988. .subBtn {
  989. display: flex;
  990. justify-content: center;
  991. position: fixed;
  992. bottom: 30rpx;
  993. width: 750rpx;
  994. padding: 0 46rpx;
  995. box-sizing: border-box;
  996. >img {
  997. width: 160rpx;
  998. height: 160rpx;
  999. }
  1000. }
  1001. .sub-btn {
  1002. display: flex;
  1003. justify-content: center;
  1004. position: fixed;
  1005. left: 30rpx;
  1006. bottom: 30rpx;
  1007. width: 690rpx;
  1008. height: 100rpx;
  1009. background: #0183FA;
  1010. border-radius: 50rpx 50rpx 50rpx 50rpx;
  1011. font-size: 30rpx;
  1012. color: #FFFFFF;
  1013. line-height: 100rpx;
  1014. text-align: center;
  1015. }
  1016. }
  1017. </style>