|
|
|
|
@ -1,7 +1,11 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<div ref="lxHeader">
|
|
|
|
|
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="护工排班视图">
|
|
|
|
|
<lx-header
|
|
|
|
|
icon="md-apps"
|
|
|
|
|
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
|
|
|
|
|
text="护工排班视图"
|
|
|
|
|
>
|
|
|
|
|
<div slot="content"></div>
|
|
|
|
|
<slot>
|
|
|
|
|
<div style="display: flex">
|
|
|
|
|
@ -53,12 +57,32 @@
|
|
|
|
|
:list="list"
|
|
|
|
|
:table-item="table"
|
|
|
|
|
:total="total"
|
|
|
|
|
@pageIndexChange="e => {select.page = e;getList()}"
|
|
|
|
|
@pageSizeChange="e => {select.page = 1;select.page_size = e;getList()}">
|
|
|
|
|
@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">
|
|
|
|
|
<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>
|
|
|
|
|
<Button size="small" type="primary" ghost @click="show(scope.row)"
|
|
|
|
|
>查看</Button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
@ -68,41 +92,108 @@
|
|
|
|
|
size="46%"
|
|
|
|
|
title="护工排班"
|
|
|
|
|
:visible.sync="isShowDrawer"
|
|
|
|
|
direction="rtl">
|
|
|
|
|
direction="rtl"
|
|
|
|
|
>
|
|
|
|
|
<div class="draw-title">护工信息</div>
|
|
|
|
|
<div style="margin-left: 2%;">
|
|
|
|
|
<div style="margin-bottom: 8px;">
|
|
|
|
|
<div style="margin-left: 2%">
|
|
|
|
|
<div style="margin-bottom: 8px">
|
|
|
|
|
<span class="info-title">姓名</span>
|
|
|
|
|
<span class="info-content">{{ worker.name }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin-bottom: 8px;">
|
|
|
|
|
<div style="margin-bottom: 8px">
|
|
|
|
|
<span class="info-title">性别</span>
|
|
|
|
|
<span class="info-content">{{ worker.sex }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin-bottom: 8px;">
|
|
|
|
|
<div style="margin-bottom: 8px">
|
|
|
|
|
<span class="info-title">手机号</span>
|
|
|
|
|
<span class="info-content">{{ worker.mobile }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin-bottom: 8px;">
|
|
|
|
|
<div style="margin-bottom: 8px">
|
|
|
|
|
<span class="info-title">年龄</span>
|
|
|
|
|
<span class="info-content">{{ $moment().diff(worker.birthday,'year') }}</span>
|
|
|
|
|
<span class="info-content">{{
|
|
|
|
|
$moment().diff(worker.birthday, "year")
|
|
|
|
|
}}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<xy-table :height="400" style="margin-top: 20px;" :list="schedules" :table-item="scheduleTable" :is-page="false">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="pickedMonth"
|
|
|
|
|
type="month"
|
|
|
|
|
size="small"
|
|
|
|
|
placeholder="选择月份"
|
|
|
|
|
style="width: 180px; margin-left: 10px; margin-top: 8px"
|
|
|
|
|
@change="
|
|
|
|
|
(e) => {
|
|
|
|
|
this.scheduleSelect.start_date = $moment(e)
|
|
|
|
|
.startOf('month')
|
|
|
|
|
.format('YYYY-MM-DD');
|
|
|
|
|
this.scheduleSelect.end_date = $moment(e)
|
|
|
|
|
.endOf('month')
|
|
|
|
|
.format('YYYY-MM-DD');
|
|
|
|
|
getSchedules();
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
></el-date-picker>
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="scheduleSelect.customer_name"
|
|
|
|
|
placeholder="客户姓名"
|
|
|
|
|
size="small"
|
|
|
|
|
style="width: 180px; margin-left: 6px; margin-top: 8px"
|
|
|
|
|
@input="debounce(getSchedules,2000)()"
|
|
|
|
|
></el-input>
|
|
|
|
|
<xy-table
|
|
|
|
|
:row-key="
|
|
|
|
|
(row) => {
|
|
|
|
|
return row.id;
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
:expand-row-keys="expandRowKeys"
|
|
|
|
|
:height="400"
|
|
|
|
|
style="margin-top: 20px"
|
|
|
|
|
:default-expand-all="false"
|
|
|
|
|
:list="schedules"
|
|
|
|
|
:table-item="scheduleTable"
|
|
|
|
|
:is-page="false"
|
|
|
|
|
@expand-change="
|
|
|
|
|
({ row, expanded }) => {
|
|
|
|
|
expandRowKeys = [];
|
|
|
|
|
logs = [];
|
|
|
|
|
expandRowKeys.push(row.id);
|
|
|
|
|
getScheduleLog(row.id);
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column :width="130" align="center" label="操作" header-align="center">
|
|
|
|
|
<el-table-column
|
|
|
|
|
:width="100"
|
|
|
|
|
align="center"
|
|
|
|
|
label="操作"
|
|
|
|
|
header-align="center"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:default="scope">
|
|
|
|
|
<el-popover
|
|
|
|
|
placement="right"
|
|
|
|
|
width="300"
|
|
|
|
|
trigger="click">
|
|
|
|
|
<el-table :data="skus" :height="300">
|
|
|
|
|
<el-table-column width="120" property="sku_info.name" label="明细名称"></el-table-column>
|
|
|
|
|
<el-table-column width="100" property="time" label="时长(分)"></el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<Button size="small" type="primary" ghost slot="reference" style="margin-right: 4px" @click="showDialog(scope.row)">明细</Button>
|
|
|
|
|
</el-popover>
|
|
|
|
|
<!-- <el-popover placement="right" width="300" trigger="click">-->
|
|
|
|
|
<!-- <el-table :data="skus" :height="300">-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- width="120"-->
|
|
|
|
|
<!-- property="sku_info.name"-->
|
|
|
|
|
<!-- label="明细名称"-->
|
|
|
|
|
<!-- ></el-table-column>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- width="100"-->
|
|
|
|
|
<!-- property="time"-->
|
|
|
|
|
<!-- label="时长(分)"-->
|
|
|
|
|
<!-- ></el-table-column>-->
|
|
|
|
|
<!-- </el-table>-->
|
|
|
|
|
<!-- <Button-->
|
|
|
|
|
<!-- size="small"-->
|
|
|
|
|
<!-- type="primary"-->
|
|
|
|
|
<!-- ghost-->
|
|
|
|
|
<!-- slot="reference"-->
|
|
|
|
|
<!-- style="margin-right: 4px"-->
|
|
|
|
|
<!-- @click="getScheduleLog(scope.row.id)"-->
|
|
|
|
|
<!-- >明细</Button-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<!-- </el-popover>-->
|
|
|
|
|
|
|
|
|
|
<template v-if="scope.row.status === 0">
|
|
|
|
|
<Poptip
|
|
|
|
|
@ -110,7 +201,8 @@
|
|
|
|
|
transfer
|
|
|
|
|
confirm
|
|
|
|
|
title="确认要删除订单?"
|
|
|
|
|
@on-ok="deleteSchedule(scope.row)">
|
|
|
|
|
@on-ok="deleteSchedule(scope.row)"
|
|
|
|
|
>
|
|
|
|
|
<Button size="small" type="primary" ghost>删除</Button>
|
|
|
|
|
</Poptip>
|
|
|
|
|
</template>
|
|
|
|
|
@ -119,16 +211,22 @@
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
</el-drawer>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { nurseSchedule,scheduleIndex,scheduleDelete } from '@/api/schedule'
|
|
|
|
|
import { getList } from '@/api/serveDetail'
|
|
|
|
|
import {
|
|
|
|
|
nurseSchedule,
|
|
|
|
|
scheduleIndex,
|
|
|
|
|
scheduleDelete,
|
|
|
|
|
scheduleLog,
|
|
|
|
|
} from "@/api/schedule";
|
|
|
|
|
import { getList } from "@/api/serveDetail";
|
|
|
|
|
import { debounce } from "@/utils";
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
expandRowKeys: [],
|
|
|
|
|
worker: {},
|
|
|
|
|
isShowDrawer: false,
|
|
|
|
|
isShowSku: false,
|
|
|
|
|
@ -154,129 +252,228 @@ export default {
|
|
|
|
|
total: 0,
|
|
|
|
|
table: [
|
|
|
|
|
{
|
|
|
|
|
prop:'name',
|
|
|
|
|
label:'护工姓名',
|
|
|
|
|
width:140
|
|
|
|
|
prop: "name",
|
|
|
|
|
label: "护工姓名",
|
|
|
|
|
width: 140,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop:'mobile',
|
|
|
|
|
label:'护工手机号',
|
|
|
|
|
width:160
|
|
|
|
|
prop: "mobile",
|
|
|
|
|
label: "护工手机号",
|
|
|
|
|
width: 160,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop:'birthday',
|
|
|
|
|
label:'护工年龄',
|
|
|
|
|
prop: "birthday",
|
|
|
|
|
label: "护工年龄",
|
|
|
|
|
formatter: (cell, data, value) => {
|
|
|
|
|
return value ? this.$moment().diff(value,'year') : value
|
|
|
|
|
return value ? this.$moment().diff(value, "year") : value;
|
|
|
|
|
},
|
|
|
|
|
width:100
|
|
|
|
|
width: 100,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop:'address',
|
|
|
|
|
label:'护工地址',
|
|
|
|
|
align:'left',
|
|
|
|
|
minWidth:200
|
|
|
|
|
prop: "address",
|
|
|
|
|
label: "护工地址",
|
|
|
|
|
align: "left",
|
|
|
|
|
minWidth: 200,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop:'has_arrange',
|
|
|
|
|
label:'待完成',
|
|
|
|
|
width:120
|
|
|
|
|
prop: "has_arrange",
|
|
|
|
|
label: "待完成",
|
|
|
|
|
width: 120,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop:'has_end',
|
|
|
|
|
label:'已完成',
|
|
|
|
|
width:120
|
|
|
|
|
}
|
|
|
|
|
prop: "has_end",
|
|
|
|
|
label: "已完成",
|
|
|
|
|
width: 120,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
pickedMonth: "",
|
|
|
|
|
scheduleSelect: {
|
|
|
|
|
nurse_name: "",
|
|
|
|
|
customer_name: "",
|
|
|
|
|
page_size: 999,
|
|
|
|
|
page: 1,
|
|
|
|
|
start_date: "",
|
|
|
|
|
end_date: "",
|
|
|
|
|
},
|
|
|
|
|
logs: [],
|
|
|
|
|
schedules: [],
|
|
|
|
|
scheduleTable: [
|
|
|
|
|
{
|
|
|
|
|
prop:'customer.name',
|
|
|
|
|
label:'客户名称',
|
|
|
|
|
width:120
|
|
|
|
|
label: "服务明细",
|
|
|
|
|
width: 78,
|
|
|
|
|
type: "expand",
|
|
|
|
|
expandFn: (row) => {
|
|
|
|
|
return (
|
|
|
|
|
<Table
|
|
|
|
|
data={this.logs}
|
|
|
|
|
columns={[
|
|
|
|
|
{
|
|
|
|
|
title: "类型",
|
|
|
|
|
key: "type",
|
|
|
|
|
width: 120,
|
|
|
|
|
render: (h, { row, column, index }) => {
|
|
|
|
|
let map = new Map([
|
|
|
|
|
[1, "签到"],
|
|
|
|
|
[2, "过程打卡"],
|
|
|
|
|
[3, "签退"],
|
|
|
|
|
[4, "更新定位"],
|
|
|
|
|
]);
|
|
|
|
|
return h("span", {}, map.get(row.type));
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop:'customer.phone',
|
|
|
|
|
label:'客户手机号',
|
|
|
|
|
width:150
|
|
|
|
|
title: "地址",
|
|
|
|
|
key: "address",
|
|
|
|
|
minWidth: 200,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop:'sign_in',
|
|
|
|
|
label:'签到时间',
|
|
|
|
|
width: 170
|
|
|
|
|
title: "时间",
|
|
|
|
|
key: "created_at",
|
|
|
|
|
width: 180,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop:'sign_out',
|
|
|
|
|
label:'签退时间',
|
|
|
|
|
width: 170
|
|
|
|
|
title: "照片",
|
|
|
|
|
minWidth: 200,
|
|
|
|
|
render: (h, { row }) => {
|
|
|
|
|
return h(
|
|
|
|
|
"div",
|
|
|
|
|
{},
|
|
|
|
|
row.upload_list.map((item) => {
|
|
|
|
|
return h("el-image", {
|
|
|
|
|
props: {
|
|
|
|
|
previewSrcList: row.upload_list.map(
|
|
|
|
|
(item) => item.upload.url
|
|
|
|
|
),
|
|
|
|
|
url: item.upload.url,
|
|
|
|
|
fit: "contain",
|
|
|
|
|
},
|
|
|
|
|
style: {
|
|
|
|
|
width: "200px",
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
]}
|
|
|
|
|
></Table>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop:'status',
|
|
|
|
|
label:'状态',
|
|
|
|
|
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: "sign_in",
|
|
|
|
|
label: "签到时间",
|
|
|
|
|
width: 170,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "sign_out",
|
|
|
|
|
label: "签退时间",
|
|
|
|
|
width: 170,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "实际服务时间",
|
|
|
|
|
width: 160,
|
|
|
|
|
customFn: (row) => {
|
|
|
|
|
return (
|
|
|
|
|
<span>
|
|
|
|
|
{row.sign_in && row.sign_out
|
|
|
|
|
? this.$moment(row.sign_out).diff(row.sign_in, "minutes")
|
|
|
|
|
: 0}
|
|
|
|
|
</span>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "status",
|
|
|
|
|
label: "状态",
|
|
|
|
|
width: 120,
|
|
|
|
|
formatter: (row, data, value) => {
|
|
|
|
|
let map = new Map([
|
|
|
|
|
[0,'待护理'],
|
|
|
|
|
[1,'护理中'],
|
|
|
|
|
[2,'已护理']
|
|
|
|
|
])
|
|
|
|
|
return map.get(value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
[0, "待护理"],
|
|
|
|
|
[1, "护理中"],
|
|
|
|
|
[2, "已护理"],
|
|
|
|
|
]);
|
|
|
|
|
return map.get(value);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async getList(){
|
|
|
|
|
const res = await nurseSchedule(this.select)
|
|
|
|
|
this.list = res.data
|
|
|
|
|
this.total = res.total
|
|
|
|
|
debounce,
|
|
|
|
|
async getScheduleLog(id) {
|
|
|
|
|
const res = await scheduleLog({ id });
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.logs = res;
|
|
|
|
|
},
|
|
|
|
|
reset(){
|
|
|
|
|
|
|
|
|
|
async getList() {
|
|
|
|
|
const res = await nurseSchedule(this.select);
|
|
|
|
|
this.list = res.data;
|
|
|
|
|
this.total = res.total;
|
|
|
|
|
},
|
|
|
|
|
reset() {},
|
|
|
|
|
|
|
|
|
|
editor(){
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
editor() {},
|
|
|
|
|
showDialog(row) {
|
|
|
|
|
getList({
|
|
|
|
|
customer_id:row.customer_id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.skus = res.data.filter(item => {
|
|
|
|
|
return row.id === item.id
|
|
|
|
|
})[0]?.sku ?? []
|
|
|
|
|
this.isShowSku = true
|
|
|
|
|
})
|
|
|
|
|
customer_id: row.customer_id,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
this.skus =
|
|
|
|
|
res.data.filter((item) => {
|
|
|
|
|
return row.id === item.id;
|
|
|
|
|
})[0]?.sku ?? [];
|
|
|
|
|
this.isShowSku = true;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
deleteSchedule(row) {
|
|
|
|
|
scheduleDelete({
|
|
|
|
|
id:row.id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
id: row.id,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type:'success',
|
|
|
|
|
message:'删除成功'
|
|
|
|
|
})
|
|
|
|
|
this.getList()
|
|
|
|
|
})
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "删除成功",
|
|
|
|
|
});
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
show(e) {
|
|
|
|
|
this.worker = e
|
|
|
|
|
scheduleIndex({
|
|
|
|
|
nurse_name:e.name,
|
|
|
|
|
page_size:9999
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.schedules = res
|
|
|
|
|
this.isShowDrawer = true
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.scheduleSelect.nurse_name = e.name;
|
|
|
|
|
this.worker = e;
|
|
|
|
|
this.getSchedules();
|
|
|
|
|
},
|
|
|
|
|
getSchedules() {
|
|
|
|
|
scheduleIndex(this.scheduleSelect).then((res) => {
|
|
|
|
|
this.schedules = res;
|
|
|
|
|
this.isShowDrawer = true;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
@ -296,11 +493,11 @@ export default {
|
|
|
|
|
position: relative;
|
|
|
|
|
padding: 10px 8px 10px 30px;
|
|
|
|
|
&::after {
|
|
|
|
|
content: '';
|
|
|
|
|
content: "";
|
|
|
|
|
width: 10px;
|
|
|
|
|
height: 10px;
|
|
|
|
|
border-radius: 100%;
|
|
|
|
|
background: #B3241D;
|
|
|
|
|
background: #b3241d;
|
|
|
|
|
|
|
|
|
|
transform: translateY(-50%);
|
|
|
|
|
position: absolute;
|
|
|
|
|
@ -312,7 +509,6 @@ export default {
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
.info-content {
|
|
|
|
|
|
|
|
|
|
padding-left: 10px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|