snapshotDetail.vue 12 KB

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