1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924 |
- <template style="background-color: #f3f3f3;">
- <view style="width: 100%;height: 100%;">
- <!-- 按需求加分段器 -->
- <u-subsection :list="SubsectionList" mode="button" :current="curNow" @change="sectionChange"></u-subsection>
- <!-- 早上 -->
- <u-select v-model="morShow" mode="mutil-column-auto" :list="morList" @confirm="confirm"></u-select>
- <!-- 下午 -->
- <u-select v-model="aftShow" mode="mutil-column-auto" :list="aftList" @confirm="confirm"></u-select>
- <!-- 晚上 -->
- <u-select v-model="nigShow" mode="mutil-column-auto" :list="nigList" @confirm="confirm"></u-select>
- <!-- 服务时间选择 -->
- <u-select v-model="serviceShow" :list="serviceTimelist" @confirm="selectService"></u-select>
- <!-- 医院选择 -->
- <u-select v-model="hospitalShow" :list="form.is_appoint.hospitalList" @confirm="selectHospital" label-name="name"
- value-name="id"></u-select>
- <!-- 电话咨询 -->
- <view class="v" v-show="showList[0].flag&&(SubsectionList[curNow].name=='电话咨询')">
- <!-- 基础价格 -->
- <view class="list">
- <!-- 左 -->
- <view class="left">
- <view class="t1">基础价格<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(元)</text></view>
- <view class="t2">基础价格为包含十分钟的起步价</view>
- </view>
- <!-- 右 -->
- <view class="right">
- <u-input v-model="form.is_phone.base_price" type="digit" :border="true" placeholder="请输入金额" :clearable="false"/>
- </view>
- </view>
- <!-- 步进价格 -->
- <view class="list">
- <!-- 左 -->
- <view class="left">
- <view class="t1">步进价格<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(元/每分钟)</text></view>
- <view class="t2">步进价格为超过起步价时长的价格</view>
- </view>
- <!-- 右 -->
- <view class="right">
- <u-input v-model="form.is_phone.step_price" type="digit" :border="true" placeholder="请输入金额" :clearable="false"/>
- </view>
- </view>
- <!-- 服务时间 -->
- <view class="list" style="margin-bottom: 20rpx;">服务时间</view>
- <!-- 线 -->
- <u-line color="#e7e7e7" />
- <!-- 早上 -->
- <view style="margin-top: 20rpx;">
- <view>
- <view class="flex justify-between" style="margin-bottom: 16rpx;">
- <text>上午服务时间</text>
- </view>
- <view class="select_time" @click="selectTime(0,0)">
- <text>{{form.is_phone.mor_time==""?"选择开始时间 - 结束时间":form.is_phone.mor_time}}</text>
- <u-icon name="clock"></u-icon>
- </view>
- </view>
- </view>
- <!-- 下午 -->
- <view style="margin-top: 20rpx;">
- <view>
- <view class="flex justify-between" style="margin-bottom: 16rpx;">
- <text>下午服务时间</text>
- </view>
- <view class="select_time" @click="selectTime(1,0)">
- <text>{{form.is_phone.aft_time==""?"选择开始时间 - 结束时间":form.is_phone.aft_time}}</text>
- <u-icon name="clock"></u-icon>
- </view>
- </view>
- </view>
- <!-- 晚上 -->
- <view style="margin-top: 20rpx;">
- <view>
- <view class="flex justify-between" style="margin-bottom: 16rpx;">
- <text>晚上服务时间</text>
- </view>
- <view class="select_time" @click="selectTime(2,0)">
- <text>{{form.is_phone.nig_time==""?"选择开始时间 - 结束时间":form.is_phone.nig_time}}</text>
- <u-icon name="clock"></u-icon>
- </view>
- </view>
- </view>
- <!-- 服务人次 -->
- <view class="list">
- <!-- 左 -->
- <view class="left">
- <view class="t1">服务人次<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(人/每小时)</text></view>
- <view class="t2">本项目每小时最大接收的服务人次</view>
- </view>
- <!-- 右 -->
- <view class="right">
- <u-input v-model="form.is_phone.person" type="number" :border="true" placeholder="请输入人次" :clearable="false"/>
- </view>
- </view>
- </view>
- <view v-if="!showList[0].flag&&(SubsectionList[curNow].name=='电话咨询')" style="height: 50vh;">
- <u-empty text="未开通" mode="data"></u-empty>
- </view>
- <view style="padding: 20rpx 26rpx 200rpx 26rpx;background-color: #f3f3f3;color:#C0C0C0" v-show="showList[0].flag&&(SubsectionList[curNow].name=='电话咨询')">
- 提示:就诊人信息用于平台审核和医疗业务使用,不会外传。请正却确填写就诊人信息,如需修改身份信息可电话联系客服修改(13330431369)
- </view>
- <!-- 图文咨询 -->
- <view class="v" v-show="showList[1].flag&&(SubsectionList[curNow].name=='图文咨询')">
- <!-- 基础价格 -->
- <view class="list">
- <!-- 左 -->
- <view class="left">
- <view class="t1">基础价格<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(元)</text></view>
- <view class="t2">基础价格为包含十分钟的起步价</view>
- </view>
- <!-- 右 -->
- <view class="right">
- <u-input v-model="form.is_chat.base_price" type="digit" :border="true" placeholder="请输入金额" :clearable="false"/>
- </view>
- </view>
- <!-- 服务时间 -->
- <view class="list" style="margin-bottom: 20rpx;">服务时间</view>
- <!-- 线 -->
- <u-line color="#e7e7e7" />
- <!-- 早上 -->
- <view style="margin-top: 20rpx;">
- <view>
- <view class="flex justify-between" style="margin-bottom: 16rpx;">
- <text>上午服务时间</text>
- </view>
- <view class="select_time" @click="selectTime(0,1)">
- <text>{{form.is_chat.mor_time==""?"选择开始时间 - 结束时间":form.is_chat.mor_time}}</text>
- <u-icon name="clock"></u-icon>
- </view>
- </view>
- </view>
- <!-- 下午 -->
- <view style="margin-top: 20rpx;">
- <view>
- <view class="flex justify-between" style="margin-bottom: 16rpx;">
- <text>下午服务时间</text>
- </view>
- <view class="select_time" @click="selectTime(1,1)">
- <text>{{form.is_chat.aft_time==""?"选择开始时间 - 结束时间":form.is_chat.aft_time}}</text>
- <u-icon name="clock"></u-icon>
- </view>
- </view>
- </view>
- <!-- 晚上 -->
- <view style="margin-top: 20rpx;">
- <view>
- <view class="flex justify-between" style="margin-bottom: 16rpx;">
- <text>晚上服务时间</text>
- </view>
- <view class="select_time" @click="selectTime(2,1)">
- <text>{{form.is_chat.nig_time==""?"选择开始时间 - 结束时间":form.is_chat.nig_time}}</text>
- <u-icon name="clock"></u-icon>
- </view>
- </view>
- </view>
- <!-- 服务人次 -->
- <view class="list">
- <!-- 左 -->
- <view class="left">
- <view class="t1">同时服务人次<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(人/每小时)</text></view>
- <view class="t2">本项目每小时最大接收的服务人次</view>
- </view>
- <!-- 右 -->
- <view class="right">
- <u-input v-model="form.is_chat.person" type="number" :border="true" placeholder="请输入人次" :clearable="false" />
- </view>
- </view>
- </view>
- <view v-if="!showList[1].flag&&(SubsectionList[curNow].name=='图文咨询')" style="height: 50vh;">
- <u-empty text="未开通" mode="data"></u-empty>
- </view>
- <view style="padding: 20rpx 26rpx 200rpx 26rpx;background-color: #f3f3f3;color:#C0C0C0" v-show="showList[1].flag&&(SubsectionList[curNow].name=='图文咨询')">
- 提示:就诊人信息用于平台审核和医疗业务使用,不会外传。请正却确填写就诊人信息,如需修改身份信息可电话联系客服修改(13330431369)
- </view>
- <!-- 门诊预约 -->
- <view class="v" v-show="showList[2].flag&&(SubsectionList[curNow].name=='门诊预约')">
- <view v-if="hospitalcurrent != -1">
- <view>
- <u-button @click="hospitalShow = true">{{form.is_appoint.hospitalList[hospitalcurrent].name}}</u-button>
- </view>
- <!-- 基础价格 -->
- <view class="list">
- <!-- 左 -->
- <view class="left">
- <view class="t1">基础价格<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(元)</text></view>
- <view class="t2">基础价格为包含十分钟的起步价</view>
- </view>
- <!-- 右 -->
- <view class="right">
- <u-input v-model="form.is_appoint.hospitalList[hospitalcurrent].appoint_price" type="digit" :border="true"
- placeholder="请输入金额" :clearable="false"/>
- </view>
- </view>
- <!-- 服务时间 -->
- <view class="list" style="margin-bottom: 20rpx;">服务时间</view>
- <!-- 线 -->
- <u-line color="#e7e7e7" />
- <!-- 早上 -->
- <view style="margin-top: 20rpx;">
- <view>
- <view class="flex justify-between" style="margin-bottom: 16rpx;">
- <text>上午服务时间</text>
- <text style="color:#4CA0FC;">可预约号源: {{form.is_appoint.hospitalList[hospitalcurrent].service_time.mon.amPerson}}个</text>
- </view>
- <view class="select_time" @click="selectTime(0,2)">
- <text>{{form.is_appoint.hospitalList[hospitalcurrent].service_time.mon.amStartTime==""?
- "选择开始时间 - 结束时间":
- form.is_appoint.hospitalList[hospitalcurrent].service_time.mon.amStartTime+" - " + form.is_appoint.hospitalList[hospitalcurrent].service_time.mon.amEndTime}}</text>
- <u-icon name="clock"></u-icon>
- </view>
- </view>
- </view>
- <!-- 下午 -->
- <view style="margin-top: 20rpx;">
- <view>
- <view class="flex justify-between" style="margin-bottom: 16rpx;">
- <text>下午服务时间</text>
- <text style="color:#4CA0FC;">可预约号源: {{form.is_appoint.hospitalList[hospitalcurrent].service_time.aft.pmPerson}}个</text>
- </view>
- <view class="select_time" @click="selectTime(1,2)">
- <text>{{form.is_appoint.hospitalList[hospitalcurrent].service_time.aft.pmStartTime==""?
- "选择开始时间 - 结束时间":
- form.is_appoint.hospitalList[hospitalcurrent].service_time.aft.pmStartTime + " - " +
- form.is_appoint.hospitalList[hospitalcurrent].service_time.aft.pmEndTime}}</text>
- <u-icon name="clock"></u-icon>
- </view>
- </view>
- </view>
- <!-- 晚上 -->
- <view style="margin-top: 20rpx;">
- <view>
- <view class="flex justify-between" style="margin-bottom: 16rpx;">
- <text>晚上服务时间</text>
- <text style="color:#4CA0FC;">可预约号源: {{form.is_appoint.hospitalList[hospitalcurrent].service_time.nig.nightPerson}}个</text>
- </view>
- <view class="select_time" @click="selectTime(2,2)">
- <text>{{form.is_appoint.hospitalList[hospitalcurrent].service_time.nig.nightStartTime==""?
- "选择开始时间 - 结束时间":
- form.is_appoint.hospitalList[hospitalcurrent].service_time.nig.nightStartTime + " - " +
- form.is_appoint.hospitalList[hospitalcurrent].service_time.nig.nightEndTime
- }}</text>
- <u-icon name="clock"></u-icon>
- </view>
- </view>
- </view>
- <!-- 服务时长 -->
- <view class="list">
- <!-- 左 -->
- <view class="left">
- <view class="t1">就诊时长<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(分钟)</text></view>
- <view class="t2">修改就诊时长,不影响已预约的订单</view>
- </view>
- <!-- 右 -->
- <view class="right" @click="serviceShow = true">
- <text style="margin-right: 20rpx;color: #c1c1c1;font-size: 30rpx;">{{form.is_appoint.hospitalList[hospitalcurrent].service_times==""?"请选择":form.is_appoint.hospitalList[hospitalcurrent].service_times}}</text>
- <u-icon :name="serviceShow?'arrow-up':'arrow-down'" size="30"></u-icon>
- </view>
- </view>
- <!-- 服务订单 -->
- <view class="list">
- <!-- 左 -->
- <view class="left">
- <view class="t1">同时服务订单数<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(个)</text></view>
- <view class="t2">同一时间可接待孩子数量</view>
- </view>
- <!-- 右 -->
- <view class="right">
- <u-input v-model="form.is_appoint.hospitalList[hospitalcurrent].service_num" type="number" :border="true" :clearable="false"
- placeholder="请输入人次" @blur="change" />
- </view>
- </view>
- <!-- 预约天数 -->
- <view class="list">
- <!-- 左 -->
- <view class="left">
- <view class="t1">可预约天数<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(自然天)</text></view>
- <view class="t2">修改预约天数,不影响已预约的订单</view>
- </view>
- <!-- 右 -->
- <view class="right">
- <u-input v-model="form.is_appoint.hospitalList[hospitalcurrent].show_days" type="number" :border="true" :clearable="false"
- placeholder="请输入天数" />
- </view>
- </view>
- </view>
- <view style="width: 100%;height: 60vh;display: flex;justify-content: center;align-items: center;" v-else>
- <view style="width: 90%;">
- <view style="width: 100%;text-align: center;margin-bottom: 40rpx;font-size: 40rpx;">请选择医院</view>
- <u-button shape="circle" type="primary" @click="xzyy">请选择医院</u-button>
- </view>
- </view>
- </view>
- <view v-if="!showList[2].flag&&(SubsectionList[curNow].name=='门诊预约')" style="height: 50vh;">
- <u-empty text="未开通" mode="data"></u-empty>
- </view>
- <view style="padding: 20rpx 26rpx 200rpx 26rpx;background-color: #f3f3f3;color:#C0C0C0" v-show="showList[2].flag&&(SubsectionList[curNow].name=='门诊预约')">
- 提示:就诊人信息用于平台审核和医疗业务使用,不会外传。请正却确填写就诊人信息,如需修改身份信息可电话联系客服修改(13330431369)
- </view>
- <view class="bottomButton" @click="pd" v-if="showList[curNow].flag">保存{{curNow==0?"电话":curNow==1?"图文":"门诊"}}设置</view>
- </view>
- </template>
- <script>
- export default {
- onLoad(options) {
- this.getShows();
- this.getPhoneData();
- this.$nextTick(function() {
- this.addTime()
- })
- console.log(this.form.is_appoint.hospitalList.length)
- },
- mounted() {
- },
- data() {
- return {
- SubsectionList: [{
- name: '电话咨询'
- }, {
- name: '图文咨询'
- }, {
- name: '门诊预约'
- }],
- curNow: 0, // 控制列表显示:0=电话,1=图文,2=门诊预约
- //控制器
- morShow: false, //早上
- aftShow: false, //下午
- nigShow: false, //晚上
- serviceShow: false, //服务时间选择
- hospitalShow: false, //医院选择
- //时间列表
- list: [{
- value: 1,
- label: '00:30'
- },
- {
- value: 2,
- label: '01:00'
- },
- {
- value: 3,
- label: '01:30'
- },
- {
- value: 4,
- label: '02:00'
- },
- {
- value: 5,
- label: '02:30'
- },
- {
- value: 6,
- label: '03:00'
- },
- {
- value: 7,
- label: '03:30'
- },
- {
- value: 8,
- label: '04:00'
- },
- {
- value: 9,
- label: '04:30'
- },
- {
- value: 10,
- label: '05:00'
- },
- {
- value: 11,
- label: '05:30'
- },
- {
- value: 12,
- label: '06:00'
- },
- {
- value: 13,
- label: '06:30'
- },
- {
- value: 14,
- label: '07:00'
- },
- {
- value: 15,
- label: '07:30'
- },
- {
- value: 16,
- label: '08:00'
- },
- {
- value: 18,
- label: '08:30'
- },
- {
- value: 19,
- label: '09:00'
- },
- {
- value: 20,
- label: '09:30'
- },
- {
- value: 21,
- label: '10:00'
- },
- {
- value: 22,
- label: '10:30'
- },
- {
- value: 23,
- label: '11:00'
- },
- {
- value: 24,
- label: '11:30'
- },
- {
- value: 25,
- label: '12:00'
- },
- {
- value: 26,
- label: '12:30'
- },
- {
- value: 27,
- label: '13:00'
- },
- {
- value: 28,
- label: '13:30'
- },
- {
- value: 29,
- label: '14:00'
- },
- {
- value: 30,
- label: '14:30'
- },
- {
- value: 31,
- label: '15:00'
- },
- {
- value: 32,
- label: '15:30'
- },
- {
- value: 33,
- label: '16:00'
- },
- {
- value: 34,
- label: '16:30'
- },
- {
- value: 35,
- label: '17:00'
- },
- {
- value: 36,
- label: '17:30'
- },
- {
- value: 37,
- label: '18:00'
- },
- {
- value: 38,
- label: '18:30'
- },
- {
- value: 39,
- label: '19:00'
- },
- {
- value: 40,
- label: '19:30'
- },
- {
- value: 41,
- label: '20:00'
- },
- {
- value: 42,
- label: '20:30'
- },
- {
- value: 43,
- label: '21:00'
- },
- {
- value: 44,
- label: '21:30'
- },
- {
- value: 45,
- label: '22:00'
- },
- {
- value: 46,
- label: '22:30'
- },
- {
- value: 47,
- label: '23:00'
- },
- {
- value: 48,
- label: '23:30'
- },
- {
- value: 49,
- label: '24:00'
- },
- ],
- morList: [{
- label: '暂不选择',
- children: [{
- label: '暂不选择'
- }]
- },
- {
- label: '00:00',
- children: []
- },
- {
- label: '00:30',
- children: []
- },
- {
- label: '01:00',
- children: []
- },
- {
- label: '01:30',
- children: []
- },
- {
- label: '02:00',
- children: []
- },
- {
- label: '02:30',
- children: []
- },
- {
- label: '03:00',
- children: []
- },
- {
- label: '03:30',
- children: []
- },
- {
- label: '04:00',
- children: []
- },
- {
- label: '04:30',
- children: []
- },
- {
- label: '05:00',
- children: []
- },
- {
- label: '05:30',
- children: []
- },
- {
- label: '06:00',
- children: []
- },
- {
- label: '06:30',
- children: []
- },
- {
- label: '07:00',
- children: []
- },
- {
- label: '07:30',
- children: []
- },
- {
- label: '08:00',
- children: []
- },
- {
- label: '08:30',
- children: []
- },
- {
- label: '09:00',
- children: []
- },
- {
- label: '09:30',
- children: []
- },
- {
- label: '10:00',
- children: []
- },
- {
- label: '10:30',
- children: []
- },
- {
- label: '11:00',
- children: []
- },
- {
- label: '11:30',
- children: []
- },
- ],
- aftList: [{
- label: '暂不选择',
- children: [{
- label: '暂不选择'
- }]
- },
- {
- label: '12:00',
- children: []
- },
- {
- label: '12:30',
- children: []
- },
- {
- label: '13:00',
- children: []
- },
- {
- label: '13:30',
- children: []
- },
- {
- label: '14:00',
- children: []
- },
- {
- label: '14:30',
- children: []
- },
- {
- label: '15:00',
- children: []
- },
- {
- label: '15:30',
- children: []
- },
- {
- label: '16:00',
- children: []
- },
- {
- label: '16:30',
- children: []
- },
- {
- label: '17:00',
- children: []
- },
- {
- label: '17:30',
- children: []
- },
- ],
- nigList: [{
- label: '暂不选择',
- children: [{
- label: '暂不选择'
- }]
- },
- {
- label: '18:00',
- children: []
- },
- {
- label: '18:30',
- children: []
- },
- {
- label: '19:00',
- children: []
- },
- {
- label: '19:30',
- children: []
- },
- {
- label: '20:00',
- children: []
- },
- {
- label: '20:30',
- children: []
- },
- {
- label: '21:00',
- children: []
- },
- {
- label: '21:30',
- children: []
- },
- {
- label: '22:00',
- children: []
- },
- {
- label: '22:30',
- children: []
- },
- {
- label: '23:00',
- children: []
- },
- {
- label: '23:30',
- children: []
- },
- {
- label: '24:00',
- children: []
- },
- ],
- serviceTimelist: [{
- label: '10'
- },
- {
- label: '15'
- },
- {
- label: '20'
- },
- {
- label: '30'
- },
- {
- label: '60'
- },
- ],
- showList: [{
- flag: true
- }, {
- flag: true
- }, {
- flag: true
- }, ],
- //医院
- hospitalTotal: 2,
- changeOne: true,
- //
- hospitals: [],
- //判断应该赋值的位置,每次时间选择,保存点击位置
- timeSlot: 0, //时间段.0上午 1下午 2晚上
- servicesType: 0, //服务种类 0电话 1图文 2门诊
- /**
- * 暂时保存的门诊服务时间段
- * 切换医院清空
- * 选择暂不选择清空
- */
- slot: [],
- morningSlot: 0, //早上
- afternoonSlot: 0, //下午
- // slot[hospitalcurrent].nig: 0, //晚上
- hospitalcurrent: -1, // 保存选中的医院下标
- /********************保存的数据****************************/
- form: {
- is_phone: { //电话
- base_price: "", //基础价格
- mor_time: "", //上午服务时间
- aft_time: "", //上午服务时间
- nig_time: "", //晚上服务时间
- service_order: 0, //同时服务订单数
- type: "1"
- },
- is_chat: { //图文
- base_price: "", //基础价格
- step_price: "", //步进价格
- mor_time: "", //上午服务时间
- aft_time: "", //上午服务时间
- nig_time: "", //晚上服务时间
- service_order: 0, //同时服务订单数
- type: "2"
- },
- is_appoint: { //门诊
- type: "3",
- hospitalList: [],
- },
- }
- }
- },
- methods: {
- change(e) {
- if (e != '') {
- if (this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times != "") { //选择了就诊时长
- //判断有没有选择服务时间
- if (this.slot[this.hospitalcurrent].mon != 0) {
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amPerson = parseInt(this.slot[
- this.hospitalcurrent].mon /
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times) * e
- }
- if (this.slot[this.hospitalcurrent].aft != 0) {
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmPerson = parseInt(this.slot[
- this.hospitalcurrent].aft /
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times) * e
- }
- if (this.slot[this.hospitalcurrent].nig != 0) {
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightPerson = parseInt(this.slot[
- this.hospitalcurrent].nig /
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times) * e
- }
- } else {
- switch (this.timeSlot) {
- case 0:
- this.slot[this.hospitalcurrent].mon = time
- break;
- case 1:
- this.slot[this.hospitalcurrent].aft = time
- break;
- case 2:
- this.slot[this.hospitalcurrent].nig = time
- break;
- }
- }
- }
- },
- /**
- * 拿到返回值并赋值
- * timeSlot:0
- * 时间段.0上午 1下午 2晚上
- * servicesType:0
- * 服务种类 0电话 1图文 2门诊
- * */
- confirm(e) {
- if (e[0].label != '暂不选择') {
- switch (this.timeSlot) {
- case 0:
- if (this.servicesType == 0) {
- this.form.is_phone.mor_time = e[0].label + ' - ' + e[1].label //电话
- } else if (this.servicesType == 1) {
- this.form.is_chat.mor_time = e[0].label + ' - ' + e[1].label //图文
- } else if (this.servicesType == 2) {
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amStartTime = e[0].label
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amEndTime = e[1].label //门诊
- this.slot[this.hospitalcurrent].mon = (e[1].value - e[0].value) * 30
- }
- break;
- case 1:
- if (this.servicesType == 0) {
- this.form.is_phone.aft_time = e[0].label + ' - ' + e[1].label //电话
- } else if (this.servicesType == 1) {
- this.form.is_chat.aft_time = e[0].label + ' - ' + e[1].label //图文
- } else if (this.servicesType == 2) {
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmStartTime = e[0].label
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmEndTime = e[1].label //门诊
- this.slot[this.hospitalcurrent].aft = (e[1].value - e[0].value) * 30
- }
- break;
- case 2:
- if (this.servicesType == 0) {
- this.form.is_phone.nig_time = e[0].label + ' - ' + e[1].label //电话
- } else if (this.servicesType == 1) {
- this.form.is_chat.nig_time = e[0].label + ' - ' + e[1].label //图文
- } else if (this.servicesType == 2) {
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightStartTime = e[0].label
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightEndTime = e[1].label //门诊
- this.slot[this.hospitalcurrent].nig = (e[1].value - e[0].value) * 30
- }
- break;
- default:
- }
- } else { //选择了暂不选择,清空
- switch (this.timeSlot) {
- case 0: //早上
- if (this.servicesType == 0) {
- this.form.is_phone.mor_time = "" //电话
- } else if (this.servicesType == 1) {
- this.form.is_chat.mor_time = "" //图文
- } else if (this.servicesType == 2) {
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amStartTime = ""
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amEndTime = "" //门诊
- this.slot[this.hospitalcurrent].mon = 0
- }
- break;
- case 1: //下午
- if (this.servicesType == 0) {
- this.form.is_phone.aft_time = "" //电话
- } else if (this.servicesType == 1) {
- this.form.is_chat.aft_time = "" //图文
- } else if (this.servicesType == 2) {
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmStartTime = ""
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmEndTime = "" //门诊
- this.slot[this.hospitalcurrent].aft = 0
- }
- break;
- case 2: //晚上
- if (this.servicesType == 0) {
- this.form.is_phone.nig_time = "" //电话
- } else if (this.servicesType == 1) {
- this.form.is_chat.nig_time = "" //图文
- } else if (this.servicesType == 2) {
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightStartTime = ""
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightEndTime = "" //门诊
- this.slot[this.hospitalcurrent].nig = 0
- }
- break;
- default:
- }
- }
- // 在这里计算号源 通过value相减得到时间段值
- //在门诊页面选择 并 选择了时间
- if (this.servicesType == 2 && e[0].label != '暂不选择') {
- if (this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times != "") { //选择了就诊时长
- if (this.form.is_appoint.hospitalList[this.hospitalcurrent].service_num != "") { //选择了就诊时长并填写了同时服务订单数
- let time = parseInt((e[1].value - e[0].value) * 30 / this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times)
- console.log(time)
- switch (this.timeSlot) {
- case 0:
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amPerson = time
- break;
- case 1:
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmPerson = time
- break;
- case 2:
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightPerson = time
- break;
- }
- }
- } else { //没有选择就诊时长
- let time = (e[1].value - e[0].value) * 30
- switch (this.timeSlot) {
- case 0:
- this.slot[this.hospitalcurrent].mon = time
- break;
- case 1:
- this.slot[this.hospitalcurrent].aft = time
- break;
- case 2:
- this.slot[this.hospitalcurrent].nig = time
- break;
- }
- }
- }
- console.log(this.form)
- },
- /**
- * 给所有时间段数组赋值
- * */
- addTime() {
- // 早上
- for (let a = 1; a < this.morList.length; a++) { //从1开始,避开暂不选择
- this.morList[a].children = this.list.slice(a - 1, 24)
- this.morList[a].value = a - 1;
- }
- //下午
- for (let a = 1; a < this.aftList.length; a++) { //从1开始,避开暂不选择
- this.aftList[a].children = this.list.slice(23 + a, 36)
- this.aftList[a].value = 24 + a;
- }
- //晚上
- for (let a = 1; a < this.nigList.length; a++) { //从1开始,避开暂不选择
- this.nigList[a].children = this.list.slice(35 + a)
- this.nigList[a].value = 36 + a;
- }
- },
- /**
- * 选择时间
- * timeSlot 选择的时间段
- * servicesType 选择的服务
- * */
- selectTime(timeSlot, servicesType) {
- //保存位置
- this.timeSlot = timeSlot;
- this.servicesType = servicesType;
- //显示选择器
- switch (timeSlot) {
- case 0:
- this.morShow = true;
- break;
- case 1:
- this.aftShow = true;
- break;
- case 2:
- this.nigShow = true;
- break;
- }
- },
- /**
- * 选择就诊时长
- */
- selectService(e) {
- console.log("同时服务订单数", this.form.is_appoint.hospitalList[this.hospitalcurrent].service_num)
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times = e[0].label
- if (this.form.is_appoint.hospitalList[this.hospitalcurrent].service_num != "") {
- if (this.slot[this.hospitalcurrent].mon != 0) {
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amPerson = parseInt(this.slot[
- this.hospitalcurrent].mon /
- e[0].label) * this.form.is_appoint.hospitalList[this.hospitalcurrent].service_num
- }
- if (this.slot[this.hospitalcurrent].aft != 0) {
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmPerson = parseInt(this.slot[
- this.hospitalcurrent].aft /
- e[0].label) * this.form.is_appoint.hospitalList[this.hospitalcurrent].service_num
- }
- if (this.slot[this.hospitalcurrent].nig != 0) {
- this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightPerson = parseInt(this.slot[
- this.hospitalcurrent].nig /
- e[0].label) * this.form.is_appoint.hospitalList[this.hospitalcurrent].service_num
- }
- }
- },
- /**
- * 选择医院
- */
- selectHospital(e) {
- for (let a = 0; a < this.form.is_appoint.hospitalList.length; a++) {
- if (e[0].value == this.form.is_appoint.hospitalList[a].id) {
- this.hospitalcurrent = a
- }
- }
- console.log(this.hospitalcurrent)
- //清空暂存数据
- // this.slot[hospitalcurrent].mon = 0 //早上
- // this.afternoonSlot = 0 //下午
- // this.slot[hospitalcurrent].nig = 0 //晚上
- },
- /* 分段器选择 */
- sectionChange(index) {
- switch(index){
- case 0:this.getPhoneData();break;
- case 1:this.getChatData();break;
- case 2:this.getMenData();break;
- }
- this.curNow = index;
- },
- /* 保存 */
- pd() {
- let that = this
- //判断有没有填写填写完整
- switch(this.curNow){
- case 0: //电话的保存
- if (that.showList[0].flag) { //如果打开了电话服务
- if (this.form.is_phone.base_price == "") { //电话的基础价格没有填
- uni.showToast({
- title: '请填写电话咨询的基础价格,否则无法保存',
- icon: 'none'
- })
- return false
- }
- if (this.form.is_phone.step_price == "") { //电话的步进价格没有填
- uni.showToast({
- title: '请填写电话咨询的步进价格,否则无法保存',
- icon: 'none'
- })
- return false
- }
- console.log(this.form.is_phone.mor_time == "",this.form.is_phone.aft_time == "",this.form.is_phone.nig_time == "")
- if(this.form.is_phone.mor_time == ""&&this.form.is_phone.aft_time == ""&&this.form.is_phone.nig_time == ""){
- uni.showToast({
- title: '请至少选择一个服务时间段',
- icon: 'none'
- })
- return false
- }
- // if (this.form.is_phone.mor_time == "") { //电话的早上服务时间
- // uni.showToast({
- // title: '请填写电话咨询的上午服务时间,否则无法保存',
- // icon: 'none'
- // })
- // return false
- // }
- // if (this.form.is_phone.aft_time == "") { //电话的下午服务时间
- // uni.showToast({
- // title: '请填写电话咨询的下午服务时间,否则无法保存',
- // icon: 'none'
- // })
- // return false
- // }
- // if (this.form.is_phone.nig_time == "") { //电话的晚上服务时间
- // uni.showToast({
- // title: '请填写电话咨询的晚上服务时间,否则无法保存',
- // icon: 'none'
- // })
- // return false
- // }
- if (this.form.is_phone.person == "") { //电话的服务人次
- uni.showToast({
- title: '请填写电话咨询的服务人次,否则无法保存',
- icon: 'none'
- })
- return false
- }
- this.setPhoneData()
- }
-
- break;
- case 1: //图文的保存
- if (that.showList[1].flag) { //如果打开了图文服务
- if (this.form.is_chat.base_price == "") { //图文的基础价格没有填
- uni.showToast({
- title: '请填写图文咨询的基础价格,否则无法保存',
- icon: 'none'
- })
- return false
- }
- if(this.form.is_chat.mor_time == ""&&this.form.is_chat.aft_time == ""&&this.form.is_chat.nig_time == ""){
- uni.showToast({
- title: '请至少保存一个时间段',
- icon: 'none'
- })
- return false
- }
- // if (this.form.is_chat.mor_time == "") { //图文的早上服务时间
- // uni.showToast({
- // title: '请填写图文咨询的上午服务时间,否则无法保存',
- // icon: 'none'
- // })
- // return false
- // }
- // if (this.form.is_chat.aft_time == "") { //图文的下午服务时间
- // uni.showToast({
- // title: '请填写图文咨询的下午服务时间,否则无法保存',
- // icon: 'none'
- // })
- // return false
- // }
- // if (this.form.is_chat.nig_time == "") { //图文的晚上服务时间
- // uni.showToast({
- // title: '请填写图文咨询的晚上服务时间,否则无法保存',
- // icon: 'none'
- // })
- // return false
- // }
- if (this.form.is_chat.person == "") { //图文的服务人次
- uni.showToast({
- title: '请填写图文咨询的同时服务人次,否则无法保存',
- icon: 'none'
- })
- return false
- }
- this.setChatData()
- }
- break;
- case 2: //门诊的保存
- if (that.showList[2].flag) {
-
- let item = that.form.is_appoint.hospitalList[this.hospitalcurrent]
- console.log("item",item.appoint_price == '')
- //基础价格
- if (item.appoint_price == '') {
- uni.showToast({
- title: '请填写' + item.name + '的基础价格,否则无法保存',
- icon: 'none'
- })
- return false
- }
- //上午
- if (item.service_time.mon.amStartTime == "") {
- uni.showToast({
- title: '请填写' + item.name + '的上午服务时间,否则无法保存',
- icon: 'none'
- })
- return false
- }
- //下午
- if (item.service_time.aft.pmStartTime == "") {
- uni.showToast({
- title: '请填写' + item.name + '的下午服务时间,否则无法保存',
- icon: 'none'
- })
- return false
- }
- //晚上
- if (item.service_time.nig.nightStartTime == "") {
- uni.showToast({
- title: '请填写' + item.name + '的晚上服务时间,否则无法保存',
- icon: 'none'
- })
- return false
- }
- //就诊时长
- if (item.service_times == "") {
- uni.showToast({
- title: '请填写' + item.name + '的就诊时长,否则无法保存',
- icon: 'none'
- })
- return false
- }
- //同时服务订单数
- if (item.service_num == "") {
- uni.showToast({
- title: '请填写' + item.name + '的同时服务订单数,否则无法保存',
- icon: 'none'
- })
- return false
- }
- //可预约天数
- if (item.show_days == "") {
- uni.showToast({
- title: '请填写' + item.name + '的可预约天数,否则无法保存',
- icon: 'none'
- })
- return false
- }
-
-
- this.setMenData()
- }
- break;
- }
- },
- bc: async function() {
- let that = this;
- var forms = JSON.parse(JSON.stringify(that.form));
- let phone_am = forms.is_phone.mor_time != '' ? forms.is_phone.mor_time.split(' - ') : '';
- let phone_pm = forms.is_phone.aft_time != '' ? forms.is_phone.aft_time.split(' - ') : '';
- let phone_ni = forms.is_phone.nig_time != '' ? forms.is_phone.nig_time.split(' - ') : '';
- forms.is_phone.amStartTime = phone_am != '' ? phone_am[0] : '';
- forms.is_phone.amEndTime = phone_am != '' ? phone_am[1] : '';
- forms.is_phone.pmStartTime = phone_pm != '' ? phone_pm[0] : '';
- forms.is_phone.pmEndTime = phone_pm != '' ? phone_pm[1] : '';
- forms.is_phone.nightStartTime = phone_ni != '' ? phone_ni[0] : '';
- forms.is_phone.nightEndTime = phone_ni != '' ? phone_ni[1] : '';
- let chat_am = forms.is_chat.mor_time != '' ? forms.is_chat.mor_time.split(' - ') : '';
- let chat_pm = forms.is_chat.aft_time != '' ? forms.is_chat.aft_time.split(' - ') : '';
- let chat_ni = forms.is_chat.nig_time != '' ? forms.is_chat.nig_time.split(' - ') : '';
- forms.is_chat.amStartTime = chat_am != '' ? chat_am[0] : '';
- forms.is_chat.amEndTime = chat_am != '' ? chat_am[1] : '';
- forms.is_chat.pmStartTime = chat_pm != '' ? chat_pm[0] : '';
- forms.is_chat.pmEndTime = chat_pm != '' ? chat_pm[1] : '';
- forms.is_chat.nightStartTime = chat_ni != '' ? chat_ni[0] : '';
- forms.is_chat.nightEndTime = chat_ni != '' ? chat_ni[1] : '';
- let newMenList = [];
- for (let i = 0; i < forms.is_appoint.hospitalList.length; i++) {
- newMenList.push({
- "base_price": forms.is_appoint.hospitalList[i].appoint_price,
- "service_times": forms.is_appoint.hospitalList[i].service_times,
- "service_num": forms.is_appoint.hospitalList[i].service_num,
- "amStartTime": forms.is_appoint.hospitalList[i].service_time.mon.amStartTime,
- "amEndTime": forms.is_appoint.hospitalList[i].service_time.mon.amEndTime,
- "amPerson": forms.is_appoint.hospitalList[i].service_time.mon.amPerson,
- "pmStartTime": forms.is_appoint.hospitalList[i].service_time.aft.pmStartTime,
- "pmEndTime": forms.is_appoint.hospitalList[i].service_time.aft.pmEndTime,
- "pmPerson": forms.is_appoint.hospitalList[i].service_time.aft.pmPerson,
- "nightStartTime": forms.is_appoint.hospitalList[i].service_time.nig.nightStartTime,
- "nightEndTime": forms.is_appoint.hospitalList[i].service_time.nig.nightEndTime,
- "nightPerson": forms.is_appoint.hospitalList[i].service_time.nig.nightPerson,
- "show_days": forms.is_appoint.hospitalList[i].show_days,
- "org_id": forms.is_appoint.hospitalList[i].id,
- })
- }
- forms.is_appoint = newMenList;
- if (typeof forms != 'string') {
- forms = JSON.stringify(forms)
- }
- console.log("forms", forms)
- let res = await that.$request.post('doctor/saveSettingList', {
- data: forms,
- type: 2
- });
- if (res.status == 0) {
- uni.showToast({
- icon: 'none',
- duration: 3000,
- title: '操作成功',
- })
- }
- console.log('res对象:', res);
- // 延迟1秒
- // setTimeout(function() {
- // uni.switchTab({
- // url: '../index/index'
- // })
- // }, 1000);
- },
- /**
- * 保存电话设置
- * */
- setPhoneData: async function() {
- let that = this;
- let forms = JSON.parse(JSON.stringify(that.form));
- let phone_am = forms.is_phone.mor_time != '' ? forms.is_phone.mor_time.split(' - ') : ['',''];
- let phone_pm = forms.is_phone.aft_time != '' ? forms.is_phone.aft_time.split(' - ') : ['',''];
- let phone_ni = forms.is_phone.nig_time != '' ? forms.is_phone.nig_time.split(' - ') : ['',''];
- console.log("1111111111111111111111",phone_am,phone_pm,phone_ni)
- forms.is_phone.amStartTime = phone_am != '' ? phone_am[0] : '';
- forms.is_phone.amEndTime = phone_am != '' ? phone_am[1] : '';
- forms.is_phone.pmStartTime = phone_pm != '' ? phone_pm[0] : '';
- forms.is_phone.pmEndTime = phone_pm != '' ? phone_pm[1] : '';
- forms.is_phone.nightStartTime = phone_ni != '' ? phone_ni[0] : '';
- forms.is_phone.nightEndTime = phone_ni != '' ? phone_ni[1] : '';
- console.log('2222222222222',forms.is_phone)
- if(typeof forms == 'object'){
- forms = JSON.stringify(forms)
- }
- let sp = await this.$request.post('doctor/saveSettingPhone', {
- data: forms,
- });
- if (sp.status == 0) {
- uni.showToast({
- icon: 'none',
- duration: 1500,
- title: '操作成功',
-
- })
- }
- },
- /**
- *保存图文设置
- * */
- setChatData: async function() {
- let that = this;
- let forms = JSON.parse(JSON.stringify(that.form));
- let chat_am = forms.is_chat.mor_time != '' ? forms.is_chat.mor_time.split(' - ') : '';
- let chat_pm = forms.is_chat.aft_time != '' ? forms.is_chat.aft_time.split(' - ') : '';
- let chat_ni = forms.is_chat.nig_time != '' ? forms.is_chat.nig_time.split(' - ') : '';
- forms.is_chat.amStartTime = chat_am != '' ? chat_am[0] : '';
- forms.is_chat.amEndTime = chat_am != '' ? chat_am[1] : '';
- forms.is_chat.pmStartTime = chat_pm != '' ? chat_pm[0] : '';
- forms.is_chat.pmEndTime = chat_pm != '' ? chat_pm[1] : '';
- forms.is_chat.nightStartTime = chat_ni != '' ? chat_ni[0] : '';
- forms.is_chat.nightEndTime = chat_ni != '' ? chat_ni[1] : '';
- if(typeof forms == 'object'){
- forms = JSON.stringify(forms)
- }
- let sc = await this.$request.post('doctor/saveSettingChat', {
- data: forms
- });
- console.log("保存电话设置",sc)
- if (sc.status == 0) {
- uni.showToast({
- icon: 'none',
- duration: 1500,
- title: '操作成功',
-
- })
- }
- },
- /**
- * 保存门诊设置
- * */
- setMenData: async function() {
- let that = this;
- let forms = JSON.parse(JSON.stringify(that.form));
- let newMenList = [];
- let i = this.hospitalcurrent
- newMenList.push({
- "base_price": forms.is_appoint.hospitalList[i].appoint_price,
- "service_times": forms.is_appoint.hospitalList[i].service_times,
- "service_num": forms.is_appoint.hospitalList[i].service_num,
- "amStartTime": forms.is_appoint.hospitalList[i].service_time.mon.amStartTime,
- "amEndTime": forms.is_appoint.hospitalList[i].service_time.mon.amEndTime,
- "amPerson": forms.is_appoint.hospitalList[i].service_time.mon.amPerson,
- "pmStartTime": forms.is_appoint.hospitalList[i].service_time.aft.pmStartTime,
- "pmEndTime": forms.is_appoint.hospitalList[i].service_time.aft.pmEndTime,
- "pmPerson": forms.is_appoint.hospitalList[i].service_time.aft.pmPerson,
- "nightStartTime": forms.is_appoint.hospitalList[i].service_time.nig.nightStartTime,
- "nightEndTime": forms.is_appoint.hospitalList[i].service_time.nig.nightEndTime,
- "nightPerson": forms.is_appoint.hospitalList[i].service_time.nig.nightPerson,
- "show_days": forms.is_appoint.hospitalList[i].show_days,
- "org_id": forms.is_appoint.hospitalList[i].id,
- })
-
- console.log("保存门诊shez",newMenList)
- let a = ({'is_appoint':newMenList})
- if(typeof a == 'object'){
- a = JSON.stringify(a)
- }
- let sm = await this.$request.post('doctor/saveSettingSchedule', {
- data: a
- });
- console.log("门诊保存返回数据",sm)
- if (sm.status == 0) {
- uni.showToast({
- icon: 'none',
- duration: 1500,
- title: '操作成功',
-
- })
- }
- },
- /**
- * 电话数据获取
- * */
- getPhoneData: async function() {
- let gp = await this.$request.post('doctor/getSettingPhone', {
- 'type': 2
- });
- console.log("电话数据获取", gp);
- if (gp.status == 0) {
- let data = gp.data.list
- this.form.is_phone.base_price = data.base_price; //基础价格
- this.form.is_phone.step_price = data.step_price; //步进价格
- //早上 下午 晚上
- this.form.is_phone.mor_time = data.service_time[1] != undefined &&data.service_time[1].amStartTime != ":" ? data.service_time[1].amStartTime + ' - ' + data
- .service_time[1].amEndTime : '';
- this.form.is_phone.aft_time = data.service_time[2] != undefined && data.service_time[2].pmStartTime != ":"? data.service_time[2].pmStartTime + ' - ' + data
- .service_time[2].pmEndTime : '';
- this.form.is_phone.nig_time = data.service_time[3] != undefined && data.service_time[3].nightStartTime!= ":"? data.service_time[3].nightStartTime + ' - ' +
- data.service_time[3].nightEndTime : '';
- this.form.is_phone.person = data.person; //服务人次
- }
- },
- /**
- * 图文数据获取
- * */
- getChatData: async function() {
- let gt = await this.$request.post('doctor/getSettingChat', {
- 'type': 2
- });
- console.log("图文数据获取", gt);
- if (gt.status == 0) {
- let data = gt.data.list
- this.form.is_chat.base_price = data.base_price; //基础价格
- // this.form.is_chat.step_price = data.chat.step_price; //步进价格
- this.form.is_chat.person = data.person; //服务人次
- //早上 下午 晚上
- this.form.is_chat.mor_time = data.service_time[1] != undefined ? data.service_time[1].amStartTime + ' - ' + data.service_time[
- 1].amEndTime : '';
- this.form.is_chat.aft_time = data.service_time[2] != undefined ? data.service_time[2].pmStartTime + ' - ' + data.service_time[
- 2].pmEndTime : '';
- this.form.is_chat.nig_time = data.service_time[3] != undefined ? data.service_time[3].nightStartTime + ' - ' +
- data.service_time[3].nightEndTime : '';
- }
- },
- /**
- * 门诊数据获取
- * */
- getMenData: async function() {
- let gm = await this.$request.post('doctor/getSettingSchedule', {
- 'type': 2
- });
- console.log("门诊数据获取", gm);
- if (gm.status == 0) {
- let dataList = gm.data.list
- let lists = [];
- for (let i = 0; i < dataList.length; i++) {
- /**
- * 计算所有医院的上下晚时间段时长,用于计算号源
- * 需要拿到开始时间和结束时间,相减并判断是否为半点
- * 公式:( 结束时间(小时) - 开始时间(小时) ) * 60- ( 结束时间(分钟) - 开始时间(分钟) ) = 时长
- * */
- let monDuration = (dataList[i].service_time[1].amEndTime.substr(0, 2) - dataList[i].service_time[1].amStartTime
- .substr(0, 2)) * 60 + (dataList[i].service_time[1].amEndTime.substr(3, 5) - dataList[i].service_time[1].amStartTime
- .substr(3, 5))
- let aftDuration = (dataList[i].service_time[2].pmEndTime.substr(0, 2) - dataList[i].service_time[2].pmStartTime
- .substr(0, 2)) * 60 + (dataList[i].service_time[2].pmEndTime.substr(3, 5) - dataList[i].service_time[2].pmStartTime
- .substr(3, 5))
- let nigDuration = (dataList[i].service_time[3].nightEndTime.substr(0, 2) - dataList[i].service_time[3].nightStartTime
- .substr(0, 2)) * 60 + (dataList[i].service_time[3].nightEndTime.substr(3, 5) - dataList[i].service_time[3].nightStartTime
- .substr(3, 5))
- console.log("早", dataList[i].org_name, monDuration)
- console.log("下", dataList[i].org_name, aftDuration)
- console.log("晚", dataList[i].org_name, nigDuration)
- this.slot.push({
- mon: monDuration,
- aft: aftDuration,
- nig: nigDuration
- });
-
- lists.push({
- id: dataList[i].org_id, //医院Id
- name: dataList[i].org_name,
- show_days: dataList[i].show_days, //可预约天数
- service_times: dataList[i].service_times, //就诊时长
- appoint_price: dataList[i].appoint_price, //基础价格
- service_num: dataList[i].service_num,
- service_time: {
- mon: {
- "amStartTime": dataList[i].service_time[1].amStartTime, //上午服务时间
- "amEndTime": dataList[i].service_time[1].amEndTime,
- "amPerson": dataList[i].service_time[1].amPerson //上午可预约号源
- },
- aft: {
- "pmStartTime": dataList[i].service_time[2].pmStartTime, //下午服务时间
- "pmEndTime": dataList[i].service_time[2].pmEndTime,
- "pmPerson": dataList[i].service_time[2].pmPerson, //下午可预约号源
- },
- nig: {
- "nightStartTime": dataList[i].service_time[3].nightStartTime, //晚上服务时间
- "nightEndTime": dataList[i].service_time[3].nightEndTime,
- "nightPerson": dataList[i].service_time[3].nightPerson //晚上可预约号源
- }
- },
- })
- }
-
- console.log("计算出来的每个医院服务时长(单位:分钟)", this.slot)
- this.form.is_appoint.hospitalList = lists;
- if (this.form.is_appoint.hospitalList.length == 1) {
- this.hospitalcurrent = 0
- }
- }
- },
- /**
- * 获取服务开通状态
- * */
- getShows: async function() {
- // 清空价格
- this.form.is_phone.person = '';
- this.form.is_chat.person = '';
- this.form.is_appoint.person = '';
- //总控 全部的服务开通状态
- let res = await this.$request.post('doctor/getSettingBase', {
- 'type': 2
- });
- console.log("总控数据获取", res);
- if (res.status == 0) {
- // 1.控制列表显示,2.渲染数据
- //ltb 分段器赋值
- this.showList[0].flag = res.data.is_phone;
- this.showList[1].flag = res.data.is_chat;
- this.showList[2].flag = res.data.is_appoint;
- }
- // //电话 数据获取
- // let gp = await this.$request.post('doctor/getSettingPhone', {
- // 'type': 2
- // });
- // console.log("电话数据获取", gp);
- // if (gp.status == 0) {
- // let data = gp.data.list
- // this.form.is_phone.base_price = data.base_price; //基础价格
- // this.form.is_phone.step_price = data.step_price; //步进价格
- // //早上 下午 晚上
- // this.form.is_phone.mor_time = data.service_time[1] != undefined ? data.service_time[1].amStartTime + ' - ' + data
- // .service_time[1].amEndTime : '';
- // this.form.is_phone.aft_time = data.service_time[2] != undefined ? data.service_time[2].pmStartTime + ' - ' + data
- // .service_time[2].pmEndTime : '';
- // this.form.is_phone.nig_time = data.service_time[3] != undefined ? data.service_time[3].nightStartTime + ' - ' +
- // data.service_time[3].nightEndTime : '';
- // this.form.is_phone.person = data.person; //服务人次
- // }
- // //图文 数据获取
- // let gt = await this.$request.post('doctor/getSettingChat', {
- // 'type': 2
- // });
- // console.log("图文数据获取", gt);
- // if (gt.status == 0) {
- // let data = gt.data.list
- // this.form.is_chat.base_price = data.base_price; //基础价格
- // // this.form.is_chat.step_price = data.chat.step_price; //步进价格
- // this.form.is_chat.person = data.person; //服务人次
- // //早上 下午 晚上
- // this.form.is_chat.mor_time = data.service_time[1] != undefined ? data.service_time[1].amStartTime + ' - ' + data.service_time[
- // 1].amEndTime : '';
- // this.form.is_chat.aft_time = data.service_time[2] != undefined ? data.service_time[2].pmStartTime + ' - ' + data.service_time[
- // 2].pmEndTime : '';
- // this.form.is_chat.nig_time = data.service_time[3] != undefined ? data.service_time[3].nightStartTime + ' - ' +
- // data.service_time[3].nightEndTime : '';
- // }
- // let gm = await this.$request.post('doctor/getSettingSchedule', {
- // 'type': 2
- // });
- // console.log("门诊数据获取", gm);
- // if (gm.status == 0) {
- // let dataList = gm.data.list
- // let lists = [];
- // for (let i = 0; i < dataList.length; i++) {
- // /**
- // * 计算所有医院的上下晚时间段时长,用于计算号源
- // * 需要拿到开始时间和结束时间,相减并判断是否为半点
- // * 公式:( 结束时间(小时) - 开始时间(小时) ) * 60- ( 结束时间(分钟) - 开始时间(分钟) ) = 时长
- // * */
- // let monDuration = (dataList[i].service_time[1].amEndTime.substr(0, 2) - dataList[i].service_time[1].amStartTime
- // .substr(0, 2)) * 60 + (dataList[i].service_time[1].amEndTime.substr(3, 5) - dataList[i].service_time[1].amStartTime
- // .substr(3, 5))
- // let aftDuration = (dataList[i].service_time[2].pmEndTime.substr(0, 2) - dataList[i].service_time[2].pmStartTime
- // .substr(0, 2)) * 60 + (dataList[i].service_time[2].pmEndTime.substr(3, 5) - dataList[i].service_time[2].pmStartTime
- // .substr(3, 5))
- // let nigDuration = (dataList[i].service_time[3].nightEndTime.substr(0, 2) - dataList[i].service_time[3].nightStartTime
- // .substr(0, 2)) * 60 + (dataList[i].service_time[3].nightEndTime.substr(3, 5) - dataList[i].service_time[3].nightStartTime
- // .substr(3, 5))
- // console.log("早", dataList[i].org_name, monDuration)
- // console.log("下", dataList[i].org_name, aftDuration)
- // console.log("晚", dataList[i].org_name, nigDuration)
- // this.slot.push({
- // mon: monDuration,
- // aft: aftDuration,
- // nig: nigDuration
- // });
- // lists.push({
- // id: dataList[i].org_id, //医院Id
- // name: dataList[i].org_name,
- // show_days: dataList[i].show_days, //可预约天数
- // service_times: dataList[i].service_times, //就诊时长
- // appoint_price: dataList[i].appoint_price, //基础价格
- // service_num: dataList[i].service_num,
- // service_time: {
- // mon: {
- // "amStartTime": dataList[i].service_time[1].amStartTime, //上午服务时间
- // "amEndTime": dataList[i].service_time[1].amEndTime,
- // "amPerson": dataList[i].service_time[1].amPerson //上午可预约号源
- // },
- // aft: {
- // "pmStartTime": dataList[i].service_time[2].pmStartTime, //下午服务时间
- // "pmEndTime": dataList[i].service_time[2].pmEndTime,
- // "pmPerson": dataList[i].service_time[2].pmPerson, //下午可预约号源
- // },
- // nig: {
- // "nightStartTime": dataList[i].service_time[3].nightStartTime, //晚上服务时间
- // "nightEndTime": dataList[i].service_time[3].nightEndTime,
- // "nightPerson": dataList[i].service_time[3].nightPerson //晚上可预约号源
- // }
- // },
- // })
- // }
- // console.log("计算出来的每个医院服务时长(单位:分钟)", this.slot)
- // this.form.is_appoint.hospitalList = lists;
- // if (this.form.is_appoint.hospitalList.length == 1) {
- // this.hospitalcurrent = 0
- // }
- // }
- // if (res.data.list.phone.length != 0) {
- // // 渲染电话的基础数据
- // this.form.is_phone.base_price = res.data.list.phone.base_price;
- // this.form.is_phone.step_price = res.data.list.phone.step_price;
- // this.form.is_phone.mor_time = res.data.list.phone.service_time[1] != undefined ? res.data.list.phone.service_time[
- // 1].amStartTime + ' - ' + res.data.list.phone.service_time[1].amEndTime : '';
- // this.form.is_phone.aft_time = res.data.list.phone.service_time[2] != undefined ? res.data.list.phone.service_time[
- // 2].pmStartTime + ' - ' + res.data.list.phone.service_time[2].pmEndTime : '';
- // this.form.is_phone.nig_time = res.data.list.phone.service_time[3] != undefined ? res.data.list.phone.service_time[
- // 3].nightStartTime + ' - ' + res.data.list.phone.service_time[3].nightEndTime : '';
- // this.form.is_phone.person = res.data.list.phone.person;
- // }
- // if (res.data.list.chat.length != 0) {
- // // 渲染图文的基础数据
- // this.form.is_chat.base_price = res.data.list.chat.base_price;
- // this.form.is_chat.step_price = res.data.list.chat.step_price;
- // this.form.is_chat.person = res.data.list.chat.person;
- // this.form.is_chat.mor_time = res.data.list.chat.service_time[1] != undefined ? res.data.list.chat.service_time[
- // 1]
- // .amStartTime + ' - ' + res.data.list.chat.service_time[1].amEndTime : '';
- // this.form.is_chat.aft_time = res.data.list.chat.service_time[2] != undefined ? res.data.list.chat.service_time[
- // 2]
- // .pmStartTime + ' - ' + res.data.list.chat.service_time[2].pmEndTime : '';
- // this.form.is_chat.nig_time = res.data.list.chat.service_time[3] != undefined ? res.data.list.chat.service_time[
- // 3]
- // .nightStartTime + ' - ' + res.data.list.chat.service_time[3].nightEndTime : '';
- // }
- // if (res.data.list.men.length != 0) {
- // let dataList = res.data.list.men;
- // let lists = [];
- // for (let i = 0; i < dataList.length; i++) {
- // /**
- // * 计算所有医院的上下晚时间段时长,用于计算号源
- // * 需要拿到开始时间和结束时间,相减并判断是否为半点
- // * 公式:( 结束时间(小时) - 开始时间(小时) ) * 60- ( 结束时间(分钟) - 开始时间(分钟) ) = 时长
- // * */
- // let monDuration = (dataList[i].service_time[1].amEndTime.substr(0, 2) - dataList[i].service_time[1].amStartTime
- // .substr(0, 2)) * 60 + (dataList[i].service_time[1].amEndTime.substr(3, 5) - dataList[i].service_time[1].amStartTime
- // .substr(3, 5))
- // let aftDuration = (dataList[i].service_time[2].pmEndTime.substr(0, 2) - dataList[i].service_time[2].pmStartTime
- // .substr(0, 2)) * 60 + (dataList[i].service_time[2].pmEndTime.substr(3, 5) - dataList[i].service_time[2].pmStartTime
- // .substr(3, 5))
- // let nigDuration = (dataList[i].service_time[3].nightEndTime.substr(0, 2) - dataList[i].service_time[3].nightStartTime
- // .substr(0, 2)) * 60 + (dataList[i].service_time[3].nightEndTime.substr(3, 5) - dataList[i].service_time[3].nightStartTime
- // .substr(3, 5))
- // console.log("早", dataList[i].org_name, monDuration)
- // console.log("下", dataList[i].org_name, aftDuration)
- // console.log("晚", dataList[i].org_name, nigDuration)
- // this.slot.push({
- // mon: monDuration,
- // aft: aftDuration,
- // nig: nigDuration
- // });
- // lists.push({
- // id: dataList[i].org_id, //医院Id
- // name: dataList[i].org_name,
- // show_days: dataList[i].show_days, //可预约天数
- // service_times: dataList[i].service_times, //就诊时长
- // appoint_price: dataList[i].appoint_price, //基础价格
- // service_num: dataList[i].service_num,
- // service_time: {
- // mon: {
- // "amStartTime": dataList[i].service_time[1].amStartTime, //上午服务时间
- // "amEndTime": dataList[i].service_time[1].amEndTime,
- // "amPerson": dataList[i].service_time[1].amPerson //上午可预约号源
- // },
- // aft: {
- // "pmStartTime": dataList[i].service_time[2].pmStartTime, //下午服务时间
- // "pmEndTime": dataList[i].service_time[2].pmEndTime,
- // "pmPerson": dataList[i].service_time[2].pmPerson, //下午可预约号源
- // },
- // nig: {
- // "nightStartTime": dataList[i].service_time[3].nightStartTime, //晚上服务时间
- // "nightEndTime": dataList[i].service_time[3].nightEndTime,
- // "nightPerson": dataList[i].service_time[3].nightPerson //晚上可预约号源
- // }
- // },
- // })
- // }
- // console.log("计算出来的每个医院服务时长(单位:分钟)", this.slot)
- // this.form.is_appoint.hospitalList = lists;
- // if (this.form.is_appoint.hospitalList.length == 1) {
- // this.hospitalcurrent = 0
- // }
- // }
- /* 渲染时间 */
- //电话的时间
- // console.log(res.data.times)
- // let dhtime = JSON.parse(JSON.stringify(res.data.times))
- // this.dh.timeList1 = dhtime.list1;
- // this.dh.timeList2 = dhtime.list2;
- // this.dh.timeList3 = dhtime.list3;
- // //图文的时间
- // let twtime = JSON.parse(JSON.stringify(res.data.times))
- // this.tw.timeList1 = twtime.list1;
- // this.tw.timeList2 = twtime.list2;
- // this.tw.timeList3 = twtime.list3;
- // // 门诊时间
- // let mz1 = JSON.parse(JSON.stringify(res.data.times))
- // this.mz1.timeList1 = mz1.list1;
- // this.mz1.timeList2 = mz1.list2;
- // this.mz1.timeList3 = mz1.list3;
- // let mz2 = JSON.parse(JSON.stringify(res.data.times))
- // this.mz2.timeList1 = mz2.list1;
- // this.mz2.timeList2 = mz2.list2;
- // this.mz2.timeList3 = mz2.list3;
- // this.reanders(res.data);
- },
- /**
- * 选择医院 判断有没有认证的医院
- * */
- xzyy() {
- console.log(this.form.is_appoint.hospitalList.length)
- console.log(this.form.is_appoint.hospitalList)
- if (this.form.is_appoint.hospitalList.length != 0) {
- this.hospitalShow = true
- } else {
- uni.showModal({
- title: "您还没有已认证的医院,确认去认证?",
- success: function(res) {
- if (res.confirm) {
- uni.redirectTo({
- url: "/pages/login/doctorRenzheng"
- })
- }
- }
- });
- }
- }
- }
- };
- </script>
- <style lang="scss">
- .v {
- padding: 28rpx 28rpx 40rpx 28rpx;
- background-color: #FFFFFF;
- .title {
- font-size: 30rpx;
- font-weight: bold;
- margin-bottom: 28rpx
- }
- .list {
- margin-top: 40rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .left {
- .t1 {
- font-size: 28rpx;
- margin-bottom: 14rpx;
- }
- .t2 {
- font-size: 22rpx;
- color: #999999;
- }
- }
- .right {}
- }
- }
- .btnAll {
- display: flex;
- margin-bottom: 28rpx;
- }
- .but {
- margin-bottom: 28rpx;
- width: 55%;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .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;
- }
- .total {
- height: 80rpx;
- border-radius: 10rpx;
- background-color: #eeeeef;
- padding: 10rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- //模拟分段器
- .front {
- height: 100%;
- flex-grow: 1;
- background-color: #FFF;
- border-radius: 10rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- font-weight: bold;
- font-size: 30rpx;
- }
- .back {
- height: 100%;
- flex-grow: 1;
- background-color: #FFF;
- border-radius: 10rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 30rpx;
- background-color: #eeeeef;
- }
- .select_time {
- display: flex;
- justify-content: space-between;
- border: 1rpx solid #dbdbdb;
- border-radius: 10rpx;
- padding: 14rpx 30rpx;
- color: #cfcfcf;
- }
- </style>
|