gradingControlDetail.vue 13 KB

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