hiddenDangerItemsDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. <!-- 检查详情 -->
  2. <template>
  3. <view class="snapshotDetail">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  5. <view class="tip" v-if="pageType==0">{{newData.checkName}}</view>
  6. <view class="tip-tow" v-if="pageType==1 || pageType==2">{{newData.checkName}}</view>
  7. <view class="items">
  8. <view class="items-t" v-if="newData.hazardCheckName!=''">
  9. <view class="items-t-r">{{newData.hazardCheckCode}} {{newData.hazardCheckName}}</view>
  10. </view>
  11. <view class="items-b" v-if="newData.hazardCheckName!=''">< {{newData.hazardCheckCode2}}
  12. {{newData.hazardCheckName2}} < {{newData.hazardCheckCode1}} {{newData.hazardCheckName1}}
  13. </view>
  14. </view>
  15. <view class="items-number" v-if="newData.hazardCheckName!=''">
  16. 此检查项在当前实验室累计出现<text>{{hazardCheckNum}}</text>次隐患</view>
  17. <view class="list">
  18. <view class="list-li" v-if="newData.hazardCheckName!=''">
  19. <view>检查要点</view>
  20. <view>
  21. <img src="@/pages_safetyCheck/images/icon_06.png">
  22. </view>
  23. </view>
  24. <view v-if="newData.hazardCheckName!=''" class="hidden-content">{{newData.hazardCheckPoint}}
  25. </view>
  26. <view class="list-li">
  27. <view>{{newData.checkFlag?'检查结果':'检查隐患'}}</view>
  28. <view :id="newData.checkFlag?'fontColor-B':'fontColor-C'">
  29. {{newData.checkFlag?'符合':'不符合'}}
  30. <img src="@/pages_safetyCheck/images/icon_06.png">
  31. </view>
  32. </view>
  33. <view class="hidden-content" v-if="!newData.checkFlag">{{newData.hazardDescribe}}
  34. </view>
  35. <view class="photo" v-if="!newData.checkFlag" @click="lockImg(newData.photoList)">
  36. <img v-for="(item,index) in newData.photoList" :src="baseUrl+item.fileUrl">
  37. </view>
  38. <view class="list-li">
  39. <view>姓名:</view>
  40. <view>{{newData.checkUserName}}</view>
  41. </view>
  42. <view class="list-li">
  43. <view>检查时间:</view>
  44. <view>{{newData.checkTime}}</view>
  45. </view>
  46. </view>
  47. </scroll-view>
  48. <view class="sub-btn" v-if="pageType==0 && !newData.checkFlag">
  49. <view @click="submitBtn(1)">编辑</view>
  50. <view @click="submitBtn(2)">继续检查</view>
  51. </view>
  52. <view v-if="pageType==0 && newData.checkFlag" @click="submitBtn(2)" class="sub-btn-tow">继续检查</view>
  53. </view>
  54. </template>
  55. <script>
  56. import {
  57. config
  58. } from '@/api/request/config.js'
  59. import {
  60. parseTime
  61. } from '@/component/public.js'
  62. import {
  63. securityAppCheckPlanCheckInfo,
  64. securityDraftFindBySetOptionId,
  65. securityAppCheckPhotoGetCheckNumBySub,
  66. } from '@/pages_safetyCheck/api/index.js'
  67. export default {
  68. name: "snapshotDetail",
  69. components: {
  70. },
  71. data() {
  72. return {
  73. baseUrl: config.base_url,
  74. inspectionItems: 0, //0有检查项 1无检查项
  75. newData: {},
  76. setOptionId: '',
  77. manageId: '',
  78. subId: '',
  79. hazardCheckPro: '',
  80. hazardCheckNum: 0,
  81. pageType: 0, //0检查 1复查 2整改
  82. itemsStatus:'',
  83. optionData:null,
  84. }
  85. },
  86. onLoad(option) {
  87. let optionData = JSON.parse(decodeURIComponent(option.infoData));
  88. this.$set(this, 'pageType', optionData.pageType);
  89. this.$set(this, 'itemsStatus', optionData.itemsStatus);
  90. this.$set(this, 'setOptionId', optionData.setOptionId);
  91. this.$set(this, 'manageId', optionData.manageId);
  92. this.$set(this, 'subId', optionData.subId);
  93. this.$set(this, 'hazardCheckPro', optionData.hazardCheckPro);
  94. this.$set(this, 'optionData', optionData);
  95. },
  96. onShow() {
  97. },
  98. mounted() {
  99. if(this.pageType==0){
  100. //检查
  101. if(this.itemsStatus==0 || this.itemsStatus==1){
  102. //开始检查-提交的详情
  103. this.securityAppCheckPlanCheckInfo();
  104. }else if(this.itemsStatus==2){
  105. //保存草稿详情
  106. this.securityDraftFindBySetOptionId();
  107. }
  108. }
  109. this.securityAppCheckPhotoGetCheckNumBySub();
  110. },
  111. methods: {
  112. //滚动事件
  113. scrollGet() {},
  114. //获取检查提交详情
  115. async securityAppCheckPlanCheckInfo() {
  116. let obj = {
  117. setOptionId: this.setOptionId,
  118. manageId: this.manageId,
  119. }
  120. const {
  121. data
  122. } = await securityAppCheckPlanCheckInfo(obj);
  123. if (data.code == 200) {
  124. uni.setNavigationBarTitle({
  125. title: data.data.subName + '(' + (this.pageType == 0 ? data.data.roomNum : data.data
  126. .subRoom) + ')'
  127. })
  128. this.$set(this, 'newData', data.data);
  129. this.$set(this.newData, 'checkTime', parseTime(data.data.checkTime, "{y}-{m}-{d}"));
  130. }
  131. },
  132. //获取草稿详情
  133. async securityDraftFindBySetOptionId() {
  134. let obj = {
  135. setOptionId: this.setOptionId,
  136. }
  137. const {
  138. data
  139. } = await securityDraftFindBySetOptionId(obj);
  140. if (data.code == 200) {
  141. uni.setNavigationBarTitle({
  142. title: this.optionData.subName + '(' + (this.pageType == 0 ? this.optionData.roomNum : this.optionData.subRoom) + ')'
  143. })
  144. this.$set(this, 'newData', data.data);
  145. this.$set(this.newData, 'checkName', this.optionData.checkName);
  146. this.$set(this.newData, 'subName', this.optionData.subName);
  147. this.$set(this.newData, 'roomNum', this.optionData.roomNum);
  148. this.$set(this.newData, 'checkTime', parseTime(data.data.checkTime, "{y}-{m}-{d}"));
  149. }
  150. },
  151. //获取检查项在当前实验室出现的次数
  152. async securityAppCheckPhotoGetCheckNumBySub() {
  153. let obj = {
  154. subId: this.subId,
  155. hazardCheckPro: this.hazardCheckPro,
  156. }
  157. const {
  158. data
  159. } = await securityAppCheckPhotoGetCheckNumBySub(obj);
  160. if (data.code == 200) {
  161. this.$set(this, 'hazardCheckNum', data.data);
  162. }
  163. },
  164. //检查-按钮
  165. submitBtn(status) {
  166. if (status == 1) {
  167. //编辑
  168. let infoData = {
  169. setOptionId: this.setOptionId,
  170. manageId: this.manageId,
  171. subId: this.subId,
  172. hazardCheckPro: this.hazardCheckPro,
  173. pageType: this.pageType,
  174. itemsStatus: this.itemsStatus,
  175. checkName: this.newData.checkName,
  176. };
  177. uni.redirectTo({
  178. url: '/pages_safetyCheck/views/inspectManage/inspectAdd?infoData=' + encodeURIComponent(
  179. JSON
  180. .stringify(infoData))
  181. });
  182. } else if (status == 2) {
  183. //继续检查
  184. let infoData = {
  185. subName: this.newData.subName,
  186. roomNum: this.newData.roomNum,
  187. manageId: this.manageId,
  188. checkPlanSetVoList: {
  189. checkName: this.newData.checkName,
  190. overdueUnrectify: this.newData.overdueUnrectify,
  191. checkStartTime: this.newData.checkStartTime,
  192. },
  193. pageType: this.pageType,
  194. };
  195. uni.redirectTo({
  196. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' +
  197. encodeURIComponent(JSON
  198. .stringify(infoData))
  199. });
  200. }
  201. },
  202. //图片预览
  203. lockImg(list) {
  204. if (!list[0]) {
  205. return
  206. }
  207. let urlList = [];
  208. for (let i = 0; i < list.length; i++) {
  209. urlList.push(config.base_url + list[i].photoUrl)
  210. }
  211. wx.previewImage({
  212. urls: urlList, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  213. current: '', // 当前显示图片的http链接,默认是第一个
  214. success: function(res) {},
  215. fail: function(res) {},
  216. complete: function(res) {},
  217. })
  218. },
  219. //整改页面
  220. rectificationBtn() {
  221. let self = this;
  222. let infoData = self.newData;
  223. console.log(self.newData)
  224. uni.navigateTo({
  225. url: '/pages_safetyCheck/views/itemsManage/snapshotRectification?infoData=' +
  226. encodeURIComponent(JSON.stringify(infoData))
  227. });
  228. },
  229. }
  230. }
  231. </script>
  232. <style lang="stylus" scoped>
  233. .snapshotDetail {
  234. height: 100%;
  235. display flex;
  236. box-sizing: border-box;
  237. padding-bottom: 160rpx;
  238. box-sizing: border-box;
  239. #bgColor-A {
  240. color: #FFD400;
  241. }
  242. #bgColor-B {
  243. color: #FF8C00;
  244. }
  245. #bgColor-C {
  246. color: #E11608;
  247. }
  248. #fontColor-A {
  249. color: #0183FA;
  250. }
  251. #fontColor-B {
  252. color: #16B531;
  253. }
  254. #fontColor-C {
  255. color: #FF8C00;
  256. }
  257. .tip {
  258. width: 750rpx;
  259. height: 80rpx;
  260. background: rgba(1, 131, 250, 0.2);
  261. border-radius: 0rpx 0rpx 0rpx 0rpx;
  262. font-size: 30rpx;
  263. color: #0183FA;
  264. line-height: 80rpx;
  265. text-align: center;
  266. }
  267. .tip-tow {
  268. width: 750rpx;
  269. height: 80rpx;
  270. background: rgba(255, 140, 0, 0.2);
  271. border-radius: 0rpx 0rpx 0rpx 0rpx;
  272. font-size: 30rpx;
  273. color: #FF8C00;
  274. line-height: 80rpx;
  275. text-align: center;
  276. }
  277. .items {
  278. width: 690rpx;
  279. min-height: 165rpx;
  280. background: #FFFFFF;
  281. border-radius: 20rpx 20rpx 20rpx 20rpx;
  282. margin: 20rpx 0 0 30rpx;
  283. .items-li {
  284. display: flex;
  285. justify-content: space-between;
  286. align-items: center;
  287. padding: 0 30rpx;
  288. box-sizing: border-box;
  289. border-bottom: 1rpx solid #E0E0E0;
  290. >view:nth-of-type(1) {
  291. font-size: 30rpx;
  292. color: #333333;
  293. line-height: 80rpx;
  294. text-align: left;
  295. }
  296. >view:nth-of-type(2) {
  297. font-size: 28rpx;
  298. color: #666666;
  299. line-height: 80rpx;
  300. text-align: left;
  301. display: flex;
  302. justify-content: space-between;
  303. align-items: center;
  304. }
  305. }
  306. .items-t {
  307. border-bottom: 1rpx solid #E0E0E0;
  308. height: 80rpx;
  309. display: flex;
  310. justify-content: flex-start;
  311. align-items: center;
  312. padding: 0 30rpx;
  313. box-sizing: border-box;
  314. .items-t-l {
  315. width: 175rpx;
  316. height: 50rpx;
  317. background: #E11608;
  318. border-radius: 50rpx 50rpx 50rpx 50rpx;
  319. font-size: 30rpx;
  320. color: #FFFFFF;
  321. line-height: 50rpx;
  322. text-align: center;
  323. margin-right: 14rpx;
  324. }
  325. .items-t-r {
  326. font-size: 30rpx;
  327. color: #333333;
  328. line-height: 42rpx;
  329. text-align: left;
  330. }
  331. }
  332. .items-b {
  333. padding: 0 30rpx;
  334. box-sizing: border-box;
  335. height: 80rpx;
  336. font-size: 28rpx;
  337. color: #666666;
  338. line-height: 80rpx;
  339. text-align: left;
  340. }
  341. }
  342. .items-number {
  343. font-size: 24rpx;
  344. color: #3D3D3D;
  345. line-height: 34rpx;
  346. text-align: right;
  347. margin: 20rpx 60rpx 0 0;
  348. >text {
  349. font-size: 24rpx;
  350. color: #FF0000;
  351. line-height: 34rpx;
  352. text-align: right;
  353. }
  354. }
  355. .list {
  356. width: 690rpx;
  357. margin: 20rpx 30rpx 0;
  358. background: #FFFFFF;
  359. border-radius: 20rpx 20rpx 20rpx 20rpx;
  360. .list-li {
  361. display: flex;
  362. justify-content: space-between;
  363. align-items: center;
  364. padding: 0 30rpx;
  365. box-sizing: border-box;
  366. border-bottom: 1rpx solid #E0E0E0;
  367. >view:nth-of-type(1) {
  368. font-size: 30rpx;
  369. color: #333333;
  370. line-height: 80rpx;
  371. text-align: left;
  372. }
  373. >view:nth-of-type(2) {
  374. font-size: 28rpx;
  375. color: #666666;
  376. line-height: 80rpx;
  377. text-align: left;
  378. display: flex;
  379. justify-content: space-between;
  380. align-items: center;
  381. >img {
  382. width: 24rpx;
  383. height: 12rpx;
  384. margin-left: 10rpx;
  385. }
  386. }
  387. }
  388. .file-li {
  389. display: flex;
  390. justify-content: space-between;
  391. align-items: center;
  392. padding: 0 30rpx;
  393. box-sizing: border-box;
  394. >img:nth-of-type(1) {
  395. width: 30rpx;
  396. height: 30rpx;
  397. }
  398. >view {
  399. flex: 1;
  400. font-size: 28rpx;
  401. color: #333333;
  402. line-height: 80rpx;
  403. text-align: left;
  404. margin: 0 92rpx 0 16rpx;
  405. overflow: hidden;
  406. text-overflow: ellipsis;
  407. white-space: nowrap;
  408. }
  409. >img:nth-of-type(2) {
  410. width: 30rpx;
  411. height: 30rpx;
  412. }
  413. }
  414. .hidden-content {
  415. width: 630rpx;
  416. min-height: 120rpx;
  417. background: #F5F5F5;
  418. border-radius: 20rpx 20rpx 20rpx 20rpx;
  419. margin: 20rpx 30rpx 0;
  420. padding: 20rpx;
  421. box-sizing: border-box;
  422. font-size: 28rpx;
  423. color: #666666;
  424. line-height: 39rpx;
  425. text-align: left;
  426. }
  427. .photo {
  428. display: flex;
  429. justify-content: flex-start;
  430. flex-wrap: wrap;
  431. margin-top: 20rpx;
  432. padding: 0 30rpx;
  433. box-sizing: border-box;
  434. >img {
  435. width: 150rpx;
  436. height: 150rpx;
  437. border-radius: 10rpx 10rpx 10rpx 10rpx;
  438. margin: 0 10rpx 10rpx 0;
  439. }
  440. }
  441. .list-li:last-of-type {
  442. border: none;
  443. }
  444. }
  445. }
  446. .sub-btn {
  447. display: flex;
  448. justify-content: center;
  449. position: fixed;
  450. left: 30rpx;
  451. bottom: 30rpx;
  452. >view:nth-of-type(1) {
  453. width: 345rpx;
  454. height: 100rpx;
  455. background: #FF8C00;
  456. border-radius: 50rpx 0rpx 0rpx 50rpx;
  457. font-size: 30rpx;
  458. color: #FFFFFF;
  459. line-height: 100rpx;
  460. text-align: center;
  461. }
  462. >view:nth-of-type(2) {
  463. width: 345rpx;
  464. height: 100rpx;
  465. background: #0183FA;
  466. border-radius: 0rpx 50rpx 50rpx 0rpx;
  467. font-size: 30rpx;
  468. color: #FFFFFF;
  469. line-height: 100rpx;
  470. text-align: center;
  471. }
  472. }
  473. .sub-btn-tow {
  474. width: 686rpx;
  475. height: 100rpx;
  476. background: #0183FA;
  477. border-radius: 50rpx 50rpx 50rpx 50rpx;
  478. position: fixed;
  479. left: 30rpx;
  480. bottom: 30rpx;
  481. font-weight: 400;
  482. font-size: 30rpx;
  483. color: #FFFFFF;
  484. line-height: 100rpx;
  485. text-align: center;
  486. }
  487. </style>