examineDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  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">
  32. <view class="attachment_t">
  33. <text>材料附件</text>
  34. <text>点击文件标题查看</text>
  35. </view>
  36. <view class="attachment_li">
  37. <img src="@/images/Version3.3.3/icon_djc_wj.png"/>
  38. <text>文件标题文件标题</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;">{{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="@/images/Version3.3.3/icon_bfhx_xq.png"/><img v-if="!inconformityStatus" src="@/images/Version3.3.3/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="@/images/Version3.3.3/icon_06_1.png"/><img v-if="!item.switch" src="@/images/Version3.3.3/icon_06.png"/></view>
  99. </view>
  100. </scroll-view>
  101. <view class="report" @change="buttonChange" 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} 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. }
  120. },
  121. onLoad(option) {
  122. if(option.id){
  123. this.id=option.id
  124. this.findCheckManage()
  125. }
  126. if(option.manageStatus){//检查状态
  127. this.manageStatus=option.manageStatus;
  128. }
  129. if(option.manageStatus==0 || option.manageStatus==1){
  130. uni.setNavigationBarTitle({
  131. title:'待检查'
  132. })
  133. }else if(option.manageStatus==2){
  134. uni.setNavigationBarTitle({
  135. title:'已检查'
  136. })
  137. }
  138. },
  139. onShow() {
  140. },
  141. mounted(){
  142. },
  143. methods: {
  144. //滚动事件
  145. scrollGet(){
  146. },
  147. //开展检查
  148. handleClick(row,doType){
  149. if(doType=='startInspect'){
  150. uni.navigateTo({
  151. url: '/pages/pages_safetyExamine/examineManage/examineAdd?id='+this.id
  152. });
  153. }
  154. },
  155. //详情
  156. async findCheckManage(){
  157. let _this = this;
  158. const {data} = await findCheckManage({id:this.id});
  159. if(data.code == 200){
  160. data.data.checkHazardDtoList.forEach(function(item){
  161. item.switch=false;
  162. })
  163. this.infoData=data.data;
  164. }
  165. },
  166. //查看图片
  167. lockImg(list){
  168. console.log(list)
  169. if(!list[0]){
  170. return
  171. }
  172. let urlList=[];
  173. for(let i=0;i<list.length;i++){
  174. urlList.push(this.baseUrl+list[i].fileUrl)
  175. }
  176. wx.previewImage({
  177. urls: urlList, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  178. current: '', // 当前显示图片的http链接,默认是第一个
  179. success: function(res) {},
  180. fail: function(res) {},
  181. complete: function(res) {},
  182. })
  183. },
  184. //隐患项跳转详情
  185. dangerItem(row){
  186. uni.navigateTo({
  187. url: '/pages/pages_safetyExamine/dangerManage/dangerDetail?item='+encodeURIComponent(JSON.stringify(row))
  188. })
  189. },
  190. //隐患项收起展开
  191. inconformityFun(){
  192. this.inconformityStatus=!this.inconformityStatus;
  193. if(this.inconformityStatus){
  194. this.infoData.checkHazardDtoList.forEach(function(item){
  195. item.switch=true;
  196. })
  197. }else{
  198. this.infoData.checkHazardDtoList.forEach(function(item){
  199. item.switch=false;
  200. })
  201. }
  202. },
  203. //隐患小项收起展开
  204. switchFun(item){
  205. item.switch=!item.switch
  206. },
  207. //查看报告按钮
  208. async buttonChange(e){
  209. let namestatus;
  210. let sealstatus;
  211. //判断有没有电子签名
  212. const {data} = await checkSign();
  213. if(data.code==200){
  214. namestatus=data.data
  215. if(data.data==false){//true有电子签名false没有电子签名
  216. uni.showModal({
  217. title: '',
  218. cancelColor:'#999999',
  219. confirmColor:'#FF6E6E',
  220. cancelText: "取消", // 取消按钮的文字
  221. confirmText: "去上传", // 确认按钮文字
  222. content: '您未上传电子签名,无法生成整改通知书/整改报告!',
  223. success (res) {
  224. if (res.confirm) {
  225. console.log('用户点击确定')
  226. uni.navigateTo({
  227. url: '/pages_manage/workbench/signature/signature'
  228. });
  229. } else if (res.cancel) {
  230. console.log('用户点击取消')
  231. }
  232. }
  233. })
  234. }else{
  235. }
  236. }
  237. //如果有电子签名判断有没有电子签章
  238. if(namestatus){
  239. const {data} = await queryDeptSignByUserId();
  240. if(data.code==200){
  241. console.log(data.data.data.isUpload)
  242. sealstatus=data.data.data.isUpload
  243. if(data.data.data.isUpload==false){
  244. uni.showToast({
  245. title: '学院未上传电子签章,无法生成整改通知书/整改报告',
  246. icon:"none",
  247. mask:true,
  248. duration: 2000
  249. });
  250. }
  251. };
  252. }
  253. //如果有电子签名和电气签章开始下载
  254. if(namestatus==true && sealstatus==true){
  255. if(this.buttonArrayType == 1){
  256. if(e.target.value == 0){
  257. this.genNotice();
  258. }else if(e.target.value == 1){
  259. this.genReport();
  260. }
  261. }else if(this.buttonArrayType == 2){
  262. this.genNotice();
  263. }
  264. }
  265. },
  266. genNotice(){
  267. uni.showLoading({
  268. title: '下载中'
  269. });
  270. wx.downloadFile({
  271. url: config.base_url+'/laboratory/checkOption/genNotice/' + this.newData.id,
  272. header: {
  273. Authorization: uni.getStorageSync('token')
  274. },
  275. success: function (res) {
  276. const fileManager = wx.getFileSystemManager()
  277. const filePath = wx.env.USER_DATA_PATH + '/整改通知书.docx'
  278. fileManager.saveFile({
  279. tempFilePath: res.tempFilePath,
  280. filePath,
  281. success: () => {
  282. uni.hideLoading();
  283. wx.openDocument({
  284. filePath: filePath,
  285. showMenu: true,
  286. fileType: 'docx'
  287. })
  288. },
  289. fail: function (res){
  290. uni.hideLoading();
  291. uni.showToast({
  292. title: '下载失败',
  293. icon:"none",
  294. mask:true,
  295. duration: 2000
  296. });
  297. }
  298. })
  299. },
  300. fail: function (res){
  301. uni.hideLoading();
  302. uni.showToast({
  303. title: '下载失败',
  304. icon:"none",
  305. mask:true,
  306. duration: 2000
  307. });
  308. }
  309. })
  310. },
  311. genReport(){
  312. uni.showLoading({
  313. title: '下载中'
  314. });
  315. wx.downloadFile({
  316. url: config.base_url+'/laboratory/checkOption/genReport/' + this.newData.id,
  317. header: {
  318. Authorization: uni.getStorageSync('token')
  319. },
  320. success: function (res) {
  321. const fileManager = wx.getFileSystemManager()
  322. const filePath = wx.env.USER_DATA_PATH + '/整改报告.docx'
  323. fileManager.saveFile({
  324. tempFilePath: res.tempFilePath,
  325. filePath,
  326. success: () => {
  327. uni.hideLoading();
  328. wx.openDocument({
  329. filePath: filePath,
  330. showMenu: true,
  331. fileType: 'docx'
  332. })
  333. },
  334. fail: function (res){
  335. uni.hideLoading();
  336. uni.showToast({
  337. title: '下载失败',
  338. icon:"none",
  339. mask:true,
  340. duration: 2000
  341. });
  342. }
  343. })
  344. },
  345. fail: function (res){
  346. uni.hideLoading();
  347. uni.showToast({
  348. title: '下载失败',
  349. icon:"none",
  350. mask:true,
  351. duration: 2000
  352. });
  353. }
  354. })
  355. },
  356. }
  357. }
  358. </script>
  359. <style lang="stylus" scoped>
  360. .examine{
  361. height:100%;
  362. display flex;
  363. .info-max-box{
  364. flex: 1;
  365. overflow: scroll;
  366. }
  367. .basics{
  368. width: 690rpx;
  369. background: #FFFFFF;
  370. border-radius: 20rpx;
  371. padding: 30rpx 30rpx 32rpx;
  372. box-sizing: border-box;
  373. margin: 20rpx 30rpx ;
  374. .basics_li{
  375. height: 80rpx;
  376. display: flex;
  377. justify-content: space-between;
  378. border-bottom: 1rpx solid #D8D8D8;
  379. >text:nth-of-type(1){
  380. font-size: 28rpx;
  381. font-family: PingFang SC-Medium, PingFang SC;
  382. font-weight: 400;
  383. color: #666666;
  384. line-height: 80rpx;
  385. width: 140rpx;
  386. }
  387. >text:nth-of-type(2){
  388. flex: 1;
  389. font-size: 28rpx;
  390. font-family: PingFang SC-Medium, PingFang SC;
  391. font-weight: 400;
  392. color: #333333;
  393. line-height: 80rpx;
  394. text-align: right;
  395. white-space: nowrap;
  396. overflow: hidden;
  397. text-overflow: ellipsis;
  398. }
  399. }
  400. }
  401. .attachment{
  402. width: 690rpx;
  403. background: #FFFFFF;
  404. border-radius: 20rpx;
  405. margin: 20rpx 30rpx 0;
  406. padding-bottom: 32rpx;
  407. box-sizing: border-box;
  408. .attachment_t{
  409. border-bottom: 1rpx solid #D8D8D8;
  410. >text:nth-of-type(1){
  411. font-size: 30rpx;
  412. font-family: PingFang SC-Medium, PingFang SC;
  413. font-weight: 400;
  414. color: #333333;
  415. line-height: 110rpx;
  416. margin-left: 28rpx;
  417. }
  418. >text:nth-of-type(2){
  419. font-size: 30rpx;
  420. font-family: PingFang SC-Medium, PingFang SC;
  421. font-weight: 400;
  422. color: #999999;
  423. line-height: 110rpx;
  424. margin-left: 24rpx;
  425. }
  426. }
  427. .attachment_li{
  428. height: 40rpx;
  429. display: flex;
  430. justify-content: flex-start;
  431. align-items: center;
  432. margin-top: 32rpx;
  433. >img{
  434. width: 30rpx;
  435. height: 26rpx;
  436. margin-right: 20rpx;
  437. margin-left: 50rpx;
  438. }
  439. >text{
  440. flex: 1;
  441. font-size: 28rpx;
  442. font-family: PingFang SC-Medium, PingFang SC;
  443. font-weight: 400;
  444. color: #0183FA;
  445. line-height: 40rpx;
  446. white-space: nowrap;
  447. overflow: hidden;
  448. text-overflow: ellipsis;
  449. }
  450. .attachment_li_del{
  451. width: 30rpx;
  452. height: 30rpx;
  453. }
  454. }
  455. }
  456. .inconformity{
  457. width: 690rpx;
  458. height: 100rpx;
  459. background: #FFFFFF;
  460. border-radius: 20rpx 20rpx 20rpx 20rpx;
  461. margin: 20rpx 30rpx;
  462. font-size: 30rpx;
  463. font-family: PingFang SC-Medium, PingFang SC;
  464. font-weight: 400;
  465. color: #333333;
  466. line-height: 100rpx;
  467. text-align: center;
  468. display: flex;
  469. justify-content: center;
  470. align-items: center;
  471. >img{
  472. width: 30rpx;
  473. height: 26rpx;
  474. margin-left: 20rpx;
  475. }
  476. }
  477. .danger{
  478. width: 690rpx;
  479. background: #FFFFFF;
  480. border-radius: 20rpx;
  481. padding: 15rpx 30rpx 15rpx;
  482. box-sizing: border-box;
  483. margin: 20rpx 30rpx ;
  484. position: relative;
  485. .sort{
  486. width: 40rpx;
  487. height: 40rpx;
  488. background: #0183FA;
  489. border-radius: 20rpx 0rpx 10rpx 0rpx;
  490. font-size: 30rpx;
  491. font-family: PingFang SC-Medium, PingFang SC;
  492. font-weight: 400;
  493. color: #FFFFFF;
  494. line-height: 40rpx;
  495. text-align: center;
  496. position: absolute;
  497. left: 0;
  498. top: 0;
  499. }
  500. .danger_title{
  501. font-size: 30rpx;
  502. font-family: PingFang SC-Medium, PingFang SC;
  503. font-weight: 400;
  504. color: #333333;
  505. line-height:80rpx;
  506. border-bottom: 1rpx solid #D8D8D8;
  507. }
  508. .grade{
  509. height: 80rpx;
  510. display: flex;
  511. justify-content: space-between;
  512. border-bottom: 1rpx solid #D8D8D8;
  513. >text:nth-of-type(1){
  514. font-size: 28rpx;
  515. font-family: PingFang SC-Medium, PingFang SC;
  516. font-weight: 400;
  517. color: #666666;
  518. line-height: 80rpx;
  519. width: 140rpx;
  520. }
  521. >text:nth-of-type(2){
  522. flex: 1;
  523. font-size: 28rpx;
  524. font-family: PingFang SC-Medium, PingFang SC;
  525. font-weight: 400;
  526. color: #333333;
  527. line-height: 80rpx;
  528. text-align: right;
  529. }
  530. }
  531. .project{
  532. .project_t{
  533. font-size: 30rpx;
  534. font-family: PingFang SC-Medium, PingFang SC;
  535. font-weight: 400;
  536. color: #333333;
  537. line-height: 80rpx;
  538. }
  539. .project_b{
  540. min-height: 158rpx;
  541. font-size: 28rpx;
  542. font-family: PingFang SC-Medium, PingFang SC;
  543. font-weight: 400;
  544. color: #333333;
  545. line-height: 40rpx;
  546. padding: 20rpx 14rpx;
  547. box-sizing: border-box;
  548. background: #F5F5F5;
  549. border-radius: 20rpx 20rpx 20rpx 20rpx;
  550. }
  551. .project_b2{
  552. font-size: 26rpx;
  553. font-family: PingFang SC-Medium, PingFang SC;
  554. font-weight: 400;
  555. color: #666666;
  556. line-height: 26rpx;
  557. margin-top: 14rpx;
  558. text-align: right;
  559. }
  560. }
  561. .picture{
  562. .picture_t{
  563. font-size: 30rpx;
  564. font-family: PingFang SC-Medium, PingFang SC;
  565. font-weight: 400;
  566. color: #333333;
  567. line-height: 80rpx;
  568. }
  569. .picture_b{
  570. display: flex;
  571. justify-content: flex-start;
  572. flex-wrap: wrap;
  573. >img{
  574. width: 200rpx;
  575. height: 200rpx;
  576. border-radius: 10rpx 10rpx 10rpx 10rpx;
  577. margin-right: 14rpx;
  578. margin-bottom: 10rpx;
  579. }
  580. >img:nth-of-type(3n+3){
  581. margin-right: 0rpx;
  582. }
  583. }
  584. }
  585. }
  586. .pack_up{
  587. font-size: 30rpx;
  588. font-family: PingFang SC-Medium, PingFang SC;
  589. font-weight: 400;
  590. color: #666666;
  591. line-height: 140rpx;
  592. display: flex;
  593. justify-content: center;
  594. align-items: center;
  595. >img{
  596. width: 14rpx;
  597. height: 8rpx;
  598. margin-left: 22rpx;
  599. }
  600. }
  601. .report{
  602. width: 153rpx;
  603. height: 50rpx;
  604. background: #0183FA;
  605. border-radius: 25rpx 0rpx 0rpx 25rpx;
  606. font-size: 26rpx;
  607. font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  608. font-weight: 400;
  609. color: #FFFFFF;
  610. line-height: 50rpx;
  611. position: fixed;
  612. top: 180rpx;
  613. right: 0;
  614. text-align: center;
  615. }
  616. .bottom_btn{
  617. position: fixed;
  618. bottom: 26rpx;
  619. left: 30rpx;
  620. font-size: 30rpx;
  621. font-family: PingFang SC-Medium, PingFang SC;
  622. font-weight: 400;
  623. color: #FFFFFF;
  624. line-height: 90rpx;
  625. width: 690rpx;
  626. height: 90rpx;
  627. background: #0183FA;
  628. border-radius: 20rpx;
  629. text-align: center;
  630. }
  631. }
  632. </style>