hiddenDangerItems.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  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 && optionData.manageStatus !=2"
  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. uni.setNavigationBarTitle({
  141. title: optionData.subName + '(' + (optionData.pageType == 0 ? (optionData.roomNum ? optionData
  142. .roomNum : '-') : (optionData
  143. .subRoom ? optionData
  144. .subRoom : '-')) + ')'
  145. })
  146. this.$set(this, 'pageType', optionData.pageType);
  147. this.$set(this, 'lotName',
  148. optionData.pageType == 0 ? optionData.checkPlanSetVoList.checkName :
  149. (optionData.checkPlanSetVoList.overdueUnrectify ? '整改期限' + optionData.checkPlanSetVoList.rectifyDeadline +'(逾期未完成整改关闭实验室)' : '整改期限' + optionData.checkPlanSetVoList.rectifyDeadline));
  150. this.$set(this, 'tabTextTow',
  151. optionData.pageType == 0 ? (optionData.manageStatus == 2 ? [{
  152. value: '1',
  153. label: '已检查'
  154. }] : [
  155. // {
  156. // value: '0',
  157. // label: '待检查'
  158. // },
  159. {
  160. value: '1',
  161. label: '已检查'
  162. }]) : (
  163. optionData.pageType == 1 ? [{
  164. value: '0',
  165. label: '待复查'
  166. }, {
  167. value: '1',
  168. label: '复查完毕'
  169. }, {
  170. value: '2',
  171. label: '退回整改'
  172. }] : (
  173. optionData.pageType == 2 ? [{
  174. value: '2',
  175. label: '待整改'
  176. }, {
  177. value: '1',
  178. label: '已整改'
  179. }, {
  180. value: '4',
  181. label: '暂无法整改'
  182. }] : []
  183. )))
  184. if (optionData.pageType == 0) {
  185. if (optionData.manageStatus == 2) {
  186. this.$set(this, 'curTabTow', '1');
  187. }else{
  188. this.$set(this, 'curTabTow',
  189. optionData.pageType == 0 ? (optionData.curTabTow == 1 ? '1' : '1') : (
  190. optionData.pageType == 1 ? '0' : (
  191. optionData.pageType == 2 ? '2' : '')));
  192. }
  193. } else {
  194. this.$set(this, 'curTabTow',
  195. optionData.pageType == 0 ? (optionData.curTabTow == 1 ? '1' : '0') : (
  196. optionData.pageType == 1 ? '0' : (
  197. optionData.pageType == 2 ? '2' : '')));
  198. }
  199. this.$set(this, 'optionData', optionData);
  200. this.$nextTick(() => {
  201. this.getList()
  202. })
  203. },
  204. onShow() {
  205. },
  206. mounted() {
  207. if (this.optionData.pageType == 0) {
  208. this.securityCheckOptionSelAllList();
  209. if (this.optionData.manageStatus == 2) {
  210. this.securityAppCheckSetOptionList(this.optionData, 1)
  211. } else {
  212. this.securityAppCheckSetOptionList(this.optionData, 0)
  213. }
  214. }
  215. },
  216. methods: {
  217. //滚动事件
  218. scrollGet() {
  219. let self = this;
  220. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  221. this.$set(this, 'getDataType', true);
  222. } else {
  223. this.queryParams.page += 1;
  224. this.$nextTick(() => {
  225. this.getList();
  226. })
  227. }
  228. },
  229. //顶部tab点击
  230. tabClickTow(value) {
  231. if(this.curTabTow != value){
  232. this.$set(this, 'checkFlag', null);
  233. this.$set(this.queryParams, 'page', 1);
  234. this.$set(this, 'curTabTow', value);
  235. this.$set(this, 'total', 0);
  236. this.$set(this, 'dataList', []);
  237. this.$nextTick(() => {
  238. this.getList();
  239. })
  240. }
  241. },
  242. dialogOpen() {
  243. this.dialogVisible = true;
  244. },
  245. dialogClose() {
  246. this.dialogVisible = false;
  247. },
  248. //符合/不符合
  249. checkFlagChange(type) {
  250. if (this.checkFlag == type) {
  251. this.$set(this, 'checkFlag', null);
  252. } else {
  253. this.$set(this, 'checkFlag', type);
  254. }
  255. this.$set(this.queryParams, 'page', 1);
  256. this.getList()
  257. },
  258. checkItemModuleButton(type, item) {
  259. if (type == 'open') {
  260. let obj = {
  261. infoType: this.pageType,
  262. checkType: this.curTabTow,
  263. }
  264. if (this.pageType == 0) {
  265. //检查
  266. obj.manageId = this.optionData.manageId
  267. // obj.planSetId = this.optionData.planSetId
  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. infoData.manageId = this.optionData.manageId;
  357. uni.navigateTo({
  358. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' +
  359. encodeURIComponent(
  360. JSON.stringify(infoData))
  361. });
  362. } else {
  363. //未找到数据提示
  364. uni.showToast({
  365. title: '未找到该实验室与本计划批次关联的数据',
  366. icon: "none",
  367. mask: true,
  368. duration: 2000
  369. });
  370. }
  371. }
  372. } else if (this.pageType == 2) {
  373. //整改计划
  374. obj.planId = this.optionData.checkPlanSetVoList.planId;
  375. obj.userId = uni.getStorageSync('userId');
  376. const {
  377. data
  378. } = await securityAppCheckDangerGetCheckDangerSubList(obj);
  379. if (data.code == 200) {
  380. if (data.data[0]) {
  381. //跳转检查项列表页面
  382. let infoData = data.data[0];
  383. infoData.pageType = this.tabIndexTow;
  384. infoData.checkPlanSetVoList = this.optionData.checkPlanSetVoList;
  385. infoData.manageId = this.optionData.manageId;
  386. uni.navigateTo({
  387. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' +
  388. encodeURIComponent(
  389. JSON.stringify(infoData))
  390. });
  391. } else {
  392. //未找到数据提示
  393. uni.showToast({
  394. title: '未找到该实验室与本计划批次关联的数据',
  395. icon: "none",
  396. mask: true,
  397. duration: 2000
  398. });
  399. }
  400. }
  401. }
  402. },
  403. //检查项选中
  404. itemsClick(row) {
  405. let infoData = this.optionData;
  406. infoData.pageType = this.pageType;
  407. infoData.checkDraftVo = row.checkDraftVo;
  408. infoData.itemsStatus = this.curTabTow;
  409. infoData.setOptionId = row.setOptionId;
  410. infoData.hazardCheckPro = row.hazardCheckPro;
  411. infoData.manageId = this.optionData.manageId;
  412. /* infoData.checkCategory = this.optionData.checkCategory;
  413. infoData.checkPlanSetVoList = this.optionData.checkPlanSetVoList; */
  414. if (this.pageType == 0 && this.curTabTow == 0) {
  415. //待检查
  416. uni.redirectTo({
  417. url: '/pages_safetyCheck/views/inspectManage/conductInspections?infoData=' +
  418. encodeURIComponent(
  419. JSON
  420. .stringify(infoData))
  421. });
  422. }
  423. if (this.pageType == 0 && this.curTabTow == 1) {
  424. //已检查
  425. uni.redirectTo({
  426. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  427. encodeURIComponent(JSON
  428. .stringify(infoData))
  429. });
  430. } else if (this.pageType == 1 && this.curTabTow == 0) {
  431. //待复查
  432. uni.redirectTo({
  433. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerRectification?infoData=' +
  434. encodeURIComponent(JSON
  435. .stringify(infoData))
  436. });
  437. } else if (this.pageType == 1 && this.curTabTow == 1) {
  438. //复查完毕
  439. uni.redirectTo({
  440. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  441. encodeURIComponent(JSON
  442. .stringify(infoData))
  443. });
  444. } else if (this.pageType == 1 && this.curTabTow == 2) {
  445. //退回整改
  446. uni.redirectTo({
  447. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  448. encodeURIComponent(JSON
  449. .stringify(infoData))
  450. });
  451. } else if (this.pageType == 2 && this.curTabTow == 2) {
  452. //待整改
  453. uni.redirectTo({
  454. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerRectification?infoData=' +
  455. encodeURIComponent(JSON
  456. .stringify(infoData))
  457. });
  458. } else if (this.pageType == 2 && this.curTabTow == 1) {
  459. //已完成
  460. uni.redirectTo({
  461. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  462. encodeURIComponent(JSON
  463. .stringify(infoData))
  464. });
  465. } else if (this.pageType == 2 && this.curTabTow == 4) {
  466. //暂无法整改
  467. uni.redirectTo({
  468. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  469. encodeURIComponent(JSON
  470. .stringify(infoData))
  471. });
  472. }
  473. },
  474. hiddenDangerClick(row) {
  475. let infoData = this.optionData;
  476. infoData.hazardCheckPro = row.hazardCheckPro;
  477. infoData.pageType = this.pageType;
  478. infoData.itemsStatus = this.curTabTow;
  479. infoData.hiddenDangerRecordStatus = true; //判断是否跳转隐患列表
  480. uni.redirectTo({
  481. url: '/pages_safetyCheck/views/inspectManage/hiddenDangerRecord?infoData=' +
  482. encodeURIComponent(JSON.stringify(infoData))
  483. });
  484. },
  485. //
  486. async getList() {
  487. let self = this;
  488. let obj = JSON.parse(JSON.stringify(this.queryParams))
  489. if (this.pageType == 0) {
  490. //检查任务
  491. obj.manageId = this.optionData.manageId;
  492. obj.checkFlag = this.checkFlag;
  493. if (this.optionData.pageType == 0) {
  494. if (this.optionData.manageStatus == 2) {
  495. obj.checkStatus = 1
  496. } else {
  497. obj.checkStatus = this.curTabTow;
  498. }
  499. }
  500. const {
  501. data
  502. } = await securityAppCheckSetOptionList(obj);
  503. if (data.code == 200) {
  504. if (self.queryParams.page == 1) {
  505. this.dataList = data.data.records;
  506. this.total = data.data.total;
  507. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  508. this.$set(this, 'getDataType', true);
  509. }
  510. } else {
  511. this.dataList = [...this.dataList, ...data.data.records]
  512. this.total = data.data.total;
  513. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  514. this.$set(this, 'getDataType', true);
  515. }
  516. }
  517. }
  518. } else if (this.pageType == 1) {
  519. //复查验证
  520. obj.planId = this.optionData.checkPlanSetVoList.planId;
  521. obj.planSetId = this.optionData.checkPlanSetVoList.planSetId;
  522. obj.subId = this.optionData.subId;
  523. obj.appReviewStatus = this.curTabTow;
  524. obj.pageFlag = true;
  525. const {
  526. data
  527. } = await securityAppCheckDangerReviewList(obj);
  528. if (data.code == 200) {
  529. if (self.queryParams.page == 1) {
  530. this.dataList = data.data.records;
  531. this.total = data.data.total;
  532. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  533. this.$set(this, 'getDataType', true);
  534. }
  535. } else {
  536. this.dataList = [...this.dataList, ...data.data.records]
  537. this.total = data.data.total;
  538. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  539. this.$set(this, 'getDataType', true);
  540. }
  541. }
  542. }
  543. } else if (this.pageType == 2) {
  544. //隐患整改
  545. obj.planId = this.optionData.checkPlanSetVoList.planId;
  546. obj.planSetId = this.optionData.checkPlanSetVoList.planSetId;
  547. obj.subId = this.optionData.subId;
  548. obj.rectifyStatus = this.curTabTow;
  549. obj.pageFlag = true;
  550. const {
  551. data
  552. } = await securityAppCheckDangerGetCheckDangerSubId(obj);
  553. if (data.code == 200) {
  554. if (self.queryParams.page == 1) {
  555. this.dataList = data.data.records;
  556. this.total = data.data.total;
  557. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  558. this.$set(this, 'getDataType', true);
  559. }
  560. } else {
  561. this.dataList = [...this.dataList, ...data.data.records]
  562. this.total = data.data.total;
  563. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  564. this.$set(this, 'getDataType', true);
  565. }
  566. }
  567. }
  568. }
  569. },
  570. //查询当前实验室检查项
  571. async securityAppCheckSetOptionList(item, checkStatus) {
  572. let self = this;
  573. let upData = item;
  574. let obj = {
  575. page: 1,
  576. pageSize: 20,
  577. checkStatus: checkStatus,
  578. manageId: upData.manageId,
  579. }
  580. this.inspectRemporaryList = [];
  581. const {
  582. data
  583. } = await securityAppCheckSetOptionList(obj);
  584. if (data.code == 200 && checkStatus == 0) { //先查询待检查数据
  585. if (data.data.records[0]) {
  586. self.inspectRemporary = true;
  587. this.inspectRemporaryList = JSON.parse(JSON.stringify(data.data.records))
  588. }
  589. }
  590. },
  591. //查询扫码进入的实验室检查项
  592. async securityAppCheckSetOptionListTow(item, checkStatus) {
  593. let self = this;
  594. let upData = item;
  595. let obj = {
  596. page: 1,
  597. pageSize: 20,
  598. checkStatus: checkStatus,
  599. manageId: upData.manageId,
  600. }
  601. this.inspectRemporaryList = [];
  602. const {
  603. data
  604. } = await securityAppCheckSetOptionList(obj);
  605. if (data.code == 200 && checkStatus == 0) { //先查询待检查数据
  606. if (data.data.records[0]) {
  607. let infoData = self.optionData;
  608. infoData.pageType = 0;
  609. infoData.subName = upData.subName;
  610. infoData.roomNum = upData.roomNum;
  611. infoData.subId = data.data.records[0].subId;
  612. infoData.manageId = data.data.records[0].manageId;
  613. infoData.setOptionId = data.data.records[0].setOptionId;
  614. infoData.hazardCheckPro = data.data.records[0].hazardCheckPro;
  615. infoData.checkCategory = data.data.records[0].checkCategory;
  616. uni.navigateTo({
  617. url: '/pages_safetyCheck/views/inspectManage/conductInspections?infoData=' +
  618. encodeURIComponent(
  619. JSON
  620. .stringify(infoData))
  621. });
  622. } else {
  623. uni.showToast({
  624. title: '该实验室暂无检查工作!',
  625. icon: "none",
  626. mask: true,
  627. duration: 2000
  628. });
  629. }
  630. }
  631. },
  632. //检查完成
  633. async submitBtn(status) {
  634. if (status == 1) {
  635. //开展检查
  636. let infoData = this.checkPlanList[0];
  637. infoData.manageId = this.optionData.manageId;
  638. infoData.manageStatus = this.optionData.manageStatus;
  639. infoData.planSetId = this.optionData.planSetId;
  640. infoData.hazardCheckPro = this.checkPlanList[0].hazardCheckPro;
  641. infoData.pageType = this.pageType;
  642. infoData.itemsStatus = this.curTabTow;
  643. infoData.checkCategory = this.optionData.checkCategory;
  644. infoData.checkPlanSetVoList = this.optionData.checkPlanSetVoList;
  645. infoData.subId = this.optionData.subId;
  646. infoData.subName = this.optionData.subName;
  647. infoData.roomNum = this.optionData.roomNum;
  648. infoData.subRoom = this.optionData.subRoom;
  649. uni.redirectTo({
  650. url: '/pages_safetyCheck/views/inspectManage/conductInspections?infoData=' +
  651. encodeURIComponent(
  652. JSON
  653. .stringify(infoData))
  654. });
  655. }
  656. },
  657. //基础检查项检查
  658. async securityCheckOptionSelAllList() {
  659. let self = this;
  660. const {
  661. data
  662. } = await securityCheckOptionSelAllList({});
  663. if (data.code == 200) {
  664. let maxList = this.getCascaderData(JSON.parse(JSON.stringify(data.data)), 2)
  665. this.$nextTick(() => {
  666. this.securityAppCheckPlanSetGetOptionList(maxList);
  667. })
  668. }
  669. },
  670. //查询批次下-检查项
  671. async securityAppCheckPlanSetGetOptionList(maxList){
  672. let self = this;
  673. const {
  674. data
  675. } = await securityAppCheckPlanSetGetOptionList({
  676. planSetId:this.optionData.planSetId,
  677. searchValue: this.searchValue
  678. });
  679. if (data.code == 200) {
  680. if (data.data[0]) {
  681. let minList = JSON.parse(JSON.stringify(data.data))
  682. this.newCascadeData(maxList, minList);
  683. }
  684. }
  685. },
  686. newCascadeData(maxList, minList) {
  687. let list = [];
  688. for (let i = 0; i < maxList.length; i++) {
  689. for (let o = 0; o < maxList[i].children.length; o++) {
  690. for (let x = 0; x < minList.length; x++) {
  691. if (maxList[i].children[o].id == minList[x].parentId) {
  692. // //三级
  693. minList[x].level = 3;
  694. minList[x].hazardCheckPro = minList[x].id
  695. minList[x].hazardCheckCode = minList[x].code
  696. minList[x].hazardCheckName = minList[x].name
  697. minList[x].hazardCheckPro2 = maxList[i].children[o].id
  698. minList[x].hazardCheckCode2 = maxList[i].children[o].code
  699. minList[x].hazardCheckName2 = maxList[i].children[o].name
  700. minList[x].hazardCheckPro1 = maxList[i].id
  701. minList[x].hazardCheckCode1 = maxList[i].code
  702. minList[x].hazardCheckName1 = maxList[i].name
  703. minList[x].hazardCheckPoint = minList[x].mainPoint.split('#')[0]
  704. list.push(minList[x])
  705. }
  706. }
  707. }
  708. }
  709. this.$set(this, 'checkPlanList', JSON.parse(JSON.stringify(list)));
  710. },
  711. /********************** 检查项格式处理 **********************/
  712. getCascaderData(list, type) {
  713. let self = this
  714. for (let i = 0; i < list.length; i++) {
  715. if (list[i].level == type) {
  716. delete list[i].children
  717. } else if (list[i].children) {
  718. if (list[i].children[0]) {
  719. list[i].children = self.getCascaderData(list[i].children, type)
  720. } else {
  721. list.splice(i, 1)
  722. i--
  723. }
  724. } else {
  725. list.splice(i, 1)
  726. i--
  727. }
  728. }
  729. for (let i = 0; i < list.length; i++) {
  730. if (list[i].level == type) {
  731. delete list[i].children
  732. } else if (list[i].children) {
  733. if (list[i].children[0]) {
  734. list[i].children = self.getCascaderData(list[i].children, type)
  735. } else {
  736. list.splice(i, 1)
  737. i--
  738. }
  739. } else {
  740. list.splice(i, 1)
  741. i--
  742. }
  743. }
  744. for (let i = 0; i < list.length; i++) {
  745. if (list[i].level == type) {
  746. delete list[i].children
  747. } else if (list[i].children) {
  748. if (list[i].children[0]) {
  749. list[i].children = self.getCascaderData(list[i].children, type)
  750. } else {
  751. list.splice(i, 1)
  752. i--
  753. }
  754. } else {
  755. list.splice(i, 1)
  756. i--
  757. }
  758. }
  759. return list
  760. },
  761. }
  762. }
  763. </script>
  764. <style lang="stylus" scoped>
  765. .hiddenDangerItems {
  766. height: 100%;
  767. display flex;
  768. flex-direction: column;
  769. overflow: hidden;
  770. box-sizing: border-box;
  771. #totalColor-A {
  772. color: #0183FA;
  773. background: rgba(1, 131, 250, 0.2);
  774. }
  775. #totalColor-B {
  776. color: #16B531;
  777. background: rgba(22, 181, 49, 0.2);
  778. }
  779. #totalColor-C {
  780. color: #FF8C00;
  781. background: rgba(255, 140, 0, 0.2);
  782. }
  783. .header {
  784. width: 100%;
  785. height: 174rpx;
  786. overflow: hidden;
  787. background: #fff;
  788. .lotName {
  789. height: 70rpx;
  790. line-height: 70rpx;
  791. font-size: 28rpx;
  792. background: rgba(1, 131, 250, 0.2);
  793. color: #0183FA;
  794. text-align: center;
  795. }
  796. .lotNameOne {
  797. background: #F7E0C4;
  798. color: #FF8C00;
  799. }
  800. .tabTitle_tow {
  801. width: 320rpx;
  802. height: 80rpx;
  803. display flex;
  804. justify-content: flex-start;
  805. align-items: center;
  806. .tabTitle_tow_li {
  807. flex: 1;
  808. position: relative;
  809. text-align center;
  810. .tabTitle_tow_text {
  811. display: inline-block;
  812. font-size: 30rpx;
  813. font-family: PingFang SC;
  814. font-weight: 500;
  815. color: #333333;
  816. line-height: 46rpx;
  817. position: relative;
  818. &.on {
  819. color: #0183FA;
  820. }
  821. }
  822. .tabTitle_tow_across {
  823. width: 50rpx;
  824. height: 4rpx;
  825. background: #0183FA;
  826. border-radius: 2rpx;
  827. margin:0 auto 0;
  828. display none;
  829. &.on {
  830. display block;
  831. }
  832. }
  833. }
  834. }
  835. .line {
  836. width: 100%;
  837. height: 13rpx;
  838. background: #F5F5F5;
  839. }
  840. .search {
  841. width: 750rpx;
  842. height: 80rpx;
  843. background: #FFFFFF;
  844. border-radius: 0rpx 0rpx 0rpx 0rpx;
  845. display: flex;
  846. justify-content: flex-start;
  847. align-items: center;
  848. .search-l {
  849. display: flex;
  850. justify-content: flex-start;
  851. align-items: center;
  852. margin: 0 20rpx 0 30rpx;
  853. .search-A {
  854. border-radius: 50rpx 50rpx 50rpx 50rpx;
  855. border: 1rpx solid #E0E0E0;
  856. width: 100rpx;
  857. height: 60rpx;
  858. background: #E0E0E0;
  859. font-weight: normal;
  860. font-size: 24rpx;
  861. color: #333333;
  862. line-height: 60rpx;
  863. text-align: center;
  864. margin-right: 10rpx;
  865. }
  866. .search-B {
  867. border-radius: 50rpx 50rpx 50rpx 50rpx;
  868. border: 1rpx solid #0183FA;
  869. width: 100rpx;
  870. height: 60rpx;
  871. background: #0183FA;
  872. font-weight: normal;
  873. font-size: 24rpx;
  874. color: #FFFFFF;
  875. line-height: 60rpx;
  876. text-align: center;
  877. margin-right: 10rpx;
  878. }
  879. }
  880. .search-r-margin {
  881. width: 700rpx !important;
  882. margin: 0 auto;
  883. }
  884. .search-r {
  885. width: 440rpx;
  886. height: 60rpx;
  887. background: #FFFFFF;
  888. border-radius: 50rpx 50rpx 50rpx 50rpx;
  889. border: 1rpx solid #E0E0E0;
  890. font-size: 24rpx;
  891. color: #999999;
  892. line-height: 60rpx;
  893. text-align: left;
  894. display: flex;
  895. justify-content: flex-start;
  896. align-items: center;
  897. padding: 0 20rpx;
  898. box-sizing: border-box;
  899. >img {
  900. width: 30rpx;
  901. height: 30rpx;
  902. margin-right: 20rpx;
  903. }
  904. }
  905. }
  906. }
  907. .list {
  908. width: 750rpx;
  909. background: #FFFFFF;
  910. padding-bottom: 20rpx;
  911. box-sizing: border-box;
  912. .total {
  913. display: inline-block;
  914. height: 50rpx;
  915. background: rgba(1, 131, 250, 0.2);
  916. border-radius: 0rpx 0rpx 20rpx 0rpx;
  917. font-size: 24rpx;
  918. color: #0183FA;
  919. line-height: 50rpx;
  920. text-align: left;
  921. padding: 0rpx 22rpx;
  922. box-sizing: border-box;
  923. margin-bottom: 20rpx;
  924. }
  925. .total-color-1 {
  926. background: rgba(1, 131, 250, 0.2);
  927. color: #0183FA;
  928. }
  929. .total-color-2 {
  930. background: rgba(22, 181, 49, 0.2);
  931. color: #16B531;
  932. }
  933. .total-color-3 {
  934. background: #F7E0C4;
  935. color: #FF8C00;
  936. }
  937. .list-li {
  938. margin: 0 30rpx;
  939. .list-li-t {
  940. width: 690rpx;
  941. background: #F5F5F5;
  942. border-radius: 10rpx 10rpx 10rpx 10rpx;
  943. display: flex;
  944. justify-content: flex-start;
  945. padding: 12rpx 20rpx 14rpx 14rpx;
  946. box-sizing: border-box;
  947. margin: 20rpx 0;
  948. >view:nth-of-type(1) {
  949. >img {
  950. width: 24rpx;
  951. height: 24rpx;
  952. margin-right: 30rpx;
  953. }
  954. }
  955. >view:nth-of-type(2) {
  956. flex: 1;
  957. font-size: 28rpx;
  958. color: #3D3D3D;
  959. line-height: 40rpx;
  960. text-align: left;
  961. }
  962. }
  963. .list-li-b {
  964. font-size: 28rpx;
  965. color: #3D3D3D;
  966. line-height: 40rpx;
  967. text-align: right;
  968. >text {
  969. color: #FF0000;
  970. }
  971. }
  972. }
  973. }
  974. .get-data-p {
  975. height: 100rpx;
  976. text-align: center;
  977. .get-data-img {
  978. width: 30rpx;
  979. height: 30rpx;
  980. margin: 0 auto;
  981. margin-top: 15rpx;
  982. }
  983. .get-data-text {
  984. text-align: center;
  985. }
  986. }
  987. .get-data-null-p {
  988. height: 100rpx;
  989. line-height: 100rpx;
  990. text-align: center;
  991. }
  992. .subBtn {
  993. display: flex;
  994. justify-content: center;
  995. position: fixed;
  996. bottom: 30rpx;
  997. width: 750rpx;
  998. padding: 0 46rpx;
  999. box-sizing: border-box;
  1000. >img {
  1001. width: 160rpx;
  1002. height: 160rpx;
  1003. }
  1004. }
  1005. .sub-btn {
  1006. display: flex;
  1007. justify-content: center;
  1008. position: fixed;
  1009. left: 30rpx;
  1010. bottom: 30rpx;
  1011. width: 690rpx;
  1012. height: 100rpx;
  1013. background: #0183FA;
  1014. border-radius: 50rpx 50rpx 50rpx 50rpx;
  1015. font-size: 30rpx;
  1016. color: #FFFFFF;
  1017. line-height: 100rpx;
  1018. text-align: center;
  1019. }
  1020. }
  1021. </style>