代码提交

This commit is contained in:
zengqiyang 2025-04-17 09:53:08 +08:00
parent 12b6d3fe79
commit 5d978c4ac8
22 changed files with 5806 additions and 920 deletions

View File

@ -1,4 +1,4 @@
NODE_ENV = 'development'
# 开发环境API地址
VUE_APP_BASE_API = http://192.168.137.38:8080
VUE_APP_BASE_API = http://192.168.137.3:8080/api

View File

@ -83,17 +83,16 @@ export function listAssetLocationTree() {
// 获取公司列表
export function listCompanies() {
return request({
url: '/system/company/list',
url: '/admin/company/getAllCompanyDetails',
method: 'get'
})
}
// 获取用户列表
export function listUsers(query) {
export function listUsers() {
return request({
url: '/system/user/list',
url: '/v1/member/list',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,7 @@
// 导出所有子模块
export * from './lead'
// 未来可以添加其他子模块,如:
// export * from './team'
// export * from './personnel'
// 等等

View File

@ -0,0 +1,151 @@
import request from '@/utils/request'
// 线索状态API
export function getLeadStatusList() {
return request({
url: '/bizLead/status/list',
method: 'get'
})
}
export function getLeadStatusDetail(id) {
return request({
url: `/bizLead/status/${id}`,
method: 'get'
})
}
export function addLeadStatus(data) {
return request({
url: '/bizLead/status',
method: 'post',
data
})
}
export function updateLeadStatus(data) {
return request({
url: '/bizLead/status',
method: 'put',
data
})
}
export function deleteLeadStatus(id, userId) {
return request({
url: `/bizLead/status/${id}`,
method: 'delete',
params: { userId }
})
}
export function checkLeadStatusName(statusName) {
return request({
url: '/bizLead/status/checkName',
method: 'get',
params: { statusName }
})
}
// 线索管理API
export function getLeadList(params) {
return request({
url: '/bizLead/list',
method: 'get',
params
})
}
export function getMyLeadList(params) {
return request({
url: '/bizLead/myLeads',
method: 'get',
params
})
}
export function getAllLeadList(params) {
return request({
url: '/bizLead/allLeads',
method: 'get',
params
})
}
export function getPublicLeadList(params) {
return request({
url: '/bizLead/publicLeads',
method: 'get',
params
})
}
export function getLeadDetail(id) {
return request({
url: `/bizLead/${id}`,
method: 'get'
})
}
export function addLead(data) {
return request({
url: '/bizLead',
method: 'post',
data
})
}
export function updateLead(data) {
return request({
url: '/bizLead',
method: 'put',
data
})
}
export function changeLeadStatus(id, statusId, userId) {
return request({
url: `/bizLead/${id}/status`,
method: 'put',
params: { statusId, userId }
})
}
export function changeLeadPersonnel(id, personnelId, userId) {
return request({
url: `/bizLead/${id}/personnel`,
method: 'put',
params: { personnelId, userId }
})
}
export function checkLeadPhone(phone) {
return request({
url: '/bizLead/checkPhone',
method: 'get',
params: { phone }
})
}
export function convertLeadToIntention(id, userId) {
return request({
url: `/bizLead/${id}/convert`,
method: 'post',
params: { userId }
})
}
export function deleteLead(id, userId) {
return request({
url: `/bizLead/${id}`,
method: 'delete',
params: { userId }
})
}
export function getLeadFollowHistory(leadId) {
return request({
url: `/bizLead/${leadId}/followHistory`,
method: 'get'
})
}

View File

@ -129,4 +129,12 @@ export function getFloorListByBuilding(buildingId) {
url: `/room/floor/building/${buildingId}`,
method: 'get'
})
}
// 收支账号管理
export function getAllAccounts() {
return request({
url: `/admin/account/getAllAccounts`,
method: 'get'
})
}

View File

@ -257,4 +257,84 @@ export function getBuildingList(projectId) {
url: `/business/building/list/${projectId}`,
method: 'get'
})
}
/* 收费标准相关接口 */
// 分页查询收费标准列表
export function getChargingStandardPage(query) {
return request({
url: '/finance/charging-standard/page',
method: 'get',
params: query
})
}
// 根据ID查询收费标准详情
export function getChargingStandardById(id) {
return request({
url: `/finance/charging-standard/${id}`,
method: 'get'
})
}
// 新增收费标准
export function addChargingStandard(data) {
return request({
url: '/finance/charging-standard',
method: 'post',
data: data
})
}
// 修改收费标准
export function updateChargingStandard(data) {
return request({
url: '/finance/charging-standard',
method: 'put',
data: data
})
}
// 删除收费标准
export function deleteChargingStandard(id) {
return request({
url: `/finance/charging-standard/${id}`,
method: 'delete'
})
}
// 更新收费标准状态(立即失效)
export function updateChargingStandardStatus(id) {
return request({
url: `/finance/charging-standard/${id}/updateStatus`,
method: 'put'
})
}
// 检查收费标准名称是否存在
export function checkChargingStandardName(standardName, id) {
return request({
url: '/finance/charging-standard/check-name',
method: 'get',
params: { standardName, id }
})
}
// 根据状态查询收费标准列表
export function getChargingStandardListByStatus(status) {
return request({
url: '/finance/charging-standard/list-by-status',
method: 'get',
params: { status }
})
}
// 获取费用类型树
export function getFeeTypeTree(params) {
return request({
url: '/feeForeign/categories',
method: 'get',
params
})
}

View File

@ -3,15 +3,29 @@ import request from '@/utils/request'
// 招商团队相关API
export function getMerchantTeamList(params) {
return request({
url: '/business/team/list',
url: '/bizTeam/list',
method: 'get',
params
})
}
export function getMerchantTeamDetail(id) {
return request({
url: `/bizTeam/${id}`,
method: 'get'
})
}
// 根据项目ID获取招商团队信息
export function getMerchantTeamByProjectId(projectId) {
return request({
url: `/bizTeam/project/${projectId}`,
method: 'get'
})
}
export function addMerchantTeam(data) {
return request({
url: '/business/team',
url: '/bizTeam',
method: 'post',
data
})
@ -19,25 +33,41 @@ export function addMerchantTeam(data) {
export function updateMerchantTeam(data) {
return request({
url: '/business/team',
url: '/bizTeam',
method: 'put',
data
})
}
export function deleteMerchantTeam(id) {
export function deleteMerchantTeam(id, userId) {
return request({
url: `/business/team/${id}`,
method: 'delete'
url: `/bizTeam/${id}`,
method: 'delete',
params: { userId }
})
}
export function checkTeamName(params) {
return request({
url: '/bizTeam/checkName',
method: 'get',
params
})
}
export function getProjectsList() {
return request({
url: '/bizTeam/projects',
method: 'get'
})
}
// 招商人员相关API
export function getMerchantPersonnelList(params) {
export function getMerchantPersonnelList(data) {
return request({
url: '/business/personnel/list',
method: 'get',
params
url: '/bizPersonnel/queryAllPersonnel',
method: 'post',
data
})
}
@ -57,16 +87,33 @@ export function getPersonnelDetail(id) {
export function addMerchantPersonnel(data) {
return request({
url: '/business/personnel',
url: '/bizPersonnel',
method: 'post',
data
})
}
export function removeMerchantPersonnel(id) {
export function batchAddMerchantPersonnel(data) {
return request({
url: `/business/personnel/${id}`,
method: 'delete'
url: '/bizPersonnel/batch',
method: 'post',
data
})
}
export function removeMerchantPersonnel(id, userId) {
return request({
url: `/bizPersonnel/${id}`,
method: 'delete',
params: { userId }
})
}
export function checkMemberExists(params) {
return request({
url: '/bizPersonnel/checkMember',
method: 'get',
params
})
}
@ -252,4 +299,285 @@ export function checkTagName(params) {
method: 'get',
params
})
}
}
// 线索状态API
export function getLeadStatusList() {
return request({
url: '/bizLead/status/list',
method: 'get'
})
}
export function getLeadStatusDetail(id) {
return request({
url: `/bizLead/status/${id}`,
method: 'get'
})
}
export function addLeadStatus(data) {
return request({
url: '/bizLead/status',
method: 'post',
data
})
}
export function updateLeadStatus(data) {
return request({
url: '/bizLead/status',
method: 'put',
data
})
}
export function deleteLeadStatus(id, userId) {
return request({
url: `/bizLead/status/${id}`,
method: 'delete',
params: { userId }
})
}
export function checkLeadStatusName(statusName) {
return request({
url: '/bizLead/status/checkName',
method: 'get',
params: { statusName }
})
}
// 线索管理API
export function getLeadList(params) {
return request({
url: '/bizLead/list',
method: 'get',
params
})
}
export function getMyLeadList(params) {
return request({
url: '/bizLead/myLeads',
method: 'get',
params
})
}
export function getAllLeadList(params) {
return request({
url: '/bizLead/allLeads',
method: 'get',
params
})
}
export function getPublicLeadList(params) {
return request({
url: '/bizLead/publicLeads',
method: 'get',
params
})
}
export function getLeadDetail(id) {
return request({
url: `/bizLead/${id}`,
method: 'get'
})
}
export function addLead(data) {
return request({
url: '/bizLead',
method: 'post',
data
})
}
export function updateLead(data) {
return request({
url: '/bizLead',
method: 'put',
data
})
}
export function changeLeadStatus(id, statusId, userId) {
return request({
url: `/bizLead/${id}/status`,
method: 'put',
params: { statusId, userId }
})
}
export function changeLeadPersonnel(id, personnelId, userId) {
return request({
url: `/bizLead/${id}/personnel`,
method: 'put',
params: { personnelId, userId }
})
}
export function checkLeadPhone(phone) {
return request({
url: '/bizLead/checkPhone',
method: 'get',
params: { phone }
})
}
export function convertLeadToIntention(id, userId) {
return request({
url: `/bizLead/${id}/convert`,
method: 'post',
params: { userId }
})
}
export function deleteLead(id, userId) {
return request({
url: `/bizLead/${id}`,
method: 'delete',
params: { userId }
})
}
export function getLeadFollowHistory(leadId) {
return request({
url: `/bizLead/${leadId}/followHistory`,
method: 'get'
})
}
// 意向客户相关API
export function getCustomerDetail(id) {
return request({
url: `/bizCustomer/${id}`,
method: 'get'
})
}
export function createCustomer(data) {
return request({
url: '/bizCustomer',
method: 'post',
data
})
}
export function updateCustomer(data) {
return request({
url: '/bizCustomer',
method: 'put',
data
})
}
export function deleteCustomer(id) {
return request({
url: `/bizCustomer/${id}`,
method: 'delete'
})
}
export function changeCustomerPersonnel(id, personnelId) {
return request({
url: `/bizCustomer/personnel/${id}/${personnelId}`,
method: 'put'
})
}
export function changeCustomerStatus(id, statusId) {
return request({
url: `/bizCustomer/status/${id}/${statusId}`,
method: 'put'
})
}
export function checkCustomerPhone(params) {
return request({
url: '/bizCustomer/checkPhone',
method: 'get',
params
})
}
export function getMyCustomerList(data) {
return request({
url: '/bizCustomer/myCustomer',
method: 'post',
data
})
}
export function getAllCustomerList(data) {
return request({
url: '/bizCustomer/allCustomer',
method: 'post',
data
})
}
export function getPublicCustomerList(data) {
return request({
url: '/bizCustomer/publicCustomer',
method: 'post',
data
})
}
export function followCustomer(data) {
return request({
url: '/bizCustomer/follow',
method: 'post',
data
})
}
export function getCustomerFollowHistory(customerId) {
return request({
url: `/bizCustomer/followHistory/${customerId}`,
method: 'get'
})
}
export function assignCustomer(id, params) {
return request({
url: `/bizCustomer/${id}/assign`,
method: 'post',
params
})
}
export function returnCustomerToPublic(id, userId) {
return request({
url: `/bizCustomer/returnToPublic/${id}`,
method: 'post',
params: { userId }
})
}
export function getCustomerTagGroups() {
return request({
url: '/bizCustomer/tags/groups',
method: 'get'
})
}
export function saveCustomerTags(data) {
return request({
url: '/bizCustomer/tags',
method: 'post',
data
})
}
// 获取客户状态列表
export function getCustomerStatusList() {
return request({
url: '/bizCustomer/status/list',
method: 'get'
})
}

View File

@ -58,4 +58,13 @@ export function getAllProjectStatistics() {
url: '/room/project/statistics',
method: 'get'
})
}
}
// 获取标签列表
export function getTagByType(data) {
return request({
url: '/admin/tag/getTagsByType',
method: 'post',
data: data
})
}

View File

@ -18,6 +18,12 @@ export default {
component: () => import('@/views/finance/receiptSetting/index.vue'),
name: 'ReceiptSetting',
meta: { title: '收据设置', icon: 'el-icon-document' }
},
{
path: 'chargeStandard',
component: () => import('@/views/finance/chargeStandard/index.vue'),
name: 'ChargeStandard',
meta: { title: '收费标准', icon: 'el-icon-price-tag' }
}
]
}

