check_list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  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" @click="viewImageBig(items.imgUrl)"></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" @click="viewImageBig(items.imgUrl)"></image>
  159. <image v-if="items.imgUrl2!=null" :src="items.imgUrl2" class="image-size" @click="viewImageBig(items.imgUrl)"></image>
  160. <image v-if="items.imgUr3!=null" :src="items.imgUrl3" class="image-size" @click="viewImageBig(items.imgUrl)"></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. viewImageBig(item){
  231. let imgList=[]
  232. imgList.push(item)
  233. uni.previewImage({
  234. urls: imgList,
  235. current: item
  236. });
  237. },
  238. // 下载附件
  239. down(appendix) {
  240. downSee(appendix)
  241. // const fileExt = appendix.substring(appendix.lastIndexOf('.') + 1);
  242. // console.log(fileExt, 'fileExtfileExt');
  243. // var that = this;
  244. // //加载框动画
  245. // uni.showLoading({
  246. // title: '正在下载……'
  247. // });
  248. // // #ifdef H5
  249. // let link = document.createElement('a');
  250. // link.href = appendix;
  251. // link.download = '';
  252. // document.body.appendChild(link);
  253. // link.click();
  254. // link.remove();
  255. // uni.hideLoading();
  256. // uni.showToast({
  257. // icon: 'success',
  258. // mask: true,
  259. // title: '文件已下载',
  260. // duration: 2000
  261. // });
  262. // // #endif
  263. // // #ifdef MP-WEIXIN
  264. // uni.downloadFile({
  265. // url: appendix, //下载地址接口返回
  266. // success: data => {
  267. // // console.log('打印data', data);
  268. // if (data.statusCode === 200) {
  269. // //隐藏加载框
  270. // // uni.hideLoading();
  271. // //文件保存到本地
  272. // uni.getFileSystemManager().saveFile({
  273. // tempFilePath: data.tempFilePath, //临时路径
  274. // success: function(res) {
  275. // // console.log('打印res', res);
  276. // uni.showToast({
  277. // icon: 'success',
  278. // mask: true,
  279. // title: '文件已保存:' + res.savedFilePath, //保存路径
  280. // title: '加载成功',
  281. // duration: 2000
  282. // });
  283. // //自动打开文档查看
  284. // setTimeout(() => {
  285. // var filePath = res.savedFilePath;
  286. // console.log(res, 'filePathfilePath');
  287. // uni.openDocument({
  288. // //新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx。
  289. // filePath: filePath,
  290. // fileType: fileExt,
  291. // showMenu: false,
  292. // success: function(res) {
  293. // console.log('打开文档成功');
  294. // },
  295. // fail: function() {
  296. // uni.showToast({
  297. // title: '暂不支持打开此类型',
  298. // duration: 2000,
  299. // icon: 'none'
  300. // });
  301. // }
  302. // });
  303. // }, 2000);
  304. // }
  305. // });
  306. // }
  307. // },
  308. // fail: err => {
  309. // console.log(err);
  310. // uni.showToast({
  311. // icon: 'none',
  312. // mask: true,
  313. // title: '文件下载失败'
  314. // });
  315. // }
  316. // }) // #endif
  317. },
  318. //返回
  319. fanHui() {
  320. uni.navigateBack()
  321. },
  322. //去完成
  323. addClickModify(val) {
  324. uni.navigateTo({
  325. url: `/pagesA/fire/check_active/check_implement/check_implement?id=${val}&broadId=${this.broaId}`,
  326. success: function(res) {
  327. res.eventChannel.emit('acceptDataFromOpenerPage', val);
  328. },
  329. })
  330. },
  331. goAddCheck(val) {
  332. uni.navigateTo({
  333. url: `/pagesA/fire/check_active/add_check/add_check?id=` + val,
  334. })
  335. },
  336. // 获取数据
  337. getData() {
  338. getCheckActiveTask({
  339. broadId: this.broaId
  340. }).then(response => {
  341. // 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
  342. this.tableData = response.data
  343. this.times = this.tableData.taskInfo ? shijianc(this.tableData.taskInfo.publishTime) : ''
  344. getempnamebyuserid({
  345. userId: this.tableData.taskInfo.receiver
  346. }).then(res => {
  347. this.receiver = res.data
  348. })
  349. getempnamebyuserid({
  350. userId: this.tableData.taskInfo.sender
  351. }).then(res => {
  352. this.sender = res.data
  353. })
  354. this.taskTypeDict.map(i=>{
  355. if(i.value==this.tableData?.taskInfo?.taskType){
  356. this.tableData.taskInfo.taskType=i.label
  357. }
  358. })
  359. });
  360. }
  361. }
  362. }
  363. </script>
  364. <style lang="scss" scoped>
  365. page {
  366. background-color: #f5f7f9;
  367. }
  368. body {
  369. background-color: #f5f7f9;
  370. }
  371. .container {
  372. // border-radius: 30px 30px 0px 0px;
  373. // background: #fff;
  374. // margin-top: 90rpx;
  375. // z-index: 9999;
  376. // position: relative;
  377. background-color: #f5f7f9;
  378. .uni-container {
  379. padding-bottom: 120rpx;
  380. margin-top: 50rpx;
  381. height: 100%;
  382. border-top-right-radius: 40rpx;
  383. border-top-left-radius: 40rpx;
  384. background-color: #f5f7f9;
  385. }
  386. }
  387. .zhuangtai {
  388. padding: 5rpx 20rpx;
  389. border-radius: 2px;
  390. }
  391. .weiwan {
  392. color: #D51A52;
  393. background: rgba(213, 26, 82, 0.2);
  394. border: 1px solid #D51A52;
  395. }
  396. .yiwan {
  397. color: #4CB2B6;
  398. background: rgba(76, 178, 182, 0.2);
  399. border: 1px solid #4CB2B6;
  400. }
  401. .shenhe {
  402. color: #3491FA;
  403. background: rgba(52, 145, 250, 0.2);
  404. border: 1px solid #4CB2B6;
  405. }
  406. .juli-top {
  407. margin: 20rpx 0 20rpx 0;
  408. }
  409. .image-size {
  410. width: 160rpx;
  411. height: 160rpx;
  412. border-radius: 10rpx;
  413. margin: 0 15rpx 20rpx 0;
  414. }
  415. .tupian {
  416. width: 38rpx;
  417. height: 38rpx;
  418. }
  419. .tupian-flex {
  420. display: flex;
  421. justify-content: space-around;
  422. flex-wrap: wrap;
  423. }
  424. //新样式
  425. .main {
  426. border: 4rpx solid rgb(192, 203, 218);
  427. border-radius: 10rpx;
  428. .demo-uni-row,
  429. /deep/.uni-row {
  430. width: 96%;
  431. margin: 0 2% !important;
  432. padding: 20rpx 0;
  433. border-bottom: 2rpx solid rgb(174, 174, 174);
  434. }
  435. /deep/.uni-row:last-child {
  436. border: 0;
  437. }
  438. .middles {
  439. text-align: center !important;
  440. }
  441. .buju {
  442. margin: 40rpx;
  443. line-height: 40rpx;
  444. .miaoshu {
  445. margin-right: 20rpx;
  446. color: #274647;
  447. font-size: 30rpx;
  448. }
  449. .text-descibe {
  450. color: rgb(102, 103, 133);
  451. font-size: 28rpx;
  452. }
  453. }
  454. }
  455. .nav {
  456. font-size: 36rpx;
  457. color: #4CB2B6;
  458. margin-bottom: 20rpx;
  459. }
  460. </style>