master
xy 3 years ago
parent 0f133a3e71
commit 01dafe6055

@ -63,3 +63,13 @@ export function scheduleIndex(params){
params params
}) })
} }
export function nurseSchedule(params){
return request(
{
method:'get',
url:'/api/admin/schedule/nurse-schedule',
params
}
)
}

@ -179,6 +179,7 @@ export default {
this.isShowTime = true this.isShowTime = true
} }
if(type === 2){ if(type === 2){
this.$refs['timeSelect'].isDelete = schedule.status == 0
this.$refs['timeSelect'].form.id = schedule.id this.$refs['timeSelect'].form.id = schedule.id
this.$refs['timeSelect'].form.nurse_id = schedule.nurse_id this.$refs['timeSelect'].form.nurse_id = schedule.nurse_id
this.$refs['timeSelect'].form.start_time = schedule.start_time this.$refs['timeSelect'].form.start_time = schedule.start_time

@ -33,7 +33,6 @@
style="width: 300px;" style="width: 300px;"
filterable remote filterable remote
:remote-method="remoteNurse" :remote-method="remoteNurse"
v-load-more="nurseLoad"
:loading="loading"> :loading="loading">
<el-option v-for="(item,index) in nurses" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="(item,index) in nurses" :key="item.id" :label="item.name" :value="item.id">
</el-option> </el-option>
@ -67,7 +66,7 @@
</template> </template>
<template v-slot:footer> <template v-slot:footer>
<template v-if="form.id"> <template v-if="form.id && isDelete">
<Poptip <Poptip
:transfer="true" :transfer="true"
confirm confirm
@ -115,9 +114,10 @@ export default {
nurses:[], nurses:[],
nurseSelect:{ nurseSelect:{
page:1, page:1,
page_size:10, page_size:999,
keyword:'' keyword:''
}, },
isDelete:true,
loading:false, loading:false,
checkAll:true, checkAll:true,
indeterminate:false, indeterminate:false,
@ -192,10 +192,6 @@ export default {
} }
}, },
nurseLoad(){
this.nurseSelect.page ++
this.getNurses()
},
async getNurses(){ async getNurses(){
let res = await getWorker(this.nurseSelect,false) let res = await getWorker(this.nurseSelect,false)
if(res.data.length === 0){ if(res.data.length === 0){

@ -61,13 +61,16 @@
<el-table-column :width="130" align="center" label="操作" fixed="right" header-align="center"> <el-table-column :width="130" align="center" label="操作" fixed="right" header-align="center">
<template v-slot:default="scope"> <template v-slot:default="scope">
<Button size="small" type="primary" ghost @click="schedule(scope.row)" style="margin-right: 6px;">排班</Button> <Button size="small" type="primary" ghost @click="schedule(scope.row)" style="margin-right: 6px;">排班</Button>
<Poptip
transfer <template v-if="scope.row.service_times === 0">
confirm <Poptip
title="确认要删除订单?" transfer
@on-ok="deleteOrder(scope.row)"> confirm
<Button size="small" type="primary" ghost>删除</Button> title="确认要删除订单?"
</Poptip> @on-ok="deleteOrder(scope.row)">
<Button size="small" type="primary" ghost>删除</Button>
</Poptip>
</template>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>

@ -5,44 +5,44 @@
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<div style="display: flex"> <div style="display: flex">
<Input v-model="select.keyword" placeholder="关键字搜索" style="width: 200px; margin-right: 10px"/> <!-- <Input v-model="select.keyword" placeholder="关键字搜索" style="width: 200px; margin-right: 10px"/>-->
<Button style="margin-right: 10px" type="primary" @click="select.page = 1,getCustomerList()">查询</Button> <!-- <Button style="margin-right: 10px" type="primary" @click="select.page = 1,getCustomerList()">查询</Button>-->
<xy-selectors @search="select.page = 1,getList()" @reset="reset"> <!-- <xy-selectors @search="select.page = 1,getList()" @reset="reset">-->
<template> <!-- <template>-->
<div class="select-item"> <!-- <div class="select-item">-->
<div class="select-item__label">业务板块</div> <!-- <div class="select-item__label">业务板块</div>-->
<el-select size="small" v-model="select.product_type_id" placeholder="选择业务板块" clearable style="width: 200px"> <!-- <el-select size="small" v-model="select.product_type_id" placeholder="选择业务板块" clearable style="width: 200px">-->
<el-option v-for="item in types" :value="item.id" :label="item.name" :key="item.id"></el-option> <!-- <el-option v-for="item in types" :value="item.id" :label="item.name" :key="item.id"></el-option>-->
</el-select> <!-- </el-select>-->
</div> <!-- </div>-->
<div class="select-item"> <!-- <div class="select-item">-->
<div class="select-item__label">所属区域</div> <!-- <div class="select-item__label">所属区域</div>-->
<el-select size="small" v-model="select.area_id" placeholder="选择区域" clearable style="width: 200px"> <!-- <el-select size="small" v-model="select.area_id" placeholder="选择区域" clearable style="width: 200px">-->
<el-option v-for="item in areas" :value="item.id" :label="item.value" :key="item.id"></el-option> <!-- <el-option v-for="item in areas" :value="item.id" :label="item.value" :key="item.id"></el-option>-->
</el-select> <!-- </el-select>-->
</div> <!-- </div>-->
<div class="select-item"> <!-- <div class="select-item">-->
<div class="select-item__label">所属月份</div> <!-- <div class="select-item__label">所属月份</div>-->
<el-date-picker <!-- <el-date-picker-->
size="small" <!-- size="small"-->
v-model="select.month" <!-- v-model="select.month"-->
type="month" <!-- type="month"-->
value-format="yyyy-MM" <!-- value-format="yyyy-MM"-->
placeholder="选择月" <!-- placeholder="选择月"-->
style="width: 200px"> <!-- style="width: 200px">-->
</el-date-picker> <!-- </el-date-picker>-->
</div> <!-- </div>-->
<div class="select-item"> <!-- <div class="select-item">-->
<div class="select-item__label">状态</div> <!-- <div class="select-item__label">状态</div>-->
<el-radio v-model="select.schedule_status" :label="1"></el-radio> <!-- <el-radio v-model="select.schedule_status" :label="1"></el-radio>-->
<el-radio v-model="select.schedule_status" :label="2"></el-radio> <!-- <el-radio v-model="select.schedule_status" :label="2"></el-radio>-->
<el-radio v-model="select.schedule_status" label=""></el-radio> <!-- <el-radio v-model="select.schedule_status" label=""></el-radio>-->
</div> <!-- </div>-->
</template> <!-- </template>-->
</xy-selectors> <!-- </xy-selectors>-->
</div> </div>
</slot> </slot>
</lx-header> </lx-header>
@ -52,24 +52,60 @@
:default-expand-all="false" :default-expand-all="false"
:list="list" :list="list"
:table-item="table" :table-item="table"
:total="total"> :total="total"
@pageIndexChange="e => {select.page = e;getList()}"
@pageSizeChange="e => {select.page = 1;select.page_size = e;getList()}">
<<template v-slot:btns>
<el-table-column :width="80" align="center" label="操作" fixed="right" header-align="center">
<template v-slot:default="scope">
<Button size="small" type="primary" ghost @click="show(scope.row)"></Button>
</template>
</el-table-column>
</template>
</xy-table> </xy-table>
<el-drawer
size="46%"
title="护工排班"
:visible.sync="isShowDrawer"
direction="rtl">
<xy-table :height="400" style="margin-top: 20px;" :list="schedules" :table-item="scheduleTable" :is-page="false">
<template v-slot:btns>
<!-- <el-table-column :width="130" align="center" label="操作" fixed="right" header-align="center">-->
<!-- <template v-slot:default="scope">-->
<!-- <Button size="small" type="primary" ghost style="margin-right: 6px;">编辑</Button>-->
<!-- <template v-if="scope.row.status === 0">-->
<!-- <Poptip-->
<!-- transfer-->
<!-- confirm-->
<!-- title="确认要删除订单?"-->
<!-- @on-ok="deleteSchedule(scope.row)">-->
<!-- <Button size="small" type="primary" ghost>删除</Button>-->
<!-- </Poptip>-->
<!-- </template>-->
<!-- </template>-->
<!-- </el-table-column>-->
</template>
</xy-table>
</el-drawer>
</div> </div>
</template> </template>
<script> <script>
import { nurseSchedule,scheduleIndex,scheduleDelete } from '@/api/schedule'
export default { export default {
data() { data() {
return { return {
isShowDrawer:false,
select: { select: {
page: 1, page: 1,
page_size: 10, page_size: 10,
keyword:'', // keyword:'',
product_type_id:'', //product_type_id:'',
area_id:'', // area_id:'',
month:'', //month:'',
schedule_status:'', //schedule_status:'',
}, },
customers:[], customers:[],
products:[], products:[],
@ -81,18 +117,119 @@ export default {
list:[], list:[],
total:0, total:0,
table:[] table:[
{
prop:'name',
label:'护工姓名',
width:140
},
{
prop:'mobile',
label:'护工手机号',
width:160
},
{
prop:'birthday',
label:'护工年龄',
formatter:(cell,data,value) => {
return value ? this.$moment().diff(value,'year') : value
},
width:100
},
{
prop:'address',
label:'护工地址',
align:'left',
minWidth:200
},
{
prop:'has_arrange',
label:'已排班',
width:120
},
{
prop:'has_end',
label:'已完成',
width:120
}
],
schedules:[],
scheduleTable:[
{
prop:'customer.name',
label:'客户名称',
width:120
},
{
prop:'customer.phone',
label:'客户手机号',
width:150
},
{
prop:'start_time',
label:'开始时间',
width: 170
},
{
prop:'end_time',
label:'结束时间',
width: 170
},
{
prop:'status',
label:'状态',
width: 120,
formatter:(row,data,value) => {
let map = new Map([
[0,'待护理'],
[1,'护理中'],
[2,'已护理']
])
return map.get(value)
}
}
]
} }
}, },
methods: { methods: {
async getList(){ async getList(){
const res = await nurseSchedule(this.select)
this.list = res.data
this.total = res.total
}, },
reset(){ reset(){
},
editor(){
},
deleteSchedule(row){
scheduleDelete({
id:row.id
}).then(res => {
this.$message({
type:'success',
message:'删除成功'
})
this.getList()
})
},
show(e){
scheduleIndex({
nurse_name:e.name,
page_size:9999
}).then(res => {
this.schedules = res
this.isShowDrawer = true
})
} }
}, },
computed: {}, computed: {},
mounted() {
this.getList()
}
} }
</script> </script>

Loading…
Cancel
Save