Commit 28db2287 authored by 高滢's avatar 高滢

治疗详情页

parent 877e5bee
......@@ -21,8 +21,25 @@ export function selectTreatListP(query) {
// 查询治疗列表不分页
export function selectTreatAll(query) {
return request({
url: '/business/treat/useListAll',
url: '/business/treat/treatListAll',
method: 'get',
params: query
})
}
// 修改治疗管理
export function updateTreatList(data) {
return request({
url: '/business/treat',
method: 'put',
data: data
})
}
// 通过id查询详情
export function getTreatDetail(id) {
return request({
url: '/business/treat/' + id,
method: 'get'
})
}
......@@ -218,11 +218,17 @@
:data="appointmentRoomList"
style="width: 100%"
>
<el-table-column prop="date" align="left" label="诊室名称" />
<el-table-column prop="date" align="left" label="治疗日期" />
<el-table-column prop="date" align="left" label="治疗时段" />
<el-table-column prop="date" align="left" label="治疗时长" />
<el-table-column prop="date" align="left" label="治疗负责人" />
<el-table-column prop="consultRoomName" align="left" label="诊室名称" />
<el-table-column prop="treatStartTime" align="left" label="治疗日期" />
<el-table-column prop="treatStartTime" align="left" label="治疗时段">
<template slot-scope="scope">
<span v-show="scope.row.treatStartTime!== null">{{ parseTime(scope.row.treatStartTime, '{h}:{m}') }}</span>
<span v-show="scope.row.treatEndTime!== null">~{{ parseTime(scope.row.treatEndTime, '{h}:{m}') }}</span>
<span v-show="scope.row.treatStartTime === null&& scope.row.treatEndTime=== null">-</span>
</template>
</el-table-column>
<el-table-column align="left" label="治疗时长" />
<el-table-column prop="treatOperator" align="left" label="治疗负责人" />
</el-table>
<div style="display: flex;padding-top: 20px;padding-bottom: 20px;">
<div class="tip1" />
......@@ -232,12 +238,12 @@
<el-row>
<el-col :span="8">
<el-form-item label="诊室" prop="consultRoomId">
<el-select v-model="appointmentRoom.consultRoomId" clearable placeholder="请选择诊室">
<el-select v-model="reservationForm.consultRoomName" clearable placeholder="请选择诊室" value-key="id" @change="getconsultingName">
<el-option
v-for="item in consultingName"
:key="item.id"
:label="item.consultingName"
:value="item.id"
:value="item"
/>
</el-select>
</el-form-item>
......@@ -247,6 +253,8 @@
<el-date-picker
v-model="appointmentRoom.treatDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
:disabled-date="disabledDate"
placeholder="请选择治疗日期"
......@@ -302,9 +310,9 @@
</template>
<script>
import { delManage, addManage, updateManage } from '@/api/business/manage'
import { delManage } from '@/api/business/manage'
import { listReservationDevice } from '@/api/business/device'
import { consultRoomListAll, selectTreatAll, selectTreatListP } from '@/api/business/treatment'
import { consultRoomListAll, selectTreatAll, selectTreatListP, updateTreatList } from '@/api/business/treatment'
export default {
name: 'MedicalRecordManagement',
......@@ -361,6 +369,7 @@ export default {
},
// 分配诊室搜索预约记录
allocationForm: {
treatSchedule: '2',
consultRoomIdList: [],
treatStartTimeS: '',
treatStartTimeE: ''
......@@ -395,8 +404,8 @@ export default {
isAsc: '',
orderByColumn: ''
},
// 表单参数
form: {},
// 添加预约表单参数
reservationForm: {},
// 设备集合
deviceList: []
}
......@@ -410,6 +419,7 @@ export default {
getAppointmentRecord() {
console.log('this.allocationForm', this.allocationForm)
selectTreatAll(this.allocationForm).then(res => {
this.appointmentRoomList = res.data
console.log('预约记录', res)
})
},
......@@ -421,6 +431,7 @@ export default {
},
// 弹出框重置
rest() {
this.reservationForm.consultRoomName = ''
this.appointmentRoomList = []
// 预约诊室
this.appointmentRoom = {
......@@ -431,19 +442,30 @@ export default {
}
// 分配诊室搜索预约记录
this.allocationForm = {
treat_schedule: '2',
consultRoomIdList: '',
treatStartTimeS: '',
treatStartTimeE: ''
}
},
// 预约诊室获取名字
getconsultingName(value) {
this.reservationForm.consultRoomName = value.consultingName
this.reservationForm.consultRoomId = value.id
console.log(value)
},
// 预约诊室搜索
allocationFormChangeName() {
this.allocationForm.consultRoomIdList = this.allocationForm.consultRoomIdList.map(str => parseInt(str))
allocationFormChangeName(value) {
this.getAppointmentRecord()
},
allocationFormChangeTime() {
allocationFormChangeTime(value) {
if (value !== '' && value !== null) {
this.allocationForm.treatStartTimeS = this.treatStartTime + ' 00:00:00'
this.allocationForm.treatStartTimeE = this.treatStartTime + ' 23:59:59'
} else {
this.allocationForm.treatStartTimeS = ''
this.allocationForm.treatStartTimeE = ''
}
this.getAppointmentRecord()
},
// 获取诊室下拉框
......@@ -482,11 +504,12 @@ export default {
this.queryParams.pageNum = 1
this.getList()
},
/** 立即预约 */
/** 分配诊室 */
handleSubscribe(row) {
this.open = true
console.log('点击立即预约', row)
this.appointmentRoom.id = row.id
this.reservationForm = row
},
/** 获取设备列表 */
getDevice() {
......@@ -519,6 +542,7 @@ export default {
/** 详情 */
handleDetails(row) {
console.log('点击详情后', row)
localStorage.setItem('treatId', row.id)
this.$router.push({
name: 'TreatmentDetail',
query: { detail: row }
......@@ -526,21 +550,18 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
this.reservationForm.treatStartTime = this.appointmentRoom.treatDate + ' ' + this.appointmentRoom.sTime
this.reservationForm.treatEndTime = this.appointmentRoom.treatDate + ' ' + this.appointmentRoom.eTime
this.reservationForm.treatSchedule = '2'
const reservation = []
reservation.push(this.reservationForm)
console.log('this.reservationForm', this.reservationForm)
this.$refs['treatTimeForm'].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateManage(this.form).then(response => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
updateTreatList(reservation).then(res => {
this.$modal.msgSuccess('预约成功')
this.cancel()
})
} else {
addManage(this.form).then(response => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
......
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