Compare commits

...

3 Commits

Author SHA1 Message Date
Wei_佳
97ce7c5ccc Merge branch 'main' of https://git.1024tool.vip/zfc/guzhi
* 'main' of https://git.1024tool.vip/zfc/guzhi:
  feat: 新增交易记录管理功能与统一上传接口

# Conflicts:
#	web/src/api/index.js
2025-11-21 11:00:22 +08:00
Wei_佳
85f8fbe694 feat: 优化评估审核页估值结果和联系方式显示逻辑,并移除API模拟数据 2025-11-21 10:55:49 +08:00
Wei_佳
e479bcfa97 feat: 优化评估审核页面数据展示逻辑,调整发票邮件发送附件处理并移除mock数据 2025-11-21 10:55:31 +08:00
7 changed files with 116 additions and 790 deletions

View File

@ -6,3 +6,4 @@ VITE_USE_PROXY = true
# base api
VITE_BASE_API = 'http://139.224.70.152:9990/api/v1'
# VITE_BASE_API = 'http://127.0.0.1:9999/api/v1'

View File

@ -1,395 +1,5 @@
import { request } from '@/utils'
const baseValuationDetail = {
valuation_result: 1180000,
created_at: '2024-11-10T09:30:00Z',
reviewed_at: null,
status: 'pending',
admin_notes: null,
asset_name: '蜀绣传承精品',
institution: '天府非遗文化发展有限公司',
industry: '文化创意',
annual_revenue: 980000,
rd_investment: 165000,
three_year_income: [890000, 975000, 1180000],
funding_status: '国家资助',
inheritor_level: '市级传承人',
inheritor_age_count: [4, 6, 2],
inheritor_certificates: [
'https://dummyimage.com/120x80/edf2ff/409eff&text=证书A1',
'https://dummyimage.com/120x80/fef6f0/f0a020&text=证书A2',
],
heritage_level: '国家级非遗',
heritage_asset_level: '一级保护',
patent_application_no: '1111111,2222222',
historical_evidence: {
artifacts: 1,
ancient_literature: 2,
inheritor_testimony: 0,
modern_research: 3,
},
patent_certificates: ['https://dummyimage.com/120x80/e8f5e9/34a853&text=专利1'],
pattern_images: ['https://dummyimage.com/120x80/f3e8ff/9c27b0&text=纹样1'],
application_maturity: '推广阶段',
application_coverage: '全国覆盖',
cooperation_depth: '品牌联名',
offline_activities: 4,
platform_accounts: {
bilibili: { account: 'B站@蜀绣', likes: 1260, comments: 320, shares: 188 },
},
sales_volume: 5200,
link_views: 86500,
circulation: '500-1000份',
last_market_activity: '近3个月',
monthly_transaction: '50-100万元',
price_fluctuation: [1200, 3200],
model_value_b: 1250000,
market_value_c: 1180000,
final_value_ab: 1220000,
dynamic_pledge_rate: 0.62,
calculation_result: {
flow: [
{
title: '基础估值',
description: '基于近三年收益与研发投入的模型估值',
value: '¥1,250,000',
},
{
title: '市场对标',
description: '结合同类资产市场成交价修正',
value: '¥1,180,000',
},
{
title: '综合校准',
description: '叠加ESG、政策匹配度得出最终估值',
value: '¥1,220,000',
},
],
},
}
const valuationRecords = [
{
id: 2001,
phone: '13800138001',
wechat: 'zhangsan_wx',
},
{
id: 2002,
phone: '13800138002',
wechat: 'lisi2024',
valuation_result: 880000,
created_at: '2024-11-09T14:20:00Z',
reviewed_at: '2024-11-09T16:45:00Z',
status: 'approved',
admin_notes: '评估结果合理,已通过审核',
asset_name: '景泰蓝掐丝珐琅',
institution: '京华非遗研究院',
application_maturity: '成熟期',
application_coverage: '华北地区',
cooperation_depth: '科技载体',
platform_accounts: {
douyin: { account: '抖音@景泰蓝工坊', likes: 2350, comments: 610, shares: 302 },
},
price_fluctuation: [980, 2680],
calculation_result: {
flow: [
{
title: '基础估值',
description: '模型估算品牌溢价后得出结果',
value: '¥900,000',
},
{
title: '市场对标',
description: '对比近六个月文博拍卖价格',
value: '¥860,000',
},
{
title: '综合校准',
description: '结合政策扶持与线上声量校准',
value: '¥880,000',
},
],
},
},
{
id: 2003,
phone: '13800138003',
wechat: 'wangwu_user',
valuation_result: 2100000,
created_at: '2024-11-08T16:45:00Z',
reviewed_at: '2024-11-08T18:30:00Z',
status: 'approved',
admin_notes: '评估价格偏高,但审核通过',
asset_name: '苗绣银饰',
institution: '黔锦民族文化有限公司',
industry: '民族工艺',
funding_status: '地方配套资金',
inheritor_level: '国家级代表性传承人',
inheritor_age_count: [2, 3, 1],
application_coverage: '西南片区',
platform_accounts: {
kuaishou: { account: '快手@苗绣手作', likes: 1800, comments: 420, shares: 210 },
},
price_fluctuation: [2600, 5200],
},
{
id: 2004,
phone: '13800138004',
wechat: 'zhaoliu_vip',
valuation_result: 560000,
created_at: '2024-11-07T11:15:00Z',
status: 'pending',
asset_name: '景德镇青花',
institution: '景尚文化传播有限公司',
industry: '陶瓷制造',
funding_status: '社会资本',
platform_accounts: {
bilibili: { account: 'B站@青花研习社', likes: 860, comments: 146, shares: 98 },
},
price_fluctuation: [560, 1200],
},
{
id: 2005,
phone: '13800138005',
wechat: 'sunqi888',
valuation_result: 1680000,
created_at: '2024-11-06T08:30:00Z',
reviewed_at: '2024-11-06T10:15:00Z',
status: 'approved',
admin_notes: '评估数据完整,审核通过',
asset_name: '藏医药香丸',
institution: '高原本草研究中心',
industry: '中医药',
application_coverage: '西藏及周边',
cooperation_depth: '国家外交礼品',
platform_accounts: {
douyin: { account: '抖音@藏医手作', likes: 3120, comments: 815, shares: 356 },
},
price_fluctuation: [3200, 7600],
},
{
id: 2006,
phone: '13800138006',
wechat: 'zhouba2024',
valuation_result: 950000,
created_at: '2024-11-05T13:20:00Z',
status: 'pending',
asset_name: '苏绣屏风',
institution: '苏澜绣坊',
funding_status: '企业自筹',
platform_accounts: {
bilibili: { account: 'B站@苏绣博物馆', likes: 980, comments: 240, shares: 130 },
},
price_fluctuation: [1500, 3600],
},
{
id: 2007,
phone: '13800138007',
wechat: 'wujiu_user',
valuation_result: 3200000,
created_at: '2024-11-04T15:45:00Z',
reviewed_at: '2024-11-04T17:20:00Z',
status: 'approved',
admin_notes: '高价值资产,评估结果准确',
asset_name: '宋锦织造',
institution: '苏州织造研究所',
funding_status: '国家重点补贴',
inheritor_age_count: [6, 8, 4],
application_maturity: '成熟期',
cooperation_depth: '科技载体',
platform_accounts: {
douyin: { account: '抖音@宋锦织造', likes: 4800, comments: 1020, shares: 520 },
},
},
{
id: 2008,
phone: '13800138008',
wechat: 'zhengshi_vip',
valuation_result: 750000,
created_at: '2024-11-03T10:10:00Z',
reviewed_at: '2024-11-03T12:00:00Z',
status: 'approved',
admin_notes: '评估流程规范,结果可信',
asset_name: '黄梅挑花',
institution: '徽楚非遗中心',
cooperation_depth: '品牌联名',
price_fluctuation: [980, 1800],
},
{
id: 2009,
phone: '13800138009',
wechat: 'chenjun2024',
valuation_result: 1890000,
created_at: '2024-11-02T14:30:00Z',
status: 'pending',
asset_name: '黎锦织造',
institution: '海南黎锦工坊',
funding_status: '国家资助',
application_coverage: '华南地区',
},
{
id: 2010,
phone: '13800138010',
wechat: 'liuxia_user',
valuation_result: 430000,
created_at: '2024-11-01T11:45:00Z',
reviewed_at: '2024-11-01T13:30:00Z',
status: 'approved',
admin_notes: '低价值资产,评估合理',
asset_name: '大漆工艺',
institution: '榫卯器物社',
funding_status: '地方专项',
cooperation_depth: '品牌联名',
platform_accounts: {
bilibili: { account: 'B站@大漆工坊', likes: 420, comments: 75, shares: 33 },
},
},
{
id: 2011,
phone: '13800138011',
wechat: 'zhaolei2024',
valuation_result: 2100000,
created_at: '2024-10-31T09:20:00Z',
reviewed_at: '2024-10-31T11:00:00Z',
status: 'approved',
admin_notes: '评估报告详细,数据支撑充分',
asset_name: '龙泉青瓷',
institution: '浙瓷非遗研究院',
cooperation_depth: '科技载体',
},
{
id: 2012,
phone: '13800138012',
wechat: 'sunmei_vip',
valuation_result: 680000,
created_at: '2024-10-30T16:15:00Z',
status: 'pending',
asset_name: '侗锦织造',
institution: '黔东南侗锦合作社',
funding_status: '社会资本',
},
]
const mockValuationDetails = valuationRecords.map((record) => ({
...baseValuationDetail,
...record,
}))
const mockAppUsers = [
{
id: 11111111,
phone: '15021982682',
wechat: 'f1498480844',
created_at: '2024-01-15T10:30:00Z',
notes: '测试用户1',
remaining_count: 1,
user_type: '体验用户',
},
{
id: 11111112,
phone: '13800138002',
wechat: 'wx_limming2024',
created_at: '2024-02-20T14:20:00Z',
notes: '付费用户',
remaining_count: 5,
user_type: '付费用户',
},
{
id: 11111113,
phone: '13800138003',
wechat: null,
created_at: '2024-03-10T08:45:00Z',
notes: null,
remaining_count: 0,
user_type: '体验用户',
},
{
id: 11111114,
phone: '13800138004',
wechat: 'chenjun_vip',
created_at: '2024-04-05T11:30:00Z',
notes: 'VIP用户',
remaining_count: 10,
user_type: 'VIP',
},
{
id: 11111115,
phone: '13800138005',
wechat: 'liuxia888',
created_at: '2024-05-12T16:15:00Z',
notes: '体验用户',
remaining_count: 3,
user_type: '体验用户',
},
{
id: 11111116,
phone: '13800138006',
wechat: null,
created_at: '2024-06-18T09:00:00Z',
notes: '新注册用户',
remaining_count: 2,
user_type: '体验用户',
},
{
id: 11111117,
phone: '13800138007',
wechat: 'zhaolei2024',
created_at: '2024-07-22T12:45:00Z',
notes: null,
remaining_count: 0,
user_type: '体验用户',
},
{
id: 11111118,
phone: '13800138008',
wechat: 'sunmei_user',
created_at: '2024-08-30T15:20:00Z',
notes: '活跃用户',
remaining_count: 7,
user_type: 'VIP',
},
]
const defaultInvoiceHeaders = [
{
company_name: '成都文创科技有限公司',
tax_number: '91510100MA7XYZ1234',
register_address: '四川省成都市高新区天府三街666号',
register_phone: '028-66666666',
bank_name: '招商银行成都分行',
bank_account: '6225 6666 8888 0000',
email: 'finance@scwenchuang.com',
},
{
company_name: '天府文化发展有限公司',
tax_number: '91510100678912345K',
register_address: '四川省成都市武侯区科华北路88号',
register_phone: '028-12345678',
bank_name: '中国工商银行成都分行',
bank_account: '6212 8888 0000 9999',
email: 'invoice@tfculture.com',
},
]
const defaultOperationLogs = [
{
time: '2025-10-31 18:30:30',
operator: 'admin',
records: ['剩余估值次数0 -> 1', '类型:付费估值', '备注:新用户'],
},
{
time: '2025-10-31 18:30:30',
operator: 'admin',
records: ['剩余估值次数2 -> 1', '类型:付费估值', '备注:退款'],
},
{
time: '2025-10-31 18:30:30',
operator: 'admin',
records: ['用户备注111111111111 -> 22222222222222222222'],
},
]
export default {
login: (data) => request.post('/base/access_token', data, { noNeedToken: true }),
getUserInfo: () => request.get('/base/userinfo'),
@ -430,379 +40,28 @@ export default {
// auditlog
getAuditLogList: (params = {}) => request.get('/auditlog/list', { params }),
// app users (客户端用户管理) - 使用现有的后端接口
getAppUserList: (params = {}) => {
// 模拟分页和搜索
let filteredUsers = [...mockAppUsers]
// 手机号搜索
if (params.phone) {
filteredUsers = filteredUsers.filter(user =>
user.phone.includes(params.phone)
)
}
// 微信号搜索
if (params.wechat) {
filteredUsers = filteredUsers.filter(user =>
user.wechat && user.wechat.includes(params.wechat)
)
}
// 注册时间筛选(日期范围)
if (params.created_at && Array.isArray(params.created_at) && params.created_at.length === 2) {
const [startTime, endTime] = params.created_at
filteredUsers = filteredUsers.filter(user => {
if (!user.created_at) return false
const userTime = new Date(user.created_at).getTime()
return userTime >= startTime && userTime <= endTime
})
}
// 分页处理
const page = Number(params.page) || 1
const pageSize = Number(params.page_size) || 10
const startIndex = (page - 1) * pageSize
const endIndex = startIndex + pageSize
const paginatedUsers = filteredUsers.slice(startIndex, endIndex)
// 返回 Promise 模拟异步请求
return new Promise((resolve) => {
setTimeout(() => {
resolve({
data: paginatedUsers,
total: filteredUsers.length,
page,
page_size: pageSize,
})
}, 300)
})
},
getAppUserById: (params = {}) =>
new Promise((resolve) => {
const id = Number(params.id)
const user = mockAppUsers.find((item) => item.id === id) || {}
setTimeout(() => {
resolve({
baseInfo: {
id: user.id,
phone: user.phone,
wechat: user.wechat,
register_time: user.created_at,
notes: user.notes,
remaining_count: user.remaining_count,
user_type: user.user_type || '体验用户',
},
invoiceHeaders: defaultInvoiceHeaders,
operationLogs: defaultOperationLogs,
})
}, 300)
}),
getAppUserList: (params = {}) => request.get('/app-user-admin/list', { params }),
updateAppUserQuota: (data = {}) => request.post('/app-user-admin/quota', data),
getAppUserQuotaLogs: ({ user_id, ...params } = {}) =>
request.get(`/app-user-admin/${user_id}/quota-logs`, { params }),
createAppUser: (data = {}) => request.post('/app-user/register', data),
updateAppUser: (data = {}) => request.post('/app-user/update', data),
deleteAppUser: (params = {}) => request.delete('/app-user/delete', { params }),
// invoice (开票记录)
getInvoiceList: (params = {}) => {
// Mock 数据
const mockInvoices = [
{
id: 1001,
created_at: '2024-11-10T09:30:00Z',
ticket_type: 'electronic',
phone: '13800138001',
email: 'zhangsan@company1.com',
company_name: '北京科技有限公司',
tax_number: '91110000123456789A',
register_address: '北京市朝阳区科技园区A座1001室',
register_phone: '010-12345678',
bank_name: '中国工商银行北京分行',
bank_account: '6222021234567890123',
invoice_type: 'special',
status: 'pending'
},
{
id: 1002,
created_at: '2024-11-09T14:20:00Z',
ticket_type: 'paper',
phone: '13800138002',
email: 'lisi@company2.com',
company_name: '上海贸易股份有限公司',
tax_number: '91310000987654321B',
register_address: '上海市浦东新区金融街B座2002室',
register_phone: '021-87654321',
bank_name: '中国建设银行上海分行',
bank_account: '6217001234567890124',
invoice_type: 'normal',
status: 'invoiced'
},
{
id: 1003,
created_at: '2024-11-08T16:45:00Z',
ticket_type: 'electronic',
phone: '13800138003',
email: 'wangwu@company3.com',
company_name: '深圳创新科技有限公司',
tax_number: '91440300456789012C',
register_address: '深圳市南山区高新技术园C座3003室',
register_phone: '0755-23456789',
bank_name: '招商银行深圳分行',
bank_account: '6214851234567890125',
invoice_type: 'special',
status: 'rejected'
},
{
id: 1004,
created_at: '2024-11-07T11:15:00Z',
ticket_type: 'paper',
phone: '13800138004',
email: 'zhaoliu@company4.com',
company_name: '广州制造业集团有限公司',
tax_number: '91440100789012345D',
register_address: '广州市天河区商务中心D座4004室',
register_phone: '020-34567890',
bank_name: '中国银行广州分行',
bank_account: '6013821234567890126',
invoice_type: 'normal',
status: 'pending'
},
{
id: 1005,
created_at: '2024-11-06T08:30:00Z',
ticket_type: 'electronic',
phone: '13800138005',
email: 'sunqi@company5.com',
company_name: '杭州互联网科技有限公司',
tax_number: '91330100012345678E',
register_address: '杭州市西湖区互联网小镇E座5005室',
register_phone: '0571-45678901',
bank_name: '浙商银行杭州分行',
bank_account: '6228481234567890127',
invoice_type: 'special',
status: 'invoiced'
},
{
id: 1006,
created_at: '2024-11-05T13:20:00Z',
ticket_type: 'paper',
phone: '13800138006',
email: 'zhouba@company6.com',
company_name: '成都软件开发有限公司',
tax_number: '91510100345678901F',
register_address: '成都市高新区软件园F座6006室',
register_phone: '028-56789012',
bank_name: '中国农业银行成都分行',
bank_account: '6230521234567890128',
invoice_type: 'normal',
status: 'pending'
},
{
id: 1007,
created_at: '2024-11-04T15:45:00Z',
ticket_type: 'electronic',
phone: '13800138007',
email: 'wujiu@company7.com',
company_name: '武汉新能源科技有限公司',
tax_number: '91420100678901234G',
register_address: '武汉市江汉区新能源产业园G座7007室',
register_phone: '027-67890123',
bank_name: '交通银行武汉分行',
bank_account: '6222601234567890129',
invoice_type: 'special',
status: 'invoiced'
},
{
id: 1008,
created_at: '2024-11-03T10:10:00Z',
ticket_type: 'paper',
phone: '13800138008',
email: 'zhengshi@company8.com',
company_name: '西安电子商务有限公司',
tax_number: '91610100901234567H',
register_address: '西安市雁塔区电商产业园H座8008室',
register_phone: '029-78901234',
bank_name: '中信银行西安分行',
bank_account: '6217711234567890130',
invoice_type: 'normal',
status: 'refunded'
},
{
id: 1009,
created_at: '2024-11-02T14:30:00Z',
ticket_type: 'electronic',
phone: '13800138009',
email: 'wangwu@company9.com',
company_name: '天津物流科技有限公司',
tax_number: '91120000234567890I',
register_address: '天津市滨海新区物流园I座9009室',
register_phone: '022-89012345',
bank_name: '民生银行天津分行',
bank_account: '6226221234567890131',
invoice_type: 'special',
status: 'refunded'
},
{
id: 1010,
created_at: '2024-11-01T11:45:00Z',
ticket_type: 'paper',
phone: '13800138010',
email: 'liuliu@company10.com',
company_name: '重庆智能制造有限公司',
tax_number: '91500000567890123J',
register_address: '重庆市渝北区智能制造园J座1010室',
register_phone: '023-90123456',
bank_name: '华夏银行重庆分行',
bank_account: '6228881234567890132',
invoice_type: 'normal',
status: 'rejected'
}
]
// 模拟分页和搜索
let filteredInvoices = [...mockInvoices]
// 手机号搜索
if (params.phone) {
filteredInvoices = filteredInvoices.filter(invoice =>
invoice.phone.includes(params.phone)
)
}
// 公司名称搜索
if (params.company_name) {
filteredInvoices = filteredInvoices.filter(invoice =>
invoice.company_name.includes(params.company_name)
)
}
// 公司税号搜索
if (params.tax_number) {
filteredInvoices = filteredInvoices.filter(invoice =>
invoice.tax_number.includes(params.tax_number)
)
}
// 状态筛选
if (params.status) {
filteredInvoices = filteredInvoices.filter(invoice =>
invoice.status === params.status
)
}
// 提交时间筛选
if (params.created_at && Array.isArray(params.created_at) && params.created_at.length === 2) {
const [startDate, endDate] = params.created_at
filteredInvoices = filteredInvoices.filter(invoice => {
const invoiceDate = new Date(invoice.created_at)
return invoiceDate >= new Date(startDate) && invoiceDate <= new Date(endDate)
})
}
// 分页处理
const page = params.page || 1
const pageSize = params.page_size || 10
const startIndex = (page - 1) * pageSize
const endIndex = startIndex + pageSize
const paginatedInvoices = filteredInvoices.slice(startIndex, endIndex)
// 返回 Promise 模拟异步请求
return new Promise((resolve) => {
setTimeout(() => {
resolve({
data: paginatedInvoices,
total: filteredInvoices.length,
page: page,
page_size: pageSize
})
}, 300) // 模拟网络延迟
})
},
getInvoiceById: (params = {}) => request.get('/invoice/detail', { params }),
createInvoice: (data = {}) => request.post('/invoice/create', data),
updateInvoice: (data = {}) => request.post('/invoice/update', data),
deleteInvoice: (params = {}) => request.delete('/invoice/delete', { params }),
updateInvoiceStatus: (data = {}) => request.post('/invoice/update-status', data),
remindInvoice: (data = {}) => request.post('/invoice/remind', data),
refundInvoice: (data = {}) => request.post('/invoice/refund', data),
sendInvoice: (data = {}) => request.post('/invoice/send', data),
// invoice (交易管理-对公转账记录)
getInvoiceList: (params = {}) => request.get('/transactions/receipts', { params }),
getInvoiceById: (params = {}) => request.get(`/transactions/receipts/${params.id}`, { params }),
// 后端接口要求请求体包裹在 data 字段下
sendInvoice: (data = {}) => request.post('/transactions/send-email', { data }),
// valuation (估值评估)
getValuationList: (params = {}) => {
// 模拟分页和搜索
let filteredValuations = [...mockValuationDetails]
// 手机号搜索
if (params.phone) {
filteredValuations = filteredValuations.filter(valuation =>
valuation.phone.includes(params.phone)
)
}
// 微信号搜索
if (params.wechat) {
filteredValuations = filteredValuations.filter(valuation =>
valuation.wechat && valuation.wechat.includes(params.wechat)
)
}
// 状态筛选
if (params.status) {
filteredValuations = filteredValuations.filter(valuation =>
valuation.status === params.status
)
}
// 提交时间筛选
if (params.created_at && Array.isArray(params.created_at) && params.created_at.length === 2) {
const [startDate, endDate] = params.created_at
filteredValuations = filteredValuations.filter(valuation => {
const valuationDate = new Date(valuation.created_at)
return valuationDate >= new Date(startDate) && valuationDate <= new Date(endDate)
})
}
// 分页处理
const page = params.page || 1
const pageSize = params.page_size || 10
const startIndex = (page - 1) * pageSize
const endIndex = startIndex + pageSize
const paginatedValuations = filteredValuations.slice(startIndex, endIndex).map((item) => ({
id: item.id,
phone: item.phone,
wechat: item.wechat,
valuation_result: item.valuation_result,
created_at: item.created_at,
reviewed_at: item.reviewed_at,
status: item.status,
admin_notes: item.admin_notes,
}))
// 返回 Promise 模拟异步请求
return new Promise((resolve) => {
setTimeout(() => {
resolve({
data: paginatedValuations,
total: filteredValuations.length,
page: page,
page_size: pageSize
})
}, 300) // 模拟网络延迟
})
},
getValuationById: (params = {}) => {
const id = Number(params.valuation_id || params.id)
return new Promise((resolve, reject) => {
setTimeout(() => {
const detail = mockValuationDetails.find((item) => item.id === id)
if (detail) {
resolve({ data: detail })
} else {
reject({ code: 404, message: '未找到估值详情' })
}
}, 200)
})
},
createValuation: (data = {}) => request.post('/valuation', data),
updateValuation: (data = {}) => request.put(`/valuation/${data.id}`, data),
deleteValuation: (params = {}) => request.delete(`/valuation/${params.valuation_id}`),
approveValuation: (data = {}) => request.post(`/valuation/${data.valuation_id}/approve`, data),
rejectValuation: (data = {}) => request.post(`/valuation/${data.valuation_id}/reject`, data),
updateValuationNotes: (data = {}) => request.put(`/valuation/${data.valuation_id}/admin-notes`, data),
getValuationList: (params = {}) => request.get('/valuations/', { params }),
getValuationById: (params = {}) => request.get(`/valuations/${params.valuation_id || params.id}`),
createValuation: (data = {}) => request.post('/valuations', data),
updateValuation: (data = {}) => request.put(`/valuations/${data.id}`, data),
deleteValuation: (params = {}) => request.delete(`/valuations/${params.valuation_id || params.id}`),
approveValuation: (data = {}) =>
request.post(`/valuations/${data.valuation_id || data.id}/approve`, { admin_notes: data.admin_notes }),
rejectValuation: (data = {}) =>
request.post(`/valuations/${data.valuation_id || data.id}/reject`, { admin_notes: data.admin_notes }),
updateValuationNotes: (data = {}) =>
request.put(`/valuations/${data.valuation_id || data.id}/admin-notes`, { admin_notes: data.admin_notes }),
}

View File

@ -1,6 +1,7 @@
<script setup>
import { ref, watch } from 'vue'
import { NModal, NCard, NForm, NFormItem, NInput, NButton, NUpload, NSpace, NText } from 'naive-ui'
import { ref, watch, computed } from 'vue'
import { NModal, NCard, NForm, NFormItem, NInput, NButton, NUpload, NSpace, NText, useMessage } from 'naive-ui'
import { getToken } from '@/utils/auth/token'
const props = defineProps({
visible: {
@ -27,6 +28,12 @@ const formData = ref({
})
const fileList = ref([])
const $message = useMessage()
const uploadUrl = `${import.meta.env.VITE_BASE_API}/upload/file`
const uploadHeaders = computed(() => ({
Authorization: `Bearer ${getToken()}`,
}))
//
watch(
@ -80,10 +87,42 @@ const beforeUpload = (data) => {
return true
}
//
const handleUploadChange = ({ fileList: newFileList }) => {
fileList.value = newFileList
formData.value.attachments = newFileList.map(file => file.id || file.name)
//
const handleUploadFinish = ({ file, event }) => {
try {
const res = JSON.parse(event.target.response)
// url
if (res.url) {
// fileList
const targetFile = fileList.value.find(f => f.id === file.id) || file
targetFile.url = res.url
targetFile.name = res.filename || targetFile.name
targetFile.status = 'finished' //
// formData.attachments
updateAttachments()
$message.success('上传成功')
} else {
$message.error(res.message || '上传失败')
//
const index = fileList.value.findIndex((item) => item.id === file.id)
if (index > -1) fileList.value.splice(index, 1)
}
} catch (error) {
console.error('上传响应解析失败:', error)
$message.error('上传失败:服务器响应异常')
const index = fileList.value.findIndex((item) => item.id === file.id)
if (index > -1) fileList.value.splice(index, 1)
}
return file
}
//
const updateAttachments = () => {
// url
formData.value.attachments = fileList.value
.map(file => file.url)
.filter(url => !!url)
}
//
@ -91,6 +130,7 @@ const handleRemove = ({ file }) => {
const index = fileList.value.findIndex(item => item.id === file.id)
if (index > -1) {
fileList.value.splice(index, 1)
updateAttachments()
}
return true
}
@ -157,8 +197,10 @@ const modalTitle = props.mode === 'invoice' ? '开票' : '查看发票'
multiple
:max="2"
list-type="image-card"
:action="uploadUrl"
:headers="uploadHeaders"
:before-upload="beforeUpload"
@change="handleUploadChange"
@finish="handleUploadFinish"
@remove="handleRemove"
:disabled="mode === 'view'"
>

View File

@ -236,18 +236,22 @@ async function fetchDetail(row) {
}
//
async function handleInvoiceConfirm(data) {
//
async function handleInvoiceConfirm(formData) {
try {
await api.sendInvoice({
email: data.email,
subject: data.subject,
body: data.body,
file_url: data.file_url || currentInvoice.value?.receipt?.url,
})
const payload = {
email: formData.email,
subject: formData.email, // subject email
body: formData.content, // content -> body
file_url: formData.attachments?.[0] || '', // attachments -> file_url
}
await api.sendInvoice(payload)
$message.success('发送成功')
invoiceModalVisible.value = false
$table.value?.handleSearch()
} catch (error) {
console.error(error)
$message.error(error?.message || '操作失败')
}
}

View File

@ -60,9 +60,9 @@ const detailSections = computed(() => {
fields: [
{ label: '资产名称', type: 'text', value: detail.asset_name || '-' },
{ label: '所属机构/权利人', type: 'text', value: detail.institution || '-' },
{ label: '统一社会信用代码/身份证号', type: 'text', value: detail.credit_code || '-' },
{ label: '统一社会信用代码/身份证号', type: 'text', value: detail.credit_code || detail.credit_code_or_id || '-' },
{ label: '所属行业', type: 'text', value: detail.industry || '-' },
{ label: '业务/传承介绍', type: 'text', value: detail.business_heritage_intro || '-' },
{ label: '业务/传承介绍', type: 'text', value: detail.business_heritage_intro || detail.biz_intro || '-' },
],
},
{
@ -80,9 +80,13 @@ const detailSections = computed(() => {
title: '非遗等级与技术',
fields: [
{ label: '非遗传承人等级', type: 'text', value: detail.inheritor_level || '-' },
{ label: '非遗传承人年龄水平及数量', type: 'list', value: formatAgeDistribution(detail.inheritor_age_count) },
{
label: '非遗传承人年龄水平及数量',
type: 'list',
value: formatAgeDistribution(detail.inheritor_age_count || detail.inheritor_ages),
},
{ label: '非遗传承人等级证书', type: 'images', value: detail.inheritor_certificates || [] },
{ label: '非遗等级', type: 'text', value: detail.heritage_level || '-' },
{ label: '非遗等级', type: 'text', value: detail.heritage_level || detail.heritage_asset_level || '-' },
{ label: '非遗资产所用专利的申请号', type: 'text', value: detail.patent_application_no || '-' },
{ label: '非遗资产历史证明证据及数量', type: 'list', value: formatHistoricalEvidence(detail.historical_evidence) },
{
@ -99,7 +103,11 @@ const detailSections = computed(() => {
{ label: '非遗资产应用成熟度', type: 'text', value: detail.application_maturity || detail.implementation_stage || '-' },
{ label: '非遗资产应用覆盖范围', type: 'text', value: detail.application_coverage || detail.coverage_area || '-' },
{ label: '非遗资产跨界合作深度', type: 'text', value: detail.cooperation_depth || detail.collaboration_type || '-' },
{ label: '近12个月线下相关宣讲活动次数', type: 'text', value: formatNumberValue(detail.offline_activities) },
{
label: '近12个月线下相关宣讲活动次数',
type: 'text',
value: formatNumberValue(detail.offline_activities ?? detail.offline_teaching_count),
},
{ label: '线上相关宣传账号信息', type: 'list', value: formatPlatformAccounts(detail.platform_accounts) },
],
},

View File

@ -1,12 +1,16 @@
export const STATUS_OPTIONS = [
{ label: '全部', value: '' },
{ label: '待审核', value: 'pending' },
{ label: '已完成', value: 'approved' },
{ label: '已通过', value: 'approved' },
{ label: '已拒绝', value: 'rejected' },
{ label: '已完成', value: 'success' },
]
export const STATUS_MAP = {
pending: { type: 'warning', text: '待审核' },
approved: { type: 'success', text: '已完成' },
approved: { type: 'success', text: '已通过' },
rejected: { type: 'error', text: '已拒绝' },
success: { type: 'success', text: '已完成' },
}
export const getStatusConfig = (status) => STATUS_MAP[status] || { type: 'default', text: '未知' }

View File

@ -36,6 +36,13 @@ const renderStatus = (status) => {
return h(NTag, { type: config.type }, { default: () => config.text })
}
const getValuationResult = (row) => {
if (row?.final_value_ab !== undefined && row.final_value_ab !== null) return row.final_value_ab
if (row?.market_value_c !== undefined && row.market_value_c !== null) return row.market_value_c
if (row?.model_value_b !== undefined && row.model_value_b !== null) return row.model_value_b
return row?.valuation_result
}
//
const columns = [
{ title: '编号', key: 'id', width: 80, align: 'center' },
@ -45,6 +52,9 @@ const columns = [
width: 120,
align: 'center',
ellipsis: { tooltip: true },
render(row) {
return row.phone || row.user_phone || row.user?.phone || '-'
},
},
{
title: '微信号',
@ -52,6 +62,9 @@ const columns = [
width: 120,
align: 'center',
ellipsis: { tooltip: true },
render(row) {
return row.wechat || row.user_wechat || row.user?.wechat || '-'
},
},
{
title: '评估结果',
@ -59,7 +72,8 @@ const columns = [
width: 120,
align: 'center',
render(row) {
return formatAmount(row.valuation_result)
const val = getValuationResult(row)
return val || val === 0 ? formatAmount(val) : '-'
},
},
{
@ -110,7 +124,7 @@ const columns = [
}
)
}
if (row.status === 'approved') {
if (['approved', 'rejected', 'success'].includes(row.status)) {
return h(
NButton,
{
@ -328,12 +342,6 @@ watch(
</QueryBarItem>
</template>
<template #action>
<NButton type="primary" @click="handleAddContent">
<TheIcon icon="mdi:plus" :size="18" class="mr-5" />
新增文案设置
</NButton>
</template>
</CrudTable>
</template>