master
271556543@qq.com 3 years ago
parent ce640e71ed
commit fa72a54964

@ -1,10 +1,11 @@
import request from "@/utils/request";
export function getList(params){
export function getList(params,isLoading=true){
return request({
method:'get',
url:'/api/admin/customer/get-list',
params
params,
isLoading
})
}

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

@ -1,10 +1,11 @@
import request from "@/utils/request";
export function getList(params){
export function getList(params,isLoading = true){
return request({
method:'get',
url:'/api/admin/product/get-list',
params
params,
isLoading
})
}

@ -0,0 +1,33 @@
import request from "@/utils/request";
export function customerList(params){
return request({
method:'get',
url:'/api/admin/schedule/customer-list',
params
})
}
export function customerDetail(params){
return request({
method:'get',
url:'/api/admin/schedule/customer-detail',
params
})
}
export function scheduleSave(params){
return request({
method:'get',
url:'/api/admin/schedule/schedule-save',
params
})
}
export function scheduleDelete(data){
return request({
method:'post',
url:'/api/admin/schedule/schedule-delete',
data
})
}

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

@ -1,10 +1,11 @@
import request from "@/utils/request";
export function getList(params){
export function getList(params,isLoading=true){
return request({
method:'get',
url:'/api/admin/nurse/get-list',
params
params,
isLoading
})
}

@ -285,10 +285,12 @@ export default {
prop={item.prop}
sortable={item.sortable ?? true}
type={item.type}
selectable={item.selectable}>
{
item.type === 'expand' ? item.expandFn(this.list[index]) : ''
}
selectable={item.selectable}
scopedSlots={item.type === 'expand' ? {
default(props){
return item.expandFn(props)
}
} : ''}>
</el-table-column>
)
}

@ -47,6 +47,18 @@ Vue.config.productionTip = false
import avue from '@smallwei/avue'
import '@smallwei/avue/lib/index.css';
Vue.use(avue)
Vue.directive('loadMore', {
bind(el, binding) {
const selectWrap = el.querySelector('.el-scrollbar__wrap')
selectWrap.addEventListener('scroll', function () {
let sign = 0
const scrollDistance = this.scrollHeight - this.scrollTop - this.clientHeight
if (scrollDistance <= sign) {
binding.value()
}
})
}
})
import LxHeader from "@/components/LxHeader"
Vue.component('lx-header',LxHeader)

@ -43,18 +43,17 @@ export default {
table:[
{
type:'expand',
fixed:'left',
expandFn:(props)=>{
return (
<el-form label-width="120px" label-position="right" className="demo-table-expand">
<el-form-item label="名称">
<span>{props?.name}</span>
<span>{props?.row.name}</span>
</el-form-item>
<el-form-item label="服务购买方">
<span>{props?.buy_name}</span>
<span>{props?.row.buy_name}</span>
</el-form-item>
<el-form-item label="服务流程">
<span>{props?.flow}</span>
<span>{props?.row.flow}</span>
</el-form-item>
</el-form>
)
@ -62,8 +61,7 @@ export default {
},
{
type:'index',
width: 60,
fixed:'left'
width: 60
},
{
prop:'name',

@ -50,31 +50,43 @@ export default {
list: [],
tableItem: [
{
prop: "id",
label: "序号"
prop: "name",
label: "姓名",
width: "180"
},
{
prop: "name",
label: "申请人",
minWidth: "180"
prop: "idcard",
label: "身份证号",
width: "220"
},
{
prop: "real_address",
label: "居住信息",
minWidth: "190"
prop: "phone",
label: "手机号",
width: "160"
},
{
prop: "insurance_count",
label: "其他信息",
width: "120"
label: "委托人",
width: "180",
prop:'contact_name'
},
{
label: "委托人信息",
width: "180"
label: "委托人电话",
width: "160",
prop:'contact_phone'
},
{
prop:'idcard_address',
label:'户籍地址',
width: 140
},
{
label:'默认上门地址',
minWidth:300
},
{
label: "销售",
width: "140"
label:'上门地址数',
prop:'customer_address_count',
width: 140
}
]
}

@ -0,0 +1,277 @@
<template>
<div>
<xy-dialog
ref="dialog"
:form="form"
:is-show.sync="isShow"
:rules="rules"
:title="type === 'add' ? '新增订单' : '编辑订单'"
type="form"
@submit="submit">
<template v-slot:customer_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.customer_id"
v-load-more="customLoad"
placeholder="请选择客户"
style="width: 300px">
<el-option v-for="item in customers" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:product_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_id"
v-load-more="productLoad"
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:date>
<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-date-picker
v-model="form.date"
end-placeholder="结束时间"
start-placeholder="开始时间"
style="width: 300px;"
type="daterange"
value-format="yyyy-MM-dd"></el-date-picker>
</div>
</div>
</template>
<template v-slot:service_times>
<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-number v-model="form.service_times" :controls="false" :precision="0" clearable
placeholder="请输入服务次数" style="width: 300px;"/>
</div>
</div>
</template>
<template v-slot:unit_price>
<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 xy-table-item-price">
<el-input-number v-model="form.unit_price" :controls="false" :precision="2" clearable
placeholder="请输入单次单价" style="width: 300px;"/>
</div>
</div>
</template>
<template v-slot:total_time>
<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.total_time" clearable
placeholder="请输入总计时长" style="width: 300px;"/>
</div>
</div>
</template>
<template v-slot:total_money>
<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.total_money" clearable
placeholder="请输入总计金额" style="width: 300px;"/>
</div>
</div>
</template>
<template v-slot:status>
<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">
<div style="width: 300px;display: flex;">
<el-radio v-model="form.status" :label="0"></el-radio>
<el-radio v-model="form.status" :label="1"></el-radio>
<el-radio v-model="form.status" :label="2"></el-radio>
</div>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {getList as customList} from '@/api/customer'
import {getList as productList} from '@/api/product'
import {save,getForm} from '@/api/order'
export default {
data() {
return {
id: '',
type: '',
isShow: false,
customers: [],
customSelect: {
page: 1,
page_size: 10
},
products: [],
productSelect: {
page: 1,
page_size: 10
},
form: {
customer_id: '',
product_id: '',
date: '',
service_times: '',
unit_price: '',
total_time: '',
total_money: '',
status: '',
},
rules: {}
}
},
methods: {
initForm(){
this.form = {
customer_id: '',
product_id: '',
date: '',
service_times: '',
unit_price: '',
total_time: '',
total_money: '',
status: '',
}
},
customLoad() {
this.customSelect.page++
this.getCustomers()
},
async getCustomers() {
const res = await customList(this.customSelect, false)
if (res.data.data.length === 0) {
this.customSelect.page--
this.$message({
type: 'warning',
message: '没有跟多客户了'
})
return
}
this.customers.push(...res.data.data)
},
productLoad() {
this.productSelect.page++
this.getProducts()
},
async getProducts() {
const res = await productList(this.productSelect, false)
if (res.data.length === 0) {
this.productSelect.page--
this.$message({
type: 'warning',
message: '没有跟多产品了'
})
return
}
this.products.push(...res.data)
},
async getDetail(){
const res = await getForm(this.id)
this.$integrateData(this.form,res)
this.form.date = [res.start_date,res.end_date]
},
submit() {
console.log(this.form)
Object.defineProperty(this.form,'start_date',{
value:this.form.date[0],
enumerable:true,
writable:true,
configurable:true
})
Object.defineProperty(this.form,'end_date',{
value:this.form.date[1],
enumerable:true,
writable:true,
configurable:true
})
delete this.form.date
if(this.type === 'editor'){
Object.defineProperty(this.form,'id',{
value:this.id,
enumerable:true,
writable:true,
configurable:true
})
}
save(this.form).then(res => {
this.$successMessage(this.type,'订单')
this.isShow = false
this.$emit('refresh')
})
}
},
watch: {
isShow(val) {
if (val) {
this.getCustomers()
this.getProducts()
if(this.type === 'editor'){
this.getDetail()
}
} else {
this.customers = []
this.products = []
this.id = ''
this.type = ''
this.$refs['dialog'].reset()
this.initForm()
}
}
},
}
</script>
<style lang="scss" scoped>
.xy-table-item-label {
width: 160px;
}
::v-deep .el-input__inner {
text-align: left;
}
</style>

@ -0,0 +1,150 @@
<template>
<div>
<!--查询-->
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="订单列表" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Input v-model="select.keyword" style="width: 200px; margin-right: 10px" placeholder="关键字搜索" />
<Button type="primary" style="margin-left: 10px" @click="getOrder"></Button>
<Button type="primary" style="margin-left: 10px" @click="$refs['addOrder'].type = 'add',$refs['addOrder'].isShow = true">创建订单</Button>
</div>
</slot>
</lx-header>
</div>
</div>
<xy-table
:total="total"
:table-item="table"
:list="list"
@editor="editor"
@destroy="destroy"
@pageSizeChange="e => select.page_size = e"
@pageIndexChange="e => {select.page = e;getOrder()}"></xy-table>
<add-order ref="addOrder" @refresh="getOrder"></add-order>
</div>
</template>
<script>
import {getList,destroy} from '@/api/order'
import addOrder from "@/views/order/component/addOrder";
export default {
components:{
addOrder
},
data() {
return {
select:{
page:1,
page_size:10,
keyword:''
},
total:0,
list:[
],
table:[
{
prop:'no',
width:220,
label:'订单编号'
},
{
prop:'customer.name',
label:'客户',
width:180
},
{
prop:'product.name',
label:'产品',
width: 200,
align:'left'
},
{
prop:'start_date',
label:'开始时间',
width: 200
},
{
prop:'end_date',
label:'结束时间',
width: 200,
formatter:(cell,data,value) => {
if(value) return value
return '未定'
}
},
{
prop:'unit_price',
label:'单次价格',
width: 180,
align:'right'
},
{
prop:'total_time',
label:'总计时长',
width: 180
},
{
prop:'total_money',
label:'总计金额',
width: 180,
align:'right'
},
{
prop:'status',
label:'执行状态',
width: 160,
customFn:(row)=>{
let statusName = new Map([
[0,'未开始'],
[1,'进行中'],
[2,'已完成'],
])
let statusColor = new Map([
[0,'blue'],
[1,'red'],
[2,'green'],
])
return (
<div style={{'color':statusColor.get(row.status)}}>{statusName.get(row.status)}</div>
)
}
}
]
}
},
methods: {
async getOrder(){
const res = await getList(this.select)
this.total = res.total
this.list = res.data
console.log(this.list)
},
editor(row){
this.$refs['addOrder'].type = 'editor'
this.$refs['addOrder'].id = row.id
this.$refs['addOrder'].isShow = true
},
destroy(row){
destroy(row.id).then(res => {
this.$successMessage('destroy','订单')
this.getOrder()
})
}
},
mounted() {
this.getOrder()
}
}
</script>
<style scoped lang="scss">
</style>

@ -1,45 +0,0 @@
<template>
<div style="padding: 0px 20px">
<!--查询-->
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="订单列表" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" placeholder="关键字搜索" />
<Button type="primary" style="margin-left: 10px">查询</Button>
<Button type="primary" style="margin-left: 10px" @click="isShowAdd = true">创建订单</Button>
</div>
</slot>
</lx-header>
</div>
</div>
<xy-table :table-item="tableItem"></xy-table>
</div>
</template>
<script>
export default {
data() {
return {
tableItem:[{
label:"名称"
},{
label: "地址"
},{
label: "站长"
},{
label: "联系电话"
}]
}
},
methods: {},
}
</script>
<style scoped lang="scss">
</style>

@ -1,42 +0,0 @@
<template>
<div style="padding: 0px 20px">
<!--查询-->
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="产品分类" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" placeholder="关键字搜索" />
<Button type="primary" style="margin-left: 10px">查询</Button>
<Button type="primary" style="margin-left: 10px" @click="isShowAdd = true">创建产品类别</Button>
</div>
</slot>
</lx-header>
</div>
</div>
<xy-table :table-item="tableItem"></xy-table>
</div>
</template>
<script>
export default {
data() {
return {
isShowAdd:false,
tableItem:[{
label:"名称"
},{
label: "排序"
}]
}
},
methods: {},
}
</script>
<style scoped lang="scss">
</style>

@ -116,7 +116,7 @@
</template>
<script>
import {save} from '@/api/product'
import {save,getForm} from '@/api/product'
export default {
props: {
@ -178,8 +178,21 @@ export default {
}
},
methods: {
async getDetail(){
const res = await getForm(this.id)
this.$integrateData(this.form,res)
},
submit() {
this.form.product_sku_list = `[${this.form.product_sku_list.toString()}]`
// this.form.product_sku_list = `[${this.form.product_sku_list.toString()}]`
if(this.type === 'editor'){
Object.defineProperty(this.form,'id',{
value:this.id,
writable:true,
configurable:true,
enumerable:true
})
}
save(this.form).then(res => {
this.$successMessage(this.type, '产品')
this.$emit('refresh')
@ -190,10 +203,14 @@ export default {
watch: {
isShow(val) {
if (val) {
if(this.type === 'editor'){
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.$refs['dialog'].reset()
delete this.form.id
}
}
}

@ -17,14 +17,21 @@
</div>
</div>
<xy-table></xy-table>
<xy-table
:total="total"
:list="list"
:table-item="table"
@delete="destroy"
@editor="editor"
@pageSizeChange="e => select.page_size = e"
@pageIndexChange="e => {select.page = e;getList()}"></xy-table>
<add-product ref="addProduct" :product-sku="productSku" :product-type="productType"></add-product>
</div>
</template>
<script>
import {getList} from '@/api/product'
import {getList,destroy} from '@/api/product'
import {getparameter} from '@/api/system/dictionary'
import {getList as getTypes} from '@/api/productType'
@ -36,18 +43,64 @@ export default {
},
data() {
return {
isShowAdd: false,
select:{
page:1,
page_size:10
},
productType: [],
productSku: [],
total:0,
list: [],
table: []
table: [
{
prop:'name',
label:'名称',
width:200,
fixed:'left',
align:'left'
},
{
prop:'product_type.name',
label:'业务板块',
width: 160
},
{
prop:'cycle',
label:'服务周期',
width: 160
},
{
prop:'purchase_price',
label:'采购单价',
align:'right',
width: 200
},
{
prop:'nurse_price',
label:'护工服务单价',
align:'right',
width:200
},
{
prop:'time_lenth',
label:'单次时长',
width: 160
},
{
prop:'',
label:'服务菜单明细',
minWidth:220
}
]
}
},
methods: {
async getList() {
const res = await getList()
console.log(res)
const res = await getList(this.select)
this.list = res.data
this.total = res.total
console.log(this.list)
},
async getProductType() {
const res = await getTypes({page_size: 999})
@ -56,6 +109,18 @@ export default {
async getProductSku() {
const res = await getparameter({number: 'productSku'})
this.productSku = res.detail
},
editor(row){
this.$refs['addProduct'].type = 'editor'
this.$refs['addProduct'].id = row.id
this.$refs['addProduct'].isShow = true
},
destroy(row){
destroy(row.id).then(res => {
this.$successMessage('destroy','订单')
this.getList()
})
}
},
mounted() {

@ -1,42 +0,0 @@
<template>
<div style="padding: 0px 20px">
<!--查询-->
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="服务项目" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" placeholder="关键字搜索" />
<Button type="primary" style="margin-left: 10px">查询</Button>
<Button type="primary" style="margin-left: 10px" @click="isShowAdd = true">创建服务项目</Button>
</div>
</slot>
</lx-header>
</div>
</div>
<xy-table :table-item="tableItem"></xy-table>
</div>
</template>
<script>
export default {
data() {
return {
isShowAdd:false,
tableItem:[{
label:"名称"
},{
label: "分类"
}]
}
},
methods: {},
}
</script>
<style scoped lang="scss">
</style>

@ -1,42 +0,0 @@
<template>
<div style="padding: 0px 20px">
<!--查询-->
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="服务项目分类" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" placeholder="关键字搜索" />
<Button type="primary" style="margin-left: 10px">查询</Button>
<Button type="primary" style="margin-left: 10px" @click="isShowAdd = true">创建服务项目分类</Button>
</div>
</slot>
</lx-header>
</div>
</div>
<xy-table :list="[]" :table-item="tableItem"></xy-table>
</div>
</template>
<script>
export default {
data() {
return {
isShowAdd:false,
tableItem:[{
label:"名称"
},{
label:"排序"
}]
}
},
methods: {},
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,46 @@
<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 placeholder="关键字搜索" style="width: 200px; margin-right: 10px"/>
<Button style="margin-left: 10px" type="primary">查询</Button>
<Button style="margin-left: 10px" type="primary">新建产品
</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table></xy-table>
</div>
</template>
<script>
import {getList} from '@/api/skuCategory'
export default {
data() {
return {
total:0,
list:[],
table:[]
}
},
methods: {
async getSkuType(){
const res = await getList()
console.log(res)
this.total = res.total
this.list = res.data
}
},
mounted() {
this.getSkuType()
}
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,18 @@
<template>
<div>
<xy-dialog></xy-dialog>
</div>
</template>
<script>
export default {
data() {
return {}
},
methods: {},
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,183 @@
<template>
<div v-if="detail">
<xy-dialog
:width='84'
:form="form"
:is-show.sync="isShow"
title="排班"
type="form"
@submit="submit">
<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" style="width: 300px;" readonly></el-input>
</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 :value="ageComputed" style="width: 300px;" readonly></el-input>
</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 :value="detail.idcard" style="width: 300px;" readonly></el-input>
</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-select disabled placeholder="请选择失能等级" v-model="detail.level_id" style="width: 300px">
<el-option v-for="item in levels" :key="item.id" :value="item.id" :label="item.value"></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 readonly v-model="detail.remark" type="textarea" :autosize="{minRows:2}" style="width: 300px;" placeholder="请输入备注"></el-input>
</div>
</div>
</el-form-item>
</div>
</template>
<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 disabled placeholder="请选择客户" v-model="form.customer_id" style="width: 300px">
<el-option v-for="item in customers" :key="item.id" :value="item.id" :label="item.name"></el-option>
</el-select>
</div>
</div>
</template>
<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 disabled placeholder="请选择产品" v-model="form.product_id" style="width: 300px">
<el-option v-for="item in products" :key="item.id" :value="item.id" :label="item.name"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:extraFormBottom>
<el-calendar>
</el-calendar>
</template>
</xy-dialog>
</div>
</template>
<script>
import {customerDetail} from '@/api/schedule'
export default {
props:{
customers:{
type:Array,
default:()=>[]
},
products:{
type:Array,
default:()=>[]
},
nurses:{
type:Array,
default:()=>[]
},
levels:{
type:Array,
default:()=>[]
}
},
data() {
return {
productId: '',
customerId: '',
isShow: false,
detail:{
},
form: {
customer_id:'',
product_id:'',
order_id:'',
start_time:'',
end_time:'',
nurse_id:'',
}
}
},
methods: {
async getCustomer() {
const res = await customerDetail({
product_id: this.form.product_id,
id:this.form.customer_id,
})
console.log(res)
this.detail = res.detail
},
submit() {
}
},
computed:{
ageComputed(){
return new Date().getFullYear() - new Date(this.detail.birthday).getFullYear()
}
},
watch: {
isShow(val) {
if (val) {
this.getCustomer()
} else {
}
}
}
}
</script>
<style lang="scss" scoped>
</style>

@ -0,0 +1,201 @@
<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 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">查询</Button>
<xy-selectors>
</xy-selectors>
<Button type="primary">新建产品</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table
:default-expand-all="false"
:list="list"
:table-item="table"
:total="total">
<template v-slot:btns>
<div></div>
</template>
</xy-table>
<add-schedule
ref="addSchedule"
:products="products"
:customers="customers"
:nurses="nurses"
:levels="levels"></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 addSchedule from "@/views/schedule/component/addSchedule";
export default {
components: {
addSchedule
},
data() {
return {
select: {
page: 1,
page_size: 10,
},
customers:[],
products:[],
nurses:[],
levels:[],
total: 0,
list: [],
table: [
{
type: 'expand',
expandFn: (props) => {
let {$refs} = this
return (
<xy-table
is-page={false}
height={200}
list={props.row.orders}
table-item={
[
{
prop: 'no',
label: '订单编号',
width: 210,
sortable: false
},
{
prop: 'product.name',
label: '产品',
minWidth: 200,
sortable: false
},
{
label: '排班状态',
width: 160,
sortable: false
}
]
}
scopedSlots={{
btns() {
return (
<el-table-column
width={70}
header-align="center"
align="center"
label="操作"
scopedSlots={{
default(scope) {
return (
<Button
type="primary"
size="small"
on={{
['click']: () => {
$refs['addSchedule'].form.product_id = scope.row.product_id
$refs['addSchedule'].form.customer_id = scope.row.customer_id
$refs['addSchedule'].isShow = true
}
}}>排班</Button>
)
}
}}>
</el-table-column>
)
}
}}>
</xy-table>
)
}
},
{
prop: 'name',
label: '客户',
width: 180,
},
{
prop: '',
label: '上门地址',
minWidth: 320,
align: 'left',
customFn: (row) => {
let add = row.customer_address.filter(item => {
return item.default === 1
})[0]?.address || row.customer_address[0]?.address || '无地址'
return (
<div>{add}</div>
)
}
},
{
label: '应服务次数',
width: 120,
customFn: (row) => {
return (
<div>{row.orders.length}</div>
)
}
},
{
label: '已排班',
width: 120
}
]
}
},
methods: {
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
},
async getNurses(){
const res = await nurseIndex({page_size:9999,page:1},false)
this.nurses = res.data
},
async getLevels(){
const res = await getparameter({number:'disabilityLevel'})
this.levels = res.detail
},
async getCustomerList() {
const res = await customerList(this.select)
this.total = res.total
this.list = res.data
}
},
mounted() {
this.getCustomers()
this.getProducts()
this.getNurses()
this.getLevels()
this.getCustomerList()
}
}
</script>
<style lang="scss" scoped>
</style>
Loading…
Cancel
Save