56
pc/src/utils/auth.js Normal file
View File

@ -0,0 +1,56 @@
/**
* 用户鉴权相关工具方法
*/
/**
* 获取当前登录用户ID
* @returns {string} 用户ID
*/
export function getUserId() {
// 从本地存储中获取用户信息
const userInfo = localStorage.getItem('userInfo')
if (userInfo) {
try {
const user = JSON.parse(userInfo)
return user.id || user.userId || ''
} catch (e) {
console.error('解析用户信息失败', e)
return ''
}
}
return ''
}
/**
* 获取用户信息
* @returns {Object} 用户信息对象
*/
export function getUserInfo() {
const userInfo = localStorage.getItem('userInfo')
if (userInfo) {
try {
return JSON.parse(userInfo)
} catch (e) {
console.error('解析用户信息失败', e)
return {}
}
}
return {}
}
/**
* 保存用户信息到本地存储
* @param {Object} userInfo 用户信息对象
*/
export function setUserInfo(userInfo) {
if (userInfo) {
localStorage.setItem('userInfo', JSON.stringify(userInfo))
}
}
/**
* 清除用户信息
*/
export function clearUserInfo() {
localStorage.removeItem('userInfo')
}

View File

@ -4,8 +4,8 @@ import { API_SUCCESS_CODE } from './constants'
// 创建axios实例
const service = axios.create({
// baseURL: '/', // 修改为相对路径,使用代理
baseURL: process.env.VUE_APP_BASE_API, // 使用环境变量中的接口地址
baseURL: '/', // 修改为相对路径,使用代理
// baseURL: process.env.VUE_APP_BASE_API, // 使用环境变量中的接口地址
timeout: 10000 // 请求超时时间
})

