check_list.vue 14 KB

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