accessQualificationInfo.vue 11 KB

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