accessQualificationInfo.vue 12 KB

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