accessQualificationInfo.vue 11 KB

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