刘翔宇-旅管家 4 years ago
commit 011d8cf7f6

@ -0,0 +1,34 @@
import request from "@/utils/request";
export function getList(params,isLoading){
return request({
method:'get',
url:'/api/admin/pay_unit/get-list',
params,
isLoading
})
}
export function getForm(id,params){
return request({
method:'get',
url:`/api/admin/pay_unit/get-form/${id}`,
params
})
}
export function save(data){
return request({
method:'post',
url:'/api/admin/pay_unit/save',
data
})
}
export function destroy(id,data){
return request({
method:'post',
url:`/api/admin/pay_unit/delete/${id}`,
data
})
}

@ -16,11 +16,11 @@ export function customerDetail(params){
})
}
export function scheduleSave(params){
export function scheduleSave(data){
return request({
method:'post',
url:'/api/admin/schedule/schedule-save',
params
data
})
}

@ -39,7 +39,7 @@ router.beforeEach(async(to, from, next) => {
// generate accessible routes map based on roles
const accessRoutes = await store.dispatch('permission/generateRoutes', roles)
console.log(accessRoutes)
//console.log(accessRoutes)
// dynamically add accessible routes
router.addRoutes(accessRoutes)

@ -1,29 +1,312 @@
<template>
<div>
<div>
<div class="statistics">
<el-card>
<template v-slot:header>
<i class="el-icon-data-line"></i>
<span class="statistics-title">营业统计</span>
</template>
<div class="statistics-content">
<div class="statistics-content-top">
<div class="statistics-content-top__num">40.5</div>
<div class="statistics-content-top__name">服务金额</div>
</div>
<div class="statistics-content-bottom">
<div class="statistics-content-bottom-left">
<div class="statistics-content-bottom-left__num">26.9</div>
<div class="statistics-content-bottom-left__name">护工金额</div>
</div>
<div class="statistics-content-bottom-right">
<div class="statistics-content-bottom-right__num">13.6</div>
<div class="statistics-content-bottom-right__name">留存金额</div>
</div>
</div>
</div>
</el-card>
<el-card>
<template v-slot:header>
<i class="el-icon-user"></i>
<span class="statistics-title">人效统计</span>
</template>
<div class="statistics-content">
<div class="statistics-content-top">
<div class="statistics-content-top__num">120</div>
<div class="statistics-content-top__name">照护人员</div>
</div>
<div class="statistics-content-bottom">
<div class="statistics-content-bottom-left">
<div class="statistics-content-bottom-left__num">8小时/</div>
<div class="statistics-content-bottom-left__name">预期照护时长</div>
</div>
<div class="statistics-content-bottom-right">
<div class="statistics-content-bottom-right__num">6.3小时/</div>
<div class="statistics-content-bottom-right__name">人均照护时长</div>
</div>
</div>
</div>
</el-card>
<el-card>
<template v-slot:header>
<i class="el-icon-s-custom"></i>
<span class="statistics-title">客户统计</span>
</template>
<div class="statistics-content">
<div class="statistics-content-top">
<div class="statistics-content-top__num">800</div>
<div class="statistics-content-top__name">活跃客户</div>
</div>
<div class="statistics-content-bottom">
<div class="statistics-content-bottom-left">
<div class="statistics-content-bottom-left__num">100</div>
<div class="statistics-content-bottom-left__name">新增</div>
</div>
<div class="statistics-content-bottom-right">
<div class="statistics-content-bottom-right__num">20</div>
<div class="statistics-content-bottom-right__name">流失</div>
</div>
</div>
</div>
</el-card>
<el-card>
<template v-slot:header>
<i class="el-icon-document"></i>
<span class="statistics-title">订单统计</span>
</template>
<div class="statistics-content">
<div class="statistics-content-top">
<div class="statistics-content-top__num">500</div>
<div class="statistics-content-top __name">服务订单</div>
</div>
<div class="statistics-content-bottom">
<div class="statistics-content-bottom-left">
<div class="statistics-content-bottom-left__num">450</div>
<div class="statistics-content-bottom-left__name">周期性订单</div>
</div>
<div class="statistics-content-bottom-right">
<div class="statistics-content-bottom-right__num">50</div>
<div class="statistics-content-bottom-right__name">单次订单</div>
</div>
</div>
</div>
</el-card>
</div>
<div class="chart">
<div id="col-chart"></div>
<div id="line-chart"></div>
</div>
</div>
</template>
<script>
export default {
components: {
import echarts from "echarts"
},
data() {
return {
}
},
created: function() {
},
methods: {
export default {
components: {},
data() {
return {
col:'',
line:''
}
},
methods: {
init() {
this.col = echarts.init(document.getElementById('col-chart'))
this.col.setOption({
title: {
text: ''
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
position:'bottom'
},
legend: {},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
yAxis: {
type: 'value',
boundaryGap: [0, 0.01]
},
xAxis: {
type: 'category',
data: ['第一周', '第二周', '第三周', '第四周']
},
series: [
{
name: '服务金额',
type: 'bar',
data: [18203, 23489, 29034, 104970],
itemStyle: {
normal: {
color: 'rgb(42,182,252)'
},
},
},
{
name: '收款',
type: 'bar',
data: [19325, 23438, 31000, 121594],
itemStyle: {
normal: {
color: 'rgb(34,228,255)'
},
},
}
]
})
this.line = echarts.init(document.getElementById('line-chart'))
this.line.setOption({
title: {
text: ''
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['活跃客户', '服务订单']
},
grid: {
left: '3%',
right: '6%',
bottom: '3%',
containLabel: true
},
toolbox: {
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['第一周', '第二周', '第三周', '第四周']
},
yAxis: {
type: 'value',
},
series: [
{
name: '活跃客户',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134],
itemStyle: {
normal: {
color: 'rgb(42,182,252)'
},
},
},
{
name: '服务订单',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234],
itemStyle: {
normal: {
color: 'rgb(34,228,255)'
},
},
}
]
})
}
},
mounted() {
this.init()
window.onresize = () => {
this.col.resize()
this.line.resize()
}
},
destroyed() {
window.onresize = null
}
}
</script>
<style lang="scss" scoped>
.statistics{
display: flex;
margin-top: 20px;
&-title{
padding-left: 6px;
}
&-content{
text-align: center;
font-size: 13px;
&-top{
&__num{
font-weight: 600;
}
&__name{
font-size: 10px;
color: rgb(140,140,140);
}
}
&-bottom{
display: flex;
justify-content: space-between;
&-left{
&__num{
font-weight: 600;
}
&__name{
font-size: 10px;
color: rgb(140,140,140);
}
}
&-right{
&__num{
font-weight: 600;
}
&__name{
font-size: 10px;
color: rgb(140,140,140);
}
}
}
}
&>div{
flex: 1;
margin-right: 20px;
&:last-child{
margin-right: 0;
}
}
}
.chart{
display: flex;
margin-top: 50px;
#col-chart {
background: #fff;
border-radius: 10px;
flex: 1;
height: 300px;
margin-right: 30px;
}
#line-chart {
background: #fff;
border-radius: 10px;
flex: 1;
height: 300px;
}
}
</style>

@ -108,6 +108,23 @@
</div>
</template>
<template v-slot:account_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>结算对象
</div>
<div class="xy-table-item-content">
<el-select
v-model="form.account_id"
v-load-more="productLoad"
placeholder="请选择结算对象"
style="width: 300px">
<el-option v-for="item in accounts" :key="item.id" :label="item.value" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:status>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -131,6 +148,12 @@ import {getList as customList} from '@/api/customer'
import {getList as productList} from '@/api/product'
import {save,getForm} from '@/api/order'
export default {
props:{
accounts:{
type:Array,
default:()=>[]
}
},
data() {
return {
id: '',
@ -191,6 +214,7 @@ export default {
unit_price: '',
total_time: '',
total_money: '',
account_id:'',
status: '',
},
rules: {
@ -217,6 +241,9 @@ export default {
],
status:[
{required: true, message: '请选择状态'}
],
account_id:[
{required: true, message: '请选择结算对象'}
]
}
}
@ -231,6 +258,7 @@ export default {
unit_price: '',
total_time: '',
total_money: '',
account_id: '',
status: '',
}
},

@ -0,0 +1,125 @@
<template>
<div>
<xy-dialog
ref="dialog"
:is-show.sync="isShow"
type="form"
:title="type === 'add' ? '新增第三方结算对象' : '编辑第三方结算对象'"
:form="form"
:rules="rules"
@submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" clearable placeholder="请输入分类名称" style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:product_type_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>业务板块
</div>
<div class="xy-table-item-content">
<el-select v-model="form.product_type_id" placeholder="请选择业务板块" style="width: 300px;">
<el-option v-for="item in types" :value="item.id" :label="item.name" :key="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:area_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>所属区域
</div>
<div class="xy-table-item-content">
<el-select v-model="form.area_id" placeholder="请选择所属区域" style="width: 300px;">
<el-option v-for="item in areas" :value="item.id" :label="item.value" :key="item.id"></el-option>
</el-select>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {save,getForm} from '@/api/payUnit'
export default {
props:{
areas:{
type:Array,
default:()=>[]
},
types:{
type:Array,
default:()=>[]
}
},
data() {
return {
isShow:false,
id:'',
type:'',
form:{
name:'',
product_type_id:'',
area_id:'',
},
rules:{
name:[
{required:true,message:'请填写名称'}
]
}
}
},
methods: {
async getDetail(){
const res = await getForm(this.id)
this.$integrateData(this.form,res)
},
submit(){
if(this.type === 'editor'){
Object.defineProperty(this.form,'id',{
value:this.id,
enumerable:true,
configurable:true,
writable:true
})
}
save(this.form).then(res => {
this.$successMessage(this.type,'结算对象')
this.isShow = false
this.$emit('refresh')
})
}
},
watch:{
isShow(val){
if(val){
if(this.type === 'editor'){
this.getDetail()
}
}else{
this.id = ''
this.type = ''
this.$refs['dialog'].reset()
delete this.form.id
}
}
}
}
</script>
<style scoped lang="scss">
::v-deep .el-input__inner{
text-align: left;
}
</style>

@ -0,0 +1,91 @@
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="第三方结算对象">
<div slot="content"></div>
<slot>
<div>
<Input v-model="select.keyword" placeholder="关键字搜索" style="width: 200px; margin-right: 10px"/>
<Button style="margin-left: 10px" type="primary" @click="select.page = 1,getList()">查询</Button>
<Button style="margin-left: 10px" type="primary" @click="$refs['addobjects'].type = 'add',$refs['addobjects'].isShow = true">新建</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table
:total="total"
:list="list"
:table-item="table"
@editor="editor"
@delete="destroy"></xy-table>
<add ref="addobjects" @refresh="getList" :types="types" :areas="areas"/>
</div>
</template>
<script>
import {getList,destroy} from '@/api/payUnit'
import {getList as typeList} from '@/api/productType'
import {getparameter} from '@/api/system/dictionary'
import add from "./component/addobjects"
export default {
components:{
add
},
data() {
return {
select:{
page:1,
page_size:10,
keyword:''
},
types:[],
areas:[],
total:0,
list:[],
table:[]
}
},
methods: {
async getTypes(){
const res = await typeList({page:1,page_size:9999},false)
this.types = res.data
},
async getAreas(){
const res = await getparameter({number:'serveArea'},false)
this.areas = res.detail
},
async getList(){
const res = await getList(this.select)
this.total = res.total
this.list = res.data
console.log(this.list)
},
editor(row){
this.$refs['addobjects'].type = 'editor'
this.$refs['addobjects'].id = row.id
this.$refs['addobjects'].isShow = true
},
destroy(row){
destroy(row.id).then(res => {
this.$successMessage('destroy','')
this.getList()
})
}
},
mounted() {
this.getTypes()
this.getAreas()
this.getList()
}
}
</script>
<style scoped lang="scss">
</style>

@ -25,12 +25,13 @@
@pageSizeChange="e => select.page_size = e"
@pageIndexChange="e => {select.page = e;getOrder()}"></xy-table>
<add-order ref="addOrder" @refresh="getOrder"></add-order>
<add-order ref="addOrder" :accounts="accounts" @refresh="getOrder"></add-order>
</div>
</template>
<script>
import {getList,destroy} from '@/api/order'
import {getparameter} from '@/api/system/dictionary'
import addOrder from "@/views/order/component/addOrder";
export default {
@ -45,6 +46,7 @@ export default {
keyword:''
},
accounts:[],
total:0,
list:[
@ -125,6 +127,11 @@ export default {
}
},
methods: {
async getAccounts(){
const res = await getparameter({number:'accounts'})
this.accounts = res.detail
},
async getOrder(){
const res = await getList(this.select)
this.total = res.total
@ -145,6 +152,7 @@ export default {
}
},
mounted() {
this.getAccounts()
this.getOrder()
}
}

@ -55,7 +55,7 @@ export default {
{
prop:'name',
label:'名称',
width:200,
minWidth:200,
fixed:'left',
align:'left'
},

@ -2,165 +2,144 @@
<div v-if="detail">
<xy-dialog
ref="dialog"
:form="form"
:rules="rules"
:is-show.sync="isShow"
:width='84'
:width='72'
title="排班"
type="form"
@submit="submit"
type="normal"
@reset="pickType = 1,dateStartPick = '',dateEndPick = ''">
<template v-slot:extraFormTop>
<div :style="{
'display':'flex',
'align-items':'center',
'flex-wrap':'wrap',
'min-width':'380px'
}">
<el-form-item>
<div class="xy-table-item">
<div class="xy-table-item-label">
性别
</div>
<div class="xy-table-item-content">
<el-input v-model="detail.sex" readonly style="width: 300px;"></el-input>
</div>
</div>
</el-form-item>
<template>
<el-row type="flex" align="middle">
<el-col :span="4" :push="1">
姓名
</el-col>
<el-col :span="18">
<el-input v-model="detail.customer.name" readonly style="width: 300px;">
</el-input>
</el-col>
</el-row>
<el-form-item>
<div class="xy-table-item">
<div class="xy-table-item-label">
年龄
</div>
<div class="xy-table-item-content">
<el-input :value="ageComputed" readonly style="width: 300px;"></el-input>
</div>
</div>
</el-form-item>
<el-row type="flex" align="middle">
<el-col :span="4" :push="1">
性别
</el-col>
<el-col :span="18">
<el-input v-model="detail.customer.sex" readonly style="width: 300px;">
</el-input>
</el-col>
</el-row>
<el-form-item>
<div class="xy-table-item">
<div class="xy-table-item-label">
身份证号
</div>
<div class="xy-table-item-content">
<el-input :value="detail.idcard" readonly style="width: 300px;"></el-input>
</div>
</div>
</el-form-item>
<el-row type="flex" align="middle">
<el-col :span="4" :push="1">
身份证号
</el-col>
<el-col :span="18">
<el-input v-model="detail.customer.idcard" readonly style="width: 300px;">
</el-input>
</el-col>
</el-row>
<el-form-item>
<div class="xy-table-item">
<div class="xy-table-item-label">
失能等级
</div>
<div class="xy-table-item-content">
<el-select v-model="detail.level_id" disabled placeholder="请选择失能等级" style="width: 300px">
<el-option v-for="item in levels" :key="item.id" :label="item.value" :value="item.id"></el-option>
</el-select>
</div>
</div>
</el-form-item>
<el-form-item>
<div class="xy-table-item">
<div class="xy-table-item-label">
备注
</div>
<div class="xy-table-item-content">
<el-input v-model="detail.remark" :autosize="{minRows:2}" placeholder="请输入备注" readonly
style="width: 300px;"
type="textarea"></el-input>
</div>
</div>
</el-form-item>
</div>
</template>
<el-row type="flex" align="middle">
<el-col :span="4" :push="1">
年龄
</el-col>
<el-col :span="18">
<el-input :value="ageComputed" readonly style="width: 300px;">
</el-input>
</el-col>
</el-row>
<template v-slot:customer_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
客户
</div>
<div class="xy-table-item-content">
<el-select v-model="form.customer_id" disabled placeholder="请选择客户" style="width: 300px">
<el-option v-for="item in customers" :key="item.id" :label="item.name" :value="item.id"></el-option>
<el-row type="flex" align="middle">
<el-col :span="4" :push="1">
评估等级
</el-col>
<el-col :span="18">
<el-select v-model="detail.customer.level_id" disabled placeholder="请选择失能等级" style="width: 300px">
<el-option v-for="item in levels" :key="item.id" :label="item.value" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
</el-col>
</el-row>
<template v-slot:product_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
产品
</div>
<div class="xy-table-item-content">
<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>
<el-row type="flex" align="middle">
<el-col :span="4" :push="1">
上门地址
</el-col>
<el-col :span="18">
<el-input style="width: 300px;" readonly :value="defaultAddress(detail.customer.customer_address)"></el-input>
</el-col>
</el-row>
<template v-slot:account_id >
<div class="xy-table-item">
<div class="xy-table-item-label">
结算对象
</div>
<div class="xy-table-item-content">
<el-select v-model="form.account_id " placeholder="请选择结算对象" style="width: 300px">
<el-option v-for="item in accounts" :key="item.id" :label="item.value" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<el-row type="flex" align="middle">
<el-col :span="4" :push="1">
备注
</el-col>
<el-col :span="18">
<el-input style="width: 300px;" v-model="detail.customer.remark" readonly></el-input>
</el-col>
</el-row>
<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:schedule_list_skus>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>关联服务
</div>
<div class="xy-table-item-content">
<el-select v-model="form.schedule_list_skus" style="width: 300px;" placeholder="请选择关联服务" multiple value-key="sku_id">
<el-option v-for="(item,index) in skus" :value="{sku_id:item.id}" :label="item.name" :key="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:extraFormBottom>
<el-calendar>
<template v-slot:dateCell="{date, data}">
<div style="display:flex;flex-direction: column;justify-content: center;align-items: center;width: 100%;height: 100%">
<div>{{data.day}}</div>
<i class="el-icon-plus" style="font-size: 22px;padding:10px;"></i>
<div @click="datePick(date,data)" style="display:flex;flex-direction: column;justify-content: center;align-items: center;width: 100%;height: 100%">
<div>{{timeFormat(date)}}</div>
<template v-if="data.type === 'current-month'">
<i class="el-icon-plus" style="padding:10px;"></i>
</template>
<template v-if="scheduleCount(data.day)">
<Poptip transfer trigger="hover" title="当日排班" width="520" content="content" >
<template v-slot:default>
<div class="schedule-num">{{scheduleCount(data.day).length}}</div>
</template>
<template v-slot:content>
<xy-table :is-page="false" :height="220" :list="scheduleCount(data.day)" :table-item="table">
<template v-slot:btns>
<el-table-column label="操作" width="70">
<template v-slot:default="scope">
<Poptip
:transfer="true"
confirm
title="确认要删除吗?"
@on-ok="destroySchedule(scope.row)">
<Button size="small" type="primary" ghost>删除</Button>
</Poptip>
</template>
</el-table-column>
</template>
</xy-table>
</template>
</Poptip>
</template>
</div>
</template>
</el-calendar>
</template>
<template v-slot:footerContent>
<Button type="primary" @click="isShow = false">确认</Button>
</template>
</xy-dialog>
<timeSelect
:is-show.sync="isShowTime"
:nurses="nurses"
:skus="skus"
:date="date"
:order-id="detail.id"
:product-id="detail.product.id"
:customer-id="detail.customer.id"></timeSelect>
</div>
</template>
<script>
import {customerDetail,scheduleSave} from '@/api/schedule'
import {parseTime} from '@/utils'
import {customerDetail,scheduleDelete} from '@/api/schedule'
import timeSelect from "@/views/schedule/component/timeSelect";
export default {
components:{
timeSelect
},
props: {
customers: {
type: Array,
@ -178,71 +157,68 @@ export default {
type: Array,
default: () => []
},
orders:{
type: Array,
default: () => []
},
skus:{
type: Array,
default: () => []
},
accounts:{
type: Array,
default: () => []
}
},
data() {
return {
productId: '',
customerId: '',
isShow: false,
isShowTime:false,
date:'',
detail: {},
detail: '',
schedules:[],
dateStartPick:'',
dateEndPick:'',
pickType:1,
form: {
customer_id: '',
product_id: '',
account_id:'',
order_id: '',
start_time: '',
end_time: '',
nurse_id: '',
schedule_list_skus:[],
},
rules:{
product_id:[
{required:true,message:'请选择产品'}
],
order_id:[
{required:true,message:'请选择订单'}
],
start_time:[
{required:true,message:'请选择开始时间'}
],
end_time:[
{required:true,message:'请选择结束时间'}
]
}
table:[
{
label:'护工',
prop:'nurse_id',
minWidth:120,
sortable:false
},
{
label:'护理时间',
width:310,
sortable: false,
customFn:(row)=>{
return (
<div>{row.start_time} {row.end_time}</div>
)
}
}
]
}
},
methods: {
datePick(date,data){
console.log(date,data)
if(data.type === 'current-month'){
this.date = data.day
this.isShowTime = true
}
},
async getCustomer() {
const res = await customerDetail({
product_id: this.form.product_id,
id: this.form.customer_id,
product_id: this.detail.product.id,
id: this.detail.customer.id,
})
console.log(res)
this.detail = res.detail
this.schedules = res.detail.schedule
},
dateConfirm(data){
if(this.pickType === 1){
this.pickType = 2
return
}
this.$refs[`popover-${data.day}`].doClose()
destroySchedule(row){
scheduleDelete({id:row.id}).then(res => {
this.$successMessage('destroy','排班')
this.getCustomer()
})
},
datePicked(data,date){
if(this.pickType === 1){
@ -252,38 +228,46 @@ export default {
this.dateEndPick = data.day
}
},
submit() {
this.form.start_time = `${this.dateStartPick} ${this.form.start_time}`
this.form.end_time = `${this.dateEndPick || this.dateStartPick} ${this.form.end_time}`
scheduleSave(this.form).then(res => {
this.$successMessage('排班','')
this.isShow = false
})
}
},
computed: {
ageComputed() {
return new Date().getFullYear() - new Date(this.detail.birthday).getFullYear()
return new Date().getFullYear() - new Date(this.detail.customer.birthday).getFullYear()
},
defaultAddress(){
return function (adds){
if(!adds instanceof Array){
return '无地址'
}
return adds.filter(item => {
return item.default === 1
})[0]?.address || adds[0]?.address || '无地址'
}
},
timeFormat(){
return function (data,format='{dd}'){
return parseTime(data,format)
}
},
isInDate(){
scheduleCount(){
return function (day){
let startTimer = new Date(this.dateStartPick).getTime()
let endTimer = new Date(this.dateEndPick).getTime()
let dayTimer = new Date(day).getTime()
return dayTimer >= startTimer && dayTimer <= endTimer
let arr = this.schedules.filter(item => {
return day === item.date
})
if(arr.length > 0){
return arr
}
}
}
},
watch: {
isShow(val) {
if (val) {
//this.getCustomer()
this.getCustomer()
} else {
this.pickType = 1
this.dateEndPick = ''
this.dateStartPick = ''
this.$refs['dialog'].reset()
this.orderId = ''
this.productId = ''
this.date = ''
}
}
}
@ -299,4 +283,19 @@ export default {
::v-deep .el-calendar-day{
padding: 0 !important;
}
::v-deep .el-row {
margin-bottom: 20px;
&:last-child {
margin-bottom: 0;
}
}
.schedule-num{
width: 18px;
height: 18px;
line-height: 18px;
text-align: center;
color: #fff;
background: $primaryColor;
border-radius: 100%;
}
</style>

@ -0,0 +1,144 @@
<template>
<div>
<Modal :value="isShow" title="排班" width="48" @on-visible-change="e => $emit('update:isShow',e)">
<template v-slot:default>
<el-form ref="elForm" :model="form" :rules="rules" label-width="80px">
<el-form-item label="时间选择" prop="end_time">
<div style="font-weight: 600">{{ date }}</div>
<el-time-picker
v-model="time"
arrow-control
end-placeholder="结束时间"
is-range
placeholder="选择时间范围"
range-separator="-"
start-placeholder="开始时间"
style="width: 300px;"
value-format="hh:mm:ss"
@change="timePick">
</el-time-picker>
</el-form-item>
<el-form-item label="护工选择" prop="nurse_id">
<el-select v-model="form.nurse_id" placeholder="请选择护工" style="width: 300px;">
<el-option v-for="(item,index) in nurses" :key="item.index" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="服务项目" prop="schedule_list_skus">
<el-checkbox-group v-model="form.schedule_list_skus">
<template v-for="(item) in skus">
<el-checkbox :label="item.id">{{ item.name }}</el-checkbox>
</template>
</el-checkbox-group>
</el-form-item>
</el-form>
</template>
<template v-slot:footer>
<Button @click="$emit('update:isShow',false)"></Button>
<Button type="primary" @click="submit"></Button>
</template>
</Modal>
</div>
</template>
<script>
import {parseTime} from '@/utils'
import {scheduleSave} from '@/api/schedule'
export default {
props: {
customerId: [Number, String],
orderId: [Number, String],
productId: [Number, String],
date: {
type: String,
default: ''
},
isShow: {
type: Boolean,
default: false
},
skus: {
type: Array,
default: () => []
},
nurses: {
type: Array,
default: () => []
}
},
data() {
return {
form: {
customer_id: '',
product_id: '',
order_id: '',
nurse_id: '',
start_time:'',
end_time: '',
schedule_list_skus: []
},
time: [new Date(),new Date()],
rules: {
nurse_id: [
{required: true, message: '请选择护工'}
],
start_time: [
{required: true, message: '请选择开始时间'}
],
end_time: [
{required: true, message: '请选择结束时间'}
],
schedule_list_skus: [
{required: true, message: '请选择护理项目'}
]
}
}
},
methods: {
timePick(e) {
this.form.start_time = `${this.date} ${e[0]}`
this.form.end_time = `${this.date} ${e[1]}`
},
submit() {
this.form.customer_id = this.customerId
this.form.product_id = this.productId
this.form.order_id = this.orderId
let temp = this.form.schedule_list_skus.map(item => {
return {sku_id: item}
})
this.form.schedule_list_skus = temp
this.$refs['elForm'].validate().then(valid => {
console.log(valid)
if (valid) {
scheduleSave(this.form).then(res => {
this.$successMessage('add', '排班')
this.$emit('update:isShow', false)
}).catch(err => {
this.$emit('update:isShow', false)
})
}
})
}
},
watch: {
isShow(val) {
if(val){
this.form.start_time = `${this.date} ${parseTime(new Date(),'{h}:{i}:{s}')}`
this.form.end_time = `${this.date} ${parseTime(new Date(),'{h}:{i}:{s}')}`
}else{
this.$refs['elForm'].resetFields()
}
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .el-form-item__error {
transform: none !important;
left: 0 !important;
}
</style>

@ -5,12 +5,44 @@
<div slot="content"></div>
<slot>
<div style="display: flex">
<el-tag effect="dark" style="margin-right: 10px;" type="warning">应排客户</el-tag>
<el-tag effect="dark" style="margin-right: 10px;" type="success">已排客户</el-tag>
<Input placeholder="关键字搜索" style="width: 200px; margin-right: 10px"/>
<Button style="margin-right: 10px" type="primary" @click="select.page = 1,getCustomers">查询</Button>
<xy-selectors>
<el-tag effect="dark" style="margin-right: 10px;" type="warning">应排客户{{statistics.need}}</el-tag>
<el-tag effect="dark" style="margin-right: 10px;" type="success">已排客户{{statistics.use}}</el-tag>
<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>
<xy-selectors @search="select.page = 1,getCustomerList()" @reset="reset">
<template>
<div class="select-item">
<div class="select-item__label">业务板块</div>
<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-select>
</div>
<div class="select-item">
<div class="select-item__label">所属区域</div>
<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-select>
</div>
<div class="select-item">
<div class="select-item__label">所属月份</div>
<el-date-picker
v-model="select.month"
type="month"
value-format="yyyy-MM"
placeholder="选择月"
style="width: 200px">
</el-date-picker>
</div>
<div class="select-item">
<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="2"></el-radio>
<el-radio v-model="select.schedule_status" label=""></el-radio>
</div>
</template>
</xy-selectors>
</div>
</slot>
@ -38,17 +70,17 @@
:nurses="nurses"
:levels="levels"
:orders="orders"
:skus="skus" :accounts="accounts"></add-schedule>
:skus="skus"></add-schedule>
</div>
</template>
<script>
import {customerList} from '@/api/schedule'
import {getList as customerIndex} from '@/api/customer'
import {getList as productIndex} from '@/api/product'
import {getList as nurseIndex} from '@/api/worker'
import {getparameter} from '@/api/system/dictionary'
import {getList as skuIndex} from '@/api/sku'
import {getList as typeIndex} from '@/api/productType'
import addSchedule from "@/views/schedule/component/addSchedule";
@ -61,6 +93,15 @@ export default {
select: {
page: 1,
page_size: 10,
keyword:'',
product_type_id:'',
area_id:'',
month:'',
schedule_status:'',
},
statistics:{
use:0,
need:0
},
customers:[],
products:[],
@ -69,6 +110,8 @@ export default {
orders:[],
skus:[],
accounts:[],
types:[],
areas:[],
total: 0,
list: [],
@ -79,7 +122,7 @@ export default {
fixed:'left'
},
{
prop: 'name',
prop: 'customer.name',
label: '客户',
width: 180,
fixed:'left'
@ -88,9 +131,14 @@ export default {
label:'产品',
width: 200,
align:'left',
customFn:(row)=>{
prop:'product.name'
},
{
label:'上门区域',
width: 200,
customFn:(row) => {
return (
<div>{row.orders[0]?.product.name}</div>
<div>{row.customer.area_detail?.value}</div>
)
}
},
@ -100,9 +148,9 @@ export default {
minWidth: 320,
align: 'left',
customFn: (row) => {
let add = row.customer_address.filter(item => {
let add = row.customer.customer_address.filter(item => {
return item.default === 1
})[0]?.address || row.customer_address[0]?.address || '无地址'
})[0]?.address || row.customer.customer_address[0]?.address || '无地址'
return (
<div>{add}</div>
)
@ -111,37 +159,26 @@ export default {
{
label: '应服务次数',
width: 120,
customFn: (row) => {
let total = 0;
row.orders.map(item => {
total += item.service_times
})
return (
<div>
{
total
}
</div>
)
}
prop:'service_times'
},
{
label: '已排班',
width: 120
width: 120,
prop:'schedule_count'
},
{
label:'排班状态',
width: 140,
}
]
}
},
methods: {
async getAccounts(){
const res = await getparameter({number:'account'})
this.accounts = res.detail
async getAreas(){
const res = await getparameter({number : 'changzhou'},false)
this.areas = res.detail
},
async getTypes(){
const res = await typeIndex({page_size:9999,page:1},false)
this.types = res.data
},
async getSkus(){
@ -149,10 +186,6 @@ export default {
this.skus = res.data
},
async getCustomers(){
const res = await customerIndex({page_size:9999,page:1},false)
this.customers = res.data.data
},
async getProducts(){
const res = await productIndex({page_size:9999,page:1},false)
this.products = res.data
@ -168,28 +201,49 @@ export default {
async getCustomerList() {
const res = await customerList(this.select)
this.total = res.total
this.list = res.data
this.total = res.list.total
this.list = res.list.data
this.statistics.need = res.need_count
this.statistics.use = res.use_count
},
reset(){
this.select = {
page: 1,
page_size: 10,
keyword:'',
product_type_id:'',
area_id:'',
month:'',
schedule_status:'',
}
},
schedule(row){
this.$refs['addSchedule'].detail = row
this.$refs['addSchedule'].form.customer_id = row.id
this.orders = row.orders
this.$refs['addSchedule'].isShow = true
}
},
mounted() {
this.getCustomers()
this.getTypes()
this.getProducts()
this.getNurses()
this.getLevels()
this.getCustomerList()
this.getSkus()
this.getAccounts()
this.getAreas()
}
}
</script>
<style lang="scss" scoped>
.select-item{
display: flex;
align-items: center;
&__label{
width: 100px;
padding: 10px 10px;
}
}
</style>

Loading…
Cancel
Save