accessQualificationInfo.vue 12 KB

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