hiddenDangerRectification.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. <!-- 检查项隐患项整改 -->
  2. <template>
  3. <view class="snapshotDetail">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  5. <view class="tip">整改期限{{optionData.checkPlanSetVoList.checkStartTime}}(逾期未完成整改关闭实验室)</view>
  6. <view class="items" v-if="newData.hazardCheckName!=''">
  7. <view class="items-t" >
  8. <view class="items-t-r">{{newData.hazardCheckCode}} {{newData.hazardCheckName}}</view>
  9. </view>
  10. <view class="items-b" >< {{newData.hazardCheckCode2}}
  11. {{newData.hazardCheckName2}} < {{newData.hazardCheckCode1}} {{newData.hazardCheckName1}}</view>
  12. </view>
  13. <view class="items-number" v-if="newData.hazardCheckName!=''">此检查项在当前实验室累计出现<text>{{newData.hazardCheckNum}}</text>次隐患</view>
  14. <view class="list">
  15. <view class="list-li" v-if="newData.hazardCheckName!=''">
  16. <view>检查要点</view>
  17. <view>
  18. <img src="@/pages_safetyCheck/images/icon_06.png">
  19. </view>
  20. </view>
  21. <view v-if="newData.hazardCheckName!=''" class="hidden-content">{{newData.hazardCheckPoint}}
  22. </view>
  23. <view class="list-li">
  24. <view>检查隐患</view>
  25. <view style="color: #FF8C00;">
  26. <img src="@/pages_safetyCheck/images/icon_06.png">
  27. </view>
  28. </view>
  29. <view class="hidden-content">{{newData.hazardDescribe}}
  30. </view>
  31. <view class="photo">
  32. <img v-for="(item,index) in newData.yhDtoList" :src="baseUrl+item.fileUrl">
  33. </view>
  34. <view class="list-li">
  35. <view>姓名:</view>
  36. <view>{{newData.createName}}</view>
  37. </view>
  38. <view class="list-li">
  39. <view>检查时间 :</view>
  40. <view>{{newData.createTime}}</view>
  41. </view>
  42. <view class="list-li">
  43. <view>隐患整改</view>
  44. <view>
  45. <img src="@/pages_safetyCheck/images/icon_06.png">
  46. </view>
  47. </view>
  48. <textarea class="describe" type="text" v-model="form.rectifyDescribe" maxlength="500"
  49. placeholder="立整立改的请填写相关文字及整改前后照片对比等,不能立整立改的请说明原因并附整改计划、措施等" placeholder-style="font-size:24rpx;color:#999;"></textarea>
  50. <view class="check-for-img-max-box">
  51. <view class="left-title-p"></view>
  52. <view class="right-img-box">
  53. <view class="img-box" v-for="(imgUrl,imgIndex) in form.imgDtoList" :key="imgIndex">
  54. <img class="img-data" :src="baseUrl+imgUrl.fileUrl">
  55. <img class="position-img" src="@/pages_safetyCheck/images/icon_ssp_closure.png"
  56. @click="delImg(imgIndex)">
  57. </view>
  58. <img class="add-button" src="@/pages_safetyCheck/images/img_ssp_pz@1x.png"
  59. @click="selectImage()" v-if="form.imgDtoList.length<6">
  60. </view>
  61. </view>
  62. <!-- <view class="list-li-tow">
  63. <view>整改方案(上传文件)</view>
  64. <view @click="selectFile()">
  65. <img src="@/pages_safetyCheck/images/icon_aqjc_sc.png">
  66. </view>
  67. </view>
  68. <view class="file-li" v-if="form.rectifyProjectName">
  69. <img src="@/pages_safetyCheck/images/icon_djc_wj.png">
  70. <view>{{form.rectifyProjectName}}</view>
  71. <img src="@/pages_safetyCheck/images/icon_yybz_sc.png">
  72. </view> -->
  73. </view>
  74. </scroll-view>
  75. <view class="sub-btn">
  76. <view @click="submitForm(2)">暂无法整改</view>
  77. <view @click="submitForm(1)">完成整改</view>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. import {
  83. config
  84. } from '@/api/request/config.js'
  85. import {
  86. securityAppCheckPhotoUpdate,
  87. securityAppCheckDangerGetCheckProDetail,
  88. securityAppCheckDangerCheckRectify,
  89. } from '@/pages_safetyCheck/api/index.js'
  90. export default {
  91. name: "snapshotDetail",
  92. components: {
  93. },
  94. data() {
  95. return {
  96. baseUrl: config.base_url,
  97. inspectionItems: 0, //0有检查项 1无检查项
  98. form: {
  99. imgDtoList: [],
  100. rectifyProjectName:'',
  101. rectifyProjectUrl:'',
  102. },
  103. newData: {},
  104. optionData:null,
  105. }
  106. },
  107. onLoad(option) {
  108. let optionData = JSON.parse(decodeURIComponent(option.infoData));
  109. console.log(optionData)
  110. this.$set(this, 'optionData', optionData);
  111. },
  112. onShow() {
  113. },
  114. mounted() {
  115. this.securityAppCheckDangerGetCheckProDetail();
  116. },
  117. methods: {
  118. //详情
  119. async securityAppCheckDangerGetCheckProDetail(){
  120. let obj = {
  121. planId: this.optionData.checkPlanSetVoList.planId,
  122. planSetId: this.optionData.checkPlanSetVoList.planSetId,
  123. checkCategory: this.optionData.checkCategory,
  124. hazardCheckPro: this.optionData.hazardCheckPro,
  125. subId: this.optionData.subId,
  126. }
  127. const {
  128. data
  129. } = await securityAppCheckDangerGetCheckProDetail(obj);
  130. if (data.code == 200) {
  131. uni.setNavigationBarTitle({
  132. title: data.data.subName + '(' + data.data.roomNum + ')'
  133. })
  134. this.$set(this, 'newData', data.data);
  135. }
  136. },
  137. //滚动事件
  138. scrollGet() {},
  139. /******文件上传******/
  140. selectFile() {
  141. let self = this;
  142. wx.chooseMessageFile({
  143. count: 1,
  144. type: 'file',
  145. success (res) {
  146. console.log(res)
  147. // tempFilePath可以作为img标签的src属性显示图片
  148. const tempFilePaths = res.tempFiles[0].path
  149. self.form.rectifyProjectName=res.tempFiles[0].name
  150. self.uploadFile(tempFilePaths);
  151. }
  152. })
  153. },
  154. async uploadFile(tempFilePaths) {
  155. var self = this;
  156. uni.showLoading({
  157. title: '上传中',
  158. mask: true
  159. });
  160. uni.uploadFile({
  161. url: config.base_url + '/system/file/upload', //仅为示例,非真实的接口地址
  162. header: {
  163. 'Authorization': uni.getStorageSync('token')
  164. },
  165. filePath: tempFilePaths,
  166. name: 'file',
  167. formData: {
  168. 'user': 'test'
  169. },
  170. success: (uploadFileRes) => {
  171. let res = JSON.parse(uploadFileRes.data);
  172. console.log(res)
  173. if (res.code == 200) {
  174. self.form.rectifyProjectUrl=res.data.url;
  175. } else {
  176. uni.showToast({
  177. title: res.msg,
  178. icon: "none",
  179. mask: true,
  180. duration: 2000
  181. });
  182. }
  183. },
  184. fail: err => {},
  185. complete: () => {
  186. uni.hideLoading()
  187. }
  188. });
  189. },
  190. /******图片上传******/
  191. selectImage() {
  192. let self = this;
  193. if (this.form.imgDtoList.length > 4) {
  194. uni.showToast({
  195. title: '最多上传5张图片',
  196. icon: "none",
  197. mask: true,
  198. duration: 2000
  199. });
  200. return
  201. }
  202. wx.chooseImage({
  203. count: 1,
  204. sizeType: ["original", "compressed"],
  205. sourceType: ["album", "camera"],
  206. success: function(res) {
  207. let tempFilePaths = res.tempFilePaths[0];
  208. console.log(tempFilePaths)
  209. self.uploadImg(tempFilePaths);
  210. }
  211. });
  212. },
  213. async uploadImg(tempFilePaths) {
  214. var self = this;
  215. uni.showLoading({
  216. title: '上传中',
  217. mask: true
  218. });
  219. uni.uploadFile({
  220. url: config.base_url + '/system/file/upload', //仅为示例,非真实的接口地址
  221. header: {
  222. 'Authorization': uni.getStorageSync('token')
  223. },
  224. filePath: tempFilePaths,
  225. name: 'file',
  226. formData: {
  227. 'user': 'test'
  228. },
  229. success: (uploadFileRes) => {
  230. let res = JSON.parse(uploadFileRes.data);
  231. if (res.code == 200) {
  232. this.form.imgDtoList.push({
  233. 'fileUrl': res.data.url,
  234. 'fileName': res.data.name,
  235. 'fileType':2,
  236. });
  237. console.log(res.data.url)
  238. } else {
  239. uni.showToast({
  240. title: res.msg,
  241. icon: "none",
  242. mask: true,
  243. duration: 2000
  244. });
  245. }
  246. },
  247. fail: err => {},
  248. complete: () => {
  249. uni.hideLoading()
  250. }
  251. });
  252. },
  253. //删除图片
  254. delImg(minIndex) {
  255. this.form.imgDtoList.splice(minIndex, 1);
  256. this.$forceUpdate();
  257. },
  258. //整改/暂无法整改
  259. async submitForm(status) {
  260. let self = this;
  261. let obj={
  262. checkCategory:this.optionData.checkCategory,
  263. dangerId:this.newData.dangerId,
  264. rectifyMaterialName:'',//待定字段
  265. rectifyMaterialUrl:'',//待定字段
  266. rectifyMeasure:this.form.rectifyDescribe,
  267. rectifyResult:status==1?true:false,//true已整改false暂无法整改
  268. rectifyUploadList:this.form.imgDtoList,
  269. }
  270. console.log(obj)
  271. const {
  272. data
  273. } = await securityAppCheckDangerCheckRectify(obj);
  274. if (data.code == 200) {
  275. uni.showToast({
  276. title: '提交成功',
  277. icon: "none",
  278. mask: true,
  279. duration: 2000
  280. });
  281. let infoData=this.optionData;
  282. uni.navigateTo({
  283. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' + encodeURIComponent(JSON.stringify(infoData))
  284. });
  285. }
  286. },
  287. }
  288. }
  289. </script>
  290. <style lang="stylus" scoped>
  291. .snapshotDetail {
  292. height: 100%;
  293. display flex;
  294. box-sizing: border-box;
  295. padding-bottom: 160rpx;
  296. box-sizing: border-box;
  297. #bgColor-A {
  298. color: #FFD400;
  299. }
  300. #bgColor-B {
  301. color: #FF8C00;
  302. }
  303. #bgColor-C {
  304. color: #E11608;
  305. }
  306. .tip {
  307. width: 750rpx;
  308. height: 80rpx;
  309. background: rgba(255, 140, 0, 0.2);
  310. font-weight: normal;
  311. font-size: 28rpx;
  312. color: #FF8C00;
  313. line-height: 80rpx;
  314. text-align: center;
  315. }
  316. .items {
  317. width: 690rpx;
  318. min-height: 165rpx;
  319. background: #FFFFFF;
  320. border-radius: 20rpx 20rpx 20rpx 20rpx;
  321. margin: 20rpx 0 0 30rpx;
  322. .items-li {
  323. display: flex;
  324. justify-content: space-between;
  325. align-items: center;
  326. padding: 0 30rpx;
  327. box-sizing: border-box;
  328. border-bottom: 1rpx solid #E0E0E0;
  329. >view:nth-of-type(1) {
  330. font-size: 30rpx;
  331. color: #333333;
  332. line-height: 80rpx;
  333. text-align: left;
  334. }
  335. >view:nth-of-type(2) {
  336. font-size: 28rpx;
  337. color: #666666;
  338. line-height: 80rpx;
  339. text-align: left;
  340. display: flex;
  341. justify-content: space-between;
  342. align-items: center;
  343. }
  344. }
  345. .items-t {
  346. border-bottom: 1rpx solid #E0E0E0;
  347. height: 80rpx;
  348. display: flex;
  349. justify-content: flex-start;
  350. align-items: center;
  351. padding: 0 30rpx;
  352. box-sizing: border-box;
  353. .items-t-l {
  354. width: 175rpx;
  355. height: 50rpx;
  356. background: #E11608;
  357. border-radius: 50rpx 50rpx 50rpx 50rpx;
  358. font-size: 30rpx;
  359. color: #FFFFFF;
  360. line-height: 50rpx;
  361. text-align: center;
  362. margin-right: 14rpx;
  363. }
  364. .items-t-r {
  365. font-size: 30rpx;
  366. color: #333333;
  367. line-height: 42rpx;
  368. text-align: left;
  369. }
  370. }
  371. .items-b {
  372. padding: 0 30rpx;
  373. box-sizing: border-box;
  374. height: 80rpx;
  375. font-size: 28rpx;
  376. color: #666666;
  377. line-height: 80rpx;
  378. text-align: left;
  379. }
  380. }
  381. .items-number {
  382. font-size: 24rpx;
  383. color: #3D3D3D;
  384. line-height: 34rpx;
  385. text-align: right;
  386. margin: 20rpx 60rpx 0 0;
  387. >text {
  388. font-size: 24rpx;
  389. color: #FF0000;
  390. line-height: 34rpx;
  391. text-align: right;
  392. }
  393. }
  394. .list {
  395. width: 690rpx;
  396. margin: 20rpx 30rpx 0;
  397. background: #FFFFFF;
  398. border-radius: 20rpx 20rpx 20rpx 20rpx;
  399. .list-li {
  400. display: flex;
  401. justify-content: space-between;
  402. align-items: center;
  403. padding: 0 30rpx;
  404. box-sizing: border-box;
  405. border-bottom: 1rpx solid #E0E0E0;
  406. >view:nth-of-type(1) {
  407. font-size: 30rpx;
  408. color: #333333;
  409. line-height: 80rpx;
  410. text-align: left;
  411. }
  412. >view:nth-of-type(2) {
  413. font-size: 28rpx;
  414. color: #666666;
  415. line-height: 80rpx;
  416. text-align: left;
  417. display: flex;
  418. justify-content: space-between;
  419. align-items: center;
  420. >img {
  421. width: 24rpx;
  422. height: 12rpx;
  423. margin-left: 10rpx;
  424. }
  425. }
  426. }
  427. .list-li-tow {
  428. display: flex;
  429. justify-content: space-between;
  430. align-items: center;
  431. padding: 0 30rpx;
  432. box-sizing: border-box;
  433. border-top: 1rpx solid #E0E0E0;
  434. border-bottom: 1rpx solid #E0E0E0;
  435. >view:nth-of-type(1) {
  436. font-size: 30rpx;
  437. color: #333333;
  438. line-height: 80rpx;
  439. text-align: left;
  440. }
  441. >view:nth-of-type(2) {
  442. font-size: 28rpx;
  443. color: #666666;
  444. line-height: 80rpx;
  445. text-align: left;
  446. display: flex;
  447. justify-content: space-between;
  448. align-items: center;
  449. >img {
  450. width: 30rpx;
  451. height: 28rpx;
  452. margin-left: 10rpx;
  453. }
  454. }
  455. }
  456. .file-li {
  457. display: flex;
  458. justify-content: space-between;
  459. align-items: center;
  460. padding: 0 30rpx;
  461. box-sizing: border-box;
  462. >img:nth-of-type(1) {
  463. width: 30rpx;
  464. height: 30rpx;
  465. }
  466. >view {
  467. flex: 1;
  468. font-size: 28rpx;
  469. color: #333333;
  470. line-height: 80rpx;
  471. text-align: left;
  472. margin: 0 92rpx 0 16rpx;
  473. overflow: hidden;
  474. text-overflow: ellipsis;
  475. white-space: nowrap;
  476. }
  477. >img:nth-of-type(2) {
  478. width: 30rpx;
  479. height: 30rpx;
  480. }
  481. }
  482. .hidden-content {
  483. width: 630rpx;
  484. min-height: 200rpx;
  485. background: #F5F5F5;
  486. border-radius: 20rpx 20rpx 20rpx 20rpx;
  487. margin: 20rpx 30rpx 0;
  488. padding: 20rpx;
  489. box-sizing: border-box;
  490. font-size: 28rpx;
  491. color: #666666;
  492. line-height: 39rpx;
  493. text-align: left;
  494. }
  495. .photo {
  496. display: flex;
  497. justify-content: flex-start;
  498. flex-wrap: wrap;
  499. margin-top: 20rpx;
  500. padding: 0 30rpx;
  501. box-sizing: border-box;
  502. >img {
  503. width: 150rpx;
  504. height: 150rpx;
  505. border-radius: 10rpx 10rpx 10rpx 10rpx;
  506. margin: 0 10rpx 10rpx 0;
  507. }
  508. }
  509. .describe {
  510. width: 636rpx;
  511. height: 120rpx;
  512. border-radius: 10rpx 10rpx 10rpx 10rpx;
  513. border: 1rpx solid #E0E0E0;
  514. margin: 20rpx 0 0 28rpx;
  515. padding: 12rpx 16rpx;
  516. box-sizing: border-box;
  517. }
  518. .check-for-img-max-box {
  519. margin: 20px 28rpx;
  520. .left-title-p {
  521. width: 100%;
  522. text-align: left;
  523. font-size: 30rpx;
  524. font-family: PingFang SC-Medium, PingFang SC;
  525. font-weight: 400;
  526. color: #333333;
  527. line-height: 80rpx;
  528. }
  529. .right-img-box {
  530. .img-box {
  531. display inline-block;
  532. height: 150rpx;
  533. width: 150rpx;
  534. position relative;
  535. margin: 0 14rpx 20rpx 0;
  536. border-radius 10rpx;
  537. overflow hidden;
  538. .img-data {
  539. height: 150rpx;
  540. width: 150rpx;
  541. }
  542. .position-img {
  543. position absolute;
  544. right: 0;
  545. top: 0;
  546. width: 36rpx;
  547. height: 36rpx;
  548. }
  549. }
  550. .img-box:nth-of-type(3n+3) {
  551. margin-right: 0rpx;
  552. }
  553. .add-button {
  554. margin: 0 0rpx 20rpx 0;
  555. border-radius 10rpx;
  556. overflow hidden;
  557. display inline-block;
  558. height: 150rpx;
  559. width: 150rpx;
  560. }
  561. }
  562. }
  563. .list-li:last-of-type {
  564. border: none;
  565. }
  566. }
  567. }
  568. .sub-btn {
  569. display: flex;
  570. justify-content: center;
  571. position: fixed;
  572. left: 30rpx;
  573. bottom: 30rpx;
  574. >view:nth-of-type(1) {
  575. width: 345rpx;
  576. height: 100rpx;
  577. background: #FF8C00;
  578. border-radius: 50rpx 0rpx 0rpx 50rpx;
  579. font-size: 30rpx;
  580. color: #FFFFFF;
  581. line-height: 100rpx;
  582. text-align: center;
  583. }
  584. >view:nth-of-type(2) {
  585. width: 345rpx;
  586. height: 100rpx;
  587. background: #0183FA;
  588. border-radius: 0rpx 50rpx 50rpx 0rpx;
  589. font-size: 30rpx;
  590. color: #FFFFFF;
  591. line-height: 100rpx;
  592. text-align: center;
  593. }
  594. }
  595. </style>