accessQualificationInfo.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. <!-- 准入资格申请详情 -->
  2. <template>
  3. <view id="accessQualificationInfo" v-show="showType">
  4. <view class="user-info-box">
  5. <view class="user-info-box-min">
  6. <view>实验室:</view>
  7. <view>{{newData.labSecurityApply.subName}}{{newData.labSecurityApply.roomNum?'('+newData.labSecurityApply.roomNum+')':''}}</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. showType:false,
  100. }
  101. },
  102. onLoad(option) {
  103. let self = this;
  104. if (!uni.getStorageSync('token')) {
  105. uni.setStorageSync('manageCation', option.item)
  106. uni.redirectTo({
  107. url: '/pages/views/login/login',
  108. });
  109. }else{
  110. if(uni.getStorageSync('manageCation')){
  111. uni.removeStorageSync('manageCation');
  112. }
  113. this.infoData = JSON.parse(decodeURIComponent(option.item));
  114. this.applyId = JSON.parse(decodeURIComponent(option.item)).applyId;
  115. this.laboratoryAppletGetApplyDetails();
  116. //修改页面title
  117. uni.setNavigationBarTitle({
  118. title: this.infoData.auditStatus == 0 ? '待审核' : (this.infoData.auditStatus == 1 ? '未通过' : (this
  119. .infoData.auditStatus == 2 ? '已通过' : ''))
  120. });
  121. }
  122. },
  123. onShow() {
  124. },
  125. methods: {
  126. //审核按钮
  127. accessButtonClick() {
  128. let self = this;
  129. uni.showModal({
  130. content: '确认审核吗?',
  131. cancelColor: "#999",
  132. confirmColor: "#0183FA",
  133. success: function(res) {
  134. if (res.confirm) {
  135. self.laboratoryAppletEditApp();
  136. } else if (res.cancel) {}
  137. }
  138. });
  139. },
  140. //审核接口
  141. async laboratoryAppletEditApp() {
  142. let obj = {
  143. applyId: this.newData.labSecurityApply.applyId,
  144. auditStatus: 2,
  145. };
  146. const {
  147. data
  148. } = await laboratoryAppletEditApp(obj)
  149. if (data.code == 200) {
  150. uni.showToast({
  151. title: '审核成功',
  152. icon: "none",
  153. mask: true,
  154. duration: 2000
  155. });
  156. let homeType = false;
  157. let list = getCurrentPages();
  158. if(list[1]){
  159. homeType = true;
  160. }
  161. // for(let i=0;i<list.length;i++){
  162. // if(list[i].route.indexOf('home') != -1){
  163. // homeType = true;
  164. // }
  165. // }
  166. if(homeType){
  167. setTimeout(function() {
  168. uni.navigateBack();
  169. }, 2000);
  170. }else{
  171. setTimeout(function() {
  172. uni.reLaunch({
  173. url: '/pages_manage/views/accessQualification/accessQualification',
  174. });
  175. }, 2000);
  176. }
  177. }
  178. },
  179. lookItem(minItem) {
  180. let self = this;
  181. if (minItem.type == 'png' || minItem.type == 'jpg' || minItem.type == 'jpeg' || minItem.type == 'gif') {
  182. //查看图片
  183. wx.previewImage({
  184. urls: [self.baseUrl + minItem.url], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  185. current: '', // 当前显示图片的http链接,默认是第一个
  186. success: function(res) {},
  187. fail: function(res) {},
  188. complete: function(res) {},
  189. })
  190. } else if (minItem.type == 'pdf' || minItem.type == 'doc' || minItem.type == 'docx') {
  191. uni.showLoading({
  192. title: '下载中'
  193. });
  194. console.log(self.baseUrl + '/' + minItem.name)
  195. console.log(minItem.url)
  196. //下载文档
  197. wx.downloadFile({
  198. url: self.baseUrl+minItem.url,
  199. header: {
  200. Authorization: uni.getStorageSync('token')
  201. },
  202. success: function(res) {
  203. const fileManager = wx.getFileSystemManager()
  204. const filePath = wx.env.USER_DATA_PATH + '/' + minItem.name
  205. fileManager.saveFile({
  206. tempFilePath: res.tempFilePath,
  207. filePath,
  208. success: () => {
  209. uni.hideLoading();
  210. wx.openDocument({
  211. filePath: filePath,
  212. showMenu: true,
  213. fileType: minItem.type
  214. })
  215. },
  216. fail: function(res) {
  217. uni.hideLoading();
  218. uni.showToast({
  219. title: '下载失败',
  220. icon: "none",
  221. mask: true,
  222. duration: 2000
  223. });
  224. }
  225. })
  226. },
  227. fail: function(res) {
  228. uni.hideLoading();
  229. uni.showToast({
  230. title: '下载失败',
  231. icon: "none",
  232. mask: true,
  233. duration: 2000
  234. });
  235. }
  236. })
  237. }
  238. },
  239. goReviewFailed() {
  240. let obj = {
  241. applyId: this.newData.labSecurityApply.applyId,
  242. rejectCause: this.newData.listTemp,
  243. }
  244. uni.navigateTo({
  245. url: '/pages_manage/views/accessQualification/approve?item=' + encodeURIComponent(JSON.stringify(
  246. obj))
  247. })
  248. },
  249. //查看图片
  250. lockImg(list) {
  251. if (!list[0]) {
  252. return
  253. }
  254. wx.previewImage({
  255. urls: list, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  256. current: '', // 当前显示图片的http链接,默认是第一个
  257. success: function(res) {},
  258. fail: function(res) {},
  259. complete: function(res) {},
  260. })
  261. },
  262. //审核信息详情
  263. async laboratoryAppletGetApplyDetails() {
  264. const {
  265. data
  266. } = await laboratoryAppletGetApplyDetails({
  267. applyId: this.applyId
  268. })
  269. if (data.code == 200) {
  270. let self = this;
  271. //判断链接跳转逻辑
  272. let homeType = false;
  273. let list = getCurrentPages();
  274. if(list[1]){
  275. homeType = true;
  276. }
  277. // for(let i=0;i<list.length;i++){
  278. // if(list[i].route.indexOf('home') != -1){
  279. // homeType = true;
  280. // }
  281. // }
  282. if(!homeType){
  283. if(data.data.labSecurityApply.auditStatus != 0){
  284. uni.showToast({
  285. title: '该申请已审核!',
  286. icon: "none",
  287. mask: true,
  288. duration: 2000
  289. });
  290. setTimeout(function() {
  291. uni.reLaunch({
  292. url: '/pages_manage/views/accessQualification/accessQualification',
  293. });
  294. }, 2000);
  295. return
  296. }
  297. }
  298. let dataList = [];
  299. for (let i = 0; i < data.data.listTemp.length; i++) {
  300. if (data.data.listTemp[i].materialType == 2 && data.data.listTemp[i].materialType == 2) {
  301. dataList.unshift(data.data.listTemp[i]);
  302. }
  303. }
  304. for (let i = 0; i < data.data.listTemp.length; i++) {
  305. if (data.data.listTemp[i].materialType == 1) {
  306. dataList.push(data.data.listTemp[i]);
  307. }
  308. }
  309. for (let i = 0; i < data.data.listTemp.length; i++) {
  310. if (data.data.listTemp[i].materialType == 2 && data.data.listTemp[i].materialType == 1) {
  311. dataList.unshift(data.data.listTemp[i]);
  312. }
  313. }
  314. this.$set(data.data, 'listTemp', dataList);
  315. let newList = [];
  316. for (let i = 0; i < data.data.listTemp.length; i++) {
  317. if (data.data.listTemp[i].materialType == 1) {
  318. let maxList = [];
  319. for (let o = 0; o < data.data.listTemp[i].listMr.length; o++) {
  320. let bigList = data.data.listTemp[i].listMr[o].dataUrl.split(',');
  321. for (let x = 0; x < bigList.length; x++) {
  322. if (bigList[x]) {
  323. let minList = bigList[x].split(';');
  324. let typeList = minList[0].split('.');
  325. let obj = {
  326. name: minList[0],
  327. url: minList[1],
  328. type: typeList[1],
  329. };
  330. maxList.push(obj);
  331. }
  332. }
  333. }
  334. data.data.listTemp[i].upList = maxList;
  335. let obj = {};
  336. if (maxList.length > 0) {
  337. obj = {
  338. forIndex: 0,
  339. url: self.baseUrl + maxList[0].url
  340. }
  341. }
  342. newList.push(obj);
  343. } else {
  344. let obj = {
  345. forIndex: "",
  346. url: ""
  347. }
  348. newList.push(obj);
  349. }
  350. }
  351. this.$set(this, 'newData', data.data)
  352. this.$set(this, 'showType', true)
  353. }
  354. },
  355. }
  356. }
  357. </script>
  358. <style lang="stylus" scoped>
  359. #accessQualificationInfo {
  360. height: 100%;
  361. overflow-y scroll;
  362. .user-info-box {
  363. background #fff;
  364. border-radius: 20rpx;
  365. margin: 20rpx 20rpx 0;
  366. padding: 20rpx 0;
  367. .user-info-box_title {
  368. font-size: 30rpx;
  369. font-family: PingFang SC;
  370. font-weight: 500;
  371. color: #333333;
  372. line-height: 30rpx;
  373. margin-left: 24rpx;
  374. margin-bottom:10px;
  375. >view {
  376. display inline-block;
  377. }
  378. }
  379. .user-info-box-min {
  380. margin: 0 26rpx;
  381. display flex;
  382. view {
  383. line-height: 66rpx;
  384. font-size: 28rpx;
  385. }
  386. view:nth-child(1) {
  387. width: 140rpx;
  388. color: #999;
  389. }
  390. view:nth-child(2) {
  391. flex: 1;
  392. text-align right;
  393. color: #333;
  394. }
  395. }
  396. }
  397. .user-card-box {
  398. background #fff;
  399. border-radius: 20rpx;
  400. margin: 0 20rpx 20rpx;
  401. padding: 20rpx 0;
  402. .user-card-title {
  403. padding-left: 24rpx;
  404. font-size: 30rpx;
  405. font-weight: 700;
  406. margin-bottom: 20rpx;
  407. }
  408. .user-card-text {
  409. line-height: 66rpx;
  410. font-size: 28rpx;
  411. color: #999;
  412. padding: 0 24rpx;
  413. }
  414. }
  415. .img-box {
  416. background #fff;
  417. border-radius: 20rpx;
  418. margin: 0 20rpx 20rpx;
  419. padding: 20rpx 0;
  420. .img-title {
  421. padding-left: 24rpx;
  422. font-size: 30rpx;
  423. font-weight: 700;
  424. margin-bottom: 20rpx;
  425. }
  426. img {
  427. display block;
  428. width: 640rpx;
  429. margin: 0 auto 10rpx;
  430. }
  431. }
  432. .word-box {
  433. background #fff;
  434. border-radius: 20rpx;
  435. margin: 0 20rpx 20rpx;
  436. padding: 20rpx 0;
  437. .word-box-title {
  438. padding-left: 24rpx;
  439. font-size: 30rpx;
  440. font-weight: 700;
  441. margin-bottom: 20rpx;
  442. }
  443. .word-box-min {
  444. display flex;
  445. margin: 0 20rpx 20rpx;
  446. img {
  447. height: 60rpx;
  448. width: 60rpx;
  449. }
  450. view {
  451. margin-left: 20rpx;
  452. line-height: 60rpx;
  453. }
  454. }
  455. }
  456. .bottom-button-box {
  457. display flex;
  458. width: 650rpx;
  459. margin: 40rpx auto;
  460. view {
  461. height: 100rpx;
  462. text-align center;
  463. line-height: 100rpx;
  464. color: #fff;
  465. width: 325rpx;
  466. }
  467. view:nth-child(1) {
  468. background: linear-gradient(-45deg, #FA9901, #F28E26);
  469. border-radius: 50rpx 0 0 50rpx;
  470. }
  471. view:nth-child(2) {
  472. background: linear-gradient(-35deg, #309CFF, #0183FA);
  473. border-radius: 0 50rpx 50rpx 0;
  474. }
  475. }
  476. }
  477. </style>