snapshotDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  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" @click="lockImg(item.yhDtoList)">
  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. lockImg(list){
  164. console.log(list)
  165. if(!list[0]){
  166. return
  167. }
  168. let urlList=[];
  169. for(let i=0;i<list.length;i++){
  170. urlList.push(list[i].fileUrl)
  171. }
  172. wx.previewImage({
  173. urls: urlList, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  174. current: '', // 当前显示图片的http链接,默认是第一个
  175. success: function(res) {},
  176. fail: function(res) {},
  177. complete: function(res) {},
  178. })
  179. },
  180. // 图片上传
  181. selectImage() {
  182. let self = this;
  183. if(this.form.imgDtoList.length>4){
  184. uni.showToast({
  185. title: '最多上传5张图片',
  186. icon:"none",
  187. mask:true,
  188. duration: 2000
  189. });
  190. return
  191. }
  192. wx.chooseImage({
  193. count: 1,
  194. sizeType: ["original", "compressed"],
  195. sourceType: ["album", "camera"],
  196. success: function(res) {
  197. let tempFilePaths = res.tempFilePaths[0];
  198. self.uploadImg(tempFilePaths);
  199. }
  200. });
  201. },
  202. async uploadImg(tempFilePaths){
  203. var self = this;
  204. uni.showLoading({
  205. title: '上传中',
  206. mask: true
  207. });
  208. uni.uploadFile({
  209. url: config.base_url+'/base/file/upload', //仅为示例,非真实的接口地址
  210. header:{'Authorization':uni.getStorageSync('token')},
  211. filePath: tempFilePaths,
  212. name: 'file',
  213. formData: {
  214. 'user': 'test'
  215. },
  216. success: (uploadFileRes) => {
  217. let res = JSON.parse(uploadFileRes.data);
  218. if(res.code == 200){
  219. this.form.imgDtoList.push({'fileUrl':res.data.url,'fileName':res.data.name});
  220. console.log(res.data.url)
  221. }else{
  222. uni.showToast({
  223. title: res.msg,
  224. icon:"none",
  225. mask:true,
  226. duration: 2000
  227. });
  228. }
  229. },
  230. fail: err => {},
  231. complete: () => {
  232. uni.hideLoading()
  233. }
  234. });
  235. },
  236. //删除图片
  237. delImg(minIndex){
  238. this.form.imgDtoList.splice(minIndex,1);
  239. this.$forceUpdate();
  240. },
  241. //随手拍详情
  242. async checkClapById(){
  243. let _this = this;
  244. const {data} = await checkClapById({id:this.id});
  245. if(data.code == 200){
  246. _this.item=data.data;
  247. _this.form.id=data.data.id;
  248. }
  249. },
  250. //提交
  251. async submitForm(){
  252. let _this = this;
  253. const {data} = await checkClapRectify(_this.form);
  254. if(data.code == 200){
  255. uni.showToast({
  256. title: '提交成功',
  257. icon:"none",
  258. mask:true,
  259. duration: 2000
  260. });
  261. uni.redirectTo({
  262. url: '/pages/pages_safetyExamine/snapshotManage/snapshotList?pageType=2'
  263. });
  264. }
  265. },
  266. }
  267. }
  268. </script>
  269. <style lang="stylus" scoped>
  270. .examine{
  271. height:100%;
  272. display flex;
  273. box-sizing: border-box;
  274. .info-max-box{
  275. flex: 1;
  276. overflow: scroll;
  277. padding-bottom: 128rpx;
  278. box-sizing: border-box;
  279. }
  280. .basics{
  281. width: 690rpx;
  282. background: #FFFFFF;
  283. border-radius: 20rpx;
  284. padding: 30rpx 30rpx 32rpx;
  285. box-sizing: border-box;
  286. margin: 20rpx 30rpx ;
  287. .small_title{
  288. font-size: 30rpx;
  289. font-family: PingFang SC-Medium, PingFang SC;
  290. font-weight: 400;
  291. color: #333333;
  292. line-height: 80rpx;
  293. border-bottom: 1rpx solid #D8D8D8;
  294. }
  295. .grade{
  296. height: 80rpx;
  297. display: flex;
  298. justify-content: space-between;
  299. border-bottom: 1rpx solid #D8D8D8;
  300. >text:nth-of-type(1){
  301. font-size: 28rpx;
  302. font-family: PingFang SC-Medium, PingFang SC;
  303. font-weight: 400;
  304. color: #666666;
  305. line-height: 80rpx;
  306. width: 140rpx;
  307. }
  308. >text:nth-of-type(2){
  309. flex: 1;
  310. font-size: 28rpx;
  311. font-family: PingFang SC-Medium, PingFang SC;
  312. font-weight: 400;
  313. color: #333333;
  314. line-height: 80rpx;
  315. text-align: right;
  316. }
  317. }
  318. .project{
  319. .project_t{
  320. font-size: 30rpx;
  321. font-family: PingFang SC-Medium, PingFang SC;
  322. font-weight: 400;
  323. color: #333333;
  324. line-height: 80rpx;
  325. }
  326. .project_b{
  327. min-height: 158rpx;
  328. font-size: 28rpx;
  329. font-family: PingFang SC-Medium, PingFang SC;
  330. font-weight: 400;
  331. color: #333333;
  332. line-height: 40rpx;
  333. padding: 20rpx 14rpx;
  334. box-sizing: border-box;
  335. background: #F5F5F5;
  336. border-radius: 20rpx 20rpx 20rpx 20rpx;
  337. }
  338. .project_b2{
  339. font-size: 26rpx;
  340. font-family: PingFang SC-Medium, PingFang SC;
  341. font-weight: 400;
  342. color: #666666;
  343. line-height: 26rpx;
  344. margin-top: 14rpx;
  345. text-align: right;
  346. }
  347. }
  348. .picture{
  349. .picture_t{
  350. font-size: 30rpx;
  351. font-family: PingFang SC-Medium, PingFang SC;
  352. font-weight: 400;
  353. color: #333333;
  354. line-height: 80rpx;
  355. }
  356. .picture_b{
  357. display: flex;
  358. justify-content: flex-start;
  359. flex-wrap: wrap;
  360. >img{
  361. width: 200rpx;
  362. height: 200rpx;
  363. border-radius: 10rpx 10rpx 10rpx 10rpx;
  364. margin-right: 14rpx;
  365. margin-bottom: 10rpx;
  366. }
  367. >img:nth-of-type(3n+3){
  368. margin-right: 0rpx;
  369. }
  370. }
  371. }
  372. }
  373. /* 待整改 */
  374. .await{
  375. width: 690rpx;
  376. background: #FFFFFF;
  377. border-radius: 20rpx;
  378. padding: 30rpx 30rpx 32rpx;
  379. box-sizing: border-box;
  380. margin: 20rpx 30rpx ;
  381. /* 整改结果 */
  382. .result{
  383. display: flex;
  384. justify-content: flex-start;
  385. border-bottom: 1rpx solid #D8D8D8;
  386. .result_l{
  387. width: 146rpx;
  388. text-align: left;
  389. font-size: 30rpx;
  390. font-family: PingFang SC-Medium, PingFang SC;
  391. font-weight: 400;
  392. color: #333333;
  393. line-height: 80rpx;
  394. }
  395. .result_r{
  396. width: 486rpx;
  397. height: 80rpx;
  398. padding-left: 20rpx;
  399. box-sizing: border-box;
  400. display: flex;
  401. justify-content: flex-end;
  402. align-items: center;
  403. >view{
  404. display: flex;
  405. justify-content: flex-start;
  406. align-items: center;
  407. margin-right: 24rpx;
  408. .result_r_l{
  409. display: inline-block;
  410. width: 30rpx;
  411. height: 30rpx;
  412. border-radius: 50%;
  413. border: 1rpx solid #E0E0E0;
  414. margin-right: 14rpx;
  415. }
  416. .result_r_r{
  417. font-size: 30rpx;
  418. font-family: PingFang SC-Medium, PingFang SC;
  419. font-weight: 400;
  420. color: #333333;
  421. line-height: 80rpx;
  422. }
  423. .checked{
  424. display: inline-block;
  425. width: 30rpx;
  426. height: 30rpx;
  427. border-radius: 50%;
  428. border: 1rpx solid #0183FA;
  429. margin-right: 14rpx;
  430. position: relative;
  431. }
  432. .checked::after{
  433. content: '';
  434. position: absolute;
  435. top: 5rpx;
  436. left:5rpx;
  437. width: 20rpx;
  438. height: 20rpx;
  439. border-radius: 50%;
  440. background: #0183FA;
  441. }
  442. }
  443. }
  444. }
  445. /* 原因描述 */
  446. .describe{
  447. .describe_l{
  448. width: 158rpx;
  449. text-align: left;
  450. font-size: 30rpx;
  451. font-family: PingFang SC-Medium, PingFang SC;
  452. font-weight: 400;
  453. color: #333333;
  454. line-height: 80rpx;
  455. }
  456. .describe_r{
  457. width: 630rpx;
  458. height: 158rpx;
  459. border-radius: 20rpx 20rpx 20rpx 20rpx;
  460. opacity: 1;
  461. border: 1rpx solid #E0E0E0;
  462. padding: 20rpx 14rpx;
  463. box-sizing: border-box;
  464. font-size: 30rpx;
  465. font-family: PingFang SC-Medium, PingFang SC;
  466. font-weight: 400;
  467. color: #333333;
  468. line-height: 34rpx;
  469. }
  470. }
  471. /* 上传照片 */
  472. .check-for-img-max-box{
  473. .left-title-p{
  474. width: 100%;
  475. text-align: left;
  476. font-size: 30rpx;
  477. font-family: PingFang SC-Medium, PingFang SC;
  478. font-weight: 400;
  479. color: #333333;
  480. line-height: 80rpx;
  481. }
  482. .right-img-box{
  483. .img-box{
  484. display inline-block;
  485. height:200rpx;
  486. width:200rpx;
  487. position relative
  488. margin:0 14rpx 20rpx 0;
  489. border-radius 10rpx;
  490. overflow hidden;
  491. .img-data{
  492. height:200rpx;
  493. width:200rpx;
  494. }
  495. .position-img{
  496. position absolute
  497. right:0;
  498. top:0;
  499. width:36rpx;
  500. height:36rpx;
  501. }
  502. }
  503. .img-box:nth-of-type(3n+3){
  504. margin-right: 0rpx;
  505. }
  506. .add-button{
  507. margin:0 0rpx 20rpx 0;
  508. border-radius 10rpx;
  509. overflow hidden;
  510. display inline-block
  511. height:200rpx;
  512. width:200rpx;
  513. }
  514. }
  515. }
  516. }
  517. .bottom_btn{
  518. position: fixed;
  519. bottom: 26rpx;
  520. left: 30rpx;
  521. font-size: 30rpx;
  522. font-family: PingFang SC-Medium, PingFang SC;
  523. font-weight: 400;
  524. color: #FFFFFF;
  525. line-height: 90rpx;
  526. width: 690rpx;
  527. height: 90rpx;
  528. background: #0183FA;
  529. border-radius: 20rpx;
  530. text-align: center;
  531. }
  532. }
  533. </style>