newApplication.vue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138
  1. <!-- 选择实验室 -->
  2. <template>
  3. <view id="newApplication">
  4. <view class="newApplication-page" v-if="pageType == 1">
  5. <view class="picker-max-box">
  6. <view class="picker-title-box">
  7. <view>*</view>
  8. <view>申请实验室:</view>
  9. </view>
  10. <input @click="inputClick(2)" v-model="subject.subName" class="picker-input-box" disabled type="text"
  11. placeholder="请选择实验室">
  12. </view>
  13. <view class="picker-max-box" v-if="subject.subId">
  14. <view class="picker-title-box">
  15. <view>*</view>
  16. <view>申请期限:</view>
  17. </view>
  18. <view class="apply_data">
  19. <picker mode="date" v-model="validBeginTime" :start="currentDate" fields="day"
  20. @change="beginDateChange">
  21. <view class="for-top-title-time" v-if="validBeginTime.length>0">{{validBeginTime}}</view>
  22. <view class="for-top-title-time" v-if="validBeginTime.length<=0">开始时间</view>
  23. </picker>
  24. -
  25. <picker mode="date" v-model="validEndTime" :start="currentDate" fields="day"
  26. @change="endDateChange">
  27. <view class="for-top-title-time" v-if="validEndTime.length>0">{{validEndTime}}</view>
  28. <view class="for-top-title-time" v-if="validEndTime.length<=0">结束时间</view>
  29. </picker>
  30. </view>
  31. </view>
  32. <view class="picker-max-box" v-if="subject.subId">
  33. <view class="picker-title-box">
  34. <view> </view>
  35. <view>申请备注:</view>
  36. </view>
  37. <textarea class="remark" v-model="applyCause" placeholder="请输入申请备注"></textarea>
  38. </view>
  39. <view class="user-info-box" v-if="subject.subId">
  40. <view class="picker-title-box">
  41. <view>*</view>
  42. <view>身份信息:</view>
  43. <view>(关联学生信息材料)</view>
  44. </view>
  45. <view class="user-info-box-min">
  46. <view>*</view>
  47. <view>申请人:</view>
  48. <input v-model="sysUser.userName" type="text" placeholder="学生姓名">
  49. </view>
  50. <view class="user-info-box-min">
  51. <view>*</view>
  52. <view>联系电话:</view>
  53. <input v-model="sysUser.mobile" type="text" placeholder="联系电话">
  54. </view>
  55. <view class="user-info-box-min">
  56. <view>*</view>
  57. <view>学号:</view>
  58. <input v-model="sysUser.account" type="text" placeholder="学号">
  59. </view>
  60. <view class="user-info-box-min">
  61. <view>*</view>
  62. <view>物理卡号:</view>
  63. <input v-model="sysUser.cardNumSimple" type="text" placeholder="物理卡号">
  64. </view>
  65. <view class="user-info-box-min">
  66. <view>*</view>
  67. <view>班级:</view>
  68. <input v-model="sysUser.gradeName" type="text" placeholder="班级">
  69. </view>
  70. <view class="user-info-box-min">
  71. <view>*</view>
  72. <view>导师:</view>
  73. <input v-model="sysUser.tutorUserName" @change="tutorUserNameClick()" type="text"
  74. placeholder="请输入姓名,最少两个字">
  75. <uni-data-picker disabled=true @change="bindPickerChange" :localdata="tutorUserList" ref='picker'>
  76. </uni-data-picker>
  77. </view>
  78. </view>
  79. <!-- 学生 -->
  80. <view v-if="subjectData.sysUser.userType == '2'" v-for="(item,index) in subjectData.listStudent"
  81. :key="index">
  82. <!-- 院系考试证书 -->
  83. <view class="picker-max-box" v-if="item.materialType==2&&item.relationType==2">
  84. <view class="picker-title-box">
  85. <view>*</view>
  86. <view>安全考试证书:</view>
  87. </view>
  88. <img class="picker-up-img-box" v-if="subjectData.listcert[0]"
  89. :src="subjectData.listcert[0].cert_url">
  90. <view v-if="!subjectData.listcert[0]" style="margin-left:40px;color:#999;font-size:14px;">暂无证书
  91. </view>
  92. </view>
  93. <!-- 上传材料 -->
  94. <view class="picker-max-box" v-if="item.materialType==1">
  95. <view class="picker-title-box">
  96. <view>*</view>
  97. <view>{{item.materialName}}:</view>
  98. </view>
  99. <view class="picker-text-info-box">{{item.materialDescribe}}</view>
  100. <view class="picker-for-item-box" v-for="(minItem,minIndex) in item.upList" :key="minIndex">
  101. <img class="left-img-box" src="@/images/basicsModules/icon_pdf.png"
  102. v-if="minItem.type == 'pdf'">
  103. <img class="left-img-box" src="@/images/basicsModules/icon_word.png"
  104. v-if="minItem.type == 'doc' || minItem.type == 'docx'">
  105. <img class="left-img-box" :src="baseUrl+minItem.url"
  106. v-if="minItem.type == 'png' || minItem.type == 'jpg' || minItem.type == 'jpeg' || minItem.type == 'gif'">
  107. <view class="center-text-box">{{minItem.name}}</view>
  108. <img class="right-img-box" src="@/images/basicsModules/icon_sczl_sc.png"
  109. @click="delUpData(item,minIndex)">
  110. </view>
  111. <view class="up-data-button" @click="itemUpData(item)">上传材料</view>
  112. </view>
  113. </view>
  114. </view>
  115. <!-- 实验室选择页面 -->
  116. <view class="pageTwo" v-if="pageType == 2">
  117. <view class="pageTwo-input-box">
  118. <input type="text" placeholder="请输入实验室名称" v-model="subjectName">
  119. <view @click="subjectList">查找</view>
  120. </view>
  121. <view class="for-max-box">
  122. <view class="for-null-text" v-if="!searchList[0]">{{nullText}}</view>
  123. <view class="for-box" v-for="(item,index) in searchList" :key="index">
  124. <view>{{item.subName}}</view>
  125. <view @click="checkClick(item)">选择</view>
  126. </view>
  127. </view>
  128. <view class="out-button" @click="inputClick(1)">返回</view>
  129. </view>
  130. <view class="bottom-button" v-if="pageType == 1" @click="upDataButton()">
  131. {{infoType?'准入材料修改完毕,重新提交':'准入材料上传完毕,提交申请'}}
  132. </view>
  133. <view class="shade-max-box" v-if="shadeType">
  134. <view class="shade-big-box">
  135. <img src="@/pages_student/images/img_zrsq_bg.png">
  136. <view @click="pageBack">返回</view>
  137. </view>
  138. </view>
  139. </view>
  140. </template>
  141. <script>
  142. import {
  143. subjectList,
  144. materialApply,
  145. materialUpdate,
  146. materialAdd,
  147. teacherApply
  148. } from '@/api/apiDemo/index.js'
  149. import {
  150. systemUserDropList
  151. } from '@/api/basicsModules/index.js'
  152. import {
  153. systemMineGetListByPower,
  154. laboratoryAppletMaterialApply,
  155. laboratoryAppletMaterialAdd,
  156. laboratoryAppletMaterialUpdate,
  157. } from '@/api/student/index.js'
  158. import {
  159. config
  160. } from '@/api/request/config.js'
  161. export default {
  162. data() {
  163. return {
  164. baseUrl: config.base_url,
  165. pageType: 1,
  166. shadeType: false,
  167. //有效期
  168. buttonArray2: [],
  169. buttonArrayIndex2: 11,
  170. //搜索回的实验室列表
  171. searchList: [],
  172. //选择的实验室数据
  173. subject: {},
  174. //暂无数据提示
  175. nullText: "请输入实验室名称进行搜索",
  176. //实验室名称
  177. subjectName: "",
  178. //有效期
  179. validLength: "12",
  180. //获取的实验室配置数据
  181. subjectData: {},
  182. //是否是编辑状态
  183. infoType: false,
  184. //编辑参数
  185. infoData: {},
  186. validBeginTime: '', //申请期限开始
  187. validEndTime: '', //申请期限结束
  188. applyCause: '', //申请备注
  189. sysUser: {},
  190. tutorUserList: [],
  191. strArr: [], //存储类型
  192. currentDate: '', //当前日期
  193. uploadFileName: '', //学生上传的文件名
  194. }
  195. },
  196. onLoad(option) {
  197. if (option.item) {
  198. let newItem = JSON.parse(decodeURIComponent(option.item));
  199. let newObj = {
  200. deptId: newItem.labSecurityApply.deptId,
  201. deptName: newItem.labSecurityApply.deptName,
  202. id: newItem.labSecurityApply.subjectId,
  203. name: newItem.labSecurityApply.subjectName,
  204. }
  205. this.validBeginTime = newItem.labSecurityApply.validBeginTime; //申请期限开始时间
  206. this.validEndTime = newItem.labSecurityApply.validEndTime; //申请期限结束时间
  207. this.applyCause = newItem.labSecurityApply.applyCause; //申请备注
  208. this.$set(this, 'subject', newObj)
  209. this.$set(this, 'infoData', newItem)
  210. this.infoType = true;
  211. this.materialApply();
  212. }
  213. },
  214. onShow() {
  215. this.addTime();
  216. this.clearData();
  217. this.currentDate = this.getdate();
  218. console.log('时间')
  219. console.log(this.currentDate)
  220. },
  221. methods: {
  222. getdate() {
  223. var date = new Date();
  224. var seperator1 = "-";
  225. var year = date.getFullYear();
  226. var month = date.getMonth() + 1;
  227. var strDate = date.getDate();
  228. if (month >= 1 && month <= 9) {
  229. month = "0" + month;
  230. }
  231. if (strDate >= 0 && strDate <= 9) {
  232. strDate = "0" + strDate;
  233. }
  234. var currentdate = year + "-" + month + "-" + strDate;
  235. return currentdate;
  236. },
  237. //清除
  238. clearData() {
  239. this.tutorUserList = [];
  240. },
  241. //导师查询
  242. async tutorUserNameClick() {
  243. let self = this
  244. self.tutorUserList = []
  245. let obj = {
  246. userName: this.sysUser.tutorUserName,
  247. userType: '1'
  248. }
  249. const {
  250. data
  251. } = await systemUserDropList(obj)
  252. if (data.code == 200) {
  253. console.log(data)
  254. data.data.forEach(function(item) {
  255. self.tutorUserList.push({
  256. text: item.userName,
  257. value: item.userId,
  258. })
  259. })
  260. console.log(self.tutorUserList)
  261. self.$refs.picker.show()
  262. }
  263. },
  264. bindPickerChange: function(e) {
  265. let self = this;
  266. console.log('picker发送选择改变,携带值为', e.detail.value)
  267. let data = e.detail.value;
  268. data.forEach(function(item) {
  269. self.sysUser.tutorUserName = item.text
  270. self.sysUser.tutorUserId = item.value
  271. })
  272. },
  273. //时间选择触发-开始
  274. beginDateChange(data) {
  275. this.validBeginTime = data.detail.value;
  276. },
  277. endDateChange(data) {
  278. this.validEndTime = data.detail.value;
  279. },
  280. pageBack() {
  281. uni.navigateBack();
  282. },
  283. //申请编辑
  284. async materialUpdate(obj) {
  285. const {
  286. data
  287. } = await laboratoryAppletMaterialUpdate(obj)
  288. if (data.code == 200) {
  289. this.shadeType = true;
  290. }
  291. },
  292. //申请提交
  293. async materialAdd(obj) {
  294. const {
  295. data
  296. } = await laboratoryAppletMaterialAdd(obj)
  297. if (data.code == 200) {
  298. this.shadeType = true;
  299. }
  300. },
  301. //提交按钮
  302. upDataButton() {
  303. let self = this;
  304. if (!this.subject.subId) {
  305. uni.showToast({
  306. title: '请选择实验室',
  307. icon: "none",
  308. mask: true,
  309. duration: 2000
  310. });
  311. return
  312. }
  313. if (!this.validBeginTime) {
  314. uni.showToast({
  315. title: '请选择开始时间',
  316. icon: "none",
  317. mask: true,
  318. duration: 2000
  319. });
  320. return
  321. }
  322. if (!this.validEndTime) {
  323. uni.showToast({
  324. title: '请选择结束时间',
  325. icon: "none",
  326. mask: true,
  327. duration: 2000
  328. });
  329. return
  330. }
  331. if (!this.sysUser.userName) {
  332. uni.showToast({
  333. title: '请输入申请人',
  334. icon: "none",
  335. mask: true,
  336. duration: 2000
  337. });
  338. return
  339. }
  340. if (!this.sysUser.mobile) {
  341. uni.showToast({
  342. title: '请输入联系电话',
  343. icon: "none",
  344. mask: true,
  345. duration: 2000
  346. });
  347. return
  348. }
  349. if (!this.sysUser.account) {
  350. uni.showToast({
  351. title: '请输入学号',
  352. icon: "none",
  353. mask: true,
  354. duration: 2000
  355. });
  356. return
  357. }
  358. if (!this.sysUser.cardNumSimple) {
  359. uni.showToast({
  360. title: '请输入物理卡号',
  361. icon: "none",
  362. mask: true,
  363. duration: 2000
  364. });
  365. return
  366. }
  367. if (!this.sysUser.gradeName) {
  368. uni.showToast({
  369. title: '请输入班级',
  370. icon: "none",
  371. mask: true,
  372. duration: 2000
  373. });
  374. return
  375. }
  376. if (!this.sysUser.tutorUserId) {
  377. uni.showToast({
  378. title: '请选择导师',
  379. icon: "none",
  380. mask: true,
  381. duration: 2000
  382. });
  383. return
  384. }
  385. let sysUser = {
  386. userName: this.sysUser.userName,
  387. userId: this.sysUser.userId,
  388. mobile: this.sysUser.mobile,
  389. account: this.sysUser.account,
  390. cardNumSimple: this.sysUser.cardNumSimple,
  391. grade: this.sysUser.gradeName,
  392. tutorUserId: this.sysUser.tutorUserId,
  393. tutorUserName: this.sysUser.tutorUserName,
  394. };
  395. let obj = {
  396. subAdminId: this.subjectData.fzrSysUser.userId, //学号/工号
  397. userNumber: this.subjectData.sysUser.account, //学号/工号
  398. userMajor: this.subjectData.sysUser.majorName, //专业
  399. userMajorId: this.subjectData.sysUser.major, //专业
  400. deptId: this.subjectData.sysUser.deptId, //NULL部门id
  401. deptName: this.subjectData.sysUser.deptName, //NULL部门名称
  402. subId: this.subject.subId, //NULL实验室id
  403. subName: this.subject.subName, //NULL实验室名称
  404. auditStatus: "0", //NULL审核状态 0待审核 1驳回 2通过
  405. //validLength: this.validLength, //NULL有效期 月份时长
  406. relList: [], //上传资料
  407. sysUserModel: sysUser, //身份卡用户信息
  408. validBeginTime: this.validBeginTime+'T00:00:00', //申请期限开始时间
  409. validEndTime: this.validEndTime+'T23:59:59', //申请期限结束时间
  410. applyCause: this.applyCause, //申请备注
  411. };
  412. if (this.subjectData.sysUser.userType == '2') {
  413. for (let i = 0; i < self.subjectData.listStudent.length; i++) {
  414. if (self.subjectData.listStudent[i].materialType == 1) {
  415. if (!self.subjectData.listStudent[i].upList[0]) {
  416. uni.showToast({
  417. title: self.subjectData.listStudent[i].materialName + "未上传",
  418. icon: "none",
  419. mask: true,
  420. duration: 2000
  421. });
  422. return
  423. } else {
  424. let upData = {
  425. materialId: self.subjectData.listStudent[i].materialId,
  426. dataName: self.subjectData.listStudent[i].materialName,
  427. dataDescribe: self.subjectData.listStudent[i].materialDescribe,
  428. dataUrl: "",
  429. };
  430. for (let o = 0; o < self.subjectData.listStudent[i].upList.length; o++) {
  431. upData.dataUrl = upData.dataUrl + self.subjectData.listStudent[i].upList[o].name +
  432. ';' + self.subjectData.listStudent[i].upList[o].url + ',';
  433. }
  434. obj.relList.push(upData);
  435. }
  436. }
  437. }
  438. }
  439. if (this.infoType) {
  440. obj.id = this.infoData.labSecurityApply.id;
  441. this.materialUpdate(obj);
  442. } else {
  443. this.materialAdd(obj);
  444. }
  445. },
  446. //删除对应材料
  447. delUpData(item, index) {
  448. item.upList.splice(index, 1);
  449. this.$forceUpdate()
  450. },
  451. itemUpData(item) {
  452. this.uploadFileName = '';
  453. this.uploadFileName = this.sysUser.userName + item.materialName; //学生上传的文件名
  454. let self = this;
  455. let fileTypeArr = item.fileType.split(',')
  456. self.strArr = [];
  457. fileTypeArr.forEach(function(item) {
  458. if (item == '1') {
  459. self.strArr.push('pdf')
  460. } else if (item == '2') {
  461. self.strArr.push('doc', 'docx')
  462. } else if (item == '3') {
  463. self.strArr.push('png', 'jpg', 'gif')
  464. }
  465. })
  466. uni.showActionSheet({
  467. itemList: ['上传文件', '上传图片'],
  468. success: function(res) {
  469. console.log(res)
  470. if (res.tapIndex == 0) {
  471. //上传文件
  472. self.upData(item);
  473. } else if (res.tapIndex == 1) {
  474. //上传图片
  475. self.upImg(item);
  476. }
  477. },
  478. fail: function(res) {
  479. console.log(res.errMsg);
  480. }
  481. });
  482. },
  483. upImg(item) {
  484. let self = this;
  485. wx.chooseImage({
  486. count: 1,
  487. sizeType: ["original", "compressed"],
  488. sourceType: ["album", "camera"],
  489. success: function(res) {
  490. console.log(res)
  491. let text = res.tempFilePaths[0].split('.')
  492. if (self.strArr.indexOf(text[1]) == -1) {
  493. uni.showToast({
  494. title: '请上传' + self.strArr.join(',') + '格式文件',
  495. icon: "none",
  496. mask: true,
  497. duration: 2000
  498. });
  499. return
  500. }
  501. if (text[1] != 'png' && text[1] != 'jpg' && text[1] != 'jpeg' && text[1] != 'gif' &&
  502. text[1] != 'pdf' && text[1] != 'doc' && text[1] != 'docx') {
  503. uni.showToast({
  504. title: '仅支持png/jpg/jpeg/gif/pdf/doc/docx类型的文件上传',
  505. icon: "none",
  506. mask: true,
  507. duration: 2000
  508. });
  509. return
  510. }
  511. let upObj = {
  512. name: self.uploadFileName + '.' + text[1],
  513. path: res.tempFilePaths[0],
  514. type: text[1],
  515. }
  516. self.upDataFunction(item, upObj);
  517. }
  518. });
  519. },
  520. //上传文件
  521. upData(item) {
  522. let self = this;
  523. wx.chooseMessageFile({
  524. count: 1,
  525. type: 'all',
  526. success(res) {
  527. let text = res.tempFiles[0].path.split('.')
  528. if (self.strArr.indexOf(text[1]) == -1) {
  529. uni.showToast({
  530. title: '请上传' + self.strArr.join(',') + '格式文件',
  531. icon: "none",
  532. mask: true,
  533. duration: 2000
  534. });
  535. return
  536. }
  537. if (text[1] != 'png' && text[1] != 'jpg' && text[1] != 'jpeg' && text[1] != 'gif' && text[
  538. 1] != 'pdf' && text[1] != 'doc' && text[1] != 'docx') {
  539. uni.showToast({
  540. title: '仅支持png/jpg/jpeg/gif/pdf/doc/docx类型的文件上传',
  541. icon: "none",
  542. mask: true,
  543. duration: 2000
  544. });
  545. return
  546. }
  547. let upObj = {
  548. name: self.uploadFileName + '.' + text[1],
  549. path: res.tempFiles[0].path,
  550. type: text[1],
  551. }
  552. self.upDataFunction(item, upObj);
  553. }
  554. })
  555. },
  556. async upDataFunction(item, upObj) {
  557. var self = this;
  558. uni.showLoading({
  559. title: '上传中',
  560. mask: true
  561. });
  562. uni.uploadFile({
  563. url: config.base_url + '/system/file/upload', //仅为示例,非真实的接口地址
  564. header: {
  565. 'Authorization': uni.getStorageSync('token')
  566. },
  567. filePath: upObj.path,
  568. name: 'file',
  569. formData: {
  570. 'user': 'test'
  571. },
  572. success: (uploadFileRes) => {
  573. let res = JSON.parse(uploadFileRes.data);
  574. if (res.code == 200) {
  575. let obj = {
  576. name: upObj.name,
  577. url: res.data.url,
  578. type: upObj.type
  579. }
  580. item.upList.push(obj);
  581. this.$forceUpdate();
  582. } else {
  583. uni.showToast({
  584. title: res.msg,
  585. icon: "none",
  586. mask: true,
  587. duration: 2000
  588. });
  589. }
  590. },
  591. fail: err => {},
  592. complete: () => {
  593. uni.hideLoading()
  594. }
  595. });
  596. },
  597. //选择搜索页面
  598. inputClick(type) {
  599. if (this.pageType != type) {
  600. this.pageType = type;
  601. }
  602. },
  603. //实验室选择
  604. checkClick(item) {
  605. this.$set(this, "subject", item);
  606. this.materialApply();
  607. },
  608. //获取实验室相关配置
  609. async materialApply() {
  610. let self = this;
  611. const {
  612. data
  613. } = await laboratoryAppletMaterialApply({
  614. subjectId: this.subject.subId
  615. })
  616. if (data.code == 200) {
  617. if (data.data.sysUser.userType != '2') {
  618. uni.showToast({
  619. title: '您不是学生,无法申请准入',
  620. icon: "none",
  621. mask: true,
  622. duration: 2000
  623. });
  624. return
  625. }
  626. if (data.data.sysUser.userType == '2') {
  627. if (!data.data.listStudent[0]) {
  628. uni.showToast({
  629. title: '该实验室未设置准入条件',
  630. icon: "none",
  631. mask: true,
  632. duration: 2000
  633. });
  634. return
  635. }
  636. }
  637. if (data.data.listStudent) {
  638. for (let i = 0; i < data.data.listStudent.length; i++) {
  639. if (data.data.listStudent[i].materialType == 1) {
  640. data.data.listStudent[i].upList = [];
  641. }
  642. }
  643. }
  644. if (data.data.listTeacher) {
  645. for (let i = 0; i < data.data.listTeacher.length; i++) {
  646. if (data.data.listTeacher[i].materialType == 1) {
  647. data.data.listTeacher[i].upList = [];
  648. }
  649. }
  650. }
  651. this.subjectData = data.data;
  652. this.sysUser = data.data.sysUser;
  653. this.sysUser.mobile == null ? '' : this.sysUser.mobile;
  654. this.sysUser.userName == null ? '' : this.sysUser.userName;
  655. this.sysUser.cardNum == null ? '' : this.sysUser.cardNum;
  656. this.sysUser.grade == null ? '' : this.sysUser.grade;
  657. this.sysUser.tutorUserName == null ? '' : this.sysUser.tutorUserName;
  658. if (this.infoType) {
  659. this.validLength = this.infoData.labSecurityApply.validLength;
  660. for (let i = 0; i < self.infoData.listTemp.length; i++) {
  661. if (self.infoData.listTemp[i].materialType == 1) {
  662. if (self.subjectData.sysUser.userType == '2') {
  663. for (let o = 0; o < self.subjectData.listStudent.length; o++) {
  664. if (self.subjectData.listStudent[o].materialType == 1 && self.subjectData
  665. .listStudent[o].id == self.infoData.listTemp[i].id) {
  666. self.subjectData.listStudent[o].upList = JSON.parse(JSON.stringify(self
  667. .infoData.listTemp[i].upList));
  668. }
  669. }
  670. }
  671. }
  672. }
  673. }
  674. this.pageType = 1;
  675. }
  676. },
  677. //有效期选中
  678. buttonChange2(e) {
  679. console.log("e", e.mp.detail.value);
  680. this.buttonArrayIndex2 = e.mp.detail.value;
  681. this.validLength = this.buttonArray2[e.mp.detail.value].value;
  682. },
  683. //查询实验室
  684. async subjectList() {
  685. const {
  686. data
  687. } = await systemMineGetListByPower({
  688. subName: this.subjectName
  689. })
  690. if (data.code == 200) {
  691. this.searchList = data.data;
  692. if (!data.data[0]) {
  693. this.nullText = "暂无数据"
  694. }
  695. }
  696. },
  697. //生成有效期
  698. addTime() {
  699. let list = [];
  700. for (let i = 1; i < 61; i++) {
  701. let obj = {
  702. name: i + "个月",
  703. value: i,
  704. }
  705. list.push(obj)
  706. }
  707. this.$set(this, 'buttonArray2', list);
  708. },
  709. },
  710. }
  711. </script>
  712. <style lang="stylus" scoped>
  713. #newApplication {
  714. height: auto;
  715. width: 100%;
  716. display flex;
  717. flex-direction column;
  718. .user-info-box {
  719. background #fff;
  720. border-radius: 20rpx;
  721. margin: 20rpx 20rpx;
  722. padding: 20rpx 0 0;
  723. .user-info-box_title {
  724. font-size: 30rpx;
  725. font-family: PingFang SC;
  726. font-weight: 500;
  727. color: #333333;
  728. line-height: 30rpx;
  729. margin-left: 24rpx;
  730. margin-bottom: 10px;
  731. }
  732. .user-info-box-min {
  733. margin: 0 26rpx;
  734. display flex;
  735. align-items center;
  736. view {
  737. line-height: 66rpx;
  738. font-size: 28rpx;
  739. }
  740. view:nth-child(1) {
  741. color: red;
  742. line-height: 28rpx;
  743. position: relative;
  744. top: 4rpx;
  745. }
  746. view:nth-child(2) {
  747. flex: 1;
  748. color: #999;
  749. }
  750. view:nth-child(3) {
  751. flex: 1;
  752. text-align right;
  753. color: #333;
  754. }
  755. >input {
  756. width 460rpx;
  757. }
  758. }
  759. .picker-title-box {
  760. padding: 0 20rpx;
  761. display flex;
  762. justify-content flex-start;
  763. align-items center;
  764. view {
  765. line-height: 80rpx;
  766. font-size: 28rpx;
  767. }
  768. view:nth-child(1) {
  769. color: red;
  770. line-height: 28rpx;
  771. }
  772. view:nth-child(2) {}
  773. view:nth-child(3) {
  774. color: #999;
  775. }
  776. }
  777. }
  778. .newApplication-page {
  779. background #fff;
  780. margin: 20rpx 20rpx 160rpx;
  781. padding-bottom: 20rpx;
  782. border-radius: 20rpx;
  783. .picker-max-box {
  784. /* 申请备注 */
  785. .remark {
  786. width: 627rpx;
  787. height: 200rpx;
  788. font-size: 28rpx;
  789. margin: 0 20rpx;
  790. border: 2rpx solid #a2a2a2;
  791. border-radius: 10rpx;
  792. padding: 20rpx;
  793. }
  794. /* 申请期限 */
  795. .apply_data {
  796. width: 667rpx;
  797. height: 82rpx;
  798. background: #FFFFFF;
  799. border: 2rpx solid #A2A2A2;
  800. border-radius: 10rpx;
  801. display: flex;
  802. justify-content: space-between;
  803. align-items center;
  804. margin: 0 20rpx;
  805. padding: 0 30rpx;
  806. box-sizing border-box;
  807. >picker {
  808. >view {
  809. font-size: 28rpx;
  810. font-family: PingFang SC;
  811. font-weight: 500;
  812. color: #999999;
  813. line-height: 82rpx;
  814. }
  815. }
  816. }
  817. .picker-title-box {
  818. padding: 0 20rpx;
  819. display flex;
  820. justify-content flex-start;
  821. align-items center;
  822. view {
  823. line-height: 80rpx;
  824. font-size: 28rpx;
  825. }
  826. view:nth-child(1) {
  827. color: red;
  828. }
  829. view:nth-child(2) {}
  830. view:nth-child(3) {
  831. color: #999;
  832. }
  833. }
  834. .picker-input-box {
  835. padding: 0 20rpx;
  836. display flex;
  837. height: 80rpx;
  838. width: 627rpx;
  839. border: 1rpx solid #a2a2a2;
  840. border-radius: 10rpx;
  841. margin: 0 20rpx;
  842. }
  843. .picker-min-box {
  844. display flex;
  845. height: 80rpx;
  846. width: 667rpx;
  847. border: 1rpx solid #a2a2a2;
  848. border-radius: 10rpx;
  849. margin: 0 20rpx;
  850. view {
  851. flex: 1;
  852. line-height: 80rpx;
  853. padding: 0 20rpx;
  854. color: #999;
  855. font-size: 28rpx;
  856. }
  857. img {
  858. width: 24rpx;
  859. height: 12rpx;
  860. margin: 35rpx 23rpx;
  861. }
  862. }
  863. .picker-text-box {
  864. padding: 0 50rpx;
  865. height: 60rpx;
  866. line-height: 60rpx;
  867. font-size: 28rpx;
  868. color: #999;
  869. }
  870. .picker-text-info-box {
  871. color: #999;
  872. font-size: 28rpx;
  873. line-height: 40rpx;
  874. padding: 0 20rpx;
  875. }
  876. .picker-up-img-box {
  877. margin: 40rpx auto;
  878. width: 640rpx;
  879. height: 250rpx;
  880. border: 2px dashed #E0E0E0;
  881. border-radius: 20rpx;
  882. background: #F8F8F8;
  883. view:nth-child(1) {
  884. margin-top: 30rpx;
  885. font-size: 80rpx;
  886. color: #e0e0e0;
  887. text-align center;
  888. }
  889. view:nth-child(2) {
  890. font-weight: 700;
  891. font-size: 28rpx;
  892. color: #999;
  893. text-align center;
  894. }
  895. }
  896. .picker-for-item-box {
  897. display flex;
  898. margin: 20rpx 0;
  899. .left-img-box {
  900. margin: 0 20rpx;
  901. width: 60rpx;
  902. height: 60rpx;
  903. }
  904. .center-text-box {
  905. flex: 1;
  906. line-height: 60rpx;
  907. font-size: 28rpx;
  908. color: #333;
  909. display: block;
  910. overflow: hidden;
  911. text-overflow: ellipsis;
  912. white-space: nowrap;
  913. }
  914. .right-img-box {
  915. width: 30rpx;
  916. height: 30rpx;
  917. margin: 15rpx 20rpx;
  918. }
  919. }
  920. .up-data-button {
  921. width: 500rpx;
  922. height: 80rpx;
  923. margin: 40rpx auto;
  924. line-height: 80rpx;
  925. text-align center;
  926. font-size: 28rpx;
  927. border-radius: 10rpx;
  928. color: #0183FA;
  929. border: 1rpx dashed #0183FA;
  930. }
  931. }
  932. }
  933. .bottom-button {
  934. position fixed;
  935. bottom: 20rpx;
  936. left: 25rpx;
  937. z-index: 500;
  938. width: 700rpx;
  939. line-height: 100rpx;
  940. border-radius: 20rpx;
  941. background #0183FA;
  942. color: #fff;
  943. text-align center;
  944. }
  945. .pageTwo {
  946. flex: 1;
  947. display flex;
  948. flex-direction column;
  949. overflow-y hidden;
  950. .pageTwo-input-box {
  951. display flex;
  952. padding: 20rpx 25rpx;
  953. background #fff;
  954. margin-bottom: 20rpx;
  955. input {
  956. padding: 0 20rpx;
  957. width: 460rpx;
  958. line-height: 80rpx;
  959. height: 80rpx;
  960. border-top: 1rpx solid #a2a2a2;
  961. border-left: 1rpx solid #a2a2a2;
  962. border-bottom: 1rpx solid #a2a2a2;
  963. border-bottom-left-radius: 10rpx;
  964. border-top-left-radius: 10rpx;
  965. }
  966. view {
  967. width: 200rpx;
  968. line-height: 80rpx;
  969. height: 80rpx;
  970. border: 1rpx solid #007AFF;
  971. color: #fff;
  972. background #007AFF;
  973. text-align center;
  974. border-top-right-radius: 10rpx;
  975. border-bottom-right-radius: 10rpx;
  976. }
  977. }
  978. .for-max-box {
  979. background #fff;
  980. flex: 1;
  981. overflow-y scroll;
  982. .for-box:nth-child(1) {
  983. border: none;
  984. }
  985. .for-null-text {
  986. text-align center;
  987. line-height: 100rpx;
  988. color: #999;
  989. }
  990. .for-box {
  991. width: 710rpx;
  992. border-top: 1rpx solid #dedede;
  993. line-height: 60rpx;
  994. height: 60rpx;
  995. padding: 20rpx;
  996. display: flex;
  997. overflow: hidden;
  998. text-overflow: ellipsis;
  999. white-space: nowrap;
  1000. view:nth-child(1) {
  1001. flex: 1;
  1002. }
  1003. view:nth-child(2) {
  1004. width: 100rpx;
  1005. text-align center;
  1006. border-radius: 10rpx;
  1007. background #007AFF;
  1008. color: #fff;
  1009. }
  1010. }
  1011. }
  1012. .out-button {
  1013. width: 650rpx;
  1014. height: 100rpx;
  1015. line-height: 100rpx;
  1016. margin: 20rpx 50rpx;
  1017. text-align center;
  1018. font-size: 32rpx;
  1019. color: #fff;
  1020. background #999;
  1021. border-radius: 20rpx;
  1022. }
  1023. }
  1024. .shade-max-box {
  1025. background: rgba(0, 0, 0, 0.2);
  1026. width: 100%;
  1027. height: 100%;
  1028. position fixed;
  1029. z-index 100;
  1030. .shade-big-box {
  1031. width: 626rpx;
  1032. height: 567rpx;
  1033. margin: 335rpx 63rpx;
  1034. position relative;
  1035. z-index 100;
  1036. img {
  1037. width: 626rpx;
  1038. height: 567rpx;
  1039. }
  1040. view {
  1041. position absolute;
  1042. left: 88rpx;
  1043. bottom: 100rpx;
  1044. width: 450rpx;
  1045. height: 80rpx;
  1046. line-height: 80rpx;
  1047. text-align center;
  1048. color: #fff;
  1049. background #0183FA;
  1050. border-radius: 40rpx;
  1051. }
  1052. }
  1053. }
  1054. }
  1055. /deep/.input-value-border {
  1056. display: none !important;
  1057. }
  1058. </style>