| 1 |
- "use strict";var e=Object.defineProperty,o=Object.defineProperties,t=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,l=(o,t,i)=>t in o?e(o,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[t]=i,a=require("../common/vendor.js"),p=require("../api/common.js"),n=require("../api/user.js");require("../common/request.js");const d={data:()=>({cityIndex1:0,cityIndex2:0,allCitys:[],citys:[[],[],[]],cityShow:!1,depts:[[]],deptShow:!1,hospitals:[[]],hospitalShow:!1,positions:[[]],positionShow:!1,fileList1:[],fileList2:[],fileList3:[],fileList4:[],checked:0,form:{sex:"1"},rules:{doctorName:[{required:!0,message:"请输入医生姓名"}],idCard:[{required:!0,message:"请输入身份证号",trigger:["change","blur"]}],deptId:[{required:!0,message:"请选择部门"}],hospitalId:[{required:!0,message:"请选择医院"}],position:[{required:!0,message:"请选择职务"}],cityIds:[{required:!0,message:"请选择所在城市"}],account:[{required:!0,message:"请输入帐号"}],password:[{required:!0,message:"请输入密码"}],mobile:[{required:!0,message:"请输入手机号",trigger:["change","blur"]}]}}),onLoad(e){this.form.doctorType=e.type,this.getCitys(),this.getHospitalList(),this.getDepartmentList(),this.getDictByKey("sys_doc_position")},onShow(){},onReady(){this.$refs.uForm.setRules(this.rules)},methods:{hospitalSelect(e){this.form.hospitalId=this.hospitals[0][e.indexs[0]].hospitalId,this.form.hospitalName=this.hospitals[0][e.indexs[0]].hospitalName,this.hospitalShow=!1},deptSelect(e){console.log(e),this.form.deptId=this.depts[0][e.indexs[0]].deptId,this.form.deptName=this.depts[0][e.indexs[0]].deptName,this.deptShow=!1},positionSelect(e){console.log(e),this.form.position=this.positions[0][e.indexs[0]].dictLabel,this.positionShow=!1},getDictByKey(e){var o={key:e};p.getDictByKey(o).then((e=>{200==e.code&&(this.positions[0]=e.data)}),(e=>{}))},openContent(e){a.index.navigateTo({url:"agreement?type="+e})},cityChangeHandler(e){const{columnIndex:o,index:t,picker:i=this.$refs.cityPicker}=e;if(0==o){this.cityIndex1=t,console.log(this.cityIndex1);var r=this.allCitys[this.cityIndex1].c;console.log(r),i.setColumnValues(1,r),this.cityIndex2=0;var s=this.allCitys[this.cityIndex1].c[this.cityIndex2].c;i.setColumnValues(2,s)}if(1==o){this.cityIndex2=t;var l=this.allCitys[this.cityIndex1].c[this.cityIndex2].c;console.log(l),i.setColumnValues(2,l)}},citySelect(e){console.log(e),this.form.cityName=e.value[0].n+">"+e.value[1].n+">"+e.value[2].n,this.form.cityIds=e.value[0].v+","+e.value[1].v+","+e.value[2].v,this.cityShow=!1},getCitys(){var e=this;p.getCitys({}).then((o=>{200==o.code&&(e.allCitys=o.data,e.citys=[[],[],[]],e.citys[0]=e.allCitys,e.citys[1]=e.allCitys[0].c,e.citys[2]=e.allCitys[0].c[0].c,console.log(e.citys))}),(e=>{}))},getHospitalList(){var e=this;p.getHospitalList({}).then((o=>{200==o.code&&(e.hospitals[0]=o.data,console.log(111),console.log(e.hospitals))}),(e=>{}))},getDepartmentList(){var e=this;p.getDepartmentList({}).then((o=>{200==o.code&&(e.depts[0]=o.data)}),(e=>{}))},deletePic(e){this[`fileList${e.name}`].splice(e.index,1)},async afterRead(e){let a=[].concat(e.file),p=this[`fileList${e.name}`].length;a.map((a=>{var p;this[`fileList${e.name}`].push((p=((e,o)=>{for(var t in o||(o={}))r.call(o,t)&&l(e,t,o[t]);if(i)for(var t of i(o))s.call(o,t)&&l(e,t,o[t]);return e})({},a),o(p,t({status:"uploading",message:"上传中"}))))}));for(let o=0;o<a.length;o++){const t=await this.uploadFilePromise(a[o].url);let i=this[`fileList${e.name}`][p];this[`fileList${e.name}`].splice(p,1,Object.assign(i,{status:"success",message:"",url:t})),p++}},uploadFilePromise:e=>new Promise(((o,t)=>{a.index.uploadFile({url:a.index.getStorageSync("requestPath")+"/app/common/uploadOSS",filePath:e,name:"file",formData:{user:"test"},success:e=>{setTimeout((()=>{console.log(JSON.parse(e.data).url),o(JSON.parse(e.data).url)}),1e3)}})})),register(){n.registerDoctor(this.form).then((e=>{console.log(e),200==e.code?(a.index.showToast({icon:"none",title:e.msg}),setTimeout((function(){a.index.navigateBack({delta:1})}),2e3)):a.index.showToast({icon:"none",title:e.msg})}),(e=>{console.log(e)}))},submit(){var e=this;if(this.fileList1.length>0&&(this.form.avatar=this.fileList1[0].url),this.fileList2.length>0){var o=[];if(e.fileList2.forEach((function(e){o.push(e.url)})),2!=o.length)return void a.index.showToast({icon:"none",title:"请上传身份证号"});this.form.idCardFrontUrl=o[0],this.form.idCardBackUrl=o[1]}if(this.fileList3.length>0){o=[];e.fileList3.forEach((function(e){o.push(e.url)})),this.form.certificateImages=o.toString()}if(this.fileList4.length>0){o=[];e.fileList4.forEach((function(e){o.push(e.url)})),this.form.practiseImages=o.toString()}1==this.checked?(console.log(this.form),this.$refs.uForm.validate().then((o=>{e.register()})).catch((e=>{console.log(e)}))):a.index.showToast({icon:"none",title:"请同意协议"})}}};if(!Array){(a.resolveComponent("u-input")+a.resolveComponent("u-form-item")+a.resolveComponent("u-radio")+a.resolveComponent("u-radio-group")+a.resolveComponent("u-icon")+a.resolveComponent("u--textarea")+a.resolveComponent("u-upload")+a.resolveComponent("u-form")+a.resolveComponent("u-checkbox")+a.resolveComponent("u-checkbox-group")+a.resolveComponent("u-picker"))()}Math||((()=>"../uni_modules/uview-plus/components/u-input/u-input.js")+(()=>"../uni_modules/uview-plus/components/u-form-item/u-form-item.js")+(()=>"../uni_modules/uview-plus/components/u-radio/u-radio.js")+(()=>"../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js")+(()=>"../uni_modules/uview-plus/components/u-icon/u-icon.js")+(()=>"../uni_modules/uview-plus/components/u--textarea/u--textarea.js")+(()=>"../uni_modules/uview-plus/components/u-upload/u-upload.js")+(()=>"../uni_modules/uview-plus/components/u-form/u-form.js")+(()=>"../uni_modules/uview-plus/components/u-checkbox/u-checkbox.js")+(()=>"../uni_modules/uview-plus/components/u-checkbox-group/u-checkbox-group.js")+(()=>"../uni_modules/uview-plus/components/u-picker/u-picker.js"))();var c=a._export_sfc(d,[["render",function(e,o,t,i,r,s){return a.e({a:1==r.form.doctorType},(r.form.doctorType,{}),{b:1==r.form.doctorType},(r.form.doctorType,{}),{c:2==r.form.doctorType},(r.form.doctorType,{}),{d:2==r.form.doctorType},(r.form.doctorType,{}),{e:a.o((e=>r.form.doctorName=e)),f:a.p({border:"none",placeholder:"请输入真实姓名",modelValue:r.form.doctorName}),g:a.p({labelWidth:"180rpx",borderBottom:!0,label:"真实姓名",prop:"doctorName"}),h:a.o((e=>r.form.idCard=e)),i:a.p({border:"none",placeholder:"请输入身份证号",modelValue:r.form.idCard}),j:a.p({labelWidth:"180rpx",borderBottom:!0,label:"身份证号",prop:"idCard"}),k:a.p({activeColor:"#C39A58",customStyle:{marginRight:"8px"},label:"男",name:"1"}),l:a.p({activeColor:"#C39A58",label:"女",name:"2"}),m:a.o((e=>r.form.sex=e)),n:a.p({placement:"row",modelValue:r.form.sex}),o:a.p({labelWidth:"180rpx",borderBottom:!0,label:"性别",prop:"sex"}),p:a.o((e=>r.form.cityName=e)),q:a.p({disabled:!0,disabledColor:"#ffffff",placeholder:"请选择所在城市",border:"none",modelValue:r.form.cityName}),r:a.p({name:"arrow-right"}),s:a.o((e=>r.cityShow=!0)),t:a.p({labelWidth:"180rpx",prop:"cityId",borderBottom:!0,label:"所在城市"}),v:a.o((e=>r.form.hospitalName=e)),w:a.p({disabled:!0,disabledColor:"#ffffff",placeholder:"请选择医院",border:"none",modelValue:r.form.hospitalName}),x:a.p({name:"arrow-right"}),y:a.o((e=>r.hospitalShow=!0)),z:a.p({labelWidth:"180rpx",prop:"hospitalId",borderBottom:!0,label:"就职医院"}),A:a.o((e=>r.form.deptName=e)),B:a.p({disabled:!0,disabledColor:"#ffffff",placeholder:"请选择科室",border:"none",modelValue:r.form.deptName}),C:a.p({name:"arrow-right"}),D:a.o((e=>r.deptShow=!0)),E:a.p({labelWidth:"180rpx",prop:"deptId",borderBottom:!0,label:"所属科室"}),F:a.o((e=>r.form.position=e)),G:a.p({disabled:!0,disabledColor:"#ffffff",placeholder:"请选择职称",border:"none",modelValue:r.form.position}),H:a.p({name:"arrow-right"}),I:a.o((e=>r.positionShow=!0)),J:a.p({labelWidth:"180rpx",prop:"position",borderBottom:!0,label:"职称"}),K:a.o((e=>r.form.speciality=e)),L:a.p({placeholder:"请输入擅长领域",count:!0,modelValue:r.form.speciality}),M:a.p({labelWidth:"180rpx",borderBottom:!0,label:"擅长领域",prop:"speciality"}),N:a.o((e=>r.form.introduction=e)),O:a.p({placeholder:"请输入个人简介",count:!0,modelValue:r.form.introduction}),P:a.p({labelWidth:"180rpx",borderBottom:!0,label:"个人简介",prop:"introduction"}),Q:a.o(s.afterRead),R:a.o(s.deletePic),S:a.p({fileList:r.fileList1,name:"1",multiple:!0,maxCount:1}),T:a.p({labelWidth:"180rpx",borderBottom:!0,label:"医生照片",prop:"avatar"}),U:a.o(s.afterRead),V:a.o(s.deletePic),W:a.p({fileList:r.fileList2,name:"2",multiple:!0,maxCount:2}),X:a.p({labelWidth:"180rpx",borderBottom:!0,label:"身份证照片(正反面)",prop:"idCardFrontUrl"}),Y:a.o((e=>r.form.certificateCode=e)),Z:a.p({border:"none",placeholder:"请输入资质证编号",modelValue:r.form.certificateCode}),aa:a.p({labelWidth:"180rpx",borderBottom:!0,label:"资质证编号",prop:"certificateCode"}),ab:a.o(s.afterRead),ac:a.o(s.deletePic),ad:a.p({fileList:r.fileList3,name:"3",maxCount:3}),ae:a.p({labelWidth:"180rpx",borderBottom:!0,label:"资质证书",prop:"certificateImages"}),af:a.o((e=>r.form.practiseCode=e)),ag:a.p({border:"none",placeholder:"请输入执业证编号",modelValue:r.form.practiseCode}),ah:a.p({labelWidth:"180rpx",borderBottom:!0,label:"执业证编号",prop:"practiseCode"}),ai:a.o(s.afterRead),aj:a.o(s.deletePic),ak:a.p({fileList:r.fileList4,name:"4",maxCount:3}),al:a.p({labelWidth:"180rpx",borderBottom:!0,label:"执业证书",prop:"certificateImages"}),am:a.o((e=>r.form.mobile=e)),an:a.p({border:"none",placeholder:"请输入联系电话",modelValue:r.form.mobile}),ao:a.p({labelWidth:"180rpx",borderBottom:!0,label:"联系电话",prop:"mobile"}),ap:a.o((e=>r.form.account=e)),aq:a.p({border:"none",placeholder:"请输入登录帐号",modelValue:r.form.account}),ar:a.p({labelWidth:"180rpx",borderBottom:!0,label:"登录帐号",prop:"account"}),as:a.o((e=>r.form.password=e)),at:a.p({border:"none",type:"password",placeholder:"请输入登录密码",modelValue:r.form.password}),av:a.p({labelWidth:"180rpx",label:"登录密码",prop:"password"}),aw:a.sr("uForm","7d372f38-0"),ax:a.p({rules:r.rules,model:r.form,labelPosition:"left"}),ay:a.p({activeColor:"#2BC7B9",customStyle:{marginRight:"8px"},label:"同意",name:1}),az:a.o((e=>r.checked=e)),aA:a.p({placement:"column",modelValue:r.checked}),aB:a.o((e=>s.openContent("doctorRegister"))),aC:a.o((e=>s.openContent("doctorFiling"))),aD:a.sr("cityPicker","7d372f38-45"),aE:a.o((e=>r.cityShow=!1)),aF:a.o(s.citySelect),aG:a.o(s.cityChangeHandler),aH:a.p({keyName:"n",show:r.cityShow,columns:r.citys}),aI:a.sr("deptPicker","7d372f38-46"),aJ:a.o((e=>r.deptShow=!1)),aK:a.o(s.deptSelect),aL:a.p({keyName:"deptName",show:r.deptShow,columns:r.depts}),aM:a.o((e=>r.hospitalShow=!1)),aN:a.o(s.hospitalSelect),aO:a.p({keyName:"hospitalName",show:r.hospitalShow,columns:r.hospitals}),aP:a.sr("positionPicker","7d372f38-48"),aQ:a.o((e=>r.positionShow=!1)),aR:a.o(s.positionSelect),aS:a.p({keyName:"dictLabel",show:r.positionShow,columns:r.positions}),aT:a.o((e=>s.submit()))})}],["__scopeId","data-v-7d372f38"]]);wx.createPage(c);
|