Commit 26656c1d authored by 高滢's avatar 高滢

分配诊室

parent 5e62a71c
...@@ -57,7 +57,8 @@ ...@@ -57,7 +57,8 @@
<el-form-item prop="name" label="门诊诊查费"> <el-form-item prop="name" label="门诊诊查费">
<div style="display: flex;"> <div style="display: flex;">
<el-input v-model="doctorForm.examinationFee" :disabled="true" maxlength="20" /> <el-input v-model="doctorForm.examinationFee" :disabled="true" maxlength="20" />
<div style="margin-left: 10px;"></div></div> <div style="margin-left: 10px;"></div>
</div>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -352,6 +352,7 @@ ...@@ -352,6 +352,7 @@
<div style="padding-left: 10px;"> <div style="padding-left: 10px;">
<el-button style="width: 98px;height: 32px;" icon="el-icon-back" class="resetBtn" @click="goBack">返 回</el-button> <el-button style="width: 98px;height: 32px;" icon="el-icon-back" class="resetBtn" @click="goBack">返 回</el-button>
</div> </div>
<!-- 分配诊室对话框 --> <!-- 分配诊室对话框 -->
<el-dialog <el-dialog
title="分配诊室" title="分配诊室"
...@@ -406,7 +407,11 @@ ...@@ -406,7 +407,11 @@
style="width: 100%" style="width: 100%"
:header-cell-style="{background:'#F4F4F4'}" :header-cell-style="{background:'#F4F4F4'}"
> >
<el-table-column prop="consultRoomName" align="left" label="诊室名称" /> <el-table-column prop="consulting_name" align="left" label="诊室名称">
<template slot-scope="scope">
<span>{{ scope.row.consulting_name || '-' }}</span>
</template>
</el-table-column>
<el-table-column prop="treatStartTime" align="left" label="治疗日期"> <el-table-column prop="treatStartTime" align="left" label="治疗日期">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.useDate, '{y}/{m}/{d}') || '-' }}</span> <span>{{ parseTime(scope.row.useDate, '{y}/{m}/{d}') || '-' }}</span>
...@@ -419,10 +424,14 @@ ...@@ -419,10 +424,14 @@
</el-table-column> </el-table-column>
<el-table-column align="left" label="治疗时长"> <el-table-column align="left" label="治疗时长">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ calculateHours(scope.row.useTimeRange) + 'h' || '-' }}</span> <span>{{ scope.row.useTimeRange || '-' }}</span>
</template>
</el-table-column>
<el-table-column prop="userName" align="left" label="治疗负责人">
<template slot-scope="scope">
<span>{{ scope.row.duration + 'h'|| '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="userName" align="left" label="治疗负责人" />
</el-table> </el-table>
<pagination <pagination
v-show="useTotal>0" v-show="useTotal>0"
...@@ -492,39 +501,30 @@ ...@@ -492,39 +501,30 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="开始时间" prop="sTime"> <el-form-item label="开始时间" prop="startTime">
<el-time-select <el-cascader
v-model="reservationForm.sTime" v-model="reservationForm.startTime"
style="width: 150px" :options="timeOptions"
is-range placeholder="请选择开始时间"
placeholder="请选择治疗开始时间" @change="calculateEndTime"
format="HH:mm"
value-format="HH:mm"
:picker-options="{
start: '00:00',
step: '01:00',
end: '12:00',
maxTime:reservationForm.eTime
}"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="结束时间" prop="eTime"> <el-form-item label="治疗时长" prop="duration">
<el-time-select <el-select v-model="reservationForm.duration" placeholder="请选择治疗时长" @change="calculateEndTime">
v-model="reservationForm.eTime" <el-option
style="width: 150px" v-for="option in durationOptions"
is-range :key="option"
placeholder="请选择治疗结束时间" :label="option + 'h'"
format="HH:mm" :value="option"
value-format="HH:mm" />
:picker-options="{ </el-select>
start: '00:00', </el-form-item>
step: '01:00', </el-col>
end: '12:00', <el-col :span="8">
minTime:reservationForm.sTime <el-form-item label="结束时间">
}" <span>{{ reservationForm.eTime }}</span>
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -579,6 +579,25 @@ export default { ...@@ -579,6 +579,25 @@ export default {
dicts: ['pet_sex', 'sterilization_status', 'vaccine_situation', 'check_type', 'treat_type'], dicts: ['pet_sex', 'sterilization_status', 'vaccine_situation', 'check_type', 'treat_type'],
data() { data() {
return { return {
// 治疗开始时间下拉框数据
timeOptions: Array.from({ length: 24 }, (_, i) => {
const hour = i.toString().padStart(2, '0')
return {
value: hour,
label: hour,
children: [
{
value: '00',
label: '00'
},
{
value: '30',
label: '30'
}
]
}
}),
durationOptions: [0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6],
// 宠物保险 // 宠物保险
insureOptions: [ insureOptions: [
{ {
...@@ -653,8 +672,10 @@ export default { ...@@ -653,8 +672,10 @@ export default {
treatType: '0', treatType: '0',
userId: '', userId: '',
userName: '', userName: '',
startTime: [],
sTime: '', sTime: '',
eTime: '' eTime: '-',
duration: ''
}, },
// 分配诊室搜索预约记录 // 分配诊室搜索预约记录
allocationForm: { allocationForm: {
...@@ -684,10 +705,10 @@ export default { ...@@ -684,10 +705,10 @@ export default {
userName: [ userName: [
{ required: true, message: '请选择治疗负责人', trigger: 'change' } { required: true, message: '请选择治疗负责人', trigger: 'change' }
], ],
sTime: [ startTime: [
{ required: true, message: '请选择开始时间', trigger: 'change' } { required: true, message: '请选择治疗开始时间', trigger: 'change' }
], ],
eTime: [ duration: [
{ required: true, message: '请选择结束时间', trigger: 'change' } { required: true, message: '请选择结束时间', trigger: 'change' }
] ]
}, },
...@@ -704,6 +725,30 @@ export default { ...@@ -704,6 +725,30 @@ export default {
this.getUserNameList() this.getUserNameList()
}, },
methods: { methods: {
// 计算结束时间
calculateEndTime() {
if (this.reservationForm.startTime.length === 2 && this.reservationForm.duration) {
const startHour = Number(this.reservationForm.startTime[0])
const startMinute = Number(this.reservationForm.startTime[1])
const duration = Number(this.reservationForm.duration)
this.reservationForm.sTime = startHour + ':' + startMinute
let endHour = startHour + Math.floor(duration)
let endMinute = startMinute + (duration % 1) * 60
if (endMinute >= 60) {
endHour += 1
endMinute -= 60
}
if (endHour >= 24) {
this.reservationForm.eTime = `${endHour % 24}:${endMinute.toString().padStart(2, '0')} (+1)`
} else {
this.reservationForm.eTime = `${endHour}:${endMinute.toString().padStart(2, '0')}`
}
} else {
this.reservationForm.eTime = '-'
}
},
// 计算小时 // 计算小时
calculateHours(timeRange) { calculateHours(timeRange) {
const [startTime, endTime] = timeRange.split('~') const [startTime, endTime] = timeRange.split('~')
......
...@@ -273,7 +273,11 @@ ...@@ -273,7 +273,11 @@
style="width: 100%" style="width: 100%"
:header-cell-style="{background:'#F4F4F4'}" :header-cell-style="{background:'#F4F4F4'}"
> >
<el-table-column prop="consultRoomName" align="left" label="诊室名称" /> <el-table-column prop="consulting_name" align="left" label="诊室名称">
<template slot-scope="scope">
<span>{{ scope.row.consulting_name || '-' }}</span>
</template>
</el-table-column>
<el-table-column prop="treatStartTime" align="left" label="治疗日期"> <el-table-column prop="treatStartTime" align="left" label="治疗日期">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.useDate, '{y}/{m}/{d}') || '-' }}</span> <span>{{ parseTime(scope.row.useDate, '{y}/{m}/{d}') || '-' }}</span>
...@@ -291,7 +295,7 @@ ...@@ -291,7 +295,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="userName" align="left" label="治疗负责人"> <el-table-column prop="userName" align="left" label="治疗负责人">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.userName || '-' }}</span> <span>{{ scope.row.duration + 'h'|| '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -363,9 +367,9 @@ ...@@ -363,9 +367,9 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="开始时间" prop="sTime"> <el-form-item label="开始时间" prop="startTime">
<el-cascader <el-cascader
v-model="startTime" v-model="reservationForm.startTime"
:options="timeOptions" :options="timeOptions"
placeholder="请选择开始时间" placeholder="请选择开始时间"
@change="calculateEndTime" @change="calculateEndTime"
...@@ -419,8 +423,6 @@ export default { ...@@ -419,8 +423,6 @@ export default {
dicts: ['check_type', 'pet_insure', 'payment_status', 'payment_status', 'treat_type'], dicts: ['check_type', 'pet_insure', 'payment_status', 'payment_status', 'treat_type'],
data() { data() {
return { return {
startTime: [],
duration: '',
timeOptions: Array.from({ length: 24 }, (_, i) => { timeOptions: Array.from({ length: 24 }, (_, i) => {
const hour = i.toString().padStart(2, '0') const hour = i.toString().padStart(2, '0')
return { return {
...@@ -490,8 +492,8 @@ export default { ...@@ -490,8 +492,8 @@ export default {
userName: [ userName: [
{ required: true, message: '请选择治疗负责人', trigger: 'change' } { required: true, message: '请选择治疗负责人', trigger: 'change' }
], ],
sTime: [ startTime: [
{ required: true, validator: this.sTimeValid, trigger: 'change' } { required: true, message: '请选择治疗开始时间', trigger: 'change' }
], ],
duration: [ duration: [
{ required: true, message: '请选择结束时间', trigger: 'change' } { required: true, message: '请选择结束时间', trigger: 'change' }
...@@ -519,6 +521,7 @@ export default { ...@@ -519,6 +521,7 @@ export default {
treatType: '0', treatType: '0',
userId: '', userId: '',
userName: '', userName: '',
startTime: [],
sTime: '', sTime: '',
eTime: '-', eTime: '-',
duration: '' duration: ''
...@@ -579,9 +582,9 @@ export default { ...@@ -579,9 +582,9 @@ export default {
}, },
// 计算结束时间 // 计算结束时间
calculateEndTime() { calculateEndTime() {
if (this.startTime.length === 2 && this.reservationForm.duration) { if (this.reservationForm.startTime.length === 2 && this.reservationForm.duration) {
const startHour = Number(this.startTime[0]) const startHour = Number(this.reservationForm.startTime[0])
const startMinute = Number(this.startTime[1]) const startMinute = Number(this.reservationForm.startTime[1])
const duration = Number(this.reservationForm.duration) const duration = Number(this.reservationForm.duration)
this.reservationForm.sTime = startHour + ':' + startMinute this.reservationForm.sTime = startHour + ':' + startMinute
let endHour = startHour + Math.floor(duration) let endHour = startHour + Math.floor(duration)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment