snapshotRectification.vue 14 KB

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