applicationDetails.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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}}
  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.nickName}}</view>
  26. </view>
  27. <view class="user-info-box-min">
  28. <view>联系电话:</view>
  29. <view>{{subjectData.sysUser.phonenumber}}</view>
  30. </view>
  31. <view class="user-info-box-min">
  32. <view>学号:</view>
  33. <view>{{subjectData.sysUser.userName}}</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">
  40. <view>班级:</view>
  41. <view>{{subjectData.sysUser.grade}}</view>
  42. </view>
  43. <view class="user-info-box-min">
  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="@/images/basicsModules/icon_pdf.png" v-if="minItem.type == 'pdf'">
  59. <img src="@/images/basicsModules/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. this.infoData = JSON.parse(decodeURIComponent(option.item));
  91. //修改页面title
  92. uni.setNavigationBarTitle({
  93. title: this.infoData.auditStatus == 0 ? '待审核' : (this.infoData.auditStatus == 1 ? '未通过' : (this
  94. .infoData.auditStatus == 2 ? '已通过' : ''))
  95. });
  96. },
  97. onShow() {
  98. this.getDetails();
  99. },
  100. methods: {
  101. lookItem(minItem) {
  102. console.log("minItem", minItem)
  103. if (minItem.type == 'png' || minItem.type == 'jpg' || minItem.type == 'jpeg' || minItem.type == 'gif') {
  104. //查看图片
  105. wx.previewImage({
  106. urls: [config.base_url + minItem.url], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  107. current: '', // 当前显示图片的http链接,默认是第一个
  108. success: function(res) {},
  109. fail: function(res) {},
  110. complete: function(res) {},
  111. })
  112. } else if (minItem.type == 'pdf' || minItem.type == 'doc' || minItem.type == 'docx') {
  113. uni.showLoading({
  114. title: '下载中'
  115. });
  116. //下载文档
  117. wx.downloadFile({
  118. url: config.base_url + minItem.url,
  119. header: {
  120. Authorization: uni.getStorageSync('token')
  121. },
  122. success: function(res) {
  123. console.log("resresresresresres", res)
  124. const fileManager = wx.getFileSystemManager()
  125. const filePath = wx.env.USER_DATA_PATH + '/' + minItem.name + '.docx'
  126. fileManager.saveFile({
  127. tempFilePath: res.tempFilePath,
  128. filePath,
  129. success: () => {
  130. uni.hideLoading();
  131. wx.openDocument({
  132. filePath: filePath,
  133. showMenu: true,
  134. fileType: minItem.type
  135. })
  136. },
  137. fail: function(res) {
  138. uni.hideLoading();
  139. uni.showToast({
  140. title: '下载失败',
  141. icon: "none",
  142. mask: true,
  143. duration: 2000
  144. });
  145. }
  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. },
  160. //重新提交
  161. bottomButtonClick() {
  162. uni.navigateTo({
  163. url: '/pages_student/accessApplication/newApplication?item=' + encodeURIComponent(JSON
  164. .stringify(this.subjectData))
  165. });
  166. },
  167. //获取安全准入审批记录详细信息(用户端)
  168. async getDetails() {
  169. let self = this;
  170. const {
  171. data
  172. } = await getDetails({
  173. id: this.infoData.id
  174. })
  175. if (data.code == 200) {
  176. for (let i = 0; i < data.data.listTemp.length; i++) {
  177. console.log(data.data.listTemp.length)
  178. if (data.data.listTemp[i].materialType == 1) {
  179. let maxList = [];
  180. for (let o = 0; o < data.data.listTemp[i].listMr.length; o++) {
  181. console.log(data.data.listTemp[i].listMr.length)
  182. let bigList = data.data.listTemp[i].listMr[o].dataUrl.split(',');
  183. for (let x = 0; x < bigList.length; x++) {
  184. console.log(bigList.length)
  185. if (bigList[x]) {
  186. let minList = bigList[x].split(';');
  187. let minListTwo = minList[0].split('.')
  188. let obj = {
  189. name: minList[0],
  190. url: minList[1],
  191. type: minListTwo[1]
  192. };
  193. maxList.push(obj);
  194. }
  195. }
  196. }
  197. data.data.listTemp[i].upList = maxList;
  198. console.log('maxList[0].url', maxList);
  199. // self.iframeSrc = window.location.href.split('://')[0]+'://' + process.env.VUE_APP_BASE_FILE_API + '/onlinePreview?url='+encodeURIComponent(btoa(unescape(encodeURIComponent(maxList[0].url))));
  200. }
  201. }
  202. this.$set(this, "subjectData", data.data);
  203. this.pageType = true;
  204. }
  205. }
  206. }
  207. }
  208. </script>
  209. <style lang="stylus" scoped>
  210. #applicationDetails {
  211. height: 100%;
  212. width: 100%;
  213. overflow-y scroll;
  214. .user-info-box {
  215. background #fff;
  216. border-radius: 20rpx;
  217. margin: 20rpx 20rpx;
  218. padding: 20rpx 0;
  219. .user-info-box_title {
  220. font-size: 30rpx;
  221. font-family: PingFang SC;
  222. font-weight: 500;
  223. color: #333333;
  224. line-height: 30rpx;
  225. margin-left: 24rpx;
  226. margin-bottom: 10px;
  227. >view {
  228. display inline-block;
  229. }
  230. }
  231. .user-info-box-min {
  232. margin: 0 26rpx;
  233. display flex;
  234. view {
  235. line-height: 66rpx;
  236. font-size: 28rpx;
  237. }
  238. view:nth-child(1) {
  239. width: 140rpx;
  240. color: #999;
  241. }
  242. view:nth-child(2) {
  243. flex: 1;
  244. text-align right;
  245. color: #333;
  246. }
  247. }
  248. }
  249. .user-card-box {
  250. background #fff;
  251. border-radius: 20rpx;
  252. margin: 0 20rpx 20rpx;
  253. padding: 20rpx 0;
  254. .user-card-title {
  255. padding-left: 24rpx;
  256. font-size: 30rpx;
  257. font-weight: 700;
  258. margin-bottom: 20rpx;
  259. }
  260. .user-card-text {
  261. line-height: 66rpx;
  262. font-size: 28rpx;
  263. color: #999;
  264. padding: 0 24rpx;
  265. }
  266. }
  267. .img-box {
  268. background #fff;
  269. border-radius: 20rpx;
  270. margin: 0 20rpx 20rpx;
  271. padding: 20rpx 0;
  272. .img-title {
  273. padding-left: 24rpx;
  274. font-size: 30rpx;
  275. font-weight: 700;
  276. margin-bottom: 20rpx;
  277. }
  278. img {
  279. display block;
  280. width: 640rpx;
  281. margin: 0 auto 10rpx;
  282. }
  283. }
  284. .word-box {
  285. background #fff;
  286. border-radius: 20rpx;
  287. margin: 0 20rpx 20rpx;
  288. padding: 20rpx 0;
  289. .word-box-title {
  290. padding-left: 24rpx;
  291. font-size: 30rpx;
  292. font-weight: 700;
  293. margin-bottom: 20rpx;
  294. }
  295. .word-box-min {
  296. display flex;
  297. margin: 0 20rpx 20rpx;
  298. img {
  299. height: 60rpx;
  300. width: 60rpx;
  301. }
  302. view {
  303. margin-left: 20rpx;
  304. line-height: 60rpx;
  305. }
  306. }
  307. }
  308. .bottom-button-p {
  309. width: 650rpx;
  310. height: 100rpx;
  311. line-height: 100rpx;
  312. text-align center;
  313. border-radius: 20rpx;
  314. margin: 20rpx 50rpx;
  315. background: #0183fa;
  316. color: #fff;
  317. }
  318. }
  319. </style>