1 |
- require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["mine/pages/files/addstudent"],{"01e1":function(t,e,a){"use strict";a.d(e,"b",(function(){return n})),a.d(e,"c",(function(){return s})),a.d(e,"a",(function(){return i}));var i={uniForms:function(){return Promise.all([a.e("common/vendor"),a.e("uni_modules/uni-forms/components/uni-forms/uni-forms")]).then(a.bind(null,"6a99"))},uniFormsItem:function(){return Promise.all([a.e("common/vendor"),a.e("uni_modules/uni-forms/components/uni-forms-item/uni-forms-item")]).then(a.bind(null,"3b57"))},uniEasyinput:function(){return a.e("uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(a.bind(null,"5426"))},uniDataCheckbox:function(){return Promise.all([a.e("common/vendor"),a.e("uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox")]).then(a.bind(null,"3f35"))}},n=function(){var t=this.$createElement,e=(this._self._c,this.zjfile.length),a=this.mjfile.length;this.$mp.data=Object.assign({},{$root:{g0:e,g1:a}})},s=[]},"316a":function(t,e,a){"use strict";a.r(e);var i=a("b8cd"),n=a.n(i);for(var s in i)["default"].indexOf(s)<0&&function(t){a.d(e,t,(function(){return i[t]}))}(s);e["default"]=n.a},3711:function(t,e,a){},a4ba:function(t,e,a){"use strict";(function(t,e){var i=a("4ea4");a("11d3"),a("5c17");i(a("66fd"));var n=i(a("df18"));t.__webpack_require_UNI_MP_PLUGIN__=a,e(n.default)}).call(this,a("bc2e")["default"],a("543d")["createPage"])},b8cd:function(t,e,a){"use strict";(function(t){var i=a("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i(a("1efe")),s=a("1214"),o=a("49a9"),d=a("ee5c"),l=a("5c3d"),r=n.default.baseUrl,u={components:{},data:function(){return{addimg:a("2135"),mooda:a("4bf9"),moodan:a("7dff"),moodb:a("2c9a"),moodbn:a("eaeb"),moodc:a("a621"),moodcn:a("aa4c"),delimg:a("2622"),rimg:a("8abc"),heaidx:1,date:"",baseUrl:"",sexrange:[{val:1,text:"男"},{val:2,text:"女"}],ynrange:[{value:1,text:"是"},{value:2,text:"否"}],zjfile:[],mjfile:[],autoHeight:!0,bjrange:[{value:1,text:"有"},{value:2,text:"无"}],rules:{name:{rules:[{required:!0,errorMessage:"请选择姓名"}]},sex:{rules:[{required:!0,errorMessage:"请选择性别"}]}},datainfo:{studentId:"",name:"",sex:"",age:"",familyName:"",school:"",studentNumber:"",idCard:"",height:"",weight:"",bloodType:"",politicalStatus:"",identificationPhoto:"",entrancePermit:"",fatherName:"",fatherTelephone:"",motherName:"",motherTelephone:"",emergencyContact:"",emergencyContactTelephone:"",address:"",isNearsightedness:"",psychologicalDescription:"",isFarsightedness:"",farsightedness:"",health:"",mind:"",isMedicalHistory:"",medicalDescription:"",classId:"",className:""},pagetype:"add",stulist:"",schoolval:[],outlook:[],isjinshi:[],healthrange:[],xlhealthrange:[],bloodrange:[],bloodidx:0,sexidx:0,lookidx:0,schoolidx:0,healthidx:0,mindidx:0,id:"",address:{},classlist:[],roles:"",classidx:0,nameidx:0,studentlist:[],schoolId:"",stuflag:!0}},onUnload:function(){t.$off("refreshaddr")},onLoad:function(e){var a=this;if(t.$on("refreshaddr",(function(t){JSON.parse(JSON.stringify(t));a.datainfo.address=t.address,a.datainfo.longitude=t.lng,a.datainfo.latitude=t.lat})),this.pagetype=e.type||"add",this.baseUrl=r,this.init(),this.getDeptListFn(),"update"==e.type)this.id=e.id,this.getDataFn();else{var i=this.$store.state.user.choseroles;if(this.roles=i,"parents"==i){var n=this.$store.state.user.student;n&&n.length&&(n.length>1?this.studentlist=n.map((function(t){return{dictLabel:t.studentName,dictValue:t.id,classId:t.classId,className:t.className}})):(this.datainfo.name=n[0].studentName,this.datainfo.studentId=n[0].id,this.datainfo.classId=n[0].classId,this.datainfo.className=n[0].className,this.stuflag=!1))}else if("teacher"==i){var s=this.$store.state.user.schoolId;this.schoolId=s,this.getselfList(s)}else this.schoolId=this.$store.state.user.deptId,this.getselfList(0)}},methods:{getselfList:function(t){var e=this,a={parentId:t};a["params[role]"]=this.$store.state.user.choseroles,(0,o.getselfList)(a).then((function(t){if(200==t.code){var a=t.data;a&&a.length&&(e.classlist=a.map((function(t){return{dictLabel:t.deptName,dictValue:t.deptId}})))}else e.$toast(t.msg)}))},getMapFn:function(){this.datainfo.address?this.$tab.navigateTo("/mine/pages/files/map?type=update&lng="+this.datainfo.longitude+"&lat="+this.datainfo.latitude+"&address="+this.datainfo.address):this.$tab.navigateTo("/mine/pages/files/map")},getDataFn:function(){var t=this;(0,l.getstuDetFn)(this.id).then((function(e){if(200==e.code){if(t.datainfo=e.data,e.data.isNearsightedness&&(t.datainfo.isNearsightedness=Number(e.data.isNearsightedness)),e.data.isLset&&(t.datainfo.isLset=Number(e.data.isLset)),e.data.isPoverty&&(t.datainfo.isPoverty=Number(e.data.isPoverty)),e.data.isMedicalHistory&&(t.datainfo.isMedicalHistory=Number(e.data.isMedicalHistory)),e.data.identificationPhoto?t.zjfile=e.data.identificationPhoto.split(","):t.zjfile=[],e.data.entrancePermit?t.mjfile=e.data.entrancePermit.split(","):t.mjfile=[],e.data.sex&&(t.sexidx=1==e.data.sex?0:1),e.data.politicalStatus)for(var a=0;a<t.outlook.length;a++)if(t.outlook[a].dictLabel==e.data.politicalStatus){t.lookidx=Number(a);break}if(e.data.school)for(a=0;a<t.schoolval.length;a++)if(t.schoolval[a].dictLabel==e.data.school){t.schoolidx=Number(a);break}if(e.data.health)for(a=0;a<t.healthrange.length;a++)if(t.healthrange[a].dictLabel==e.data.health){t.healthidx=Number(a);break}if(e.data.mind)for(a=0;a<t.xlhealthrange.length;a++)if(t.xlhealthrange[a].dictLabel==e.data.mind){t.mindidx=Number(a);break}}else t.$toast(e.msg)}))},go:function(t){var e=null,a=null,i=new Date,n=i.getMonth()+1,s=i.getDate(),o=0;return 18===t.length&&(o=i.getFullYear()-t.substring(6,10)-1,e=t.substring(16,17),a=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)<=s)&&o++),15===t.length&&(o=i.getFullYear()-t.substring(6,8)-1901,e=t.substring(13,14),a="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)<=s)&&o++),e=e%2===0?"2":"1",this.datainfo.sex=e,this.datainfo.age=o,{age:o,sex:e,birth:a}},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)}},getClassFn:function(){var t=this,e=t.$store.state.user.choseroles;t.roles=e,"parents"==e&&this.$store.dispatch("GetInforoles").then((function(e){if(200==e.code){var a=e.data;a.user&&a.user.parentsStudent&&a.user.parentsStudent.length&&(t.stulist=a.user.parentsStudent)}}))},init:function(){var t=this;(0,d.getDictionaryFn)("political_outlook").then((function(e){200==e.code&&(t.outlook=e.data.map((function(t){return{dictLabel:t.dictLabel,dictValue:t.dictValue}})))})),(0,d.getDictionaryFn)("isjinshi").then((function(e){200==e.code&&(t.isjinshi=e.data.map((function(t){return{text:t.dictLabel,value:t.dictValue}})))})),(0,d.getDictionaryFn)("health_status").then((function(e){200==e.code&&(t.healthrange=e.data.map((function(t){return{dictLabel:t.dictLabel,dictValue:t.dictValue}})))})),(0,d.getDictionaryFn)("psychology").then((function(e){200==e.code&&(t.xlhealthrange=e.data.map((function(t){return{dictLabel:t.dictLabel,dictValue:t.dictValue}})))})),(0,d.getDictionaryFn)("blood_type").then((function(e){200==e.code&&(t.bloodrange=e.data.map((function(t){return{dictLabel:t.dictLabel,dictValue:t.dictValue}})))}))},getDeptListFn:function(){var t=this;(0,o.getDeptList)(0).then((function(e){200==e.code?t.schoolval=e.data.map((function(t){return{dictLabel:t.deptName,dictValue:t.deptId}})):t.$toast(e.msg)}))},getstunoListFn:function(){var t=this,e={classId:this.datainfo.classId};e["params[role]"]=this.$store.state.user.choseroles,(0,l.getstunoListFn)(e).then((function(e){200==e.code&&(t.studentlist=e.rows.map((function(t){return{dictLabel:t.studentName,dictValue:t.id,classId:t.classId}})))}))},getSubmit:function(){var e=this,a=this;this.$refs.form.validate().then((function(i){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("请输入正确身份证号")}var s=/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;if(n.fatherTelephone&&!s.test(n.fatherTelephone))return void e.$toast("请输入正确的父亲联系方式");if(n.motherTelephone&&!s.test(n.motherTelephone))return void e.$toast("请输入正确的母亲联系方式");if(n.emergencyContactTelephone&&!s.test(n.emergencyContactTelephone))return void e.$toast("请输入正确的紧急联系方式");(0,l.getstuAddtFn)(n).then((function(i){200==i.code?(a.$toast("新增成功"),setTimeout((function(){t.$emit("refreshdalist"),t.navigateBack({delta:1})}),1500)):e.$toast(i.msg)}))}else{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("请输入正确身份证号")}var o=/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;if(n.fatherTelephone&&!o.test(n.fatherTelephone))return void e.$toast("请输入正确的父亲联系方式");if(n.motherTelephone&&!o.test(n.motherTelephone))return void e.$toast("请输入正确的母亲联系方式");(0,l.getstuPutFn)(n).then((function(i){200==i.code?(a.$toast("修改成功"),setTimeout((function(){t.$emit("refreshdadetail"),t.$emit("refreshdalist"),t.navigateBack({delta:1})}),1500)):e.$toast(i.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},bindDateChangeb:function(t){var e=t.detail.value;this.datainfo.school=this.schoolval[e].dictLabel},bindDateChangec:function(t){var e=t.detail.value;this.datainfo.health=this.healthrange[e].dictLabel},bindDateChanged:function(t){var e=t.detail.value;this.datainfo.mind=this.xlhealthrange[e].dictLabel},bindDateChangee: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.studentId="",this.getstunoListFn()},bindDateChangef:function(t){var e=t.detail.value;this.datainfo.name=this.studentlist[e].dictLabel,this.datainfo.studentId=this.studentlist[e].dictValue},bindDateChangeg:function(t){var e=t.detail.value;this.datainfo.bloodType=this.bloodrange[e].dictLabel},getPreview:function(e,a){var i=this,n=[];e.forEach((function(t){var e=i.baseUrl+t;n.push(e)})),t.previewImage({urls:n,current:a,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(",")):(this.mjfile.splice(e,1),this.datainfo.entrancePermit=this.mjfile.join(","))},getphotoFn:function(e){var a=this,i=[],n=9;"zj"==e?(i=a.zjfile,n=9):(i=a.mjfile,n=9),i.length<n&&t.chooseImage({count:n-parseInt(i.length),success:function(o){var d=o.tempFilePaths;if(d.length+i.length>n)t.showToast({title:"最多上传"+n+"张图片",icon:"none",duration:2e3});else{var l=o.tempFilePaths.length;(0,s.uploadmore)("/common/upload",d,0,0,0,l,[],(function(t){"zj"==e?(a.zjfile=a.zjfile.concat(t),a.datainfo.identificationPhoto=a.zjfile.join(",")):(a.mjfile=a.mjfile.concat(t),a.datainfo.entrancePermit=a.mjfile.join(","))}))}}})}}};e.default=u}).call(this,a("543d")["default"])},bd7c:function(t,e,a){"use strict";var i=a("3711"),n=a.n(i);n.a},df18:function(t,e,a){"use strict";a.r(e);var i=a("01e1"),n=a("316a");for(var s in n)["default"].indexOf(s)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(s);a("bd7c");var o=a("f0c5"),d=Object(o["a"])(n["default"],i["b"],i["c"],!1,null,"26937e0d",null,!1,i["a"],void 0);e["default"]=d.exports}},[["a4ba","common/runtime","common/vendor","mine/common/vendor"]]]);
|