View File

@ -39,7 +39,7 @@
<el-option
v-for="item in adminOptions"
:key="item.id"
:label="item.name"
:label="item.memberName"
:value="item.id"
/>
</el-select>
@ -51,7 +51,7 @@
<el-option
v-for="item in companyOptions"
:key="item.id"
:label="item.name"
:label="item.companyName"
:value="item.id"
/>
</el-select>
@ -226,7 +226,7 @@
import { getAsset, addAsset, updateAsset, listCompanies, listUsers, uploadAssetImage, checkAssetCode } from '@/api/asset/inventory'
import { getClassificationTree } from '@/api/asset/classification'
import { getLocationTree } from '@/api/asset/location'
import { API_SUCCESS_CODE } from '@/utils/constants'
export default {
name: 'AssetForm',
@ -350,7 +350,7 @@ export default {
getAssetDetail() {
this.loading = true
getAsset(this.assetId).then(response => {
if (response.code === '000000') {
if (response.code === API_SUCCESS_CODE) {
this.form = response.data || {}
//
@ -371,7 +371,7 @@ export default {
/** 获取资产分类树形选项 */
getClassificationOptions() {
getClassificationTree({ status: '1' }).then(response => {
if (response.code === '000000') {
if (response.code === API_SUCCESS_CODE) {
this.classificationOptions = this.processClassificationTree(response.data || [])
}
})
@ -404,7 +404,7 @@ export default {
/** 获取位置树选项 */
getLocationOptions() {
getLocationTree().then(response => {
if (response.code === '000000') {
if (response.code === API_SUCCESS_CODE) {
this.locationOptions = this.processLocationTree(response.data || [])
}
})
@ -436,7 +436,7 @@ export default {
/** 获取公司选项 */
getCompanyOptions() {
listCompanies().then(response => {
if (response.code === '000000') {
if (response.code === API_SUCCESS_CODE) {
this.companyOptions = response.data || []
}
}).catch(() => {
@ -448,9 +448,9 @@ export default {
/** 远程搜索管理员 */
remoteSearchAdmin(query) {
this.adminLoading = true
listUsers({ name: query }).then(response => {
listUsers().then(response => {
this.adminLoading = false
if (response.code === '000000') {
if (response.code === API_SUCCESS_CODE) {
this.adminOptions = response.data || []
}
}).catch(() => {
@ -471,7 +471,7 @@ export default {
//
if (!this.isEdit) {
checkAssetCode(this.form.code).then(response => {
if (response.code === '000000') {
if (response.code === API_SUCCESS_CODE) {
if (!response.data) {
this.$message.error('资产编码已存在,请更换其他编码')
this.loading = false
@ -496,7 +496,7 @@ export default {
saveAsset(formData) {
const method = this.isEdit ? updateAsset : addAsset
method(formData).then(response => {
if (response.code === '000000') {
if (response.code === API_SUCCESS_CODE) {
this.$message.success(this.isEdit ? '修改成功' : '新增成功')
this.$emit('refresh')
this.$emit('close')
@ -530,7 +530,7 @@ export default {
/** 图片上传成功回调 */
handleImageSuccess(response) {
if (response.code === '000000') {
if (response.code === API_SUCCESS_CODE) {
this.form.imageUrl = response.data.url
} else {
this.$message.error(response.msg || '上传图片失败')

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -20,8 +20,8 @@
placeholder="请输入分组名称"
clearable
size="small"
@keyup.enter.native="handleGroupSearch">
<el-button slot="append" icon="el-icon-search" @click="handleGroupSearch"></el-button>
>
</el-input>
</div>
<div class="group-menu">
@ -179,7 +179,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="标签名称" prop="names">
<el-form-item v-if="tagDialogType === 'add'" label="标签名称" prop="names">
<el-select
v-model="tagForm.names"
multiple
@ -191,6 +191,9 @@
</el-select>
<div class="el-form-item-tip">按回车键可输入多个标签名称</div>
</el-form-item>
<el-form-item v-else label="标签名称" prop="tagName">
<el-input v-model="tagForm.tagName" placeholder="请输入标签名称" style="width: 100%"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="tagDialogVisible = false"> </el-button>
@ -201,19 +204,19 @@
</template>
<script>
import {
import {
getTagGroupList,
getAllTagGroups,
getTagGroupDetail,
addTagGroup,
updateTagGroup,
addTagGroup,
updateTagGroup,
deleteTagGroup,
checkTagGroupName,
getTagList,
getTagListByGroupId,
getTagListByGroupId,
getTagDetail,
addTag,
updateTag,
addTag,
updateTag,
deleteTag,
checkTagName
} from '@/api/merchant'
@ -221,128 +224,158 @@ import {
export default {
name: 'TagManagement',
data() {
//
//
const validateGroupName = (rule, value, callback) => {
if (!value) {
callback(new Error('请输入分组名称'))
return
}
//
if (this.groupDialogType === 'edit' && this.groupForm.originalName === value) {
callback()
return
}
const params = {
groupName: value
}
if (this.groupDialogType === 'edit') {
if (this.groupForm.id) {
params.id = this.groupForm.id
}
checkTagGroupName(params).then(res => {
if (res.success && res.data) {
callback()
if (res.code === '0000000000000000') {
if (res.data) {
callback(new Error('分组名称已存在'))
} else {
callback()
}
} else {
callback(new Error('分组名称已存在'))
callback(new Error('验证失败,请重试'))
}
}).catch(() => {
callback(new Error('校验分组名称失败'))
callback(new Error('验证失败,请重试'))
})
}
//
//
const validateTagName = (rule, value, callback) => {
if (!value || value.length === 0) {
callback(new Error('请输入至少一个标签名称'))
callback(new Error('请输入标签名称'))
return
}
//
if (value.length > 1 || this.tagDialogType === 'add') {
callback()
return
//
const firstTagName = value[0]
const params = {
groupId: this.tagForm.groupId,
tagName: firstTagName
}
//
if (this.tagDialogType === 'edit' && this.tagForm.originalName === value[0]) {
callback()
if (this.tagForm.id) {
params.id = this.tagForm.id
}
checkTagName(params).then(res => {
if (res.code === '0000000000000000') {
if (res.data) {
callback(new Error(`标签名称"${firstTagName}"已存在`))
} else {
callback()
}
} else {
callback(new Error('验证失败,请重试'))
}
}).catch(() => {
callback(new Error('验证失败,请重试'))
})
}
//
const validateSingleTagName = (rule, value, callback) => {
if (!value) {
callback(new Error('请输入标签名称'))
return
}
const params = {
groupId: this.tagForm.groupId,
tagName: value[0]
tagName: value
}
if (this.tagDialogType === 'edit') {
if (this.tagForm.id) {
params.id = this.tagForm.id
}
checkTagName(params).then(res => {
if (res.success && res.data) {
callback()
if (res.code === '0000000000000000') {
if (res.data) {
callback(new Error(`标签名称"${value}"已存在`))
} else {
callback()
}
} else {
callback(new Error('标签名称在该分组下已存在'))
callback(new Error('验证失败,请重试'))
}
}).catch(() => {
callback(new Error('校验标签名称失败'))
callback(new Error('验证失败,请重试'))
})
}
return {
//
//
groupList: [],
groupSearchInput: '',
activeGroupId: '',
activeGroup: null,
//
tagList: [],
tagQueryParams: {
groupId: '',
tagName: '',
pageNum: 1,
pageSize: 10
},
total: 0,
tableLoading: false,
//
groupDialogVisible: false,
groupDialogType: 'add', // addedit
groupDialogType: 'add', // add edit
groupForm: {
id: '',
id: undefined,
groupName: '',
tagNames: [],
originalName: '' //
operatorId: this.$store.getters.userId,
tenantId: this.$store.getters.tenantId
},
groupRules: {
groupName: [
{ required: true, message: '请输入分组名称', trigger: 'blur' },
{ min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' },
{ validator: validateGroupName, trigger: 'blur' }
],
tagNames: [
{ required: true, message: '请输入至少一个标签名称', trigger: 'change' }
]
},
//
tagList: [],
tableLoading: false,
total: 0,
tagQueryParams: {
pageNum: 1,
pageSize: 10,
tagName: undefined,
groupId: null
},
//
tagDialogVisible: false,
tagDialogType: 'add', // addedit
tagDialogType: 'add', // add edit
tagForm: {
id: '',
id: undefined,
groupId: '',
tagName: '',
names: [],
originalName: '' //
tagName: '',
tagColor: '#1890FF',
operatorId: this.$store.getters.userId,
tenantId: this.$store.getters.tenantId
},
tagRules: {
groupId: [
{ required: true, message: '请选择分组', trigger: 'change' }
],
names: [
{ required: true, message: '请输入至少一个标签名称', trigger: 'change' },
{ validator: validateTagName, trigger: 'blur' }
{ required: true, message: '请输入标签名称', trigger: 'change' },
{ validator: validateTagName, trigger: 'change' }
],
tagName: [
{ required: true, message: '请输入标签名称', trigger: 'blur' },
{ validator: validateSingleTagName, trigger: 'blur' }
]
}
}
@ -357,353 +390,252 @@ export default {
group.groupName.toLowerCase().includes(this.groupSearchInput.toLowerCase())
)
},
//
paginationTagList() {
let list = this.tagList
if (this.tagQueryParams.tagName) {
list = list.filter(tag =>
tag.tagName.toLowerCase().includes(this.tagQueryParams.tagName.toLowerCase())
)
}
this.total = list.length
const start = (this.tagQueryParams.pageNum - 1) * this.tagQueryParams.pageSize
const end = start + this.tagQueryParams.pageSize
return list.slice(start, end)
return this.tagList
}
},
created() {
this.fetchGroupList()
},
methods: {
//
async fetchGroupList() {
try {
const res = await getAllTagGroups()
if (res.success) {
this.groupList = res.data || []
//
loadGroupList() {
getAllTagGroups().then(res => {
if (res.code === '0000000000000000') {
this.groupList = res.data
//
if (this.groupList.length > 0 && !this.activeGroupId) {
this.activeGroupId = this.groupList[0].id.toString()
this.activeGroup = this.groupList[0]
this.tagQueryParams.groupId = parseInt(this.activeGroupId)
this.fetchTagList(this.activeGroupId)
}
} else {
this.$message.error(res.message || '获取分组列表失败')
}
} catch (error) {
console.error('获取分组列表失败', error)
this.$message.error('获取分组列表失败')
}
},
//
handleGroupSearch() {
// filteredGroupList
},
handleGroupSelect(index) {
this.activeGroupId = index
this.activeGroup = this.groupList.find(group => group.id.toString() === index)
this.tagQueryParams.groupId = parseInt(index)
this.tagQueryParams.pageNum = 1
this.fetchTagList(index)
},
handleAddGroup() {
this.groupDialogType = 'add'
this.groupForm = {
id: '',
groupName: '',
tagNames: [],
originalName: ''
}
this.groupDialogVisible = true
},
handleEditGroup(group) {
this.groupDialogType = 'edit'
this.groupForm = {
id: group.id,
groupName: group.groupName,
tagNames: [],
originalName: group.groupName
}
this.groupDialogVisible = true
},
handleDeleteGroup(group) {
this.$confirm('此操作将永久删除该分组, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
if (group.tagCount > 0) {
return this.$message.warning('该分组下存在标签,不能删除')
}
deleteTagGroup(group.id).then(res => {
if (res.success) {
this.$message.success('删除成功')
this.fetchGroupList()
if (this.activeGroupId === group.id.toString()) {
this.tagList = []
this.total = 0
}
} else {
this.$message.error(res.message || '删除失败')
}
}).catch(() => {
this.$message.error('删除失败')
})
}).catch(() => {
this.$message.info('已取消删除')
})
},
submitGroupForm() {
this.$refs.groupForm.validate(async (valid) => {
if (valid) {
try {
const data = {
groupName: this.groupForm.groupName
}
if (this.groupDialogType === 'add') {
const res = await addTagGroup(data)
if (res.success) {
this.$message.success('新增成功')
//
if (this.groupForm.tagNames && this.groupForm.tagNames.length > 0) {
//
await this.fetchGroupList()
const newGroup = this.groupList.find(g => g.groupName === this.groupForm.groupName)
if (newGroup) {
//
for (const tagName of this.groupForm.tagNames) {
await addTag({
groupId: newGroup.id,
tagName: tagName
})
}
}
}
} else {
this.$message.error(res.message || '新增分组失败')
}
} else {
data.id = this.groupForm.id
const res = await updateTagGroup(data)
if (res.success) {
this.$message.success('更新成功')
} else {
this.$message.error(res.message || '更新分组失败')
}
}
this.groupDialogVisible = false
await this.fetchGroupList()
} catch (error) {
console.error(this.groupDialogType === 'add' ? '新增分组失败' : '更新分组失败', error)
this.$message.error(this.groupDialogType === 'add' ? '新增分组失败' : '更新分组失败')
this.handleGroupSelect(this.groupList[0].id.toString())
}
}
})
},
//
async fetchTagList(groupId) {
if (!groupId) return
//
loadTagList() {
if (!this.activeGroupId) {
this.tagList = []
this.total = 0
return
}
this.tableLoading = true
try {
const res = await getTagListByGroupId(groupId)
if (res.success) {
this.tagList = res.data || []
this.total = this.tagList.length
this.tagQueryParams.pageNum = 1
this.tagQueryParams.groupId = this.activeGroupId
getTagList(this.tagQueryParams).then(res => {
if (res.code === '0000000000000000') {
this.tagList = res.data.data
this.total = res.data.total
} else {
this.$message.error(res.message || '获取标签列表失败')
this.tagList = []
this.total = 0
}
} catch (error) {
console.error('获取标签列表失败', error)
this.$message.error('获取标签列表失败')
this.tableLoading = false
}).catch(() => {
this.tagList = []
this.total = 0
} finally {
this.tableLoading = false
}
})
},
//
//
handleGroupSearch() {
//
},
//
handleTagQuery() {
//
if (this.tagQueryParams.tagName) {
this.fetchTagsByParams()
} else {
this.fetchTagList(this.activeGroupId)
}
},
//
async fetchTagsByParams() {
this.tableLoading = true
try {
const params = {
...this.tagQueryParams,
pageNum: 1,
pageSize: 1000 //
}
const res = await getTagList(params)
if (res.success) {
this.tagList = res.data.list || []
this.total = res.data.total || 0
} else {
this.$message.error(res.message || '查询标签失败')
this.tagList = []
this.total = 0
}
} catch (error) {
console.error('查询标签失败', error)
this.$message.error('查询标签失败')
this.tagList = []
this.total = 0
} finally {
this.tableLoading = false
}
this.tagQueryParams.pageNum = 1
this.loadTagList()
},
//
resetTagQuery() {
this.tagQueryParams.tagName = undefined
this.tagQueryParams.tagName = ''
this.tagQueryParams.pageNum = 1
this.fetchTagList(this.activeGroupId)
this.loadTagList()
},
//
handleGroupSelect(groupId) {
this.activeGroupId = Number(groupId)
this.activeGroup = this.groupList.find(item => item.id.toString() === groupId)
//
this.tagQueryParams.tagName = ''
this.tagQueryParams.pageNum = 1
//
this.loadTagList()
},
//
handleSizeChange(val) {
this.tagQueryParams.pageSize = val
this.loadTagList()
},
//
handleCurrentChange(val) {
this.tagQueryParams.pageNum = val
this.loadTagList()
},
//
handleAddGroup() {
this.groupDialogType = 'add'
this.groupForm = {
id: undefined,
groupName: '',
tagNames: [],
operatorId: this.$store.getters.userId,
tenantId: this.$store.getters.tenantId
}
this.groupDialogVisible = true
},
//
handleEditGroup(group) {
this.groupDialogType = 'edit'
this.groupForm = {
id: group.id,
groupName: group.groupName,
operatorId: this.$store.getters.userId,
tenantId: this.$store.getters.tenantId
}
this.groupDialogVisible = true
},
//
submitGroupForm() {
this.$refs.groupForm.validate(valid => {
if (valid) {
const method = this.groupForm.id ? updateTagGroup : addTagGroup
const message = this.groupForm.id ? '更新成功' : '新增成功'
method(this.groupForm).then(res => {
if (res.code === '0000000000000000') {
this.$message.success(message)
this.groupDialogVisible = false
this.loadGroupList()
}
})
}
})
},
//
handleDeleteGroup(group) {
this.$confirm(`确认删除分组"${group.groupName}"吗?该操作将删除该分组下所有标签`, '警告', {
type: 'warning'
}).then(() => {
deleteTagGroup(group.id).then(res => {
if (res.code === '0000000000000000') {
this.$message.success('删除成功')
//
if (this.activeGroupId === group.id.toString()) {
this.activeGroupId = ''
this.activeGroup = null
this.tagList = []
this.total = 0
}
this.loadGroupList()
}
})
}).catch(() => {})
},
//
handleAddTag() {
this.tagDialogType = 'add'
this.tagForm = {
id: '',
id: undefined,
groupId: this.activeGroupId,
tagName: '',
names: [],
originalName: ''
tagColor: '#1890FF',
operatorId: this.$store.getters.userId,
tenantId: this.$store.getters.tenantId
}
this.tagDialogVisible = true
},
//
handleEditTag(tag) {
this.tagDialogType = 'edit'
this.tagForm = {
id: tag.id,
groupId: tag.groupId,
tagName: tag.tagName,
names: [tag.tagName],
originalName: tag.tagName
tagColor: tag.tagColor || '#1890FF',
operatorId: this.$store.getters.userId,
tenantId: this.$store.getters.tenantId
}
this.tagDialogVisible = true
},
handleDeleteTag(tag) {
//
if (tag.intentionCustomerCount > 0) {
return this.$message.warning('该标签已绑定意向客户,不能删除')
}
this.$confirm('此操作将永久删除该标签, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteTag(tag.id).then(res => {
if (res.success) {
this.$message.success('删除成功')
this.fetchTagList(this.activeGroupId)
} else {
this.$message.error(res.message || '删除失败')
}
}).catch(() => {
this.$message.error('删除失败')
})
}).catch(() => {
this.$message.info('已取消删除')
})
},
//
submitTagForm() {
this.$refs.tagForm.validate(async (valid) => {
this.$refs.tagForm.validate(valid => {
if (valid) {
try {
if (this.tagDialogType === 'add') {
//
if (this.tagForm.names.length > 1) {
let success = 0
let fail = 0
for (const name of this.tagForm.names) {
try {
const res = await addTag({
groupId: this.tagForm.groupId,
tagName: name
})
if (res.success) {
success++
} else {
fail++
}
} catch (error) {
fail++
}
}
if (success > 0) {
this.$message.success(`成功添加${success}个标签`)
}
if (fail > 0) {
this.$message.warning(`${fail}个标签添加失败`)
}
} else {
//
const res = await addTag({
groupId: this.tagForm.groupId,
tagName: this.tagForm.names[0]
})
if (res.success) {
this.$message.success('新增成功')
} else {
this.$message.error(res.message || '新增标签失败')
}
}
} else {
//
const res = await updateTag({
id: this.tagForm.id,
groupId: this.tagForm.groupId,
tagName: this.tagForm.names[0]
})
if (res.success) {
if (this.tagDialogType === 'edit') {
//
const data = {
id: this.tagForm.id,
groupId: this.tagForm.groupId,
tagName: this.tagForm.tagName,
tagColor: this.tagForm.tagColor,
operatorId: this.tagForm.operatorId,
tenantId: this.tagForm.tenantId
}
updateTag(data).then(res => {
if (res.code === '0000000000000000') {
this.$message.success('更新成功')
} else {
this.$message.error(res.message || '更新标签失败')
this.tagDialogVisible = false
this.loadTagList()
}
}
})
} else {
//
const promises = this.tagForm.names.map(name => {
const data = {
groupId: this.tagForm.groupId,
tagName: name,
tagColor: this.tagForm.tagColor,
operatorId: this.tagForm.operatorId,
tenantId: this.tagForm.tenantId
}
return addTag(data)
})
this.tagDialogVisible = false
await this.fetchTagList(this.tagForm.groupId)
//
if (this.activeGroupId !== this.tagForm.groupId) {
this.activeGroupId = this.tagForm.groupId
this.activeGroup = this.groupList.find(group => group.id.toString() === this.tagForm.groupId)
}
} catch (error) {
console.error(this.tagDialogType === 'add' ? '新增标签失败' : '更新标签失败', error)
this.$message.error(this.tagDialogType === 'add' ? '新增标签失败' : '更新标签失败')
Promise.all(promises).then(() => {
this.$message.success('新增成功')
this.tagDialogVisible = false
this.loadTagList()
})
}
}
})
},
//
handleSizeChange(val) {
this.tagQueryParams.pageSize = val
},
handleCurrentChange(val) {
this.tagQueryParams.pageNum = val
//
handleDeleteTag(tag) {
this.$confirm(`确认删除标签"${tag.tagName}"吗?`, '警告', {
type: 'warning'
}).then(() => {
deleteTag(tag.id).then(res => {
if (res.code === '0000000000000000') {
this.$message.success('删除成功')
this.loadTagList()
}
})
}).catch(() => {})
}
},
created() {
this.loadGroupList()
}
}
</script>

View File

@ -296,9 +296,9 @@
:value="item.id">
<div style="display: flex; justify-content: space-between;">
<span>{{ item.accountName }}</span>
<span style="color: #8492a6; font-size: 13px">{{ item.company }}</span>
<span style="color: #8492a6; font-size: 13px">{{ item.companyName }}</span>
</div>
<div style="font-size: 12px; color: #909399">{{ item.bankAccount }}</div>
<div style="font-size: 12px; color: #909399">{{ item.bankAccountNumber }}</div>
</el-option>
</el-select>
</el-form-item>
@ -311,12 +311,12 @@
<el-row :gutter="20" v-if="form.accountId">
<el-col :span="12">
<el-form-item label="收款公司">
<el-input v-model="selectedAccount.company" disabled placeholder="收款公司" />
<el-input v-model="selectedAccount.companyName" disabled placeholder="收款公司" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开户银行">
<el-input v-model="selectedAccount.bank" disabled placeholder="开户银行" />
<el-input v-model="selectedAccount.bankName" disabled placeholder="开户银行" />
</el-form-item>
</el-col>
</el-row>
@ -324,7 +324,7 @@
<el-row :gutter="20" v-if="form.accountId">
<el-col :span="12">
<el-form-item label="银行账号">
<el-input v-model="selectedAccount.bankAccount" disabled placeholder="银行账号" />
<el-input v-model="selectedAccount.bankAccountNumber" disabled placeholder="银行账号" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -340,13 +340,12 @@
<el-col :span="12">
<el-form-item label="楼宇标签" prop="buildingTags">
<el-select v-model="form.buildingTags" multiple placeholder="请选择楼宇标签">
<el-option label="AAA级写字楼" value="AAA级写字楼" />
<el-option label="甲级写字楼" value="甲级写字楼" />
<el-option label="乙级写字楼" value="乙级写字楼" />
<el-option label="商住两用" value="商住两用" />
<el-option label="商业综合体" value="商业综合体" />
<el-option label="创意园区" value="创意园区" />
<el-option label="科技园区" value="科技园区" />
<el-option
v-for="item in tagOptions"
:key="item.id"
:label="item.tagName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
@ -552,12 +551,12 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="收款公司">
<el-input v-model="detail.company" disabled />
<el-input v-model="detail.companyName" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开户银行">
<el-input v-model="detail.bank" disabled />
<el-input v-model="detail.bankName" disabled />
</el-form-item>
</el-col>
</el-row>
@ -565,7 +564,7 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="银行账号">
<el-input v-model="detail.bankAccount" disabled />
<el-input v-model="detail.bankAccountNumber" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
@ -663,8 +662,10 @@
<script>
import { getBuildingList, getBuildingDetail, addBuilding, updateBuilding, deleteBuilding, getBuildingStatistics } from '@/api/building'
import { getFloorList, addFloor, updateFloor, deleteFloor, getFloorListByBuilding } from '@/api/building'
import { getProjectList } from '@/api/project'
import { getFloorList, addFloor, updateFloor, deleteFloor, getFloorListByBuilding,getAllAccounts } from '@/api/building'
import { getProjectList,getTagByType } from '@/api/project'
import { getAccountList } from '@/api/finance'
import { API_SUCCESS_CODE } from '@/utils/constants'
export default {
name: 'BuildingList',
@ -733,11 +734,12 @@ export default {
projectOptions: [],
//
accountOptions: [],
tagOptions: [], //
//
selectedAccount: {
company: '',
bank: '',
bankAccount: ''
companyName: '',
bankName: '',
bankAccountNumber: ''
},
//
rules: {
@ -911,6 +913,7 @@ export default {
this.getList()
this.getProjectOptions()
this.getAccountOptions()
this.getTagOptions() //
this.fetchStatistics()
},
methods: {
@ -929,7 +932,7 @@ export default {
}
getBuildingList(params).then(res => {
if (res.code === '000000') {
if (res.code === API_SUCCESS_CODE) {
//
const listData = res.data.rows || res.data.list || []
this.buildingList = listData.map(item => {
@ -960,7 +963,7 @@ export default {
getProjectOptions() {
//
getProjectList({ pageSize: 100 }).then(res => {
if (res.code === '000000') {
if (res.code === API_SUCCESS_CODE) {
this.projectOptions = res.data.list.map(item => {
return { id: item.id, name: item.projectName }
})
@ -969,23 +972,16 @@ export default {
},
/** 获取账户选项 */
getAccountOptions() {
// TODO:
this.accountOptions = [
{
id: 1,
accountName: '示例账户1',
company: '示例收款公司1',
bank: '中国建设银行',
bankAccount: '6214000012345678'
},
{
id: 2,
accountName: '示例账户2',
company: '示例收款公司2',
bank: '中国工商银行',
bankAccount: '6217000087654321'
getAllAccounts().then(res => {
if (res.code === API_SUCCESS_CODE) {
this.accountOptions = res.data
}
]
}).catch(() => {
this.accountOptions = [
{ id: 1, accountName: '示例账户1', company: '示例收款公司1', bankName: '中国建设银行', bankAccountNumber: '6214000012345678' },
{ id: 2, accountName: '示例账户2', company: '示例收款公司2', bankName: '中国工商银行', bankAccountNumber: '6217000087654321' }
]
})
},
/** 查询楼层列表 */
getFloorList(buildingId) {
@ -996,7 +992,7 @@ export default {
this.floorLoading = true
getFloorListByBuilding(buildingId).then(res => {
if (res.code === '000000') {
if (res.code === API_SUCCESS_CODE) {
this.floorList = res.data
} else {
this.$message.error(res.msg || '获取楼层列表失败')
@ -1058,7 +1054,7 @@ export default {
this.dialogTitle = '编辑楼宇'
const id = row.id
getBuildingDetail(id).then(res => {
if (res.code === '000000') {
if (res.code === API_SUCCESS_CODE) {
//
this.originalBuildingName = res.data.buildingName
// API
@ -1179,7 +1175,7 @@ export default {
type: 'warning'
}).then(() => {
deleteFloor(row.id).then(res => {
if (res.code === '000000') {
if (res.code === API_SUCCESS_CODE) {
this.$message.success('删除成功')
this.getFloorList(this.currentBuilding.id)
} else {
@ -1202,7 +1198,7 @@ export default {
type: 'warning'
}).then(() => {
deleteBuilding(row.id).then(res => {
if (res.code === '000000') {
if (res.code === API_SUCCESS_CODE) {
this.$message.success('删除成功')
this.getList()
} else {
@ -1215,6 +1211,9 @@ export default {
},
/** 对话框打开时的处理 */
onDialogOpen() {
if (this.tagOptions.length === 0) {
this.getTagOptions()
}
// DOM
this.$nextTick(() => {
if (this.$refs.form) {
@ -1265,7 +1264,7 @@ export default {
action(formData).then(res => {
console.log("API响应:", res)
if (res.code === '000000') {
if (res.code === API_SUCCESS_CODE) {
this.$message.success(successMsg)
this.dialogVisible = false
this.getList()
@ -1297,7 +1296,7 @@ export default {
const action = isEdit ? updateFloor : addFloor
action(this.floorForm).then(res => {
if (res.code === '000000') {
if (res.code === API_SUCCESS_CODE) {
this.$message.success(isEdit ? '编辑成功' : '新增成功')
this.floorFormVisible = false
this.getFloorList(this.currentBuilding.id)
@ -1334,7 +1333,7 @@ export default {
pageNum: 1
})
if (res.code === '000000') {
if (res.code === API_SUCCESS_CODE) {
//
const totalStats = {
buildingCount: res.data.total || 0,
@ -1379,12 +1378,12 @@ export default {
/** 详情按钮操作 */
handleDetail(row) {
getBuildingDetail(row.id).then(res => {
if (res.code === '000000') {
if (res.code === API_SUCCESS_CODE) {
const buildingData = res.data
//
getBuildingStatistics(row.id).then(statsRes => {
if (statsRes.code === '000000') {
if (statsRes.code === API_SUCCESS_CODE) {
//
const detailData = {
...buildingData,
@ -1593,9 +1592,9 @@ export default {
const selectedAccount = this.accountOptions.find(item => item.id === this.form.accountId)
if (selectedAccount) {
this.selectedAccount = {
company: selectedAccount.company,
bank: selectedAccount.bank,
bankAccount: selectedAccount.bankAccount
companyName: selectedAccount.companyName,
bankName: selectedAccount.bankName,
bankAccountNumber: selectedAccount.bankAccountNumber
}
}
},
@ -1666,6 +1665,17 @@ export default {
buildingImage: '',
facilities: []
}
},
//
getTagOptions() {
getTagByType({ tagType: "楼宇标签", tagName: "楼宇标签" }).then(res => {
this.tagOptions = res.data
}).catch(() => {
this.tagOptions = [
{ id: '1', tagName: '标签1' },
{ id: '2', tagName: '标签2' }
]
})
}
}
}

View File

@ -146,9 +146,9 @@
<el-select v-model="form.projectTags" multiple placeholder="请选择项目标签">
<el-option
v-for="tag in tagOptions"
:key="tag.value"
:label="tag.label"
:value="tag.value">
:key="tag.id"
:label="tag.tagName"
:value="tag.id">
</el-option>
</el-select>
</el-form-item>
@ -222,7 +222,7 @@
</template>
<script>
import { getProjectList, getProjectDetail, addProject, updateProject, deleteProject, getAllProjectStatistics } from '@/api/project'
import { getProjectList, getProjectDetail, addProject, updateProject, deleteProject, getAllProjectStatistics, getTagByType } from '@/api/project'
export default {
name: 'ProjectList',
@ -309,11 +309,14 @@ export default {
},
/** 获取标签选项 */
getTagOptions() {
// TODO:
this.tagOptions = [
{ value: '1', label: '标签1' },
{ value: '2', label: '标签2' }
]
getTagByType({ tagType: '项目标签',tagName: '项目标签' }).then(res => {
this.tagOptions = res.data
}).catch(() => {
this.tagOptions = [
{ id: '1', tagName: '标签1' },
{ id: '2', tagName: '标签2' }
]
})
},
/** 搜索按钮操作 */
handleQuery() {

View File

@ -343,7 +343,7 @@
<script>
import { getRoom, addRoom, updateRoom, listProjects, listBuildings, listFloors, listRoomTags, listOwners } from '@/api/room'
import { getProjectList } from '@/api/project'
import { getProjectList,getTagByType } from '@/api/project'
import { getBuildingList, getFloorList,getFloorListByBuilding} from '@/api/building'
export default {
name: 'RoomForm',
@ -589,12 +589,13 @@ export default {
/** 获取房源标签选项 */
getTagOptions() {
listRoomTags().then(response => {
if (response.code === '000000') {
this.tagOptions = response.data
} else {
this.$message.error(response.msg || '获取房源标签失败')
}
getTagByType({ tagType: "房源标签", tagName: "房源标签" }).then(res => {
this.tagOptions = res.data
}).catch(() => {
this.tagOptions = [
{ id: '1', tagName: '标签1' },
{ id: '2', tagName: '标签2' }
]
})
},

View File

@ -206,7 +206,7 @@
<script>
import { listRoom, exportRoom, downloadTemplate, importRoom, listRoomTags, listProjects, listBuildings, listFloors, delRoom } from '@/api/room'
import { getProjectList } from '@/api/project'
import { getProjectList,getTagByType } from '@/api/project'
import { getBuildingList,getFloorList,getFloorListByBuilding } from '@/api/building'
import DetailView from './components/DetailView'
@ -389,12 +389,13 @@ export default {
/** 获取房源标签选项 */
getTagOptions() {
listRoomTags().then(response => {
if (response.code === '000000') {
this.tagOptions = response.data || []
} else {
this.$message.error(response.msg || '获取房源标签失败')
}
getTagByType({ tagType: "房源标签", tagName: "房源标签" }).then(res => {
this.tagOptions = res.data
}).catch(() => {
this.tagOptions = [
{ id: '1', tagName: '标签1' },
{ id: '2', tagName: '标签2' }
]
})
},

View File

@ -10,14 +10,14 @@ module.exports = {
warnings: false,
errors: true
},
// proxy: {
// '/': {
// target: 'http://192.168.137.3:8080/api',
// changeOrigin: true,
// pathRewrite: {
// '^/api': '/api'
// }
// }
// }
proxy: {
'/': {
target: 'http://192.168.137.214:8082/api',
changeOrigin: true,
pathRewrite: {
'^/api': '/api'
}
}
}
}
}