gradingControlDetail.vue 13 KB

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