user.js
4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
* @Description:
* @Author: huyue
* @Date: 2024-04-07 18:15:11
* @LastEditors: limin
* @LastEditTime: 2025-01-03 20:52:28
*/
// import { setToken, getToken, removeToken } from '@/utils/token';;
export default {
state () {
return {
customerInfo: {
customerName: "",
carBrand: "",
carModel: "",
phoneNumber: "",
salesUuid: "",
staffName: "",
newCarFare: '',
carModelId: '',
oneCarBrand: '',
oneCarBrandId: ''
},
insuranceEquityProducts: [], // 当前接待已选择的保险权益产品
historyStatus: Date.now(),
carBrands: [],
employeeList: [],
paymentType: [],
haveCustomerAccess: true, //2025-7月版本 客户档案权限设置为默认为true
boutiqueMediaConfig: {},
receptionTrack: {}, //接待记录埋点
boutiqueDefaultCarBrandId: '',
viewKey: Date.now(),
boutiqueCarList: [],
receptionKey: Date.now(), //接待记录埋点KEY
defaultCarId: '',
customerKey: Date.now(), //客户信息KEY
currentCarInfo: {},//当前选中的车品牌车系
carBrandOpenStatus: false, // 车品牌选择弹窗是否打开
newReport: false, // 是否新日报
};
},
mutations: {
getCustomerInfo (state) {
return state.customerInfo;
},
setCustomerInfo (state, data = {}) {
// state.customerInfo = data;
uni.$storage.set("customerInfo", JSON.stringify(data));
state.customerInfo = data
state.customerKey = Date.now()
},
setInsuranceEquityProducts (state, value = []) {
state.insuranceEquityProducts = Array.isArray(value) ? value : []
},
setReceptionTrack (state, { key, value }) {
state.receptionTrack[key] = value
state.receptionKey = Date.now()
},
clearReceptionTrack (state) {
state.receptionTrack = {}
state.receptionKey = Date.now()
},
updateViewKey (state) {
state.viewKey = Date.now();
},
setPaymentType (state, value) {
state.paymentType = value;
},
setCarBrandsList (state, value) {
state.carBrands = value;
},
setEmployeeList (state, value) {
state.employeeList = value;
},
setCurrentCarInfo (state, data = {}) {
state.currentCarInfo = data;
},
clearCustomerInfo (state) {
const info = {
customerName: "",
carBrand: "",
carModel: "",
phoneNumber: "",
salesUuid: "",
staffName: "",
newCarFare: '',
carModelId: '',
oneCarBrand: '',
oneCarBrandId: ''
};
uni.$storage.set("customerInfo", JSON.stringify(info));
state.customerInfo = info
state.insuranceEquityProducts = []
state.customerKey = Date.now()
},
setCarBrandOpenStatus (state, value) {
state.carBrandOpenStatus = value;
},
setNewReport (state, value) {
state.newReport = value;
},
},
actions: {
// 获取用户详情
getCustomerInfo ({ state }) {
return state.customerInfo;
},
setCustomerInfo ({ commit }, value) {
// uni.$logger.local.info(`当前接待客户信息: ${JSON.stringify(value)}`)
commit("setCustomerInfo", value);
},
setInsuranceEquityProducts ({ commit }, value) {
commit('setInsuranceEquityProducts', value)
},
clearCustomerInfo ({ commit }) {
commit("clearCustomerInfo");
},
clearHistory ({ state }) {
state.historyStatus = Date.now();
},
setPaymentType ({ commit }, value) {
commit('setPaymentType', value)
},
setCarBrandsList ({ commit }, value) {
commit('setCarBrandsList', value)
},
setEmployeeList ({ commit }, value) {
commit('setEmployeeList', value)
},
setReceptionTrack ({ commit }, { key, value }) {
commit('setReceptionTrack', { key, value })
},
clearReceptionTrack ({ commit }) {
commit('clearReceptionTrack')
},
updateViewKey ({ commit }) {
commit('updateViewKey')
},
setCurrentCarInfo ({ commit }, value) {
commit("setCurrentCarInfo", value);
},
setCarBrandOpenStatus ({ commit }, value) {
commit('setCarBrandOpenStatus', value)
},
setNewReport ({ commit }, value) {
commit('setNewReport', value)
},
},
};