accessQualificationInfo.vue 14 KB

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