master
xy 3 years ago
parent 12d9fcf76b
commit d8b46147bd

@ -209,10 +209,11 @@
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select <el-select
disabled :disabled="flag !== 1"
v-model="form1.product_type_id" :value="flag ===1 ? form.product_type_id : form1.product_type_id"
placeholder="请选择业务板块" placeholder="请选择业务板块"
style="width: 300px"> style="width: 300px"
@change="e => flag === 1 ? form.product_type_id = e : form1.product_type_id = e">
<el-option v-for="item in types" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in types" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
@ -416,6 +417,7 @@ export default {
form: { form: {
name: '', name: '',
product_type_id:'',
phone: '', phone: '',
idcard: '', idcard: '',
contact_name: '', contact_name: '',
@ -568,6 +570,7 @@ export default {
init(){ init(){
this.form = { this.form = {
name: '', name: '',
product_type_id:'',
phone: '', phone: '',
idcard: '', idcard: '',
contact_name: '', contact_name: '',

@ -1,331 +1,336 @@
<template> <template>
<div> <div>
<!--查询--> <!--查询-->
<div> <div>
<div ref="lxHeader"> <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> <div slot="content"></div>
<slot> <slot>
<div> <div>
<Input placeholder="关键字搜索" v-model="select.keyword" style="width: 200px; margin-right: 10px" /> <el-select v-model="select.product_type_id" size="small" style="margin-right: 10px;">
<el-option v-for="(item,index) in types" :key="item.id" :value="item.id" :label="item.name" ></el-option>
<Button style="margin-left: 10px" type="primary" @click="select.page = 1,getCustomers()">查询</Button> </el-select>
<Button style="margin-left: 10px" type="primary"
@click="$refs['addCustomer'].type = 'add',$refs['addCustomer'].isShow = true">录入客户 <el-input size="small" placeholder="关键字搜索" v-model="select.keyword" style="width: 200px; margin-right: 10px" />
</Button>
</div> <Button style="margin-left: 10px" type="primary" @click="select.page = 1,getCustomers()">查询</Button>
</slot> <Button style="margin-left: 10px" type="primary"
</lx-header> @click="$refs['addCustomer'].type = 'add',$refs['addCustomer'].isShow = true">新增客户
</div> </Button>
</div> </div>
</slot>
<xy-table ref="table" :total="total" :list="list" :table-item="tableItem" :default-expand-all="false" </lx-header>
@pageSizeChange="e => {select.page_size = e;select.page=1;getCustomers()}" </div>
@pageIndexChange="e => {select.page = e;getCustomers()}"> </div>
<template v-slot:btns>
<el-table-column fixed="right" width="166" header-align="center" align="center" label="操作"> <xy-table ref="table" :total="total" :list="list" :table-item="tableItem" :default-expand-all="false"
<template v-slot:default="scope"> @pageSizeChange="e => {select.page_size = e;select.page=1;getCustomers()}"
<Poptip transfer confirm title="确认要删除?" @on-ok="destroy(scope.row)"> @pageIndexChange="e => {select.page = e;getCustomers()}">
<Button size="small" type="error" ghost style="margin-right: 6px">删除</Button> <template v-slot:btns>
</Poptip> <el-table-column fixed="right" width="166" header-align="center" align="center" label="操作">
<Button size="small" ghost type="primary" @click="editor(scope.row)" style="margin-right: 6px">编辑</Button> <template v-slot:default="scope">
<Button size="small" type="primary" <Poptip transfer confirm title="确认要删除?" @on-ok="destroy(scope.row)">
@click="$refs['addOrder'].customerIdcard = scope.row.idcard,$refs['addOrder'].isShow = true,$refs['addOrder'].form.customer_id = scope.row.id">录入</Button> <Button size="small" type="error" ghost style="margin-right: 6px">删除</Button>
</template> </Poptip>
</el-table-column> <Button size="small" ghost type="primary" @click="editor(scope.row)" style="margin-right: 6px">编辑</Button>
</template> <Button size="small" type="primary"
</xy-table> @click="$refs['addOrder'].customerIdcard = scope.row.idcard,$refs['addOrder'].isShow = true,$refs['addOrder'].form.customer_id = scope.row.id">录入</Button>
</template>
<addOrder ref="addOrder" :types="types" :accounts="accounts" @refresh="getCustomers"></addOrder> </el-table-column>
<add-customer ref="addCustomer" :level-types="levelTypes" :types="types" :accounts="accounts" :cities="cities" </template>
:disability-level="disabilityLevel" @refresh="getCustomers"></add-customer> </xy-table>
</div>
</template> <addOrder ref="addOrder" :types="types" :accounts="accounts" @refresh="getCustomers"></addOrder>
<add-customer ref="addCustomer" :level-types="levelTypes" :types="types" :accounts="accounts" :cities="cities"
<script> :disability-level="disabilityLevel" @refresh="getCustomers"></add-customer>
import { </div>
getList, </template>
destroy
} from '@/api/customer' <script>
import { import {
getparameter getList,
} from '@/api/system/dictionary' destroy
import { } from '@/api/customer'
getList as getUnit import {
} from "@/api/payUnit"; getparameter
import { } from '@/api/system/dictionary'
getList as getTypes import {
} from '@/api/productType' getList as getUnit
} from "@/api/payUnit";
import addCustomer from "@/views/customer/component/addCustomer"; import {
import addOrder from './component/addOrder' getList as getTypes
export default { } from '@/api/productType'
components: {
addCustomer, import addCustomer from "@/views/customer/component/addCustomer";
addOrder import addOrder from './component/addOrder'
}, export default {
data() { components: {
return { addCustomer,
select: { addOrder
page: 1, },
page_size: 10, data() {
keyword: '' return {
}, select: {
disabilityLevel: [], product_type_id:'',
levelTypes: [], page: 1,
cities: [], page_size: 10,
accounts: [], keyword: ''
types: [], },
disabilityLevel: [],
total: 0, levelTypes: [],
list: [], cities: [],
tableItem: [{ accounts: [],
type: 'expand', types: [],
expandFn: (props) => {
return ( < total: 0,
Table style = { list: [],
{ tableItem: [{
'margin': '0 166px 0 40px' type: 'expand',
} expandFn: (props) => {
} return ( <
width = { Table style = {
1370 {
} 'margin': '0 166px 0 40px'
stripe = { }
true }
} width = {
border = { 1370
true }
} stripe = {
size = "small" true
columns = { }
[{ border = {
title: '订单编号', true
key: 'no', }
width: 220, size = "small"
align: 'center' columns = {
}, [{
{ title: '订单编号',
title: '订单产品', key: 'no',
width: 200, width: 220,
align: 'center', align: 'center'
render: (h, params) => { },
return h('div', params.row.product.name) {
} title: '订单产品',
}, width: 200,
{ align: 'center',
title: '时间', render: (h, params) => {
width: 270, return h('div', params.row.product.name)
align: 'center', }
render: (h, params) => { },
return h('div', [ {
h('span', params.row.start_date), title: '时间',
h('span', ' ~ '), width: 270,
h('span', params.row.end_date) align: 'center',
]) render: (h, params) => {
} return h('div', [
}, h('span', params.row.start_date),
{ h('span', ' ~ '),
title: '单次价格', h('span', params.row.end_date)
width: 180, ])
align: 'right', }
key: 'unit_price' },
}, {
{ title: '单次价格',
title: '总计时长', width: 180,
width: 160, align: 'right',
align: 'center', key: 'unit_price'
key: 'total_time' },
}, {
{ title: '总计时长',
title: '总计金额', width: 160,
width: 190, align: 'center',
align: 'right', key: 'total_time'
key: 'total_money' },
}, {
{ title: '总计金额',
title: '执行状态', width: 190,
align: 'center', align: 'right',
render: (h, params) => { key: 'total_money'
let statusName = new Map([ },
[0, '未开始'], {
[1, '进行中'], title: '执行状态',
[2, '已完成'], align: 'center',
]) render: (h, params) => {
let statusColor = new Map([ let statusName = new Map([
[0, 'blue'], [0, '未开始'],
[1, 'red'], [1, '进行中'],
[2, 'green'], [2, '已完成'],
]) ])
return h('div', { let statusColor = new Map([
style: { [0, 'blue'],
color: statusColor.get(params.row.status) [1, 'red'],
} [2, 'green'],
}, statusName.get(params.row.status)) ])
} return h('div', {
} style: {
] color: statusColor.get(params.row.status)
} }
data = { }, statusName.get(params.row.status))
props?.row.orders }
} > }
< ]
/Table> }
) data = {
} props?.row.orders
}, } >
{ <
prop: "name", /Table>
label: "姓名", )
width: "180", }
}, },
{ {
label: '订单产品', prop: "name",
width: 220, label: "姓名",
align: 'left', width: "180",
customFn: (row) => { },
return ( < {
div > { label: '订单产品',
row.orders.map(item => { width: 220,
return item.product.name align: 'left',
}).toString() customFn: (row) => {
} < return ( <
/div> div > {
) row.orders.map(item => {
} return item.product.name
}, }).toString()
{ } <
prop: "idcard", /div>
label: "身份证号", )
width: "220" }
}, },
{ {
prop: "phone", prop: "idcard",
label: "手机号", label: "身份证号",
width: "160" width: "220"
}, },
{ {
label: "委托人", prop: "phone",
width: "180", label: "手机号",
prop: 'contact_name' width: "160"
}, },
{ {
label: "委托人电话", label: "委托人",
width: "160", width: "180",
prop: 'contact_phone' prop: 'contact_name'
}, },
{ {
prop: 'idcard_address', label: "委托人电话",
label: '户籍地址', width: "160",
width: 140 prop: 'contact_phone'
}, },
{ {
label: '默认上门地址', prop: 'idcard_address',
minWidth: 300, label: '户籍地址',
align: 'left', width: 140
customFn: (row) => { },
return ( < {
div > { label: '默认上门地址',
row.customer_address.filter(item => { minWidth: 300,
return item.default === 1 align: 'left',
})[0]?.address || row.customer_address[0]?.address || '无' customFn: (row) => {
} < return ( <
/div> div > {
) row.customer_address.filter(item => {
} return item.default === 1
}, })[0]?.address || row.customer_address[0]?.address || '无'
{ } <
label: '上门地址数', /div>
prop: 'customer_address_count', )
width: 140 }
} },
] {
} label: '上门地址数',
}, prop: 'customer_address_count',
methods: { width: 140
async getLevelTypes() { }
const types = await getparameter({ ]
number: 'disabilityType' }
}, false) },
this.levelTypes = types.detail methods: {
}, async getLevelTypes() {
const types = await getparameter({
async getDisabilityLevel() { number: 'disabilityType'
const levels = await getparameter({ }, false)
number: 'disabilityLevel' this.levelTypes = types.detail
}, false) },
this.disabilityLevel = levels.detail
}, async getDisabilityLevel() {
const levels = await getparameter({
async getCustomers() { number: 'disabilityLevel'
const res = await getList(this.select) }, false)
this.list = res.data.data this.disabilityLevel = levels.detail
this.total = res.data.total },
},
async getCustomers() {
async getAccounts() { const res = await getList(this.select)
const res = await getUnit({ this.list = res.data.data
page: 1, this.total = res.data.total
page_size: 9999 },
}, false)
this.accounts = res.data async getAccounts() {
}, const res = await getUnit({
page: 1,
async getTypes() { page_size: 9999
const res = await getTypes({ }, false)
page: 1, this.accounts = res.data
page_size: 9999 },
}, false)
this.types = res.data async getTypes() {
}, const res = await getTypes({
page: 1,
async getCity() { page_size: 9999
let city = await getparameter({ }, false)
number: 'city' this.types = res.data
}, false) },
for (let i = 0; i < city.detail.length; i++) {
let area = await getparameter({ async getCity() {
pid: city.detail[i].id let city = await getparameter({
}, false) number: 'city'
city.detail[i].children = area.detail }, false)
for (let i = 0; i < city.detail.length; i++) {
for (let j = 0; j < area.detail.length; j++) { let area = await getparameter({
let street = await getparameter({ pid: city.detail[i].id
pid: area.detail[j].id }, false)
}, false) city.detail[i].children = area.detail
area.detail[j].children = street.detail
} for (let j = 0; j < area.detail.length; j++) {
} let street = await getparameter({
pid: area.detail[j].id
this.cities = city.detail }, false)
}, area.detail[j].children = street.detail
}
editor(row) { }
this.$refs['addCustomer'].id = row.id
this.$refs['addCustomer'].type = 'editor' this.cities = city.detail
this.$refs['addCustomer'].isShow = true },
},
destroy(row) { editor(row) {
destroy(row.id).then(res => { this.$refs['addCustomer'].id = row.id
this.$successMessage('destroy', '客户') this.$refs['addCustomer'].type = 'editor'
this.getCustomers() this.$refs['addCustomer'].isShow = true
}) },
} destroy(row) {
}, destroy(row.id).then(res => {
mounted() { this.$successMessage('destroy', '客户')
this.getDisabilityLevel() this.getCustomers()
this.getLevelTypes() })
this.getCustomers() }
this.getCity() },
this.getAccounts() mounted() {
this.getTypes() this.getDisabilityLevel()
} this.getLevelTypes()
} this.getCustomers()
</script> this.getCity()
this.getAccounts()
<style lang="scss" scoped> this.getTypes()
::v-deep .ivu-table-header thead tr th { }
text-align: center !important; }
} </script>
<style lang="scss" scoped>
::v-deep .ivu-table-header thead tr th {
text-align: center !important;
}
</style> </style>

Loading…
Cancel
Save