|
|
|
|
@ -25,6 +25,7 @@
|
|
|
|
|
:total="total"
|
|
|
|
|
:list="list"
|
|
|
|
|
:table-item="tableItem"
|
|
|
|
|
:default-expand-all="false"
|
|
|
|
|
@pageSizeChange="e => select.page_size = e"
|
|
|
|
|
@pageIndexChange="e => {select.page = e;getCustomers()}">
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
@ -38,14 +39,14 @@
|
|
|
|
|
<Button size="small" type="error" ghost style="margin-right: 6px">删除</Button>
|
|
|
|
|
</Poptip>
|
|
|
|
|
<Button size="small" ghost type="primary" @click="editor(scope.row)" style="margin-right: 6px">编辑</Button>
|
|
|
|
|
<Button size="small" ghost type="primary" @click="$refs['addOrder'].isShow = true,$refs['addOrder'].form.customer_id = scope.row.id">录入</Button>
|
|
|
|
|
<Button size="small" type="primary" @click="$refs['addOrder'].isShow = true,$refs['addOrder'].form.customer_id = scope.row.id">录入</Button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
|
|
|
|
|
<addOrder ref="addOrder" :accounts="accounts"></addOrder>
|
|
|
|
|
<add-customer ref="addCustomer" :accounts="accounts" :cities="cities" :disability-level="disabilityLevel" @refresh="getCustomers"></add-customer>
|
|
|
|
|
<addOrder ref="addOrder" :types="types" :accounts="accounts"></addOrder>
|
|
|
|
|
<add-customer ref="addCustomer" :types="types" :accounts="accounts" :cities="cities" :disability-level="disabilityLevel" @refresh="getCustomers"></add-customer>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -53,7 +54,7 @@
|
|
|
|
|
import {getList,destroy} from '@/api/customer'
|
|
|
|
|
import {getparameter} from '@/api/system/dictionary'
|
|
|
|
|
import {getList as getUnit} from "@/api/payUnit";
|
|
|
|
|
|
|
|
|
|
import {getList as getTypes} from '@/api/productType'
|
|
|
|
|
|
|
|
|
|
import addCustomer from "@/views/customer/component/addCustomer";
|
|
|
|
|
import addOrder from './component/addOrder'
|
|
|
|
|
@ -72,10 +73,94 @@ export default {
|
|
|
|
|
disabilityLevel: [],
|
|
|
|
|
cities:[],
|
|
|
|
|
accounts:[],
|
|
|
|
|
types:[],
|
|
|
|
|
|
|
|
|
|
total: 0,
|
|
|
|
|
list: [],
|
|
|
|
|
tableItem: [
|
|
|
|
|
{
|
|
|
|
|
type:'expand',
|
|
|
|
|
expandFn:(props) => {
|
|
|
|
|
return (
|
|
|
|
|
<Table style={{'margin':'0 166px 0 40px'}}
|
|
|
|
|
width={1370}
|
|
|
|
|
stripe={true}
|
|
|
|
|
border={true}
|
|
|
|
|
size="small"
|
|
|
|
|
columns={
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
title:'订单编号',
|
|
|
|
|
key:'no',
|
|
|
|
|
width:220,
|
|
|
|
|
align:'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title:'订单产品',
|
|
|
|
|
width: 200,
|
|
|
|
|
align:'center',
|
|
|
|
|
render:(h,params)=>{
|
|
|
|
|
return h('div',params.row.product.name)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title:'时间',
|
|
|
|
|
width: 270,
|
|
|
|
|
align:'center',
|
|
|
|
|
render:(h,params)=>{
|
|
|
|
|
return h('div',[
|
|
|
|
|
h('span',params.row.start_date),
|
|
|
|
|
h('span',' ~ '),
|
|
|
|
|
h('span',params.row.end_date)
|
|
|
|
|
])
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title:'单次价格',
|
|
|
|
|
width: 180,
|
|
|
|
|
align:'right',
|
|
|
|
|
key:'unit_price'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title:'总计时长',
|
|
|
|
|
width: 160,
|
|
|
|
|
align: 'center',
|
|
|
|
|
key:'total_time'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title:'总计金额',
|
|
|
|
|
width: 190,
|
|
|
|
|
align:'right',
|
|
|
|
|
key:'total_money'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title:'执行状态',
|
|
|
|
|
align:'center',
|
|
|
|
|
render:(h,params)=>{
|
|
|
|
|
let statusName = new Map([
|
|
|
|
|
[0,'未开始'],
|
|
|
|
|
[1,'进行中'],
|
|
|
|
|
[2,'已完成'],
|
|
|
|
|
])
|
|
|
|
|
let statusColor = new Map([
|
|
|
|
|
[0,'blue'],
|
|
|
|
|
[1,'red'],
|
|
|
|
|
[2,'green'],
|
|
|
|
|
])
|
|
|
|
|
return h('div',{
|
|
|
|
|
style:{
|
|
|
|
|
color:statusColor.get(params.row.status)
|
|
|
|
|
}
|
|
|
|
|
},statusName.get(params.row.status))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
data={props?.row.orders}>
|
|
|
|
|
</Table>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
width: 40,
|
|
|
|
|
type:'index',
|
|
|
|
|
@ -85,7 +170,6 @@ export default {
|
|
|
|
|
prop: "name",
|
|
|
|
|
label: "姓名",
|
|
|
|
|
width: "180",
|
|
|
|
|
fixed:'left'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:'订单产品',
|
|
|
|
|
@ -154,21 +238,26 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async getDisabilityLevel() {
|
|
|
|
|
const res = await getparameter({number: 'disabilityLevel'})
|
|
|
|
|
const res = await getparameter({number: 'disabilityLevel'},false)
|
|
|
|
|
this.disabilityLevel = res.detail
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getCustomers() {
|
|
|
|
|
const res = await getList(this.select)
|
|
|
|
|
const res = await getList(this.select,false)
|
|
|
|
|
this.list = res.data.data
|
|
|
|
|
this.total = res.data.total
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getAccounts(){
|
|
|
|
|
const res = await getUnit({page:1,page_size:9999})
|
|
|
|
|
const res = await getUnit({page:1,page_size:9999},false)
|
|
|
|
|
this.accounts = res.data
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getTypes(){
|
|
|
|
|
const res = await getTypes({page:1,page_size:9999},false)
|
|
|
|
|
this.types = res.data
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getCity(){
|
|
|
|
|
let city = await getparameter({number: 'city'},false)
|
|
|
|
|
for(let i = 0;i < city.detail.length;i ++){
|
|
|
|
|
@ -201,11 +290,14 @@ export default {
|
|
|
|
|
this.getCustomers()
|
|
|
|
|
this.getCity()
|
|
|
|
|
this.getAccounts()
|
|
|
|
|
this.getTypes()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
|
|
::v-deep .ivu-table-header thead tr th{
|
|
|
|
|
text-align: center !important;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|