check_list.vue 14 KB

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