addPage.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285
  1. <template>
  2. <div class="student-add-page">
  3. <div class="top-title-box">
  4. <p>{{titleName}}</p>
  5. </div>
  6. <el-form :model="form" class="top-info-box" ref="form" :inline="true" :rules="rules" label-width="120px">
  7. <div class="left-info-box">
  8. <img :src="form.avatar" v-if="form.avatar">
  9. <img src="@/assets/ZDimages/tx_cion_one.png" v-if="!form.avatar">
  10. <el-upload
  11. v-if="!editType"
  12. class="certificate-avatar-uploader"
  13. :action="uploadImgUrl"
  14. :show-file-list="false"
  15. accept="image/jpeg,image/gif,image/png"
  16. :on-success="handleAvatarSuccess"
  17. :headers="headers"
  18. :before-upload="beforeAvatarUpload">
  19. <p>上传证件照</p>
  20. </el-upload>
  21. </div>
  22. <div class="right-info-box">
  23. <el-form-item label="姓名:" prop="nickName">
  24. <el-input
  25. :disabled="editType"
  26. style="width:218px;"
  27. maxlength="50"
  28. v-model="form.nickName"
  29. placeholder="请输入姓名"
  30. clearable
  31. size="small"
  32. />
  33. </el-form-item>
  34. <el-form-item label="性别:" prop="sex">
  35. <el-radio-group v-model="form.sex" v-if="!editType">
  36. <el-radio :label="0" style="margin-left:20px;width:70px;">男</el-radio>
  37. <el-radio :label="1">女</el-radio>
  38. </el-radio-group>
  39. <p v-if="editType" style="line-height:40px;color:#999;width:180px;padding-left:40px;">{{form.sex==0?'男':'女'}}</p>
  40. </el-form-item>
  41. <el-form-item label="学号:" prop="userName">
  42. <el-input
  43. style="width:218px;"
  44. :disabled="editType"
  45. maxlength="50"
  46. v-model="form.userName"
  47. placeholder="请输入学号"
  48. clearable
  49. size="small"
  50. />
  51. </el-form-item>
  52. <el-form-item label="所在学院:" prop="deptId">
  53. <el-select v-model="form.deptId" clearable :disabled="editType" placeholder="请选择所在学院">
  54. <el-option
  55. v-for="item in deptOptions"
  56. :key="item.deptId"
  57. :label="item.deptName"
  58. :value="item.deptId">
  59. </el-option>
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item label="专业:" prop="majorId">
  63. <el-select
  64. :disabled="editType"
  65. v-model="form.majorId"
  66. filterable
  67. remote
  68. clearable
  69. reserve-keyword
  70. @visible-change="majorSelectNull"
  71. @change="majorSelectClick"
  72. @clear="majorClearClick"
  73. placeholder="请选择专业"
  74. :remote-method="majorSelect">
  75. <el-option
  76. v-for="item in majorOptions"
  77. :key="item.id"
  78. :label="item.majorName"
  79. :value="item.id">
  80. </el-option>
  81. </el-select>
  82. </el-form-item>
  83. <el-form-item label="手机号码:" prop="phonenumber">
  84. <el-input
  85. :disabled="editType"
  86. style="width:218px;"
  87. maxlength="11"
  88. onkeyup="this.value=this.value.replace(/[^\d.]/g,'')"
  89. v-model="form.phonenumber"
  90. placeholder="请输入手机号码"
  91. clearable
  92. size="small"
  93. />
  94. </el-form-item>
  95. <el-form-item label="班级:" prop="grade">
  96. <el-select
  97. :disabled="editType"
  98. v-model="form.grade"
  99. filterable
  100. remote
  101. clearable
  102. reserve-keyword
  103. @visible-change="gradeSelectNull"
  104. @change="gradeSelectClick"
  105. @clear="gradeClearClick"
  106. placeholder="请选择班级"
  107. :remote-method="gradeSelect">
  108. <el-option
  109. v-for="item in gradeOptions"
  110. :key="item.id"
  111. :label="item.className"
  112. :value="item.id">
  113. </el-option>
  114. </el-select>
  115. </el-form-item>
  116. <el-form-item label="出生日期:" prop="dateBirth">
  117. <el-date-picker
  118. :disabled="editType"
  119. v-model="form.dateBirth"
  120. type="date"
  121. placeholder="请选择出生日期">
  122. </el-date-picker>
  123. </el-form-item>
  124. <el-form-item label="邮箱:" prop="email">
  125. <el-input
  126. :disabled="editType"
  127. style="width:218px;"
  128. maxlength="40"
  129. v-model="form.email"
  130. placeholder="请输入邮箱"
  131. clearable
  132. size="small"
  133. />
  134. </el-form-item>
  135. <el-form-item label="导师:" prop="tutorUserId">
  136. <el-select
  137. :disabled="editType"
  138. v-model="form.tutorUserId"
  139. filterable
  140. remote
  141. clearable
  142. reserve-keyword
  143. @change="tutorUserSelectClick"
  144. @clear="tutorUserClearClick"
  145. placeholder="请选择"
  146. :remote-method="tutorUserSelect">
  147. <el-option
  148. v-for="item in tutorUserOptions"
  149. :key="item.userId"
  150. :label="item.nickName+'-'+item.userName"
  151. :value="item.userId">
  152. </el-option>
  153. </el-select>
  154. </el-form-item>
  155. <el-form-item label="学生类别:" prop="education">
  156. <el-select
  157. :disabled="editType"
  158. v-model="form.education"
  159. filterable
  160. remote
  161. clearable
  162. reserve-keyword
  163. @change="educationSelectClick"
  164. @clear="educationClearClick"
  165. placeholder="请选择学生类别"
  166. :remote-method="educationSelect">
  167. <el-option
  168. v-for="item in educationOptions"
  169. :key="item.dictValue"
  170. :label="item.dictLabel"
  171. :value="item.dictValue">
  172. </el-option>
  173. </el-select>
  174. </el-form-item>
  175. <el-form-item label="学籍状态:" prop="workStatus">
  176. <el-select
  177. :disabled="editType"
  178. v-model="form.workStatus"
  179. filterable
  180. remote
  181. clearable
  182. reserve-keyword
  183. @change="workStatusSelectClick"
  184. @clear="workStatusClearClick"
  185. placeholder="请选择学籍状态"
  186. :remote-method="workStatusSelect">
  187. <el-option
  188. v-for="item in workStatusOptions"
  189. :key="item.dictValue"
  190. :label="item.dictLabel"
  191. :value="item.dictValue">
  192. </el-option>
  193. </el-select>
  194. </el-form-item>
  195. <el-form-item label="校园卡号:" prop="cardNum">
  196. <el-input
  197. :disabled="editType"
  198. style="width:218px;"
  199. onkeyup="this.value=this.value.replace(/^\s*|\s*$/g,'')"
  200. maxlength="30"
  201. v-model="form.cardNum"
  202. placeholder="请输入校园卡号"
  203. clearable
  204. size="small"
  205. />
  206. </el-form-item>
  207. <el-form-item label="人脸照片:" prop="status" v-if="editType">
  208. <div style="width:180px;" v-if="form.faceImg">
  209. <img :src="form.faceImg" style="width:140px;height:140px;">
  210. </div>
  211. <p v-if="!form.faceImg" style="line-height:40px;color:#999;width:180px;padding-left:40px;">未上传</p>
  212. </el-form-item>
  213. <el-form-item label="电子签名:" prop="status" v-if="editType">
  214. <div style="width:180px;" v-if="form.signature">
  215. <img :src="form.signature" style="width:140px;height:140px;">
  216. </div>
  217. <p v-if="!form.signature" style="line-height:40px;color:#999;width:180px;padding-left:40px;">未上传</p>
  218. </el-form-item>
  219. <el-form-item label="账号状态:" prop="status">
  220. <el-switch
  221. v-if="!editType"
  222. @click.native="changeIsNeedCaptcha"
  223. class="switch captcha-img"
  224. :active-value="0"
  225. :inactive-value="1"
  226. active-color="#29B24D"
  227. inactive-color="#999"
  228. v-model="form.status"
  229. active-text="启用"
  230. inactive-text="停用"
  231. disabled
  232. ></el-switch>
  233. <p v-if="editType" style="line-height:40px;color:#999;width:180px;padding-left:40px;">{{form.status==0?'启用':'停用'}}</p>
  234. </el-form-item>
  235. </div>
  236. </el-form>
  237. <div class="bottom-button-box" v-if="editType">
  238. <p class="null-p"></p>
  239. <p class="button-p-1 reset-button-one" @click="outPageButton">返回</p>
  240. <p class="null-p"></p>
  241. </div>
  242. <div class="bottom-button-box" v-if="!editType">
  243. <p class="null-p"></p>
  244. <p class="button-p-1 reset-button-one" @click="outPageButton">返回</p>
  245. <addPageSubPageSZDX class="button-p-2" v-if="versionField() === 'suZhouDaXue'"></addPageSubPageSZDX>
  246. <addPageSubPagePublic class="button-p-2" v-else></addPageSubPagePublic>
  247. <!--<p class="inquire-button-one" @click="upDataClick">提交</p>-->
  248. <p class="null-p"></p>
  249. </div>
  250. <el-dialog title="添加班级" :visible.sync="gradeOpen" width="600px" append-to-body class="teacher-revise-dialog-box" :close-on-click-modal="false">
  251. <el-form :model="gradeForm" ref="gradeForm" :inline="true" :rules="rules" class="addCheckPage-min">
  252. <el-form-item label="班级名称" prop="gradeName" label-width="110px" >
  253. <el-input v-model="gradeForm.gradeName" clearable maxlength="20" style="width:420px;" placeholder="请输入班级名称"/>
  254. </el-form-item>
  255. </el-form>
  256. <div slot="footer" class="teacher-revise-dialog-button-box">
  257. <p class="reset-button-one" @click="gradeOpenOff">取消</p>
  258. <p class="inquire-button-one" @click="gradeOpenUp">确定</p>
  259. </div>
  260. </el-dialog>
  261. </div>
  262. </template>
  263. <script>
  264. import { listDepartments } from "@/api/system/dept";
  265. import { getWorkList, getVague, addSystemClass, getMajorList,getTeacherOption,addUserStudent,putUserStudent } from "@/api/system/user_student";
  266. import { getToken } from "@/utils/auth";
  267. import addPageSubPagePublic from './differenceComponent/addPageSubPagePublic.vue'
  268. import addPageSubPageSZDX from './differenceComponent/addPageSubPageSZDX.vue'
  269. export default {
  270. name: "addPage",
  271. components: {
  272. addPageSubPagePublic,
  273. addPageSubPageSZDX
  274. },
  275. props:{
  276. editType:{},
  277. propsData:{},
  278. titleName:{},
  279. },
  280. data() {
  281. return {
  282. uploadImgUrl: this.uploadUrl(), // 上传的图片服务器地址
  283. headers: {
  284. Authorization: "Bearer " + getToken(),
  285. },
  286. menuList:[],
  287. form:{
  288. avatar:"",
  289. nickName:"",
  290. sex:0,
  291. userName:"",
  292. deptId:"",
  293. majorId:"",
  294. grade:"",
  295. dateBirth:"",
  296. email:"",
  297. phonenumber:"",
  298. tutorUserId:"",
  299. education:"",
  300. workStatus:"",
  301. cardNum:"",
  302. status:0,
  303. },
  304. rules:{
  305. gradeName: [{ required: true, message: "请输入班级名称", trigger: "blur" },
  306. { required: true, message: "请输入班级名称", validator: this.spaceJudgment, trigger: "blur" }],
  307. nickName: [{ required: true, message: "请输入姓名", trigger: "blur" },
  308. { required: true, message: "请输入姓名", validator: this.spaceJudgment, trigger: "blur" }],
  309. userName: [{ required: true, message: "请输入学号", trigger: "blur" },
  310. { required: true, message: "请输入学号", validator: this.spaceJudgment, trigger: "blur" }],
  311. deptId: [{ required: true, message: "请选择所在学院", trigger: "blur" }],
  312. majorId: [{ required: true, message: "请选择专业", trigger: "blur" }],
  313. phonenumber: [
  314. { required: true, message: "请输入手机号码", trigger: "blur" },
  315. { required: true, message: "请输入手机号码", validator: this.spaceJudgment, trigger: "blur" }
  316. ],
  317. },
  318. textType:false,
  319. //数据范围列表
  320. optionsDataList:[
  321. {type: 0, value: "所有数据",},
  322. {type: 1, value: "本部门及下级部门数据",},
  323. {type: 2, value: "本部门及指定部门数据",},
  324. {type: 3, value: "当前账号数据",},
  325. ],
  326. //学院数据列表
  327. deptOptions:[],
  328. //快捷权限列表
  329. templateList:[{name:"校领导",id:"0"},{name:"教师",id:"1"},{name:"助教",id:"2"}],
  330. templateKey:"",
  331. templateName:"",
  332. //权限勾选数据
  333. permissionOpen:false,
  334. permissionCheckData:{},
  335. allCheckType:false,
  336. //导师查询数据
  337. tutorUserOptions:[],
  338. //专业查询数据
  339. majorOptions:[],
  340. //班级查询数据
  341. gradeOptions:[
  342. {id:9981,className:"+ 添加班级"}
  343. ],
  344. //学生类别查询数据
  345. educationOptions:[],
  346. //学籍状态查询数据
  347. workStatusOptions:[],
  348. //新增班级弹窗开关
  349. gradeOpen:false,
  350. gradeForm:{
  351. gradeName:"",
  352. }
  353. }
  354. },
  355. created(){
  356. if(this.propsData.userId){
  357. if(this.propsData.avatar){
  358. this.form.avatar = this.propsData.avatar;
  359. }else{
  360. this.form.avatar = '';
  361. }
  362. if(this.propsData.nickName){
  363. this.form.nickName = this.propsData.nickName;
  364. }else{
  365. this.form.nickName = '';
  366. }
  367. if(this.propsData.sex){
  368. this.form.sex = parseInt(this.propsData.sex);
  369. }else{
  370. this.form.sex = 0;
  371. }
  372. if(this.propsData.userName){
  373. this.form.userName = this.propsData.userName;
  374. }else{
  375. this.form.userName = '';
  376. }
  377. if(this.propsData.deptId){
  378. this.form.deptId = this.propsData.deptId;
  379. }else{
  380. this.form.deptId = '';
  381. }
  382. if(this.propsData.majorId){
  383. this.form.majorId = parseInt(this.propsData.majorId);
  384. }else{
  385. this.form.majorId = '';
  386. }
  387. if(this.propsData.grade){
  388. this.form.grade = parseInt(this.propsData.grade);
  389. }else{
  390. this.form.grade = '';
  391. }
  392. if(this.propsData.dateBirth){
  393. this.form.dateBirth = this.propsData.dateBirth;
  394. }else{
  395. this.form.dateBirth = '';
  396. }
  397. if(this.propsData.email){
  398. this.form.email = this.propsData.email;
  399. }else{
  400. this.form.email = '';
  401. }
  402. if(this.propsData.phonenumber){
  403. this.form.phonenumber = this.propsData.phonenumber;
  404. }else{
  405. this.form.phonenumber = '';
  406. }
  407. if(this.propsData.tutorUserId){
  408. this.form.tutorUserId = this.propsData.tutorUserId;
  409. }else{
  410. this.form.tutorUserId = '';
  411. }
  412. if(this.propsData.education){
  413. this.form.education = this.propsData.education;
  414. }else{
  415. this.form.education = '';
  416. }
  417. if(this.propsData.workStatus){
  418. this.form.workStatus = this.propsData.workStatus;
  419. }else{
  420. this.form.workStatus = '';
  421. }
  422. if(this.propsData.cardNum){
  423. this.form.cardNum = this.propsData.cardNum;
  424. }else{
  425. this.form.cardNum = '';
  426. }
  427. if(this.propsData.status){
  428. this.form.status = parseInt(this.propsData.status);
  429. }else{
  430. this.form.status = '';
  431. }
  432. if(this.propsData.faceImg){
  433. this.form.faceImg = this.propsData.faceImg;
  434. }else{
  435. this.form.faceImg = '';
  436. }
  437. if(this.propsData.signature){
  438. this.form.signature = this.propsData.signature;
  439. }else{
  440. this.form.signature = '';
  441. }
  442. this.getSelect();
  443. }else{
  444. this.getAll();
  445. this.majorSelectAll();
  446. this.gradeSelectAll();
  447. }
  448. },
  449. mounted(){
  450. this.listDepartments();
  451. },
  452. methods:{
  453. upDataClick(){
  454. this.$refs["form"].validate(valid => {
  455. if (valid) {
  456. if(this.form.email){
  457. let re = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
  458. if(!re.test(this.form.email)){
  459. this.msgError('请输入正确的邮箱地址')
  460. return
  461. }
  462. }
  463. if(this.propsData.userId){
  464. //编辑
  465. this.form.userId = this.propsData.userId
  466. putUserStudent(this.form).then(response => {
  467. if(response.code==200){
  468. this.msgSuccess(response.msg)
  469. this.outPageButton()
  470. }else if(response.code==205){
  471. this.$confirm(response.msg, "警告", {
  472. confirmButtonText: "确定",
  473. cancelButtonText: "取消",
  474. type: "warning"
  475. }).then(() => {
  476. // 确定
  477. this.$router.push({ path: '/comprehensive/laboratoryManagement/accessAuthorization' });
  478. }).catch(function() {
  479. // 取消
  480. this.outPageButton();
  481. });
  482. }
  483. });
  484. }else{
  485. //新增
  486. addUserStudent(this.form).then(response => {
  487. if(response.code==200){
  488. this.msgSuccess(response.msg)
  489. this.outPageButton()
  490. }else if(response.code==205){
  491. this.$confirm(response.msg, "警告", {
  492. confirmButtonText: "确定",
  493. cancelButtonText: "取消",
  494. type: "warning"
  495. }).then(() => {
  496. // 确定
  497. this.$router.push({ path: '/comprehensive/laboratoryManagement/accessAuthorization' });
  498. }).catch(function() {
  499. // 取消
  500. this.outPageButton();
  501. });
  502. }
  503. });
  504. }
  505. }
  506. });
  507. },
  508. //查询所有搜索接口数据
  509. getAll(){
  510. //学籍状态查询
  511. getVague({dictType:"student_status", dictLabel:""}).then(response => {
  512. this.workStatusOptions = response.data;
  513. });
  514. //学生类别查询
  515. getVague({dictType:"education",dictLabel:""}).then(response => {
  516. this.educationOptions = response.data;
  517. });
  518. },
  519. getSelect(){
  520. //导师查询
  521. if(this.propsData.tutorUserName){
  522. getTeacherOption({nickName:this.propsData.tutorUserName}).then(response => {
  523. this.tutorUserOptions = response.data;
  524. });
  525. }
  526. //专业查询
  527. getMajorList({majorName:this.propsData.major}).then(response => {
  528. this.majorOptions = response.data;
  529. });
  530. //班级查询
  531. getWorkList({className:this.propsData.className}).then(response => {
  532. this.gradeOptions = response.data;
  533. this.gradeOptions.push({className:"+ 添加班级",id:9981});
  534. });
  535. //学籍状态查询
  536. getVague({dictType:"student_status", dictLabel:""}).then(response => {
  537. this.workStatusOptions = response.data;
  538. });
  539. //学生类别查询
  540. getVague({dictType:"education",dictLabel:""}).then(response => {
  541. this.educationOptions = response.data;
  542. });
  543. },
  544. //新增班级关闭
  545. gradeOpenOff(){
  546. this.gradeOpen = false;
  547. },
  548. //新增班级提交
  549. gradeOpenUp(){
  550. this.$refs["gradeForm"].validate(valid => {
  551. if (valid) {
  552. let obj = {
  553. className:this.gradeForm.gradeName,
  554. }
  555. addSystemClass(obj).then(response => {
  556. this.gradeOptions.unshift({className:response.data.classObject.className,id:response.data.classObject.id});
  557. this.form.grade = response.data.classObject.id;
  558. this.gradeOpen = false;
  559. this.msgSuccess(response.msg);
  560. });
  561. }
  562. });
  563. },
  564. //账号启用停用开关
  565. changeIsNeedCaptcha(){
  566. this.form.status = this.form.status == 1?0:1;
  567. },
  568. //*************************学籍状态查询
  569. workStatusSelect(query){
  570. if (query !== '') {
  571. let obj = {
  572. dictType:"student_status",
  573. dictLabel:query
  574. };
  575. getVague(obj).then(response => {
  576. this.workStatusOptions = response.data;
  577. });
  578. } else {
  579. this.workStatusOptions = [];
  580. }
  581. },
  582. //学籍状态选中触发
  583. workStatusSelectClick(data){
  584. console.log("学籍状态选中触发",data)
  585. },
  586. //学籍状态清空触发
  587. workStatusClearClick(){
  588. console.log("学籍状态清空触发")
  589. getVague({dictType:"student_status", dictLabel:""}).then(response => {
  590. this.workStatusOptions = response.data;
  591. });
  592. },
  593. //*************************学生类别查询
  594. educationSelect(query){
  595. if (query !== '') {
  596. let obj = {
  597. dictType:"education",
  598. dictLabel:query
  599. };
  600. getVague(obj).then(response => {
  601. this.educationOptions = response.data;
  602. });
  603. } else {
  604. this.educationOptions = [];
  605. }
  606. },
  607. //学生类别选中触发
  608. educationSelectClick(data){
  609. console.log("学生类别选中触发",data)
  610. },
  611. //学生类别清空触发
  612. educationClearClick(){
  613. console.log("学生类别清空触发")
  614. getVague({dictType:"education",dictLabel:""}).then(response => {
  615. this.educationOptions = response.data;
  616. });
  617. },
  618. //*************************班级查询
  619. gradeSelectNull(type){
  620. if(!type&&!this.gradeOptions[1]){
  621. this.gradeSelectAll();
  622. }
  623. },
  624. gradeSelectAll(){
  625. let obj = {
  626. className:'',
  627. }
  628. getWorkList(obj).then(response => {
  629. this.gradeOptions = response.data;
  630. this.gradeOptions.push({className:"+ 添加班级",id:9981});
  631. });
  632. },
  633. gradeSelect(query){
  634. if (query !== '') {
  635. let obj = {
  636. className:query,
  637. }
  638. getWorkList(obj).then(response => {
  639. this.gradeOptions = response.data;
  640. this.gradeOptions.push({className:"+ 添加班级",id:9981});
  641. });
  642. } else {
  643. this.optionsUser = [];
  644. }
  645. },
  646. //班级选中触发
  647. gradeSelectClick(data){
  648. console.log("班级选中触发",data);
  649. if(data == 9981){
  650. this.gradeForm.gradeName = "";
  651. this.form.grade = "";
  652. this.gradeOpen = true;
  653. }
  654. },
  655. //班级清空触发
  656. gradeClearClick(){
  657. console.log("班级清空触发")
  658. this.gradeSelectAll();
  659. },
  660. //*************************专业查询
  661. majorSelectNull(type){
  662. console.log("type",type);
  663. if(!type&&!this.majorOptions[0]){
  664. this.majorSelectAll();
  665. }
  666. },
  667. majorSelectAll(){
  668. let obj = {
  669. majorName:'',
  670. };
  671. getMajorList(obj).then(response => {
  672. this.majorOptions = response.data;
  673. });
  674. },
  675. majorSelect(query){
  676. if (query !== '') {
  677. let obj = {
  678. majorName:query,
  679. };
  680. getMajorList(obj).then(response => {
  681. this.majorOptions = response.data;
  682. });
  683. } else {
  684. this.majorOptions = [];
  685. }
  686. },
  687. //专业选中触发
  688. majorSelectClick(data){
  689. console.log("专业选中触发",data)
  690. },
  691. //专业清空触发
  692. majorClearClick(){
  693. console.log("专业清空触发")
  694. this.majorSelectAll();
  695. },
  696. //*************************导师查询
  697. tutorUserSelect(query){
  698. if (query !== '') {
  699. let obj = {
  700. nickName:query,
  701. }
  702. getTeacherOption(obj).then(response => {
  703. this.tutorUserOptions = response.data;
  704. });
  705. } else {
  706. this.tutorUserOptions = [];
  707. }
  708. },
  709. //导师选中触发
  710. tutorUserSelectClick(data){
  711. console.log("导师选中触发",data)
  712. },
  713. //导师清空触发
  714. tutorUserClearClick(){
  715. console.log("导师清空触发")
  716. this.tutorUserOptions = [];
  717. },
  718. //获取学院列表
  719. listDepartments(){
  720. listDepartments().then(response => {
  721. this.deptOptions = response.data;
  722. });
  723. },
  724. //上传
  725. handleAvatarSuccess(res, file) {
  726. console.log(res.data.url);
  727. this.form.avatar = res.data.url;
  728. this.$forceUpdate()
  729. },
  730. beforeAvatarUpload(file) {
  731. let type = false;
  732. console.log('file',file);
  733. if (file.type == 'image/png' || file.type == 'image/jpeg' || file.type == 'image/gif') {
  734. type = true;
  735. }else{
  736. this.$message.error('只能上传png/jpeg/gif格式图片');
  737. type = false;
  738. }
  739. return type;
  740. },
  741. //导入用户权限
  742. importUser(){
  743. this.$refs.userOpen.show();
  744. },
  745. //返回事件
  746. outPageButton(){
  747. this.$parent.outPage(1);
  748. },
  749. //模板选中
  750. templateClick(id){
  751. let self = this;
  752. if(this.templateKey != id){
  753. this.templateKey = id;
  754. for(let i=0;i<self.templateList.length;i++){
  755. if(id == self.templateList[i].id){
  756. this.templateName = self.templateList[i].name;
  757. }
  758. }
  759. }else{
  760. this.templateKey = "";
  761. this.templateName = "";
  762. }
  763. },
  764. //清除模板选中
  765. templateDel(){
  766. this.templateKey = "";
  767. this.templateName = "";
  768. },
  769. //权限详情按钮
  770. permissionDetails(item){
  771. console.log('item',item)
  772. let num = 0;
  773. for(let i=0;i<item.children.length;i++){
  774. if(item.children[i].checkType){
  775. num++
  776. }
  777. }
  778. this.allCheckType = num != 0;
  779. this.$set(this,'permissionCheckData',item)
  780. this.permissionOpen = true;
  781. },
  782. //数据范围刷新
  783. optionChange(){
  784. this.$forceUpdate()
  785. },
  786. //模块勾选逻辑
  787. itemCheckClick(status,type,item){
  788. if(status == 1 || status == 2 || status == 3){
  789. //一级菜单勾选
  790. if(item.children){
  791. for(let i=0;i<item.children.length;i++){
  792. item.children[i].checkType = !!type;
  793. if(item.children[i].children){
  794. for(let o=0;o<item.children[i].children.length;o++){
  795. item.children[i].children[o].checkType = !!type;
  796. if(item.children[i].children[o].children){
  797. for(let x=0;x<item.children[i].children[o].children.length;x++){
  798. item.children[i].children[o].children[x].checkType = !!type;
  799. }
  800. }
  801. if(item.children[i].children[o].menuType == 'C'){
  802. item.children[i].children[o].scopeCheckType = !!type;
  803. item.children[i].children[o].value = type?0:"";
  804. item.children[i].children[o].permissionCheckType = !!type;
  805. }
  806. }
  807. }
  808. if(item.children[i].menuType == 'C'){
  809. item.children[i].scopeCheckType = !!type;
  810. item.children[i].value = type?0:"";
  811. item.children[i].permissionCheckType = !!type;
  812. }
  813. }
  814. }
  815. if(item.menuType == 'C'){
  816. item.scopeCheckType = !!type;
  817. item.value = type?0:"";
  818. item.permissionCheckType = !!type;
  819. }
  820. }else if(status == 4){
  821. //数据范围勾选
  822. item.scopeCheckType = !!type;
  823. item.value = type?0:"";
  824. }else if(status == 5){
  825. //管理权限勾选
  826. item.permissionCheckType = !!type;
  827. for(let i=0;i<item.children.length;i++){
  828. item.children[i].checkType = !!type;
  829. }
  830. }
  831. },
  832. //权限勾选逻辑
  833. permissionCheckClick(status,type){
  834. let self = this;
  835. if(status == 1){
  836. for(let i=0;i<self.permissionCheckData.children.length;i++){
  837. self.permissionCheckData.children[i].checkType = !!type;
  838. self.permissionCheckData.permissionCheckType = !!type;
  839. }
  840. }else if(status == 2){
  841. if(type&&!this.allCheckType){
  842. this.allCheckType = true;
  843. this.permissionCheckData.permissionCheckType = true;
  844. }else{
  845. let num = 0;
  846. for(let i=0;i<self.permissionCheckData.children.length;i++){
  847. if(!self.permissionCheckData.children[i].checkType){
  848. num++
  849. }
  850. }
  851. if(num == self.permissionCheckData.children.length){
  852. this.allCheckType = false;
  853. this.permissionCheckData.permissionCheckType = false;
  854. }
  855. }
  856. }
  857. this.$forceUpdate();
  858. },
  859. showText(){
  860. console.log("1")
  861. this.textType = true;
  862. },
  863. hideText(){
  864. console.log("2")
  865. this.textType = false;
  866. },
  867. }
  868. }
  869. </script>
  870. <style scoped lang="scss">
  871. .student-add-page{
  872. flex:1;
  873. display: flex;
  874. flex-direction: column;
  875. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  876. padding:0 0 20px!important;
  877. *{
  878. margin:0;
  879. }
  880. .top-title-box{
  881. border-bottom:1px solid #E0E0E0;
  882. display: flex;
  883. p:nth-child(1){
  884. color:#0045AF;
  885. line-height:80px;
  886. margin-left:24px;
  887. font-size:18px;
  888. flex:1;
  889. }
  890. p:nth-child(2){
  891. border:1px solid #0045AF;
  892. color:#0045AF;
  893. width:80px;
  894. height:30px;
  895. text-align: center;
  896. font-size:16px;
  897. border-radius: 6px;
  898. line-height:30px;
  899. margin:25px 20px 0 0;
  900. cursor: pointer;
  901. }
  902. }
  903. .top-info-box{
  904. flex:1;
  905. display: flex;
  906. padding:40px 20px 0;
  907. .left-info-box{
  908. margin-right:20px;
  909. img{
  910. width:100px;
  911. height:120px;
  912. }
  913. p{
  914. width: 80px;
  915. height: 26px;
  916. border: 1px solid #0183FA;
  917. border-radius: 6px;
  918. line-height:24px;
  919. font-size:12px;
  920. color:#0183FA;
  921. text-align: center;
  922. margin:24px 10px;
  923. }
  924. }
  925. }
  926. .for-button-list{
  927. background: #E5F2FE;
  928. margin:0 20px;
  929. display: flex;
  930. .for-title-p{
  931. width:175px;
  932. height:80px;
  933. line-height:80px;
  934. font-size:16px;
  935. color:#333;
  936. text-align: center;
  937. }
  938. .for-button-max-box{
  939. flex:1;
  940. .for-button-min-box{
  941. font-size:16px;
  942. display: inline-block;
  943. overflow: hidden;
  944. height:30px;
  945. line-height:30px;
  946. border-radius:6px;
  947. margin:25px 28px 0 0;
  948. cursor: pointer;
  949. i{
  950. height:30px;
  951. line-height:30px;
  952. font-size:16px;
  953. color:#fff;
  954. margin-right:6px;
  955. }
  956. }
  957. .colorAA{
  958. color: #ffffff;
  959. background: #0183FA;
  960. padding:0 26px 0 16px;
  961. }
  962. .colorBB{
  963. padding:0 26px;
  964. color: #333;
  965. background: #E0E0E0;
  966. }
  967. }
  968. }
  969. .template-name-box{
  970. display: flex;
  971. .template-name-p{
  972. font-weight:500;
  973. height:80px;
  974. line-height:80px;
  975. font-size:16px;
  976. color:#333;
  977. margin-left:20px;
  978. flex: 1;
  979. }
  980. .template-name-button{
  981. width:80px;
  982. height:40px;
  983. line-height:40px;
  984. margin:20px 20px 0 0;
  985. }
  986. .template-name-button-one{
  987. width:180px;
  988. height:40px;
  989. line-height:40px;
  990. margin:20px 40px 0 0;
  991. color:#fff;
  992. background: #0183FA;
  993. border: 1px solid #E0E0E0;
  994. cursor: pointer;
  995. font-size: 14px;
  996. text-align: center;
  997. border-radius: 6px;
  998. }
  999. }
  1000. .table-for-max-box{
  1001. border:1px solid #D7D7D7;
  1002. margin:0 20px;
  1003. *{
  1004. margin:0;
  1005. padding:0;
  1006. }
  1007. .table-title-box{
  1008. background: rgba(1,131,250,0.1);
  1009. display: flex;
  1010. p{
  1011. font-size:14px;
  1012. font-weight:700;
  1013. color:#333;
  1014. line-height:48px;
  1015. padding-left:20px;
  1016. }
  1017. p:nth-child(1){
  1018. width:615px;
  1019. border-right:1px solid #D7D7D7;
  1020. }
  1021. }
  1022. .table-for-big-box{
  1023. border-top:1px solid #D7D7D7;
  1024. display: flex;
  1025. font-size:14px;
  1026. .max-title-box-null{
  1027. width:615px!important;
  1028. }
  1029. .max-title-box{
  1030. width:230px;
  1031. border-right:1px solid #D7D7D7;
  1032. min-height:48px;
  1033. position: relative;
  1034. p{
  1035. position: absolute;
  1036. top:50%;
  1037. left:20px;
  1038. height:18px;
  1039. line-height:18px;
  1040. margin-top:-9px;
  1041. }
  1042. }
  1043. .max-right-box{
  1044. flex:5;
  1045. min-height:48px;
  1046. .big-box:nth-child(1){
  1047. border:none!important;
  1048. }
  1049. .big-box-null{
  1050. line-height:48px;
  1051. margin-left:20px;
  1052. color:#606266;
  1053. }
  1054. .big-box{
  1055. display: flex;
  1056. border-top:1px solid #D7D7D7;
  1057. .big-title-box-null{
  1058. width:385px!important;
  1059. }
  1060. .big-title-box{
  1061. width:180px;
  1062. border-right:1px solid #D7D7D7;
  1063. min-height:48px;
  1064. position: relative;
  1065. overflow: hidden;
  1066. p{
  1067. position: absolute;
  1068. top:50%;
  1069. left:20px;
  1070. height:48px;
  1071. line-height:48px;
  1072. margin-top:-24px;
  1073. }
  1074. }
  1075. .big-right-box-null{
  1076. display: flex;
  1077. .scope-box{
  1078. width:430px;
  1079. position: relative;
  1080. overflow: hidden;
  1081. border-right:1px solid #D7D7D7;
  1082. p{
  1083. position: absolute;
  1084. top:50%;
  1085. left:20px;
  1086. height:48px;
  1087. line-height:48px;
  1088. margin-top:-24px;
  1089. }
  1090. }
  1091. .permission-box{
  1092. flex:1;
  1093. position: relative;
  1094. overflow: hidden;
  1095. display: flex;
  1096. .check-left-p{
  1097. margin-left:20px;
  1098. height:48px;
  1099. line-height:48px;
  1100. }
  1101. .check-button-box{
  1102. width:130px;
  1103. height:36px;
  1104. margin:6px 0 0 36px;
  1105. line-height:36px;
  1106. display: flex;
  1107. color:#333;
  1108. cursor: pointer;
  1109. img{
  1110. width:16px;
  1111. height:16px;
  1112. margin:10px 14px 0 19px;
  1113. }
  1114. }
  1115. .check-button-box-colorA{
  1116. background: #CCE6FE;
  1117. color:#0183FA;
  1118. }
  1119. .check-button-box-colorB{
  1120. background: #E0E0E0;
  1121. color:#333;
  1122. }
  1123. }
  1124. }
  1125. .big-right-box{
  1126. flex:5;
  1127. min-height:48px;
  1128. .min-box:nth-child(1){
  1129. border:none!important;
  1130. }
  1131. .min-box{
  1132. display: flex;
  1133. border-top:1px solid #D7D7D7;
  1134. .min-title-box{
  1135. width:205px;
  1136. border-right:1px solid #D7D7D7;
  1137. min-height:48px;
  1138. position: relative;
  1139. overflow: hidden;
  1140. p{
  1141. position: absolute;
  1142. top:50%;
  1143. left:20px;
  1144. height:48px;
  1145. line-height:48px;
  1146. margin-top:-24px;
  1147. }
  1148. }
  1149. .min-right-box{
  1150. flex:5;
  1151. min-height:48px;
  1152. display: flex;
  1153. .scope-box{
  1154. width:430px;
  1155. position: relative;
  1156. overflow: hidden;
  1157. border-right:1px solid #D7D7D7;
  1158. p{
  1159. position: absolute;
  1160. top:50%;
  1161. left:20px;
  1162. height:48px;
  1163. line-height:48px;
  1164. margin-top:-24px;
  1165. }
  1166. }
  1167. .permission-box{
  1168. flex:1;
  1169. position: relative;
  1170. overflow: hidden;
  1171. display: flex;
  1172. .check-left-p{
  1173. margin-left:20px;
  1174. height:48px;
  1175. line-height:48px;
  1176. }
  1177. .check-button-box{
  1178. width:130px;
  1179. height:36px;
  1180. margin:6px 0 0 36px;
  1181. line-height:36px;
  1182. display: flex;
  1183. color:#333;
  1184. cursor: pointer;
  1185. img{
  1186. width:16px;
  1187. height:16px;
  1188. margin:10px 14px 0 19px;
  1189. }
  1190. }
  1191. .check-button-box-colorA{
  1192. background: #CCE6FE;
  1193. color:#0183FA;
  1194. }
  1195. .check-button-box-colorB{
  1196. background: #E0E0E0;
  1197. color:#333;
  1198. }
  1199. }
  1200. }
  1201. }
  1202. }
  1203. }
  1204. }
  1205. }
  1206. }
  1207. .bottom-button-box{
  1208. display: flex;
  1209. width:600px;
  1210. margin:30px auto 10px;
  1211. .null-p{
  1212. flex:1;
  1213. }
  1214. .button-p-1{
  1215. width:100px;
  1216. margin-right:20px;
  1217. }
  1218. .button-p-2{
  1219. width:100px;
  1220. margin-right:20px;
  1221. }
  1222. .button-p-3{
  1223. width:180px;
  1224. }
  1225. }
  1226. }
  1227. </style>
  1228. <style lang="scss">
  1229. .student-add-page{
  1230. .top-info-box{
  1231. .el-form-item{
  1232. height:70px;
  1233. }
  1234. .el-input--small{
  1235. width:180px!important;
  1236. }
  1237. .el-select{
  1238. width:180px!important;
  1239. }
  1240. .el-input{
  1241. width:180px!important;
  1242. }
  1243. .el-input__inner{
  1244. width:180px!important;
  1245. }
  1246. .el-radio-group{
  1247. width:180px!important;
  1248. }
  1249. .is-disabled{
  1250. width:180px!important;
  1251. }
  1252. .switch .el-switch__label {
  1253. position: absolute;
  1254. display: none;
  1255. color: #fff !important;
  1256. }
  1257. .switch .el-switch__label--right {
  1258. z-index: 1;
  1259. }
  1260. .switch .el-switch__label--right span{
  1261. margin-left: 10px;
  1262. }
  1263. .switch .el-switch__label--left {
  1264. z-index: 1;
  1265. }
  1266. .switch .el-switch__label--left span{
  1267. margin-left: 24px;
  1268. }
  1269. .switch .el-switch__label.is-active {
  1270. display: block;
  1271. }
  1272. .switch.el-switch .el-switch__core,
  1273. .el-switch .el-switch__label {
  1274. width: 64px !important;
  1275. margin: 0;
  1276. }
  1277. }
  1278. }
  1279. </style>