examineDetail.vue 16 KB

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