applicationDetails.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <!-- 申请详情 -->
  2. <template>
  3. <view id="applicationDetails" v-if="pageType">
  4. <view class="user-info-box">
  5. <view class="user-info-box-min">
  6. <view>实验室:</view>
  7. <view>{{subjectData.labSecurityApply.subjectName}}</view>
  8. </view>
  9. <view class="user-info-box-min">
  10. <view>申请时限:</view>
  11. <view>{{subjectData.labSecurityApply.validBeginTime}}至{{subjectData.labSecurityApply.validEndTime}}</view>
  12. </view>
  13. <view class="user-info-box-min">
  14. <view>申请备注:</view>
  15. <view>{{subjectData.labSecurityApply.applyCause}}</view>
  16. </view>
  17. </view>
  18. <view class="user-info-box">
  19. <view class="user-info-box_title"><view style="color: red;">*</view>身份信息:(关联学生信息材料)</view>
  20. <view class="user-info-box-min">
  21. <view>申请人:</view>
  22. <view>{{subjectData.sysUser.nickName}}</view>
  23. </view>
  24. <view class="user-info-box-min">
  25. <view>联系电话:</view>
  26. <view>{{subjectData.sysUser.phonenumber}}</view>
  27. </view>
  28. <view class="user-info-box-min" >
  29. <view>学号:</view>
  30. <view>{{subjectData.sysUser.userName}}</view>
  31. </view>
  32. <view class="user-info-box-min">
  33. <view>物理卡号:</view>
  34. <view>{{subjectData.sysUser.cardNum}}</view>
  35. </view>
  36. <view class="user-info-box-min" >
  37. <view>班级:</view>
  38. <view>{{subjectData.sysUser.grade}}</view>
  39. </view>
  40. <view class="user-info-box-min" >
  41. <view>导师:</view>
  42. <view>{{subjectData.sysUser.tutorUserName}}</view>
  43. </view>
  44. </view>
  45. <view v-for="(item,index) in subjectData.listTemp" :key="index" style="overflow: hidden;">
  46. <view class="img-box" v-if="item.materialType==2&&item.relationType==2">
  47. <view class="img-title">安全考试证书</view>
  48. <img v-if="subjectData.listcert[0]" class="item-img-box" :src="subjectData.listcert[0].cert_url">
  49. <view v-if="!subjectData.listcert[0]" style="margin-left:40px;color:#999;font-size:14px;">暂无证书</view>
  50. </view>
  51. <view class="word-box" v-if="item.materialType==1">
  52. <view class="word-box-title">{{item.materialName}}</view>
  53. <view class="word-box-min" v-for="(minItem,minIndex) in item.upList" :key="minIndex" @click="lookItem(minItem)">
  54. <img src="@/images/basicsModules/icon_pdf.png" v-if="minItem.type == 'pdf'">
  55. <img src="@/images/basicsModules/icon_word.png" v-if="minItem.type == 'doc' || minItem.type == 'docx'">
  56. <img :src="configUrl+minItem.url" v-if="minItem.type == 'png' || minItem.type == 'jpg' || minItem.type == 'jpeg' || minItem.type == 'gif'">
  57. <view>{{minItem.name}}</view>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="bottom-button-p" v-if="subjectData.labSecurityApply.auditStatus == 1" @click="bottomButtonClick">重新提交</view>
  62. </view>
  63. </template>
  64. <script>
  65. import { getDetails } from '@/api/apiDemo/index.js'
  66. import { config } from '@/api/request/config.js'
  67. export default {
  68. data() {
  69. return {
  70. pageType:false,
  71. //传参数据
  72. infoData:{},
  73. //获取数据
  74. subjectData:{},
  75. configUrl:config.base_url,
  76. }
  77. },
  78. onLoad(option) {
  79. this.infoData = JSON.parse(decodeURIComponent(option.item));
  80. //修改页面title
  81. uni.setNavigationBarTitle({
  82. title:this.infoData.auditStatus==0?'待审核':(this.infoData.auditStatus==1?'未通过':(this.infoData.auditStatus==2?'已通过':''))
  83. });
  84. },
  85. onShow(){
  86. this.getDetails();
  87. },
  88. methods: {
  89. lookItem(minItem){
  90. console.log("minItem",minItem)
  91. if(minItem.type == 'png' || minItem.type == 'jpg' || minItem.type == 'jpeg' || minItem.type == 'gif'){
  92. //查看图片
  93. wx.previewImage({
  94. urls: [config.base_url+minItem.url], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  95. current: '', // 当前显示图片的http链接,默认是第一个
  96. success: function(res) {},
  97. fail: function(res) {},
  98. complete: function(res) {},
  99. })
  100. }else if(minItem.type == 'pdf' || minItem.type == 'doc' || minItem.type == 'docx'){
  101. uni.showLoading({
  102. title: '下载中'
  103. });
  104. //下载文档
  105. wx.downloadFile({
  106. url: config.base_url+minItem.url,
  107. header: {
  108. Authorization: uni.getStorageSync('token')
  109. },
  110. success: function (res) {
  111. console.log("resresresresresres",res)
  112. const fileManager = wx.getFileSystemManager()
  113. const filePath = wx.env.USER_DATA_PATH + '/' + minItem.name + '.docx'
  114. fileManager.saveFile({
  115. tempFilePath: res.tempFilePath,
  116. filePath,
  117. success: () => {
  118. uni.hideLoading();
  119. wx.openDocument({
  120. filePath: filePath,
  121. showMenu: true,
  122. fileType: minItem.type
  123. })
  124. },
  125. fail: function (res){
  126. uni.hideLoading();
  127. uni.showToast({
  128. title: '下载失败',
  129. icon:"none",
  130. mask:true,
  131. duration: 2000
  132. });
  133. }
  134. })
  135. },
  136. fail: function (res){
  137. uni.hideLoading();
  138. uni.showToast({
  139. title: '下载失败',
  140. icon:"none",
  141. mask:true,
  142. duration: 2000
  143. });
  144. }
  145. })
  146. }
  147. },
  148. //重新提交
  149. bottomButtonClick(){
  150. uni.navigateTo({
  151. url:'/pages_student/accessApplication/newApplication?item='+encodeURIComponent(JSON.stringify(this.subjectData))
  152. });
  153. },
  154. //获取安全准入审批记录详细信息(用户端)
  155. async getDetails() {
  156. let self = this;
  157. const {data} = await getDetails({id:this.infoData.id})
  158. if(data.code==200){
  159. for(let i=0;i<data.data.listTemp.length;i++){
  160. console.log(data.data.listTemp.length)
  161. if(data.data.listTemp[i].materialType == 1){
  162. let maxList = [];
  163. for(let o=0;o<data.data.listTemp[i].listMr.length;o++){
  164. console.log(data.data.listTemp[i].listMr.length)
  165. let bigList = data.data.listTemp[i].listMr[o].dataUrl.split(',');
  166. for(let x=0;x<bigList.length;x++){
  167. console.log(bigList.length)
  168. if(bigList[x]){
  169. let minList = bigList[x].split(';');
  170. let minListTwo = minList[0].split('.')
  171. let obj = {
  172. name:minList[0],
  173. url:minList[1],
  174. type:minListTwo[1]
  175. };
  176. maxList.push(obj);
  177. }
  178. }
  179. }
  180. data.data.listTemp[i].upList = maxList;
  181. console.log('maxList[0].url',maxList);
  182. // self.iframeSrc = window.location.href.split('://')[0]+'://' + process.env.VUE_APP_BASE_FILE_API + '/onlinePreview?url='+encodeURIComponent(btoa(unescape(encodeURIComponent(maxList[0].url))));
  183. }
  184. }
  185. this.$set(this,"subjectData",data.data);
  186. this.pageType = true;
  187. }
  188. }
  189. }
  190. }
  191. </script>
  192. <style lang="stylus" scoped>
  193. #applicationDetails{
  194. height:100%;
  195. width:100%;
  196. overflow-y scroll
  197. .user-info-box{
  198. background #fff;
  199. border-radius:20rpx;
  200. margin:20rpx 20rpx;
  201. padding:20rpx 0;
  202. .user-info-box_title{
  203. font-size: 30rpx;
  204. font-family: PingFang SC;
  205. font-weight: 500;
  206. color: #333333;
  207. line-height: 30rpx;
  208. margin-left: 24rpx
  209. margin-bottom :10px;
  210. >view{
  211. display inline-block;
  212. }
  213. }
  214. .user-info-box-min{
  215. margin:0 26rpx;
  216. display flex;
  217. view{
  218. line-height:66rpx;
  219. font-size:28rpx;
  220. }
  221. view:nth-child(1){
  222. width:140rpx;
  223. color:#999;
  224. }
  225. view:nth-child(2){
  226. flex:1;
  227. text-align right;
  228. color:#333;
  229. }
  230. }
  231. }
  232. .user-card-box{
  233. background #fff;
  234. border-radius:20rpx;
  235. margin:0 20rpx 20rpx;
  236. padding:20rpx 0;
  237. .user-card-title{
  238. padding-left:24rpx;
  239. font-size:30rpx;
  240. font-weight:700;
  241. margin-bottom:20rpx;
  242. }
  243. .user-card-text{
  244. line-height:66rpx;
  245. font-size:28rpx;
  246. color:#999;
  247. padding:0 24rpx;
  248. }
  249. }
  250. .img-box{
  251. background #fff;
  252. border-radius:20rpx;
  253. margin:0 20rpx 20rpx;
  254. padding:20rpx 0;
  255. .img-title{
  256. padding-left:24rpx;
  257. font-size:30rpx;
  258. font-weight:700;
  259. margin-bottom:20rpx;
  260. }
  261. img{
  262. display block;
  263. width:640rpx;
  264. margin:0 auto 10rpx;
  265. }
  266. }
  267. .word-box{
  268. background #fff;
  269. border-radius:20rpx;
  270. margin:0 20rpx 20rpx;
  271. padding:20rpx 0;
  272. .word-box-title{
  273. padding-left:24rpx;
  274. font-size:30rpx;
  275. font-weight:700;
  276. margin-bottom:20rpx;
  277. }
  278. .word-box-min{
  279. display flex;
  280. margin:0 20rpx 20rpx;
  281. img{
  282. height:60rpx;
  283. width:60rpx;
  284. }
  285. view{
  286. margin-left:20rpx;
  287. line-height:60rpx;
  288. }
  289. }
  290. }
  291. .bottom-button-p{
  292. width:650rpx;
  293. height:100rpx;
  294. line-height:100rpx;
  295. text-align center;
  296. border-radius:20rpx;
  297. margin:20rpx 50rpx;
  298. background: #0183fa;
  299. color:#fff;
  300. }
  301. }
  302. </style>