hiddenDangerItemsDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  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">{{optionData.checkPlanSetVoList.checkName}}</view>
  6. <view class="tip-tow" v-if="pageType==1 || pageType==2">{{optionData.checkPlanSetVoList.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, 'checkPlanSetVoList', this.optionData.checkPlanSetVoList);
  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. checkPlanSetVoList: this.optionData.checkPlanSetVoList,
  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: this.optionData.checkPlanSetVoList,
  189. pageType: this.pageType,
  190. };
  191. uni.redirectTo({
  192. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' +
  193. encodeURIComponent(JSON
  194. .stringify(infoData))
  195. });
  196. }
  197. },
  198. //图片预览
  199. lockImg(list) {
  200. if (!list[0]) {
  201. return
  202. }
  203. let urlList = [];
  204. for (let i = 0; i < list.length; i++) {
  205. urlList.push(config.base_url + list[i].photoUrl)
  206. }
  207. wx.previewImage({
  208. urls: urlList, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  209. current: '', // 当前显示图片的http链接,默认是第一个
  210. success: function(res) {},
  211. fail: function(res) {},
  212. complete: function(res) {},
  213. })
  214. },
  215. //整改页面
  216. rectificationBtn() {
  217. let self = this;
  218. let infoData = self.newData;
  219. console.log(self.newData)
  220. uni.navigateTo({
  221. url: '/pages_safetyCheck/views/itemsManage/snapshotRectification?infoData=' +
  222. encodeURIComponent(JSON.stringify(infoData))
  223. });
  224. },
  225. }
  226. }
  227. </script>
  228. <style lang="stylus" scoped>
  229. .snapshotDetail {
  230. height: 100%;
  231. display flex;
  232. box-sizing: border-box;
  233. padding-bottom: 160rpx;
  234. box-sizing: border-box;
  235. #bgColor-A {
  236. color: #FFD400;
  237. }
  238. #bgColor-B {
  239. color: #FF8C00;
  240. }
  241. #bgColor-C {
  242. color: #E11608;
  243. }
  244. #fontColor-A {
  245. color: #0183FA;
  246. }
  247. #fontColor-B {
  248. color: #16B531;
  249. }
  250. #fontColor-C {
  251. color: #FF8C00;
  252. }
  253. .tip {
  254. width: 750rpx;
  255. height: 80rpx;
  256. background: rgba(1, 131, 250, 0.2);
  257. border-radius: 0rpx 0rpx 0rpx 0rpx;
  258. font-size: 30rpx;
  259. color: #0183FA;
  260. line-height: 80rpx;
  261. text-align: center;
  262. }
  263. .tip-tow {
  264. width: 750rpx;
  265. height: 80rpx;
  266. background: rgba(255, 140, 0, 0.2);
  267. border-radius: 0rpx 0rpx 0rpx 0rpx;
  268. font-size: 30rpx;
  269. color: #FF8C00;
  270. line-height: 80rpx;
  271. text-align: center;
  272. }
  273. .items {
  274. width: 690rpx;
  275. min-height: 165rpx;
  276. background: #FFFFFF;
  277. border-radius: 20rpx 20rpx 20rpx 20rpx;
  278. margin: 20rpx 0 0 30rpx;
  279. .items-li {
  280. display: flex;
  281. justify-content: space-between;
  282. align-items: center;
  283. padding: 0 30rpx;
  284. box-sizing: border-box;
  285. border-bottom: 1rpx solid #E0E0E0;
  286. >view:nth-of-type(1) {
  287. font-size: 30rpx;
  288. color: #333333;
  289. line-height: 80rpx;
  290. text-align: left;
  291. }
  292. >view:nth-of-type(2) {
  293. font-size: 28rpx;
  294. color: #666666;
  295. line-height: 80rpx;
  296. text-align: left;
  297. display: flex;
  298. justify-content: space-between;
  299. align-items: center;
  300. }
  301. }
  302. .items-t {
  303. border-bottom: 1rpx solid #E0E0E0;
  304. height: 80rpx;
  305. display: flex;
  306. justify-content: flex-start;
  307. align-items: center;
  308. padding: 0 30rpx;
  309. box-sizing: border-box;
  310. .items-t-l {
  311. width: 175rpx;
  312. height: 50rpx;
  313. background: #E11608;
  314. border-radius: 50rpx 50rpx 50rpx 50rpx;
  315. font-size: 30rpx;
  316. color: #FFFFFF;
  317. line-height: 50rpx;
  318. text-align: center;
  319. margin-right: 14rpx;
  320. }
  321. .items-t-r {
  322. font-size: 30rpx;
  323. color: #333333;
  324. line-height: 42rpx;
  325. text-align: left;
  326. }
  327. }
  328. .items-b {
  329. padding: 0 30rpx;
  330. box-sizing: border-box;
  331. height: 80rpx;
  332. font-size: 28rpx;
  333. color: #666666;
  334. line-height: 80rpx;
  335. text-align: left;
  336. }
  337. }
  338. .items-number {
  339. font-size: 24rpx;
  340. color: #3D3D3D;
  341. line-height: 34rpx;
  342. text-align: right;
  343. margin: 20rpx 60rpx 0 0;
  344. >text {
  345. font-size: 24rpx;
  346. color: #FF0000;
  347. line-height: 34rpx;
  348. text-align: right;
  349. }
  350. }
  351. .list {
  352. width: 690rpx;
  353. margin: 20rpx 30rpx 0;
  354. background: #FFFFFF;
  355. border-radius: 20rpx 20rpx 20rpx 20rpx;
  356. .list-li {
  357. display: flex;
  358. justify-content: space-between;
  359. align-items: center;
  360. padding: 0 30rpx;
  361. box-sizing: border-box;
  362. border-bottom: 1rpx solid #E0E0E0;
  363. >view:nth-of-type(1) {
  364. font-size: 30rpx;
  365. color: #333333;
  366. line-height: 80rpx;
  367. text-align: left;
  368. }
  369. >view:nth-of-type(2) {
  370. font-size: 28rpx;
  371. color: #666666;
  372. line-height: 80rpx;
  373. text-align: left;
  374. display: flex;
  375. justify-content: space-between;
  376. align-items: center;
  377. >img {
  378. width: 24rpx;
  379. height: 12rpx;
  380. margin-left: 10rpx;
  381. }
  382. }
  383. }
  384. .file-li {
  385. display: flex;
  386. justify-content: space-between;
  387. align-items: center;
  388. padding: 0 30rpx;
  389. box-sizing: border-box;
  390. >img:nth-of-type(1) {
  391. width: 30rpx;
  392. height: 30rpx;
  393. }
  394. >view {
  395. flex: 1;
  396. font-size: 28rpx;
  397. color: #333333;
  398. line-height: 80rpx;
  399. text-align: left;
  400. margin: 0 92rpx 0 16rpx;
  401. overflow: hidden;
  402. text-overflow: ellipsis;
  403. white-space: nowrap;
  404. }
  405. >img:nth-of-type(2) {
  406. width: 30rpx;
  407. height: 30rpx;
  408. }
  409. }
  410. .hidden-content {
  411. width: 630rpx;
  412. min-height: 120rpx;
  413. background: #F5F5F5;
  414. border-radius: 20rpx 20rpx 20rpx 20rpx;
  415. margin: 20rpx 30rpx 0;
  416. padding: 20rpx;
  417. box-sizing: border-box;
  418. font-size: 28rpx;
  419. color: #666666;
  420. line-height: 39rpx;
  421. text-align: left;
  422. }
  423. .photo {
  424. display: flex;
  425. justify-content: flex-start;
  426. flex-wrap: wrap;
  427. margin-top: 20rpx;
  428. padding: 0 30rpx;
  429. box-sizing: border-box;
  430. >img {
  431. width: 150rpx;
  432. height: 150rpx;
  433. border-radius: 10rpx 10rpx 10rpx 10rpx;
  434. margin: 0 10rpx 10rpx 0;
  435. }
  436. }
  437. .list-li:last-of-type {
  438. border: none;
  439. }
  440. }
  441. }
  442. .sub-btn {
  443. display: flex;
  444. justify-content: center;
  445. position: fixed;
  446. left: 30rpx;
  447. bottom: 30rpx;
  448. >view:nth-of-type(1) {
  449. width: 345rpx;
  450. height: 100rpx;
  451. background: #FF8C00;
  452. border-radius: 50rpx 0rpx 0rpx 50rpx;
  453. font-size: 30rpx;
  454. color: #FFFFFF;
  455. line-height: 100rpx;
  456. text-align: center;
  457. }
  458. >view:nth-of-type(2) {
  459. width: 345rpx;
  460. height: 100rpx;
  461. background: #0183FA;
  462. border-radius: 0rpx 50rpx 50rpx 0rpx;
  463. font-size: 30rpx;
  464. color: #FFFFFF;
  465. line-height: 100rpx;
  466. text-align: center;
  467. }
  468. }
  469. .sub-btn-tow {
  470. width: 686rpx;
  471. height: 100rpx;
  472. background: #0183FA;
  473. border-radius: 50rpx 50rpx 50rpx 50rpx;
  474. position: fixed;
  475. left: 30rpx;
  476. bottom: 30rpx;
  477. font-weight: 400;
  478. font-size: 30rpx;
  479. color: #FFFFFF;
  480. line-height: 100rpx;
  481. text-align: center;
  482. }
  483. </style>