|
@@ -12,7 +12,7 @@
|
|
|
<el-option v-for="station in filteredStationList" :key="station.id" :label="station.name" :value="station.id" />
|
|
<el-option v-for="station in filteredStationList" :key="station.id" :label="station.name" :value="station.id" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
<el-input v-model="searchForm.keyword" placeholder="搜索姓名/手机号" style="width: 200px; margin-right: 10px;" clearable @keyup.enter="handleSearch" @clear="handleSearch" />
|
|
<el-input v-model="searchForm.keyword" placeholder="搜索姓名/手机号" style="width: 200px; margin-right: 10px;" clearable @keyup.enter="handleSearch" @clear="handleSearch" />
|
|
|
- <el-button type="primary" icon="Plus" @click="handleAdd">新增用户</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" icon="Plus" @click="handleAdd" v-hasPermi="['archieves:customer:add']">新增用户</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -73,19 +73,16 @@
|
|
|
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
|
|
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
|
|
|
<el-table-column label="操作" width="200" align="center">
|
|
<el-table-column label="操作" width="200" align="center">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <el-button link type="primary" size="small" @click="handleDetail(scope.row)">详情</el-button>
|
|
|
|
|
- <el-button link type="primary" size="small" @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
|
|
|
|
+ <el-button link type="primary" size="small" @click="handleDetail(scope.row)" v-hasPermi="['archieves:customer:query']">详情</el-button>
|
|
|
|
|
+ <el-button link type="primary" size="small" @click="handleEdit(scope.row)" v-hasPermi="['archieves:customer:edit']">编辑</el-button>
|
|
|
<el-dropdown trigger="click" @command="(cmd) => handleCommand(cmd, scope.row)" style="margin-left: 10px; vertical-align: middle">
|
|
<el-dropdown trigger="click" @command="(cmd) => handleCommand(cmd, scope.row)" style="margin-left: 10px; vertical-align: middle">
|
|
|
<el-button link type="primary" size="small">
|
|
<el-button link type="primary" size="small">
|
|
|
更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
|
更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<template #dropdown>
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
<el-dropdown-menu>
|
|
|
- <el-dropdown-item command="remark">添加备注</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item :command="scope.row.status ? 'disable' : 'enable'">
|
|
|
|
|
- {{ scope.row.status ? '停用用户' : '启用用户' }}
|
|
|
|
|
- </el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item command="delete" style="color: #F56C6C">删除用户</el-dropdown-item>
|
|
|
|
|
|
|
+ <el-dropdown-item command="remark" v-hasPermi="['archieves:customer:edit']">添加备注</el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item command="delete" style="color: #F56C6C" v-hasPermi="['archieves:customer:remove']">删除用户</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
@@ -129,10 +126,10 @@
|
|
|
<el-descriptions :column="2" border>
|
|
<el-descriptions :column="2" border>
|
|
|
<el-descriptions-item label="姓名">{{ currentUser.name }}</el-descriptions-item>
|
|
<el-descriptions-item label="姓名">{{ currentUser.name }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="电话">{{ currentUser.phone }}</el-descriptions-item>
|
|
<el-descriptions-item label="电话">{{ currentUser.phone }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="所属区域">{{ currentUser.area || '-' }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="所属站点">{{ currentUser.station || '-' }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="录入来源">{{ currentUser.source }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="录入时间">{{ currentUser.entryTime }}</el-descriptions-item>
|
|
|
|
|
|
|
+ <el-descriptions-item label="所属区域">{{ currentUser.areaName || '-' }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="所属站点">{{ currentUser.stationName || '-' }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="录入来源">{{ currentUser.source || '-' }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="录入时间">{{ currentUser.createTime || '-' }}</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
</el-descriptions>
|
|
|
|
|
|
|
|
<div class="section-title" style="margin-top: 20px">居住信息</div>
|
|
<div class="section-title" style="margin-top: 20px">居住信息</div>
|
|
@@ -761,7 +758,22 @@ const handleEdit = (row) => {
|
|
|
|
|
|
|
|
const handleDetail = (row) => {
|
|
const handleDetail = (row) => {
|
|
|
getCustomer(row.id).then((res) => {
|
|
getCustomer(row.id).then((res) => {
|
|
|
- currentUser.value = res.data
|
|
|
|
|
|
|
+ const data = res.data
|
|
|
|
|
+ // Convert areaId to area name
|
|
|
|
|
+ if (data.areaId) {
|
|
|
|
|
+ const area = allNodes.value.find(n => n.id === data.areaId)
|
|
|
|
|
+ data.areaName = area ? area.name : '-'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ data.areaName = '-'
|
|
|
|
|
+ }
|
|
|
|
|
+ // Convert stationId to station name
|
|
|
|
|
+ if (data.stationId) {
|
|
|
|
|
+ const station = allNodes.value.find(n => n.id === data.stationId)
|
|
|
|
|
+ data.stationName = station ? station.name : '-'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ data.stationName = '-'
|
|
|
|
|
+ }
|
|
|
|
|
+ currentUser.value = data
|
|
|
detailActiveTab.value = 'info'
|
|
detailActiveTab.value = 'info'
|
|
|
loadDetailPets(row.id)
|
|
loadDetailPets(row.id)
|
|
|
loadDetailLogs(row.id, 'customer')
|
|
loadDetailLogs(row.id, 'customer')
|
|
@@ -848,12 +860,6 @@ const handleCommand = (command, row) => {
|
|
|
handleRemark(row)
|
|
handleRemark(row)
|
|
|
} else if (command === 'delete') {
|
|
} else if (command === 'delete') {
|
|
|
handleDelete(row)
|
|
handleDelete(row)
|
|
|
- } else if (command === 'enable') {
|
|
|
|
|
- row.status = 0
|
|
|
|
|
- handleStatusChange(row)
|
|
|
|
|
- } else if (command === 'disable') {
|
|
|
|
|
- row.status = 1
|
|
|
|
|
- handleStatusChange(row)
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|