hiddenDangerItems.vue 31 KB

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