accessQualificationInfo.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  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}}{{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. }
  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. let homeType = false;
  156. let list = getCurrentPages();
  157. for(let i=0;i<list.length;i++){
  158. if(list[i].route.indexOf('home') != -1){
  159. homeType = true;
  160. }
  161. }
  162. if(homeType){
  163. setTimeout(function() {
  164. uni.navigateBack();
  165. }, 2000);
  166. }else{
  167. setTimeout(function() {
  168. uni.reLaunch({
  169. url: '/pages/views/home/home',
  170. });
  171. }, 2000);
  172. }
  173. }
  174. },
  175. lookItem(minItem) {
  176. let self = this;
  177. if (minItem.type == 'png' || minItem.type == 'jpg' || minItem.type == 'jpeg' || minItem.type == 'gif') {
  178. //查看图片
  179. wx.previewImage({
  180. urls: [self.baseUrl + minItem.url], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  181. current: '', // 当前显示图片的http链接,默认是第一个
  182. success: function(res) {},
  183. fail: function(res) {},
  184. complete: function(res) {},
  185. })
  186. } else if (minItem.type == 'pdf' || minItem.type == 'doc' || minItem.type == 'docx') {
  187. uni.showLoading({
  188. title: '下载中'
  189. });
  190. console.log(self.baseUrl + '/' + minItem.name)
  191. console.log(minItem.url)
  192. //下载文档
  193. wx.downloadFile({
  194. url: self.baseUrl+minItem.url,
  195. header: {
  196. Authorization: uni.getStorageSync('token')
  197. },
  198. success: function(res) {
  199. const fileManager = wx.getFileSystemManager()
  200. const filePath = wx.env.USER_DATA_PATH + '/' + minItem.name
  201. fileManager.saveFile({
  202. tempFilePath: res.tempFilePath,
  203. filePath,
  204. success: () => {
  205. uni.hideLoading();
  206. wx.openDocument({
  207. filePath: filePath,
  208. showMenu: true,
  209. fileType: minItem.type
  210. })
  211. },
  212. fail: function(res) {
  213. uni.hideLoading();
  214. uni.showToast({
  215. title: '下载失败',
  216. icon: "none",
  217. mask: true,
  218. duration: 2000
  219. });
  220. }
  221. })
  222. },
  223. fail: function(res) {
  224. uni.hideLoading();
  225. uni.showToast({
  226. title: '下载失败',
  227. icon: "none",
  228. mask: true,
  229. duration: 2000
  230. });
  231. }
  232. })
  233. }
  234. },
  235. goReviewFailed() {
  236. let obj = {
  237. applyId: this.newData.labSecurityApply.applyId,
  238. rejectCause: this.newData.listTemp,
  239. }
  240. uni.navigateTo({
  241. url: '/pages_manage/views/accessQualification/approve?item=' + encodeURIComponent(JSON.stringify(
  242. obj))
  243. })
  244. },
  245. //查看图片
  246. lockImg(list) {
  247. if (!list[0]) {
  248. return
  249. }
  250. wx.previewImage({
  251. urls: list, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  252. current: '', // 当前显示图片的http链接,默认是第一个
  253. success: function(res) {},
  254. fail: function(res) {},
  255. complete: function(res) {},
  256. })
  257. },
  258. //审核信息详情
  259. async laboratoryAppletGetApplyDetails() {
  260. const {
  261. data
  262. } = await laboratoryAppletGetApplyDetails({
  263. applyId: this.applyId
  264. })
  265. if (data.code == 200) {
  266. let self = this;
  267. let dataList = [];
  268. for (let i = 0; i < data.data.listTemp.length; i++) {
  269. if (data.data.listTemp[i].materialType == 2 && data.data.listTemp[i].materialType == 2) {
  270. dataList.unshift(data.data.listTemp[i]);
  271. }
  272. }
  273. for (let i = 0; i < data.data.listTemp.length; i++) {
  274. if (data.data.listTemp[i].materialType == 1) {
  275. dataList.push(data.data.listTemp[i]);
  276. }
  277. }
  278. for (let i = 0; i < data.data.listTemp.length; i++) {
  279. if (data.data.listTemp[i].materialType == 2 && data.data.listTemp[i].materialType == 1) {
  280. dataList.unshift(data.data.listTemp[i]);
  281. }
  282. }
  283. this.$set(data.data, 'listTemp', dataList);
  284. let newList = [];
  285. for (let i = 0; i < data.data.listTemp.length; i++) {
  286. if (data.data.listTemp[i].materialType == 1) {
  287. let maxList = [];
  288. for (let o = 0; o < data.data.listTemp[i].listMr.length; o++) {
  289. let bigList = data.data.listTemp[i].listMr[o].dataUrl.split(',');
  290. for (let x = 0; x < bigList.length; x++) {
  291. if (bigList[x]) {
  292. let minList = bigList[x].split(';');
  293. let typeList = minList[0].split('.');
  294. let obj = {
  295. name: minList[0],
  296. url: minList[1],
  297. type: typeList[1],
  298. };
  299. maxList.push(obj);
  300. }
  301. }
  302. }
  303. data.data.listTemp[i].upList = maxList;
  304. let obj = {};
  305. if (maxList.length > 0) {
  306. obj = {
  307. forIndex: 0,
  308. url: self.baseUrl + maxList[0].url
  309. }
  310. }
  311. newList.push(obj);
  312. } else {
  313. let obj = {
  314. forIndex: "",
  315. url: ""
  316. }
  317. newList.push(obj);
  318. }
  319. }
  320. this.$set(this, 'newData', data.data)
  321. console.log(this.newData)
  322. }
  323. },
  324. }
  325. }
  326. </script>
  327. <style lang="stylus" scoped>
  328. #accessQualificationInfo {
  329. height: 100%;
  330. overflow-y scroll;
  331. .user-info-box {
  332. background #fff;
  333. border-radius: 20rpx;
  334. margin: 20rpx 20rpx 0;
  335. padding: 20rpx 0;
  336. .user-info-box_title {
  337. font-size: 30rpx;
  338. font-family: PingFang SC;
  339. font-weight: 500;
  340. color: #333333;
  341. line-height: 30rpx;
  342. margin-left: 24rpx;
  343. margin-bottom:10px;
  344. >view {
  345. display inline-block;
  346. }
  347. }
  348. .user-info-box-min {
  349. margin: 0 26rpx;
  350. display flex;
  351. view {
  352. line-height: 66rpx;
  353. font-size: 28rpx;
  354. }
  355. view:nth-child(1) {
  356. width: 140rpx;
  357. color: #999;
  358. }
  359. view:nth-child(2) {
  360. flex: 1;
  361. text-align right;
  362. color: #333;
  363. }
  364. }
  365. }
  366. .user-card-box {
  367. background #fff;
  368. border-radius: 20rpx;
  369. margin: 0 20rpx 20rpx;
  370. padding: 20rpx 0;
  371. .user-card-title {
  372. padding-left: 24rpx;
  373. font-size: 30rpx;
  374. font-weight: 700;
  375. margin-bottom: 20rpx;
  376. }
  377. .user-card-text {
  378. line-height: 66rpx;
  379. font-size: 28rpx;
  380. color: #999;
  381. padding: 0 24rpx;
  382. }
  383. }
  384. .img-box {
  385. background #fff;
  386. border-radius: 20rpx;
  387. margin: 0 20rpx 20rpx;
  388. padding: 20rpx 0;
  389. .img-title {
  390. padding-left: 24rpx;
  391. font-size: 30rpx;
  392. font-weight: 700;
  393. margin-bottom: 20rpx;
  394. }
  395. img {
  396. display block;
  397. width: 640rpx;
  398. margin: 0 auto 10rpx;
  399. }
  400. }
  401. .word-box {
  402. background #fff;
  403. border-radius: 20rpx;
  404. margin: 0 20rpx 20rpx;
  405. padding: 20rpx 0;
  406. .word-box-title {
  407. padding-left: 24rpx;
  408. font-size: 30rpx;
  409. font-weight: 700;
  410. margin-bottom: 20rpx;
  411. }
  412. .word-box-min {
  413. display flex;
  414. margin: 0 20rpx 20rpx;
  415. img {
  416. height: 60rpx;
  417. width: 60rpx;
  418. }
  419. view {
  420. margin-left: 20rpx;
  421. line-height: 60rpx;
  422. }
  423. }
  424. }
  425. .bottom-button-box {
  426. display flex;
  427. width: 650rpx;
  428. margin: 40rpx auto;
  429. view {
  430. height: 100rpx;
  431. text-align center;
  432. line-height: 100rpx;
  433. color: #fff;
  434. width: 325rpx;
  435. }
  436. view:nth-child(1) {
  437. background: linear-gradient(-45deg, #FA9901, #F28E26);
  438. border-radius: 50rpx 0 0 50rpx;
  439. }
  440. view:nth-child(2) {
  441. background: linear-gradient(-35deg, #309CFF, #0183FA);
  442. border-radius: 0 50rpx 50rpx 0;
  443. }
  444. }
  445. }
  446. </style>