Commit 5ce19c19 by 张立顺

fix bug修复

1 parent de305ef6
......@@ -18,13 +18,7 @@
</template>
<script>
import { mapBasicInfoFromRow } from "../utils/customerSnapshot";
const DEFAULT_STATUS_LIST = [
{ confId: 1, confLabel: "未完成" },
{ confId: 2, confLabel: "已完成" },
{ confId: 3, confLabel: "已评价" },
];
import { CUSTOMER_STATUS_LIST, mapBasicInfoFromRow } from "../utils/customerSnapshot";
export default {
name: "CustomerBasicInfoCard",
......@@ -39,7 +33,7 @@ export default {
},
statusList: {
type: Array,
default: () => DEFAULT_STATUS_LIST,
default: () => CUSTOMER_STATUS_LIST,
},
},
computed: {
......
......@@ -32,7 +32,7 @@
</el-table-column>
<el-table-column label="客户状态" align="center" width="90">
<template slot-scope="scope">
<span :class="{ 'red': scope.row.status === 1 }">{{ formatCustomerStatusLabel(scope.row) }}</span>
<span :class="{ 'red': scope.row.customerStatus === 1 }">{{ formatCustomerStatusLabel(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column label="车型" align="center" min-width="150">
......@@ -94,6 +94,7 @@ import { getList, orderCount } from '@api/customerList'
import { getServiceStore, getParkStore } from '@api/editCustomer'
import {
saveCustomerSnapshot,
CUSTOMER_STATUS_LIST,
formatListPhone,
formatCustomerClass,
formatCarModelForList,
......@@ -187,12 +188,6 @@ export default {
},
// 表格
tableData: [],
// 搜索下拉框
// 客户状态;1-未完成;2-已完成
// customerStatusObj: {
// 1: [1, 3],
// 2: [2, 4, 6]
// },
// 创建方式;1-系统录入;2-现场升级;5-核销抵扣
sourceStatusObj: {
1: [1, 2, 6],
......@@ -202,16 +197,7 @@ export default {
baseData: {
parkServiceList: [],
storeIdList: [],
customerStatusList: [{
confId: 1,
confLabel: '未完成'
}, {
confId: 2,
confLabel: '已完成'
}, {
confId: 3,
confLabel: '已评价'
}],
customerStatusList: CUSTOMER_STATUS_LIST.slice(),
upgradeList: [{
confId: 'Y',
confLabel: '已升级'
......@@ -294,7 +280,7 @@ export default {
// upgradeFinishFlag: this.searchForm.upgradeFinishFlag
}
// this.searchForm.baseGoodsId && (params.baseGoodsCodeList = [this.searchForm.baseGoodsId])
this.searchForm.customerStatus && (params.statusList = this.searchForm.customerStatus)
this.searchForm.customerStatus && (params.customerStatus = this.searchForm.customerStatus)
this.searchForm.source && (params.sourceList = this.sourceStatusObj[this.searchForm.source])
if (this.searchForm.successTime) {
params.paySuccessStartDate = new Date(this.searchForm.successTime[0]).toLocaleDateString().replace(/\//g, '-')
......@@ -414,7 +400,7 @@ export default {
query: {
customerId: row.id,
customerClass: row.customerClass || '',
status: row.status != null ? String(row.status) : '',
customerStatus: row.customerStatus != null ? String(row.customerStatus) : '',
},
})
},
......@@ -429,7 +415,7 @@ export default {
query: {
customerId: row.id,
customerClass: row.customerClass || '',
status: row.status != null ? String(row.status) : '',
customerStatus: row.customerStatus != null ? String(row.customerStatus) : '',
},
})
},
......
const SNAPSHOT_KEY = "customerDetailSnapshot";
export const CUSTOMER_STATUS_LIST = [
{ confId: 1, confLabel: "待跟进" },
{ confId: 2, confLabel: "已升级" },
{ confId: 3, confLabel: "战败" },
{ confId: 4, confLabel: "已退款" },
];
export function saveCustomerSnapshot(row) {
if (!row) {
return;
......@@ -26,8 +33,8 @@ export function resolveCustomerRowFromRoute(route = {}, snapshotRow = {}) {
if (route.query && route.query.customerClass) {
row.customerClass = route.query.customerClass;
}
if (route.query && route.query.status !== undefined && route.query.status !== "") {
row.status = route.query.status;
if (route.query && route.query.customerStatus !== undefined && route.query.customerStatus !== "") {
row.customerStatus = route.query.customerStatus;
}
return row;
}
......@@ -103,12 +110,12 @@ export function formatReferrer(row = {}) {
|| "";
}
export function formatCustomerStatus(row = {}, statusList = []) {
const status = row.status;
if (status == null || status === "") {
export function formatCustomerStatus(row = {}, statusList = CUSTOMER_STATUS_LIST) {
const customerStatus = row.customerStatus;
if (customerStatus == null || customerStatus === "") {
return "-";
}
const matched = statusList.find((item) => Number(item.confId) === Number(status));
const matched = statusList.find((item) => Number(item.confId) === Number(customerStatus));
return matched ? matched.confLabel : "-";
}
......@@ -150,7 +157,7 @@ export function formatCreateTime(row = {}) {
return formatDateValue(row.createdDate);
}
export function mapBasicInfoFromRow(row = {}, statusList = []) {
export function mapBasicInfoFromRow(row = {}, statusList = CUSTOMER_STATUS_LIST) {
const deliveryTime = formatDeliveryTime(row);
const referrer = formatReferrer(row);
const recorder = formatRecorder(row);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!