accessQualificationInfo.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. <!-- 准入资格申请详情 -->
  2. <template>
  3. <view id="accessQualificationInfo">
  4. <view class="user-info-box">
  5. <view class="user-info-box-min">
  6. <view>实验室:</view>
  7. <view>{{newData.labSecurityApply.subName}}</view>
  8. </view>
  9. <view class="user-info-box-min">
  10. <view>申请人:</view>
  11. <view>{{newData.labSecurityApply.userName}}</view>
  12. </view>
  13. <view class="user-info-box-min" style="flex-direction: column;">
  14. <view>申请时限:</view>
  15. <view>{{newData.labSecurityApply.validBeginTime}}至{{newData.labSecurityApply.validEndTime}}</view>
  16. </view>
  17. <view class="user-info-box-min">
  18. <view>申请备注:</view>
  19. <view>{{newData.labSecurityApply.applyCause==null?'':newData.labSecurityApply.applyCause}}</view>
  20. </view>
  21. </view>
  22. <view class="user-info-box" style="margin-bottom:20rpx;">
  23. <view class="user-info-box_title">
  24. <view style="color: red;">*</view>身份信息:(关联学生信息材料)
  25. </view>
  26. <view class="user-info-box-min">
  27. <view>申请人:</view>
  28. <view>{{newData.sysUser.userName}}</view>
  29. </view>
  30. <view class="user-info-box-min">
  31. <view>联系电话:</view>
  32. <view>{{newData.sysUser.mobile}}</view>
  33. </view>
  34. <view class="user-info-box-min">
  35. <view>学号:</view>
  36. <view>{{newData.sysUser.account}}</view>
  37. </view>
  38. <!-- <view class="user-info-box-min">
  39. <view>物理卡号:</view>
  40. <view>{{newData.sysUser.cardNum}}</view>
  41. </view> -->
  42. <view class="user-info-box-min" v-if="newData.sysUser.gradeName">
  43. <view>班级:</view>
  44. <view>{{newData.sysUser.gradeName}}</view>
  45. </view>
  46. <view class="user-info-box-min" v-if="newData.sysUser.tutorUserName">
  47. <view>导师:</view>
  48. <view>{{newData.sysUser.tutorUserName}}</view>
  49. </view>
  50. </view>
  51. <view v-for="(item,index) in newData.listTemp" :key="index" style="overflow: hidden;">
  52. <!-- <view class="img-box" v-if="item.materialType==2&&item.relationType==2">
  53. <view class="img-title">安全考试证书</view>
  54. <img v-if="newData.listcert[0]" class="item-img-box" :src="newData.listcert[0].cert_url">
  55. <view v-if="!newData.listcert[0]" style="margin-left:40px;color:#999;font-size:14px;">暂无证书</view>
  56. </view> -->
  57. <view class="word-box" v-if="item.materialType==1">
  58. <view class="word-box-title">{{item.materialName}}</view>
  59. <view class="word-box-min" v-for="(minItem,minIndex) in item.upList" :key="minIndex"
  60. @click="lookItem(minItem)">
  61. <img :src="imagesUrl('commonality/icon_pdf.png')" v-if="minItem.type == 'pdf'">
  62. <img :src="imagesUrl('commonality/icon_word.png')"
  63. v-if="minItem.type == 'doc' || minItem.type == 'docx'">
  64. <img :src="baseUrl+minItem.url"
  65. v-if="minItem.type == 'png' || minItem.type == 'jpg' || minItem.type == 'jpeg' || minItem.type == 'gif'">
  66. <view>{{minItem.name}}</view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="bottom-button-box" v-if="newData.labSecurityApply.auditStatus == 0">
  71. <view @click="goReviewFailed">驳回</view>
  72. <view @click="accessButtonClick">审核通过</view>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. import {
  78. config
  79. } from '@/api/request/config.js'
  80. import {
  81. getDetails,
  82. laboratoryApply
  83. } from '@/api/apiDemo/index.js'
  84. import {
  85. laboratoryAppletGetApplyDetails,
  86. laboratoryAppletEditApp
  87. } from '@/pages_manage/api/index.js'
  88. export default {
  89. data() {
  90. return {
  91. baseUrl: config.base_url,
  92. pageType: false,
  93. //获取数据
  94. subjectData: {},
  95. newData: {},
  96. itemData: {},
  97. type: 0,
  98. applyId: '',
  99. }
  100. },
  101. onLoad(option) {
  102. let self = this;
  103. if (!uni.getStorageSync('token')) {
  104. uni.setStorageSync('manageCation', option.item)
  105. uni.redirectTo({
  106. url: '/pages/views/login/login',
  107. });
  108. }else{
  109. if(uni.getStorageSync('manageCation')){
  110. uni.removeStorageSync('manageCation');
  111. }
  112. this.infoData = JSON.parse(decodeURIComponent(option.item));
  113. this.applyId = JSON.parse(decodeURIComponent(option.item)).applyId;
  114. this.laboratoryAppletGetApplyDetails();
  115. //修改页面title
  116. uni.setNavigationBarTitle({
  117. title: this.infoData.auditStatus == 0 ? '待审核' : (this.infoData.auditStatus == 1 ? '未通过' : (this
  118. .infoData.auditStatus == 2 ? '已通过' : ''))
  119. });
  120. }
  121. },
  122. onShow() {
  123. },
  124. methods: {
  125. //审核按钮
  126. accessButtonClick() {
  127. let self = this;
  128. uni.showModal({
  129. content: '确认审核吗?',
  130. cancelColor: "#999",
  131. confirmColor: "#0183FA",
  132. success: function(res) {
  133. if (res.confirm) {
  134. self.laboratoryAppletEditApp();
  135. } else if (res.cancel) {}
  136. }
  137. });
  138. },
  139. //审核接口
  140. async laboratoryAppletEditApp() {
  141. let obj = {
  142. applyId: this.newData.labSecurityApply.applyId,
  143. auditStatus: 2,
  144. };
  145. const {
  146. data
  147. } = await laboratoryAppletEditApp(obj)
  148. if (data.code == 200) {
  149. uni.showToast({
  150. title: '审核成功',
  151. icon: "none",
  152. mask: true,
  153. duration: 2000
  154. });
  155. setTimeout(function() {
  156. uni.navigateBack();
  157. }, 2000);
  158. }
  159. },
  160. lookItem(minItem) {
  161. let self = this;
  162. if (minItem.type == 'png' || minItem.type == 'jpg' || minItem.type == 'jpeg' || minItem.type == 'gif') {
  163. //查看图片
  164. wx.previewImage({
  165. urls: [self.baseUrl + minItem.url], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  166. current: '', // 当前显示图片的http链接,默认是第一个
  167. success: function(res) {},
  168. fail: function(res) {},
  169. complete: function(res) {},
  170. })
  171. } else if (minItem.type == 'pdf' || minItem.type == 'doc' || minItem.type == 'docx') {
  172. uni.showLoading({
  173. title: '下载中'
  174. });
  175. console.log(self.baseUrl + '/' + minItem.name)
  176. console.log(minItem.url)
  177. //下载文档
  178. wx.downloadFile({
  179. url: self.baseUrl+minItem.url,
  180. header: {
  181. Authorization: uni.getStorageSync('token')
  182. },
  183. success: function(res) {
  184. const fileManager = wx.getFileSystemManager()
  185. const filePath = wx.env.USER_DATA_PATH + '/' + minItem.name
  186. fileManager.saveFile({
  187. tempFilePath: res.tempFilePath,
  188. filePath,
  189. success: () => {
  190. uni.hideLoading();
  191. wx.openDocument({
  192. filePath: filePath,
  193. showMenu: true,
  194. fileType: minItem.type
  195. })
  196. },
  197. fail: function(res) {
  198. uni.hideLoading();
  199. uni.showToast({
  200. title: '下载失败',
  201. icon: "none",
  202. mask: true,
  203. duration: 2000
  204. });
  205. }
  206. })
  207. },
  208. fail: function(res) {
  209. uni.hideLoading();
  210. uni.showToast({
  211. title: '下载失败',
  212. icon: "none",
  213. mask: true,
  214. duration: 2000
  215. });
  216. }
  217. })
  218. }
  219. },
  220. goReviewFailed() {
  221. let obj = {
  222. applyId: this.newData.labSecurityApply.applyId,
  223. rejectCause: this.newData.listTemp,
  224. }
  225. uni.navigateTo({
  226. url: '/pages_manage/views/accessQualification/approve?item=' + encodeURIComponent(JSON.stringify(
  227. obj))
  228. })
  229. },
  230. //查看图片
  231. lockImg(list) {
  232. if (!list[0]) {
  233. return
  234. }
  235. wx.previewImage({
  236. urls: list, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  237. current: '', // 当前显示图片的http链接,默认是第一个
  238. success: function(res) {},
  239. fail: function(res) {},
  240. complete: function(res) {},
  241. })
  242. },
  243. //审核信息详情
  244. async laboratoryAppletGetApplyDetails() {
  245. const {
  246. data
  247. } = await laboratoryAppletGetApplyDetails({
  248. applyId: this.applyId
  249. })
  250. if (data.code == 200) {
  251. let self = this;
  252. let dataList = [];
  253. for (let i = 0; i < data.data.listTemp.length; i++) {
  254. if (data.data.listTemp[i].materialType == 2 && data.data.listTemp[i].materialType == 2) {
  255. dataList.unshift(data.data.listTemp[i]);
  256. }
  257. }
  258. for (let i = 0; i < data.data.listTemp.length; i++) {
  259. if (data.data.listTemp[i].materialType == 1) {
  260. dataList.push(data.data.listTemp[i]);
  261. }
  262. }
  263. for (let i = 0; i < data.data.listTemp.length; i++) {
  264. if (data.data.listTemp[i].materialType == 2 && data.data.listTemp[i].materialType == 1) {
  265. dataList.unshift(data.data.listTemp[i]);
  266. }
  267. }
  268. this.$set(data.data, 'listTemp', dataList);
  269. let newList = [];
  270. for (let i = 0; i < data.data.listTemp.length; i++) {
  271. if (data.data.listTemp[i].materialType == 1) {
  272. let maxList = [];
  273. for (let o = 0; o < data.data.listTemp[i].listMr.length; o++) {
  274. let bigList = data.data.listTemp[i].listMr[o].dataUrl.split(',');
  275. for (let x = 0; x < bigList.length; x++) {
  276. if (bigList[x]) {
  277. let minList = bigList[x].split(';');
  278. let typeList = minList[0].split('.');
  279. let obj = {
  280. name: minList[0],
  281. url: minList[1],
  282. type: typeList[1],
  283. };
  284. maxList.push(obj);
  285. }
  286. }
  287. }
  288. data.data.listTemp[i].upList = maxList;
  289. let obj = {};
  290. if (maxList.length > 0) {
  291. obj = {
  292. forIndex: 0,
  293. url: self.baseUrl + maxList[0].url
  294. }
  295. }
  296. newList.push(obj);
  297. } else {
  298. let obj = {
  299. forIndex: "",
  300. url: ""
  301. }
  302. newList.push(obj);
  303. }
  304. }
  305. this.$set(this, 'newData', data.data)
  306. console.log(this.newData)
  307. }
  308. },
  309. }
  310. }
  311. </script>
  312. <style lang="stylus" scoped>
  313. #accessQualificationInfo {
  314. height: 100%;
  315. overflow-y scroll;
  316. .user-info-box {
  317. background #fff;
  318. border-radius: 20rpx;
  319. margin: 20rpx 20rpx 0;
  320. padding: 20rpx 0;
  321. .user-info-box_title {
  322. font-size: 30rpx;
  323. font-family: PingFang SC;
  324. font-weight: 500;
  325. color: #333333;
  326. line-height: 30rpx;
  327. margin-left: 24rpx;
  328. margin-bottom:10px;
  329. >view {
  330. display inline-block;
  331. }
  332. }
  333. .user-info-box-min {
  334. margin: 0 26rpx;
  335. display flex;
  336. view {
  337. line-height: 66rpx;
  338. font-size: 28rpx;
  339. }
  340. view:nth-child(1) {
  341. width: 140rpx;
  342. color: #999;
  343. }
  344. view:nth-child(2) {
  345. flex: 1;
  346. text-align right;
  347. color: #333;
  348. }
  349. }
  350. }
  351. .user-card-box {
  352. background #fff;
  353. border-radius: 20rpx;
  354. margin: 0 20rpx 20rpx;
  355. padding: 20rpx 0;
  356. .user-card-title {
  357. padding-left: 24rpx;
  358. font-size: 30rpx;
  359. font-weight: 700;
  360. margin-bottom: 20rpx;
  361. }
  362. .user-card-text {
  363. line-height: 66rpx;
  364. font-size: 28rpx;
  365. color: #999;
  366. padding: 0 24rpx;
  367. }
  368. }
  369. .img-box {
  370. background #fff;
  371. border-radius: 20rpx;
  372. margin: 0 20rpx 20rpx;
  373. padding: 20rpx 0;
  374. .img-title {
  375. padding-left: 24rpx;
  376. font-size: 30rpx;
  377. font-weight: 700;
  378. margin-bottom: 20rpx;
  379. }
  380. img {
  381. display block;
  382. width: 640rpx;
  383. margin: 0 auto 10rpx;
  384. }
  385. }
  386. .word-box {
  387. background #fff;
  388. border-radius: 20rpx;
  389. margin: 0 20rpx 20rpx;
  390. padding: 20rpx 0;
  391. .word-box-title {
  392. padding-left: 24rpx;
  393. font-size: 30rpx;
  394. font-weight: 700;
  395. margin-bottom: 20rpx;
  396. }
  397. .word-box-min {
  398. display flex;
  399. margin: 0 20rpx 20rpx;
  400. img {
  401. height: 60rpx;
  402. width: 60rpx;
  403. }
  404. view {
  405. margin-left: 20rpx;
  406. line-height: 60rpx;
  407. }
  408. }
  409. }
  410. .bottom-button-box {
  411. display flex;
  412. width: 650rpx;
  413. margin: 40rpx auto;
  414. view {
  415. height: 100rpx;
  416. text-align center;
  417. line-height: 100rpx;
  418. color: #fff;
  419. width: 325rpx;
  420. }
  421. view:nth-child(1) {
  422. background: linear-gradient(-45deg, #FA9901, #F28E26);
  423. border-radius: 50rpx 0 0 50rpx;
  424. }
  425. view:nth-child(2) {
  426. background: linear-gradient(-35deg, #309CFF, #0183FA);
  427. border-radius: 0 50rpx 50rpx 0;
  428. }
  429. }
  430. }
  431. </style>