snapshotRectification.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <!-- 随手拍隐患项整改 -->
  2. <template>
  3. <view class="snapshotDetail">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  5. <view class="tip">整改期限2024-10-06(逾期未完成整改关闭实验室)</view>
  6. <view class="items" v-if="inspectionItems==0">
  7. <view class="items-t">
  8. <view class="items-t-r">{{newData.data3}}</view>
  9. </view>
  10. <view class="items-b">< {{newData.data4}} <</view>
  11. </view>
  12. <view v-if="inspectionItems==0" class="items-number">此检查项在当前实验室累计出现<text>{{newData.data5}}</text>次隐患</view>
  13. <view class="list">
  14. <view v-if="inspectionItems==0" class="list-li">
  15. <view>检查要点</view>
  16. <view>
  17. <img src="@/pages_safetyCheck/images/icon_06.png">
  18. </view>
  19. </view>
  20. <view v-if="inspectionItems==0" class="hidden-content">{{newData.data6}}
  21. </view>
  22. <view class="list-li">
  23. <view>检查隐患</view>
  24. <view style="color: #FF8C00;">
  25. <img src="@/pages_safetyCheck/images/icon_06.png">
  26. </view>
  27. </view>
  28. <view class="hidden-content">{{newData.data7}}
  29. </view>
  30. <view class="photo">
  31. <img src="@/pages_safetyCheck/images/img_ssp_pz@1x.png">
  32. </view>
  33. <view class="list-li">
  34. <view>姓名:</view>
  35. <view>李瑶瑶</view>
  36. </view>
  37. <view class="list-li">
  38. <view>时间:</view>
  39. <view>2024-01-01</view>
  40. </view>
  41. <view class="list-li">
  42. <view>隐患整改</view>
  43. <view>
  44. <img src="@/pages_safetyCheck/images/icon_06.png">
  45. </view>
  46. </view>
  47. <textarea class="describe" type="text" v-model="form.rectifyDescribe" maxlength="200"
  48. placeholder="请填写整改措施" placeholder-style="font-size:24rpx;color:#999;"></textarea>
  49. <view class="check-for-img-max-box">
  50. <view class="left-title-p"></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_safetyCheck/images/icon_ssp_closure.png"
  55. @click="delImg(imgIndex)">
  56. </view>
  57. <img class="add-button" src="@/pages_safetyCheck/images/img_ssp_pz@1x.png"
  58. @click="selectImage()" v-if="form.imgDtoList.length<5">
  59. </view>
  60. </view>
  61. <view class="list-li-tow">
  62. <view>整改方案(上传文件)</view>
  63. <view>
  64. <img src="@/pages_safetyCheck/images/icon_aqjc_sc.png">
  65. </view>
  66. </view>
  67. <view class="file-li">
  68. <img src="@/pages_safetyCheck/images/icon_djc_wj.png">
  69. <view>文件标题文件标题文件标题文件标题</view>
  70. <img src="@/pages_safetyCheck/images/icon_yybz_sc.png">
  71. </view>
  72. </view>
  73. </scroll-view>
  74. <view class="sub-btn">
  75. <view>暂无法整改</view>
  76. <view>完成整改</view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. import {
  82. config
  83. } from '@/api/request/config.js'
  84. export default {
  85. name: "snapshotDetail",
  86. components: {
  87. },
  88. data() {
  89. return {
  90. baseUrl: config.base_url,
  91. inspectionItems:0,//0有检查项 1无检查项
  92. form: {
  93. imgDtoList: [],
  94. },
  95. newData: {
  96. data1:'实验室名称(房间号)',
  97. data2:'学院单位名称',
  98. data3:'1.1.1 检查项检查项检查项检查',
  99. data4:'1.1 检查项检查项检查项检查项检查项检查项',
  100. data5:'19',
  101. data6:'(1)有学校相关会议(校务会议、党委常委会会议等)纪要,内容包含实验室安全工作。',
  102. data7:'内容内容内容内容内容内容内容内容内容内容内容内内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容',
  103. data8:'李瑶瑶',
  104. data9:'2024-01-01',
  105. rectificationStatus:0,//整改状态 0待整改 1暂无法整改 2已整改
  106. },
  107. }
  108. },
  109. onLoad(option) {},
  110. onShow() {
  111. },
  112. mounted() {
  113. },
  114. methods: {
  115. //滚动事件
  116. scrollGet() {},
  117. /******图片上传******/
  118. selectImage() {
  119. let self = this;
  120. if (this.form.imgDtoList.length > 4) {
  121. uni.showToast({
  122. title: '最多上传5张图片',
  123. icon: "none",
  124. mask: true,
  125. duration: 2000
  126. });
  127. return
  128. }
  129. wx.chooseImage({
  130. count: 1,
  131. sizeType: ["original", "compressed"],
  132. sourceType: ["album", "camera"],
  133. success: function(res) {
  134. let tempFilePaths = res.tempFilePaths[0];
  135. self.uploadImg(tempFilePaths);
  136. }
  137. });
  138. },
  139. async uploadImg(tempFilePaths) {
  140. var self = this;
  141. uni.showLoading({
  142. title: '上传中',
  143. mask: true
  144. });
  145. uni.uploadFile({
  146. url: config.base_url + '/system/file/upload', //仅为示例,非真实的接口地址
  147. header: {
  148. 'Authorization': uni.getStorageSync('token')
  149. },
  150. filePath: tempFilePaths,
  151. name: 'file',
  152. formData: {
  153. 'user': 'test'
  154. },
  155. success: (uploadFileRes) => {
  156. let res = JSON.parse(uploadFileRes.data);
  157. if (res.code == 200) {
  158. this.form.imgDtoList.push({
  159. 'fileUrl': res.data.url,
  160. 'fileName': res.data.name
  161. });
  162. console.log(res.data.url)
  163. } else {
  164. uni.showToast({
  165. title: res.msg,
  166. icon: "none",
  167. mask: true,
  168. duration: 2000
  169. });
  170. }
  171. },
  172. fail: err => {},
  173. complete: () => {
  174. uni.hideLoading()
  175. }
  176. });
  177. },
  178. //删除图片
  179. delImg(minIndex) {
  180. this.form.imgDtoList.splice(minIndex, 1);
  181. this.$forceUpdate();
  182. },
  183. }
  184. }
  185. </script>
  186. <style lang="stylus" scoped>
  187. .snapshotDetail {
  188. height: 100%;
  189. display flex;
  190. box-sizing: border-box;
  191. padding-bottom: 160rpx;
  192. box-sizing: border-box;
  193. #bgColor-A {
  194. color: #FFD400;
  195. }
  196. #bgColor-B {
  197. color: #FF8C00;
  198. }
  199. #bgColor-C {
  200. color: #E11608;
  201. }
  202. .tip {
  203. width: 750rpx;
  204. height: 80rpx;
  205. background: rgba(255, 140, 0, 0.2);
  206. font-weight: normal;
  207. font-size: 28rpx;
  208. color: #FF8C00;
  209. line-height: 80rpx;
  210. text-align: center;
  211. }
  212. .items {
  213. width: 690rpx;
  214. min-height: 165rpx;
  215. background: #FFFFFF;
  216. border-radius: 20rpx 20rpx 20rpx 20rpx;
  217. margin: 20rpx 0 0 30rpx;
  218. .items-li{
  219. display: flex;
  220. justify-content: space-between;
  221. align-items: center;
  222. padding: 0 30rpx;
  223. box-sizing: border-box;
  224. border-bottom: 1rpx solid #E0E0E0;
  225. >view:nth-of-type(1) {
  226. font-size: 30rpx;
  227. color: #333333;
  228. line-height: 80rpx;
  229. text-align: left;
  230. }
  231. >view:nth-of-type(2) {
  232. font-size: 28rpx;
  233. color: #666666;
  234. line-height: 80rpx;
  235. text-align: left;
  236. display: flex;
  237. justify-content: space-between;
  238. align-items: center;
  239. }
  240. }
  241. .items-t {
  242. border-bottom: 1rpx solid #E0E0E0;
  243. height: 80rpx;
  244. display: flex;
  245. justify-content: flex-start;
  246. align-items: center;
  247. padding: 0 30rpx;
  248. box-sizing: border-box;
  249. .items-t-l {
  250. width: 175rpx;
  251. height: 50rpx;
  252. background: #E11608;
  253. border-radius: 50rpx 50rpx 50rpx 50rpx;
  254. font-size: 30rpx;
  255. color: #FFFFFF;
  256. line-height: 50rpx;
  257. text-align: center;
  258. margin-right: 14rpx;
  259. }
  260. .items-t-r {
  261. font-size: 30rpx;
  262. color: #333333;
  263. line-height: 42rpx;
  264. text-align: left;
  265. }
  266. }
  267. .items-b {
  268. padding: 0 30rpx;
  269. box-sizing: border-box;
  270. height: 80rpx;
  271. font-size: 28rpx;
  272. color: #666666;
  273. line-height: 80rpx;
  274. text-align: left;
  275. }
  276. }
  277. .items-number {
  278. font-size: 24rpx;
  279. color: #3D3D3D;
  280. line-height: 34rpx;
  281. text-align: right;
  282. margin: 20rpx 60rpx 0 0;
  283. >text {
  284. font-size: 24rpx;
  285. color: #FF0000;
  286. line-height: 34rpx;
  287. text-align: right;
  288. }
  289. }
  290. .list {
  291. width: 690rpx;
  292. margin: 20rpx 30rpx 0;
  293. background: #FFFFFF;
  294. border-radius: 20rpx 20rpx 20rpx 20rpx;
  295. .list-li {
  296. display: flex;
  297. justify-content: space-between;
  298. align-items: center;
  299. padding: 0 30rpx;
  300. box-sizing: border-box;
  301. border-bottom: 1rpx solid #E0E0E0;
  302. >view:nth-of-type(1) {
  303. font-size: 30rpx;
  304. color: #333333;
  305. line-height: 80rpx;
  306. text-align: left;
  307. }
  308. >view:nth-of-type(2) {
  309. font-size: 28rpx;
  310. color: #666666;
  311. line-height: 80rpx;
  312. text-align: left;
  313. display: flex;
  314. justify-content: space-between;
  315. align-items: center;
  316. >img {
  317. width: 24rpx;
  318. height: 12rpx;
  319. margin-left: 10rpx;
  320. }
  321. }
  322. }
  323. .list-li-tow {
  324. display: flex;
  325. justify-content: space-between;
  326. align-items: center;
  327. padding: 0 30rpx;
  328. box-sizing: border-box;
  329. border-top: 1rpx solid #E0E0E0;
  330. border-bottom: 1rpx solid #E0E0E0;
  331. >view:nth-of-type(1) {
  332. font-size: 30rpx;
  333. color: #333333;
  334. line-height: 80rpx;
  335. text-align: left;
  336. }
  337. >view:nth-of-type(2) {
  338. font-size: 28rpx;
  339. color: #666666;
  340. line-height: 80rpx;
  341. text-align: left;
  342. display: flex;
  343. justify-content: space-between;
  344. align-items: center;
  345. >img {
  346. width: 30rpx;
  347. height: 28rpx;
  348. margin-left: 10rpx;
  349. }
  350. }
  351. }
  352. .file-li{
  353. display: flex;
  354. justify-content: space-between;
  355. align-items: center;
  356. padding: 0 30rpx;
  357. box-sizing: border-box;
  358. >img:nth-of-type(1) {
  359. width: 30rpx;
  360. height: 30rpx;
  361. }
  362. >view{
  363. flex: 1;
  364. font-size: 28rpx;
  365. color: #333333;
  366. line-height: 80rpx;
  367. text-align: left;
  368. margin: 0 92rpx 0 16rpx;
  369. overflow: hidden;
  370. text-overflow: ellipsis;
  371. white-space: nowrap;
  372. }
  373. >img:nth-of-type(2) {
  374. width: 30rpx;
  375. height: 30rpx;
  376. }
  377. }
  378. .hidden-content {
  379. width: 630rpx;
  380. min-height: 200rpx;
  381. background: #F5F5F5;
  382. border-radius: 20rpx 20rpx 20rpx 20rpx;
  383. margin: 20rpx 30rpx 0;
  384. padding: 20rpx;
  385. box-sizing: border-box;
  386. font-size: 28rpx;
  387. color: #666666;
  388. line-height: 39rpx;
  389. text-align: left;
  390. }
  391. .photo {
  392. display: flex;
  393. justify-content: flex-start;
  394. flex-wrap: wrap;
  395. margin-top: 20rpx;
  396. padding: 0 30rpx;
  397. box-sizing: border-box;
  398. >img {
  399. width: 150rpx;
  400. height: 150rpx;
  401. border-radius: 10rpx 10rpx 10rpx 10rpx;
  402. margin: 0 10rpx 10rpx 0;
  403. }
  404. }
  405. .describe {
  406. width: 636rpx;
  407. height: 120rpx;
  408. border-radius: 10rpx 10rpx 10rpx 10rpx;
  409. border: 1rpx solid #E0E0E0;
  410. margin: 20rpx 0 0 28rpx;
  411. padding: 12rpx 16rpx;
  412. box-sizing: border-box;
  413. }
  414. .check-for-img-max-box {
  415. margin: 20px 28rpx;
  416. .left-title-p {
  417. width: 100%;
  418. text-align: left;
  419. font-size: 30rpx;
  420. font-family: PingFang SC-Medium, PingFang SC;
  421. font-weight: 400;
  422. color: #333333;
  423. line-height: 80rpx;
  424. }
  425. .right-img-box {
  426. .img-box {
  427. display inline-block;
  428. height: 150rpx;
  429. width: 150rpx;
  430. position relative;
  431. margin: 0 14rpx 20rpx 0;
  432. border-radius 10rpx;
  433. overflow hidden;
  434. .img-data {
  435. height: 150rpx;
  436. width: 150rpx;
  437. }
  438. .position-img {
  439. position absolute;
  440. right: 0;
  441. top: 0;
  442. width: 36rpx;
  443. height: 36rpx;
  444. }
  445. }
  446. .img-box:nth-of-type(3n+3) {
  447. margin-right: 0rpx;
  448. }
  449. .add-button {
  450. margin: 0 0rpx 20rpx 0;
  451. border-radius 10rpx;
  452. overflow hidden;
  453. display inline-block;
  454. height: 150rpx;
  455. width: 150rpx;
  456. }
  457. }
  458. }
  459. .list-li:last-of-type {
  460. border: none;
  461. }
  462. }
  463. }
  464. .sub-btn{
  465. display: flex;
  466. justify-content: center;
  467. position: fixed;
  468. left: 30rpx;
  469. bottom: 30rpx;
  470. >view:nth-of-type(1) {
  471. width: 345rpx;
  472. height: 100rpx;
  473. background: #FF8C00;
  474. border-radius: 50rpx 0rpx 0rpx 50rpx;
  475. font-size: 30rpx;
  476. color: #FFFFFF;
  477. line-height: 100rpx;
  478. text-align: center;
  479. }
  480. >view:nth-of-type(2) {
  481. width: 345rpx;
  482. height: 100rpx;
  483. background: #0183FA;
  484. border-radius: 0rpx 50rpx 50rpx 0rpx;
  485. font-size: 30rpx;
  486. color: #FFFFFF;
  487. line-height: 100rpx;
  488. text-align: center;
  489. }
  490. }
  491. </style>