3.9提交
This commit is contained in:
@@ -137,16 +137,55 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<unidialog
|
||||
:visible="noticeVisible"
|
||||
:title="'门诊安排'"
|
||||
:cancelText="'返回修改'"
|
||||
:confirmText="'确认发布'"
|
||||
@close="noticeVisible=false"
|
||||
@confirm="noticeConfirm"
|
||||
>
|
||||
<template v-slot:content>
|
||||
<view class="ppt-content">
|
||||
<view class="notice-row">
|
||||
<view class="name">门诊时间:</view>
|
||||
<view class="value" style="display: flex;align-items: center;gap: 10rpx;">
|
||||
<text class="weekday-text">{{ getWeekdayText(selectedWeekday) }}</text>
|
||||
<text class="time-text">{{ getTimePeriodText(selectedTimePeriod) }}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="notice-row">
|
||||
<view class="name">门诊地点:</view>
|
||||
<view class="value">
|
||||
<text class="value-text">{{ selectedLocation.hospital_name }};</text>
|
||||
<text class="value-text">{{ selectedLocation.office_name }};</text>
|
||||
<text class="value-text">{{ selectedLocation.location }};</text>
|
||||
<text class="value-text">
|
||||
{{ getTypeText(selectedLocation.type) }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</unidialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import unidialog from '@/components/dialog/dialog.vue'
|
||||
import api from "@/api/api.js";
|
||||
import navTo from '@/utils/navTo'
|
||||
import navBar from '@/components/navBar/navBar.vue'
|
||||
const title = ref('增加门诊安排')
|
||||
const uuid=ref('')
|
||||
const noticeVisible=ref(false)
|
||||
const noticeConfirm = () => {
|
||||
noticeVisible.value = false
|
||||
submit()
|
||||
}
|
||||
// 响应式数据
|
||||
const selectedWeekday = ref(null)
|
||||
const selectedTimePeriod = ref('')
|
||||
@@ -155,6 +194,14 @@ const selectedLocation = ref({})
|
||||
const map = { 1: '普通门诊', 2: '专家门诊', 3: '特需门诊', 4: '专科/专病门诊' }
|
||||
return map[type] || '普通门诊'
|
||||
}
|
||||
const getWeekdayText = (weekday) => {
|
||||
const map = { 1: '周一', 2: '周二', 3: '周三', 4: '周四', 5: '周五', 6: '周六', 7: '周日' }
|
||||
return map[weekday]
|
||||
}
|
||||
const getTimePeriodText = (timePeriod) => {
|
||||
const map = { a: '上午', b: '下午', c: '晚上', d: '全天' }
|
||||
return map[timePeriod]
|
||||
}
|
||||
onShow(()=>{
|
||||
listWorkPlace()
|
||||
})
|
||||
@@ -166,8 +213,13 @@ const workPlaceList=ref([])
|
||||
const listWorkPlace=async()=>{
|
||||
const res = await api.listWorkPlace()
|
||||
if(res.code == 200){
|
||||
workPlaceList.value = res.data
|
||||
|
||||
workPlaceList.value = res.data;
|
||||
for(let i=0;i<workPlaceList.value.length;i++){
|
||||
if(workPlaceList.value[i].uuid == selectedLocation.value.uuid){
|
||||
chooseLocation(workPlaceList.value[i]);
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const selectWeekday = (weekday) => {
|
||||
@@ -197,7 +249,7 @@ const updateOutPatient=async()=>{
|
||||
type:1,
|
||||
week: selectedWeekday.value,
|
||||
day: selectedTimePeriod.value,
|
||||
workplace_uuid: selectedLocation.value
|
||||
workplace_uuid: selectedLocation.value.uuid
|
||||
})
|
||||
|
||||
if(res.code == 200){
|
||||
@@ -213,12 +265,20 @@ const selectTimePeriod = (period) => {
|
||||
}
|
||||
|
||||
const chooseLocation = (item) => {
|
||||
console.log(item)
|
||||
selectedLocation.value = item
|
||||
}
|
||||
const getType=(type)=>{
|
||||
const map = { 1: 'a', 2: 'b', 3: 'c', 4: 'd' }
|
||||
return map[type]
|
||||
}
|
||||
const submit=()=>{
|
||||
if(uuid.value){
|
||||
updateOutPatient()
|
||||
}else{
|
||||
addOutPatient()
|
||||
}
|
||||
}
|
||||
const confirmPublish = () => {
|
||||
if (!selectedWeekday.value) {
|
||||
uni.showToast({
|
||||
@@ -244,11 +304,7 @@ const confirmPublish = () => {
|
||||
return
|
||||
}
|
||||
|
||||
if(uuid.value){
|
||||
updateOutPatient()
|
||||
}else{
|
||||
addOutPatient()
|
||||
}
|
||||
noticeVisible.value = true
|
||||
}
|
||||
|
||||
onLoad((options)=>{
|
||||
@@ -256,7 +312,8 @@ const confirmPublish = () => {
|
||||
uuid.value = options.uuid;
|
||||
selectedWeekday.value = options.week;
|
||||
selectedLocation.value.uuid = options.workplace_uuid;
|
||||
selectedTimePeriod.value = getType(options.type);
|
||||
selectedTimePeriod.value =options.type;
|
||||
|
||||
if(uuid.value){
|
||||
title.value = '编辑门诊安排'
|
||||
}
|
||||
@@ -264,6 +321,13 @@ const confirmPublish = () => {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.value .weekday-text{
|
||||
color:red
|
||||
}
|
||||
.value .time-text{
|
||||
color:red;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.add-schedule-page {
|
||||
min-height: 100vh;
|
||||
background-color: #fff;
|
||||
@@ -329,6 +393,26 @@ const confirmPublish = () => {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.notice-row{
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
.name{
|
||||
width: 160rpx;
|
||||
white-space: nowrap;
|
||||
text-align: right;
|
||||
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.value{
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
text-align: left;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
font-size: 34rpx;
|
||||
@@ -362,7 +446,6 @@ const confirmPublish = () => {
|
||||
.title-text {
|
||||
font-size: 32rpx;
|
||||
color: #8B2316;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.required-mark {
|
||||
@@ -543,6 +626,5 @@ const confirmPublish = () => {
|
||||
.btn-text {
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user