check_list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. <template>
  2. <view class="container uni-container" v-if="tableData!=''">
  3. <!-- <navInfo :title="'每日巡查详情'"></navInfo>
  4. <view class="bgTopImg">
  5. <image slot="right" src="@/static/images/navBg@2x.png" class="bgTopImg"></image>
  6. </view> -->
  7. <view style="margin-bottom: 150rpx;" class="time-main main-time">
  8. <view>
  9. <view class="nav par-time " style="color:#4CB2B6;">
  10. <view class="time-axis">
  11. 主要信息
  12. </view>
  13. </view>
  14. <view class="main">
  15. <uni-row class="demo-uni-row">
  16. <uni-col :span="10">
  17. <text class="text-df text-1cut middles">任务名称</text>
  18. </uni-col>
  19. <uni-col :span="14">
  20. <text class="text-descibe">{{tableData.taskInfo.taskName}}</text>
  21. </uni-col>
  22. </uni-row>
  23. <uni-row class="demo-uni-row">
  24. <uni-col :span="10">
  25. <text class="text-df text-1cut middles">接受者</text>
  26. </uni-col>
  27. <uni-col :span="14">
  28. <text class="text-descibe">{{receiver}}</text>
  29. </uni-col>
  30. </uni-row>
  31. <uni-row class="demo-uni-row">
  32. <uni-col :span="10">
  33. <text class="text-df text-1cut middles">发布者</text>
  34. </uni-col>
  35. <uni-col :span="14">
  36. <text class="text-descibe">{{sender}}</text>
  37. </uni-col>
  38. </uni-row>
  39. <uni-row class="demo-uni-row">
  40. <uni-col :span="10">
  41. <text class="text-df text-1cut middles">任务状态</text>
  42. </uni-col>
  43. <uni-col :span="14">
  44. <text v-if="tableData.taskInfo.taskStatus==1"
  45. class="text-descibe weiwan zhuangtai">未完成</text>
  46. <text class="text-descibe shenhe zhuangtai"
  47. v-else-if="tableData.taskInfo.taskStatus==2">待审核</text>
  48. <text class="text-descibe yiwan zhuangtai"
  49. v-else-if="tableData.taskInfo.taskStatus==3">已完成</text>
  50. </uni-col>
  51. </uni-row>
  52. <uni-row class="demo-uni-row">
  53. <uni-col :span="10">
  54. <text class="text-df text-1cut middles">发布日期</text>
  55. </uni-col>
  56. <uni-col :span="14">
  57. <text class="text-descibe" style="padding-top: 20rpx;">{{times}}</text>
  58. </uni-col>
  59. </uni-row>
  60. <uni-row class="demo-uni-row">
  61. <uni-col :span="10">
  62. <text class="text-df text-1cut middles">任务类型</text>
  63. </uni-col>
  64. <uni-col :span="14">
  65. <text class="text-descibe">{{tableData.taskInfo.taskType}}</text>
  66. </uni-col>
  67. </uni-row>
  68. <uni-row class="demo-uni-row">
  69. <uni-col :span="10">
  70. <text class="text-df text-1cut middles">任务说明</text>
  71. </uni-col>
  72. <uni-col :span="14">
  73. <rich-text :nodes="tableData.taskInfo.taskContent"></rich-text>
  74. </uni-col>
  75. </uni-row>
  76. <uni-row class="demo-uni-row" v-if="tableData.taskInfo.attId">
  77. <uni-col :span="10">
  78. <text class="text-df text-1cut middles">附件</text>
  79. </uni-col>
  80. <uni-col :span="14">
  81. <!-- #ifdef MP-WEIXIN -->
  82. <text style="color:#00a3f4;cursor: pointer;"
  83. @click.native="down(tableData.taskInfo.attId)">点击预览文件</text>
  84. <!-- #endif -->
  85. <!-- #ifdef H5 -->
  86. <a style="color:#00a3f4;cursor: pointer;" @click="down(tableData.taskInfo.attId)">点击预览文件</a>
  87. <!-- #endif -->
  88. </uni-col>
  89. </uni-row>
  90. </view>
  91. </view>
  92. <view v-if="tableData.inspectInfo.length!=0" style="margin-top: 30rpx;">
  93. <view class="nav par-time" style="color:#4CB2B6;">
  94. <view class="time-axis">处理详情</view>
  95. </view>
  96. <view class="main" v-for="(item,index) in tableData.inspectInfo" :key="index"
  97. style="margin-bottom: 40rpx;">
  98. <uni-row class="demo-uni-row">
  99. <uni-col :span="10">
  100. <text class="text-df text-1cut middles"
  101. style="font-weight: 600;color:#274647;">检查项目{{index+1}}</text>
  102. </uni-col>
  103. <uni-col :span="14">
  104. <text class="text-descibe" style="font-weight: 600;color:#274647;">{{item.inspName}}</text>
  105. </uni-col>
  106. </uni-row>
  107. <view v-if="item.inspType!='fpd'">
  108. <uni-row class="demo-uni-row">
  109. <uni-col :span="10">
  110. <text class="text-df text-1cut middles">{{item.isdenger==1?'检查隐患描述':'检查描述'}}</text>
  111. </uni-col>
  112. <uni-col :span="14">
  113. <text class="text-descibe">{{item.isdenger==1?item.description:'正常'}}</text>
  114. </uni-col>
  115. </uni-row>
  116. <uni-row class="demo-uni-row tupian-flex">
  117. <view v-for="(items,indexs) in item.inspectHisSubDOList">
  118. <image v-if="items.imgUrl" :key="indexs" :src="items.imgUrl" class="image-size"
  119. @click="viewImageBig(items.imgUrl)"></image>
  120. </view>
  121. </uni-row>
  122. </view>
  123. <view v-else>
  124. <view v-for="(items,indexs) in item.inspectHisFpdMutliDOList" :key="indexs">
  125. <uni-row class="demo-uni-row">
  126. <uni-col :span="10">
  127. <text class="text-df text-1cut middles"
  128. style="color:#274647;font-weight: 500;">{{`(${indexs+1})`}}设备名称</text>
  129. </uni-col>
  130. <uni-col :span="14">
  131. <text class="text-descibe" style="color:#274647;">{{items.fpdName}}</text>
  132. </uni-col>
  133. </uni-row>
  134. <uni-row class="demo-uni-row">
  135. <uni-col :span="10">
  136. <text class="text-df text-1cut middles"
  137. style="color:#274647;font-weight: 500;">设备编号</text>
  138. </uni-col>
  139. <uni-col :span="14">
  140. <text class="text-descibe" style="color:#274647;">{{items.fpdCode}}</text>
  141. </uni-col>
  142. </uni-row>
  143. <uni-row class="demo-uni-row">
  144. <uni-col :span="10">
  145. <text class="text-df text-1cut middles">{{item.isdenger==1?'检查隐患描述':'检查描述'}}</text>
  146. </uni-col>
  147. <uni-col :span="14">
  148. <text class="text-descibe">{{item.isdenger==1?items.dangerDescribe:'正常'}}</text>
  149. </uni-col>
  150. </uni-row>
  151. <uni-row class="demo-uni-row">
  152. <uni-col :span="10">
  153. <text class="text-df text-1cut middles">检查结果</text>
  154. </uni-col>
  155. <uni-col :span="14" style="display: flex;flex-wrap: wrap;">
  156. <view v-for="(items2,indexs2) in items.fpdResultDOList" :key="indexs2"
  157. style="margin-right: 10rpx;">
  158. <image v-if="items2.resValue==1" :src="zhengchang" class="tupian"
  159. style="vertical-align:middle;margin-right: 6rpx;" />
  160. <text v-if="items2.resValue==1" class="text-descibe">{{items2.resLable}}</text>
  161. </view>
  162. </uni-col>
  163. </uni-row>
  164. <uni-row class="demo-uni-row tupian-flex">
  165. <image v-if="items.imgUrl1!=null" :src="items.imgUrl1" class="image-size"
  166. @click="viewImageBig(items.imgUrl)"></image>
  167. <image v-if="items.imgUrl2!=null" :src="items.imgUrl2" class="image-size"
  168. @click="viewImageBig(items.imgUrl)"></image>
  169. <image v-if="items.imgUr3!=null" :src="items.imgUrl3" class="image-size"
  170. @click="viewImageBig(items.imgUrl)"></image>
  171. </uni-row>
  172. </view>
  173. </view>
  174. </view>
  175. </view>
  176. </view>
  177. <view style="width: 80%;position: fixed;bottom:80rpx;left: 50%;transform: translate(-50%);">
  178. <u-button v-if="current==0&&history==''" style="width: 70%;" @click="addClickModify(tableData)"
  179. type="primary" color="#4CB2B6" shape="circle" size="default" text="去完成">
  180. </u-button>
  181. </u-button>
  182. <u-button v-if="current!=0" style="width: 70%;" @click="fanHui" type="primary" color="#4CB2B6"
  183. shape="circle" size="default" text="返回">
  184. </u-button>
  185. </view>
  186. </view>
  187. </template>
  188. <script>
  189. let that = null;
  190. import {
  191. getCheckActiveTask, //主动检查除归档外的查看详情--新
  192. getempnamebyuserid //根据人员id获取人员姓名
  193. } from "@/api/check_active";
  194. import {
  195. shijianc,
  196. downSee
  197. } from '@/utils/common.js'
  198. import {
  199. DICT_TYPE,
  200. getDictDatas
  201. } from "@/utils/dict";
  202. //任务状态,0代表未执行刚建好,可修改,1表示已执行不能改
  203. import config from '@/config'
  204. const baseUrlImg = config.baseUrlImg
  205. export default {
  206. data() {
  207. return {
  208. taskTypeDict: getDictDatas(DICT_TYPE.TASK_TYPE),
  209. urls: baseUrlImg,
  210. moren: `${baseUrlImg}/checkActive/moren.png`, //默认图片
  211. zhengchang: `${baseUrlImg}/checkActive/zhengchang.png`,
  212. current: 0,
  213. broaId: 0,
  214. tableData: [],
  215. times: '',
  216. sender: '',
  217. receiver: '',
  218. jieTimes: '',
  219. attId: ['https://img0.baidu.com/it/u=55142048,1961882233&fm=253&fmt=auto&app=138&f=JPEG?w=707&h=500',
  220. 'https://img0.baidu.com/it/u=55142048,1961882233&fm=253&fmt=auto&app=138&f=JPEG?w=707&h=500',
  221. 'https://img0.baidu.com/it/u=55142048,1961882233&fm=253&fmt=auto&app=138&f=JPEG?w=707&h=500',
  222. 'https://www.anhuanjia.com/upload/resources/image/2021/10/21/11255.jpg',
  223. 'https://img0.baidu.com/it/u=1094909399,1438583889&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1677258000&t=d2ab3fbac6d995537e6e152a1078a4fb',
  224. 'https://img0.baidu.com/it/u=2492383633,364894362&fm=253&fmt=auto&app=138&f=JPEG?w=650&h=451'
  225. ],
  226. history: ''
  227. }
  228. },
  229. onLoad(options) {
  230. this.history = options.history ? options.history : ''
  231. this.current = options.current ? options.current : ''
  232. that = this;
  233. const eventChannel = this.getOpenerEventChannel();
  234. eventChannel.on('acceptDataFromOpenerPage', function(val) {
  235. that.broaId = val
  236. that.getData()
  237. })
  238. },
  239. methods: {
  240. viewImageBig(item) {
  241. let imgList = []
  242. imgList.push(item)
  243. uni.previewImage({
  244. urls: imgList,
  245. current: item
  246. });
  247. },
  248. // 下载附件
  249. down(appendix) {
  250. downSee(appendix)
  251. // const fileExt = appendix.substring(appendix.lastIndexOf('.') + 1);
  252. // console.log(fileExt, 'fileExtfileExt');
  253. // var that = this;
  254. // //加载框动画
  255. // uni.showLoading({
  256. // title: '正在下载……'
  257. // });
  258. // // #ifdef H5
  259. // let link = document.createElement('a');
  260. // link.href = appendix;
  261. // link.download = '';
  262. // document.body.appendChild(link);
  263. // link.click();
  264. // link.remove();
  265. // uni.hideLoading();
  266. // uni.showToast({
  267. // icon: 'success',
  268. // mask: true,
  269. // title: '文件已下载',
  270. // duration: 2000
  271. // });
  272. // // #endif
  273. // // #ifdef MP-WEIXIN
  274. // uni.downloadFile({
  275. // url: appendix, //下载地址接口返回
  276. // success: data => {
  277. // // console.log('打印data', data);
  278. // if (data.statusCode === 200) {
  279. // //隐藏加载框
  280. // // uni.hideLoading();
  281. // //文件保存到本地
  282. // uni.getFileSystemManager().saveFile({
  283. // tempFilePath: data.tempFilePath, //临时路径
  284. // success: function(res) {
  285. // // console.log('打印res', res);
  286. // uni.showToast({
  287. // icon: 'success',
  288. // mask: true,
  289. // title: '文件已保存:' + res.savedFilePath, //保存路径
  290. // title: '加载成功',
  291. // duration: 2000
  292. // });
  293. // //自动打开文档查看
  294. // setTimeout(() => {
  295. // var filePath = res.savedFilePath;
  296. // console.log(res, 'filePathfilePath');
  297. // uni.openDocument({
  298. // //新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx。
  299. // filePath: filePath,
  300. // fileType: fileExt,
  301. // showMenu: false,
  302. // success: function(res) {
  303. // console.log('打开文档成功');
  304. // },
  305. // fail: function() {
  306. // uni.showToast({
  307. // title: '暂不支持打开此类型',
  308. // duration: 2000,
  309. // icon: 'none'
  310. // });
  311. // }
  312. // });
  313. // }, 2000);
  314. // }
  315. // });
  316. // }
  317. // },
  318. // fail: err => {
  319. // console.log(err);
  320. // uni.showToast({
  321. // icon: 'none',
  322. // mask: true,
  323. // title: '文件下载失败'
  324. // });
  325. // }
  326. // }) // #endif
  327. },
  328. //返回
  329. fanHui() {
  330. uni.navigateBack()
  331. },
  332. //去完成
  333. addClickModify(val) {
  334. uni.navigateTo({
  335. url: `/pagesA/fire/check_active/check_implement/check_implement?id=${val}&broadId=${this.broaId}`,
  336. success: function(res) {
  337. res.eventChannel.emit('acceptDataFromOpenerPage', val);
  338. },
  339. })
  340. },
  341. goAddCheck(val) {
  342. uni.navigateTo({
  343. url: `/pagesA/fire/check_active/add_check/add_check?id=` + val,
  344. })
  345. },
  346. // 获取数据
  347. getData() {
  348. getCheckActiveTask({
  349. broadId: this.broaId
  350. }).then(response => {
  351. // 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
  352. this.tableData = response.data
  353. this.times = this.tableData.taskInfo ? shijianc(this.tableData.taskInfo.publishTime) : ''
  354. getempnamebyuserid({
  355. userId: this.tableData.taskInfo.receiver
  356. }).then(res => {
  357. this.receiver = res.data
  358. })
  359. getempnamebyuserid({
  360. userId: this.tableData.taskInfo.sender
  361. }).then(res => {
  362. this.sender = res.data
  363. })
  364. this.taskTypeDict.map(i => {
  365. if (i.value == this.tableData?.taskInfo?.taskType) {
  366. this.tableData.taskInfo.taskType = i.label
  367. }
  368. })
  369. });
  370. }
  371. }
  372. }
  373. </script>
  374. <style lang="scss" scoped>
  375. page {
  376. background-color: #f5f7f9;
  377. }
  378. body {
  379. background-color: #f5f7f9;
  380. }
  381. .container {
  382. // border-radius: 30px 30px 0px 0px;
  383. // background: #fff;
  384. // margin-top: 90rpx;
  385. // z-index: 9999;
  386. // position: relative;
  387. background-color: #f5f7f9;
  388. .uni-container {
  389. padding-bottom: 120rpx;
  390. margin-top: 50rpx;
  391. height: 100%;
  392. border-top-right-radius: 40rpx;
  393. border-top-left-radius: 40rpx;
  394. background-color: #f5f7f9;
  395. }
  396. }
  397. .zhuangtai {
  398. padding: 5rpx 20rpx;
  399. border-radius: 2px;
  400. }
  401. .weiwan {
  402. color: #D51A52;
  403. background: rgba(213, 26, 82, 0.2);
  404. border: 1px solid #D51A52;
  405. }
  406. .yiwan {
  407. color: #4CB2B6;
  408. background: rgba(76, 178, 182, 0.2);
  409. border: 1px solid #4CB2B6;
  410. }
  411. .shenhe {
  412. color: #3491FA;
  413. background: rgba(52, 145, 250, 0.2);
  414. border: 1px solid #4CB2B6;
  415. }
  416. .juli-top {
  417. margin: 20rpx 0 20rpx 0;
  418. }
  419. .image-size {
  420. width: 160rpx;
  421. height: 160rpx;
  422. border-radius: 10rpx;
  423. margin: 0 15rpx 20rpx 0;
  424. }
  425. .tupian {
  426. width: 38rpx;
  427. height: 38rpx;
  428. }
  429. .tupian-flex {
  430. display: flex;
  431. justify-content: space-around;
  432. flex-wrap: wrap;
  433. }
  434. //新样式
  435. .main {
  436. border: 4rpx solid rgb(192, 203, 218);
  437. border-radius: 10rpx;
  438. .demo-uni-row,
  439. /deep/.uni-row {
  440. width: 96%;
  441. margin: 0 2% !important;
  442. padding: 20rpx 0;
  443. border-bottom: 2rpx solid rgb(174, 174, 174);
  444. }
  445. /deep/.uni-row:last-child {
  446. border: 0;
  447. }
  448. .middles {
  449. text-align: center !important;
  450. }
  451. .buju {
  452. margin: 40rpx;
  453. line-height: 40rpx;
  454. .miaoshu {
  455. margin-right: 20rpx;
  456. color: #274647;
  457. font-size: 30rpx;
  458. }
  459. .text-descibe {
  460. color: rgb(102, 103, 133);
  461. font-size: 28rpx;
  462. }
  463. }
  464. }
  465. .nav {
  466. font-size: 36rpx;
  467. color: #4CB2B6;
  468. margin-bottom: 20rpx;
  469. }
  470. .main-time{
  471. list-style: none;
  472. position: relative;
  473. }
  474. .main-time::before{
  475. content: "";
  476. position: absolute;
  477. border:rgba(52, 145, 250, 0.4) 2px dashed;
  478. left: -43px;
  479. height: calc(100% - 20px);
  480. top: 20rpx;
  481. }
  482. .time-main {
  483. width: 70%;
  484. margin-left:15%;
  485. }
  486. .par-time {
  487. position: relative;
  488. }
  489. //时间轴
  490. .time-axis::before {
  491. content: "";
  492. position: absolute;
  493. width: 18rpx;
  494. height: 18rpx;
  495. border-radius: 9rpx;
  496. background: #21bfd0;
  497. top: 50%;
  498. transform: translateY(-50%);
  499. left: -46px;
  500. }
  501. </style>