snapshotDetail.vue 13 KB

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