暂存更改
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { ref, onMounted, reactive } from 'vue'
|
||||
import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import {
|
||||
getCustomerList,
|
||||
createCustomer,
|
||||
@@ -18,7 +18,8 @@ const form = reactive({
|
||||
region: [], // 地区,默认为空数组(省市区三级代码)
|
||||
address: '', // 详细地址,默认为空字符串
|
||||
email: '', // 电子邮箱,默认为空字符串
|
||||
customer_type: 'Normal' // 客户类型,默认选中"普通客户"
|
||||
customer_type: 'Normal', // 客户类型,默认选中"普通客户"
|
||||
remark: '' // 备注
|
||||
})
|
||||
|
||||
const search = ref('')
|
||||
@@ -61,6 +62,7 @@ const resetForm = () => {
|
||||
form.address = ''
|
||||
form.email = ''
|
||||
form.customer_type = 'Normal'
|
||||
form.remark = ''
|
||||
isEditMode.value = false
|
||||
currentCustomerId.value = null
|
||||
}
|
||||
@@ -87,6 +89,7 @@ const editCustomer = (row) => {
|
||||
form.address = row.address
|
||||
form.email = row.email
|
||||
form.customer_type = row.customer_type
|
||||
form.remark = row.remark
|
||||
showAddForm.value = true
|
||||
showSearchResults.value = false
|
||||
}
|
||||
@@ -100,7 +103,8 @@ const saveCustomer = async () => {
|
||||
district: CodeToText[form.region[2]] || '',
|
||||
address: form.address,
|
||||
email: form.email,
|
||||
customer_type: form.customer_type
|
||||
customer_type: form.customer_type,
|
||||
remark: form.remark
|
||||
}
|
||||
if (isEditMode.value) {
|
||||
await updateCustomer(currentCustomerId.value, formData)
|
||||
@@ -192,7 +196,7 @@ const clearSearch = () => {
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="详细地址" width="200" />
|
||||
<el-table-column prop="email" label="电子邮箱" width="200" />
|
||||
<el-table-column prop="remark" label="备注" width=""200 />
|
||||
<el-table-column prop="remark" label="备注" width="200" show-overflow-tooltip />
|
||||
<el-table-column prop="customer_type" label="代理商类型" width="120">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.customer_type === 'VIP' ? 'danger' : 'info'">
|
||||
@@ -248,6 +252,10 @@ const clearSearch = () => {
|
||||
<el-radio value="Normal">加盟商</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注信息" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="saveCustomer">保存</el-button>
|
||||
<el-button type="danger" @click="cancelAdd">取消</el-button>
|
||||
|
||||
@@ -74,7 +74,7 @@ const switchFold = () => {
|
||||
</el-menu-item>
|
||||
|
||||
<el-menu-item index="/panel/user">
|
||||
<el-icon><User /></el-icon>
|
||||
<el-icon><UserFilled /></el-icon>
|
||||
<template #title>用户管理</template>
|
||||
</el-menu-item>
|
||||
|
||||
@@ -156,6 +156,7 @@ const switchFold = () => {
|
||||
transition: width 0.3s ease;
|
||||
background: #fff;
|
||||
border-right: 1px solid #eee;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.aside-menu {
|
||||
@@ -163,6 +164,7 @@ const switchFold = () => {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-right: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.aside-menu:not(.el-menu--collapse) {
|
||||
|
||||
Reference in New Issue
Block a user