snapshotDetail.vue 11 KB

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