newApplication.vue 28 KB

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