master
xy 3 years ago
parent 2855fc1c8e
commit f36bf0697f

@ -0,0 +1,65 @@
<template>
<div>
<div class="draw-title">{{ title }}</div>
<div style="margin-left: 2%;">
<template v-for="(value,key) in info">
<div style="margin-bottom: 8px;">
<span class="info-title">{{ key }}</span>
<span class="info-content">{{ value }}</span>
</div>
</template>
</div>
</div>
</template>
<script>
export default {
props:{
title:{
type:String,
default:"详情"
},
info:Object
},
data() {
return {}
},
methods: {},
computed: {},
}
</script>
<style scoped lang="scss">
.draw-title{
letter-spacing: 2px;
font-weight: 600;
position: relative;
padding: 10px 8px 10px 30px;
&::after{
content: '';
width: 10px;
height: 10px;
border-radius: 100%;
background: #B3241D;
transform: translateY(-50%);
position: absolute;
top: 50%;
left: 10px;
}
}
.info-title{
font-weight: 600;
}
.info-content{
padding-left: 10px;
}
::v-deep .el-drawer__header > :first-child{
font-size: 18px;
font-weight: 600;
}
</style>

@ -1,36 +1,47 @@
<template> <template>
<div> <div>
<el-drawer <el-drawer size="46%" title="详情" :visible.sync="isShow" direction="rtl">
size="46%"
:title="row.name || ''"
:visible.sync="isShow"
direction="rtl">
<template> <template>
<div class="draw-title">用户信息</div> <div style="overflow-y: scroll; height: 100%; padding-bottom: 100px">
<div style="margin-left: 2%;"> <drawInfoItem title="被护理人" :info="rowFormat[0]"></drawInfoItem>
<div style="margin-bottom: 8px;"> <drawInfoItem title="护理人" :info="rowFormat[1]"></drawInfoItem>
<span class="info-title">性别</span> <div class="draw-title">
<span class="info-content">{{ row.sex }}</span> {{ type === 1 ? "服务列表" : "本次服务信息" }}
</div> </div>
<div style="margin-bottom: 8px;"> <div style="padding: 0 10px">
<span class="info-title">身份证号</span> <template v-if="type === 1">
<span class="info-content">{{ row.idcard }}</span> <xy-table
</div> :height="300"
<div style="margin-bottom: 8px;"> :is-page="false"
<span class="info-title">电话</span> :list="list"
<span class="info-content">{{ row.phone }}</span> :table-item="table"
</div> >
<div style="margin-bottom: 8px;"> <template v-slot:btns> </template>
<span class="info-title">联系人</span> </xy-table>
<span class="info-content">{{ row.contact_name }} / {{ row.contact_phone }}</span> </template>
</div> <template v-else>
</div> <el-timeline style="margin-left: 8px">
<div class="draw-title">服务记录</div> <el-timeline-item
<div style="padding: 0 10px;"> v-for="item in list"
<xy-table :is-page="false" :list="list" :table-item="table"> :key="item.id"
<template v-slot:btns> :timestamp="item.created_at"
placement="top"
>
<el-card>
<h4>{{ typeFormat(item.type) }}</h4>
<p>{{ item.address }}</p>
<el-image
:preview-src-list="picList"
v-for="img in item.upload_list"
:src="img.upload.url"
fit="contain"
style="height: 200px"
></el-image>
</el-card>
</el-timeline-item>
</el-timeline>
</template> </template>
</xy-table> </div>
</div> </div>
</template> </template>
</el-drawer> </el-drawer>
@ -40,138 +51,190 @@
</template> </template>
<script> <script>
import { scheduleLog } from '@/api/schedule' import { scheduleLog } from "@/api/schedule";
import { getList } from '@/api/serveDetail'
import moment from "moment"; import moment from "moment";
import { getAgeByIdcard } from "@/utils";
import detail from './detailServe' import detail from "./detailServe";
import drawInfoItem from "./drawInfoItem.vue";
export default { export default {
components:{ components: {
detail detail,
drawInfoItem,
}, },
provide(){ inject: ["selectedRow"],
provide() {
return { return {
scheduleInfo:()=>this.scheduleInfo scheduleInfo: () => this.scheduleInfo,
} };
},
props: {
type: {
type: Number,
default: 1,
},
}, },
data() { data() {
return { return {
isShow:false, isShow: false,
row:{}, row: {},
scheduleInfo:{}, scheduleInfo: {},
picList: [],
select:{ select: {
page: 1, customer_id: "",
page_size:9999, id: "",
customer_id:'', order_id: "",
year:'', type: "",
month:'',
id:''
}, },
list:[], list: [],
table:[ table: [
{ {
prop:'nurse.name', prop: "type",
label:'护工', label: "类型",
width: 124 width: 140,
formatter: (cell, data, val) => {
switch (val) {
case 1:
return "签到";
break;
case 2:
return "过程打卡";
break;
case 3:
return "签退";
break;
case 4:
return "更新定位";
break;
default:
return val;
}
},
}, },
{ {
prop:'customer_address.address', prop: "created_at",
label:'上门地址', label: "时间",
minWidth: 160, width: 170,
align:'left'
}, },
{ {
label:'服务时间', prop: "updated_at",
width: 200, label: "更新",
customFn:(row) => { width: 170,
return (
<div>{ moment(row.start_time).format('YYYY-MM-DD HH:mm') }~{ moment(row.end_time).format('HH:mm') }</div>
)
}
}, },
{ {
label:'状态', prop: "address",
width: 80, label: "定位地址",
customFn:(row) => { minWidth: 220,
let map1 = new Map([ align: "left",
[0,'待护理'],
[1,'进行中'],
[2,'已完成']
])
let map2 = new Map([
[0,'blue'],
[1,'red'],
[2,'green']
])
return (
<div style={{'color':map2.get(row.status)}}>
{map1.get(row.status)}
</div>
)
}
}, },
{ {
label:'详情', label: "照片",
width: 74, minWidth: 200,
fixed:"right", customFn: (row) => {
customFn:(row) => {
let _this = this
return ( return (
<div> <div
<Button style={{
type="primary" display: "flex",
size="small" "flex-wrap": "wrap",
on={ }}
{ on={{ ["click"]: (e) => this.setPicList(row) }}
['click']:() => { >
_this.scheduleInfo = row {row.upload_list.map((item) => {
_this.$refs['detail'].time = moment(row.start_time).format('YYYY-MM-DD HH:mm') + '~' + moment(row.end_time).format('HH:mm') return (
_this.$refs['detail'].id = row.id <el-image
_this.$refs['detail'].isShow = true preview-src-list={this.picList}
_this.isShow = false src={item.upload.url}
} fit="contain"
} style="height: 200px;"
}>查看</Button> ></el-image>
);
})}
</div> </div>
) );
} },
} },
] ],
} };
}, },
methods: { methods: {
async getList(){ init() {
const res = await scheduleLog(this.select) this.select = {
console.log(111,res) customer_id: "",
// const res = await getList(this.select) id: "",
// this.list = res.data order_id: "",
// console.log(this.list) type: "",
} };
},
async getList() {
const res = await scheduleLog(this.select);
this.list = res;
this.picList = [];
this.list.forEach((item) => {
let pics = item.upload_list?.map((upload) => upload.upload?.url) || [];
this.picList.push(...pics);
});
},
}, },
watch:{ computed: {
isShow(val){ rowFormat() {
if(val){ if (this.selectedRow()) {
this.getList() return [
{
姓名: this.selectedRow().customer?.name,
性别: this.selectedRow().customer?.sex,
年龄: getAgeByIdcard(this.selectedRow().customer?.idcard),
地址: this.selectedRow().customer_address?.address,
联系人: this.selectedRow().customer?.contact_name,
联系人电话: this.selectedRow().customer?.contact_phone,
},
{
姓名: this.selectedRow().nurse?.name,
性别: this.selectedRow().nurse?.sex,
年龄: getAgeByIdcard(this.selectedRow().nurse?.idcard),
手机号: this.selectedRow().nurse?.mobile,
},
];
} }
} },
} typeFormat() {
} return function (type) {
let map = new Map([
[1, "签到"],
[2, "过程打卡"],
[3, "签退"],
[4, "更新定位"],
]);
return map.get(type);
};
},
},
watch: {
isShow(val) {
if (val) {
this.getList();
} else {
this.init();
}
},
},
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.draw-title{ .draw-title {
letter-spacing: 2px; letter-spacing: 2px;
font-weight: 600; font-weight: 600;
position: relative; position: relative;
padding: 10px 8px 10px 30px; padding: 10px 8px 10px 30px;
&::after{ &::after {
content: ''; content: "";
width: 10px; width: 10px;
height: 10px; height: 10px;
border-radius: 100%; border-radius: 100%;
background: #B3241D; background: #b3241d;
transform: translateY(-50%); transform: translateY(-50%);
position: absolute; position: absolute;
@ -180,15 +243,14 @@ export default {
} }
} }
.info-title{ .info-title {
font-weight: 600; font-weight: 600;
} }
.info-content{ .info-content {
padding-left: 10px; padding-left: 10px;
} }
::v-deep .el-drawer__header > :first-child{ ::v-deep .el-drawer__header > :first-child {
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
} }

@ -117,14 +117,17 @@
<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="0"
>待护理</el-radio
>
<el-radio v-model="select.schedule_status" :label="1" <el-radio v-model="select.schedule_status" :label="1"
>已排</el-radio >进行中</el-radio
> >
<el-radio v-model="select.schedule_status" :label="2" <el-radio v-model="select.schedule_status" :label="2"
>未排</el-radio >已完成</el-radio
> >
<el-radio v-model="select.schedule_status" label="" <el-radio v-model="select.schedule_status" label=""
>全部</el-radio >全部</el-radio
> >
</div> </div>
</template> </template>
@ -178,12 +181,19 @@
ghost ghost
type="primary" type="primary"
style="margin-right: 6px" style="margin-right: 6px"
@click="e => {
selectedRow = scope.row;
$refs['draw'].select.id = scope.row.id;
$refs['draw'].isShow = true;
}"
>查看</Button >查看</Button
> >
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
</xy-table> </xy-table>
<draw ref="draw" :type="2"></draw>
</div> </div>
</template> </template>
@ -192,11 +202,21 @@ import { scheduleDelete } from "@/api/schedule/index"
import { getList as customerIndex } from "@/api/customer" import { getList as customerIndex } from "@/api/customer"
import { scheduleList } from "@/api/schedule"; import { scheduleList } from "@/api/schedule";
import { getList as nurseList} from "@/api/worker" import { getList as nurseList} from "@/api/worker"
import { download } from "@/utils/downloadRequest" import { download } from "@/utils/downloadRequest"
import draw from "./component/serveDraw.vue"
export default { export default {
components:{
draw
},
provide(){
return {
selectedRow:() => this.selectedRow
}
},
data() { data() {
return { return {
selectedRow:{},
customers:[], customers:[],
nurses:[], nurses:[],
select: { select: {

@ -111,8 +111,14 @@ export default {
components: { components: {
serveDraw, serveDraw,
}, },
provide(){
return {
selectedRow:() => this.selectedRow
}
},
data() { data() {
return { return {
selectedRow:{},
isShowDraw: false, isShowDraw: false,
isShowDetail: false, isShowDetail: false,
datePickMode: 1, //01 datePickMode: 1, //01

Loading…
Cancel
Save