more.vue 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924
  1. <template style="background-color: #f3f3f3;">
  2. <view style="width: 100%;height: 100%;">
  3. <!-- 按需求加分段器 -->
  4. <u-subsection :list="SubsectionList" mode="button" :current="curNow" @change="sectionChange"></u-subsection>
  5. <!-- 早上 -->
  6. <u-select v-model="morShow" mode="mutil-column-auto" :list="morList" @confirm="confirm"></u-select>
  7. <!-- 下午 -->
  8. <u-select v-model="aftShow" mode="mutil-column-auto" :list="aftList" @confirm="confirm"></u-select>
  9. <!-- 晚上 -->
  10. <u-select v-model="nigShow" mode="mutil-column-auto" :list="nigList" @confirm="confirm"></u-select>
  11. <!-- 服务时间选择 -->
  12. <u-select v-model="serviceShow" :list="serviceTimelist" @confirm="selectService"></u-select>
  13. <!-- 医院选择 -->
  14. <u-select v-model="hospitalShow" :list="form.is_appoint.hospitalList" @confirm="selectHospital" label-name="name"
  15. value-name="id"></u-select>
  16. <!-- 电话咨询 -->
  17. <view class="v" v-show="showList[0].flag&&(SubsectionList[curNow].name=='电话咨询')">
  18. <!-- 基础价格 -->
  19. <view class="list">
  20. <!-- 左 -->
  21. <view class="left">
  22. <view class="t1">基础价格<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(元)</text></view>
  23. <view class="t2">基础价格为包含十分钟的起步价</view>
  24. </view>
  25. <!-- 右 -->
  26. <view class="right">
  27. <u-input v-model="form.is_phone.base_price" type="digit" :border="true" placeholder="请输入金额" :clearable="false"/>
  28. </view>
  29. </view>
  30. <!-- 步进价格 -->
  31. <view class="list">
  32. <!-- 左 -->
  33. <view class="left">
  34. <view class="t1">步进价格<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(元/每分钟)</text></view>
  35. <view class="t2">步进价格为超过起步价时长的价格</view>
  36. </view>
  37. <!-- 右 -->
  38. <view class="right">
  39. <u-input v-model="form.is_phone.step_price" type="digit" :border="true" placeholder="请输入金额" :clearable="false"/>
  40. </view>
  41. </view>
  42. <!-- 服务时间 -->
  43. <view class="list" style="margin-bottom: 20rpx;">服务时间</view>
  44. <!-- 线 -->
  45. <u-line color="#e7e7e7" />
  46. <!-- 早上 -->
  47. <view style="margin-top: 20rpx;">
  48. <view>
  49. <view class="flex justify-between" style="margin-bottom: 16rpx;">
  50. <text>上午服务时间</text>
  51. </view>
  52. <view class="select_time" @click="selectTime(0,0)">
  53. <text>{{form.is_phone.mor_time==""?"选择开始时间 - 结束时间":form.is_phone.mor_time}}</text>
  54. <u-icon name="clock"></u-icon>
  55. </view>
  56. </view>
  57. </view>
  58. <!-- 下午 -->
  59. <view style="margin-top: 20rpx;">
  60. <view>
  61. <view class="flex justify-between" style="margin-bottom: 16rpx;">
  62. <text>下午服务时间</text>
  63. </view>
  64. <view class="select_time" @click="selectTime(1,0)">
  65. <text>{{form.is_phone.aft_time==""?"选择开始时间 - 结束时间":form.is_phone.aft_time}}</text>
  66. <u-icon name="clock"></u-icon>
  67. </view>
  68. </view>
  69. </view>
  70. <!-- 晚上 -->
  71. <view style="margin-top: 20rpx;">
  72. <view>
  73. <view class="flex justify-between" style="margin-bottom: 16rpx;">
  74. <text>晚上服务时间</text>
  75. </view>
  76. <view class="select_time" @click="selectTime(2,0)">
  77. <text>{{form.is_phone.nig_time==""?"选择开始时间 - 结束时间":form.is_phone.nig_time}}</text>
  78. <u-icon name="clock"></u-icon>
  79. </view>
  80. </view>
  81. </view>
  82. <!-- 服务人次 -->
  83. <view class="list">
  84. <!-- 左 -->
  85. <view class="left">
  86. <view class="t1">服务人次<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(人/每小时)</text></view>
  87. <view class="t2">本项目每小时最大接收的服务人次</view>
  88. </view>
  89. <!-- 右 -->
  90. <view class="right">
  91. <u-input v-model="form.is_phone.person" type="number" :border="true" placeholder="请输入人次" :clearable="false"/>
  92. </view>
  93. </view>
  94. </view>
  95. <view v-if="!showList[0].flag&&(SubsectionList[curNow].name=='电话咨询')" style="height: 50vh;">
  96. <u-empty text="未开通" mode="data"></u-empty>
  97. </view>
  98. <view style="padding: 20rpx 26rpx 200rpx 26rpx;background-color: #f3f3f3;color:#C0C0C0" v-show="showList[0].flag&&(SubsectionList[curNow].name=='电话咨询')">
  99. 提示:就诊人信息用于平台审核和医疗业务使用,不会外传。请正却确填写就诊人信息,如需修改身份信息可电话联系客服修改(13330431369)
  100. </view>
  101. <!-- 图文咨询 -->
  102. <view class="v" v-show="showList[1].flag&&(SubsectionList[curNow].name=='图文咨询')">
  103. <!-- 基础价格 -->
  104. <view class="list">
  105. <!-- 左 -->
  106. <view class="left">
  107. <view class="t1">基础价格<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(元)</text></view>
  108. <view class="t2">基础价格为包含十分钟的起步价</view>
  109. </view>
  110. <!-- 右 -->
  111. <view class="right">
  112. <u-input v-model="form.is_chat.base_price" type="digit" :border="true" placeholder="请输入金额" :clearable="false"/>
  113. </view>
  114. </view>
  115. <!-- 服务时间 -->
  116. <view class="list" style="margin-bottom: 20rpx;">服务时间</view>
  117. <!-- 线 -->
  118. <u-line color="#e7e7e7" />
  119. <!-- 早上 -->
  120. <view style="margin-top: 20rpx;">
  121. <view>
  122. <view class="flex justify-between" style="margin-bottom: 16rpx;">
  123. <text>上午服务时间</text>
  124. </view>
  125. <view class="select_time" @click="selectTime(0,1)">
  126. <text>{{form.is_chat.mor_time==""?"选择开始时间 - 结束时间":form.is_chat.mor_time}}</text>
  127. <u-icon name="clock"></u-icon>
  128. </view>
  129. </view>
  130. </view>
  131. <!-- 下午 -->
  132. <view style="margin-top: 20rpx;">
  133. <view>
  134. <view class="flex justify-between" style="margin-bottom: 16rpx;">
  135. <text>下午服务时间</text>
  136. </view>
  137. <view class="select_time" @click="selectTime(1,1)">
  138. <text>{{form.is_chat.aft_time==""?"选择开始时间 - 结束时间":form.is_chat.aft_time}}</text>
  139. <u-icon name="clock"></u-icon>
  140. </view>
  141. </view>
  142. </view>
  143. <!-- 晚上 -->
  144. <view style="margin-top: 20rpx;">
  145. <view>
  146. <view class="flex justify-between" style="margin-bottom: 16rpx;">
  147. <text>晚上服务时间</text>
  148. </view>
  149. <view class="select_time" @click="selectTime(2,1)">
  150. <text>{{form.is_chat.nig_time==""?"选择开始时间 - 结束时间":form.is_chat.nig_time}}</text>
  151. <u-icon name="clock"></u-icon>
  152. </view>
  153. </view>
  154. </view>
  155. <!-- 服务人次 -->
  156. <view class="list">
  157. <!-- 左 -->
  158. <view class="left">
  159. <view class="t1">同时服务人次<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(人/每小时)</text></view>
  160. <view class="t2">本项目每小时最大接收的服务人次</view>
  161. </view>
  162. <!-- 右 -->
  163. <view class="right">
  164. <u-input v-model="form.is_chat.person" type="number" :border="true" placeholder="请输入人次" :clearable="false" />
  165. </view>
  166. </view>
  167. </view>
  168. <view v-if="!showList[1].flag&&(SubsectionList[curNow].name=='图文咨询')" style="height: 50vh;">
  169. <u-empty text="未开通" mode="data"></u-empty>
  170. </view>
  171. <view style="padding: 20rpx 26rpx 200rpx 26rpx;background-color: #f3f3f3;color:#C0C0C0" v-show="showList[1].flag&&(SubsectionList[curNow].name=='图文咨询')">
  172. 提示:就诊人信息用于平台审核和医疗业务使用,不会外传。请正却确填写就诊人信息,如需修改身份信息可电话联系客服修改(13330431369)
  173. </view>
  174. <!-- 门诊预约 -->
  175. <view class="v" v-show="showList[2].flag&&(SubsectionList[curNow].name=='门诊预约')">
  176. <view v-if="hospitalcurrent != -1">
  177. <view>
  178. <u-button @click="hospitalShow = true">{{form.is_appoint.hospitalList[hospitalcurrent].name}}</u-button>
  179. </view>
  180. <!-- 基础价格 -->
  181. <view class="list">
  182. <!-- 左 -->
  183. <view class="left">
  184. <view class="t1">基础价格<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(元)</text></view>
  185. <view class="t2">基础价格为包含十分钟的起步价</view>
  186. </view>
  187. <!-- 右 -->
  188. <view class="right">
  189. <u-input v-model="form.is_appoint.hospitalList[hospitalcurrent].appoint_price" type="digit" :border="true"
  190. placeholder="请输入金额" :clearable="false"/>
  191. </view>
  192. </view>
  193. <!-- 服务时间 -->
  194. <view class="list" style="margin-bottom: 20rpx;">服务时间</view>
  195. <!-- 线 -->
  196. <u-line color="#e7e7e7" />
  197. <!-- 早上 -->
  198. <view style="margin-top: 20rpx;">
  199. <view>
  200. <view class="flex justify-between" style="margin-bottom: 16rpx;">
  201. <text>上午服务时间</text>
  202. <text style="color:#4CA0FC;">可预约号源: {{form.is_appoint.hospitalList[hospitalcurrent].service_time.mon.amPerson}}个</text>
  203. </view>
  204. <view class="select_time" @click="selectTime(0,2)">
  205. <text>{{form.is_appoint.hospitalList[hospitalcurrent].service_time.mon.amStartTime==""?
  206. "选择开始时间 - 结束时间":
  207. form.is_appoint.hospitalList[hospitalcurrent].service_time.mon.amStartTime+" - " + form.is_appoint.hospitalList[hospitalcurrent].service_time.mon.amEndTime}}</text>
  208. <u-icon name="clock"></u-icon>
  209. </view>
  210. </view>
  211. </view>
  212. <!-- 下午 -->
  213. <view style="margin-top: 20rpx;">
  214. <view>
  215. <view class="flex justify-between" style="margin-bottom: 16rpx;">
  216. <text>下午服务时间</text>
  217. <text style="color:#4CA0FC;">可预约号源: {{form.is_appoint.hospitalList[hospitalcurrent].service_time.aft.pmPerson}}个</text>
  218. </view>
  219. <view class="select_time" @click="selectTime(1,2)">
  220. <text>{{form.is_appoint.hospitalList[hospitalcurrent].service_time.aft.pmStartTime==""?
  221. "选择开始时间 - 结束时间":
  222. form.is_appoint.hospitalList[hospitalcurrent].service_time.aft.pmStartTime + " - " +
  223. form.is_appoint.hospitalList[hospitalcurrent].service_time.aft.pmEndTime}}</text>
  224. <u-icon name="clock"></u-icon>
  225. </view>
  226. </view>
  227. </view>
  228. <!-- 晚上 -->
  229. <view style="margin-top: 20rpx;">
  230. <view>
  231. <view class="flex justify-between" style="margin-bottom: 16rpx;">
  232. <text>晚上服务时间</text>
  233. <text style="color:#4CA0FC;">可预约号源: {{form.is_appoint.hospitalList[hospitalcurrent].service_time.nig.nightPerson}}个</text>
  234. </view>
  235. <view class="select_time" @click="selectTime(2,2)">
  236. <text>{{form.is_appoint.hospitalList[hospitalcurrent].service_time.nig.nightStartTime==""?
  237. "选择开始时间 - 结束时间":
  238. form.is_appoint.hospitalList[hospitalcurrent].service_time.nig.nightStartTime + " - " +
  239. form.is_appoint.hospitalList[hospitalcurrent].service_time.nig.nightEndTime
  240. }}</text>
  241. <u-icon name="clock"></u-icon>
  242. </view>
  243. </view>
  244. </view>
  245. <!-- 服务时长 -->
  246. <view class="list">
  247. <!-- 左 -->
  248. <view class="left">
  249. <view class="t1">就诊时长<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(分钟)</text></view>
  250. <view class="t2">修改就诊时长,不影响已预约的订单</view>
  251. </view>
  252. <!-- 右 -->
  253. <view class="right" @click="serviceShow = true">
  254. <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>
  255. <u-icon :name="serviceShow?'arrow-up':'arrow-down'" size="30"></u-icon>
  256. </view>
  257. </view>
  258. <!-- 服务订单 -->
  259. <view class="list">
  260. <!-- 左 -->
  261. <view class="left">
  262. <view class="t1">同时服务订单数<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(个)</text></view>
  263. <view class="t2">同一时间可接待孩子数量</view>
  264. </view>
  265. <!-- 右 -->
  266. <view class="right">
  267. <u-input v-model="form.is_appoint.hospitalList[hospitalcurrent].service_num" type="number" :border="true" :clearable="false"
  268. placeholder="请输入人次" @blur="change" />
  269. </view>
  270. </view>
  271. <!-- 预约天数 -->
  272. <view class="list">
  273. <!-- 左 -->
  274. <view class="left">
  275. <view class="t1">可预约天数<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(自然天)</text></view>
  276. <view class="t2">修改预约天数,不影响已预约的订单</view>
  277. </view>
  278. <!-- 右 -->
  279. <view class="right">
  280. <u-input v-model="form.is_appoint.hospitalList[hospitalcurrent].show_days" type="number" :border="true" :clearable="false"
  281. placeholder="请输入天数" />
  282. </view>
  283. </view>
  284. </view>
  285. <view style="width: 100%;height: 60vh;display: flex;justify-content: center;align-items: center;" v-else>
  286. <view style="width: 90%;">
  287. <view style="width: 100%;text-align: center;margin-bottom: 40rpx;font-size: 40rpx;">请选择医院</view>
  288. <u-button shape="circle" type="primary" @click="xzyy">请选择医院</u-button>
  289. </view>
  290. </view>
  291. </view>
  292. <view v-if="!showList[2].flag&&(SubsectionList[curNow].name=='门诊预约')" style="height: 50vh;">
  293. <u-empty text="未开通" mode="data"></u-empty>
  294. </view>
  295. <view style="padding: 20rpx 26rpx 200rpx 26rpx;background-color: #f3f3f3;color:#C0C0C0" v-show="showList[2].flag&&(SubsectionList[curNow].name=='门诊预约')">
  296. 提示:就诊人信息用于平台审核和医疗业务使用,不会外传。请正却确填写就诊人信息,如需修改身份信息可电话联系客服修改(13330431369)
  297. </view>
  298. <view class="bottomButton" @click="pd" v-if="showList[curNow].flag">保存{{curNow==0?"电话":curNow==1?"图文":"门诊"}}设置</view>
  299. </view>
  300. </template>
  301. <script>
  302. export default {
  303. onLoad(options) {
  304. this.getShows();
  305. this.getPhoneData();
  306. this.$nextTick(function() {
  307. this.addTime()
  308. })
  309. console.log(this.form.is_appoint.hospitalList.length)
  310. },
  311. mounted() {
  312. },
  313. data() {
  314. return {
  315. SubsectionList: [{
  316. name: '电话咨询'
  317. }, {
  318. name: '图文咨询'
  319. }, {
  320. name: '门诊预约'
  321. }],
  322. curNow: 0, // 控制列表显示:0=电话,1=图文,2=门诊预约
  323. //控制器
  324. morShow: false, //早上
  325. aftShow: false, //下午
  326. nigShow: false, //晚上
  327. serviceShow: false, //服务时间选择
  328. hospitalShow: false, //医院选择
  329. //时间列表
  330. list: [{
  331. value: 1,
  332. label: '00:30'
  333. },
  334. {
  335. value: 2,
  336. label: '01:00'
  337. },
  338. {
  339. value: 3,
  340. label: '01:30'
  341. },
  342. {
  343. value: 4,
  344. label: '02:00'
  345. },
  346. {
  347. value: 5,
  348. label: '02:30'
  349. },
  350. {
  351. value: 6,
  352. label: '03:00'
  353. },
  354. {
  355. value: 7,
  356. label: '03:30'
  357. },
  358. {
  359. value: 8,
  360. label: '04:00'
  361. },
  362. {
  363. value: 9,
  364. label: '04:30'
  365. },
  366. {
  367. value: 10,
  368. label: '05:00'
  369. },
  370. {
  371. value: 11,
  372. label: '05:30'
  373. },
  374. {
  375. value: 12,
  376. label: '06:00'
  377. },
  378. {
  379. value: 13,
  380. label: '06:30'
  381. },
  382. {
  383. value: 14,
  384. label: '07:00'
  385. },
  386. {
  387. value: 15,
  388. label: '07:30'
  389. },
  390. {
  391. value: 16,
  392. label: '08:00'
  393. },
  394. {
  395. value: 18,
  396. label: '08:30'
  397. },
  398. {
  399. value: 19,
  400. label: '09:00'
  401. },
  402. {
  403. value: 20,
  404. label: '09:30'
  405. },
  406. {
  407. value: 21,
  408. label: '10:00'
  409. },
  410. {
  411. value: 22,
  412. label: '10:30'
  413. },
  414. {
  415. value: 23,
  416. label: '11:00'
  417. },
  418. {
  419. value: 24,
  420. label: '11:30'
  421. },
  422. {
  423. value: 25,
  424. label: '12:00'
  425. },
  426. {
  427. value: 26,
  428. label: '12:30'
  429. },
  430. {
  431. value: 27,
  432. label: '13:00'
  433. },
  434. {
  435. value: 28,
  436. label: '13:30'
  437. },
  438. {
  439. value: 29,
  440. label: '14:00'
  441. },
  442. {
  443. value: 30,
  444. label: '14:30'
  445. },
  446. {
  447. value: 31,
  448. label: '15:00'
  449. },
  450. {
  451. value: 32,
  452. label: '15:30'
  453. },
  454. {
  455. value: 33,
  456. label: '16:00'
  457. },
  458. {
  459. value: 34,
  460. label: '16:30'
  461. },
  462. {
  463. value: 35,
  464. label: '17:00'
  465. },
  466. {
  467. value: 36,
  468. label: '17:30'
  469. },
  470. {
  471. value: 37,
  472. label: '18:00'
  473. },
  474. {
  475. value: 38,
  476. label: '18:30'
  477. },
  478. {
  479. value: 39,
  480. label: '19:00'
  481. },
  482. {
  483. value: 40,
  484. label: '19:30'
  485. },
  486. {
  487. value: 41,
  488. label: '20:00'
  489. },
  490. {
  491. value: 42,
  492. label: '20:30'
  493. },
  494. {
  495. value: 43,
  496. label: '21:00'
  497. },
  498. {
  499. value: 44,
  500. label: '21:30'
  501. },
  502. {
  503. value: 45,
  504. label: '22:00'
  505. },
  506. {
  507. value: 46,
  508. label: '22:30'
  509. },
  510. {
  511. value: 47,
  512. label: '23:00'
  513. },
  514. {
  515. value: 48,
  516. label: '23:30'
  517. },
  518. {
  519. value: 49,
  520. label: '24:00'
  521. },
  522. ],
  523. morList: [{
  524. label: '暂不选择',
  525. children: [{
  526. label: '暂不选择'
  527. }]
  528. },
  529. {
  530. label: '00:00',
  531. children: []
  532. },
  533. {
  534. label: '00:30',
  535. children: []
  536. },
  537. {
  538. label: '01:00',
  539. children: []
  540. },
  541. {
  542. label: '01:30',
  543. children: []
  544. },
  545. {
  546. label: '02:00',
  547. children: []
  548. },
  549. {
  550. label: '02:30',
  551. children: []
  552. },
  553. {
  554. label: '03:00',
  555. children: []
  556. },
  557. {
  558. label: '03:30',
  559. children: []
  560. },
  561. {
  562. label: '04:00',
  563. children: []
  564. },
  565. {
  566. label: '04:30',
  567. children: []
  568. },
  569. {
  570. label: '05:00',
  571. children: []
  572. },
  573. {
  574. label: '05:30',
  575. children: []
  576. },
  577. {
  578. label: '06:00',
  579. children: []
  580. },
  581. {
  582. label: '06:30',
  583. children: []
  584. },
  585. {
  586. label: '07:00',
  587. children: []
  588. },
  589. {
  590. label: '07:30',
  591. children: []
  592. },
  593. {
  594. label: '08:00',
  595. children: []
  596. },
  597. {
  598. label: '08:30',
  599. children: []
  600. },
  601. {
  602. label: '09:00',
  603. children: []
  604. },
  605. {
  606. label: '09:30',
  607. children: []
  608. },
  609. {
  610. label: '10:00',
  611. children: []
  612. },
  613. {
  614. label: '10:30',
  615. children: []
  616. },
  617. {
  618. label: '11:00',
  619. children: []
  620. },
  621. {
  622. label: '11:30',
  623. children: []
  624. },
  625. ],
  626. aftList: [{
  627. label: '暂不选择',
  628. children: [{
  629. label: '暂不选择'
  630. }]
  631. },
  632. {
  633. label: '12:00',
  634. children: []
  635. },
  636. {
  637. label: '12:30',
  638. children: []
  639. },
  640. {
  641. label: '13:00',
  642. children: []
  643. },
  644. {
  645. label: '13:30',
  646. children: []
  647. },
  648. {
  649. label: '14:00',
  650. children: []
  651. },
  652. {
  653. label: '14:30',
  654. children: []
  655. },
  656. {
  657. label: '15:00',
  658. children: []
  659. },
  660. {
  661. label: '15:30',
  662. children: []
  663. },
  664. {
  665. label: '16:00',
  666. children: []
  667. },
  668. {
  669. label: '16:30',
  670. children: []
  671. },
  672. {
  673. label: '17:00',
  674. children: []
  675. },
  676. {
  677. label: '17:30',
  678. children: []
  679. },
  680. ],
  681. nigList: [{
  682. label: '暂不选择',
  683. children: [{
  684. label: '暂不选择'
  685. }]
  686. },
  687. {
  688. label: '18:00',
  689. children: []
  690. },
  691. {
  692. label: '18:30',
  693. children: []
  694. },
  695. {
  696. label: '19:00',
  697. children: []
  698. },
  699. {
  700. label: '19:30',
  701. children: []
  702. },
  703. {
  704. label: '20:00',
  705. children: []
  706. },
  707. {
  708. label: '20:30',
  709. children: []
  710. },
  711. {
  712. label: '21:00',
  713. children: []
  714. },
  715. {
  716. label: '21:30',
  717. children: []
  718. },
  719. {
  720. label: '22:00',
  721. children: []
  722. },
  723. {
  724. label: '22:30',
  725. children: []
  726. },
  727. {
  728. label: '23:00',
  729. children: []
  730. },
  731. {
  732. label: '23:30',
  733. children: []
  734. },
  735. {
  736. label: '24:00',
  737. children: []
  738. },
  739. ],
  740. serviceTimelist: [{
  741. label: '10'
  742. },
  743. {
  744. label: '15'
  745. },
  746. {
  747. label: '20'
  748. },
  749. {
  750. label: '30'
  751. },
  752. {
  753. label: '60'
  754. },
  755. ],
  756. showList: [{
  757. flag: true
  758. }, {
  759. flag: true
  760. }, {
  761. flag: true
  762. }, ],
  763. //医院
  764. hospitalTotal: 2,
  765. changeOne: true,
  766. //
  767. hospitals: [],
  768. //判断应该赋值的位置,每次时间选择,保存点击位置
  769. timeSlot: 0, //时间段.0上午 1下午 2晚上
  770. servicesType: 0, //服务种类 0电话 1图文 2门诊
  771. /**
  772. * 暂时保存的门诊服务时间段
  773. * 切换医院清空
  774. * 选择暂不选择清空
  775. */
  776. slot: [],
  777. morningSlot: 0, //早上
  778. afternoonSlot: 0, //下午
  779. // slot[hospitalcurrent].nig: 0, //晚上
  780. hospitalcurrent: -1, // 保存选中的医院下标
  781. /********************保存的数据****************************/
  782. form: {
  783. is_phone: { //电话
  784. base_price: "", //基础价格
  785. mor_time: "", //上午服务时间
  786. aft_time: "", //上午服务时间
  787. nig_time: "", //晚上服务时间
  788. service_order: 0, //同时服务订单数
  789. type: "1"
  790. },
  791. is_chat: { //图文
  792. base_price: "", //基础价格
  793. step_price: "", //步进价格
  794. mor_time: "", //上午服务时间
  795. aft_time: "", //上午服务时间
  796. nig_time: "", //晚上服务时间
  797. service_order: 0, //同时服务订单数
  798. type: "2"
  799. },
  800. is_appoint: { //门诊
  801. type: "3",
  802. hospitalList: [],
  803. },
  804. }
  805. }
  806. },
  807. methods: {
  808. change(e) {
  809. if (e != '') {
  810. if (this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times != "") { //选择了就诊时长
  811. //判断有没有选择服务时间
  812. if (this.slot[this.hospitalcurrent].mon != 0) {
  813. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amPerson = parseInt(this.slot[
  814. this.hospitalcurrent].mon /
  815. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times) * e
  816. }
  817. if (this.slot[this.hospitalcurrent].aft != 0) {
  818. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmPerson = parseInt(this.slot[
  819. this.hospitalcurrent].aft /
  820. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times) * e
  821. }
  822. if (this.slot[this.hospitalcurrent].nig != 0) {
  823. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightPerson = parseInt(this.slot[
  824. this.hospitalcurrent].nig /
  825. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times) * e
  826. }
  827. } else {
  828. switch (this.timeSlot) {
  829. case 0:
  830. this.slot[this.hospitalcurrent].mon = time
  831. break;
  832. case 1:
  833. this.slot[this.hospitalcurrent].aft = time
  834. break;
  835. case 2:
  836. this.slot[this.hospitalcurrent].nig = time
  837. break;
  838. }
  839. }
  840. }
  841. },
  842. /**
  843. * 拿到返回值并赋值
  844. * timeSlot:0
  845. * 时间段.0上午 1下午 2晚上
  846. * servicesType:0
  847. * 服务种类 0电话 1图文 2门诊
  848. * */
  849. confirm(e) {
  850. if (e[0].label != '暂不选择') {
  851. switch (this.timeSlot) {
  852. case 0:
  853. if (this.servicesType == 0) {
  854. this.form.is_phone.mor_time = e[0].label + ' - ' + e[1].label //电话
  855. } else if (this.servicesType == 1) {
  856. this.form.is_chat.mor_time = e[0].label + ' - ' + e[1].label //图文
  857. } else if (this.servicesType == 2) {
  858. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amStartTime = e[0].label
  859. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amEndTime = e[1].label //门诊
  860. this.slot[this.hospitalcurrent].mon = (e[1].value - e[0].value) * 30
  861. }
  862. break;
  863. case 1:
  864. if (this.servicesType == 0) {
  865. this.form.is_phone.aft_time = e[0].label + ' - ' + e[1].label //电话
  866. } else if (this.servicesType == 1) {
  867. this.form.is_chat.aft_time = e[0].label + ' - ' + e[1].label //图文
  868. } else if (this.servicesType == 2) {
  869. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmStartTime = e[0].label
  870. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmEndTime = e[1].label //门诊
  871. this.slot[this.hospitalcurrent].aft = (e[1].value - e[0].value) * 30
  872. }
  873. break;
  874. case 2:
  875. if (this.servicesType == 0) {
  876. this.form.is_phone.nig_time = e[0].label + ' - ' + e[1].label //电话
  877. } else if (this.servicesType == 1) {
  878. this.form.is_chat.nig_time = e[0].label + ' - ' + e[1].label //图文
  879. } else if (this.servicesType == 2) {
  880. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightStartTime = e[0].label
  881. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightEndTime = e[1].label //门诊
  882. this.slot[this.hospitalcurrent].nig = (e[1].value - e[0].value) * 30
  883. }
  884. break;
  885. default:
  886. }
  887. } else { //选择了暂不选择,清空
  888. switch (this.timeSlot) {
  889. case 0: //早上
  890. if (this.servicesType == 0) {
  891. this.form.is_phone.mor_time = "" //电话
  892. } else if (this.servicesType == 1) {
  893. this.form.is_chat.mor_time = "" //图文
  894. } else if (this.servicesType == 2) {
  895. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amStartTime = ""
  896. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amEndTime = "" //门诊
  897. this.slot[this.hospitalcurrent].mon = 0
  898. }
  899. break;
  900. case 1: //下午
  901. if (this.servicesType == 0) {
  902. this.form.is_phone.aft_time = "" //电话
  903. } else if (this.servicesType == 1) {
  904. this.form.is_chat.aft_time = "" //图文
  905. } else if (this.servicesType == 2) {
  906. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmStartTime = ""
  907. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmEndTime = "" //门诊
  908. this.slot[this.hospitalcurrent].aft = 0
  909. }
  910. break;
  911. case 2: //晚上
  912. if (this.servicesType == 0) {
  913. this.form.is_phone.nig_time = "" //电话
  914. } else if (this.servicesType == 1) {
  915. this.form.is_chat.nig_time = "" //图文
  916. } else if (this.servicesType == 2) {
  917. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightStartTime = ""
  918. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightEndTime = "" //门诊
  919. this.slot[this.hospitalcurrent].nig = 0
  920. }
  921. break;
  922. default:
  923. }
  924. }
  925. // 在这里计算号源 通过value相减得到时间段值
  926. //在门诊页面选择 并 选择了时间
  927. if (this.servicesType == 2 && e[0].label != '暂不选择') {
  928. if (this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times != "") { //选择了就诊时长
  929. if (this.form.is_appoint.hospitalList[this.hospitalcurrent].service_num != "") { //选择了就诊时长并填写了同时服务订单数
  930. let time = parseInt((e[1].value - e[0].value) * 30 / this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times)
  931. console.log(time)
  932. switch (this.timeSlot) {
  933. case 0:
  934. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amPerson = time
  935. break;
  936. case 1:
  937. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmPerson = time
  938. break;
  939. case 2:
  940. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightPerson = time
  941. break;
  942. }
  943. }
  944. } else { //没有选择就诊时长
  945. let time = (e[1].value - e[0].value) * 30
  946. switch (this.timeSlot) {
  947. case 0:
  948. this.slot[this.hospitalcurrent].mon = time
  949. break;
  950. case 1:
  951. this.slot[this.hospitalcurrent].aft = time
  952. break;
  953. case 2:
  954. this.slot[this.hospitalcurrent].nig = time
  955. break;
  956. }
  957. }
  958. }
  959. console.log(this.form)
  960. },
  961. /**
  962. * 给所有时间段数组赋值
  963. * */
  964. addTime() {
  965. // 早上
  966. for (let a = 1; a < this.morList.length; a++) { //从1开始,避开暂不选择
  967. this.morList[a].children = this.list.slice(a - 1, 24)
  968. this.morList[a].value = a - 1;
  969. }
  970. //下午
  971. for (let a = 1; a < this.aftList.length; a++) { //从1开始,避开暂不选择
  972. this.aftList[a].children = this.list.slice(23 + a, 36)
  973. this.aftList[a].value = 24 + a;
  974. }
  975. //晚上
  976. for (let a = 1; a < this.nigList.length; a++) { //从1开始,避开暂不选择
  977. this.nigList[a].children = this.list.slice(35 + a)
  978. this.nigList[a].value = 36 + a;
  979. }
  980. },
  981. /**
  982. * 选择时间
  983. * timeSlot 选择的时间段
  984. * servicesType 选择的服务
  985. * */
  986. selectTime(timeSlot, servicesType) {
  987. //保存位置
  988. this.timeSlot = timeSlot;
  989. this.servicesType = servicesType;
  990. //显示选择器
  991. switch (timeSlot) {
  992. case 0:
  993. this.morShow = true;
  994. break;
  995. case 1:
  996. this.aftShow = true;
  997. break;
  998. case 2:
  999. this.nigShow = true;
  1000. break;
  1001. }
  1002. },
  1003. /**
  1004. * 选择就诊时长
  1005. */
  1006. selectService(e) {
  1007. console.log("同时服务订单数", this.form.is_appoint.hospitalList[this.hospitalcurrent].service_num)
  1008. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_times = e[0].label
  1009. if (this.form.is_appoint.hospitalList[this.hospitalcurrent].service_num != "") {
  1010. if (this.slot[this.hospitalcurrent].mon != 0) {
  1011. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.mon.amPerson = parseInt(this.slot[
  1012. this.hospitalcurrent].mon /
  1013. e[0].label) * this.form.is_appoint.hospitalList[this.hospitalcurrent].service_num
  1014. }
  1015. if (this.slot[this.hospitalcurrent].aft != 0) {
  1016. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.aft.pmPerson = parseInt(this.slot[
  1017. this.hospitalcurrent].aft /
  1018. e[0].label) * this.form.is_appoint.hospitalList[this.hospitalcurrent].service_num
  1019. }
  1020. if (this.slot[this.hospitalcurrent].nig != 0) {
  1021. this.form.is_appoint.hospitalList[this.hospitalcurrent].service_time.nig.nightPerson = parseInt(this.slot[
  1022. this.hospitalcurrent].nig /
  1023. e[0].label) * this.form.is_appoint.hospitalList[this.hospitalcurrent].service_num
  1024. }
  1025. }
  1026. },
  1027. /**
  1028. * 选择医院
  1029. */
  1030. selectHospital(e) {
  1031. for (let a = 0; a < this.form.is_appoint.hospitalList.length; a++) {
  1032. if (e[0].value == this.form.is_appoint.hospitalList[a].id) {
  1033. this.hospitalcurrent = a
  1034. }
  1035. }
  1036. console.log(this.hospitalcurrent)
  1037. //清空暂存数据
  1038. // this.slot[hospitalcurrent].mon = 0 //早上
  1039. // this.afternoonSlot = 0 //下午
  1040. // this.slot[hospitalcurrent].nig = 0 //晚上
  1041. },
  1042. /* 分段器选择 */
  1043. sectionChange(index) {
  1044. switch(index){
  1045. case 0:this.getPhoneData();break;
  1046. case 1:this.getChatData();break;
  1047. case 2:this.getMenData();break;
  1048. }
  1049. this.curNow = index;
  1050. },
  1051. /* 保存 */
  1052. pd() {
  1053. let that = this
  1054. //判断有没有填写填写完整
  1055. switch(this.curNow){
  1056. case 0: //电话的保存
  1057. if (that.showList[0].flag) { //如果打开了电话服务
  1058. if (this.form.is_phone.base_price == "") { //电话的基础价格没有填
  1059. uni.showToast({
  1060. title: '请填写电话咨询的基础价格,否则无法保存',
  1061. icon: 'none'
  1062. })
  1063. return false
  1064. }
  1065. if (this.form.is_phone.step_price == "") { //电话的步进价格没有填
  1066. uni.showToast({
  1067. title: '请填写电话咨询的步进价格,否则无法保存',
  1068. icon: 'none'
  1069. })
  1070. return false
  1071. }
  1072. console.log(this.form.is_phone.mor_time == "",this.form.is_phone.aft_time == "",this.form.is_phone.nig_time == "")
  1073. if(this.form.is_phone.mor_time == ""&&this.form.is_phone.aft_time == ""&&this.form.is_phone.nig_time == ""){
  1074. uni.showToast({
  1075. title: '请至少选择一个服务时间段',
  1076. icon: 'none'
  1077. })
  1078. return false
  1079. }
  1080. // if (this.form.is_phone.mor_time == "") { //电话的早上服务时间
  1081. // uni.showToast({
  1082. // title: '请填写电话咨询的上午服务时间,否则无法保存',
  1083. // icon: 'none'
  1084. // })
  1085. // return false
  1086. // }
  1087. // if (this.form.is_phone.aft_time == "") { //电话的下午服务时间
  1088. // uni.showToast({
  1089. // title: '请填写电话咨询的下午服务时间,否则无法保存',
  1090. // icon: 'none'
  1091. // })
  1092. // return false
  1093. // }
  1094. // if (this.form.is_phone.nig_time == "") { //电话的晚上服务时间
  1095. // uni.showToast({
  1096. // title: '请填写电话咨询的晚上服务时间,否则无法保存',
  1097. // icon: 'none'
  1098. // })
  1099. // return false
  1100. // }
  1101. if (this.form.is_phone.person == "") { //电话的服务人次
  1102. uni.showToast({
  1103. title: '请填写电话咨询的服务人次,否则无法保存',
  1104. icon: 'none'
  1105. })
  1106. return false
  1107. }
  1108. this.setPhoneData()
  1109. }
  1110. break;
  1111. case 1: //图文的保存
  1112. if (that.showList[1].flag) { //如果打开了图文服务
  1113. if (this.form.is_chat.base_price == "") { //图文的基础价格没有填
  1114. uni.showToast({
  1115. title: '请填写图文咨询的基础价格,否则无法保存',
  1116. icon: 'none'
  1117. })
  1118. return false
  1119. }
  1120. if(this.form.is_chat.mor_time == ""&&this.form.is_chat.aft_time == ""&&this.form.is_chat.nig_time == ""){
  1121. uni.showToast({
  1122. title: '请至少保存一个时间段',
  1123. icon: 'none'
  1124. })
  1125. return false
  1126. }
  1127. // if (this.form.is_chat.mor_time == "") { //图文的早上服务时间
  1128. // uni.showToast({
  1129. // title: '请填写图文咨询的上午服务时间,否则无法保存',
  1130. // icon: 'none'
  1131. // })
  1132. // return false
  1133. // }
  1134. // if (this.form.is_chat.aft_time == "") { //图文的下午服务时间
  1135. // uni.showToast({
  1136. // title: '请填写图文咨询的下午服务时间,否则无法保存',
  1137. // icon: 'none'
  1138. // })
  1139. // return false
  1140. // }
  1141. // if (this.form.is_chat.nig_time == "") { //图文的晚上服务时间
  1142. // uni.showToast({
  1143. // title: '请填写图文咨询的晚上服务时间,否则无法保存',
  1144. // icon: 'none'
  1145. // })
  1146. // return false
  1147. // }
  1148. if (this.form.is_chat.person == "") { //图文的服务人次
  1149. uni.showToast({
  1150. title: '请填写图文咨询的同时服务人次,否则无法保存',
  1151. icon: 'none'
  1152. })
  1153. return false
  1154. }
  1155. this.setChatData()
  1156. }
  1157. break;
  1158. case 2: //门诊的保存
  1159. if (that.showList[2].flag) {
  1160. let item = that.form.is_appoint.hospitalList[this.hospitalcurrent]
  1161. console.log("item",item.appoint_price == '')
  1162. //基础价格
  1163. if (item.appoint_price == '') {
  1164. uni.showToast({
  1165. title: '请填写' + item.name + '的基础价格,否则无法保存',
  1166. icon: 'none'
  1167. })
  1168. return false
  1169. }
  1170. //上午
  1171. if (item.service_time.mon.amStartTime == "") {
  1172. uni.showToast({
  1173. title: '请填写' + item.name + '的上午服务时间,否则无法保存',
  1174. icon: 'none'
  1175. })
  1176. return false
  1177. }
  1178. //下午
  1179. if (item.service_time.aft.pmStartTime == "") {
  1180. uni.showToast({
  1181. title: '请填写' + item.name + '的下午服务时间,否则无法保存',
  1182. icon: 'none'
  1183. })
  1184. return false
  1185. }
  1186. //晚上
  1187. if (item.service_time.nig.nightStartTime == "") {
  1188. uni.showToast({
  1189. title: '请填写' + item.name + '的晚上服务时间,否则无法保存',
  1190. icon: 'none'
  1191. })
  1192. return false
  1193. }
  1194. //就诊时长
  1195. if (item.service_times == "") {
  1196. uni.showToast({
  1197. title: '请填写' + item.name + '的就诊时长,否则无法保存',
  1198. icon: 'none'
  1199. })
  1200. return false
  1201. }
  1202. //同时服务订单数
  1203. if (item.service_num == "") {
  1204. uni.showToast({
  1205. title: '请填写' + item.name + '的同时服务订单数,否则无法保存',
  1206. icon: 'none'
  1207. })
  1208. return false
  1209. }
  1210. //可预约天数
  1211. if (item.show_days == "") {
  1212. uni.showToast({
  1213. title: '请填写' + item.name + '的可预约天数,否则无法保存',
  1214. icon: 'none'
  1215. })
  1216. return false
  1217. }
  1218. this.setMenData()
  1219. }
  1220. break;
  1221. }
  1222. },
  1223. bc: async function() {
  1224. let that = this;
  1225. var forms = JSON.parse(JSON.stringify(that.form));
  1226. let phone_am = forms.is_phone.mor_time != '' ? forms.is_phone.mor_time.split(' - ') : '';
  1227. let phone_pm = forms.is_phone.aft_time != '' ? forms.is_phone.aft_time.split(' - ') : '';
  1228. let phone_ni = forms.is_phone.nig_time != '' ? forms.is_phone.nig_time.split(' - ') : '';
  1229. forms.is_phone.amStartTime = phone_am != '' ? phone_am[0] : '';
  1230. forms.is_phone.amEndTime = phone_am != '' ? phone_am[1] : '';
  1231. forms.is_phone.pmStartTime = phone_pm != '' ? phone_pm[0] : '';
  1232. forms.is_phone.pmEndTime = phone_pm != '' ? phone_pm[1] : '';
  1233. forms.is_phone.nightStartTime = phone_ni != '' ? phone_ni[0] : '';
  1234. forms.is_phone.nightEndTime = phone_ni != '' ? phone_ni[1] : '';
  1235. let chat_am = forms.is_chat.mor_time != '' ? forms.is_chat.mor_time.split(' - ') : '';
  1236. let chat_pm = forms.is_chat.aft_time != '' ? forms.is_chat.aft_time.split(' - ') : '';
  1237. let chat_ni = forms.is_chat.nig_time != '' ? forms.is_chat.nig_time.split(' - ') : '';
  1238. forms.is_chat.amStartTime = chat_am != '' ? chat_am[0] : '';
  1239. forms.is_chat.amEndTime = chat_am != '' ? chat_am[1] : '';
  1240. forms.is_chat.pmStartTime = chat_pm != '' ? chat_pm[0] : '';
  1241. forms.is_chat.pmEndTime = chat_pm != '' ? chat_pm[1] : '';
  1242. forms.is_chat.nightStartTime = chat_ni != '' ? chat_ni[0] : '';
  1243. forms.is_chat.nightEndTime = chat_ni != '' ? chat_ni[1] : '';
  1244. let newMenList = [];
  1245. for (let i = 0; i < forms.is_appoint.hospitalList.length; i++) {
  1246. newMenList.push({
  1247. "base_price": forms.is_appoint.hospitalList[i].appoint_price,
  1248. "service_times": forms.is_appoint.hospitalList[i].service_times,
  1249. "service_num": forms.is_appoint.hospitalList[i].service_num,
  1250. "amStartTime": forms.is_appoint.hospitalList[i].service_time.mon.amStartTime,
  1251. "amEndTime": forms.is_appoint.hospitalList[i].service_time.mon.amEndTime,
  1252. "amPerson": forms.is_appoint.hospitalList[i].service_time.mon.amPerson,
  1253. "pmStartTime": forms.is_appoint.hospitalList[i].service_time.aft.pmStartTime,
  1254. "pmEndTime": forms.is_appoint.hospitalList[i].service_time.aft.pmEndTime,
  1255. "pmPerson": forms.is_appoint.hospitalList[i].service_time.aft.pmPerson,
  1256. "nightStartTime": forms.is_appoint.hospitalList[i].service_time.nig.nightStartTime,
  1257. "nightEndTime": forms.is_appoint.hospitalList[i].service_time.nig.nightEndTime,
  1258. "nightPerson": forms.is_appoint.hospitalList[i].service_time.nig.nightPerson,
  1259. "show_days": forms.is_appoint.hospitalList[i].show_days,
  1260. "org_id": forms.is_appoint.hospitalList[i].id,
  1261. })
  1262. }
  1263. forms.is_appoint = newMenList;
  1264. if (typeof forms != 'string') {
  1265. forms = JSON.stringify(forms)
  1266. }
  1267. console.log("forms", forms)
  1268. let res = await that.$request.post('doctor/saveSettingList', {
  1269. data: forms,
  1270. type: 2
  1271. });
  1272. if (res.status == 0) {
  1273. uni.showToast({
  1274. icon: 'none',
  1275. duration: 3000,
  1276. title: '操作成功',
  1277. })
  1278. }
  1279. console.log('res对象:', res);
  1280. // 延迟1秒
  1281. // setTimeout(function() {
  1282. // uni.switchTab({
  1283. // url: '../index/index'
  1284. // })
  1285. // }, 1000);
  1286. },
  1287. /**
  1288. * 保存电话设置
  1289. * */
  1290. setPhoneData: async function() {
  1291. let that = this;
  1292. let forms = JSON.parse(JSON.stringify(that.form));
  1293. let phone_am = forms.is_phone.mor_time != '' ? forms.is_phone.mor_time.split(' - ') : ['',''];
  1294. let phone_pm = forms.is_phone.aft_time != '' ? forms.is_phone.aft_time.split(' - ') : ['',''];
  1295. let phone_ni = forms.is_phone.nig_time != '' ? forms.is_phone.nig_time.split(' - ') : ['',''];
  1296. console.log("1111111111111111111111",phone_am,phone_pm,phone_ni)
  1297. forms.is_phone.amStartTime = phone_am != '' ? phone_am[0] : '';
  1298. forms.is_phone.amEndTime = phone_am != '' ? phone_am[1] : '';
  1299. forms.is_phone.pmStartTime = phone_pm != '' ? phone_pm[0] : '';
  1300. forms.is_phone.pmEndTime = phone_pm != '' ? phone_pm[1] : '';
  1301. forms.is_phone.nightStartTime = phone_ni != '' ? phone_ni[0] : '';
  1302. forms.is_phone.nightEndTime = phone_ni != '' ? phone_ni[1] : '';
  1303. console.log('2222222222222',forms.is_phone)
  1304. if(typeof forms == 'object'){
  1305. forms = JSON.stringify(forms)
  1306. }
  1307. let sp = await this.$request.post('doctor/saveSettingPhone', {
  1308. data: forms,
  1309. });
  1310. if (sp.status == 0) {
  1311. uni.showToast({
  1312. icon: 'none',
  1313. duration: 1500,
  1314. title: '操作成功',
  1315. })
  1316. }
  1317. },
  1318. /**
  1319. *保存图文设置
  1320. * */
  1321. setChatData: async function() {
  1322. let that = this;
  1323. let forms = JSON.parse(JSON.stringify(that.form));
  1324. let chat_am = forms.is_chat.mor_time != '' ? forms.is_chat.mor_time.split(' - ') : '';
  1325. let chat_pm = forms.is_chat.aft_time != '' ? forms.is_chat.aft_time.split(' - ') : '';
  1326. let chat_ni = forms.is_chat.nig_time != '' ? forms.is_chat.nig_time.split(' - ') : '';
  1327. forms.is_chat.amStartTime = chat_am != '' ? chat_am[0] : '';
  1328. forms.is_chat.amEndTime = chat_am != '' ? chat_am[1] : '';
  1329. forms.is_chat.pmStartTime = chat_pm != '' ? chat_pm[0] : '';
  1330. forms.is_chat.pmEndTime = chat_pm != '' ? chat_pm[1] : '';
  1331. forms.is_chat.nightStartTime = chat_ni != '' ? chat_ni[0] : '';
  1332. forms.is_chat.nightEndTime = chat_ni != '' ? chat_ni[1] : '';
  1333. if(typeof forms == 'object'){
  1334. forms = JSON.stringify(forms)
  1335. }
  1336. let sc = await this.$request.post('doctor/saveSettingChat', {
  1337. data: forms
  1338. });
  1339. console.log("保存电话设置",sc)
  1340. if (sc.status == 0) {
  1341. uni.showToast({
  1342. icon: 'none',
  1343. duration: 1500,
  1344. title: '操作成功',
  1345. })
  1346. }
  1347. },
  1348. /**
  1349. * 保存门诊设置
  1350. * */
  1351. setMenData: async function() {
  1352. let that = this;
  1353. let forms = JSON.parse(JSON.stringify(that.form));
  1354. let newMenList = [];
  1355. let i = this.hospitalcurrent
  1356. newMenList.push({
  1357. "base_price": forms.is_appoint.hospitalList[i].appoint_price,
  1358. "service_times": forms.is_appoint.hospitalList[i].service_times,
  1359. "service_num": forms.is_appoint.hospitalList[i].service_num,
  1360. "amStartTime": forms.is_appoint.hospitalList[i].service_time.mon.amStartTime,
  1361. "amEndTime": forms.is_appoint.hospitalList[i].service_time.mon.amEndTime,
  1362. "amPerson": forms.is_appoint.hospitalList[i].service_time.mon.amPerson,
  1363. "pmStartTime": forms.is_appoint.hospitalList[i].service_time.aft.pmStartTime,
  1364. "pmEndTime": forms.is_appoint.hospitalList[i].service_time.aft.pmEndTime,
  1365. "pmPerson": forms.is_appoint.hospitalList[i].service_time.aft.pmPerson,
  1366. "nightStartTime": forms.is_appoint.hospitalList[i].service_time.nig.nightStartTime,
  1367. "nightEndTime": forms.is_appoint.hospitalList[i].service_time.nig.nightEndTime,
  1368. "nightPerson": forms.is_appoint.hospitalList[i].service_time.nig.nightPerson,
  1369. "show_days": forms.is_appoint.hospitalList[i].show_days,
  1370. "org_id": forms.is_appoint.hospitalList[i].id,
  1371. })
  1372. console.log("保存门诊shez",newMenList)
  1373. let a = ({'is_appoint':newMenList})
  1374. if(typeof a == 'object'){
  1375. a = JSON.stringify(a)
  1376. }
  1377. let sm = await this.$request.post('doctor/saveSettingSchedule', {
  1378. data: a
  1379. });
  1380. console.log("门诊保存返回数据",sm)
  1381. if (sm.status == 0) {
  1382. uni.showToast({
  1383. icon: 'none',
  1384. duration: 1500,
  1385. title: '操作成功',
  1386. })
  1387. }
  1388. },
  1389. /**
  1390. * 电话数据获取
  1391. * */
  1392. getPhoneData: async function() {
  1393. let gp = await this.$request.post('doctor/getSettingPhone', {
  1394. 'type': 2
  1395. });
  1396. console.log("电话数据获取", gp);
  1397. if (gp.status == 0) {
  1398. let data = gp.data.list
  1399. this.form.is_phone.base_price = data.base_price; //基础价格
  1400. this.form.is_phone.step_price = data.step_price; //步进价格
  1401. //早上 下午 晚上
  1402. this.form.is_phone.mor_time = data.service_time[1] != undefined &&data.service_time[1].amStartTime != ":" ? data.service_time[1].amStartTime + ' - ' + data
  1403. .service_time[1].amEndTime : '';
  1404. this.form.is_phone.aft_time = data.service_time[2] != undefined && data.service_time[2].pmStartTime != ":"? data.service_time[2].pmStartTime + ' - ' + data
  1405. .service_time[2].pmEndTime : '';
  1406. this.form.is_phone.nig_time = data.service_time[3] != undefined && data.service_time[3].nightStartTime!= ":"? data.service_time[3].nightStartTime + ' - ' +
  1407. data.service_time[3].nightEndTime : '';
  1408. this.form.is_phone.person = data.person; //服务人次
  1409. }
  1410. },
  1411. /**
  1412. * 图文数据获取
  1413. * */
  1414. getChatData: async function() {
  1415. let gt = await this.$request.post('doctor/getSettingChat', {
  1416. 'type': 2
  1417. });
  1418. console.log("图文数据获取", gt);
  1419. if (gt.status == 0) {
  1420. let data = gt.data.list
  1421. this.form.is_chat.base_price = data.base_price; //基础价格
  1422. // this.form.is_chat.step_price = data.chat.step_price; //步进价格
  1423. this.form.is_chat.person = data.person; //服务人次
  1424. //早上 下午 晚上
  1425. this.form.is_chat.mor_time = data.service_time[1] != undefined ? data.service_time[1].amStartTime + ' - ' + data.service_time[
  1426. 1].amEndTime : '';
  1427. this.form.is_chat.aft_time = data.service_time[2] != undefined ? data.service_time[2].pmStartTime + ' - ' + data.service_time[
  1428. 2].pmEndTime : '';
  1429. this.form.is_chat.nig_time = data.service_time[3] != undefined ? data.service_time[3].nightStartTime + ' - ' +
  1430. data.service_time[3].nightEndTime : '';
  1431. }
  1432. },
  1433. /**
  1434. * 门诊数据获取
  1435. * */
  1436. getMenData: async function() {
  1437. let gm = await this.$request.post('doctor/getSettingSchedule', {
  1438. 'type': 2
  1439. });
  1440. console.log("门诊数据获取", gm);
  1441. if (gm.status == 0) {
  1442. let dataList = gm.data.list
  1443. let lists = [];
  1444. for (let i = 0; i < dataList.length; i++) {
  1445. /**
  1446. * 计算所有医院的上下晚时间段时长,用于计算号源
  1447. * 需要拿到开始时间和结束时间,相减并判断是否为半点
  1448. * 公式:( 结束时间(小时) - 开始时间(小时) ) * 60- ( 结束时间(分钟) - 开始时间(分钟) ) = 时长
  1449. * */
  1450. let monDuration = (dataList[i].service_time[1].amEndTime.substr(0, 2) - dataList[i].service_time[1].amStartTime
  1451. .substr(0, 2)) * 60 + (dataList[i].service_time[1].amEndTime.substr(3, 5) - dataList[i].service_time[1].amStartTime
  1452. .substr(3, 5))
  1453. let aftDuration = (dataList[i].service_time[2].pmEndTime.substr(0, 2) - dataList[i].service_time[2].pmStartTime
  1454. .substr(0, 2)) * 60 + (dataList[i].service_time[2].pmEndTime.substr(3, 5) - dataList[i].service_time[2].pmStartTime
  1455. .substr(3, 5))
  1456. let nigDuration = (dataList[i].service_time[3].nightEndTime.substr(0, 2) - dataList[i].service_time[3].nightStartTime
  1457. .substr(0, 2)) * 60 + (dataList[i].service_time[3].nightEndTime.substr(3, 5) - dataList[i].service_time[3].nightStartTime
  1458. .substr(3, 5))
  1459. console.log("早", dataList[i].org_name, monDuration)
  1460. console.log("下", dataList[i].org_name, aftDuration)
  1461. console.log("晚", dataList[i].org_name, nigDuration)
  1462. this.slot.push({
  1463. mon: monDuration,
  1464. aft: aftDuration,
  1465. nig: nigDuration
  1466. });
  1467. lists.push({
  1468. id: dataList[i].org_id, //医院Id
  1469. name: dataList[i].org_name,
  1470. show_days: dataList[i].show_days, //可预约天数
  1471. service_times: dataList[i].service_times, //就诊时长
  1472. appoint_price: dataList[i].appoint_price, //基础价格
  1473. service_num: dataList[i].service_num,
  1474. service_time: {
  1475. mon: {
  1476. "amStartTime": dataList[i].service_time[1].amStartTime, //上午服务时间
  1477. "amEndTime": dataList[i].service_time[1].amEndTime,
  1478. "amPerson": dataList[i].service_time[1].amPerson //上午可预约号源
  1479. },
  1480. aft: {
  1481. "pmStartTime": dataList[i].service_time[2].pmStartTime, //下午服务时间
  1482. "pmEndTime": dataList[i].service_time[2].pmEndTime,
  1483. "pmPerson": dataList[i].service_time[2].pmPerson, //下午可预约号源
  1484. },
  1485. nig: {
  1486. "nightStartTime": dataList[i].service_time[3].nightStartTime, //晚上服务时间
  1487. "nightEndTime": dataList[i].service_time[3].nightEndTime,
  1488. "nightPerson": dataList[i].service_time[3].nightPerson //晚上可预约号源
  1489. }
  1490. },
  1491. })
  1492. }
  1493. console.log("计算出来的每个医院服务时长(单位:分钟)", this.slot)
  1494. this.form.is_appoint.hospitalList = lists;
  1495. if (this.form.is_appoint.hospitalList.length == 1) {
  1496. this.hospitalcurrent = 0
  1497. }
  1498. }
  1499. },
  1500. /**
  1501. * 获取服务开通状态
  1502. * */
  1503. getShows: async function() {
  1504. // 清空价格
  1505. this.form.is_phone.person = '';
  1506. this.form.is_chat.person = '';
  1507. this.form.is_appoint.person = '';
  1508. //总控 全部的服务开通状态
  1509. let res = await this.$request.post('doctor/getSettingBase', {
  1510. 'type': 2
  1511. });
  1512. console.log("总控数据获取", res);
  1513. if (res.status == 0) {
  1514. // 1.控制列表显示,2.渲染数据
  1515. //ltb 分段器赋值
  1516. this.showList[0].flag = res.data.is_phone;
  1517. this.showList[1].flag = res.data.is_chat;
  1518. this.showList[2].flag = res.data.is_appoint;
  1519. }
  1520. // //电话 数据获取
  1521. // let gp = await this.$request.post('doctor/getSettingPhone', {
  1522. // 'type': 2
  1523. // });
  1524. // console.log("电话数据获取", gp);
  1525. // if (gp.status == 0) {
  1526. // let data = gp.data.list
  1527. // this.form.is_phone.base_price = data.base_price; //基础价格
  1528. // this.form.is_phone.step_price = data.step_price; //步进价格
  1529. // //早上 下午 晚上
  1530. // this.form.is_phone.mor_time = data.service_time[1] != undefined ? data.service_time[1].amStartTime + ' - ' + data
  1531. // .service_time[1].amEndTime : '';
  1532. // this.form.is_phone.aft_time = data.service_time[2] != undefined ? data.service_time[2].pmStartTime + ' - ' + data
  1533. // .service_time[2].pmEndTime : '';
  1534. // this.form.is_phone.nig_time = data.service_time[3] != undefined ? data.service_time[3].nightStartTime + ' - ' +
  1535. // data.service_time[3].nightEndTime : '';
  1536. // this.form.is_phone.person = data.person; //服务人次
  1537. // }
  1538. // //图文 数据获取
  1539. // let gt = await this.$request.post('doctor/getSettingChat', {
  1540. // 'type': 2
  1541. // });
  1542. // console.log("图文数据获取", gt);
  1543. // if (gt.status == 0) {
  1544. // let data = gt.data.list
  1545. // this.form.is_chat.base_price = data.base_price; //基础价格
  1546. // // this.form.is_chat.step_price = data.chat.step_price; //步进价格
  1547. // this.form.is_chat.person = data.person; //服务人次
  1548. // //早上 下午 晚上
  1549. // this.form.is_chat.mor_time = data.service_time[1] != undefined ? data.service_time[1].amStartTime + ' - ' + data.service_time[
  1550. // 1].amEndTime : '';
  1551. // this.form.is_chat.aft_time = data.service_time[2] != undefined ? data.service_time[2].pmStartTime + ' - ' + data.service_time[
  1552. // 2].pmEndTime : '';
  1553. // this.form.is_chat.nig_time = data.service_time[3] != undefined ? data.service_time[3].nightStartTime + ' - ' +
  1554. // data.service_time[3].nightEndTime : '';
  1555. // }
  1556. // let gm = await this.$request.post('doctor/getSettingSchedule', {
  1557. // 'type': 2
  1558. // });
  1559. // console.log("门诊数据获取", gm);
  1560. // if (gm.status == 0) {
  1561. // let dataList = gm.data.list
  1562. // let lists = [];
  1563. // for (let i = 0; i < dataList.length; i++) {
  1564. // /**
  1565. // * 计算所有医院的上下晚时间段时长,用于计算号源
  1566. // * 需要拿到开始时间和结束时间,相减并判断是否为半点
  1567. // * 公式:( 结束时间(小时) - 开始时间(小时) ) * 60- ( 结束时间(分钟) - 开始时间(分钟) ) = 时长
  1568. // * */
  1569. // let monDuration = (dataList[i].service_time[1].amEndTime.substr(0, 2) - dataList[i].service_time[1].amStartTime
  1570. // .substr(0, 2)) * 60 + (dataList[i].service_time[1].amEndTime.substr(3, 5) - dataList[i].service_time[1].amStartTime
  1571. // .substr(3, 5))
  1572. // let aftDuration = (dataList[i].service_time[2].pmEndTime.substr(0, 2) - dataList[i].service_time[2].pmStartTime
  1573. // .substr(0, 2)) * 60 + (dataList[i].service_time[2].pmEndTime.substr(3, 5) - dataList[i].service_time[2].pmStartTime
  1574. // .substr(3, 5))
  1575. // let nigDuration = (dataList[i].service_time[3].nightEndTime.substr(0, 2) - dataList[i].service_time[3].nightStartTime
  1576. // .substr(0, 2)) * 60 + (dataList[i].service_time[3].nightEndTime.substr(3, 5) - dataList[i].service_time[3].nightStartTime
  1577. // .substr(3, 5))
  1578. // console.log("早", dataList[i].org_name, monDuration)
  1579. // console.log("下", dataList[i].org_name, aftDuration)
  1580. // console.log("晚", dataList[i].org_name, nigDuration)
  1581. // this.slot.push({
  1582. // mon: monDuration,
  1583. // aft: aftDuration,
  1584. // nig: nigDuration
  1585. // });
  1586. // lists.push({
  1587. // id: dataList[i].org_id, //医院Id
  1588. // name: dataList[i].org_name,
  1589. // show_days: dataList[i].show_days, //可预约天数
  1590. // service_times: dataList[i].service_times, //就诊时长
  1591. // appoint_price: dataList[i].appoint_price, //基础价格
  1592. // service_num: dataList[i].service_num,
  1593. // service_time: {
  1594. // mon: {
  1595. // "amStartTime": dataList[i].service_time[1].amStartTime, //上午服务时间
  1596. // "amEndTime": dataList[i].service_time[1].amEndTime,
  1597. // "amPerson": dataList[i].service_time[1].amPerson //上午可预约号源
  1598. // },
  1599. // aft: {
  1600. // "pmStartTime": dataList[i].service_time[2].pmStartTime, //下午服务时间
  1601. // "pmEndTime": dataList[i].service_time[2].pmEndTime,
  1602. // "pmPerson": dataList[i].service_time[2].pmPerson, //下午可预约号源
  1603. // },
  1604. // nig: {
  1605. // "nightStartTime": dataList[i].service_time[3].nightStartTime, //晚上服务时间
  1606. // "nightEndTime": dataList[i].service_time[3].nightEndTime,
  1607. // "nightPerson": dataList[i].service_time[3].nightPerson //晚上可预约号源
  1608. // }
  1609. // },
  1610. // })
  1611. // }
  1612. // console.log("计算出来的每个医院服务时长(单位:分钟)", this.slot)
  1613. // this.form.is_appoint.hospitalList = lists;
  1614. // if (this.form.is_appoint.hospitalList.length == 1) {
  1615. // this.hospitalcurrent = 0
  1616. // }
  1617. // }
  1618. // if (res.data.list.phone.length != 0) {
  1619. // // 渲染电话的基础数据
  1620. // this.form.is_phone.base_price = res.data.list.phone.base_price;
  1621. // this.form.is_phone.step_price = res.data.list.phone.step_price;
  1622. // this.form.is_phone.mor_time = res.data.list.phone.service_time[1] != undefined ? res.data.list.phone.service_time[
  1623. // 1].amStartTime + ' - ' + res.data.list.phone.service_time[1].amEndTime : '';
  1624. // this.form.is_phone.aft_time = res.data.list.phone.service_time[2] != undefined ? res.data.list.phone.service_time[
  1625. // 2].pmStartTime + ' - ' + res.data.list.phone.service_time[2].pmEndTime : '';
  1626. // this.form.is_phone.nig_time = res.data.list.phone.service_time[3] != undefined ? res.data.list.phone.service_time[
  1627. // 3].nightStartTime + ' - ' + res.data.list.phone.service_time[3].nightEndTime : '';
  1628. // this.form.is_phone.person = res.data.list.phone.person;
  1629. // }
  1630. // if (res.data.list.chat.length != 0) {
  1631. // // 渲染图文的基础数据
  1632. // this.form.is_chat.base_price = res.data.list.chat.base_price;
  1633. // this.form.is_chat.step_price = res.data.list.chat.step_price;
  1634. // this.form.is_chat.person = res.data.list.chat.person;
  1635. // this.form.is_chat.mor_time = res.data.list.chat.service_time[1] != undefined ? res.data.list.chat.service_time[
  1636. // 1]
  1637. // .amStartTime + ' - ' + res.data.list.chat.service_time[1].amEndTime : '';
  1638. // this.form.is_chat.aft_time = res.data.list.chat.service_time[2] != undefined ? res.data.list.chat.service_time[
  1639. // 2]
  1640. // .pmStartTime + ' - ' + res.data.list.chat.service_time[2].pmEndTime : '';
  1641. // this.form.is_chat.nig_time = res.data.list.chat.service_time[3] != undefined ? res.data.list.chat.service_time[
  1642. // 3]
  1643. // .nightStartTime + ' - ' + res.data.list.chat.service_time[3].nightEndTime : '';
  1644. // }
  1645. // if (res.data.list.men.length != 0) {
  1646. // let dataList = res.data.list.men;
  1647. // let lists = [];
  1648. // for (let i = 0; i < dataList.length; i++) {
  1649. // /**
  1650. // * 计算所有医院的上下晚时间段时长,用于计算号源
  1651. // * 需要拿到开始时间和结束时间,相减并判断是否为半点
  1652. // * 公式:( 结束时间(小时) - 开始时间(小时) ) * 60- ( 结束时间(分钟) - 开始时间(分钟) ) = 时长
  1653. // * */
  1654. // let monDuration = (dataList[i].service_time[1].amEndTime.substr(0, 2) - dataList[i].service_time[1].amStartTime
  1655. // .substr(0, 2)) * 60 + (dataList[i].service_time[1].amEndTime.substr(3, 5) - dataList[i].service_time[1].amStartTime
  1656. // .substr(3, 5))
  1657. // let aftDuration = (dataList[i].service_time[2].pmEndTime.substr(0, 2) - dataList[i].service_time[2].pmStartTime
  1658. // .substr(0, 2)) * 60 + (dataList[i].service_time[2].pmEndTime.substr(3, 5) - dataList[i].service_time[2].pmStartTime
  1659. // .substr(3, 5))
  1660. // let nigDuration = (dataList[i].service_time[3].nightEndTime.substr(0, 2) - dataList[i].service_time[3].nightStartTime
  1661. // .substr(0, 2)) * 60 + (dataList[i].service_time[3].nightEndTime.substr(3, 5) - dataList[i].service_time[3].nightStartTime
  1662. // .substr(3, 5))
  1663. // console.log("早", dataList[i].org_name, monDuration)
  1664. // console.log("下", dataList[i].org_name, aftDuration)
  1665. // console.log("晚", dataList[i].org_name, nigDuration)
  1666. // this.slot.push({
  1667. // mon: monDuration,
  1668. // aft: aftDuration,
  1669. // nig: nigDuration
  1670. // });
  1671. // lists.push({
  1672. // id: dataList[i].org_id, //医院Id
  1673. // name: dataList[i].org_name,
  1674. // show_days: dataList[i].show_days, //可预约天数
  1675. // service_times: dataList[i].service_times, //就诊时长
  1676. // appoint_price: dataList[i].appoint_price, //基础价格
  1677. // service_num: dataList[i].service_num,
  1678. // service_time: {
  1679. // mon: {
  1680. // "amStartTime": dataList[i].service_time[1].amStartTime, //上午服务时间
  1681. // "amEndTime": dataList[i].service_time[1].amEndTime,
  1682. // "amPerson": dataList[i].service_time[1].amPerson //上午可预约号源
  1683. // },
  1684. // aft: {
  1685. // "pmStartTime": dataList[i].service_time[2].pmStartTime, //下午服务时间
  1686. // "pmEndTime": dataList[i].service_time[2].pmEndTime,
  1687. // "pmPerson": dataList[i].service_time[2].pmPerson, //下午可预约号源
  1688. // },
  1689. // nig: {
  1690. // "nightStartTime": dataList[i].service_time[3].nightStartTime, //晚上服务时间
  1691. // "nightEndTime": dataList[i].service_time[3].nightEndTime,
  1692. // "nightPerson": dataList[i].service_time[3].nightPerson //晚上可预约号源
  1693. // }
  1694. // },
  1695. // })
  1696. // }
  1697. // console.log("计算出来的每个医院服务时长(单位:分钟)", this.slot)
  1698. // this.form.is_appoint.hospitalList = lists;
  1699. // if (this.form.is_appoint.hospitalList.length == 1) {
  1700. // this.hospitalcurrent = 0
  1701. // }
  1702. // }
  1703. /* 渲染时间 */
  1704. //电话的时间
  1705. // console.log(res.data.times)
  1706. // let dhtime = JSON.parse(JSON.stringify(res.data.times))
  1707. // this.dh.timeList1 = dhtime.list1;
  1708. // this.dh.timeList2 = dhtime.list2;
  1709. // this.dh.timeList3 = dhtime.list3;
  1710. // //图文的时间
  1711. // let twtime = JSON.parse(JSON.stringify(res.data.times))
  1712. // this.tw.timeList1 = twtime.list1;
  1713. // this.tw.timeList2 = twtime.list2;
  1714. // this.tw.timeList3 = twtime.list3;
  1715. // // 门诊时间
  1716. // let mz1 = JSON.parse(JSON.stringify(res.data.times))
  1717. // this.mz1.timeList1 = mz1.list1;
  1718. // this.mz1.timeList2 = mz1.list2;
  1719. // this.mz1.timeList3 = mz1.list3;
  1720. // let mz2 = JSON.parse(JSON.stringify(res.data.times))
  1721. // this.mz2.timeList1 = mz2.list1;
  1722. // this.mz2.timeList2 = mz2.list2;
  1723. // this.mz2.timeList3 = mz2.list3;
  1724. // this.reanders(res.data);
  1725. },
  1726. /**
  1727. * 选择医院 判断有没有认证的医院
  1728. * */
  1729. xzyy() {
  1730. console.log(this.form.is_appoint.hospitalList.length)
  1731. console.log(this.form.is_appoint.hospitalList)
  1732. if (this.form.is_appoint.hospitalList.length != 0) {
  1733. this.hospitalShow = true
  1734. } else {
  1735. uni.showModal({
  1736. title: "您还没有已认证的医院,确认去认证?",
  1737. success: function(res) {
  1738. if (res.confirm) {
  1739. uni.redirectTo({
  1740. url: "/pages/login/doctorRenzheng"
  1741. })
  1742. }
  1743. }
  1744. });
  1745. }
  1746. }
  1747. }
  1748. };
  1749. </script>
  1750. <style lang="scss">
  1751. .v {
  1752. padding: 28rpx 28rpx 40rpx 28rpx;
  1753. background-color: #FFFFFF;
  1754. .title {
  1755. font-size: 30rpx;
  1756. font-weight: bold;
  1757. margin-bottom: 28rpx
  1758. }
  1759. .list {
  1760. margin-top: 40rpx;
  1761. display: flex;
  1762. justify-content: space-between;
  1763. align-items: center;
  1764. .left {
  1765. .t1 {
  1766. font-size: 28rpx;
  1767. margin-bottom: 14rpx;
  1768. }
  1769. .t2 {
  1770. font-size: 22rpx;
  1771. color: #999999;
  1772. }
  1773. }
  1774. .right {}
  1775. }
  1776. }
  1777. .btnAll {
  1778. display: flex;
  1779. margin-bottom: 28rpx;
  1780. }
  1781. .but {
  1782. margin-bottom: 28rpx;
  1783. width: 55%;
  1784. display: flex;
  1785. align-items: center;
  1786. justify-content: center;
  1787. }
  1788. .bottomButton {
  1789. position: fixed;
  1790. bottom: 0;
  1791. left: 0;
  1792. width: 100%;
  1793. height: 100rpx;
  1794. display: flex;
  1795. align-items: center;
  1796. justify-content: center;
  1797. background-color: #0B73B9;
  1798. color: #FFFFFF;
  1799. z-index: 99;
  1800. }
  1801. .total {
  1802. height: 80rpx;
  1803. border-radius: 10rpx;
  1804. background-color: #eeeeef;
  1805. padding: 10rpx;
  1806. display: flex;
  1807. justify-content: center;
  1808. align-items: center;
  1809. }
  1810. //模拟分段器
  1811. .front {
  1812. height: 100%;
  1813. flex-grow: 1;
  1814. background-color: #FFF;
  1815. border-radius: 10rpx;
  1816. display: flex;
  1817. justify-content: center;
  1818. align-items: center;
  1819. font-weight: bold;
  1820. font-size: 30rpx;
  1821. }
  1822. .back {
  1823. height: 100%;
  1824. flex-grow: 1;
  1825. background-color: #FFF;
  1826. border-radius: 10rpx;
  1827. display: flex;
  1828. justify-content: center;
  1829. align-items: center;
  1830. font-size: 30rpx;
  1831. background-color: #eeeeef;
  1832. }
  1833. .select_time {
  1834. display: flex;
  1835. justify-content: space-between;
  1836. border: 1rpx solid #dbdbdb;
  1837. border-radius: 10rpx;
  1838. padding: 14rpx 30rpx;
  1839. color: #cfcfcf;
  1840. }
  1841. </style>