check_list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  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. import {
  189. DICT_TYPE,
  190. getDictDatas
  191. } from "@/utils/dict";
  192. //任务状态,0代表未执行刚建好,可修改,1表示已执行不能改
  193. import config from '@/config'
  194. const baseUrlImg = config.baseUrlImg
  195. export default {
  196. data() {
  197. return {
  198. taskTypeDict:getDictDatas(DICT_TYPE.TASK_TYPE),
  199. urls: baseUrlImg,
  200. moren: `${baseUrlImg}/checkActive/moren.png`, //默认图片
  201. zhengchang: `${baseUrlImg}/checkActive/zhengchang.png`,
  202. current: 0,
  203. broaId: 0,
  204. tableData: [],
  205. times: '',
  206. sender: '',
  207. receiver: '',
  208. jieTimes: '',
  209. attId: ['https://img0.baidu.com/it/u=55142048,1961882233&fm=253&fmt=auto&app=138&f=JPEG?w=707&h=500',
  210. 'https://img0.baidu.com/it/u=55142048,1961882233&fm=253&fmt=auto&app=138&f=JPEG?w=707&h=500',
  211. 'https://img0.baidu.com/it/u=55142048,1961882233&fm=253&fmt=auto&app=138&f=JPEG?w=707&h=500',
  212. 'https://www.anhuanjia.com/upload/resources/image/2021/10/21/11255.jpg',
  213. 'https://img0.baidu.com/it/u=1094909399,1438583889&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1677258000&t=d2ab3fbac6d995537e6e152a1078a4fb',
  214. 'https://img0.baidu.com/it/u=2492383633,364894362&fm=253&fmt=auto&app=138&f=JPEG?w=650&h=451'
  215. ],
  216. history: ''
  217. }
  218. },
  219. onLoad(options) {
  220. this.history = options.history ? options.history : ''
  221. this.current = options.current ? options.current : ''
  222. that = this;
  223. const eventChannel = this.getOpenerEventChannel();
  224. eventChannel.on('acceptDataFromOpenerPage', function(val) {
  225. that.broaId = val
  226. that.getData()
  227. })
  228. },
  229. methods: {
  230. // 下载附件
  231. down(appendix) {
  232. downSee(appendix)
  233. // const fileExt = appendix.substring(appendix.lastIndexOf('.') + 1);
  234. // console.log(fileExt, 'fileExtfileExt');
  235. // var that = this;
  236. // //加载框动画
  237. // uni.showLoading({
  238. // title: '正在下载……'
  239. // });
  240. // // #ifdef H5
  241. // let link = document.createElement('a');
  242. // link.href = appendix;
  243. // link.download = '';
  244. // document.body.appendChild(link);
  245. // link.click();
  246. // link.remove();
  247. // uni.hideLoading();
  248. // uni.showToast({
  249. // icon: 'success',
  250. // mask: true,
  251. // title: '文件已下载',
  252. // duration: 2000
  253. // });
  254. // // #endif
  255. // // #ifdef MP-WEIXIN
  256. // uni.downloadFile({
  257. // url: appendix, //下载地址接口返回
  258. // success: data => {
  259. // // console.log('打印data', data);
  260. // if (data.statusCode === 200) {
  261. // //隐藏加载框
  262. // // uni.hideLoading();
  263. // //文件保存到本地
  264. // uni.getFileSystemManager().saveFile({
  265. // tempFilePath: data.tempFilePath, //临时路径
  266. // success: function(res) {
  267. // // console.log('打印res', res);
  268. // uni.showToast({
  269. // icon: 'success',
  270. // mask: true,
  271. // title: '文件已保存:' + res.savedFilePath, //保存路径
  272. // title: '加载成功',
  273. // duration: 2000
  274. // });
  275. // //自动打开文档查看
  276. // setTimeout(() => {
  277. // var filePath = res.savedFilePath;
  278. // console.log(res, 'filePathfilePath');
  279. // uni.openDocument({
  280. // //新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx。
  281. // filePath: filePath,
  282. // fileType: fileExt,
  283. // showMenu: false,
  284. // success: function(res) {
  285. // console.log('打开文档成功');
  286. // },
  287. // fail: function() {
  288. // uni.showToast({
  289. // title: '暂不支持打开此类型',
  290. // duration: 2000,
  291. // icon: 'none'
  292. // });
  293. // }
  294. // });
  295. // }, 2000);
  296. // }
  297. // });
  298. // }
  299. // },
  300. // fail: err => {
  301. // console.log(err);
  302. // uni.showToast({
  303. // icon: 'none',
  304. // mask: true,
  305. // title: '文件下载失败'
  306. // });
  307. // }
  308. // }) // #endif
  309. },
  310. //返回
  311. fanHui() {
  312. uni.navigateBack()
  313. },
  314. //去完成
  315. addClickModify(val) {
  316. uni.navigateTo({
  317. url: `/pagesA/fire/check_active/check_implement/check_implement?id=${val}&broadId=${this.broaId}`,
  318. success: function(res) {
  319. res.eventChannel.emit('acceptDataFromOpenerPage', val);
  320. },
  321. })
  322. },
  323. goAddCheck(val) {
  324. uni.navigateTo({
  325. url: `/pagesA/fire/check_active/add_check/add_check?id=` + val,
  326. })
  327. },
  328. // 获取数据
  329. getData() {
  330. getCheckActiveTask({
  331. broadId: this.broaId
  332. }).then(response => {
  333. // 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
  334. this.tableData = response.data
  335. this.times = this.tableData.taskInfo ? shijianc(this.tableData.taskInfo.publishTime) : ''
  336. getempnamebyuserid({
  337. userId: this.tableData.taskInfo.receiver
  338. }).then(res => {
  339. this.receiver = res.data
  340. })
  341. getempnamebyuserid({
  342. userId: this.tableData.taskInfo.sender
  343. }).then(res => {
  344. this.sender = res.data
  345. })
  346. this.taskTypeDict.map(i=>{
  347. if(i.value==this.tableData?.taskInfo?.taskType){
  348. this.tableData.taskInfo.taskType=i.label
  349. }
  350. })
  351. });
  352. }
  353. }
  354. }
  355. </script>
  356. <style lang="scss" scoped>
  357. page {
  358. background-color: #f5f7f9;
  359. }
  360. body {
  361. background-color: #f5f7f9;
  362. }
  363. .container {
  364. // border-radius: 30px 30px 0px 0px;
  365. // background: #fff;
  366. // margin-top: 90rpx;
  367. // z-index: 9999;
  368. // position: relative;
  369. background-color: #f5f7f9;
  370. .uni-container {
  371. padding-bottom: 120rpx;
  372. margin-top: 50rpx;
  373. height: 100%;
  374. border-top-right-radius: 40rpx;
  375. border-top-left-radius: 40rpx;
  376. background-color: #f5f7f9;
  377. }
  378. }
  379. .zhuangtai {
  380. padding: 5rpx 20rpx;
  381. border-radius: 2px;
  382. }
  383. .weiwan {
  384. color: #D51A52;
  385. background: rgba(213, 26, 82, 0.2);
  386. border: 1px solid #D51A52;
  387. }
  388. .yiwan {
  389. color: #4CB2B6;
  390. background: rgba(76, 178, 182, 0.2);
  391. border: 1px solid #4CB2B6;
  392. }
  393. .shenhe {
  394. color: #3491FA;
  395. background: rgba(52, 145, 250, 0.2);
  396. border: 1px solid #4CB2B6;
  397. }
  398. .juli-top {
  399. margin: 20rpx 0 20rpx 0;
  400. }
  401. .image-size {
  402. width: 160rpx;
  403. height: 160rpx;
  404. border-radius: 10rpx;
  405. margin: 0 15rpx 20rpx 0;
  406. }
  407. .tupian {
  408. width: 38rpx;
  409. height: 38rpx;
  410. }
  411. .tupian-flex {
  412. display: flex;
  413. justify-content: space-around;
  414. flex-wrap: wrap;
  415. }
  416. //新样式
  417. .main {
  418. border: 4rpx solid rgb(192, 203, 218);
  419. border-radius: 10rpx;
  420. .demo-uni-row,
  421. /deep/.uni-row {
  422. width: 96%;
  423. margin: 0 2% !important;
  424. padding: 20rpx 0;
  425. border-bottom: 2rpx solid rgb(174, 174, 174);
  426. }
  427. /deep/.uni-row:last-child {
  428. border: 0;
  429. }
  430. .middles {
  431. text-align: center !important;
  432. }
  433. .buju {
  434. margin: 40rpx;
  435. line-height: 40rpx;
  436. .miaoshu {
  437. margin-right: 20rpx;
  438. color: #274647;
  439. font-size: 30rpx;
  440. }
  441. .text-descibe {
  442. color: rgb(102, 103, 133);
  443. font-size: 28rpx;
  444. }
  445. }
  446. }
  447. .nav {
  448. font-size: 36rpx;
  449. color: #4CB2B6;
  450. margin-bottom: 20rpx;
  451. }
  452. </style>