代码提交
This commit is contained in:
parent
12b6d3fe79
commit
5d978c4ac8
@ -1,4 +1,4 @@
|
|||||||
NODE_ENV = 'development'
|
NODE_ENV = 'development'
|
||||||
|
|
||||||
# 开发环境API地址
|
# 开发环境API地址
|
||||||
VUE_APP_BASE_API = http://192.168.137.38:8080
|
VUE_APP_BASE_API = http://192.168.137.3:8080/api
|
@ -83,17 +83,16 @@ export function listAssetLocationTree() {
|
|||||||
// 获取公司列表
|
// 获取公司列表
|
||||||
export function listCompanies() {
|
export function listCompanies() {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/company/list',
|
url: '/admin/company/getAllCompanyDetails',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取用户列表
|
// 获取用户列表
|
||||||
export function listUsers(query) {
|
export function listUsers() {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/list',
|
url: '/v1/member/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
7
pc/src/api/bak/merchant/index.js
Normal file
7
pc/src/api/bak/merchant/index.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// 导出所有子模块
|
||||||
|
export * from './lead'
|
||||||
|
|
||||||
|
// 未来可以添加其他子模块,如:
|
||||||
|
// export * from './team'
|
||||||
|
// export * from './personnel'
|
||||||
|
// 等等
|
151
pc/src/api/bak/merchant/lead.js
Normal file
151
pc/src/api/bak/merchant/lead.js
Normal 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'
|
||||||
|
})
|
||||||
|
}
|
@ -130,3 +130,11 @@ export function getFloorListByBuilding(buildingId) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 收支账号管理
|
||||||
|
export function getAllAccounts() {
|
||||||
|
return request({
|
||||||
|
url: `/admin/account/getAllAccounts`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
@ -258,3 +258,83 @@ export function getBuildingList(projectId) {
|
|||||||
method: 'get'
|
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
|
||||||
|
})
|
||||||
|
}
|
@ -3,15 +3,29 @@ import request from '@/utils/request'
|
|||||||
// 招商团队相关API
|
// 招商团队相关API
|
||||||
export function getMerchantTeamList(params) {
|
export function getMerchantTeamList(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/team/list',
|
url: '/bizTeam/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
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) {
|
export function addMerchantTeam(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/team',
|
url: '/bizTeam',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@ -19,25 +33,41 @@ export function addMerchantTeam(data) {
|
|||||||
|
|
||||||
export function updateMerchantTeam(data) {
|
export function updateMerchantTeam(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/team',
|
url: '/bizTeam',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deleteMerchantTeam(id) {
|
export function deleteMerchantTeam(id, userId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/business/team/${id}`,
|
url: `/bizTeam/${id}`,
|
||||||
method: 'delete'
|
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
|
// 招商人员相关API
|
||||||
export function getMerchantPersonnelList(params) {
|
export function getMerchantPersonnelList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/personnel/list',
|
url: '/bizPersonnel/queryAllPersonnel',
|
||||||
method: 'get',
|
method: 'post',
|
||||||
params
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,16 +87,33 @@ export function getPersonnelDetail(id) {
|
|||||||
|
|
||||||
export function addMerchantPersonnel(data) {
|
export function addMerchantPersonnel(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/personnel',
|
url: '/bizPersonnel',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function removeMerchantPersonnel(id) {
|
export function batchAddMerchantPersonnel(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/business/personnel/${id}`,
|
url: '/bizPersonnel/batch',
|
||||||
method: 'delete'
|
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
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,3 +300,284 @@ export function checkTagName(params) {
|
|||||||
params
|
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'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -59,3 +59,12 @@ export function getAllProjectStatistics() {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取标签列表
|
||||||
|
export function getTagByType(data) {
|
||||||
|
return request({
|
||||||
|
url: '/admin/tag/getTagsByType',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
@ -18,6 +18,12 @@ export default {
|
|||||||
component: () => import('@/views/finance/receiptSetting/index.vue'),
|
component: () => import('@/views/finance/receiptSetting/index.vue'),
|
||||||
name: 'ReceiptSetting',
|
name: 'ReceiptSetting',
|
||||||
meta: { title: '收据设置', icon: 'el-icon-document' }
|
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
56
pc/src/utils/auth.js
Normal 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')
|
||||||
|
}
|
@ -4,8 +4,8 @@ import { API_SUCCESS_CODE } from './constants'
|
|||||||
|
|
||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
// baseURL: '/', // 修改为相对路径,使用代理
|
baseURL: '/', // 修改为相对路径,使用代理
|
||||||
baseURL: process.env.VUE_APP_BASE_API, // 使用环境变量中的接口地址
|
// baseURL: process.env.VUE_APP_BASE_API, // 使用环境变量中的接口地址
|
||||||
|
|
||||||
timeout: 10000 // 请求超时时间
|
timeout: 10000 // 请求超时时间
|
||||||
})
|
})
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
<el-option
|
<el-option
|
||||||
v-for="item in adminOptions"
|
v-for="item in adminOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.memberName"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -51,7 +51,7 @@
|
|||||||
<el-option
|
<el-option
|
||||||
v-for="item in companyOptions"
|
v-for="item in companyOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.companyName"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -226,7 +226,7 @@
|
|||||||
import { getAsset, addAsset, updateAsset, listCompanies, listUsers, uploadAssetImage, checkAssetCode } from '@/api/asset/inventory'
|
import { getAsset, addAsset, updateAsset, listCompanies, listUsers, uploadAssetImage, checkAssetCode } from '@/api/asset/inventory'
|
||||||
import { getClassificationTree } from '@/api/asset/classification'
|
import { getClassificationTree } from '@/api/asset/classification'
|
||||||
import { getLocationTree } from '@/api/asset/location'
|
import { getLocationTree } from '@/api/asset/location'
|
||||||
|
import { API_SUCCESS_CODE } from '@/utils/constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AssetForm',
|
name: 'AssetForm',
|
||||||
@ -350,7 +350,7 @@ export default {
|
|||||||
getAssetDetail() {
|
getAssetDetail() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
getAsset(this.assetId).then(response => {
|
getAsset(this.assetId).then(response => {
|
||||||
if (response.code === '000000') {
|
if (response.code === API_SUCCESS_CODE) {
|
||||||
this.form = response.data || {}
|
this.form = response.data || {}
|
||||||
|
|
||||||
// 如果有管理员,添加到选项中
|
// 如果有管理员,添加到选项中
|
||||||
@ -371,7 +371,7 @@ export default {
|
|||||||
/** 获取资产分类树形选项 */
|
/** 获取资产分类树形选项 */
|
||||||
getClassificationOptions() {
|
getClassificationOptions() {
|
||||||
getClassificationTree({ status: '1' }).then(response => {
|
getClassificationTree({ status: '1' }).then(response => {
|
||||||
if (response.code === '000000') {
|
if (response.code === API_SUCCESS_CODE) {
|
||||||
this.classificationOptions = this.processClassificationTree(response.data || [])
|
this.classificationOptions = this.processClassificationTree(response.data || [])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -404,7 +404,7 @@ export default {
|
|||||||
/** 获取位置树选项 */
|
/** 获取位置树选项 */
|
||||||
getLocationOptions() {
|
getLocationOptions() {
|
||||||
getLocationTree().then(response => {
|
getLocationTree().then(response => {
|
||||||
if (response.code === '000000') {
|
if (response.code === API_SUCCESS_CODE) {
|
||||||
this.locationOptions = this.processLocationTree(response.data || [])
|
this.locationOptions = this.processLocationTree(response.data || [])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -436,7 +436,7 @@ export default {
|
|||||||
/** 获取公司选项 */
|
/** 获取公司选项 */
|
||||||
getCompanyOptions() {
|
getCompanyOptions() {
|
||||||
listCompanies().then(response => {
|
listCompanies().then(response => {
|
||||||
if (response.code === '000000') {
|
if (response.code === API_SUCCESS_CODE) {
|
||||||
this.companyOptions = response.data || []
|
this.companyOptions = response.data || []
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@ -448,9 +448,9 @@ export default {
|
|||||||
/** 远程搜索管理员 */
|
/** 远程搜索管理员 */
|
||||||
remoteSearchAdmin(query) {
|
remoteSearchAdmin(query) {
|
||||||
this.adminLoading = true
|
this.adminLoading = true
|
||||||
listUsers({ name: query }).then(response => {
|
listUsers().then(response => {
|
||||||
this.adminLoading = false
|
this.adminLoading = false
|
||||||
if (response.code === '000000') {
|
if (response.code === API_SUCCESS_CODE) {
|
||||||
this.adminOptions = response.data || []
|
this.adminOptions = response.data || []
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@ -471,7 +471,7 @@ export default {
|
|||||||
// 检查资产编码是否已存在
|
// 检查资产编码是否已存在
|
||||||
if (!this.isEdit) {
|
if (!this.isEdit) {
|
||||||
checkAssetCode(this.form.code).then(response => {
|
checkAssetCode(this.form.code).then(response => {
|
||||||
if (response.code === '000000') {
|
if (response.code === API_SUCCESS_CODE) {
|
||||||
if (!response.data) {
|
if (!response.data) {
|
||||||
this.$message.error('资产编码已存在,请更换其他编码')
|
this.$message.error('资产编码已存在,请更换其他编码')
|
||||||
this.loading = false
|
this.loading = false
|
||||||
@ -496,7 +496,7 @@ export default {
|
|||||||
saveAsset(formData) {
|
saveAsset(formData) {
|
||||||
const method = this.isEdit ? updateAsset : addAsset
|
const method = this.isEdit ? updateAsset : addAsset
|
||||||
method(formData).then(response => {
|
method(formData).then(response => {
|
||||||
if (response.code === '000000') {
|
if (response.code === API_SUCCESS_CODE) {
|
||||||
this.$message.success(this.isEdit ? '修改成功' : '新增成功')
|
this.$message.success(this.isEdit ? '修改成功' : '新增成功')
|
||||||
this.$emit('refresh')
|
this.$emit('refresh')
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
@ -530,7 +530,7 @@ export default {
|
|||||||
|
|
||||||
/** 图片上传成功回调 */
|
/** 图片上传成功回调 */
|
||||||
handleImageSuccess(response) {
|
handleImageSuccess(response) {
|
||||||
if (response.code === '000000') {
|
if (response.code === API_SUCCESS_CODE) {
|
||||||
this.form.imageUrl = response.data.url
|
this.form.imageUrl = response.data.url
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(response.msg || '上传图片失败')
|
this.$message.error(response.msg || '上传图片失败')
|
||||||
|
1097
pc/src/views/finance/chargeStandard/index.vue
Normal file
1097
pc/src/views/finance/chargeStandard/index.vue
Normal file
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
@ -20,8 +20,8 @@
|
|||||||
placeholder="请输入分组名称"
|
placeholder="请输入分组名称"
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
size="small"
|
||||||
@keyup.enter.native="handleGroupSearch">
|
>
|
||||||
<el-button slot="append" icon="el-icon-search" @click="handleGroupSearch"></el-button>
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="group-menu">
|
<div class="group-menu">
|
||||||
@ -179,7 +179,7 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="标签名称" prop="names">
|
<el-form-item v-if="tagDialogType === 'add'" label="标签名称" prop="names">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="tagForm.names"
|
v-model="tagForm.names"
|
||||||
multiple
|
multiple
|
||||||
@ -191,6 +191,9 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
<div class="el-form-item-tip">按回车键可输入多个标签名称</div>
|
<div class="el-form-item-tip">按回车键可输入多个标签名称</div>
|
||||||
</el-form-item>
|
</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>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="tagDialogVisible = false">取 消</el-button>
|
<el-button @click="tagDialogVisible = false">取 消</el-button>
|
||||||
@ -221,128 +224,158 @@ import {
|
|||||||
export default {
|
export default {
|
||||||
name: 'TagManagement',
|
name: 'TagManagement',
|
||||||
data() {
|
data() {
|
||||||
// 校验分组名称是否重复
|
// 校验分组名称
|
||||||
const validateGroupName = (rule, value, callback) => {
|
const validateGroupName = (rule, value, callback) => {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
callback(new Error('请输入分组名称'))
|
callback(new Error('请输入分组名称'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑时不需要校验自身名称
|
|
||||||
if (this.groupDialogType === 'edit' && this.groupForm.originalName === value) {
|
|
||||||
callback()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
groupName: value
|
groupName: value
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.groupDialogType === 'edit') {
|
if (this.groupForm.id) {
|
||||||
params.id = this.groupForm.id
|
params.id = this.groupForm.id
|
||||||
}
|
}
|
||||||
|
|
||||||
checkTagGroupName(params).then(res => {
|
checkTagGroupName(params).then(res => {
|
||||||
if (res.success && res.data) {
|
if (res.code === '0000000000000000') {
|
||||||
callback()
|
if (res.data) {
|
||||||
} else {
|
|
||||||
callback(new Error('分组名称已存在'))
|
callback(new Error('分组名称已存在'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
callback(new Error('验证失败,请重试'))
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
callback(new Error('校验分组名称失败'))
|
callback(new Error('验证失败,请重试'))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 校验标签名称是否重复
|
// 校验标签名称
|
||||||
const validateTagName = (rule, value, callback) => {
|
const validateTagName = (rule, value, callback) => {
|
||||||
if (!value || value.length === 0) {
|
if (!value || value.length === 0) {
|
||||||
callback(new Error('请输入至少一个标签名称'))
|
callback(new Error('请输入标签名称'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多标签情况下,暂不支持前端检查
|
// 批量添加标签时,只检查第一个标签名称
|
||||||
if (value.length > 1 || this.tagDialogType === 'add') {
|
const firstTagName = value[0]
|
||||||
callback()
|
const params = {
|
||||||
return
|
groupId: this.tagForm.groupId,
|
||||||
|
tagName: firstTagName
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑时不需要校验自身名称
|
if (this.tagForm.id) {
|
||||||
if (this.tagDialogType === 'edit' && this.tagForm.originalName === value[0]) {
|
params.id = this.tagForm.id
|
||||||
|
}
|
||||||
|
|
||||||
|
checkTagName(params).then(res => {
|
||||||
|
if (res.code === '0000000000000000') {
|
||||||
|
if (res.data) {
|
||||||
|
callback(new Error(`标签名称"${firstTagName}"已存在`))
|
||||||
|
} else {
|
||||||
callback()
|
callback()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
callback(new Error('验证失败,请重试'))
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
callback(new Error('验证失败,请重试'))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验单个标签名称
|
||||||
|
const validateSingleTagName = (rule, value, callback) => {
|
||||||
|
if (!value) {
|
||||||
|
callback(new Error('请输入标签名称'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
groupId: this.tagForm.groupId,
|
groupId: this.tagForm.groupId,
|
||||||
tagName: value[0]
|
tagName: value
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.tagDialogType === 'edit') {
|
if (this.tagForm.id) {
|
||||||
params.id = this.tagForm.id
|
params.id = this.tagForm.id
|
||||||
}
|
}
|
||||||
|
|
||||||
checkTagName(params).then(res => {
|
checkTagName(params).then(res => {
|
||||||
if (res.success && res.data) {
|
if (res.code === '0000000000000000') {
|
||||||
callback()
|
if (res.data) {
|
||||||
|
callback(new Error(`标签名称"${value}"已存在`))
|
||||||
} else {
|
} else {
|
||||||
callback(new Error('标签名称在该分组下已存在'))
|
callback()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
callback(new Error('验证失败,请重试'))
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
callback(new Error('校验标签名称失败'))
|
callback(new Error('验证失败,请重试'))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// 分组相关数据
|
// 分组相关
|
||||||
groupList: [],
|
groupList: [],
|
||||||
groupSearchInput: '',
|
groupSearchInput: '',
|
||||||
activeGroupId: '',
|
activeGroupId: '',
|
||||||
activeGroup: null,
|
activeGroup: null,
|
||||||
|
|
||||||
|
// 标签相关
|
||||||
|
tagList: [],
|
||||||
|
tagQueryParams: {
|
||||||
|
groupId: '',
|
||||||
|
tagName: '',
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
|
tableLoading: false,
|
||||||
|
|
||||||
|
// 分组弹窗
|
||||||
groupDialogVisible: false,
|
groupDialogVisible: false,
|
||||||
groupDialogType: 'add', // add或edit
|
groupDialogType: 'add', // add 或 edit
|
||||||
groupForm: {
|
groupForm: {
|
||||||
id: '',
|
id: undefined,
|
||||||
groupName: '',
|
groupName: '',
|
||||||
tagNames: [],
|
tagNames: [],
|
||||||
originalName: '' // 用于校验
|
operatorId: this.$store.getters.userId,
|
||||||
|
tenantId: this.$store.getters.tenantId
|
||||||
},
|
},
|
||||||
groupRules: {
|
groupRules: {
|
||||||
groupName: [
|
groupName: [
|
||||||
{ required: true, message: '请输入分组名称', trigger: 'blur' },
|
{ required: true, message: '请输入分组名称', trigger: 'blur' },
|
||||||
{ min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' },
|
|
||||||
{ validator: validateGroupName, 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,
|
tagDialogVisible: false,
|
||||||
tagDialogType: 'add', // add或edit
|
tagDialogType: 'add', // add 或 edit
|
||||||
tagForm: {
|
tagForm: {
|
||||||
id: '',
|
id: undefined,
|
||||||
groupId: '',
|
groupId: '',
|
||||||
tagName: '',
|
|
||||||
names: [],
|
names: [],
|
||||||
originalName: '' // 用于校验
|
tagName: '',
|
||||||
|
tagColor: '#1890FF',
|
||||||
|
operatorId: this.$store.getters.userId,
|
||||||
|
tenantId: this.$store.getters.tenantId
|
||||||
},
|
},
|
||||||
tagRules: {
|
tagRules: {
|
||||||
groupId: [
|
groupId: [
|
||||||
{ required: true, message: '请选择分组', trigger: 'change' }
|
{ required: true, message: '请选择分组', trigger: 'change' }
|
||||||
],
|
],
|
||||||
names: [
|
names: [
|
||||||
{ required: true, message: '请输入至少一个标签名称', trigger: 'change' },
|
{ required: true, message: '请输入标签名称', trigger: 'change' },
|
||||||
{ validator: validateTagName, trigger: 'blur' }
|
{ 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())
|
group.groupName.toLowerCase().includes(this.groupSearchInput.toLowerCase())
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
// 分页后的标签列表
|
// 分页后的标签列表
|
||||||
paginationTagList() {
|
paginationTagList() {
|
||||||
let list = this.tagList
|
return 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)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.fetchGroupList()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 分组相关方法
|
// 加载分组列表
|
||||||
async fetchGroupList() {
|
loadGroupList() {
|
||||||
try {
|
getAllTagGroups().then(res => {
|
||||||
const res = await getAllTagGroups()
|
if (res.code === '0000000000000000') {
|
||||||
if (res.success) {
|
this.groupList = res.data
|
||||||
this.groupList = res.data || []
|
|
||||||
|
// 如果存在分组,默认选中第一个
|
||||||
if (this.groupList.length > 0 && !this.activeGroupId) {
|
if (this.groupList.length > 0 && !this.activeGroupId) {
|
||||||
this.activeGroupId = this.groupList[0].id.toString()
|
this.handleGroupSelect(this.groupList[0].id.toString())
|
||||||
this.activeGroup = this.groupList[0]
|
|
||||||
this.tagQueryParams.groupId = parseInt(this.activeGroupId)
|
|
||||||
this.fetchTagList(this.activeGroupId)
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 加载标签列表
|
||||||
|
loadTagList() {
|
||||||
|
if (!this.activeGroupId) {
|
||||||
|
this.tagList = []
|
||||||
|
this.total = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.tableLoading = true
|
||||||
|
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 {
|
} 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
|
||||||
|
this.tableLoading = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// 分组搜索
|
|
||||||
|
// 处理分组搜索
|
||||||
handleGroupSearch() {
|
handleGroupSearch() {
|
||||||
// 分组搜索功能已通过计算属性filteredGroupList实现
|
// 通过计算属性过滤
|
||||||
},
|
},
|
||||||
handleGroupSelect(index) {
|
|
||||||
this.activeGroupId = index
|
// 处理标签查询
|
||||||
this.activeGroup = this.groupList.find(group => group.id.toString() === index)
|
handleTagQuery() {
|
||||||
this.tagQueryParams.groupId = parseInt(index)
|
|
||||||
this.tagQueryParams.pageNum = 1
|
this.tagQueryParams.pageNum = 1
|
||||||
this.fetchTagList(index)
|
this.loadTagList()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 重置标签查询
|
||||||
|
resetTagQuery() {
|
||||||
|
this.tagQueryParams.tagName = ''
|
||||||
|
this.tagQueryParams.pageNum = 1
|
||||||
|
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() {
|
handleAddGroup() {
|
||||||
this.groupDialogType = 'add'
|
this.groupDialogType = 'add'
|
||||||
this.groupForm = {
|
this.groupForm = {
|
||||||
id: '',
|
id: undefined,
|
||||||
groupName: '',
|
groupName: '',
|
||||||
tagNames: [],
|
tagNames: [],
|
||||||
originalName: ''
|
operatorId: this.$store.getters.userId,
|
||||||
|
tenantId: this.$store.getters.tenantId
|
||||||
}
|
}
|
||||||
this.groupDialogVisible = true
|
this.groupDialogVisible = true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 打开编辑分组弹窗
|
||||||
handleEditGroup(group) {
|
handleEditGroup(group) {
|
||||||
this.groupDialogType = 'edit'
|
this.groupDialogType = 'edit'
|
||||||
this.groupForm = {
|
this.groupForm = {
|
||||||
id: group.id,
|
id: group.id,
|
||||||
groupName: group.groupName,
|
groupName: group.groupName,
|
||||||
tagNames: [],
|
operatorId: this.$store.getters.userId,
|
||||||
originalName: group.groupName
|
tenantId: this.$store.getters.tenantId
|
||||||
}
|
}
|
||||||
this.groupDialogVisible = true
|
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) {
|
handleDeleteGroup(group) {
|
||||||
this.$confirm('此操作将永久删除该分组, 是否继续?', '提示', {
|
this.$confirm(`确认删除分组"${group.groupName}"吗?该操作将删除该分组下所有标签`, '警告', {
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
// 判断分组下是否有标签
|
|
||||||
if (group.tagCount > 0) {
|
|
||||||
return this.$message.warning('该分组下存在标签,不能删除')
|
|
||||||
}
|
|
||||||
|
|
||||||
deleteTagGroup(group.id).then(res => {
|
deleteTagGroup(group.id).then(res => {
|
||||||
if (res.success) {
|
if (res.code === '0000000000000000') {
|
||||||
this.$message.success('删除成功')
|
this.$message.success('删除成功')
|
||||||
this.fetchGroupList()
|
|
||||||
|
// 如果删除的是当前激活的分组,重置激活状态
|
||||||
if (this.activeGroupId === group.id.toString()) {
|
if (this.activeGroupId === group.id.toString()) {
|
||||||
|
this.activeGroupId = ''
|
||||||
|
this.activeGroup = null
|
||||||
this.tagList = []
|
this.tagList = []
|
||||||
this.total = 0
|
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') {
|
this.loadGroupList()
|
||||||
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' ? '新增分组失败' : '更新分组失败')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 标签相关方法
|
// 打开新增标签弹窗
|
||||||
async fetchTagList(groupId) {
|
|
||||||
if (!groupId) 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
|
|
||||||
} 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
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 标签查询
|
|
||||||
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
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 重置标签查询
|
|
||||||
resetTagQuery() {
|
|
||||||
this.tagQueryParams.tagName = undefined
|
|
||||||
this.tagQueryParams.pageNum = 1
|
|
||||||
this.fetchTagList(this.activeGroupId)
|
|
||||||
},
|
|
||||||
handleAddTag() {
|
handleAddTag() {
|
||||||
this.tagDialogType = 'add'
|
this.tagDialogType = 'add'
|
||||||
this.tagForm = {
|
this.tagForm = {
|
||||||
id: '',
|
id: undefined,
|
||||||
groupId: this.activeGroupId,
|
groupId: this.activeGroupId,
|
||||||
tagName: '',
|
|
||||||
names: [],
|
names: [],
|
||||||
originalName: ''
|
tagColor: '#1890FF',
|
||||||
|
operatorId: this.$store.getters.userId,
|
||||||
|
tenantId: this.$store.getters.tenantId
|
||||||
}
|
}
|
||||||
this.tagDialogVisible = true
|
this.tagDialogVisible = true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 打开编辑标签弹窗
|
||||||
handleEditTag(tag) {
|
handleEditTag(tag) {
|
||||||
this.tagDialogType = 'edit'
|
this.tagDialogType = 'edit'
|
||||||
this.tagForm = {
|
this.tagForm = {
|
||||||
id: tag.id,
|
id: tag.id,
|
||||||
groupId: tag.groupId,
|
groupId: tag.groupId,
|
||||||
tagName: tag.tagName,
|
tagName: tag.tagName,
|
||||||
names: [tag.tagName],
|
tagColor: tag.tagColor || '#1890FF',
|
||||||
originalName: tag.tagName
|
operatorId: this.$store.getters.userId,
|
||||||
|
tenantId: this.$store.getters.tenantId
|
||||||
}
|
}
|
||||||
this.tagDialogVisible = true
|
this.tagDialogVisible = true
|
||||||
},
|
},
|
||||||
handleDeleteTag(tag) {
|
|
||||||
// 判断标签是否有关联的意向客户
|
// 提交标签表单
|
||||||
if (tag.intentionCustomerCount > 0) {
|
submitTagForm() {
|
||||||
return this.$message.warning('该标签已绑定意向客户,不能删除')
|
this.$refs.tagForm.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$confirm('此操作将永久删除该标签, 是否继续?', '提示', {
|
updateTag(data).then(res => {
|
||||||
confirmButtonText: '确定',
|
if (res.code === '0000000000000000') {
|
||||||
cancelButtonText: '取消',
|
this.$message.success('更新成功')
|
||||||
|
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)
|
||||||
|
})
|
||||||
|
|
||||||
|
Promise.all(promises).then(() => {
|
||||||
|
this.$message.success('新增成功')
|
||||||
|
this.tagDialogVisible = false
|
||||||
|
this.loadTagList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除标签
|
||||||
|
handleDeleteTag(tag) {
|
||||||
|
this.$confirm(`确认删除标签"${tag.tagName}"吗?`, '警告', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
deleteTag(tag.id).then(res => {
|
deleteTag(tag.id).then(res => {
|
||||||
if (res.success) {
|
if (res.code === '0000000000000000') {
|
||||||
this.$message.success('删除成功')
|
this.$message.success('删除成功')
|
||||||
this.fetchTagList(this.activeGroupId)
|
this.loadTagList()
|
||||||
} else {
|
|
||||||
this.$message.error(res.message || '删除失败')
|
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
|
||||||
this.$message.error('删除失败')
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
this.$message.info('已取消删除')
|
|
||||||
})
|
})
|
||||||
|
}).catch(() => {})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
submitTagForm() {
|
created() {
|
||||||
this.$refs.tagForm.validate(async (valid) => {
|
this.loadGroupList()
|
||||||
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) {
|
|
||||||
this.$message.success('更新成功')
|
|
||||||
} else {
|
|
||||||
this.$message.error(res.message || '更新标签失败')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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' ? '新增标签失败' : '更新标签失败')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 分页相关方法
|
|
||||||
handleSizeChange(val) {
|
|
||||||
this.tagQueryParams.pageSize = val
|
|
||||||
},
|
|
||||||
handleCurrentChange(val) {
|
|
||||||
this.tagQueryParams.pageNum = val
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -296,9 +296,9 @@
|
|||||||
:value="item.id">
|
:value="item.id">
|
||||||
<div style="display: flex; justify-content: space-between;">
|
<div style="display: flex; justify-content: space-between;">
|
||||||
<span>{{ item.accountName }}</span>
|
<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>
|
||||||
<div style="font-size: 12px; color: #909399">{{ item.bankAccount }}</div>
|
<div style="font-size: 12px; color: #909399">{{ item.bankAccountNumber }}</div>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -311,12 +311,12 @@
|
|||||||
<el-row :gutter="20" v-if="form.accountId">
|
<el-row :gutter="20" v-if="form.accountId">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="收款公司">
|
<el-form-item label="收款公司">
|
||||||
<el-input v-model="selectedAccount.company" disabled placeholder="收款公司" />
|
<el-input v-model="selectedAccount.companyName" disabled placeholder="收款公司" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="开户银行">
|
<el-form-item label="开户银行">
|
||||||
<el-input v-model="selectedAccount.bank" disabled placeholder="开户银行" />
|
<el-input v-model="selectedAccount.bankName" disabled placeholder="开户银行" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -324,7 +324,7 @@
|
|||||||
<el-row :gutter="20" v-if="form.accountId">
|
<el-row :gutter="20" v-if="form.accountId">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="银行账号">
|
<el-form-item label="银行账号">
|
||||||
<el-input v-model="selectedAccount.bankAccount" disabled placeholder="银行账号" />
|
<el-input v-model="selectedAccount.bankAccountNumber" disabled placeholder="银行账号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -340,13 +340,12 @@
|
|||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="楼宇标签" prop="buildingTags">
|
<el-form-item label="楼宇标签" prop="buildingTags">
|
||||||
<el-select v-model="form.buildingTags" multiple placeholder="请选择楼宇标签">
|
<el-select v-model="form.buildingTags" multiple placeholder="请选择楼宇标签">
|
||||||
<el-option label="AAA级写字楼" value="AAA级写字楼" />
|
<el-option
|
||||||
<el-option label="甲级写字楼" value="甲级写字楼" />
|
v-for="item in tagOptions"
|
||||||
<el-option label="乙级写字楼" value="乙级写字楼" />
|
:key="item.id"
|
||||||
<el-option label="商住两用" value="商住两用" />
|
:label="item.tagName"
|
||||||
<el-option label="商业综合体" value="商业综合体" />
|
:value="item.id"
|
||||||
<el-option label="创意园区" value="创意园区" />
|
/>
|
||||||
<el-option label="科技园区" value="科技园区" />
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -552,12 +551,12 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="收款公司">
|
<el-form-item label="收款公司">
|
||||||
<el-input v-model="detail.company" disabled />
|
<el-input v-model="detail.companyName" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="开户银行">
|
<el-form-item label="开户银行">
|
||||||
<el-input v-model="detail.bank" disabled />
|
<el-input v-model="detail.bankName" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -565,7 +564,7 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="银行账号">
|
<el-form-item label="银行账号">
|
||||||
<el-input v-model="detail.bankAccount" disabled />
|
<el-input v-model="detail.bankAccountNumber" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -663,8 +662,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getBuildingList, getBuildingDetail, addBuilding, updateBuilding, deleteBuilding, getBuildingStatistics } from '@/api/building'
|
import { getBuildingList, getBuildingDetail, addBuilding, updateBuilding, deleteBuilding, getBuildingStatistics } from '@/api/building'
|
||||||
import { getFloorList, addFloor, updateFloor, deleteFloor, getFloorListByBuilding } from '@/api/building'
|
import { getFloorList, addFloor, updateFloor, deleteFloor, getFloorListByBuilding,getAllAccounts } from '@/api/building'
|
||||||
import { getProjectList } from '@/api/project'
|
import { getProjectList,getTagByType } from '@/api/project'
|
||||||
|
import { getAccountList } from '@/api/finance'
|
||||||
|
import { API_SUCCESS_CODE } from '@/utils/constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'BuildingList',
|
name: 'BuildingList',
|
||||||
@ -733,11 +734,12 @@ export default {
|
|||||||
projectOptions: [],
|
projectOptions: [],
|
||||||
// 账户选项
|
// 账户选项
|
||||||
accountOptions: [],
|
accountOptions: [],
|
||||||
|
tagOptions: [], // 楼宇标签选项
|
||||||
// 选中的账户信息
|
// 选中的账户信息
|
||||||
selectedAccount: {
|
selectedAccount: {
|
||||||
company: '',
|
companyName: '',
|
||||||
bank: '',
|
bankName: '',
|
||||||
bankAccount: ''
|
bankAccountNumber: ''
|
||||||
},
|
},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
@ -911,6 +913,7 @@ export default {
|
|||||||
this.getList()
|
this.getList()
|
||||||
this.getProjectOptions()
|
this.getProjectOptions()
|
||||||
this.getAccountOptions()
|
this.getAccountOptions()
|
||||||
|
this.getTagOptions() // 获取楼宇标签选项
|
||||||
this.fetchStatistics()
|
this.fetchStatistics()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -929,7 +932,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getBuildingList(params).then(res => {
|
getBuildingList(params).then(res => {
|
||||||
if (res.code === '000000') {
|
if (res.code === API_SUCCESS_CODE) {
|
||||||
// 处理后端返回的数据,确保字段名映射正确
|
// 处理后端返回的数据,确保字段名映射正确
|
||||||
const listData = res.data.rows || res.data.list || []
|
const listData = res.data.rows || res.data.list || []
|
||||||
this.buildingList = listData.map(item => {
|
this.buildingList = listData.map(item => {
|
||||||
@ -960,7 +963,7 @@ export default {
|
|||||||
getProjectOptions() {
|
getProjectOptions() {
|
||||||
// 调用项目列表接口获取项目选项
|
// 调用项目列表接口获取项目选项
|
||||||
getProjectList({ pageSize: 100 }).then(res => {
|
getProjectList({ pageSize: 100 }).then(res => {
|
||||||
if (res.code === '000000') {
|
if (res.code === API_SUCCESS_CODE) {
|
||||||
this.projectOptions = res.data.list.map(item => {
|
this.projectOptions = res.data.list.map(item => {
|
||||||
return { id: item.id, name: item.projectName }
|
return { id: item.id, name: item.projectName }
|
||||||
})
|
})
|
||||||
@ -969,23 +972,16 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 获取账户选项 */
|
/** 获取账户选项 */
|
||||||
getAccountOptions() {
|
getAccountOptions() {
|
||||||
// TODO: 调用后端接口获取账户列表
|
getAllAccounts().then(res => {
|
||||||
this.accountOptions = [
|
if (res.code === API_SUCCESS_CODE) {
|
||||||
{
|
this.accountOptions = res.data
|
||||||
id: 1,
|
|
||||||
accountName: '示例账户1',
|
|
||||||
company: '示例收款公司1',
|
|
||||||
bank: '中国建设银行',
|
|
||||||
bankAccount: '6214000012345678'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
accountName: '示例账户2',
|
|
||||||
company: '示例收款公司2',
|
|
||||||
bank: '中国工商银行',
|
|
||||||
bankAccount: '6217000087654321'
|
|
||||||
}
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.accountOptions = [
|
||||||
|
{ id: 1, accountName: '示例账户1', company: '示例收款公司1', bankName: '中国建设银行', bankAccountNumber: '6214000012345678' },
|
||||||
|
{ id: 2, accountName: '示例账户2', company: '示例收款公司2', bankName: '中国工商银行', bankAccountNumber: '6217000087654321' }
|
||||||
]
|
]
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/** 查询楼层列表 */
|
/** 查询楼层列表 */
|
||||||
getFloorList(buildingId) {
|
getFloorList(buildingId) {
|
||||||
@ -996,7 +992,7 @@ export default {
|
|||||||
|
|
||||||
this.floorLoading = true
|
this.floorLoading = true
|
||||||
getFloorListByBuilding(buildingId).then(res => {
|
getFloorListByBuilding(buildingId).then(res => {
|
||||||
if (res.code === '000000') {
|
if (res.code === API_SUCCESS_CODE) {
|
||||||
this.floorList = res.data
|
this.floorList = res.data
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.msg || '获取楼层列表失败')
|
this.$message.error(res.msg || '获取楼层列表失败')
|
||||||
@ -1058,7 +1054,7 @@ export default {
|
|||||||
this.dialogTitle = '编辑楼宇'
|
this.dialogTitle = '编辑楼宇'
|
||||||
const id = row.id
|
const id = row.id
|
||||||
getBuildingDetail(id).then(res => {
|
getBuildingDetail(id).then(res => {
|
||||||
if (res.code === '000000') {
|
if (res.code === API_SUCCESS_CODE) {
|
||||||
// 保存原始楼宇名称用于验证
|
// 保存原始楼宇名称用于验证
|
||||||
this.originalBuildingName = res.data.buildingName
|
this.originalBuildingName = res.data.buildingName
|
||||||
// 将API返回的数据转换为数值类型
|
// 将API返回的数据转换为数值类型
|
||||||
@ -1179,7 +1175,7 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
deleteFloor(row.id).then(res => {
|
deleteFloor(row.id).then(res => {
|
||||||
if (res.code === '000000') {
|
if (res.code === API_SUCCESS_CODE) {
|
||||||
this.$message.success('删除成功')
|
this.$message.success('删除成功')
|
||||||
this.getFloorList(this.currentBuilding.id)
|
this.getFloorList(this.currentBuilding.id)
|
||||||
} else {
|
} else {
|
||||||
@ -1202,7 +1198,7 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
deleteBuilding(row.id).then(res => {
|
deleteBuilding(row.id).then(res => {
|
||||||
if (res.code === '000000') {
|
if (res.code === API_SUCCESS_CODE) {
|
||||||
this.$message.success('删除成功')
|
this.$message.success('删除成功')
|
||||||
this.getList()
|
this.getList()
|
||||||
} else {
|
} else {
|
||||||
@ -1215,6 +1211,9 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 对话框打开时的处理 */
|
/** 对话框打开时的处理 */
|
||||||
onDialogOpen() {
|
onDialogOpen() {
|
||||||
|
if (this.tagOptions.length === 0) {
|
||||||
|
this.getTagOptions()
|
||||||
|
}
|
||||||
// 等待DOM更新后重置验证
|
// 等待DOM更新后重置验证
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.$refs.form) {
|
if (this.$refs.form) {
|
||||||
@ -1265,7 +1264,7 @@ export default {
|
|||||||
|
|
||||||
action(formData).then(res => {
|
action(formData).then(res => {
|
||||||
console.log("API响应:", res)
|
console.log("API响应:", res)
|
||||||
if (res.code === '000000') {
|
if (res.code === API_SUCCESS_CODE) {
|
||||||
this.$message.success(successMsg)
|
this.$message.success(successMsg)
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.getList()
|
this.getList()
|
||||||
@ -1297,7 +1296,7 @@ export default {
|
|||||||
const action = isEdit ? updateFloor : addFloor
|
const action = isEdit ? updateFloor : addFloor
|
||||||
|
|
||||||
action(this.floorForm).then(res => {
|
action(this.floorForm).then(res => {
|
||||||
if (res.code === '000000') {
|
if (res.code === API_SUCCESS_CODE) {
|
||||||
this.$message.success(isEdit ? '编辑成功' : '新增成功')
|
this.$message.success(isEdit ? '编辑成功' : '新增成功')
|
||||||
this.floorFormVisible = false
|
this.floorFormVisible = false
|
||||||
this.getFloorList(this.currentBuilding.id)
|
this.getFloorList(this.currentBuilding.id)
|
||||||
@ -1334,7 +1333,7 @@ export default {
|
|||||||
pageNum: 1
|
pageNum: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
if (res.code === '000000') {
|
if (res.code === API_SUCCESS_CODE) {
|
||||||
// 计算总统计数据
|
// 计算总统计数据
|
||||||
const totalStats = {
|
const totalStats = {
|
||||||
buildingCount: res.data.total || 0,
|
buildingCount: res.data.total || 0,
|
||||||
@ -1379,12 +1378,12 @@ export default {
|
|||||||
/** 详情按钮操作 */
|
/** 详情按钮操作 */
|
||||||
handleDetail(row) {
|
handleDetail(row) {
|
||||||
getBuildingDetail(row.id).then(res => {
|
getBuildingDetail(row.id).then(res => {
|
||||||
if (res.code === '000000') {
|
if (res.code === API_SUCCESS_CODE) {
|
||||||
const buildingData = res.data
|
const buildingData = res.data
|
||||||
|
|
||||||
// 获取楼宇统计信息
|
// 获取楼宇统计信息
|
||||||
getBuildingStatistics(row.id).then(statsRes => {
|
getBuildingStatistics(row.id).then(statsRes => {
|
||||||
if (statsRes.code === '000000') {
|
if (statsRes.code === API_SUCCESS_CODE) {
|
||||||
// 合并基本信息和统计信息
|
// 合并基本信息和统计信息
|
||||||
const detailData = {
|
const detailData = {
|
||||||
...buildingData,
|
...buildingData,
|
||||||
@ -1593,9 +1592,9 @@ export default {
|
|||||||
const selectedAccount = this.accountOptions.find(item => item.id === this.form.accountId)
|
const selectedAccount = this.accountOptions.find(item => item.id === this.form.accountId)
|
||||||
if (selectedAccount) {
|
if (selectedAccount) {
|
||||||
this.selectedAccount = {
|
this.selectedAccount = {
|
||||||
company: selectedAccount.company,
|
companyName: selectedAccount.companyName,
|
||||||
bank: selectedAccount.bank,
|
bankName: selectedAccount.bankName,
|
||||||
bankAccount: selectedAccount.bankAccount
|
bankAccountNumber: selectedAccount.bankAccountNumber
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1666,6 +1665,17 @@ export default {
|
|||||||
buildingImage: '',
|
buildingImage: '',
|
||||||
facilities: []
|
facilities: []
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// 获取楼宇标签选项
|
||||||
|
getTagOptions() {
|
||||||
|
getTagByType({ tagType: "楼宇标签", tagName: "楼宇标签" }).then(res => {
|
||||||
|
this.tagOptions = res.data
|
||||||
|
}).catch(() => {
|
||||||
|
this.tagOptions = [
|
||||||
|
{ id: '1', tagName: '标签1' },
|
||||||
|
{ id: '2', tagName: '标签2' }
|
||||||
|
]
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,9 +146,9 @@
|
|||||||
<el-select v-model="form.projectTags" multiple placeholder="请选择项目标签">
|
<el-select v-model="form.projectTags" multiple placeholder="请选择项目标签">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="tag in tagOptions"
|
v-for="tag in tagOptions"
|
||||||
:key="tag.value"
|
:key="tag.id"
|
||||||
:label="tag.label"
|
:label="tag.tagName"
|
||||||
:value="tag.value">
|
:value="tag.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -222,7 +222,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getProjectList, getProjectDetail, addProject, updateProject, deleteProject, getAllProjectStatistics } from '@/api/project'
|
import { getProjectList, getProjectDetail, addProject, updateProject, deleteProject, getAllProjectStatistics, getTagByType } from '@/api/project'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ProjectList',
|
name: 'ProjectList',
|
||||||
@ -309,11 +309,14 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 获取标签选项 */
|
/** 获取标签选项 */
|
||||||
getTagOptions() {
|
getTagOptions() {
|
||||||
// TODO: 调用后端接口获取标签列表
|
getTagByType({ tagType: '项目标签',tagName: '项目标签' }).then(res => {
|
||||||
|
this.tagOptions = res.data
|
||||||
|
}).catch(() => {
|
||||||
this.tagOptions = [
|
this.tagOptions = [
|
||||||
{ value: '1', label: '标签1' },
|
{ id: '1', tagName: '标签1' },
|
||||||
{ value: '2', label: '标签2' }
|
{ id: '2', tagName: '标签2' }
|
||||||
]
|
]
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
|
@ -343,7 +343,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getRoom, addRoom, updateRoom, listProjects, listBuildings, listFloors, listRoomTags, listOwners } from '@/api/room'
|
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'
|
import { getBuildingList, getFloorList,getFloorListByBuilding} from '@/api/building'
|
||||||
export default {
|
export default {
|
||||||
name: 'RoomForm',
|
name: 'RoomForm',
|
||||||
@ -589,12 +589,13 @@ export default {
|
|||||||
|
|
||||||
/** 获取房源标签选项 */
|
/** 获取房源标签选项 */
|
||||||
getTagOptions() {
|
getTagOptions() {
|
||||||
listRoomTags().then(response => {
|
getTagByType({ tagType: "房源标签", tagName: "房源标签" }).then(res => {
|
||||||
if (response.code === '000000') {
|
this.tagOptions = res.data
|
||||||
this.tagOptions = response.data
|
}).catch(() => {
|
||||||
} else {
|
this.tagOptions = [
|
||||||
this.$message.error(response.msg || '获取房源标签失败')
|
{ id: '1', tagName: '标签1' },
|
||||||
}
|
{ id: '2', tagName: '标签2' }
|
||||||
|
]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listRoom, exportRoom, downloadTemplate, importRoom, listRoomTags, listProjects, listBuildings, listFloors, delRoom } from '@/api/room'
|
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 { getBuildingList,getFloorList,getFloorListByBuilding } from '@/api/building'
|
||||||
|
|
||||||
import DetailView from './components/DetailView'
|
import DetailView from './components/DetailView'
|
||||||
@ -389,12 +389,13 @@ export default {
|
|||||||
|
|
||||||
/** 获取房源标签选项 */
|
/** 获取房源标签选项 */
|
||||||
getTagOptions() {
|
getTagOptions() {
|
||||||
listRoomTags().then(response => {
|
getTagByType({ tagType: "房源标签", tagName: "房源标签" }).then(res => {
|
||||||
if (response.code === '000000') {
|
this.tagOptions = res.data
|
||||||
this.tagOptions = response.data || []
|
}).catch(() => {
|
||||||
} else {
|
this.tagOptions = [
|
||||||
this.$message.error(response.msg || '获取房源标签失败')
|
{ id: '1', tagName: '标签1' },
|
||||||
}
|
{ id: '2', tagName: '标签2' }
|
||||||
|
]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -10,14 +10,14 @@ module.exports = {
|
|||||||
warnings: false,
|
warnings: false,
|
||||||
errors: true
|
errors: true
|
||||||
},
|
},
|
||||||
// proxy: {
|
proxy: {
|
||||||
// '/': {
|
'/': {
|
||||||
// target: 'http://192.168.137.3:8080/api',
|
target: 'http://192.168.137.214:8082/api',
|
||||||
// changeOrigin: true,
|
changeOrigin: true,
|
||||||
// pathRewrite: {
|
pathRewrite: {
|
||||||
// '^/api': '/api'
|
'^/api': '/api'
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user