Commit 5ce19c19 by 张立顺

fix bug修复

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