examineDetail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. <!-- 安全检查-检查详情 -->
  2. <template>
  3. <view class="examine">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  5. <view class="basics">
  6. <view class="basics_li">
  7. <text>学院:</text>
  8. <text>{{infoData.collegeName}}</text>
  9. </view>
  10. <view class="basics_li">
  11. <text>实验室:</text>
  12. <text>{{infoData.subjectName}}-{{infoData.roomNumber}}</text>
  13. </view>
  14. <view class="basics_li">
  15. <text>楼栋:</text>
  16. <text>{{infoData.buildName}}</text>
  17. </view>
  18. <view class="basics_li">
  19. <text>检查类型:</text>
  20. <text>{{infoData.checkType==1?'校园巡查':(infoData.checkType==2?'实验室自查':'')}}</text>
  21. </view>
  22. <view class="basics_li">
  23. <text>检查范围:</text>
  24. <text>{{infoData.checkRange==1?'全校':(infoData.checkRange==2?'学院':'实验室')}}</text>
  25. </view>
  26. <view class="basics_li" style="border:none;">
  27. <text>计划标题:</text>
  28. <text>{{infoData.title}}</text>
  29. </view>
  30. </view>
  31. <view class="attachment" v-if="infoData.isAttachment==1">
  32. <view class="attachment_t">
  33. <text>材料附件</text>
  34. <text>点击文件标题查看</text>
  35. </view>
  36. <view class="attachment_li" v-for="item in attachmentList">
  37. <img src="@/pages_safetyExamine/images/icon_djc_wj.png"/>
  38. <text @click="attachmentPreview(item)">{{item.fileName}}</text>
  39. <!-- <img class="attachment_li_del" src="@/images/Version3.3.3/icon_fjgk_sc.png"/> -->
  40. </view>
  41. </view>
  42. <view class="basics" v-if="manageStatus==2">
  43. <view class="basics_li">
  44. <text>检查结果:</text>
  45. <text>{{infoData.checkResult==0?'不符合':(infoData.checkResult==1?'符合':'')}}</text>
  46. </view>
  47. <view class="basics_li">
  48. <text>整改期限:</text>
  49. <text>{{infoData.rectifyDeadline}}</text>
  50. </view>
  51. <view class="basics_li">
  52. <text>整改通知:</text>
  53. <text style="color: #0183FA;" @click="rectifyInform">{{infoData.rectifyNotice == 1?'整改告知书':(infoData.rectifyNotice == 2?'整改通知书':'')}}</text>
  54. </view>
  55. <view class="basics_li">
  56. <text>检查者:</text>
  57. <text>{{infoData.checkUser}}</text>
  58. </view>
  59. <view class="basics_li" style="border:none;">
  60. <text>检查时间:</text>
  61. <text>{{infoData.checkTime}}</text>
  62. </view>
  63. </view>
  64. <view class="inconformity" @click="inconformityFun()" v-if="manageStatus==2">不符合项<img v-if="inconformityStatus" src="@/pages_safetyExamine/images/icon_bfhx_xq.png"/><img v-if="!inconformityStatus" src="@/pages_safetyExamine/images/icon_bfhx_sq.png"/></view>
  65. <view v-for="(item,index) in infoData.checkHazardDtoList" v-if="manageStatus==2">
  66. <view class="danger">
  67. <view class="sort">{{item.sort}}</view>
  68. <view class="grade" :style="item.switch?'border-bottom: 1rpx solid #D8D8D8;':'border:none;'">
  69. <text>第{{index+1}}项隐患</text>
  70. <text style="color: #0183FA;" @click="dangerItem(item)">{{item.rectifyStatus==1?'已完成':(item.rectifyStatus==2?'待整改':(item.rectifyStatus==3?'待复核':(item.rectifyStatus==4?'暂无法整改':'')))}} >></text>
  71. </view>
  72. <view v-if="item.switch">
  73. <view class="grade">
  74. <text>隐患等级:</text>
  75. <text>{{item.hazardLevel==2?'一般隐患':(item.hazardLevel==1?'重大隐患':(item.hazardLevel==3?'管理问题':''))}}</text>
  76. </view>
  77. <view class="project">
  78. <view class="project_t">检查项目:</view>
  79. <view class="project_b">{{item.hazardCheckProStr}}</view>
  80. <view class="project_b2" v-if="item.hazardCheckCount>0">此检查项在当前实验室累计出现{{item.hazardCheckCount}}次隐患</view>
  81. </view>
  82. <view class="project">
  83. <view class="project_t">检查要点:</view>
  84. <view class="project_b">{{item.hazardCheckPoint}}</view>
  85. </view>
  86. <view class="project">
  87. <view class="project_t">隐患描述:</view>
  88. <view class="project_b">{{item.hazardDescribe}}</view>
  89. </view>
  90. <view class="picture">
  91. <view class="picture_t">隐患照片</view>
  92. <view class="picture_b" @click="lockImg(item.uploadDtoList)">
  93. <img :src="baseUrl+imgItem.fileUrl" v-for="(imgItem,imgIndex) in item.uploadDtoList"/>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. <view class="pack_up" @click="switchFun(item)">{{item.switch?'收起':'展开'}}<img v-if="item.switch" src="@/pages_safetyExamine/images/icon_06_1.png"/><img v-if="!item.switch" src="@/pages_safetyExamine/images/icon_06.png"/></view>
  99. </view>
  100. </scroll-view>
  101. <view class="report" @change="rectifyReport" v-if="manageStatus==2">整改报告</view>
  102. <view class="bottom_btn" v-if="manageStatus==0" @click="handleClick('','startInspect')">开始检查</view>
  103. </view>
  104. </template>
  105. <script>
  106. import { config } from '@/api/request/config.js'
  107. import {checkSign,queryDeptSignByUserId,findCheckManage,findByPlanIdAttachment} from '@/api/index.js'
  108. export default {
  109. name: "rectifyList",
  110. components: {
  111. },
  112. data() {
  113. return {
  114. baseUrl:config.base_url,
  115. manageStatus:0,//0 待检查 1 检查中 2已检查
  116. pageType:0,
  117. inconformityStatus:false,
  118. infoData:{},
  119. attachmentList:[],
  120. }
  121. },
  122. onLoad(option) {
  123. if(option.id){
  124. this.id=option.id
  125. this.findCheckManage()
  126. }
  127. if(option.manageStatus){//检查状态
  128. this.manageStatus=option.manageStatus;
  129. }
  130. if(option.manageStatus==0 || option.manageStatus==1){
  131. uni.setNavigationBarTitle({
  132. title:'待检查'
  133. })
  134. }else if(option.manageStatus==2){
  135. uni.setNavigationBarTitle({
  136. title:'已检查'
  137. })
  138. }
  139. },
  140. onShow() {
  141. },
  142. mounted(){
  143. },
  144. methods: {
  145. //滚动事件
  146. scrollGet(){
  147. },
  148. //开展检查
  149. handleClick(row,doType){
  150. if(doType=='startInspect'){
  151. uni.navigateTo({
  152. url: '/pages_safetyExamine/examineManage/examineAdd?id='+this.id
  153. });
  154. }
  155. },
  156. //根据计划id查询附件列表
  157. async findByPlanIdAttachment(){
  158. let _this = this;
  159. const {data} = await findByPlanIdAttachment({checkPlanId:this.infoData.checkPlanId});
  160. if(data.code == 200){
  161. _this.attachmentList=data.data;
  162. }
  163. },
  164. //详情
  165. async findCheckManage(){
  166. let _this = this;
  167. const {data} = await findCheckManage({id:this.id});
  168. if(data.code == 200){
  169. data.data.checkHazardDtoList.forEach(function(item){
  170. item.switch=false;
  171. })
  172. this.infoData=data.data;
  173. if(data.data.isAttachment==1){//0没有附件 1有附件
  174. this.findByPlanIdAttachment()
  175. }
  176. }
  177. },
  178. //附件查看
  179. attachmentPreview(item){
  180. uni.showLoading({
  181. title: '下载中'
  182. });
  183. wx.downloadFile({
  184. url: config.base_url+item.fileUrl,
  185. header: {
  186. Authorization: uni.getStorageSync('token')
  187. },
  188. success: function (res) {
  189. uni.hideLoading();
  190. const filePath = res.tempFilePath
  191. wx.openDocument({
  192. filePath: filePath,
  193. success: function (res) {
  194. console.log('打开文档成功')
  195. }
  196. })
  197. },
  198. fail: function (res){
  199. uni.hideLoading();
  200. uni.showToast({
  201. title: '下载失败',
  202. icon:"none",
  203. mask:true,
  204. duration: 2000
  205. });
  206. }
  207. })
  208. },
  209. //查看图片
  210. lockImg(list){
  211. console.log(list)
  212. if(!list[0]){
  213. return
  214. }
  215. let urlList=[];
  216. for(let i=0;i<list.length;i++){
  217. urlList.push(this.baseUrl+list[i].fileUrl)
  218. }
  219. wx.previewImage({
  220. urls: urlList, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  221. current: '', // 当前显示图片的http链接,默认是第一个
  222. success: function(res) {},
  223. fail: function(res) {},
  224. complete: function(res) {},
  225. })
  226. },
  227. //隐患项跳转详情
  228. dangerItem(row){
  229. uni.navigateTo({
  230. url: '/pages_safetyExamine/dangerManage/dangerDetail?item='+encodeURIComponent(JSON.stringify(row))
  231. })
  232. },
  233. //隐患项收起展开
  234. inconformityFun(){
  235. this.inconformityStatus=!this.inconformityStatus;
  236. if(this.inconformityStatus){
  237. this.infoData.checkHazardDtoList.forEach(function(item){
  238. item.switch=true;
  239. })
  240. }else{
  241. this.infoData.checkHazardDtoList.forEach(function(item){
  242. item.switch=false;
  243. })
  244. }
  245. },
  246. //隐患小项收起展开
  247. switchFun(item){
  248. item.switch=!item.switch
  249. },
  250. //整改通知
  251. rectifyInform(){//rectifyNotice 整改通知(1整改告知书 2整改通知书)
  252. if(this.infoData.rectifyNotice==1){//1整改告知书
  253. this.genReport(this.infoData.id)
  254. }else if(this.infoData.rectifyNotice==2){//2整改通知书
  255. this.genNotice(this.infoData.id)
  256. }
  257. },
  258. //整改报告
  259. rectifyReport(){
  260. uni.showLoading({
  261. title: '下载中'
  262. });
  263. wx.downloadFile({
  264. url: config.base_url+'/zd-security/checkRectify/genReport/' + this.infoData.id,
  265. header: {
  266. Authorization: uni.getStorageSync('token')
  267. },
  268. success: function (res) {
  269. const fileManager = wx.getFileSystemManager()
  270. const filePath = wx.env.USER_DATA_PATH + '/(整改报告).docx'
  271. fileManager.saveFile({
  272. tempFilePath: res.tempFilePath,
  273. filePath,
  274. success: () => {
  275. uni.hideLoading();
  276. wx.openDocument({
  277. filePath: filePath,
  278. showMenu: true,
  279. fileType: 'docx'
  280. })
  281. },
  282. fail: function (res){
  283. uni.hideLoading();
  284. uni.showToast({
  285. title: '下载失败',
  286. icon:"none",
  287. mask:true,
  288. duration: 2000
  289. });
  290. }
  291. })
  292. },
  293. fail: function (res){
  294. uni.hideLoading();
  295. uni.showToast({
  296. title: '下载失败',
  297. icon:"none",
  298. mask:true,
  299. duration: 2000
  300. });
  301. }
  302. })
  303. },
  304. //整改通知书
  305. genNotice(id){
  306. uni.showLoading({
  307. title: '下载中'
  308. });
  309. wx.downloadFile({
  310. url: config.base_url+'/zd-security/checkManage/getRectifyAdviceNote/' + id,
  311. header: {
  312. Authorization: uni.getStorageSync('token')
  313. },
  314. success: function (res) {
  315. const fileManager = wx.getFileSystemManager()
  316. const filePath = wx.env.USER_DATA_PATH + '/(整改通知书).docx'
  317. fileManager.saveFile({
  318. tempFilePath: res.tempFilePath,
  319. filePath,
  320. success: () => {
  321. uni.hideLoading();
  322. wx.openDocument({
  323. filePath: filePath,
  324. showMenu: true,
  325. fileType: 'docx'
  326. })
  327. },
  328. fail: function (res){
  329. uni.hideLoading();
  330. uni.showToast({
  331. title: '下载失败',
  332. icon:"none",
  333. mask:true,
  334. duration: 2000
  335. });
  336. }
  337. })
  338. },
  339. fail: function (res){
  340. uni.hideLoading();
  341. uni.showToast({
  342. title: '下载失败',
  343. icon:"none",
  344. mask:true,
  345. duration: 2000
  346. });
  347. }
  348. })
  349. },
  350. //整改告知书
  351. genReport(id){
  352. uni.showLoading({
  353. title: '下载中'
  354. });
  355. wx.downloadFile({
  356. url: config.base_url+'/zd-security/checkManage/getRectifyNotification/' + id,
  357. header: {
  358. Authorization: uni.getStorageSync('token')
  359. },
  360. success: function (res) {
  361. const fileManager = wx.getFileSystemManager()
  362. const filePath = wx.env.USER_DATA_PATH + '/整改报告.docx'
  363. fileManager.saveFile({
  364. tempFilePath: res.tempFilePath,
  365. filePath,
  366. success: () => {
  367. uni.hideLoading();
  368. wx.openDocument({
  369. filePath: filePath,
  370. showMenu: true,
  371. fileType: 'docx'
  372. })
  373. },
  374. fail: function (res){
  375. uni.hideLoading();
  376. uni.showToast({
  377. title: '下载失败',
  378. icon:"none",
  379. mask:true,
  380. duration: 2000
  381. });
  382. }
  383. })
  384. },
  385. fail: function (res){
  386. uni.hideLoading();
  387. uni.showToast({
  388. title: '下载失败',
  389. icon:"none",
  390. mask:true,
  391. duration: 2000
  392. });
  393. }
  394. })
  395. },
  396. }
  397. }
  398. </script>
  399. <style lang="stylus" scoped>
  400. .examine{
  401. height:100%;
  402. display flex;
  403. .info-max-box{
  404. flex: 1;
  405. overflow: scroll;
  406. padding-bottom: 140rpx;
  407. }
  408. .basics{
  409. width: 690rpx;
  410. background: #FFFFFF;
  411. border-radius: 20rpx;
  412. padding: 30rpx 30rpx 32rpx;
  413. box-sizing: border-box;
  414. margin: 20rpx 30rpx ;
  415. .basics_li{
  416. height: 80rpx;
  417. display: flex;
  418. justify-content: space-between;
  419. border-bottom: 1rpx solid #D8D8D8;
  420. >text:nth-of-type(1){
  421. font-size: 28rpx;
  422. font-family: PingFang SC-Medium, PingFang SC;
  423. font-weight: 400;
  424. color: #666666;
  425. line-height: 80rpx;
  426. width: 140rpx;
  427. }
  428. >text:nth-of-type(2){
  429. flex: 1;
  430. font-size: 28rpx;
  431. font-family: PingFang SC-Medium, PingFang SC;
  432. font-weight: 400;
  433. color: #333333;
  434. line-height: 80rpx;
  435. text-align: right;
  436. white-space: nowrap;
  437. overflow: hidden;
  438. text-overflow: ellipsis;
  439. }
  440. }
  441. }
  442. .attachment{
  443. width: 690rpx;
  444. background: #FFFFFF;
  445. border-radius: 20rpx;
  446. margin: 20rpx 30rpx 0;
  447. padding-bottom: 32rpx;
  448. box-sizing: border-box;
  449. .attachment_t{
  450. border-bottom: 1rpx solid #D8D8D8;
  451. >text:nth-of-type(1){
  452. font-size: 30rpx;
  453. font-family: PingFang SC-Medium, PingFang SC;
  454. font-weight: 400;
  455. color: #333333;
  456. line-height: 110rpx;
  457. margin-left: 28rpx;
  458. }
  459. >text:nth-of-type(2){
  460. font-size: 30rpx;
  461. font-family: PingFang SC-Medium, PingFang SC;
  462. font-weight: 400;
  463. color: #999999;
  464. line-height: 110rpx;
  465. margin-left: 24rpx;
  466. }
  467. }
  468. .attachment_li{
  469. height: 40rpx;
  470. display: flex;
  471. justify-content: flex-start;
  472. align-items: center;
  473. margin-top: 32rpx;
  474. >img{
  475. width: 30rpx;
  476. height: 26rpx;
  477. margin-right: 20rpx;
  478. margin-left: 50rpx;
  479. }
  480. >text{
  481. flex: 1;
  482. font-size: 28rpx;
  483. font-family: PingFang SC-Medium, PingFang SC;
  484. font-weight: 400;
  485. color: #0183FA;
  486. line-height: 40rpx;
  487. white-space: nowrap;
  488. overflow: hidden;
  489. text-overflow: ellipsis;
  490. }
  491. .attachment_li_del{
  492. width: 30rpx;
  493. height: 30rpx;
  494. }
  495. }
  496. }
  497. .inconformity{
  498. width: 690rpx;
  499. height: 100rpx;
  500. background: #FFFFFF;
  501. border-radius: 20rpx 20rpx 20rpx 20rpx;
  502. margin: 20rpx 30rpx;
  503. font-size: 30rpx;
  504. font-family: PingFang SC-Medium, PingFang SC;
  505. font-weight: 400;
  506. color: #333333;
  507. line-height: 100rpx;
  508. text-align: center;
  509. display: flex;
  510. justify-content: center;
  511. align-items: center;
  512. >img{
  513. width: 30rpx;
  514. height: 26rpx;
  515. margin-left: 20rpx;
  516. }
  517. }
  518. .danger{
  519. width: 690rpx;
  520. background: #FFFFFF;
  521. border-radius: 20rpx;
  522. padding: 15rpx 30rpx 15rpx;
  523. box-sizing: border-box;
  524. margin: 20rpx 30rpx ;
  525. position: relative;
  526. .sort{
  527. width: 40rpx;
  528. height: 40rpx;
  529. background: #0183FA;
  530. border-radius: 20rpx 0rpx 10rpx 0rpx;
  531. font-size: 30rpx;
  532. font-family: PingFang SC-Medium, PingFang SC;
  533. font-weight: 400;
  534. color: #FFFFFF;
  535. line-height: 40rpx;
  536. text-align: center;
  537. position: absolute;
  538. left: 0;
  539. top: 0;
  540. }
  541. .danger_title{
  542. font-size: 30rpx;
  543. font-family: PingFang SC-Medium, PingFang SC;
  544. font-weight: 400;
  545. color: #333333;
  546. line-height:80rpx;
  547. border-bottom: 1rpx solid #D8D8D8;
  548. }
  549. .grade{
  550. height: 80rpx;
  551. display: flex;
  552. justify-content: space-between;
  553. border-bottom: 1rpx solid #D8D8D8;
  554. >text:nth-of-type(1){
  555. font-size: 28rpx;
  556. font-family: PingFang SC-Medium, PingFang SC;
  557. font-weight: 400;
  558. color: #666666;
  559. line-height: 80rpx;
  560. width: 140rpx;
  561. }
  562. >text:nth-of-type(2){
  563. flex: 1;
  564. font-size: 28rpx;
  565. font-family: PingFang SC-Medium, PingFang SC;
  566. font-weight: 400;
  567. color: #333333;
  568. line-height: 80rpx;
  569. text-align: right;
  570. }
  571. }
  572. .project{
  573. .project_t{
  574. font-size: 30rpx;
  575. font-family: PingFang SC-Medium, PingFang SC;
  576. font-weight: 400;
  577. color: #333333;
  578. line-height: 80rpx;
  579. }
  580. .project_b{
  581. min-height: 158rpx;
  582. font-size: 28rpx;
  583. font-family: PingFang SC-Medium, PingFang SC;
  584. font-weight: 400;
  585. color: #333333;
  586. line-height: 40rpx;
  587. padding: 20rpx 14rpx;
  588. box-sizing: border-box;
  589. background: #F5F5F5;
  590. border-radius: 20rpx 20rpx 20rpx 20rpx;
  591. }
  592. .project_b2{
  593. font-size: 26rpx;
  594. font-family: PingFang SC-Medium, PingFang SC;
  595. font-weight: 400;
  596. color: #666666;
  597. line-height: 26rpx;
  598. margin-top: 14rpx;
  599. text-align: right;
  600. }
  601. }
  602. .picture{
  603. .picture_t{
  604. font-size: 30rpx;
  605. font-family: PingFang SC-Medium, PingFang SC;
  606. font-weight: 400;
  607. color: #333333;
  608. line-height: 80rpx;
  609. }
  610. .picture_b{
  611. display: flex;
  612. justify-content: flex-start;
  613. flex-wrap: wrap;
  614. >img{
  615. width: 200rpx;
  616. height: 200rpx;
  617. border-radius: 10rpx 10rpx 10rpx 10rpx;
  618. margin-right: 14rpx;
  619. margin-bottom: 10rpx;
  620. }
  621. >img:nth-of-type(3n+3){
  622. margin-right: 0rpx;
  623. }
  624. }
  625. }
  626. }
  627. .pack_up{
  628. font-size: 30rpx;
  629. font-family: PingFang SC-Medium, PingFang SC;
  630. font-weight: 400;
  631. color: #666666;
  632. line-height: 140rpx;
  633. display: flex;
  634. justify-content: center;
  635. align-items: center;
  636. >img{
  637. width: 14rpx;
  638. height: 8rpx;
  639. margin-left: 22rpx;
  640. }
  641. }
  642. .report{
  643. width: 153rpx;
  644. height: 50rpx;
  645. background: #0183FA;
  646. border-radius: 25rpx 0rpx 0rpx 25rpx;
  647. font-size: 26rpx;
  648. font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  649. font-weight: 400;
  650. color: #FFFFFF;
  651. line-height: 50rpx;
  652. position: fixed;
  653. top: 180rpx;
  654. right: 0;
  655. text-align: center;
  656. }
  657. .bottom_btn{
  658. position: fixed;
  659. bottom: 26rpx;
  660. left: 30rpx;
  661. font-size: 30rpx;
  662. font-family: PingFang SC-Medium, PingFang SC;
  663. font-weight: 400;
  664. color: #FFFFFF;
  665. line-height: 90rpx;
  666. width: 690rpx;
  667. height: 90rpx;
  668. background: #0183FA;
  669. border-radius: 20rpx;
  670. text-align: center;
  671. }
  672. }
  673. </style>