|
|
|
|
@ -1,12 +1,15 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div v-if="detail">
|
|
|
|
|
<xy-dialog
|
|
|
|
|
ref="dialog"
|
|
|
|
|
:form="form"
|
|
|
|
|
:rules="rules"
|
|
|
|
|
:is-show.sync="isShow"
|
|
|
|
|
:width='84'
|
|
|
|
|
title="排班"
|
|
|
|
|
type="form"
|
|
|
|
|
@submit="submit">
|
|
|
|
|
@submit="submit"
|
|
|
|
|
@reset="pickType = 1,dateStartPick = '',dateEndPick = ''">
|
|
|
|
|
<template v-slot:extraFormTop>
|
|
|
|
|
<div :style="{
|
|
|
|
|
'display':'flex',
|
|
|
|
|
@ -94,22 +97,35 @@
|
|
|
|
|
产品:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-select v-model="form.product_id" disabled placeholder="请选择产品" style="width: 300px">
|
|
|
|
|
<el-select v-model="form.product_id" placeholder="请选择产品" style="width: 300px">
|
|
|
|
|
<el-option v-for="item in products" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:order_id>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
订单:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-select v-model="form.order_id" placeholder="请选择订单" style="width: 300px">
|
|
|
|
|
<el-option v-for="item in orders" :key="item.id" :label="item.no" :value="item.id"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:extraFormBottom>
|
|
|
|
|
<el-calendar>
|
|
|
|
|
<template v-slot:dateCell="{date, data}">
|
|
|
|
|
|
|
|
|
|
<el-popover
|
|
|
|
|
ref="popover"
|
|
|
|
|
:ref="`popover-${data.day}`"
|
|
|
|
|
placement="top"
|
|
|
|
|
trigger="click"
|
|
|
|
|
width="300">
|
|
|
|
|
width="280">
|
|
|
|
|
<div
|
|
|
|
|
slot="reference"
|
|
|
|
|
:style="
|
|
|
|
|
@ -125,37 +141,44 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<template v-if="pickType === 1">
|
|
|
|
|
<el-time-select
|
|
|
|
|
v-model="form.start_time"
|
|
|
|
|
:picker-options="{
|
|
|
|
|
start: '08:30',
|
|
|
|
|
step: '00:15',
|
|
|
|
|
end: '18:30'
|
|
|
|
|
<div style="display: flex;flex-direction: column;justify-content: center;align-items: center">
|
|
|
|
|
<template v-if="pickType === 1">
|
|
|
|
|
<el-time-select
|
|
|
|
|
style="width: 200px;margin-bottom: 10px"
|
|
|
|
|
v-model="form.start_time"
|
|
|
|
|
:picker-options="{
|
|
|
|
|
start: '00:00',
|
|
|
|
|
step: '00:5',
|
|
|
|
|
end: '23:59'
|
|
|
|
|
}"
|
|
|
|
|
placeholder="开始时间">
|
|
|
|
|
</el-time-select>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<el-time-select
|
|
|
|
|
v-model="form.end_time"
|
|
|
|
|
:picker-options="{
|
|
|
|
|
start: '08:30',
|
|
|
|
|
step: '00:15',
|
|
|
|
|
end: '18:30',
|
|
|
|
|
placeholder="开始时间">
|
|
|
|
|
</el-time-select>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<el-time-select
|
|
|
|
|
style="width: 200px;margin-bottom: 10px"
|
|
|
|
|
v-model="form.end_time"
|
|
|
|
|
:picker-options="{
|
|
|
|
|
start: '00:00',
|
|
|
|
|
step: '00:5',
|
|
|
|
|
end: '23:59',
|
|
|
|
|
minTime: form.start_time
|
|
|
|
|
}"
|
|
|
|
|
placeholder="结束时间">
|
|
|
|
|
</el-time-select>
|
|
|
|
|
</template>
|
|
|
|
|
<el-select v-model="form.nurse_id">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in nurses"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
:label="item.name"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
<Button type="primary" @click="dateConfirm">确认</Button>
|
|
|
|
|
placeholder="结束时间">
|
|
|
|
|
</el-time-select>
|
|
|
|
|
</template>
|
|
|
|
|
<el-select placeholder="请选择护工" v-model="form.nurse_id" style="width: 200px;margin-bottom: 10px">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in nurses"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
:label="item.name"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
<div style="width: 200px;display: flex;justify-content: space-between;">
|
|
|
|
|
<Button ghost type="primary" @click="$refs[`popover-${data.day}`].doClose()">取消</Button>
|
|
|
|
|
<Button type="primary" @click="dateConfirm(data)">确认</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-popover>
|
|
|
|
|
</template>
|
|
|
|
|
@ -185,6 +208,10 @@ export default {
|
|
|
|
|
levels: {
|
|
|
|
|
type: Array,
|
|
|
|
|
default: () => []
|
|
|
|
|
},
|
|
|
|
|
orders:{
|
|
|
|
|
type: Array,
|
|
|
|
|
default: () => []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
@ -204,6 +231,14 @@ export default {
|
|
|
|
|
start_time: '',
|
|
|
|
|
end_time: '',
|
|
|
|
|
nurse_id: '',
|
|
|
|
|
},
|
|
|
|
|
rules:{
|
|
|
|
|
product_id:[
|
|
|
|
|
{required:true,message:'请选择产品'}
|
|
|
|
|
],
|
|
|
|
|
order_id:[
|
|
|
|
|
{required:true,message:'请选择订单'}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -217,13 +252,14 @@ export default {
|
|
|
|
|
this.detail = res.detail
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
dateConfirm(){
|
|
|
|
|
this.pickType = 2
|
|
|
|
|
this.$refs['popover'].doClose()
|
|
|
|
|
console.log(this.$refs['popover'].showPopper)
|
|
|
|
|
dateConfirm(data){
|
|
|
|
|
if(this.pickType === 1){
|
|
|
|
|
this.pickType = 2
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.$refs[`popover-${data.day}`].doClose()
|
|
|
|
|
},
|
|
|
|
|
datePicked(data,date){
|
|
|
|
|
console.log(data,date)
|
|
|
|
|
if(this.pickType === 1){
|
|
|
|
|
this.dateStartPick = data.day
|
|
|
|
|
}
|
|
|
|
|
@ -233,7 +269,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
submit() {
|
|
|
|
|
this.form.start_time = `${this.dateStartPick} ${this.form.start_time}`
|
|
|
|
|
this.form.end_time = `${this.dateEndPick} ${this.form.end_time}`
|
|
|
|
|
this.form.end_time = `${this.dateEndPick || this.dateStartPick} ${this.form.end_time}`
|
|
|
|
|
|
|
|
|
|
scheduleSave(this.form).then(res => {
|
|
|
|
|
this.$successMessage('排班','')
|
|
|
|
|
@ -257,9 +293,12 @@ export default {
|
|
|
|
|
watch: {
|
|
|
|
|
isShow(val) {
|
|
|
|
|
if (val) {
|
|
|
|
|
this.getCustomer()
|
|
|
|
|
//this.getCustomer()
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
this.pickType = 1
|
|
|
|
|
this.dateEndPick = ''
|
|
|
|
|
this.dateStartPick = ''
|
|
|
|
|
this.$refs['dialog'].reset()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|