| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761 |
- <template>
- <view style="width: 100%;height: 100%;background-color: #FFF;">
- <!-- 性别选择器 -->
- <u-select v-model="sexshow" :list="sexlist" @confirm="sexconfirm"></u-select>
- <!-- 省市区选择 -->
- <u-select v-model="regionShow" mode="mutil-column-auto" :list="regionlist" @confirm="regionChoice"></u-select>
- <!-- 机构科室资质选择 -->
- <u-select v-model="hospitalShow" mode="mutil-column-auto" :list="hospitallist" @confirm="hospitalChoice"></u-select>
- <u-gap height="30" bg-color="#f0f2f5"></u-gap>
- <!-- 姓名 性别 身份证 -->
- <view style="padding: 0 28rpx;">
- <view class="flex align-center justify-between" style="margin: 20rpx 0;">
- <view style="width: 30%;font-weight: bold;" class="felx align-center">医生姓名</view>
- <text v-if="allupload">{{form.name}}</text>
- <u-input v-model="form.name" type="text" :border="false" placeholder="请填写真实姓名" input-align="right" maxlength="6"
- v-else />
- </view>
- <u-line color="#f0f2f5" />
- <view class="flex align-center justify-between" style="margin: 20rpx 0;">
- <view style="width: 30%;font-weight: bold;" class="felx align-center">性别</view>
- <text v-if="allupload">{{form.sex}}</text>
- <u-icon name="arrow-down" color="#dddfe1" @click="sexshow = true" :label="form.sex==''?'请选择性别':form.sex" label-pos="left"
- :label-color="form.sex==''?'#c7c9ca':'#000000'" v-else></u-icon>
- </view>
- <u-line color="#f0f2f5" />
- <view class="flex align-center justify-between" style="margin: 20rpx 0;">
- <view style="width: 30%;font-weight: bold;" class="felx align-center">身份证</view>
- <text v-if="allupload">{{form.ID}}</text>
- <u-input v-model="form.ID" type="idcard" :border="false" placeholder="请填写身份证号" input-align="right" maxlength="18"
- v-else />
- </view>
- </view>
- <u-gap height="30" bg-color="#f0f2f5"></u-gap>
- <!-- 照片上传 -->
- <view style="border-bottom: 0.5rpx solid #EFEFEF;padding: 10rpx 25rpx;">
- <view style="margin-bottom: 30rpx;">
- <text style="font-size: 30rpx;font-weight: bold;">上传医师执业证书</text>
- <text style="color: #999999;font-size: 26rpx;">(清晰照片和信息页)</text>
- </view>
- <!-- 上传 -->
- <view>
- <!-- <u-upload :action="action" :file-list="form.certificate" max-count="2" ref="Upractice" :auto-upload="true"
- :deletable="!allupload"></u-upload> -->
- <view class="cu-form-group">
- <view class="grid col-4 grid-square flex-sub">
- <view class="bg-img" v-for="(item,index) in form.certificate" :key="index" :data-url="form.certificate[index]">
- <image :src="imghost+form.certificate[index]" mode='aspectFill'></image>
- <view class="cu-tag bg-red" v-if="iscertificate" @click="certificateDelImg" :data-index="index">
- <text class="cuIcon-close"></text>
- </view>
- </view>
- <view class="solids" @click="certificateChooseImage" v-if="form.certificate.length<9">
- <text class="cuIcon-cameraadd"></text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view style="border-bottom: 0.5rpx solid #EFEFEF;padding: 10rpx 25rpx;">
- <view style="margin-bottom: 30rpx;">
- <text style="font-size: 30rpx;font-weight: bold;">上传身份证</text>
- <text style="color: #999999;font-size: 26rpx;">(请上传身份证人像面和国徽面各一张)</text>
- </view>
- <!-- 上传 -->
- <view>
- <!-- <u-upload :action="action" :file-list="form.idPhoto" max-count="2" ref="Ucard_photo" :auto-upload="true" :deletable="!allupload"></u-upload> -->
- <view class="cu-form-group">
- <view class="grid col-4 grid-square flex-sub">
- <view class="bg-img" v-for="(item,index) in form.idPhoto" :key="index" :data-url="form.idPhoto[index]">
- <image :src="imghost+form.idPhoto[index]" mode='aspectFill'></image>
- <view class="cu-tag bg-red" v-if="iscertificate" @click="idPhotoDelImg" :data-index="index">
- <text class="cuIcon-close"></text>
- </view>
- </view>
- <view class="solids" @click="idPhotoChooseImage" v-if="form.idPhoto.length<2">
- <text class="cuIcon-cameraadd"></text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view style="border-bottom: 0.5rpx solid #EFEFEF;padding: 10rpx 25rpx;">
- <view style="margin-bottom: 30rpx;">
- <text style="font-size: 30rpx;font-weight: bold;">上传医生资格证</text>
- <text style="color: #999999;font-size: 26rpx;">(请上传清晰的照片和相关信息页面)</text>
- </view>
- <!-- 上传 -->
- <view>
- <!-- <u-upload :action="action" :file-list="form.doctorQualification" max-count="2" ref="Uis_quali" :auto-upload="true"
- :deletable="!allupload"></u-upload> -->
- <view class="cu-form-group">
- <view class="grid col-4 grid-square flex-sub">
- <view class="bg-img" v-for="(item,index) in form.doctorQualification" :key="index" :data-url="form.doctorQualification[index]">
- <image :src="imghost+form.doctorQualification[index]" mode='aspectFill'></image>
- <view class="cu-tag bg-red" v-if="iscertificate" @click="doctorQualificationDelImg" :data-index="index">
- <text class="cuIcon-close"></text>
- </view>
- </view>
- <view class="solids" @click="doctorQualificationChooseImage" v-if="form.doctorQualification.length<9">
- <text class="cuIcon-cameraadd"></text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <u-gap height="30" bg-color="#f0f2f5"></u-gap>
- <view style="padding: 36rpx 28rpx 0rpx 28rpx;;background-color: #FFF;" class="flex align-center">
- <view style="font-size: 28rpx;margin-right: 20rpx;font-weight: bold;font-size: 32rpx;">认证机构</view>
- </view>
- <!-- 工作机构一 -->
- <view style="padding: 45rpx 28rpx 30rpx 28rpx;" v-for="item,index in mechanismList" :key="index">
- <view style="margin-bottom: 20rpx;font-weight: bold;font-size: 30rpx;" class="flex justify-between">
- <!-- 标题 -->
- <text>{{item.title}}</text>
- <!-- 删除按钮 -->
- <u-icon name="close" size="30" @click="closemechanism" style="margin-right:20rpx;" v-if="index != 0&&item.Submit==4"></u-icon>
- <!-- 状态 1审核中 2审核通过 3审核不通过 -->
- <view v-else-if="item.Submit==0" style="color:#EA970E;font-size: 28rpx;">状态:审核中</view>
- <view v-else-if="item.Submit==1" style="color:#00aa7f;font-size: 28rpx;">状态:已认证</view>
- <view v-else-if="item.Submit==2" style="color:#ff0000;font-size: 28rpx;">状态:审核拒绝</view>
- <view v-else-if="item.Submit==3" style="color:#55aaff;font-size: 28rpx;">状态:审核通过</view>
- <view v-else="item.Submit==4"></view>
- </view>
- <!-- 地区 -->
- <view style="padding: 25rpx 10rpx;" class="flex align-center justify-around" @click="regionClick(index)">
- <view style="width: 95%;font-size: 28rpx;background-color: ;">{{item.regionText==""?'请选择 省-市-区':item.regionText}}</view>
- <view class="flex align-center">
- <u-icon name="arrow-right" color="#C0C0C0"></u-icon>
- </view>
- </view>
- <!-- 机构 -->
- <view style="padding: 25rpx 10rpx;" class="flex align-center justify-around" @click="hospitalClick(index)">
- <view style="width: 95%;font-size: 28rpx;background-color: ;">{{item.hospitalText==""?'请选择 机构-科室-资质':item.hospitalText}}</view>
- <view class="flex align-center">
- <u-icon name="arrow-right" color="#C0C0C0"></u-icon>
- </view>
- </view>
- </view>
- <view style="height: 100rpx;background-color: #f0f2f5;" class="flex align-center justify-center" v-if="mechanismList[mechanismList.length-1].preservation">
- <view style="font-size: 28rpx;color: #096CBB;border:1rpx solid #C0C0C0;border-radius: 15rpx;padding: 10rpx 20rpx;background-color: #FFF;"
- @click="addmechanism">
- <text>继续添加</text>
- <u-icon name="plus" color="#096CBB"></u-icon>
- </view>
- </view>
- <view style="height: 100rpx;background-color: #f0f2f5;" class="flex align-center justify-center" v-else>
- <view style="font-size: 28rpx;color: #096CBB;border:1rpx solid #C0C0C0;border-radius: 15rpx;padding: 10rpx 20rpx;background-color: #096CBB;"
- @click="bcmechanism">
- <text style="color: #FFF;">点击保存</text>
- </view>
- </view>
- <u-gap height="200" bg-color="#f0f2f5"></u-gap>
- <view class="bottomButton" @click="bc">提交</view>
- <!-- <view class="bottomButton" @click="jxrz" style="background-color: #FFF;color: #0000FF;">继续认证</view> -->
- </view>
- </template>
- <script>
- export default {
- components: {},
- onLoad() {
- this.imghost = this.$imgHost
- this.provinceconfirm()
- this.addmechanism()
- this.docterInfos();
- },
- mounted() {},
- data() {
- return {
- action: 'https://t11.swdz.com/api/v2/Common/uploadFile',
- //保存选择的列数
- form: {
- name: '', //姓名
- sex: '', //性别
- ID: '', //身份证
- works: [],
- certificate: [], //证书
- idPhoto: [], //身份证
- doctorQualification: [], //医生资格
- },
- //性别选择
- sexshow: false,
- sexlist: [{
- value: '1',
- label: '男'
- },
- {
- value: '2',
- label: '女'
- }
- ],
- //机构列表
- mechanismList: [],
- //省市区选择器
- regionShow: false,
- regionlist: [],
- regindex: 0, //记录点击的地方
- //机构科室资质选择器
- hospitalShow: false,
- hospitallist: [],
- hosindex: 0, //记录点击的地方
- //提交之后不能修改姓名 身份证 性别 证书
- allupload: false, //是否已经提交过并且审核通过
- iscertificate: false,
- imghost:""
- }
- },
- methods: {
- /*****************view点击**********************/
- //省市区选择器打开
- docterInfos: async function() {
- let res = await this.$request.post("doctor/getRenInfo");
- if (res.status == 0) {
- if (res.data != undefined || res.data != "undefined") {
- if (res.data.oqf.length != 0 || res.data.orgList.length != 0) {
- if (res.data.info.is_then == 0) {
- this.allupload = false
- } else if (res.data.info.is_then == 1) {
- this.allupload = true
- }
- this.form.name = res.data.info.name;
- this.form.sex = res.data.info.sex == 1 ? '男' : '女';
- this.form.ID = res.data.info.card_id;
- if (res.data.info.is_then == 0) {
- this.iscertificate = true
- }
- if (res.data.info.practice != '0') {
- this.form.certificate = res.data.info.practice.split(',');
- }
- if (res.data.info.card_photo != '0') {
- this.form.idPhoto = res.data.info.card_photo.split(',');
- }
- if (res.data.info.is_quail != '0') {
- this.form.doctorQualification = res.data.info.is_quail.split(',');
- }
- }
- console.log(this.form.certificate)
- if (res.data.orgList.length != 0 && res.data.oqf.length != 0) {
- let orglist = res.data.orgList;
- let oqflist = res.data.oqf;
- this.mechanismList.length = 0;
- this.form.works.length = 0;
- console.log('orglist', orglist)
- for (let i = 0; i < orglist.length; i++) {
- // 获取到修改中数据
- this.form.works.push({
- hospital: orglist[i].organization.id, //医院id
- department: oqflist[i].office.id, //科室id
- qualifications: oqflist[i].qualification.id, //资质id
- state: orglist[i].state,
- })
- // 渲染页面数据
- this.mechanismList.push({
- title: '工作机构' + this.convertToChinese(this.mechanismList.length + 1), //工作机构名称
- regionText: orglist[i].province + '-' + orglist[i].city + '-' + orglist[i].area, //地区信息文字
- hospitalText: orglist[i].name + '-' + oqflist[i].office.name + '-' + oqflist[i].qualification.name, //机构信息文字
- preservation: true, //是否已经保存
- Submit: orglist[i].state, // 0=审核中,1=审核通过,2=审核拒绝 信息状态 0未提交 1审核中 2审核通过 3审核不通过
- hospitalID: orglist[i].organization.id,
- })
- console.log(this.mechanismList)
- }
- }
- }
- }
- },
- regionClick(index) {
- if (this.mechanismList[index].Submit == 0 || this.mechanismList[index].Submit == 1) {
- uni.showToast({
- title: '无法修改',
- icon: 'none'
- })
- return false
- }
- if (this.mechanismList.length - 1 == index) {
- this.regionShow = true
- this.regindex = index //保存点击的地方
- } else {
- uni.showToast({
- title: '无法修改',
- icon: 'none'
- })
- }
- },
- //机构选择器打开
- hospitalClick(index) {
- console.log(index);
- if (this.mechanismList[index].Submit == 0 || this.mechanismList[index].Submit == 1) {
- uni.showToast({
- title: '无法修改',
- icon: 'none'
- })
- return false
- }
- if (this.hospitallist.length != 0) {
- if (this.mechanismList.length - 1 == index) {
- if (this.mechanismList[index].regionText != '') {
- this.hospitalShow = true
- this.hosindex = index //保存点击的地方
- } else {
- uni.showToast({
- title: '请先填写地区数据',
- icon: 'none'
- })
- }
- } else {
- uni.showToast({
- title: '无法修改',
- icon: 'none'
- })
- }
- } else {
- uni.showToast({
- title: '此地区暂无医院',
- icon: 'none'
- })
- }
- },
- //省市区选择器确认
- regionChoice(e) {
- console.log(e)
- console.log('hosindex', this.hosindex)
- console.log('regindex', this.regindex)
- this.hospitallist.splice(0, this.hospitallist.length);
- this.$forceUpdate()
- // this.mechanismList[this.hosindex].hospitalText = '';
- this.hospitalconfirm(e[0].value, e[1].value, e[2].value);
- this.mechanismList[this.regindex].regionText = e[0].label + '-' + e[1].label + '-' + e[2].label //利用保存的地方赋值
- },
- //机构选择
- hospitalChoice(e) {
- // this.mechanismList.map(val => {
- // if (val.hospitalText == e[0].label + '-' + e[1].label + '-' + e[2].label) {
- // return false;
- // }
- // })
- console.log(e)
- if (typeof this.form.works[this.hosindex] == undefined || typeof this.form.works[this.hosindex] == 'undefined') {
- this.form.works.push({
- hospital: e[0].value, //医院id
- department: e[1].value, //科室id
- qualifications: e[2].value, //资质id
- state: 0,
- })
- } else {
- this.form.works[this.hosindex].hospital = e[0].value;
- this.form.works[this.hosindex].department = e[1].value;
- this.form.works[this.hosindex].qualifications = e[2].value;
- this.form.works[this.hosindex].state = 0;
- }
- this.mechanismList[this.hosindex].hospitalText = e[0].label + '-' + e[1].label + '-' + e[2].label
- this.mechanismList[this.hosindex].hospitalID = e[0].value
- },
- //数字转文字
- convertToChinese(num) {
- var N = [
- "零", "一", "二", "三", "四", "五", "六", "七", "八", "九"
- ];
- var str = num.toString();
- var len = num.toString().length;
- var C_Num = [];
- for (var i = 0; i < len; i++) {
- C_Num.push(N[str.charAt(i)]);
- }
- return C_Num.join('');
- },
- //添加机构
- addmechanism() {
- this.mechanismList.push({
- title: '工作机构' + this.convertToChinese(this.mechanismList.length + 1), //工作机构名称
- regionText: '', //地区信息文字
- hospitalText: '', //机构信息文字
- preservation: false, //是否已经保存
- Submit: 4, // 信息状态
- hospitalID: 0 //医院id
- })
- console.log(this.mechanismList)
- },
- //保存机构
- bcmechanism() {
- if (this.mechanismList[this.mechanismList.length - 1].regionText == '' || this.mechanismList[this.mechanismList.length -
- 1].hospitalText == '') {
- uni.showToast({
- title: '请完善机构信息',
- icon: 'none'
- })
- } else {
- this.mechanismList[this.mechanismList.length - 1].preservation = true
- uni.showToast({
- title: '保存成功'
- })
- }
- },
- //删除机构
- closemechanism() {
- this.mechanismList.splice(this.mechanismList.length - 1, 1)
- },
- /************************/
- // 性别
- sexconfirm(e) {
- console.log(e);
- this.form.sex = e[0].label
- console.log(this.form.sex);
- },
- /*******************接口*********************/
- //省
- provinceconfirm: async function() {
- // 点击请求接口
- let res = await this.$request.post('doctor/getCityList', {
- 'type': 1
- });
- // console.log('省', res.data)
- // this.provincelist = this.provincelist2 = res.data
- this.regionlist = res.data
- },
- //市
- cityconfirm: async function(e) {
- // parent_id为省份返回的id
- let res = await this.$request.post('doctor/getCityList', {
- 'type': 2,
- 'parent_id': e
- });
- console.log('市', res.data)
- if (this.province == 1) {
- this.citylist = res.data
- } else if (this.province == 2) {
- this.citylist2 = res.data
- }
- },
- //区
- areaconfirm: async function(e) {
- // parent_id为市返回的id
- let res = await this.$request.post('doctor/getCityList', {
- 'type': 3,
- 'parent_id': e
- });
- console.log('区', res.data)
- if (this.city == 1) {
- this.arealist = res.data
- } else if (this.city == 2) {
- this.arealist2 = res.data
- }
- },
- //医院
- hospitalconfirm: async function(p, c, a) {
- console.log(p, c, a)
- //organizations_ids为省市区返回的id字符串,顺序为,省id,市id,区id
- let res = await this.$request.post('doctor/get_city_id', {
- 'level_type': 4,
- "province": p,
- "city": c,
- "area": a,
- });
- if (res.status == 0) {
- this.hospitallist = res.data
- /**
- * 新需求,已经选择过的医院不再出现
- * 循环已经认证的机构,在里面找
- * */
- for (let i = 0; i < this.mechanismList.length; i++) {
- console.log('hospitalID', this.mechanismList[i].hospitalID)
- for (let j = 0; j < this.hospitallist.length; j++) {
- if (this.mechanismList[i].hospitalID == this.hospitallist[j].value) {
- this.hospitallist.splice(j, 1);
- }
- }
- // console.log('第'+i+'个数据',this.mechanismList[i].hospitalText)
- // let a = this.mechanismList[i].hospitalText.indexOf('-')
- // console.log('a',a)
- // if(a>0){
- // }
- }
- console.log('hospitallist', this.hospitallist)
- console.log('mechanismList', this.mechanismList)
- }
- },
- // //科室
- // departmentconfirm: async function(e) {
- // let res = await this.$request.post('doctor/getOfferList', {
- // 'type': 1
- // });
- // if (this.hospital == 1) {
- // this.departmentlist = res.data
- // console.log('科室列表', this.departmentlist)
- // } else if (this.hospital == 2) {
- // this.departmentlist2 = res.data
- // }
- // },
- // //资质
- // qualificationsconfirm: async function(e) {
- // let res = await this.$request.post('doctor/getOfferList', {
- // 'type': 2
- // });
- // if (this.department == 1) {
- // this.qualificationslist = res.data
- // console.log('资质列表', this.qualificationslist)
- // } else if (this.department == 2) {
- // this.qualificationslist2 = res.data
- // }
- // },
- // 保存
- bc: async function() {
- if (this.mechanismList[this.mechanismList.length - 1].preservation == false) {
- uni.showModal({
- 'title': '请先保存机构!'
- })
- return false;
- }
- //保存之后改变机构信息状态
- /* this.mechanismList.map(val => {
- //判断是不是新增的数据 状态为0
- if(val.Submit==0){
- val.Submit = 1;
- }
- }) */
- //照片
- let practice = [] //证书
- let card_photo = [] //身份证
- let is_quali = [] //资格
- // 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
- // practice = this.$refs.uUpload.lists.filter(val => {
- // return val.progress == 100;
- // })
- // card_photo = this.$refs.uUpload.lists.filter(val => {
- // return val.progress == 100;
- // })
- // is_quail = this.$refs.uUpload.lists.filter(val => {
- // return val.progress == 100;
- // })
- // 如果您不需要进行太多的处理,直接如下即可
- /* practice = this.$refs.Upractice.lists; //证书
- card_photo = this.$refs.Ucard_photo.lists; //身份证
- is_quali = this.$refs.Uis_quali.lists; //资格
- if (typeof practice[0] == 'undefined' || typeof practice[1] == 'undefined') {
- uni.showToast({
- 'title': '医师职业证书必填',
- icon: "none"
- })
- return false;
- }
- if (typeof card_photo[0] == 'undefined' || typeof card_photo[1] == 'undefined') {
- uni.showToast({
- 'title': '身份证必填',
- icon: "none"
- })
- return false;
- }
- if (typeof is_quali[0] == 'undefined' || typeof is_quali[1] == 'undefined') {
- uni.showToast({
- 'title': '资格证必填',
- icon: "none"
- })
- return false;
- }
- this.form.certificate = [practice[0].response.data.url, practice[1].response.data.url]
- this.form.idPhoto = [card_photo[0].response.data.url, card_photo[1].response.data.url]
- this.form.doctorQualification = [is_quali[0].response.data.url, is_quali[1].response.data.url] */
- if (typeof this.form.works != 'string') {
- this.form.works = JSON.stringify(this.form.works);
- }
- console.log('提交表单!', this.form);
- // 注意要 {'doctor_name':'ddd',doctor_sex:1....}分开传值因为我方便拦截垃圾数据
- let res = await this.$request.post('doctor/addthen', this.form);
- console.log('res...:', res);
- if (res.status == 0) {
- // uni.switchTab({
- // url: '../index/index'
- // })
- uni.navigateBack({
- delta: 1
- })
- } else {
- uni.showToast({
- icon: 'none',
- title: res.message
- })
- }
- },
- certificateChooseImage() {
- let arr = []
- uni.chooseImage({
- count: 9, //默认9
- sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ['album', 'camera'], //从相册选择
- success: (res) => {
- if (arr.length != 0) {
- arr = arr.concat(res.tempFilePaths)
- arr.forEach(item => {
- this.$request.upload("Common/uploadFile", item, {}).then(data => {
- this.form.certificate.push(JSON.parse(data).data.url)
- })
- })
- } else {
- arr = res.tempFilePaths
- arr.forEach(item => {
- this.$request.upload("Common/uploadFile", item, {}).then(data => {
- this.form.certificate.push(JSON.parse(data).data.url)
- })
- })
- }
- }
- });
- },
- idPhotoChooseImage() {
- let arr = []
- uni.chooseImage({
- count: 2, //默认9
- sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ['album', 'camera'], //从相册选择
- success: (res) => {
- if (arr.length != 0) {
- arr = arr.concat(res.tempFilePaths)
- arr.forEach(item => {
- this.$request.upload("Common/uploadFile", item, {}).then(data => {
- this.form.idPhoto.push(JSON.parse(data).data.url)
- })
- })
- } else {
- arr = res.tempFilePaths
- arr.forEach(item => {
- this.$request.upload("Common/uploadFile", item, {}).then(data => {
- this.form.idPhoto.push(JSON.parse(data).data.url)
- })
- })
- }
- }
- });
- },
- doctorQualificationChooseImage() {
- let arr = []
- uni.chooseImage({
- count: 9, //默认9
- sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ['album', 'camera'], //从相册选择
- success: (res) => {
- if (arr.length != 0) {
- arr = arr.concat(res.tempFilePaths)
- arr.forEach(item => {
- this.$request.upload("Common/uploadFile", item, {}).then(data => {
- this.form.doctorQualification.push(JSON.parse(data).data.url)
- })
- })
- } else {
- arr = res.tempFilePaths
- arr.forEach(item => {
- this.$request.upload("Common/uploadFile", item, {}).then(data => {
- this.form.doctorQualification.push(JSON.parse(data).data.url)
- })
- })
- }
- }
- });
- },
- certificateDelImg(e) {
- uni.showModal({
- title: '提示',
- content: '确定要删除吗?',
- cancelText: '再想想',
- confirmText: '删除',
- success: res => {
- if (res.confirm) {
- this.form.certificate.splice(e.currentTarget.dataset.index, 1);
- this.form.certificate = this.form.certificate
- }
- }
- })
- },
- idPhotoDelImg(e) {
- uni.showModal({
- title: '提示',
- content: '确定要删除吗?',
- cancelText: '再想想',
- confirmText: '删除',
- success: res => {
- if (res.confirm) {
- this.form.idPhoto.splice(e.currentTarget.dataset.index, 1);
- this.form.idPhoto = this.form.idPhoto
- }
- }
- })
- },
- doctorQualificationDelImg(e) {
- uni.showModal({
- title: '提示',
- content: '确定要删除吗?',
- cancelText: '再想想',
- confirmText: '删除',
- success: res => {
- if (res.confirm) {
- this.form.doctorQualification.splice(e.currentTarget.dataset.index, 1);
- this.form.doctorQualification = this.form.doctorQualification
- }
- }
- })
- },
- }
- };
- </script>
- <style scoped lang="scss">
- page {
- background-color: #f0f2f5;
- }
- .bottomButton {
- position: fixed;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 100rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: #0B73B9;
- color: #FFFFFF;
- z-index: 99;
- font-size: 32rpx;
- }
- .xiala {
- width: 50%;
- flex-direction: row-reverse;
- align-items: center;
- display: flex;
- }
- </style>
|