applicationDetails.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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.subName}}</view>
  8. </view>
  9. <view class="user-info-box-min" style="flex-direction: column;">
  10. <view>申请时限:</view>
  11. <view>{{subjectData.labSecurityApply.validBeginTime}}至{{subjectData.labSecurityApply.validEndTime}}
  12. </view>
  13. </view>
  14. <view class="user-info-box-min">
  15. <view>申请备注:</view>
  16. <view>{{subjectData.labSecurityApply.applyCause}}</view>
  17. </view>
  18. </view>
  19. <view class="user-info-box">
  20. <view class="user-info-box_title">
  21. <view style="color: red;">*</view>身份信息:(关联学生信息材料)
  22. </view>
  23. <view class="user-info-box-min">
  24. <view>申请人:</view>
  25. <view>{{subjectData.sysUser.userName}}</view>
  26. </view>
  27. <view class="user-info-box-min">
  28. <view>联系电话:</view>
  29. <view>{{subjectData.sysUser.mobile}}</view>
  30. </view>
  31. <view class="user-info-box-min">
  32. <view>学号:</view>
  33. <view>{{subjectData.sysUser.account}}</view>
  34. </view>
  35. <!-- <view class="user-info-box-min">
  36. <view>物理卡号:</view>
  37. <view>{{subjectData.sysUser.cardNum}}</view>
  38. </view> -->
  39. <view class="user-info-box-min" v-if="subjectData.sysUser.gradeName">
  40. <view>班级:</view>
  41. <view>{{subjectData.sysUser.gradeName}}</view>
  42. </view>
  43. <view class="user-info-box-min" v-if="subjectData.sysUser.tutorUserName">
  44. <view>导师:</view>
  45. <view>{{subjectData.sysUser.tutorUserName}}</view>
  46. </view>
  47. </view>
  48. <view v-for="(item,index) in subjectData.listTemp" :key="index" style="overflow: hidden;">
  49. <view class="img-box" v-if="item.materialType==2&&item.relationType==2">
  50. <view class="img-title">安全考试证书</view>
  51. <img v-if="subjectData.listcert[0]" class="item-img-box" :src="subjectData.listcert[0].cert_url">
  52. <view v-if="!subjectData.listcert[0]" style="margin-left:40px;color:#999;font-size:14px;">暂无证书</view>
  53. </view>
  54. <view class="word-box" v-if="item.materialType==1">
  55. <view class="word-box-title">{{item.materialName}}</view>
  56. <view class="word-box-min" v-for="(minItem,minIndex) in item.upList" :key="minIndex"
  57. @click="lookItem(minItem)">
  58. <img :src="imagesUrl('commonality/icon_pdf.png')" v-if="minItem.type == 'pdf'">
  59. <img :src="imagesUrl('commonality/icon_word.png')"
  60. v-if="minItem.type == 'doc' || minItem.type == 'docx'">
  61. <img :src="configUrl+minItem.url"
  62. v-if="minItem.type == 'png' || minItem.type == 'jpg' || minItem.type == 'jpeg' || minItem.type == 'gif'">
  63. <view>{{minItem.name}}</view>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="bottom-button-p" v-if="subjectData.labSecurityApply.auditStatus == 1" @click="bottomButtonClick">
  68. 重新提交</view>
  69. </view>
  70. </template>
  71. <script>
  72. import {
  73. getDetails
  74. } from '@/api/apiDemo/index.js'
  75. import {
  76. config
  77. } from '@/api/request/config.js'
  78. export default {
  79. data() {
  80. return {
  81. pageType: false,
  82. //传参数据
  83. infoData: {},
  84. //获取数据
  85. subjectData: {},
  86. configUrl: config.base_url,
  87. }
  88. },
  89. onLoad(option) {
  90. let self = this;
  91. if (!uni.getStorageSync('token')) {
  92. uni.setStorageSync('studentCation', option.item)
  93. uni.redirectTo({
  94. url: '/pages/views/login/login',
  95. });
  96. }else{
  97. if(uni.getStorageSync('studentCation')){
  98. uni.removeStorageSync('studentCation');
  99. }
  100. this.infoData = JSON.parse(decodeURIComponent(option.item));
  101. //修改页面title
  102. uni.setNavigationBarTitle({
  103. title: this.infoData.auditStatus == 0 ? '待审核' : (this.infoData.auditStatus == 1 ? '未通过' : (this
  104. .infoData.auditStatus == 2 ? '已通过' : ''))
  105. });
  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/views/accessApplication/newApplication?item=' + encodeURIComponent(JSON
  175. .stringify(this.subjectData))
  176. });
  177. },
  178. //获取安全准入审批记录详细信息(用户端)
  179. async getDetails() {
  180. let self = this;
  181. const {
  182. data
  183. } = await getDetails({
  184. id: this.infoData.applyId
  185. })
  186. if (data.code == 200) {
  187. for (let i = 0; i < data.data.listTemp.length; i++) {
  188. console.log(data.data.listTemp.length)
  189. if (data.data.listTemp[i].materialType == 1) {
  190. let maxList = [];
  191. for (let o = 0; o < data.data.listTemp[i].listMr.length; o++) {
  192. console.log(data.data.listTemp[i].listMr.length)
  193. let bigList = data.data.listTemp[i].listMr[o].dataUrl.split(',');
  194. for (let x = 0; x < bigList.length; x++) {
  195. console.log(bigList.length)
  196. if (bigList[x]) {
  197. let minList = bigList[x].split(';');
  198. let minListTwo = minList[0].split('.')
  199. let obj = {
  200. name: minList[0],
  201. url: minList[1],
  202. type: minListTwo[1]
  203. };
  204. maxList.push(obj);
  205. }
  206. }
  207. }
  208. data.data.listTemp[i].upList = maxList;
  209. // console.log('maxList[0].url', maxList);
  210. // self.iframeSrc = window.location.href.split('://')[0]+'://' + process.env.VUE_APP_BASE_FILE_API + '/onlinePreview?url='+encodeURIComponent(btoa(unescape(encodeURIComponent(maxList[0].url))));
  211. }
  212. }
  213. this.$set(this, "subjectData", data.data);
  214. this.pageType = true;
  215. }
  216. }
  217. }
  218. }
  219. </script>
  220. <style lang="stylus" scoped>
  221. #applicationDetails {
  222. height: 100%;
  223. width: 100%;
  224. overflow-y scroll;
  225. .user-info-box {
  226. background #fff;
  227. border-radius: 20rpx;
  228. margin: 20rpx 20rpx;
  229. padding: 20rpx 0;
  230. .user-info-box_title {
  231. font-size: 30rpx;
  232. font-family: PingFang SC;
  233. font-weight: 500;
  234. color: #333333;
  235. line-height: 30rpx;
  236. margin-left: 24rpx;
  237. margin-bottom: 10px;
  238. >view {
  239. display inline-block;
  240. }
  241. }
  242. .user-info-box-min {
  243. margin: 0 26rpx;
  244. display flex;
  245. view {
  246. line-height: 66rpx;
  247. font-size: 28rpx;
  248. }
  249. view:nth-child(1) {
  250. width: 140rpx;
  251. color: #999;
  252. }
  253. view:nth-child(2) {
  254. flex: 1;
  255. text-align right;
  256. color: #333;
  257. }
  258. }
  259. }
  260. .user-card-box {
  261. background #fff;
  262. border-radius: 20rpx;
  263. margin: 0 20rpx 20rpx;
  264. padding: 20rpx 0;
  265. .user-card-title {
  266. padding-left: 24rpx;
  267. font-size: 30rpx;
  268. font-weight: 700;
  269. margin-bottom: 20rpx;
  270. }
  271. .user-card-text {
  272. line-height: 66rpx;
  273. font-size: 28rpx;
  274. color: #999;
  275. padding: 0 24rpx;
  276. }
  277. }
  278. .img-box {
  279. background #fff;
  280. border-radius: 20rpx;
  281. margin: 0 20rpx 20rpx;
  282. padding: 20rpx 0;
  283. .img-title {
  284. padding-left: 24rpx;
  285. font-size: 30rpx;
  286. font-weight: 700;
  287. margin-bottom: 20rpx;
  288. }
  289. img {
  290. display block;
  291. width: 640rpx;
  292. margin: 0 auto 10rpx;
  293. }
  294. }
  295. .word-box {
  296. background #fff;
  297. border-radius: 20rpx;
  298. margin: 0 20rpx 20rpx;
  299. padding: 20rpx 0;
  300. .word-box-title {
  301. padding-left: 24rpx;
  302. font-size: 30rpx;
  303. font-weight: 700;
  304. margin-bottom: 20rpx;
  305. }
  306. .word-box-min {
  307. display flex;
  308. margin: 0 20rpx 20rpx;
  309. img {
  310. height: 60rpx;
  311. width: 60rpx;
  312. }
  313. view {
  314. margin-left: 20rpx;
  315. line-height: 60rpx;
  316. }
  317. }
  318. }
  319. .bottom-button-p {
  320. width: 650rpx;
  321. height: 100rpx;
  322. line-height: 100rpx;
  323. text-align center;
  324. border-radius: 20rpx;
  325. margin: 20rpx 50rpx;
  326. background: #0183fa;
  327. color: #fff;
  328. }
  329. }
  330. </style>