addteacher.js 9.9 KB

1
  1. require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["mine/pages/files/addteacher"],{"0deb":function(t,e,i){"use strict";var a=i("877f"),n=i.n(a);n.a},"7bed":function(t,e,i){"use strict";i.r(e);var a=i("e89b"),n=i("b526");for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);i("0deb");var s=i("f0c5"),l=Object(s["a"])(n["default"],a["b"],a["c"],!1,null,"dca65278",null,!1,a["a"],void 0);e["default"]=l.exports},"877f":function(t,e,i){},b526:function(t,e,i){"use strict";i.r(e);var a=i("e8f5"),n=i.n(a);for(var o in a)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(o);e["default"]=n.a},e89b:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return a}));var a={uniForms:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-forms/components/uni-forms/uni-forms")]).then(i.bind(null,"6a99"))},uniFormsItem:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-forms/components/uni-forms-item/uni-forms-item")]).then(i.bind(null,"3b57"))},uniEasyinput:function(){return i.e("uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(i.bind(null,"5426"))}},n=function(){var t=this.$createElement,e=(this._self._c,this.zjfile.length),i=this.mjfile.length,a=this.byzmfile.length,n=this.byzsfile.length,o=this.jzzmfile.length,s=this.zczmfile.length;this.$mp.data=Object.assign({},{$root:{g0:e,g1:i,g2:a,g3:n,g4:o,g5:s}})},o=[]},e8f5:function(t,e,i){"use strict";(function(t){var a=i("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(i("1efe")),o=i("1214"),s=i("49a9"),l=i("ee5c"),d=i("5c3d"),r=n.default.baseUrl,c={components:{},data:function(){return{addimg:i("2135"),addsimg:i("ed2d"),delimg:i("2622"),rimg:i("8abc"),date:"",baseUrl:"",sexrange:[{val:1,text:"男"},{val:2,text:"女"}],zjfile:[],mjfile:[],byzmfile:[],byzsfile:[],jzzmfile:[],zczmfile:[],autoHeight:!0,rules:{name:{rules:[{required:!0,errorMessage:"请选择老师"}]},sex:{rules:[{required:!0,errorMessage:"请选择性别"}]},jobTime:{rules:[{required:!0,errorMessage:"请选择参加工作时间"}]}},datainfo:{teacherId:"",name:"",sex:"",age:"",school:"",studentNumber:"",idCard:"",height:"",weight:"",bloodType:"",politicalStatus:"",identificationPhoto:"",entrancePermit:"",graduationPhoto:"",degreePhoto:"",teachingPhoto:"",professionalPhoto:"",address:"",onBoardTime:"",jobTime:"",professional:"",classId:"",className:""},pagetype:"add",stulist:"",schoolval:[],outlook:[],zctitle:[],bloodrange:[],zcidx:0,bloodidx:0,sexidx:0,lookidx:0,schoolidx:0,classidx:0,nameidx:0,id:"",schoolId:"",classlist:[],teacherlist:[],teaflag:!0,roles:""}},onLoad:function(e){var i=this;if(t.$on("refreshaddr",(function(t){JSON.parse(JSON.stringify(t));i.datainfo.address=t.address,i.datainfo.longitude=t.lng,i.datainfo.latitude=t.lat})),this.pagetype=e.type||"add",this.baseUrl=r,this.init(),"update"==e.type)this.id=e.id,this.getDataFn();else{var a=this.$store.state.user.choseroles;this.roles=a,"parents"==a||("teacher"==a?(this.datainfo.teacherId=this.$store.state.user.userId,this.datainfo.name=this.$store.state.user.name,this.datainfo.phone=this.$store.state.user.phonenumber,this.teaflag=!1):(this.schoolId=this.$store.state.user.deptId,this.getclassListFn()))}},methods:{getclassListFn:function(){var t=this,e=this.schoolId;(0,s.getDeptList)(e).then((function(e){if(200==e.code){var i=e.data;i&&i.length&&(t.classlist=i.map((function(t){return{dictLabel:t.deptName,dictValue:t.deptId}})))}else t.$toast(e.msg)}))},getteanoListFn:function(){var t=this,e={classId:this.datainfo.classId};e["params[role]"]=this.$store.state.user.choseroles,(0,d.getteanoListFn)(e).then((function(e){200==e.code&&(t.teacherlist=e.rows.map((function(t){return{dictLabel:t.teacherName,dictValue:Number(t.teacherId),classId:t.classId}})))}))},go:function(t){var e=null,i=null,a=new Date,n=a.getMonth()+1,o=a.getDate(),s=0;return 18===t.length&&(s=a.getFullYear()-t.substring(6,10)-1,e=t.substring(16,17),i=t.substring(6,10)+"-"+t.substring(10,12)+"-"+t.substring(12,14),(t.substring(10,12)<n||t.substring(10,12)===n&&t.substring(12,14)<=o)&&s++),15===t.length&&(s=a.getFullYear()-t.substring(6,8)-1901,e=t.substring(13,14),i="19"+t.substring(6,8)+"-"+t.substring(8,10)+"-"+t.substring(10,12),(t.substring(8,10)<n||t.substring(8,10)===n&&t.substring(10,12)<=o)&&s++),e=e%2===0?"2":"1",this.datainfo.sex=e,this.datainfo.age=s,{age:s,sex:e,birth:i}},getIdcardInfo:function(t){var e=this.datainfo.idCard;if(e){(/^([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]$/.test(e)||/^([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}$/.test(e))&&this.go(e)}},getMapFn:function(){this.$tab.navigateTo("/mine/pages/files/map")},getDataFn:function(){var t=this;(0,d.getteaDetFn)(this.id).then((function(e){if(200==e.code){if(t.datainfo=e.data,e.data.identificationPhoto?t.zjfile=e.data.identificationPhoto.split(","):t.zjfile=[],e.data.entrancePermit?t.mjfile=e.data.entrancePermit.split(","):t.mjfile=[],e.data.graduationPhoto?t.byzmfile=e.data.graduationPhoto.split(","):t.byzmfile=[],e.data.degreePhoto?t.byzsfile=e.data.degreePhoto.split(","):t.byzsfile=[],e.data.teachingPhoto?t.jzzmfile=e.data.teachingPhoto.split(","):t.jzzmfile=[],e.data.professionalPhoto?t.zczmfile=e.data.professionalPhoto.split(","):t.zczmfile=[],e.data.sex&&(t.sexidx=1==e.data.sex?0:1),t.datainfo.rzsh="123",e.data.politicalStatus)for(var i=0;i<t.outlook.length;i++)if(t.outlook[i].dictLabel==e.data.politicalStatus){t.lookidx=Number(i);break}if(e.data.professional)for(i=0;i<t.zctitle.length;i++)if(t.zctitle[i].dictLabel==e.data.professional){t.zcidx=Number(i);break}}else t.$toast(e.msg)}))},init:function(){var t=this;(0,l.getDictionaryFn)("political_outlook").then((function(e){200==e.code&&(t.outlook=e.data.map((function(t){return{dictLabel:t.dictLabel,dictValue:t.dictValue}})))})),(0,l.getDictionaryFn)("title").then((function(e){200==e.code&&(t.zctitle=e.data.map((function(t){return{dictLabel:t.dictLabel,dictValue:t.dictValue}})))})),(0,l.getDictionaryFn)("blood_type").then((function(e){200==e.code&&(t.bloodrange=e.data.map((function(t){return{dictLabel:t.dictLabel,dictValue:t.dictValue}})))}))},getSubmit:function(){var e=this,i=this;this.$refs.form.validate().then((function(a){var n=JSON.parse(JSON.stringify(e.datainfo));if("add"==e.pagetype){if(n.idCard){if(!/^([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]$/.test(n.idCard)&&!/^([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}$/.test(n.idCard))return void e.$toast("请输入正确身份证号")}(0,d.getteaAddtFn)(n).then((function(a){200==a.code?(i.$toast("新增成功"),setTimeout((function(){t.$emit("refreshdalist"),t.navigateBack({delta:1})}),1500)):e.$toast(a.msg)}))}else(0,d.getteaPutFn)(n).then((function(a){200==a.code?(i.$toast("修改成功"),setTimeout((function(){t.$emit("refreshdadetail"),t.$emit("refreshdalist"),t.navigateBack({delta:1})}),1500)):e.$toast(a.msg)}))}))},bindDateChange:function(t){var e=t.detail.value;this.datainfo.sex=this.sexrange[e].val},bindDateChangea:function(t){var e=t.detail.value;this.datainfo.politicalStatus=this.outlook[e].dictLabel},bindDateChangec:function(t){var e=t.detail.value;this.datainfo.professional=this.zctitle[e].dictLabel},bindDateChanged:function(t){this.datainfo.onBoardTime=t.detail.value},bindDateChangee:function(t){this.datainfo.jobTime=t.detail.value},bindDateChangeb:function(t){var e=t.detail.value;this.datainfo.className=this.classlist[e].dictLabel,this.datainfo.classId=this.classlist[e].dictValue,this.datainfo.name="",this.datainfo.teacherId="",this.getteanoListFn()},bindDateChangef:function(t){var e=t.detail.value;this.datainfo.name=this.teacherlist[e].dictLabel,this.datainfo.teacherId=this.teacherlist[e].dictValue},bindDateChangeg:function(t){var e=t.detail.value;this.datainfo.bloodType=this.bloodrange[e].dictLabel},getPreview:function(e,i){var a=this,n=[];e.forEach((function(t){var e=a.baseUrl+t;n.push(e)})),t.previewImage({urls:n,current:i,success:function(t){},fail:function(t){console.log(t.errMsg)}})},delimgFn:function(t,e){"zj"==t?(this.zjfile.splice(e,1),this.datainfo.identificationPhoto=this.zjfile.join(",")):"mj"==t?(this.mjfile.splice(e,1),this.datainfo.entrancePermit=this.mjfile.join(",")):"byzm"==t?(this.byzmfile.splice(e,1),this.datainfo.entrancePermit=this.byzmfile.join(",")):"byzs"==t?(this.byzsfile.splice(e,1),this.datainfo.entrancePermit=this.byzsfile.join(",")):"jzzm"==t?(this.jzzmfile.splice(e,1),this.datainfo.entrancePermit=this.jzzmfile.join(",")):"zczm"==t&&(this.zczmfile.splice(e,1),this.datainfo.entrancePermit=this.zczmfile.join(","))},getphotoFn:function(e){var i=this,a=[],n=9;"zj"==e?(a=i.zjfile,n=9):(a=i.mjfile,n=9),a.length<n&&t.chooseImage({count:n-parseInt(a.length),success:function(s){var l=s.tempFilePaths;if(l.length+a.length>n)t.showToast({title:"最多上传"+n+"张图片",icon:"none",duration:2e3});else{var d=s.tempFilePaths.length;(0,o.uploadmore)("/common/upload",l,0,0,0,d,[],(function(t){"zj"==e?(i.zjfile=i.zjfile.concat(t),i.datainfo.identificationPhoto=i.zjfile.join(",")):"mj"==e?(i.mjfile=i.mjfile.concat(t),i.datainfo.entrancePermit=i.mjfile.join(",")):"byzm"==e?(i.byzmfile=i.byzmfile.concat(t),i.datainfo.graduationPhoto=i.byzmfile.join(",")):"byzs"==e?(i.byzsfile=i.byzsfile.concat(t),i.datainfo.degreePhoto=i.byzsfile.join(",")):"jzzm"==e?(i.jzzmfile=i.jzzmfile.concat(t),i.datainfo.teachingPhoto=i.jzzmfile.join(",")):"zczm"==e&&(i.zczmfile=i.zczmfile.concat(t),i.datainfo.professionalPhoto=i.zczmfile.join(","))}))}}})}}};e.default=c}).call(this,i("543d")["default"])},f22b:function(t,e,i){"use strict";(function(t,e){var a=i("4ea4");i("11d3"),i("5c17");a(i("66fd"));var n=a(i("7bed"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(n.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])}},[["f22b","common/runtime","common/vendor","mine/common/vendor"]]]);