gradingControlDetail.vue 13 KB

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