gradingControlDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. <!-- 分级管控记录详情 -->
  2. <template>
  3. <view id="accessQualification">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  5. <view class="list">
  6. <view class="list_li">
  7. <view class="list_li_t">
  8. <view class="list_li_t_l"
  9. :style="'color:'+infoList.fiedColor+';border-color:'+infoList.fiedColor">
  10. {{infoList.levelName}}
  11. </view>
  12. <view class="list_li_t_c">{{infoList.subName}}</view>
  13. <view class="list_li_t_r">{{infoList.typeName}}</view>
  14. </view>
  15. <view class="list_li_b">
  16. <view class="list_li_b_t">
  17. <view class="list_li_b_t_t">
  18. <view class="list_li_b_t_t_n">
  19. <view class="list_li_b_t_t_l" :class="[infoList.ruleType== '日管控' ? 'purple': '', infoList.ruleType=='周管控'? 'blue': '',infoList.ruleType=='月管控'? 'orange': '',infoList.ruleType=='季度管控'? 'lightBlue ': '',infoList.ruleType=='半年管控'? 'deepPurple ': '',
  20. infoList.ruleType=='年管控'? 'green': '',]">
  21. {{infoList.ruleType}}
  22. </view>
  23. <view class="list_li_b_t_t_c">{{infoList.ruleName}}</view>
  24. </view>
  25. <view class="list_li_b_t_t_n_r">{{infoList.endDate}}</view>
  26. </view>
  27. <view class="list_li_b_t_b" style="display: flex;"><label
  28. style="width:150rpx;">执行方式:</label>{{infoList.isAll==1?'多人执行':'单人执行'}}</view>
  29. <view class="list_li_b_t_b" style="display: flex;"><label
  30. style="width:150rpx;">规则描述:</label>{{infoList.ruleRemark}}</view>
  31. <view class="list_li_b_t_b" style="display: flex;" v-if="infoList.status == 0">
  32. <label style="width:200rpx;">指定执行人员:</label>
  33. <view style="flex:1;word-wrap:break-word;word-break:break-all;overflow: hidden;">
  34. {{infoList.allUserName?infoList.allUserName:''}}
  35. </view>
  36. </view>
  37. <view class="list_li_b_t_b" style="display: flex;" v-if="infoList.status == 2"><label
  38. style="width:150rpx;">执行人:</label>{{infoList.detail.createName}}</view>
  39. <view class="list_li_b_t_b" style="display: flex;" v-if="infoList.status == 2"><label
  40. style="width:150rpx;">身份:</label>{{infoList.userPosition}}</view>
  41. <view class="list_li_b_t_b" style="display: flex;" v-if="infoList.status == 2"><label
  42. style="width:150rpx;">执行时间:</label>{{infoList.detail.createTime}}</view>
  43. <view class="list_li_b_t_b" style="display: flex;" v-if="infoList.status == 2">
  44. <label style="width:150rpx;">执行描述:</label>
  45. <view style="flex:1;word-wrap:break-word;word-break:break-all;overflow: hidden;">
  46. {{infoList.detail.remark}}
  47. </view>
  48. </view>
  49. </view>
  50. <view class="list_li_b_b4" v-if="infoList.status == 2">
  51. <label>执行材料:</label>
  52. <view class="list_li_b_b4_n">
  53. <view class="list_li_b_b4_r" v-for="(item,index) in upList" :key="index"
  54. @click="lookItem(item)">
  55. <img :src="imagesUrl('commonality/icon_pdf.png')" v-if="item.type == 'pdf'" />
  56. <img :src="imagesUrl('commonality/icon_word.png')"
  57. v-if="item.type == 'docx'" />
  58. <img :src="item.url"
  59. v-if="item.type == 'png' || item.type == 'jpg' || item.type == 'jpeg' || item.type == 'gif'" />
  60. <view class="list_li_b_b4_r_r">{{item.name}}</view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </scroll-view>
  68. </view>
  69. </template>
  70. <script>
  71. import {
  72. parseTime
  73. } from '@/component/public.js'
  74. import {
  75. gradingControlDetail,
  76. readByLoginUser
  77. } from '@/pages_basics/api/index.js'
  78. import {
  79. config
  80. } from '@/api/request/config.js'
  81. export default {
  82. data() {
  83. return {
  84. infoList: {},
  85. id: '',
  86. upList: [],
  87. }
  88. },
  89. onLoad(option) {
  90. if (option.item) {
  91. let item = JSON.parse(decodeURIComponent(option.item));
  92. console.log(item)
  93. this.id = item.recordId;
  94. if (item.messageUserId) {
  95. this.readByLoginUser(item.messageUserId);
  96. }
  97. } else {
  98. }
  99. },
  100. onShow() {
  101. this.clearData();
  102. this.getList();
  103. },
  104. methods: {
  105. //清除
  106. clearData() {
  107. this.infoList = [];
  108. this.upList = [];
  109. },
  110. //滚动事件
  111. scrollGet() {
  112. //this.getList();
  113. },
  114. lookItem(item) {
  115. console.log("item", item)
  116. if (item.type == 'png' || item.type == 'jpg' || item.type == 'jpeg' || item.type == 'gif') {
  117. //查看图片
  118. wx.previewImage({
  119. urls: [item.url], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  120. current: '', // 当前显示图片的http链接,默认是第一个
  121. success: function(res) {},
  122. fail: function(res) {},
  123. complete: function(res) {},
  124. })
  125. } else if (item.type == 'pdf' || item.type == 'xlsx' || item.type == 'docx') {
  126. uni.showLoading({
  127. title: '下载中'
  128. });
  129. //下载文档
  130. wx.downloadFile({
  131. url:item.url,
  132. header: {
  133. Authorization: uni.getStorageSync('token')
  134. },
  135. success: function(res) {
  136. const fileManager = wx.getFileSystemManager()
  137. const filePath = wx.env.USER_DATA_PATH + '/' + item.name
  138. fileManager.saveFile({
  139. tempFilePath: res.tempFilePath,
  140. filePath,
  141. success: () => {
  142. uni.hideLoading();
  143. wx.openDocument({
  144. filePath: filePath,
  145. showMenu: true,
  146. fileType: item.type
  147. })
  148. },
  149. fail: function(res) {
  150. uni.hideLoading();
  151. uni.showToast({
  152. title: '下载失败',
  153. icon: "none",
  154. mask: true,
  155. duration: 2000
  156. });
  157. }
  158. })
  159. },
  160. fail: function(res) {
  161. uni.hideLoading();
  162. uni.showToast({
  163. title: '下载失败',
  164. icon: "none",
  165. mask: true,
  166. duration: 2000
  167. });
  168. }
  169. })
  170. }
  171. },
  172. //查看图片
  173. lockImg(list) {
  174. console.log(list)
  175. /* if(!list[0]){
  176. return
  177. } */
  178. let url = list.split(',')
  179. wx.previewImage({
  180. urls: url, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  181. current: '', // 当前显示图片的http链接,默认是第一个
  182. success: function(res) {},
  183. fail: function(res) {},
  184. complete: function(res) {},
  185. })
  186. },
  187. async readByLoginUser(id) {
  188. let obj = {
  189. id: id
  190. }
  191. const {
  192. data
  193. } = await readByLoginUser(obj)
  194. },
  195. //获取列表数据
  196. async getList() {
  197. let _this = this;
  198. let listUrl = [];
  199. let listName = [];
  200. const {
  201. data
  202. } = await gradingControlDetail(this.id)
  203. if (data.code == 200) {
  204. if(data.data.endDate){
  205. data.data.endDate = parseTime(data.data.endDate, "{y}-{m}-{d} {h}:{i}:{s}");
  206. }
  207. if(data.data.detail){
  208. data.data.detail.createTime = parseTime(data.data.detail.createTime, "{y}-{m}-{d} {h}:{i}:{s}");
  209. }
  210. this.infoList = data.data
  211. if(data.data.detail){
  212. if(data.data.detail.imgName){
  213. listName = data.data.detail.imgName.split(",")
  214. }
  215. }
  216. if(data.data.detail){
  217. if(data.data.detail.imgUrl){
  218. listUrl = data.data.detail.imgUrl.split(",")
  219. }
  220. }
  221. for (var i = 0; i < listName.length; i++) {
  222. if (listName[i]) {
  223. let type = listName[i].split(".")[1];
  224. this.upList.push({
  225. 'name': listName[i],
  226. 'url': config.base_url + listUrl[i],
  227. 'type': type,
  228. })
  229. }
  230. }
  231. console.log(this.upList)
  232. }
  233. },
  234. }
  235. }
  236. </script>
  237. <style lang="stylus" scoped>
  238. #accessQualification {
  239. height: 100%;
  240. display flex;
  241. flex-direction column;
  242. .info-max-box {
  243. flex: 1;
  244. overflow: scroll;
  245. .for-big-box:last-child {
  246. margin-bottom: 180rpx;
  247. }
  248. /* 列表 */
  249. .list {
  250. padding 0 20rpx;
  251. box-sizing border-box;
  252. .list_li {
  253. height 450rpx;
  254. .list_li_t {
  255. height: 80rpx;
  256. display flex;
  257. justify-content flex-start;
  258. align-items: center;
  259. .list_li_t_l {
  260. width: 80rpx;
  261. height: 30rpx;
  262. font-size: 24rpx;
  263. font-family: PingFang SC;
  264. font-weight: 500;
  265. color: #EE3A3A;
  266. line-height: 30rpx;
  267. border: 2rpx solid #EE3A3A;
  268. border-radius: 6rpx;
  269. text-align center;
  270. }
  271. .list_li_t_c {
  272. font-size: 28rpx;
  273. font-family: PingFang SC;
  274. font-weight: 500;
  275. color: #333333;
  276. line-height: 30rpx;
  277. margin 0 32rpx 0 16rpx;
  278. }
  279. .list_li_t_r {
  280. font-size: 28rpx;
  281. font-family: PingFang SC;
  282. font-weight: 500;
  283. color: #999999;
  284. line-height: 30rpx;
  285. }
  286. }
  287. .list_li_b {
  288. width 710rpx;
  289. height auto;
  290. background: #FFFFFF;
  291. border-radius: 20rpx;
  292. padding: 0 14rpx;
  293. box-sizing: border-box;
  294. overflow hidden;
  295. .list_li_b_t {
  296. overflow: hidden;
  297. .list_li_b_t_t {
  298. display flex;
  299. justify-content flex-start;
  300. margin: 24rpx 0 18rpx 0;
  301. .list_li_b_t_t_n {
  302. flex: 1;
  303. display flex;
  304. justify-content flex-start;
  305. .list_li_b_t_t_l {
  306. width: 100rpx;
  307. height: 30rpx;
  308. font-size: 24rpx;
  309. font-family: PingFang SC;
  310. font-weight: 500;
  311. /* color: #0183FA; */
  312. line-height: 30rpx;
  313. /* background: rgba(1,131,250,0.2); */
  314. border-radius: 6rpx;
  315. text-align: center;
  316. }
  317. .list_li_b_t_t_c {
  318. flex: 1;
  319. font-size: 28rpx;
  320. font-family: PingFang SC;
  321. font-weight: 500;
  322. color: #333333;
  323. line-height: 28rpx;
  324. margin: 0 16rpx 0 12rpx;
  325. }
  326. .list_li_b_t_t_r {
  327. font-size: 24rpx;
  328. font-family: PingFang SC;
  329. font-weight: 500;
  330. color: #EE3A3A;
  331. line-height: 24rpx;
  332. }
  333. }
  334. .list_li_b_t_t_n_r {
  335. font-size: 24rpx;
  336. line-height: 30rpx;
  337. color: #999;
  338. }
  339. /* 日管控 */
  340. .purple {
  341. color: #AC20E0;
  342. background: rgba(172, 32, 224, 0.2);
  343. }
  344. /* 周管控 */
  345. .blue {
  346. color: #0183FA;
  347. background: rgba(1, 131, 250, 0.2);
  348. }
  349. /* 月管控 */
  350. .orange {
  351. color: #FA8801;
  352. background: rgba(250, 136, 1, 0.2);
  353. }
  354. /* 季管控 */
  355. .lightBlue {
  356. color: #81d3f8;
  357. background: rgba(129, 211, 248, 0.2);
  358. }
  359. /* 半年管控 */
  360. .deepPurple {
  361. color: #6565f1;
  362. background: rgba(101, 101, 241, 0.2);
  363. }
  364. /* 年管控 */
  365. .green {
  366. color: #11BA25;
  367. background: rgba(17, 186, 37, 0.2);
  368. }
  369. >img {
  370. width: 12rpx;
  371. height: 24rpx;
  372. }
  373. }
  374. .list_li_b_t_b {
  375. font-size: 28rpx;
  376. font-family: PingFang SC;
  377. font-weight: 500;
  378. color: #999999;
  379. line-height: 48rpx;
  380. margin-bottom: 14rpx;
  381. >label {
  382. color: #333333;
  383. }
  384. }
  385. }
  386. .list_li_b_b {
  387. font-size: 28rpx;
  388. font-family: PingFang SC;
  389. font-weight: 500;
  390. color: #333333;
  391. line-height: 28rpx;
  392. >label {
  393. font-size: 28rpx;
  394. font-family: PingFang SC;
  395. font-weight: 500;
  396. color: #999999;
  397. line-height: 28rpx;
  398. }
  399. }
  400. .list_li_b_b2 {
  401. font-size: 28rpx;
  402. font-family: PingFang SC;
  403. font-weight: 500;
  404. color: #999999;
  405. line-height: 48rpx;
  406. margin-top: 32rpx;
  407. >label {
  408. color: #333333;
  409. }
  410. }
  411. .list_li_b_b4 {
  412. width: 100%;
  413. margin-top: 10rpx;
  414. margin-bottom 20rpx;
  415. display: flex;
  416. justify-content: flex-start;
  417. >label {
  418. display: inline-block;
  419. font-size: 28rpx;
  420. font-family: PingFang SC;
  421. font-weight: 500;
  422. color: #333333;
  423. line-height: 28rpx;
  424. width: 150rpx;
  425. }
  426. .list_li_b_b4_n {
  427. width: 560rpx;
  428. .list_li_b_b4_r {
  429. height: 60rpx;
  430. width: 100%;
  431. margin-bottom: 20rpx;
  432. display: flex;
  433. justify-content: flex-start;
  434. align-items: center;
  435. img {
  436. height: 60rpx;
  437. width: 60rpx;
  438. margin-right: 10rpx;
  439. }
  440. .list_li_b_b4_r_r {
  441. height: 50rpx;
  442. white-space: nowrap;
  443. overflow: hidden;
  444. text-overflow: ellipsis;
  445. width: 100%;
  446. font-size: 28rpx;
  447. font-family: PingFang SC;
  448. font-weight: 500;
  449. color: #999999;
  450. line-height: 50rpx;
  451. }
  452. }
  453. }
  454. }
  455. }
  456. }
  457. }
  458. /*暂无数据*/
  459. .get-null-box {
  460. height: 100rpx;
  461. line-height: 100rpx;
  462. color: #999;
  463. text-align center
  464. }
  465. }
  466. .bottom-button-box {
  467. border-radius: 20rpx;
  468. margin: 20rpx 50rpx;
  469. width: 650rpx;
  470. height: 100rpx;
  471. line-height: 100rpx;
  472. background: #0183FA;
  473. font-size: 30rpx;
  474. color: #FFFFFF;
  475. text-align center;
  476. }
  477. }
  478. </style>