applicationDetails.vue 10 KB

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