gradingControlDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  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"
  20. :class="[infoList.ruleType== '日管控' ? 'purple': '', infoList.ruleType=='周管控'? 'blue': '',infoList.ruleType=='月管控'? 'orange': '',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}}
  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="@/pages_basics/images/icon_pdf.png" v-if="item.type == 'pdf'" />
  56. <img src="@/pages_basics/images/icon_word.png"
  57. v-if="item.type == 'doc' || 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 == 'doc' || 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. console.log("resresresresresres", res)
  137. const fileManager = wx.getFileSystemManager()
  138. const filePath = wx.env.USER_DATA_PATH + '/' + item.name + '.docx'
  139. fileManager.saveFile({
  140. tempFilePath: res.tempFilePath,
  141. filePath,
  142. success: () => {
  143. uni.hideLoading();
  144. wx.openDocument({
  145. filePath: filePath,
  146. showMenu: true,
  147. fileType: item.type
  148. })
  149. },
  150. fail: function(res) {
  151. uni.hideLoading();
  152. uni.showToast({
  153. title: '下载失败',
  154. icon: "none",
  155. mask: true,
  156. duration: 2000
  157. });
  158. }
  159. })
  160. },
  161. fail: function(res) {
  162. uni.hideLoading();
  163. uni.showToast({
  164. title: '下载失败',
  165. icon: "none",
  166. mask: true,
  167. duration: 2000
  168. });
  169. }
  170. })
  171. }
  172. },
  173. //查看图片
  174. lockImg(list) {
  175. console.log(list)
  176. /* if(!list[0]){
  177. return
  178. } */
  179. let url = list.split(',')
  180. wx.previewImage({
  181. urls: url, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  182. current: '', // 当前显示图片的http链接,默认是第一个
  183. success: function(res) {},
  184. fail: function(res) {},
  185. complete: function(res) {},
  186. })
  187. },
  188. async readByLoginUser(id) {
  189. let obj = {
  190. id: id
  191. }
  192. const {
  193. data
  194. } = await readByLoginUser(obj)
  195. },
  196. //获取列表数据
  197. async getList() {
  198. let _this = this;
  199. let listUrl = [];
  200. let listName = [];
  201. const {
  202. data
  203. } = await gradingControlDetail(this.id)
  204. if (data.code == 200) {
  205. data.data.endDate = parseTime(data.data.endDate, "{y}-{m}-{d} {h}:{i}:{s}");
  206. data.data.detail.createTime = parseTime(data.data.detail.createTime, "{y}-{m}-{d} {h}:{i}:{s}");
  207. this.infoList = data.data
  208. listName = data.data.detail.imgName.split(",")
  209. listUrl = data.data.detail.imgUrl.split(",")
  210. for (var i = 0; i < listName.length; i++) {
  211. if (listName[i]) {
  212. let type = listName[i].split(".")[1];
  213. this.upList.push({
  214. 'name': listName[i],
  215. 'url': config.base_url + listUrl[i],
  216. 'type': type,
  217. })
  218. }
  219. }
  220. console.log(this.upList)
  221. }
  222. },
  223. }
  224. }
  225. </script>
  226. <style lang="stylus" scoped>
  227. #accessQualification {
  228. height: 100%;
  229. display flex;
  230. flex-direction column;
  231. .info-max-box {
  232. flex: 1;
  233. overflow: scroll;
  234. .for-big-box:last-child {
  235. margin-bottom: 180rpx;
  236. }
  237. /* 列表 */
  238. .list {
  239. padding 0 20rpx;
  240. box-sizing border-box;
  241. .list_li {
  242. height 450rpx;
  243. .list_li_t {
  244. height: 80rpx;
  245. display flex;
  246. justify-content flex-start;
  247. align-items: center;
  248. .list_li_t_l {
  249. width: 80rpx;
  250. height: 30rpx;
  251. font-size: 24rpx;
  252. font-family: PingFang SC;
  253. font-weight: 500;
  254. color: #EE3A3A;
  255. line-height: 30rpx;
  256. border: 2rpx solid #EE3A3A;
  257. border-radius: 6rpx;
  258. text-align center;
  259. }
  260. .list_li_t_c {
  261. font-size: 28rpx;
  262. font-family: PingFang SC;
  263. font-weight: 500;
  264. color: #333333;
  265. line-height: 30rpx;
  266. margin 0 32rpx 0 16rpx;
  267. }
  268. .list_li_t_r {
  269. font-size: 28rpx;
  270. font-family: PingFang SC;
  271. font-weight: 500;
  272. color: #999999;
  273. line-height: 30rpx;
  274. }
  275. }
  276. .list_li_b {
  277. width 710rpx;
  278. height auto;
  279. background: #FFFFFF;
  280. border-radius: 20rpx;
  281. padding: 0 14rpx;
  282. box-sizing: border-box;
  283. overflow hidden;
  284. .list_li_b_t {
  285. overflow: hidden;
  286. .list_li_b_t_t {
  287. display flex;
  288. justify-content flex-start;
  289. margin: 24rpx 0 18rpx 0;
  290. .list_li_b_t_t_n {
  291. flex: 1;
  292. display flex;
  293. justify-content flex-start;
  294. .list_li_b_t_t_l {
  295. width: 100rpx;
  296. height: 30rpx;
  297. font-size: 24rpx;
  298. font-family: PingFang SC;
  299. font-weight: 500;
  300. /* color: #0183FA; */
  301. line-height: 30rpx;
  302. /* background: rgba(1,131,250,0.2); */
  303. border-radius: 6rpx;
  304. text-align: center;
  305. }
  306. .list_li_b_t_t_c {
  307. flex: 1;
  308. font-size: 28rpx;
  309. font-family: PingFang SC;
  310. font-weight: 500;
  311. color: #333333;
  312. line-height: 28rpx;
  313. margin: 0 16rpx 0 12rpx;
  314. }
  315. .list_li_b_t_t_r {
  316. font-size: 24rpx;
  317. font-family: PingFang SC;
  318. font-weight: 500;
  319. color: #EE3A3A;
  320. line-height: 24rpx;
  321. }
  322. }
  323. .list_li_b_t_t_n_r {
  324. font-size: 24rpx;
  325. line-height: 30rpx;
  326. color: #999;
  327. }
  328. /* 日管控 */
  329. .purple {
  330. color: #AC20E0;
  331. background: rgba(172, 32, 224, 0.2);
  332. }
  333. /* 周管控 */
  334. .blue {
  335. color: #0183FA;
  336. background: rgba(1, 131, 250, 0.2);
  337. }
  338. /* 月管控 */
  339. .orange {
  340. color: #FA8801;
  341. background: rgba(250, 136, 1, 0.2);
  342. }
  343. /* 年管控 */
  344. .green {
  345. color: #11BA25;
  346. background: rgba(17, 186, 37, 0.2);
  347. }
  348. >img {
  349. width: 12rpx;
  350. height: 24rpx;
  351. }
  352. }
  353. .list_li_b_t_b {
  354. font-size: 28rpx;
  355. font-family: PingFang SC;
  356. font-weight: 500;
  357. color: #999999;
  358. line-height: 48rpx;
  359. margin-bottom: 14rpx;
  360. >label {
  361. color: #333333;
  362. }
  363. }
  364. }
  365. .list_li_b_b {
  366. font-size: 28rpx;
  367. font-family: PingFang SC;
  368. font-weight: 500;
  369. color: #333333;
  370. line-height: 28rpx;
  371. >label {
  372. font-size: 28rpx;
  373. font-family: PingFang SC;
  374. font-weight: 500;
  375. color: #999999;
  376. line-height: 28rpx;
  377. }
  378. }
  379. .list_li_b_b2 {
  380. font-size: 28rpx;
  381. font-family: PingFang SC;
  382. font-weight: 500;
  383. color: #999999;
  384. line-height: 48rpx;
  385. margin-top: 32rpx;
  386. >label {
  387. color: #333333;
  388. }
  389. }
  390. .list_li_b_b4 {
  391. width: 100%;
  392. margin-top: 10rpx;
  393. margin-bottom 20rpx;
  394. display: flex;
  395. justify-content: flex-start;
  396. >label {
  397. display: inline-block;
  398. font-size: 28rpx;
  399. font-family: PingFang SC;
  400. font-weight: 500;
  401. color: #333333;
  402. line-height: 28rpx;
  403. width: 150rpx;
  404. }
  405. .list_li_b_b4_n {
  406. width: 560rpx;
  407. .list_li_b_b4_r {
  408. height: 60rpx;
  409. width: 100%;
  410. margin-bottom: 20rpx;
  411. display: flex;
  412. justify-content: flex-start;
  413. align-items: center;
  414. img {
  415. height: 60rpx;
  416. width: 60rpx;
  417. margin-right: 10rpx;
  418. }
  419. .list_li_b_b4_r_r {
  420. height: 50rpx;
  421. white-space: nowrap;
  422. overflow: hidden;
  423. text-overflow: ellipsis;
  424. width: 100%;
  425. font-size: 28rpx;
  426. font-family: PingFang SC;
  427. font-weight: 500;
  428. color: #999999;
  429. line-height: 50rpx;
  430. }
  431. }
  432. }
  433. }
  434. }
  435. }
  436. }
  437. /*暂无数据*/
  438. .get-null-box {
  439. height: 100rpx;
  440. line-height: 100rpx;
  441. color: #999;
  442. text-align center
  443. }
  444. }
  445. .bottom-button-box {
  446. border-radius: 20rpx;
  447. margin: 20rpx 50rpx;
  448. width: 650rpx;
  449. height: 100rpx;
  450. line-height: 100rpx;
  451. background: #0183FA;
  452. font-size: 30rpx;
  453. color: #FFFFFF;
  454. text-align center;
  455. }
  456. }
  457. </style>