accessQualificationInfo.vue 11 KB

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