gradingControlDetail.vue 13 KB

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