Commit 122cd3d6 authored by dcy's avatar dcy

客户详情,账单,信用日志,等级日志

parent 4a89cd43
...@@ -203,3 +203,28 @@ export function orderStatistics(params){ ...@@ -203,3 +203,28 @@ export function orderStatistics(params){
params params
}) })
} }
//创建客户信用日志
export function creditLogCreate(data){
return request({
url:'/customer/credit-log/create',
method:'post',
data
})
}
//获得客户统计
export function creditScoreStatistic(params){
return request({
url:'/customer/detail/infoList/creditScoreStatistic',
method:'get',
params
})
}
//获取账单数据
export function infoListReceiptPage(params){
return request({
url:'/customer/detail/infoList/receiptPage',
method:'get',
params
})
}
...@@ -233,20 +233,28 @@ ...@@ -233,20 +233,28 @@
<customer-complaint ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint> <customer-complaint ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="账单"> <el-tab-pane label="账单">
<el-table style="width: 100%"> <el-table style="width: 100%" :data="infoListReceiptList">
<el-table-column label="序号"></el-table-column> <el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="账单"></el-table-column> <el-table-column label="账单" prop="receiptNo"></el-table-column>
<el-table-column label="订单号"></el-table-column> <el-table-column label="订单号" prop="orderNo"></el-table-column>
<el-table-column label="箱数"></el-table-column> <el-table-column label="箱数" prop="num"></el-table-column>
<el-table-column label="方数"></el-table-column> <el-table-column label="方数" prop="volume" ></el-table-column>
<el-table-column label="重量"></el-table-column> <el-table-column label="重量" prop="weight" ></el-table-column>
<el-table-column label="类型"></el-table-column> <el-table-column label="类型">
<el-table-column label="费用类型"></el-table-column> <template v-slot="{row}">
<el-table-column label="金额"></el-table-column> <dict-tag :type="DICT_TYPE.PAYMENT_TYPE" :value="row.collectionType" />
<el-table-column label="汇率"></el-table-column> </template>
<el-table-column label="实收金额"></el-table-column> </el-table-column>
<el-table-column label="实收日期"></el-table-column> <el-table-column label="费用类型">
<el-table-column label="业务员"></el-table-column> <template v-slot="{row}">
<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="row.feeType" />
</template>
</el-table-column>
<el-table-column label="金额" prop="totalAmount">
</el-table-column>
<el-table-column label="已核销比例" prop="writeOffScale"></el-table-column>
<el-table-column label="实收日期" prop="writeOffAt"></el-table-column>
<el-table-column label="业务员" prop="salesmanName"></el-table-column>
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="数据"> <el-tab-pane label="数据">
...@@ -312,11 +320,7 @@ ...@@ -312,11 +320,7 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-button style="float: right;" type="primary" @click="dialogVisible = true" >添加信用日志</el-button> <el-button style="float: right;" type="primary" @click="dialogVisible = true" >添加信用日志</el-button>
<el-descriptions :column="5" border> <el-descriptions :column="5" border>
<el-descriptions-item label="信用分"></el-descriptions-item> <el-descriptions-item v-for="(item,index) in creditScoreStatisticObj" :key="index" :label="creditScoreCalculation(item.type)">{{item.score}}</el-descriptions-item>
<el-descriptions-item label="身份认证"></el-descriptions-item>
<el-descriptions-item label="贷款"></el-descriptions-item>
<el-descriptions-item label="提货率"></el-descriptions-item>
<el-descriptions-item label="发货"></el-descriptions-item>
</el-descriptions> </el-descriptions>
</div> </div>
<el-table :data="customerCreditLogList"> <el-table :data="customerCreditLogList">
...@@ -329,7 +333,7 @@ ...@@ -329,7 +333,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="score" label="规则得分"></el-table-column> <el-table-column prop="score" label="规则得分"></el-table-column>
<el-table-column prop="remark" label="备注"></el-table-column> <el-table-column prop="remark" label="备注"></el-table-column>
<el-table-column label="添加人"></el-table-column> <el-table-column label="添加人" prop="createName"></el-table-column>
<el-table-column label="时间"> <el-table-column label="时间">
<template v-slot="{row}"> <template v-slot="{row}">
{{parseTime(row.createTime)}} {{parseTime(row.createTime)}}
...@@ -366,20 +370,22 @@ ...@@ -366,20 +370,22 @@
width="30%" width="30%"
> >
<h1 slot="title"> <h1 slot="title">
给客户【小六子】添加信用日志 给客户【{{customer.name}}】添加信用日志
</h1> </h1>
<el-form label-width="100"> <el-form label-width="100">
<el-form-item label="客户编号:"></el-form-item> <el-form-item label="客户编号:">{{customer.number}}</el-form-item>
<el-form-item label="信用类别"> <el-form-item label="信用类别">
<el-select ></el-select> <el-select v-model="creditFrom.ruleId">
<el-option v-for="(item,index) in creditTypeList" :key="index" :value="item.id" :label="item.name"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="信用分"></el-form-item> <el-form-item v-if="creditTypeList.length > 0" label="信用分">{{(creditTypeList.find(r=>creditFrom.ruleId === r.id) || {}).score }}</el-form-item>
<el-form-item label="备注"> <el-form-item label="备注">
<el-input type="textarea"> </el-input> <el-input type="textarea" v-model="creditFrom.remark"> </el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button>提交</el-button> <el-button @click="submit">提交</el-button>
<el-button @click="dialogVisible = false" >取消</el-button> <el-button @click="dialogVisible = false" >取消</el-button>
</span> </span>
</el-dialog> </el-dialog>
...@@ -392,7 +398,13 @@ import { ...@@ -392,7 +398,13 @@ import {
getCustomerSelect, getCustomerSelect,
getBrankByCustomer, getBrankByCustomer,
levelLogPage, levelLogPage,
customerCreditLogPage, infoListOrderPage, infoListOfferPage, orderStatistics customerCreditLogPage,
infoListOrderPage,
infoListOfferPage,
orderStatistics,
creditLogCreate,
creditScoreStatistic,
infoListReceiptPage
} from '@/api/ecw/customer' } from '@/api/ecw/customer'
import { DICT_TYPE, getDictDataLabel } from '@/utils/dict' import { DICT_TYPE, getDictDataLabel } from '@/utils/dict'
import { getProductTypeList } from '@/api/ecw/productType' import { getProductTypeList } from '@/api/ecw/productType'
...@@ -404,6 +416,7 @@ import { listServiceUser } from '@/api/system/user' ...@@ -404,6 +416,7 @@ import { listServiceUser } from '@/api/system/user'
import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts' import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts'
import {getOrderPage} from "@/api/ecw/order"; import {getOrderPage} from "@/api/ecw/order";
import Template from "@/views/cms/template"; import Template from "@/views/cms/template";
import {getCreditRulePage} from "@/api/customer/creditRule";
export default { export default {
name: 'query', name: 'query',
...@@ -416,6 +429,10 @@ export default { ...@@ -416,6 +429,10 @@ export default {
CustomerComplaint CustomerComplaint
}, },
created() { created() {
//获取信用类型
getCreditRulePage({page:1,rows:999,type:2}).then(r => {
this.creditTypeList = r.data.list
})
getNodeList().then(r => { getNodeList().then(r => {
this.nodeList = r.data this.nodeList = r.data
}) })
...@@ -442,6 +459,8 @@ export default { ...@@ -442,6 +459,8 @@ export default {
this.getorderList() this.getorderList()
this.getInfoListOfferPage() this.getInfoListOfferPage()
this.getOrderStatistics() this.getOrderStatistics()
this.creditScoreStatisticFn()
this.infoListReceiptFn()
}, },
data() { data() {
return { return {
...@@ -531,7 +550,16 @@ export default { ...@@ -531,7 +550,16 @@ export default {
}, },
infoListOfferTotal:0, infoListOfferTotal:0,
infoListOfferList:[], infoListOfferList:[],
orderStatisticsObj:{} orderStatisticsObj:{},
creditTypeList:[],
creditFrom:{},//添加信用 日志
creditScoreStatisticObj:[],
infoListReceiptList:[],
infoListReceiptFrom:{
pageNo:1,
pageSize:10,
},
infoListReceiptTotal:0
} }
}, },
computed: { computed: {
...@@ -551,6 +579,15 @@ export default { ...@@ -551,6 +579,15 @@ export default {
}, },
id() { id() {
return this.customerId ? parseInt(this.customerId) : undefined return this.customerId ? parseInt(this.customerId) : undefined
},
creditScoreCalculation(){
return (val)=>{
if(val === 'all'){
return '信用分'
}else{
return (this.getDictDatas(DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE).find(i => i.value === val)||{}).label
}
}
} }
}, },
methods:{ methods:{
...@@ -614,6 +651,32 @@ export default { ...@@ -614,6 +651,32 @@ export default {
this.orderStatisticsObj = r.data this.orderStatisticsObj = r.data
} }
}) })
},
submit(){
creditLogCreate({customerId:this.id,...this.creditFrom}).then(r => {
if(r.code === 0){
this.creditLogPage();
this.creditFrom = {};
this.dialogVisible = false;
}
})
},
//获得信用客户统计
creditScoreStatisticFn(){
creditScoreStatistic({customerId:this.id}).then(r => {
console.log(r)
if(r.code === 0) this.creditScoreStatisticObj = r.data
})
},
// 获取账单数据
infoListReceiptFn(){
infoListReceiptPage({...this.infoListReceiptFrom,customerId:this.id}).then(r => {
console.log(r)
if(r.code === 0){
this.infoListReceiptList = r.data.list;
this.infoListReceiptTotal = r.data.total;
}
})
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment