ViewPreference.vue
8.1 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<template>
<div>
<div class="titleBox">
{{ actionState == 'EDIT' ? '编辑收车偏好' : '收车偏好详情' }}
<a-button style="float: right;" @click="handleCancelExit()">返回列表</a-button>
</div>
<div v-if="actionState == 'EDIT'" class="warning-box">
<InfoCircleFilled color="#1956FE" font-size="14px" style="margin-left: 16px; color: #1956FE;" />
<span style="padding-left: 8px;color: #777C85;">编辑完成所有偏好信息并保存后,车商小程序将不再展示收车偏好调研入口。仅编辑部分信息无法保存。</span>
</div>
<a-card :bordered="false" size="small">
<a-descriptions :column="3" size="small" layout="vertical">
<template #title>
<title-tip-icon></title-tip-icon>
车商基础信息
<div class="title-line"></div>
</template>
<a-descriptions-item label="车商ID">{{ pageData.accountId }}</a-descriptions-item>
<a-descriptions-item label="车商手机号">{{ pageData.mobile }}</a-descriptions-item>
<a-descriptions-item label="车商昵称">{{ pageData.nickName }}</a-descriptions-item>
<a-descriptions-item label="真实姓名">{{ pageData.accountName }}</a-descriptions-item>
<a-descriptions-item label="调研状态">
<div v-if="pageData.status == '1'" class="tag1">已完成</div>
<div v-else class="tag2">未完成</div>
</a-descriptions-item>
<a-descriptions-item label="注册时间">{{ pageData.regTime }}</a-descriptions-item>
<a-descriptions-item label="首次填写时间">{{ pageData.createTime }}</a-descriptions-item>
<a-descriptions-item label="更新时间">{{ pageData.updateTime }}</a-descriptions-item>
<a-descriptions-item label="编辑人">{{ pageData.updatedBy }}</a-descriptions-item>
</a-descriptions>
<div v-if="actionState == 'VIEW'" style="width: 100%;">
<a-descriptions :column="3" size="small" layout="vertical">
<template #title>
<title-tip-icon></title-tip-icon>
经营信息
<div class="title-line"></div>
</template>
<a-descriptions-item label="经营模式">
{{ pageData.businessModel == '1' ? '批发' : pageData.businessModel == '2' ? '零售' : '--' }}
</a-descriptions-item>
<a-descriptions-item label="注册地区">
{{ pageData.provinceName }}-{{ pageData.cityName }}
</a-descriptions-item>
</a-descriptions>
<a-descriptions :column="3" size="small" layout="vertical">
<template #title>
<title-tip-icon></title-tip-icon>
收车偏好详情
<div class="title-line"></div>
</template>
<a-descriptions-item label="偏好车况">
<PageMultipleTag :listValue="'vehicleConditionList'" :tagValue="pageData.vehicleCondition" />
</a-descriptions-item>
<a-descriptions-item label="偏好车龄">
<PageMultipleTag :listValue="'vehicleAgeList'" :tagValue="pageData.vehicleAge" />
</a-descriptions-item>
<a-descriptions-item label="燃油类型">
<PageMultipleTag :listValue="'vehicleFuelTypeList'" :tagValue="pageData.vehicleFuelType" />
</a-descriptions-item>
<a-descriptions-item label="收车车型">
<PageMultipleTag :listValue="'vehicleTypeList'" :tagValue="pageData.vehicleType" />
</a-descriptions-item>
<a-descriptions-item label="品牌偏好">
<PageMultipleTag :listValue="pageData.brandList" :tagValue="pageData.brandList" />
</a-descriptions-item>
</a-descriptions>
<a-descriptions :column="1" size="small" layout="vertical">
<template #title>
<title-tip-icon></title-tip-icon>
操作日志
<div class="title-line"></div>
</template>
<a-descriptions-item label="">
<OperationLog ref="operationLogRef" :operationLogData="pageData" />
</a-descriptions-item>
</a-descriptions>
</div>
</a-card>
<div v-if="actionState == 'EDIT'" style="width: 100%;">
<PreferenceForm ref="preferenceFormRef" :preferenceFormData="pageData" @cancelExit="handleCancelExit()" />
</div>
<!-- 退出提示弹窗 -->
<a-modal v-model:open="exitVisible" title="提示" width="480px" @ok="handleExit">
<p style="height: 32px;line-height: 32px;">本次编辑未保存,是否确定退出?</p>
</a-modal>
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-facing-decorator';
import { PreferenceController } from "@/api/PreferenceController";
import PageMultipleTag from "@/views/finance/preference/PageMultipleTag.vue";
import OperationLog from "@/views/finance/preference/OperationLog.vue";
import PreferenceForm from "@/views/finance/preference/PreferenceForm.vue";
import TitleDivider from "@/components/TitleDivider.vue";
import { DeleteOutlined, EditOutlined, PlusOutlined, InfoCircleFilled } from "@ant-design/icons-vue";
import TitleTipIcon from "@/components/icons/TitleTipIcon.vue";
@Component({
components: { TitleDivider, EditOutlined, DeleteOutlined, PlusOutlined, TitleTipIcon, PageMultipleTag, OperationLog, PreferenceForm, InfoCircleFilled }
})
export default class ViewPreference extends Vue {
actionState: string = 'VIEW'//VIEW查看状态 EDIT编辑状态
pageData: object = {} //页面显示数据
exitVisible: boolean = false //退出提示弹窗是否显示
created() {
const { preferenceId, action } = this.$route.query;
this.actionState = action || 'VIEW';
PreferenceController.getPreferenceDetail(this.axios, Number(preferenceId)).then(response => {
this.pageData = response.data || {};
})
}
handleCancelExit() {
if (this.actionState == 'EDIT') {
this.exitVisible = true;
} else {
this.$goBack()
}
}
handleExit() {
this.exitVisible = false;
this.$goBack()
}
}
</script>
<style scoped lang="less">
::v-deep(.ant-descriptions-item-label::after) {
display: none;
}
::v-deep(.ant-descriptions-small .ant-descriptions-row >th) {
padding-bottom: 0px !important;
}
::v-deep(.ant-descriptions-small .ant-descriptions-row >td) {
padding-top: 6px !important;
padding-bottom: 16px !important;
}
.titleBox {
width: -webkit-calc(100% - 24px);
width: -moz-calc(100% - 24px);
width: calc(100% - 24px);
height: 32px;
line-height: 32px;
margin-left: 12px;
font-size: 16px;
font-weight: 700;
margin-bottom: 4px;
}
.warning-box {
width: 100%;
height: 36px;
line-height: 36px;
border-radius: 4px;
background: #196dfe1a;
color: #777c85;
font-size: 14px;
font-weight: 400;
font-family: "HarmonyOSSansSC";
margin-top: 8px;
}
.title-line {
width: 100%;
height: 1px;
background-color: #F2F4F7;
margin-top: 10px;
}
.tag1 {
width: 52px;
height: 24px;
border-radius: 3px;
border: 1px solid #e8f8f2;
background: #e8f8f2;
color: #00ad74;
font-size: 12px;
font-weight: 400;
text-align: center;
line-height: 24px;
}
.tag2 {
width: 52px;
height: 24px;
border: 1px solid #f0f2f5;
border-radius: 3px;
background: #f0f2f5;
color: #777c85;
font-size: 12px;
font-weight: 400;
text-align: center;
line-height: 24px;
}
</style>