snapshotDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  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="grade">
  7. <text>学院:</text>
  8. <text>{{item.deptName}}</text>
  9. </view>
  10. <view class="grade">
  11. <text>实验室:</text>
  12. <text>{{item.subName}}</text>
  13. </view>
  14. <view class="project">
  15. <view class="project_t">隐患描述:</view>
  16. <view class="project_b">{{item.hazardDescribe}}</view>
  17. </view>
  18. <view class="picture">
  19. <view class="picture_t">隐患照片:</view>
  20. <view class="picture_b">
  21. <img :src="item.fileUrl" v-for="(item,index) in item.yhDtoList"/>
  22. </view>
  23. </view>
  24. <view class="grade">
  25. <text>上报时间:</text>
  26. <text>{{item.createTime}}</text>
  27. </view>
  28. <view class="grade" style="border:none;">
  29. <text>上报人:</text>
  30. <text >{{item.createName}}</text>
  31. </view>
  32. </view>
  33. <!-- 待整改 -->
  34. <view v-if="rectifyStatus==0 && item.rectifyGentle">
  35. <view class="await">
  36. <view class="result">
  37. <view class="result_l">整改结果</view>
  38. <view class="result_r">
  39. <view v-for="(item,index) in resultArray" :key="index" @click="tabClick(index)">
  40. <text :class="resultIndex==index?'checked':'result_r_l' "></text>
  41. <text class="result_r_r">{{item}}</text>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="describe">
  46. <view class="describe_l">{{describeTitle}}:</view>
  47. <textarea class="describe_r" type="text" v-model="form.rectifyDescribe" maxlength="50" placeholder="请输入描述内容" placeholder-style="font-size:28rpx;color:#999;"></textarea>
  48. </view>
  49. <view class="check-for-img-max-box">
  50. <view class="left-title-p">隐患照片(最多上传5张):</view>
  51. <view class="right-img-box">
  52. <view class="img-box" v-for="(imgUrl,imgIndex) in form.imgDtoList" :key="imgIndex">
  53. <img class="img-data" :src="configURL+imgUrl">
  54. <img class="position-img" src="@/pages_manage/images/icon_ssp_closure.png" @click="delImg(imgIndex)">
  55. </view>
  56. <img class="add-button" src="@/pages_manage/images/icon_07.png" @click="selectImage()" v-if="form.imgDtoList.length<5">
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- 隐患整改 -->
  62. <view class="basics" v-if="rectifyStatus==1 || rectifyStatus==2">
  63. <view class="small_title">隐患整改</view>
  64. <view class="grade">
  65. <text>整改结果:</text>
  66. <text style="color: #0183FA;">{{item.rectifyStatus==1?'已整改':'暂无法整改'}}</text>
  67. </view>
  68. <view class="project">
  69. <view class="project_t">整改措施:</view>
  70. <view class="project_b">{{item.rectifyDescribe}}</view>
  71. </view>
  72. <view class="picture">
  73. <view class="picture_t">上传照片:</view>
  74. <view class="picture_b">
  75. <img :src="item.fileUrl" v-for="(item,index) in item.zgDtoList"/>
  76. </view>
  77. </view>
  78. <view class="grade">
  79. <text>整改时间:</text>
  80. <text>{{item.rectifyTime}}</text>
  81. </view>
  82. <view class="grade" style="border:none;">
  83. <text>整改人:</text>
  84. <text >{{item.rectifyPeople}}</text>
  85. </view>
  86. </view>
  87. </scroll-view>
  88. <view v-if="rectifyStatus==0 && item.rectifyGentle" class="bottom_btn" @click="submitForm()">提交</view>
  89. </view>
  90. </template>
  91. <script>
  92. import { config } from '@/api/request/config.js'
  93. import { getSelectInfoByRoom,checkClapById,checkClapRectify} from '@/api/index.js'
  94. export default {
  95. name: "rectifyList",
  96. components: {
  97. },
  98. data() {
  99. return {
  100. configURL:config.base_url,
  101. id:'',
  102. rectifyStatus:'',//整改状态,0是待整改,1是已整改,2是暂无法整改
  103. pageType:2,
  104. form:{
  105. id:'',
  106. rectifyStatus:1,//0待整改 1已整改 2暂无法整改
  107. rectifyDescribe:'',
  108. imgDtoList:[],
  109. },
  110. item:{},
  111. describeTitle:'整改措施',
  112. resultIndex:0,
  113. resultArray:['已整改','暂无法整改'],
  114. }
  115. },
  116. onLoad(option) {
  117. console.log(option.id)
  118. if(option.id){
  119. this.id=option.id
  120. }
  121. if(option.rectifyStatus){
  122. this.rectifyStatus=option.rectifyStatus
  123. if(option.rectifyStatus==0){
  124. uni.setNavigationBarTitle({
  125. title:'待整改'
  126. })
  127. }else if(option.rectifyStatus==1){
  128. uni.setNavigationBarTitle({
  129. title:'已整改'
  130. })
  131. }else if(option.rectifyStatus==2){
  132. uni.setNavigationBarTitle({
  133. title:'暂无法整改'
  134. })
  135. }
  136. }
  137. },
  138. onShow() {
  139. },
  140. mounted(){
  141. this.checkClapById();
  142. },
  143. methods: {
  144. //整改结果
  145. tabClick(index) {
  146. this.resultIndex = index;
  147. if(index==0){
  148. this.describeTitle='整改措施';
  149. this.form.rectifyStatus=1;
  150. }else if(index==1){
  151. this.describeTitle='原因描述';
  152. this.form.rectifyStatus=2;
  153. }
  154. },
  155. //滚动事件
  156. scrollGet(){},
  157. handleClick(doType){
  158. let self=this;
  159. if(doType=='subBtn'){//提交
  160. }
  161. },
  162. // 图片上传
  163. selectImage() {
  164. let self = this;
  165. if(this.form.imgDtoList.length>4){
  166. uni.showToast({
  167. title: '最多上传5张图片',
  168. icon:"none",
  169. mask:true,
  170. duration: 2000
  171. });
  172. return
  173. }
  174. wx.chooseImage({
  175. count: 1,
  176. sizeType: ["original", "compressed"],
  177. sourceType: ["album", "camera"],
  178. success: function(res) {
  179. let tempFilePaths = res.tempFilePaths[0];
  180. self.uploadImg(tempFilePaths);
  181. }
  182. });
  183. },
  184. async uploadImg(tempFilePaths){
  185. var self = this;
  186. uni.showLoading({
  187. title: '上传中',
  188. mask: true
  189. });
  190. uni.uploadFile({
  191. url: config.base_url+'/base/file/upload', //仅为示例,非真实的接口地址
  192. header:{'Authorization':uni.getStorageSync('token')},
  193. filePath: tempFilePaths,
  194. name: 'file',
  195. formData: {
  196. 'user': 'test'
  197. },
  198. success: (uploadFileRes) => {
  199. let res = JSON.parse(uploadFileRes.data);
  200. if(res.code == 200){
  201. this.form.imgDtoList.push({'fileUrl':res.data.url,'fileName':res.data.name});
  202. console.log(res.data.url)
  203. }else{
  204. uni.showToast({
  205. title: res.msg,
  206. icon:"none",
  207. mask:true,
  208. duration: 2000
  209. });
  210. }
  211. },
  212. fail: err => {},
  213. complete: () => {
  214. uni.hideLoading()
  215. }
  216. });
  217. },
  218. //删除图片
  219. delImg(minIndex){
  220. this.form.imgDtoList.splice(minIndex,1);
  221. this.$forceUpdate();
  222. },
  223. //随手拍详情
  224. async checkClapById(){
  225. let _this = this;
  226. const {data} = await checkClapById({id:this.id});
  227. if(data.code == 200){
  228. _this.item=data.data;
  229. _this.form.id=data.data.id;
  230. }
  231. },
  232. //提交
  233. async submitForm(){
  234. let _this = this;
  235. const {data} = await checkClapRectify(_this.form);
  236. if(data.code == 200){
  237. uni.showToast({
  238. title: '提交成功',
  239. icon:"none",
  240. mask:true,
  241. duration: 2000
  242. });
  243. uni.redirectTo({
  244. url: '/pages/pages_safetyExamine/snapshotManage/snapshotList?pageType=2'
  245. });
  246. }
  247. },
  248. }
  249. }
  250. </script>
  251. <style lang="stylus" scoped>
  252. .examine{
  253. height:100%;
  254. display flex;
  255. box-sizing: border-box;
  256. .info-max-box{
  257. flex: 1;
  258. overflow: scroll;
  259. padding-bottom: 128rpx;
  260. box-sizing: border-box;
  261. }
  262. .basics{
  263. width: 690rpx;
  264. background: #FFFFFF;
  265. border-radius: 20rpx;
  266. padding: 30rpx 30rpx 32rpx;
  267. box-sizing: border-box;
  268. margin: 20rpx 30rpx ;
  269. .small_title{
  270. font-size: 30rpx;
  271. font-family: PingFang SC-Medium, PingFang SC;
  272. font-weight: 400;
  273. color: #333333;
  274. line-height: 80rpx;
  275. border-bottom: 1rpx solid #D8D8D8;
  276. }
  277. .grade{
  278. height: 80rpx;
  279. display: flex;
  280. justify-content: space-between;
  281. border-bottom: 1rpx solid #D8D8D8;
  282. >text:nth-of-type(1){
  283. font-size: 28rpx;
  284. font-family: PingFang SC-Medium, PingFang SC;
  285. font-weight: 400;
  286. color: #666666;
  287. line-height: 80rpx;
  288. width: 140rpx;
  289. }
  290. >text:nth-of-type(2){
  291. flex: 1;
  292. font-size: 28rpx;
  293. font-family: PingFang SC-Medium, PingFang SC;
  294. font-weight: 400;
  295. color: #333333;
  296. line-height: 80rpx;
  297. text-align: right;
  298. }
  299. }
  300. .project{
  301. .project_t{
  302. font-size: 30rpx;
  303. font-family: PingFang SC-Medium, PingFang SC;
  304. font-weight: 400;
  305. color: #333333;
  306. line-height: 80rpx;
  307. }
  308. .project_b{
  309. min-height: 158rpx;
  310. font-size: 28rpx;
  311. font-family: PingFang SC-Medium, PingFang SC;
  312. font-weight: 400;
  313. color: #333333;
  314. line-height: 40rpx;
  315. padding: 20rpx 14rpx;
  316. box-sizing: border-box;
  317. background: #F5F5F5;
  318. border-radius: 20rpx 20rpx 20rpx 20rpx;
  319. }
  320. .project_b2{
  321. font-size: 26rpx;
  322. font-family: PingFang SC-Medium, PingFang SC;
  323. font-weight: 400;
  324. color: #666666;
  325. line-height: 26rpx;
  326. margin-top: 14rpx;
  327. text-align: right;
  328. }
  329. }
  330. .picture{
  331. .picture_t{
  332. font-size: 30rpx;
  333. font-family: PingFang SC-Medium, PingFang SC;
  334. font-weight: 400;
  335. color: #333333;
  336. line-height: 80rpx;
  337. }
  338. .picture_b{
  339. display: flex;
  340. justify-content: flex-start;
  341. flex-wrap: wrap;
  342. >img{
  343. width: 200rpx;
  344. height: 200rpx;
  345. border-radius: 10rpx 10rpx 10rpx 10rpx;
  346. margin-right: 14rpx;
  347. margin-bottom: 10rpx;
  348. }
  349. >img:nth-of-type(3n+3){
  350. margin-right: 0rpx;
  351. }
  352. }
  353. }
  354. }
  355. /* 待整改 */
  356. .await{
  357. width: 690rpx;
  358. background: #FFFFFF;
  359. border-radius: 20rpx;
  360. padding: 30rpx 30rpx 32rpx;
  361. box-sizing: border-box;
  362. margin: 20rpx 30rpx ;
  363. /* 整改结果 */
  364. .result{
  365. display: flex;
  366. justify-content: flex-start;
  367. border-bottom: 1rpx solid #D8D8D8;
  368. .result_l{
  369. width: 146rpx;
  370. text-align: left;
  371. font-size: 30rpx;
  372. font-family: PingFang SC-Medium, PingFang SC;
  373. font-weight: 400;
  374. color: #333333;
  375. line-height: 80rpx;
  376. }
  377. .result_r{
  378. width: 486rpx;
  379. height: 80rpx;
  380. padding-left: 20rpx;
  381. box-sizing: border-box;
  382. display: flex;
  383. justify-content: flex-end;
  384. align-items: center;
  385. >view{
  386. display: flex;
  387. justify-content: flex-start;
  388. align-items: center;
  389. margin-right: 24rpx;
  390. .result_r_l{
  391. display: inline-block;
  392. width: 30rpx;
  393. height: 30rpx;
  394. border-radius: 50%;
  395. border: 1rpx solid #E0E0E0;
  396. margin-right: 14rpx;
  397. }
  398. .result_r_r{
  399. font-size: 30rpx;
  400. font-family: PingFang SC-Medium, PingFang SC;
  401. font-weight: 400;
  402. color: #333333;
  403. line-height: 80rpx;
  404. }
  405. .checked{
  406. display: inline-block;
  407. width: 30rpx;
  408. height: 30rpx;
  409. border-radius: 50%;
  410. border: 1rpx solid #0183FA;
  411. margin-right: 14rpx;
  412. position: relative;
  413. }
  414. .checked::after{
  415. content: '';
  416. position: absolute;
  417. top: 5rpx;
  418. left:5rpx;
  419. width: 20rpx;
  420. height: 20rpx;
  421. border-radius: 50%;
  422. background: #0183FA;
  423. }
  424. }
  425. }
  426. }
  427. /* 原因描述 */
  428. .describe{
  429. .describe_l{
  430. width: 158rpx;
  431. text-align: left;
  432. font-size: 30rpx;
  433. font-family: PingFang SC-Medium, PingFang SC;
  434. font-weight: 400;
  435. color: #333333;
  436. line-height: 80rpx;
  437. }
  438. .describe_r{
  439. width: 630rpx;
  440. height: 158rpx;
  441. border-radius: 20rpx 20rpx 20rpx 20rpx;
  442. opacity: 1;
  443. border: 1rpx solid #E0E0E0;
  444. padding: 20rpx 14rpx;
  445. box-sizing: border-box;
  446. font-size: 30rpx;
  447. font-family: PingFang SC-Medium, PingFang SC;
  448. font-weight: 400;
  449. color: #333333;
  450. line-height: 34rpx;
  451. }
  452. }
  453. /* 上传照片 */
  454. .check-for-img-max-box{
  455. .left-title-p{
  456. width: 100%;
  457. text-align: left;
  458. font-size: 30rpx;
  459. font-family: PingFang SC-Medium, PingFang SC;
  460. font-weight: 400;
  461. color: #333333;
  462. line-height: 80rpx;
  463. }
  464. .right-img-box{
  465. .img-box{
  466. display inline-block;
  467. height:200rpx;
  468. width:200rpx;
  469. position relative
  470. margin:0 14rpx 20rpx 0;
  471. border-radius 10rpx;
  472. overflow hidden;
  473. .img-data{
  474. height:200rpx;
  475. width:200rpx;
  476. }
  477. .position-img{
  478. position absolute
  479. right:0;
  480. top:0;
  481. width:36rpx;
  482. height:36rpx;
  483. }
  484. }
  485. .img-box:nth-of-type(3n+3){
  486. margin-right: 0rpx;
  487. }
  488. .add-button{
  489. margin:0 0rpx 20rpx 0;
  490. border-radius 10rpx;
  491. overflow hidden;
  492. display inline-block
  493. height:200rpx;
  494. width:200rpx;
  495. }
  496. }
  497. }
  498. }
  499. .bottom_btn{
  500. position: fixed;
  501. bottom: 26rpx;
  502. left: 30rpx;
  503. font-size: 30rpx;
  504. font-family: PingFang SC-Medium, PingFang SC;
  505. font-weight: 400;
  506. color: #FFFFFF;
  507. line-height: 90rpx;
  508. width: 690rpx;
  509. height: 90rpx;
  510. background: #0183FA;
  511. border-radius: 20rpx;
  512. text-align: center;
  513. }
  514. }
  515. </style>