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

分配诊室

parent 5e62a71c
......@@ -57,7 +57,8 @@
<el-form-item prop="name" label="门诊诊查费">
<div style="display: flex;">
<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-col>
</el-row>
......
......@@ -352,6 +352,7 @@
<div style="padding-left: 10px;">
<el-button style="width: 98px;height: 32px;" icon="el-icon-back" class="resetBtn" @click="goBack">返 回</el-button>
</div>
<!-- 分配诊室对话框 -->
<el-dialog
title="分配诊室"
......@@ -406,7 +407,11 @@
style="width: 100%"
: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="治疗日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.useDate, '{y}/{m}/{d}') || '-' }}</span>
......@@ -419,10 +424,14 @@
</el-table-column>
<el-table-column align="left" label="治疗时长">
<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>
</el-table-column>
<el-table-column prop="userName" align="left" label="治疗负责人" />
</el-table>
<pagination
v-show="useTotal>0"
......@@ -492,39 +501,30 @@
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="开始时间" prop="sTime">
<el-time-select
v-model="reservationForm.sTime"
style="width: 150px"
is-range
placeholder="请选择治疗开始时间"
format="HH:mm"
value-format="HH:mm"
:picker-options="{
start: '00:00',
step: '01:00',
end: '12:00',
maxTime:reservationForm.eTime
}"
<el-form-item label="开始时间" prop="startTime">
<el-cascader
v-model="reservationForm.startTime"
:options="timeOptions"
placeholder="请选择开始时间"
@change="calculateEndTime"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="结束时间" prop="eTime">
<el-time-select
v-model="reservationForm.eTime"
style="width: 150px"
is-range
placeholder="请选择治疗结束时间"
format="HH:mm"
value-format="HH:mm"
:picker-options="{
start: '00:00',
step: '01:00',
end: '12:00',
minTime:reservationForm.sTime
}"
<el-form-item label="治疗时长" prop="duration">
<el-select v-model="reservationForm.duration" placeholder="请选择治疗时长" @change="calculateEndTime">
<el-option
v-for="option in durationOptions"
:key="option"
:label="option + 'h'"
:value="option"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="结束时间">
<span>{{ reservationForm.eTime }}</span>
</el-form-item>
</el-col>
</el-row>
......@@ -579,6 +579,25 @@ export default {
dicts: ['pet_sex', 'sterilization_status', 'vaccine_situation', 'check_type', 'treat_type'],
data() {
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: [
{
......@@ -653,8 +672,10 @@ export default {
treatType: '0',
userId: '',
userName: '',
startTime: [],
sTime: '',
eTime: ''
eTime: '-',
duration: ''
},
// 分配诊室搜索预约记录
allocationForm: {
......@@ -684,10 +705,10 @@ export default {
userName: [
{ required: true, message: '请选择治疗负责人', trigger: 'change' }
],
sTime: [
{ required: true, message: '请选择开始时间', trigger: 'change' }
startTime: [
{ required: true, message: '请选择治疗开始时间', trigger: 'change' }
],
eTime: [
duration: [
{ required: true, message: '请选择结束时间', trigger: 'change' }
]
},
......@@ -704,6 +725,30 @@ export default {
this.getUserNameList()
},
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) {
const [startTime, endTime] = timeRange.split('~')
......
......@@ -273,7 +273,11 @@
style="width: 100%"
: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="治疗日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.useDate, '{y}/{m}/{d}') || '-' }}</span>
......@@ -291,7 +295,7 @@
</el-table-column>
<el-table-column prop="userName" align="left" label="治疗负责人">
<template slot-scope="scope">
<span>{{ scope.row.userName || '-' }}</span>
<span>{{ scope.row.duration + 'h'|| '-' }}</span>
</template>
</el-table-column>
</el-table>
......@@ -363,9 +367,9 @@
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="开始时间" prop="sTime">
<el-form-item label="开始时间" prop="startTime">
<el-cascader
v-model="startTime"
v-model="reservationForm.startTime"
:options="timeOptions"
placeholder="请选择开始时间"
@change="calculateEndTime"
......@@ -419,8 +423,6 @@ export default {
dicts: ['check_type', 'pet_insure', 'payment_status', 'payment_status', 'treat_type'],
data() {
return {
startTime: [],
duration: '',
timeOptions: Array.from({ length: 24 }, (_, i) => {
const hour = i.toString().padStart(2, '0')
return {
......@@ -490,8 +492,8 @@ export default {
userName: [
{ required: true, message: '请选择治疗负责人', trigger: 'change' }
],
sTime: [
{ required: true, validator: this.sTimeValid, trigger: 'change' }
startTime: [
{ required: true, message: '请选择治疗开始时间', trigger: 'change' }
],
duration: [
{ required: true, message: '请选择结束时间', trigger: 'change' }
......@@ -519,6 +521,7 @@ export default {
treatType: '0',
userId: '',
userName: '',
startTime: [],
sTime: '',
eTime: '-',
duration: ''
......@@ -579,9 +582,9 @@ export default {
},
// 计算结束时间
calculateEndTime() {
if (this.startTime.length === 2 && this.reservationForm.duration) {
const startHour = Number(this.startTime[0])
const startMinute = Number(this.startTime[1])
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)
......
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