gradingControlDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  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="@/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 == '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. listName = data.data.detail.imgName.split(",")
  212. listUrl = data.data.detail.imgUrl.split(",")
  213. for (var i = 0; i < listName.length; i++) {
  214. if (listName[i]) {
  215. let type = listName[i].split(".")[1];
  216. this.upList.push({
  217. 'name': listName[i],
  218. 'url': config.base_url + listUrl[i],
  219. 'type': type,
  220. })
  221. }
  222. }
  223. console.log(this.upList)
  224. }
  225. },
  226. }
  227. }
  228. </script>
  229. <style lang="stylus" scoped>
  230. #accessQualification {
  231. height: 100%;
  232. display flex;
  233. flex-direction column;
  234. .info-max-box {
  235. flex: 1;
  236. overflow: scroll;
  237. .for-big-box:last-child {
  238. margin-bottom: 180rpx;
  239. }
  240. /* 列表 */
  241. .list {
  242. padding 0 20rpx;
  243. box-sizing border-box;
  244. .list_li {
  245. height 450rpx;
  246. .list_li_t {
  247. height: 80rpx;
  248. display flex;
  249. justify-content flex-start;
  250. align-items: center;
  251. .list_li_t_l {
  252. width: 80rpx;
  253. height: 30rpx;
  254. font-size: 24rpx;
  255. font-family: PingFang SC;
  256. font-weight: 500;
  257. color: #EE3A3A;
  258. line-height: 30rpx;
  259. border: 2rpx solid #EE3A3A;
  260. border-radius: 6rpx;
  261. text-align center;
  262. }
  263. .list_li_t_c {
  264. font-size: 28rpx;
  265. font-family: PingFang SC;
  266. font-weight: 500;
  267. color: #333333;
  268. line-height: 30rpx;
  269. margin 0 32rpx 0 16rpx;
  270. }
  271. .list_li_t_r {
  272. font-size: 28rpx;
  273. font-family: PingFang SC;
  274. font-weight: 500;
  275. color: #999999;
  276. line-height: 30rpx;
  277. }
  278. }
  279. .list_li_b {
  280. width 710rpx;
  281. height auto;
  282. background: #FFFFFF;
  283. border-radius: 20rpx;
  284. padding: 0 14rpx;
  285. box-sizing: border-box;
  286. overflow hidden;
  287. .list_li_b_t {
  288. overflow: hidden;
  289. .list_li_b_t_t {
  290. display flex;
  291. justify-content flex-start;
  292. margin: 24rpx 0 18rpx 0;
  293. .list_li_b_t_t_n {
  294. flex: 1;
  295. display flex;
  296. justify-content flex-start;
  297. .list_li_b_t_t_l {
  298. width: 100rpx;
  299. height: 30rpx;
  300. font-size: 24rpx;
  301. font-family: PingFang SC;
  302. font-weight: 500;
  303. /* color: #0183FA; */
  304. line-height: 30rpx;
  305. /* background: rgba(1,131,250,0.2); */
  306. border-radius: 6rpx;
  307. text-align: center;
  308. }
  309. .list_li_b_t_t_c {
  310. flex: 1;
  311. font-size: 28rpx;
  312. font-family: PingFang SC;
  313. font-weight: 500;
  314. color: #333333;
  315. line-height: 28rpx;
  316. margin: 0 16rpx 0 12rpx;
  317. }
  318. .list_li_b_t_t_r {
  319. font-size: 24rpx;
  320. font-family: PingFang SC;
  321. font-weight: 500;
  322. color: #EE3A3A;
  323. line-height: 24rpx;
  324. }
  325. }
  326. .list_li_b_t_t_n_r {
  327. font-size: 24rpx;
  328. line-height: 30rpx;
  329. color: #999;
  330. }
  331. /* 日管控 */
  332. .purple {
  333. color: #AC20E0;
  334. background: rgba(172, 32, 224, 0.2);
  335. }
  336. /* 周管控 */
  337. .blue {
  338. color: #0183FA;
  339. background: rgba(1, 131, 250, 0.2);
  340. }
  341. /* 月管控 */
  342. .orange {
  343. color: #FA8801;
  344. background: rgba(250, 136, 1, 0.2);
  345. }
  346. /* 季管控 */
  347. .lightBlue {
  348. color: #81d3f8;
  349. background: rgba(129, 211, 248, 0.2);
  350. }
  351. /* 半年管控 */
  352. .deepPurple {
  353. color: #6565f1;
  354. background: rgba(101, 101, 241, 0.2);
  355. }
  356. /* 年管控 */
  357. .green {
  358. color: #11BA25;
  359. background: rgba(17, 186, 37, 0.2);
  360. }
  361. >img {
  362. width: 12rpx;
  363. height: 24rpx;
  364. }
  365. }
  366. .list_li_b_t_b {
  367. font-size: 28rpx;
  368. font-family: PingFang SC;
  369. font-weight: 500;
  370. color: #999999;
  371. line-height: 48rpx;
  372. margin-bottom: 14rpx;
  373. >label {
  374. color: #333333;
  375. }
  376. }
  377. }
  378. .list_li_b_b {
  379. font-size: 28rpx;
  380. font-family: PingFang SC;
  381. font-weight: 500;
  382. color: #333333;
  383. line-height: 28rpx;
  384. >label {
  385. font-size: 28rpx;
  386. font-family: PingFang SC;
  387. font-weight: 500;
  388. color: #999999;
  389. line-height: 28rpx;
  390. }
  391. }
  392. .list_li_b_b2 {
  393. font-size: 28rpx;
  394. font-family: PingFang SC;
  395. font-weight: 500;
  396. color: #999999;
  397. line-height: 48rpx;
  398. margin-top: 32rpx;
  399. >label {
  400. color: #333333;
  401. }
  402. }
  403. .list_li_b_b4 {
  404. width: 100%;
  405. margin-top: 10rpx;
  406. margin-bottom 20rpx;
  407. display: flex;
  408. justify-content: flex-start;
  409. >label {
  410. display: inline-block;
  411. font-size: 28rpx;
  412. font-family: PingFang SC;
  413. font-weight: 500;
  414. color: #333333;
  415. line-height: 28rpx;
  416. width: 150rpx;
  417. }
  418. .list_li_b_b4_n {
  419. width: 560rpx;
  420. .list_li_b_b4_r {
  421. height: 60rpx;
  422. width: 100%;
  423. margin-bottom: 20rpx;
  424. display: flex;
  425. justify-content: flex-start;
  426. align-items: center;
  427. img {
  428. height: 60rpx;
  429. width: 60rpx;
  430. margin-right: 10rpx;
  431. }
  432. .list_li_b_b4_r_r {
  433. height: 50rpx;
  434. white-space: nowrap;
  435. overflow: hidden;
  436. text-overflow: ellipsis;
  437. width: 100%;
  438. font-size: 28rpx;
  439. font-family: PingFang SC;
  440. font-weight: 500;
  441. color: #999999;
  442. line-height: 50rpx;
  443. }
  444. }
  445. }
  446. }
  447. }
  448. }
  449. }
  450. /*暂无数据*/
  451. .get-null-box {
  452. height: 100rpx;
  453. line-height: 100rpx;
  454. color: #999;
  455. text-align center
  456. }
  457. }
  458. .bottom-button-box {
  459. border-radius: 20rpx;
  460. margin: 20rpx 50rpx;
  461. width: 650rpx;
  462. height: 100rpx;
  463. line-height: 100rpx;
  464. background: #0183FA;
  465. font-size: 30rpx;
  466. color: #FFFFFF;
  467. text-align center;
  468. }
  469. }
  470. </style>