Browse Source

预约时间选择优化

360view
bianyaqi 2 years ago
parent
commit
a7ab06c5ee
  1. 65
      src/page-subspecialty/views/modules/nurseManagement/reservation/schedule/addPatientOrder.vue
  2. 13
      src/page-subspecialty/views/modules/nurseManagement/reservation/schedule/doctor-schedule.vue
  3. 128
      src/page-subspecialty/views/modules/nurseManagement/reservation/schedule/number-detail-manage.vue

65
src/page-subspecialty/views/modules/nurseManagement/reservation/schedule/addPatientOrder.vue

@ -74,35 +74,23 @@
</div>
</el-col>
</div>
<el-form-item required label="预约时间:" prop="date">
<el-date-picker
v-model="form.date"
type="datetime"
placeholder="选择日期时间"
/>
<el-form-item label="预约时间:" required>
<el-col :span="11">
<el-form-item prop="date1">
<el-date-picker v-model="form.date1" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="width: 100%;" />
</el-form-item>
</el-col>
<el-col class="line" style="text-align: center" :span="2">-</el-col>
<el-col :span="11">
<el-time-select
v-model="form.date2"
:picker-options="{...timeRange}"
value-format="HH:mm:ss"
placeholder="选择时间"
style="width: 100%;"
/>
</el-col>
</el-form-item>
<!-- <el-form-item label="活动时间" required>-->
<!-- <el-col :span="11">-->
<!-- <el-form-item prop="date1">-->
<!-- <el-date-picker v-model="form.date1" type="date" placeholder="选择日期" style="width: 100%;" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col class="line" style="text-align: center" :span="2">-</el-col>-->
<!-- <el-col :span="11">-->
<!-- <el-form-item prop="date2">-->
<!-- <el-time-select-->
<!-- v-model="form.date2"-->
<!-- :picker-options="{-->
<!-- start: '07:30',-->
<!-- step:'00:15',-->
<!-- end: '13:30'-->
<!-- }"-->
<!-- placeholder="选择时间"-->
<!-- style="width: 100%;"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-form-item>-->
</el-form>
<span slot="footer" class="dialog-footer">
<el-button v-if="print" v-print="print" size="small">打印</el-button>
@ -130,6 +118,9 @@ export default {
isEdit: {
type: Boolean,
default: false
},
isPm: {
type: Boolean
}
},
data() {
@ -156,6 +147,17 @@ export default {
}
},
computed: {
timeRange() {
return this.isPm ? {
start: '12:00',
step: '00:15',
end: '21:30'
} : {
start: '07:30',
step: '00:15',
end: '12:00'
}
},
dataRule() {
return {
patientId: [
@ -178,9 +180,8 @@ export default {
this.form.pupilShrink = this.patientDetail.pupilShrink
this.form.remark = this.patientDetail.remark
this.form.yzOpen = this.patientDetail.yzOpen
this.form.date = this.patientDetail.appointDate
this.form.date1 = this.patientDetail.appointDate.split(' ')[0]
this.form.date2 = this.patientDetail.appointDate.split(' ')[1]
this.form.date2 = this.patientDetail.appointDate.split(' ')[1].substring(0, 5)
this.patientInfo = this.patientDetail
}
},
@ -217,7 +218,7 @@ export default {
return false
}
const params = {
appointDate: this.$moment(this.form.date).format('YYYY-MM-DD HH:mm:ss'),
appointDate: `${this.form.date1} ${this.form.date2}:00`,
patientName: this.patientInfo.patientName,
jzNumber: this.patientInfo.jzNumber,
appointSource: this.patientInfo.source,
@ -233,7 +234,7 @@ export default {
})
} else {
const params = {
appointDate: this.$moment(this.form.date).format('YYYY-MM-DD HH:mm:ss'),
appointDate: `${this.form.date1} ${this.form.date2}:00`,
doctorId: this.form.doctorId,
doctorName: this.form.doctorName,
patientId: this.form.patientId,

13
src/page-subspecialty/views/modules/nurseManagement/reservation/schedule/doctor-schedule.vue

@ -375,11 +375,8 @@ export default {
mounted() {
const index = _.findIndex(this.days, function (o) {
// console.log('o: ', o.getDate());
// console.log('new Date().getDate(): ', new Date().getDate());
return o.getDate() === new Date().getDate();
});
console.log("index: ", index);
this.tabIndex = index;
},
@ -568,18 +565,16 @@ export default {
},
//
switchChange(index,e) {
console.log(index,e);
this.doctorList[index].isDefault = e ? 1 : 0
},
//
addPatientHandle(item, weekInfoItem, flag) {
// console.log(weekInfoItem);
this.addScheduleVisible = true
this.$nextTick(() => {
this.$refs.addScheduleRef.dataForm.title = '预约医生'
this.$refs.addScheduleRef.dataForm.doctorName = item.doctorName
this.$refs.addScheduleRef.dataForm.doctorCode = item.doctorCode
this.$refs.addScheduleRef.dataForm.operaName = item.expertise
// this.$refs.addScheduleRef.dataForm.doctorCode = item.doctorCode
// this.$refs.addScheduleRef.dataForm.operaName = item.expertise
this.$refs.addScheduleRef.dataForm.operaTime = flag === 'morning' ? weekInfoItem.date + ' 07:30:00' : weekInfoItem.date + ' 14:00:00'
this.$refs.addScheduleRef.params = item
this.$refs.addScheduleRef.init()
@ -612,8 +607,8 @@ export default {
this.$refs.numberManageRef.projectName = item.itemName
this.$refs.numberManageRef.weekName = weekInfoItem.weekName
this.$refs.numberManageRef.morOrAft = morOrAft
this.$refs.numberManageRef.dataForm.doctorCode = item.doctorCode
this.$refs.numberManageRef.dataForm.operaDate = weekInfoItem.date
// this.$refs.numberManageRef.dataForm.doctorCode = item.doctorCode
// this.$refs.numberManageRef.dataForm.operaDate = weekInfoItem.date
this.$refs.numberManageRef.init()
})
},

128
src/page-subspecialty/views/modules/nurseManagement/reservation/schedule/number-detail-manage.vue

@ -27,6 +27,7 @@
<add-patient-order
v-if="addPatientVisible"
ref="addPatientOrder"
:is-pm="isPm"
:project="curProject"
:patient-detail="curPatient"
:title="addTitle"
@ -58,54 +59,27 @@ export default {
visible: false,
addPatientVisible: false,
dateInfo: '',
appointPatients: [],
isPm: false,
isEdit: false,
projectName: '',
curProject: '',
curPatient: null,
morOrAft: '', //
weekName: '', //
title: '',
addTitle: '',
doctorName: '',
dataForm: {
operaDate: '', // ()
doctorCode: '', //
morOrAft: '',
total: '' //
},
dataList: [],
currentTableList: [],
currentTableId: [],
rowListObj: {},
editOperationVisible: false
addTitle: ''
}
},
computed: {
dataRule() {
return {
startNum: [
{ required: true, message: '请输入起始号', trigger: 'change' }
],
total: [
{ required: true, message: '请输入总数', trigger: 'change' }
],
startTime: [
{ required: true, message: '请选择开始时间', trigger: 'change' }
],
interval: [
{ required: true, message: '请输入间隔时间', trigger: 'change' }
]
watch: {
dateInfo(value) {
if (value.includes('下午')) {
this.isPm = true
} else {
this.isPm = false
}
}
},
methods: {
init() {
this.visible = true
this.$nextTick(() => {
this.$refs.dataForm ? this.$refs.dataForm.resetFields() : '' //
this.dataForm.morOrAft = this.morOrAft
})
},
addOrder() {
this.addPatientVisible = true
@ -137,90 +111,6 @@ export default {
})
})
},
//
async getSourceList() {
const { data: res } = await this.$http.get('/num/source/getList', {
params: {
doctorCode: this.dataForm.doctorCode, //
morOrAft: this.morOrAft, // morOrAft --1:2:
searchDate: this.dataForm.operaDate //
}
})
if (res.code === 0) {
this.dataList = res.data
//
this.dataList.forEach((item, index) => {
if (this.rowListObj.id === item.id) {
this.rowListObj.operaTime && this.$refs.multipleTable ? this.$refs.multipleTable.setCurrentRow(this.dataList[index]) : ''
}
})
} else {
this.$message.error(res.msg)
}
},
//
handleSelectionChange(val) {
// console.log(val)
this.currentTableList = val
this.currentTableId = []
this.currentTableList.forEach(item => {
this.currentTableId.push(item.id)
})
},
//
rowClick(val) {
console.log('点击rowClick', val)
this.rowListObj = val
},
// row
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
},
//
editHandle(scopeRow) {
this.editOperationVisible = true
this.$nextTick(() => {
this.$refs.editOperationRef.dataForm.operaTime = scopeRow.appointmentTime.substr(0, 5)
this.$refs.editOperationRef.dataForm.morOrAft = scopeRow.morOrAft
this.$refs.editOperationRef.patientInfo = scopeRow
this.$refs.editOperationRef.init()
})
},
//
async deleteHandle(scopeRow) {
this.deleteClickFun([scopeRow.id])
},
//
batchDeleteClick() {
if (this.currentTableId.length > 0) {
this.deleteClickFun(this.currentTableId)
} else {
this.$message({
message: '请选择删除项',
type: 'warning'
})
}
},
// --
deleteClickFun(id) {
this.$confirmFun('您确定要删除吗?').then(async() => {
const { data: res } = await this.$http({
url: '/num/source',
method: 'delete',
data: id
})
if (res.code === 0) {
this.$message({
message: '删除成功',
type: 'success'
})
this.getSourceList()
} else {
this.$message.error(res.msg)
}
})
},
closeAddDialog() {
this.addPatientVisible = false
},

Loading…
Cancel
Save