hiddenDangerItems.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092
  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. if (this.optionData.manageStatus == 2) {
  210. this.securityAppCheckSetOptionList(this.optionData, 1)
  211. } else {
  212. this.securityAppCheckSetOptionList(this.optionData, 0)
  213. }
  214. }
  215. this.securityCheckOptionSelAllList();
  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].hazardCheckPro = minList[x].id
  690. // minList[x].hazardCheckCode = minList[x].code
  691. // minList[x].hazardCheckName = minList[x].name
  692. // minList[x].hazardCheckPro2 = maxList[i].children[o].id
  693. // minList[x].hazardCheckCode2 = maxList[i].children[o].code
  694. // minList[x].hazardCheckName2 = maxList[i].children[o].name
  695. // minList[x].hazardCheckPro1 = maxList[i].id
  696. // minList[x].hazardCheckCode1 = maxList[i].code
  697. // minList[x].hazardCheckName1 = maxList[i].name
  698. // //二级
  699. // minList[x].children[o].hazardCheckPro = minList[x].id
  700. // minList[x].children[o].hazardCheckCode = minList[x].code
  701. // minList[x].children[o].hazardCheckName = minList[x].name
  702. // minList[x].children[o].hazardCheckPro2 = maxList[i].children[o].id
  703. // minList[x].children[o].hazardCheckCode2 = maxList[i].children[o].code
  704. // minList[x].children[o].hazardCheckName2 = maxList[i].children[o].name
  705. // minList[x].children[o].hazardCheckPro1 = maxList[i].id
  706. // minList[x].children[o].hazardCheckCode1 = maxList[i].code
  707. // minList[x].children[o].hazardCheckName1 = maxList[i].name
  708. // //三级
  709. minList[x].level = 3;
  710. minList[x].hazardCheckPro = minList[x].id
  711. minList[x].hazardCheckCode = minList[x].code
  712. minList[x].hazardCheckName = minList[x].name
  713. minList[x].hazardCheckPro2 = maxList[i].children[o].id
  714. minList[x].hazardCheckCode2 = maxList[i].children[o].code
  715. minList[x].hazardCheckName2 = maxList[i].children[o].name
  716. minList[x].hazardCheckPro1 = maxList[i].id
  717. minList[x].hazardCheckCode1 = maxList[i].code
  718. minList[x].hazardCheckName1 = maxList[i].name
  719. minList[x].hazardCheckPoint = minList[x].mainPoint.split('#')[0]
  720. list.push(minList[x])
  721. }
  722. }
  723. }
  724. }
  725. this.$set(this, 'checkPlanList', JSON.parse(JSON.stringify(list)));
  726. },
  727. /********************** 检查项格式处理 **********************/
  728. getCascaderData(list, type) {
  729. let self = this
  730. for (let i = 0; i < list.length; i++) {
  731. if (list[i].level == type) {
  732. delete list[i].children
  733. } else if (list[i].children) {
  734. if (list[i].children[0]) {
  735. list[i].children = self.getCascaderData(list[i].children, type)
  736. } else {
  737. list.splice(i, 1)
  738. i--
  739. }
  740. } else {
  741. list.splice(i, 1)
  742. i--
  743. }
  744. }
  745. for (let i = 0; i < list.length; i++) {
  746. if (list[i].level == type) {
  747. delete list[i].children
  748. } else if (list[i].children) {
  749. if (list[i].children[0]) {
  750. list[i].children = self.getCascaderData(list[i].children, type)
  751. } else {
  752. list.splice(i, 1)
  753. i--
  754. }
  755. } else {
  756. list.splice(i, 1)
  757. i--
  758. }
  759. }
  760. for (let i = 0; i < list.length; i++) {
  761. if (list[i].level == type) {
  762. delete list[i].children
  763. } else if (list[i].children) {
  764. if (list[i].children[0]) {
  765. list[i].children = self.getCascaderData(list[i].children, type)
  766. } else {
  767. list.splice(i, 1)
  768. i--
  769. }
  770. } else {
  771. list.splice(i, 1)
  772. i--
  773. }
  774. }
  775. return list
  776. },
  777. }
  778. }
  779. </script>
  780. <style lang="stylus" scoped>
  781. .hiddenDangerItems {
  782. height: 100%;
  783. display flex;
  784. flex-direction: column;
  785. overflow: hidden;
  786. box-sizing: border-box;
  787. #totalColor-A {
  788. color: #0183FA;
  789. background: rgba(1, 131, 250, 0.2);
  790. }
  791. #totalColor-B {
  792. color: #16B531;
  793. background: rgba(22, 181, 49, 0.2);
  794. }
  795. #totalColor-C {
  796. color: #FF8C00;
  797. background: rgba(255, 140, 0, 0.2);
  798. }
  799. .header {
  800. width: 100%;
  801. height: 268rpx;
  802. overflow: hidden;
  803. background: #fff;
  804. .lotName {
  805. height: 70rpx;
  806. line-height: 70rpx;
  807. font-size: 28rpx;
  808. background: rgba(1, 131, 250, 0.2);
  809. color: #0183FA;
  810. text-align: center;
  811. }
  812. .lotNameOne {
  813. background: #F7E0C4;
  814. color: #FF8C00;
  815. }
  816. .tabTitle_tow {
  817. width: 320rpx;
  818. height: 80rpx;
  819. display flex;
  820. justify-content: flex-start;
  821. align-items: center;
  822. .tabTitle_tow_li {
  823. flex: 1;
  824. position: relative;
  825. text-align center;
  826. .tabTitle_tow_text {
  827. display: inline-block;
  828. font-size: 30rpx;
  829. font-family: PingFang SC;
  830. font-weight: 500;
  831. color: #333333;
  832. line-height: 46rpx;
  833. position: relative;
  834. &.on {
  835. color: #0183FA;
  836. }
  837. }
  838. .tabTitle_tow_across {
  839. width: 50rpx;
  840. height: 4rpx;
  841. background: #0183FA;
  842. border-radius: 2rpx;
  843. margin:0 auto 0;
  844. display none;
  845. &.on {
  846. display block;
  847. }
  848. }
  849. }
  850. }
  851. .line {
  852. width: 100%;
  853. height: 13rpx;
  854. background: #F5F5F5;
  855. }
  856. .search {
  857. width: 750rpx;
  858. height: 80rpx;
  859. background: #FFFFFF;
  860. border-radius: 0rpx 0rpx 0rpx 0rpx;
  861. display: flex;
  862. justify-content: flex-start;
  863. align-items: center;
  864. .search-l {
  865. display: flex;
  866. justify-content: flex-start;
  867. align-items: center;
  868. margin: 0 20rpx 0 30rpx;
  869. .search-A {
  870. border-radius: 50rpx 50rpx 50rpx 50rpx;
  871. border: 1rpx solid #E0E0E0;
  872. width: 100rpx;
  873. height: 60rpx;
  874. background: #E0E0E0;
  875. font-weight: normal;
  876. font-size: 24rpx;
  877. color: #333333;
  878. line-height: 60rpx;
  879. text-align: center;
  880. margin-right: 10rpx;
  881. }
  882. .search-B {
  883. border-radius: 50rpx 50rpx 50rpx 50rpx;
  884. border: 1rpx solid #0183FA;
  885. width: 100rpx;
  886. height: 60rpx;
  887. background: #0183FA;
  888. font-weight: normal;
  889. font-size: 24rpx;
  890. color: #FFFFFF;
  891. line-height: 60rpx;
  892. text-align: center;
  893. margin-right: 10rpx;
  894. }
  895. }
  896. .search-r-margin {
  897. width: 700rpx !important;
  898. margin: 0 auto;
  899. }
  900. .search-r {
  901. width: 440rpx;
  902. height: 60rpx;
  903. background: #FFFFFF;
  904. border-radius: 50rpx 50rpx 50rpx 50rpx;
  905. border: 1rpx solid #E0E0E0;
  906. font-size: 24rpx;
  907. color: #999999;
  908. line-height: 60rpx;
  909. text-align: left;
  910. display: flex;
  911. justify-content: flex-start;
  912. align-items: center;
  913. padding: 0 20rpx;
  914. box-sizing: border-box;
  915. >img {
  916. width: 30rpx;
  917. height: 30rpx;
  918. margin-right: 20rpx;
  919. }
  920. }
  921. }
  922. }
  923. .list {
  924. width: 750rpx;
  925. background: #FFFFFF;
  926. padding-bottom: 20rpx;
  927. box-sizing: border-box;
  928. .total {
  929. display: inline-block;
  930. height: 50rpx;
  931. background: rgba(1, 131, 250, 0.2);
  932. border-radius: 0rpx 0rpx 20rpx 0rpx;
  933. font-size: 24rpx;
  934. color: #0183FA;
  935. line-height: 50rpx;
  936. text-align: left;
  937. padding: 0rpx 22rpx;
  938. box-sizing: border-box;
  939. margin-bottom: 20rpx;
  940. }
  941. .total-color-1 {
  942. background: rgba(1, 131, 250, 0.2);
  943. color: #0183FA;
  944. }
  945. .total-color-2 {
  946. background: rgba(22, 181, 49, 0.2);
  947. color: #16B531;
  948. }
  949. .total-color-3 {
  950. background: #F7E0C4;
  951. color: #FF8C00;
  952. }
  953. .list-li {
  954. margin: 0 30rpx;
  955. .list-li-t {
  956. width: 690rpx;
  957. background: #F5F5F5;
  958. border-radius: 10rpx 10rpx 10rpx 10rpx;
  959. display: flex;
  960. justify-content: flex-start;
  961. padding: 12rpx 20rpx 14rpx 14rpx;
  962. box-sizing: border-box;
  963. margin: 20rpx 0;
  964. >view:nth-of-type(1) {
  965. >img {
  966. width: 24rpx;
  967. height: 24rpx;
  968. margin-right: 30rpx;
  969. }
  970. }
  971. >view:nth-of-type(2) {
  972. flex: 1;
  973. font-size: 28rpx;
  974. color: #3D3D3D;
  975. line-height: 40rpx;
  976. text-align: left;
  977. }
  978. }
  979. .list-li-b {
  980. font-size: 28rpx;
  981. color: #3D3D3D;
  982. line-height: 40rpx;
  983. text-align: right;
  984. >text {
  985. color: #FF0000;
  986. }
  987. }
  988. }
  989. }
  990. .get-data-p {
  991. height: 100rpx;
  992. text-align: center;
  993. .get-data-img {
  994. width: 30rpx;
  995. height: 30rpx;
  996. margin: 0 auto;
  997. margin-top: 15rpx;
  998. }
  999. .get-data-text {
  1000. text-align: center;
  1001. }
  1002. }
  1003. .get-data-null-p {
  1004. height: 100rpx;
  1005. line-height: 100rpx;
  1006. text-align: center;
  1007. }
  1008. .subBtn {
  1009. display: flex;
  1010. justify-content: center;
  1011. position: fixed;
  1012. bottom: 30rpx;
  1013. width: 750rpx;
  1014. padding: 0 46rpx;
  1015. box-sizing: border-box;
  1016. >img {
  1017. width: 160rpx;
  1018. height: 160rpx;
  1019. }
  1020. }
  1021. .sub-btn {
  1022. display: flex;
  1023. justify-content: center;
  1024. position: fixed;
  1025. left: 30rpx;
  1026. bottom: 30rpx;
  1027. width: 690rpx;
  1028. height: 100rpx;
  1029. background: #0183FA;
  1030. border-radius: 50rpx 50rpx 50rpx 50rpx;
  1031. font-size: 30rpx;
  1032. color: #FFFFFF;
  1033. line-height: 100rpx;
  1034. text-align: center;
  1035. }
  1036. }
  1037. </style>