addteacher.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702
  1. <template>
  2. <view class="addbox">
  3. <uni-forms ref="form" :rules="rules" :modelValue="datainfo">
  4. <!-- 家长 -->
  5. <view class="ftit">基本信息</view>
  6. <view class="fbox">
  7. <picker range-key="dictLabel" v-if="roles!='teacher'&&pagetype=='add'" :range="classlist" :value="classidx" @change="bindDateChangeb">
  8. <uni-forms-item name="className" label="班级">
  9. <view class="f15 flex1 txr co16" v-if="datainfo.className" >{{datainfo.className}}</view>
  10. <view class="f15 flex1 txr coa" v-else >请选择班级</view>
  11. </uni-forms-item>
  12. </picker>
  13. <picker range-key="dictLabel" :disabled="pagetype=='update'||!teaflag" :range="teacherlist" :value="nameidx" @change="bindDateChangef">
  14. <uni-forms-item name="name" :disabled="pagetype=='update'||!teaflag" required label="老师">
  15. <view class="f15 flex1 txr co16" v-if="datainfo.name" >{{datainfo.name}}</view>
  16. <view class="f15 flex1 txr coa" v-else >请选择老师</view>
  17. </uni-forms-item>
  18. </picker>
  19. <uni-forms-item label="身份证号" name="idCard">
  20. <uni-easyinput :inputBorder="false" @blur="getIdcardInfo" v-model="datainfo.idCard" placeholder="请输入身份证号">
  21. </uni-easyinput>
  22. </uni-forms-item>
  23. <!-- <uni-forms-item label="姓名" name="name">
  24. <uni-easyinput :inputBorder="false" v-model="datainfo.name" placeholder="请输入姓名">
  25. </uni-easyinput>
  26. </uni-forms-item> -->
  27. <picker range-key="text" :range="sexrange" :value="sexidx" @change="bindDateChange">
  28. <uni-forms-item name="sex" required label="性别">
  29. <view class="f15 flex1 txr co16" v-if="datainfo.sex" >{{datainfo.sex==1?'男':'女'}}</view>
  30. <view class="f15 flex1 txr coa" v-else >请选择性别</view>
  31. </uni-forms-item>
  32. </picker>
  33. <uni-forms-item label="年龄" name="age">
  34. <uni-easyinput :inputBorder="false" v-model="datainfo.age" placeholder="请输入年龄">
  35. </uni-easyinput>
  36. </uni-forms-item>
  37. <picker range-key="dictLabel" :range="outlook" :value="lookidx" @change="bindDateChangea">
  38. <uni-forms-item name="politicalStatus" label="政治面貌">
  39. <view class="f15 flex1 txr" :class="datainfo.politicalStatus?'co16':'coa'">{{datainfo.politicalStatus||'请选择政治面貌'}}</view>
  40. </uni-forms-item>
  41. </picker>
  42. <picker range-key="dictLabel" :range="zctitle" :value="zcidx" @change="bindDateChangec">
  43. <uni-forms-item name="professional" label="职称">
  44. <view class="f15 flex1 txr" :class="datainfo.professional?'co16':'coa'">{{datainfo.professional||'请选择职称'}}</view>
  45. </uni-forms-item>
  46. </picker>
  47. <uni-forms-item label="联系方式" name="phone">
  48. <uni-easyinput :inputBorder="false" v-model="datainfo.phone" placeholder="请输入联系方式">
  49. </uni-easyinput>
  50. </uni-forms-item>
  51. <uni-forms-item label="居住地址" name="phone">
  52. <view @click="getMapFn" class="flexc flex1">
  53. <view class="flex1 f15 txr" :class="datainfo.address?'co16':'coa'">{{datainfo.address||'请选择居住地址'}}</view>
  54. <image :src="rimg" class="ilrmgr"></image>
  55. </view>
  56. </uni-forms-item>
  57. </view>
  58. <view class="ftit">职业信息</view>
  59. <view class="fbox">
  60. <!-- <uni-forms-item label="教龄" name="height">
  61. <uni-easyinput :inputBorder="false" v-model="datainfo.height" placeholder="请输入教龄 ">
  62. </uni-easyinput>
  63. <view class="f16 co16 ml6">年</view>
  64. </uni-forms-item> -->
  65. <picker mode="date" @change="bindDateChanged">
  66. <uni-forms-item name="onBoardTime" label="入职时间">
  67. <view class="f15 flex1 txr" :class="datainfo.onBoardTime?'co16':'coa'">{{datainfo.onBoardTime||'请选择入职时间'}}</view>
  68. </uni-forms-item>
  69. </picker>
  70. <picker mode="date" @change="bindDateChangee">
  71. <uni-forms-item name="jobTime" required label="参加工作时间">
  72. <view class="f15 flex1 txr" :class="datainfo.jobTime?'co16':'coa'">{{datainfo.jobTime||'请选择参加工作时间'}}</view>
  73. </uni-forms-item>
  74. </picker>
  75. </view>
  76. <view class="ftit">照片信息</view>
  77. <view class="fbox">
  78. <uni-forms-item label="证件照" name="identificationPhoto">
  79. <view class="flex1"></view>
  80. <view class="imgs">
  81. <view class="photos" v-for="(item,index) in zjfile" :key='index' @click="getPreview(zjfile,index)">
  82. <image :src="baseUrl+item" class="addimg"></image>
  83. <image :src="delimg" class="del" @click.stop="delimgFn('zj',index)" ></image>
  84. </view>
  85. <image :src="addimg" class="photos" v-if="zjfile.length<9" @click.stop="getphotoFn('zj')"></image>
  86. </view>
  87. </uni-forms-item>
  88. <uni-forms-item label="门禁照" name="entrancePermit">
  89. <view class="flex1"></view>
  90. <view class="imgs">
  91. <view class="photos" v-for="(item,index) in mjfile" :key='index' @click="getPreview(mjfile,index)">
  92. <image :src="baseUrl+item" class="addimg"></image>
  93. <image :src="delimg" class="del" @click.stop="delimgFn('mj',index)" ></image>
  94. </view>
  95. <image :src="addimg" class="photos" v-if="mjfile.length<9" @click.stop="getphotoFn('mj')"></image>
  96. </view>
  97. </uni-forms-item>
  98. </view>
  99. <view class="ftit">资质信息</view>
  100. <view class="fbox">
  101. <uni-forms-item label="毕业证明照" name="identificationPhoto">
  102. <view class="flex1"></view>
  103. <view class="imgs">
  104. <view class="photos" v-for="(item,index) in byzmfile" :key='index' @click="getPreview(byzmfile,index)">
  105. <image :src="baseUrl+item" class="addimg"></image>
  106. <image :src="delimg" class="del" @click.stop="delimgFn('byzm',index)" ></image>
  107. </view>
  108. <image :src="addsimg" class="photos" v-if="byzmfile.length<9" @click.stop="getphotoFn('byzm')"></image>
  109. </view>
  110. </uni-forms-item>
  111. <uni-forms-item label="毕业证书照" name="entrancePermit">
  112. <view class="flex1"></view>
  113. <view class="imgs">
  114. <view class="photos" v-for="(item,index) in byzsfile" :key='index' @click="getPreview(byzsfile,index)">
  115. <image :src="baseUrl+item" class="addimg"></image>
  116. <image :src="delimg" class="del" @click.stop="delimgFn('byzs',index)" ></image>
  117. </view>
  118. <image :src="addsimg" class="photos" v-if="byzsfile.length<9" @click.stop="getphotoFn('byzs')"></image>
  119. </view>
  120. </uni-forms-item>
  121. <uni-forms-item label="教资证明照" name="entrancePermit">
  122. <view class="flex1"></view>
  123. <view class="imgs">
  124. <view class="photos" v-for="(item,index) in jzzmfile" :key='index' @click="getPreview(jzzmfile,index)">
  125. <image :src="baseUrl+item" class="addimg"></image>
  126. <image :src="delimg" class="del" @click.stop="delimgFn('jzzm',index)" ></image>
  127. </view>
  128. <image :src="addsimg" class="photos" v-if="jzzmfile.length<9" @click.stop="getphotoFn('jzzm')"></image>
  129. </view>
  130. </uni-forms-item>
  131. <uni-forms-item label="职称证明照" name="entrancePermit">
  132. <view class="flex1"></view>
  133. <view class="imgs">
  134. <view class="photos" v-for="(item,index) in zczmfile" :key='index' @click="getPreview(zczmfile,index)">
  135. <image :src="baseUrl+item" class="addimg"></image>
  136. <image :src="delimg" class="del" @click.stop="delimgFn('zczm',index)" ></image>
  137. </view>
  138. <image :src="addsimg" class="photos" v-if="zczmfile.length<9" @click.stop="getphotoFn('zczm')"></image>
  139. </view>
  140. </uni-forms-item>
  141. </view>
  142. <view class="ftit">其他信息</view>
  143. <view class="fbox">
  144. <uni-forms-item label="身高" name="height">
  145. <uni-easyinput :inputBorder="false" v-model="datainfo.height" placeholder="请输入身高">
  146. </uni-easyinput>
  147. <view class="f16 co16 ml6">cm</view>
  148. </uni-forms-item>
  149. <uni-forms-item label="体重" name="weight">
  150. <uni-easyinput :inputBorder="false" v-model="datainfo.weight" placeholder="请输入体重">
  151. </uni-easyinput>
  152. <view class="f16 co16 ml6">kg</view>
  153. </uni-forms-item>
  154. <picker range-key="dictLabel" :range="bloodrange" :value="bloodidx" @change="bindDateChangeg">
  155. <uni-forms-item name="bloodType" label="血型">
  156. <view class="f15 flex1 txr" :class="datainfo.bloodType?'co16':'coa'">{{datainfo.bloodType||'请选择血型'}}</view>
  157. <image :src="rimg" class="ilrmgr"></image>
  158. </uni-forms-item>
  159. </picker>
  160. <!-- <uni-forms-item label="血型" name="bloodType">
  161. <uni-easyinput :inputBorder="false" v-model="datainfo.bloodType" placeholder="请输入血型">
  162. </uni-easyinput>
  163. </uni-forms-item> -->
  164. </view>
  165. <view class="fbtns">
  166. <view class="rebtn" @click="getSubmit">确认</view>
  167. </view>
  168. </uni-forms>
  169. </view>
  170. </template>
  171. <script>
  172. // import tabSearch from "@/components/toptab/search.vue"
  173. import config from '@/config'
  174. const baseUrl = config.baseUrl
  175. import {uploadmore,selectDictLabel} from '@/utils/common.js'
  176. import {getDeptList} from "@/api/mine/mine.js"
  177. import {getDictionaryFn} from '@/api/mine/register.js'
  178. import {getteaDetFn,getteaAddtFn,getteaPutFn,getteanoListFn} from "@/api/mine/files.js"
  179. export default {
  180. components:{},
  181. data(){
  182. return{
  183. // adddj
  184. addimg:require("@/mine/static/score/addd.png"),
  185. addsimg:require("@/mine/static/score/adddj.png"),
  186. delimg: require("@/static/images/del.png"),
  187. rimg:require("@/mine/static/score/rimg.png"),
  188. date:'',
  189. baseUrl:'',
  190. sexrange:[{"val": 1,"text":"男"},{"val":2,"text":"女"}],// 性别
  191. zjfile:[],
  192. mjfile:[],
  193. byzmfile:[],
  194. byzsfile:[],
  195. jzzmfile:[],
  196. zczmfile:[],
  197. autoHeight:true,
  198. rules: {
  199. name: {rules: [{required: true,errorMessage: '请选择老师'}]},
  200. sex: {rules: [{required: true,errorMessage: '请选择性别'}]},
  201. jobTime: {rules: [{required: true,errorMessage: '请选择参加工作时间'}]},
  202. // subject: {rules: [{required: true,errorMessage: '请选择调课科目'}]},
  203. // beSubject: {rules: [{required: true,errorMessage: '请选择被调科目'}]},
  204. // week: {rules: [{required: true,errorMessage: '请选择时间(星期)'}]},
  205. },
  206. datainfo:{
  207. "teacherId":"",//学生id
  208. "name":"",//姓名
  209. "sex":"",//性别(1:男,2:女)
  210. "age":"",//年龄
  211. "school":"",//学校(汉字)
  212. "studentNumber":"",//学号
  213. "idCard":"",//身份证号
  214. "height":"",//身高
  215. "weight":"",//体重
  216. "bloodType":"",//血型
  217. "politicalStatus":"",//政治面貌(字典值:political_outlook)
  218. "identificationPhoto":"",//证件照(地址)
  219. "entrancePermit":"",//门禁照(地址)
  220. "graduationPhoto":"",//毕业证明照(地址)
  221. "degreePhoto":"",//学位证书照(地址)
  222. "teachingPhoto":"",//教资证明照(地址)
  223. "professionalPhoto":"",//职称证明照(地址)
  224. "address":"",
  225. 'onBoardTime':'',//入职时间
  226. 'jobTime':'',//入职时间
  227. 'professional':'',//职称
  228. "classId":'',
  229. "className":''
  230. },
  231. pagetype:'add',
  232. stulist:'',
  233. schoolval:[],
  234. outlook:[],
  235. zctitle:[],
  236. bloodrange:[],
  237. zcidx:0,
  238. bloodidx:0,
  239. sexidx:0,
  240. lookidx:0,
  241. schoolidx:0,
  242. classidx:0,
  243. nameidx:0,
  244. id:'',
  245. schoolId:'',
  246. classlist:[],
  247. teacherlist:[],
  248. teaflag:true,
  249. roles:''
  250. }
  251. },
  252. onLoad: function(e) {
  253. uni.$on('refreshaddr',(e) => {
  254. var addr=JSON.parse(JSON.stringify(e))
  255. this.datainfo.address=e.address
  256. this.datainfo.longitude=e.lng
  257. this.datainfo.latitude=e.lat
  258. })
  259. this.pagetype=e.type||'add';
  260. this.baseUrl=baseUrl;
  261. this.init()
  262. if(e.type=='update'){
  263. this.id=e.id
  264. this.getDataFn()
  265. }else{
  266. var roles=this.$store.state.user.choseroles;
  267. this.roles=roles;
  268. if(roles=='parents'){
  269. }else if(roles=='teacher'){
  270. // 老师
  271. this.datainfo.teacherId=this.$store.state.user.userId
  272. this.datainfo.name=this.$store.state.user.name
  273. this.datainfo.phone=this.$store.state.user.phonenumber
  274. this.teaflag=false
  275. }else{
  276. this.schoolId=this.$store.state.user.deptId;
  277. this.getclassListFn()
  278. }
  279. }
  280. },
  281. methods:{
  282. getclassListFn(){
  283. // 获取学校id
  284. var id=this.schoolId;
  285. getDeptList(id).then(res=>{
  286. if(res.code==200){
  287. var newArr=res.data;
  288. if(newArr&&newArr.length){
  289. this.classlist = newArr.map(v => {
  290. return {
  291. dictLabel: v.deptName,
  292. dictValue: v.deptId,
  293. }
  294. })
  295. }
  296. }else{
  297. this.$toast(res.msg)
  298. }
  299. })
  300. },
  301. getteanoListFn(){
  302. var params={
  303. classId:this.datainfo.classId
  304. }
  305. params['params[role]']=this.$store.state.user.choseroles
  306. getteanoListFn(params).then(res=>{
  307. if(res.code==200){
  308. this.teacherlist = res.rows.map(v => {
  309. return {
  310. dictLabel: v.teacherName,
  311. dictValue: Number(v.teacherId),
  312. classId:v.classId
  313. }
  314. })
  315. }
  316. })
  317. },
  318. go(idCard) {
  319. let sex = null;
  320. let birth = null;
  321. let myDate = new Date();
  322. let month = myDate.getMonth() + 1;
  323. let day = myDate.getDate();
  324. let age = 0;
  325. if (idCard.length === 18) {
  326. age = myDate.getFullYear() - idCard.substring(6, 10) - 1;
  327. sex = idCard.substring(16, 17);
  328. birth = idCard.substring(6, 10) + "-" + idCard.substring(10, 12) + "-" + idCard.substring(12, 14);
  329. if (idCard.substring(10, 12) < month || idCard.substring(10, 12) === month && idCard.substring(12, 14) <= day)
  330. age++;
  331. }
  332. if (idCard.length === 15) {
  333. age = myDate.getFullYear() - idCard.substring(6, 8) - 1901;
  334. sex = idCard.substring(13, 14);
  335. birth = "19" + idCard.substring(6, 8) + "-" + idCard.substring(8, 10) + "-" + idCard.substring(10, 12);
  336. if (idCard.substring(8, 10) < month || idCard.substring(8, 10) === month && idCard.substring(10, 12) <= day)
  337. age++;
  338. }
  339. if (sex % 2 === 0) sex = '2';
  340. else sex = '1';
  341. this.datainfo.sex = sex
  342. this.datainfo.age = age
  343. return {
  344. age,
  345. sex,
  346. birth
  347. }
  348. },
  349. /* 上传后端获取身份证信息 */
  350. getIdcardInfo(val) {
  351. var idCard=this.datainfo.idCard;
  352. if(!idCard){
  353. return
  354. }
  355. // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
  356. let _IDRe18 =/^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
  357. let _IDre15 = /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/
  358. // 校验身份证:
  359. if (_IDRe18.test(idCard) || _IDre15.test(idCard)) {
  360. this.go(idCard)
  361. } else {
  362. }
  363. },
  364. getMapFn(){
  365. // #ifdef APP-PLUS
  366. this.$tab.navigateTo('/mine/pages/files/maps')
  367. // #endif
  368. // #ifndef APP-PLUS
  369. this.$tab.navigateTo('/mine/pages/files/map')
  370. // #endif
  371. },
  372. getDataFn() {
  373. getteaDetFn(this.id).then(res => {
  374. if (res.code == 200) {
  375. this.datainfo = res.data;
  376. if(res.data.identificationPhoto){
  377. this.zjfile=res.data.identificationPhoto.split(',')
  378. }else{
  379. this.zjfile=[];
  380. }
  381. if(res.data.entrancePermit){
  382. this.mjfile=res.data.entrancePermit.split(',')
  383. }else{
  384. this.mjfile=[];
  385. }
  386. if(res.data.graduationPhoto){
  387. this.byzmfile=res.data.graduationPhoto.split(',')
  388. }else{
  389. this.byzmfile=[];
  390. }
  391. if(res.data.degreePhoto){
  392. this.byzsfile=res.data.degreePhoto.split(',')
  393. }else{
  394. this.byzsfile=[];
  395. }
  396. if(res.data.teachingPhoto){
  397. this.jzzmfile=res.data.teachingPhoto.split(',')
  398. }else{
  399. this.jzzmfile=[];
  400. }
  401. if(res.data.professionalPhoto){
  402. this.zczmfile=res.data.professionalPhoto.split(',')
  403. }else{
  404. this.zczmfile=[];
  405. }
  406. if(res.data.sex){
  407. this.sexidx=res.data.sex==1?0:1
  408. }
  409. this.datainfo.rzsh='123'
  410. // 政治面貌
  411. if(res.data.politicalStatus){
  412. for(var i=0;i<this.outlook.length;i++){
  413. if(this.outlook[i].dictLabel==res.data.politicalStatus){
  414. this.lookidx=Number(i)
  415. break;
  416. }
  417. }
  418. }
  419. // 职称
  420. if(res.data.professional){
  421. for(var i=0;i<this.zctitle.length;i++){
  422. if(this.zctitle[i].dictLabel==res.data.professional){
  423. this.zcidx=Number(i)
  424. break;
  425. }
  426. }
  427. }
  428. // if(res.data.school){
  429. // for(var i=0;i<this.schoolval.length;i++){
  430. // if(this.schoolval[i].dictLabel==res.data.school){
  431. // this.schoolidx=Number(i)
  432. // break;
  433. // }
  434. // }
  435. // }
  436. } else {
  437. this.$toast(res.msg)
  438. }
  439. })
  440. },
  441. init(){
  442. // 政治面貌
  443. getDictionaryFn('political_outlook').then(res=>{
  444. if(res.code==200){
  445. this.outlook = res.data.map(v => {
  446. return {
  447. dictLabel: v.dictLabel,
  448. dictValue: v.dictValue
  449. }
  450. })
  451. }
  452. })
  453. // 职称
  454. getDictionaryFn('title').then(res=>{
  455. if(res.code==200){
  456. this.zctitle = res.data.map(v => {
  457. return {
  458. dictLabel: v.dictLabel,
  459. dictValue: v.dictValue
  460. }
  461. })
  462. }
  463. })
  464. // 血型
  465. getDictionaryFn('blood_type').then(res=>{
  466. if(res.code==200){
  467. this.bloodrange = res.data.map(v => {
  468. return {
  469. dictLabel: v.dictLabel,
  470. dictValue: v.dictValue
  471. }
  472. })
  473. }
  474. })
  475. },
  476. getSubmit(){
  477. var that = this;
  478. this.$refs.form.validate().then(res => {
  479. var params = JSON.parse(JSON.stringify(this.datainfo))
  480. if (this.pagetype == 'add') {
  481. if(params.idCard){
  482. let _IDRe18 =
  483. /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
  484. let _IDre15 = /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/
  485. // 校验身份证:
  486. if (_IDRe18.test(params.idCard) || _IDre15.test(params.idCard)) {
  487. }else{
  488. this.$toast('请输入正确身份证号')
  489. return
  490. }
  491. }
  492. getteaAddtFn(params).then(res => {
  493. if (res.code == 200) {
  494. that.$toast('新增成功')
  495. setTimeout(function() {
  496. uni.$emit('refreshdalist');
  497. uni.navigateBack({
  498. delta:1
  499. })
  500. }, 1500)
  501. } else {
  502. this.$toast(res.msg)
  503. }
  504. })
  505. } else {
  506. getteaPutFn(params).then(res => {
  507. if (res.code == 200) {
  508. that.$toast('修改成功')
  509. setTimeout(function() {
  510. uni.$emit('refreshdadetail');
  511. uni.$emit('refreshdalist');
  512. uni.navigateBack({
  513. delta:1
  514. })
  515. }, 1500)
  516. } else {
  517. this.$toast(res.msg)
  518. }
  519. })
  520. }
  521. })
  522. },
  523. bindDateChange(e){
  524. var idx=e.detail.value
  525. this.datainfo.sex=this.sexrange[idx].val
  526. },
  527. bindDateChangea(e){
  528. var idx=e.detail.value
  529. this.datainfo.politicalStatus=this.outlook[idx].dictLabel
  530. },
  531. bindDateChangec(e){
  532. var idx=e.detail.value
  533. this.datainfo.professional=this.zctitle[idx].dictLabel
  534. },
  535. bindDateChanged(e){
  536. this.datainfo.onBoardTime=e.detail.value;
  537. },
  538. bindDateChangee(e){
  539. this.datainfo.jobTime=e.detail.value;
  540. },
  541. bindDateChangeb(e){
  542. var idx=e.detail.value
  543. this.datainfo.className=this.classlist[idx].dictLabel;
  544. this.datainfo.classId=this.classlist[idx].dictValue;
  545. this.datainfo.name='';
  546. this.datainfo.teacherId='';
  547. this.getteanoListFn()
  548. },
  549. bindDateChangef(e){
  550. var idx=e.detail.value
  551. this.datainfo.name=this.teacherlist[idx].dictLabel
  552. this.datainfo.teacherId=this.teacherlist[idx].dictValue
  553. },
  554. bindDateChangeg(e){
  555. var idx=e.detail.value
  556. this.datainfo.bloodType=this.bloodrange[idx].dictLabel
  557. },
  558. // 查看照片
  559. getPreview(iurl,idx) {
  560. var newArr=[];
  561. iurl.forEach(ite=>{
  562. var ds=this.baseUrl+ite
  563. newArr.push(ds)
  564. })
  565. uni.previewImage({
  566. urls: newArr,
  567. current:idx,
  568. success: function(data) {
  569. },
  570. fail: function(err) {
  571. console.log(err.errMsg);
  572. }
  573. });
  574. },
  575. delimgFn(e,idx){
  576. var that = this;
  577. if(e=='zj'){
  578. that.zjfile.splice(idx,1);
  579. that.datainfo.identificationPhoto=that.zjfile.join(',')
  580. }else if(e=='mj'){
  581. that.mjfile.splice(idx,1);
  582. that.datainfo.entrancePermit=that.mjfile.join(',')
  583. }else if(e=='byzm'){
  584. that.byzmfile.splice(idx,1);
  585. that.datainfo.entrancePermit=that.byzmfile.join(',')
  586. }else if(e=='byzs'){
  587. that.byzsfile.splice(idx,1);
  588. that.datainfo.entrancePermit=that.byzsfile.join(',')
  589. }else if(e=='jzzm'){
  590. that.jzzmfile.splice(idx,1);
  591. that.datainfo.entrancePermit=that.jzzmfile.join(',')
  592. }else if(e=='zczm'){
  593. that.zczmfile.splice(idx,1);
  594. that.datainfo.entrancePermit=that.zczmfile.join(',')
  595. }
  596. },
  597. getphotoFn(e){
  598. let that = this;
  599. let file =[],count=9
  600. if(e=='zj'){
  601. file = that.zjfile;
  602. count=9
  603. }else{
  604. file = that.mjfile;
  605. count=9
  606. }
  607. if(file.length < count){
  608. uni.chooseImage({
  609. count: count - parseInt(file.length),
  610. success:function(res){
  611. let img= res.tempFilePaths;
  612. if(img.length + file.length > count){
  613. uni.showToast({
  614. title: '最多上传'+count+'张图片',
  615. icon: 'none',
  616. duration: 2000
  617. })
  618. }else{
  619. let imglen = res.tempFilePaths.length;
  620. var fuwufile = [];
  621. uploadmore('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
  622. if(e=='zj'){
  623. that.zjfile = that.zjfile.concat(rs);
  624. that.datainfo.identificationPhoto=that.zjfile.join(',')
  625. }else if(e=='mj'){
  626. that.mjfile = that.mjfile.concat(rs);
  627. that.datainfo.entrancePermit=that.mjfile.join(',')
  628. }else if(e=='byzm'){
  629. that.byzmfile = that.byzmfile.concat(rs);
  630. that.datainfo.graduationPhoto=that.byzmfile.join(',')
  631. }else if(e=='byzs'){
  632. that.byzsfile = that.byzsfile.concat(rs);
  633. that.datainfo.degreePhoto=that.byzsfile.join(',')
  634. }else if(e=='jzzm'){
  635. that.jzzmfile = that.jzzmfile.concat(rs);
  636. that.datainfo.teachingPhoto=that.jzzmfile.join(',')
  637. }else if(e=='zczm'){
  638. that.zczmfile = that.zczmfile.concat(rs);
  639. that.datainfo.professionalPhoto=that.zczmfile.join(',')
  640. }
  641. })
  642. }
  643. }
  644. });
  645. }
  646. },
  647. },
  648. }
  649. </script>
  650. <style lang="scss" scoped>
  651. .addbox{padding: 24rpx 36rpx 180rpx;}
  652. .ftit{font-size: 30rpx;font-weight: 500;color: #666666;padding: 8rpx;margin-bottom: 16rpx;}
  653. .fbox{background: #FFFFFF;border-radius: 18rpx;padding: 12rpx 0;margin-bottom: 32rpx;
  654. .addimg{width: 120rpx;height: 120rpx;}
  655. .ilrmgr{width: 14rpx;height: 24rpx;margin-left: 20rpx;flex: 0 0 auto;}
  656. }
  657. .addbtn{height: 98rpx;width: 100%;
  658. background: #1f57e6;
  659. border-radius: 48rpx;display: flex;align-items: center;justify-content: center;font-size: 34rpx;font-weight: 500;
  660. color: #FFFFFF;}
  661. .comboxl{min-height: 70rpx;padding:15rpx 0rpx;box-sizing: border-box;line-height: 40rpx;flex: 1;
  662. textarea{width: 100%;font-size: 30rpx;color: #161616;text-align: right;}
  663. }
  664. .imgs{display: flex;align-items: center;flex-wrap: wrap;justify-content: flex-end;
  665. .photos{width: 120rpx;height: 120rpx;position: relative;margin: 0 0rpx 16rpx 16rpx;
  666. // &:nth-child(3n){margin-left: 0;}
  667. .rimg{width: 100%;height: 100%;}
  668. .del{width: 36rpx;height: 36rpx;position: absolute;right: 0rpx;top: 0rpx;}
  669. }
  670. }
  671. .addbox /deep/ .uni-forms{flex: 1;}
  672. .addbox /deep/ .uni-forms-item__label{flex: 0 0 auto;width: auto !important;font-size: 32rpx;font-weight: bold;
  673. color: #161616;}
  674. .addbox /deep/ .uni-forms .uni-forms-item{margin-bottom: 0;padding: 4rpx 32rpx;
  675. // &:nth-of-type(3){margin-bottom: 0;border-bottom: 0;}
  676. }
  677. .addbox /deep/ .uni-easyinput{height: 70rpx;}
  678. // .addbox /deep/ .uni-textarea-textarea{height: auto;}
  679. .addbox /deep/ .uni-forms-item__content{display: flex;align-items: center;flex-direction: row;}
  680. .addbox /deep/ .uni-easyinput{flex: 1;text-align: right;}
  681. .addbox /deep/ .uni-easyinput__placeholder-class{font-size: 30rpx;}
  682. .addbox /deep/ .uni-easyinput__content-input{font-size: 30rpx;}
  683. .addbox /deep/ .uni-forms-item__error{margin-top:-12rpx;left: auto;right: 0;}
  684. .addbox /deep/ .uni-data-checklist .checklist-group .checklist-box{margin-right: 30rpx;}
  685. .addbox /deep/ .uni-data-checklist .checklist-group{justify-content: flex-end;}
  686. </style>