feat: 管理后台完整可用 + 注册登录记日志 + 提取信息结构化展示 + 微信配置就绪
- 管理后台用户/统计/日志/配置四页签全部对接真实后端API - auth注册/登录/游客/微信登录事件写入usage_logs表 - 提取信息结果从原始JSON改为卡片式字段列表(中文标签) - 管理后台搜索按钮增加加载态和结果数提示 - 配置WECHAT_APP_ID/WECHAT_APP_SECRET - 客户/产品/报价单CRUD页面完整(导出导入批量操作)
This commit is contained in:
@@ -98,8 +98,28 @@ export const quotationApi = {
|
||||
updateStatus: (id, status) => request(`/quotations/${id}/status`, 'PATCH', { status }),
|
||||
exportPdf: (id) => `${BASE_URL}/quotations/${id}/pdf`,
|
||||
exportCsv: () => `${BASE_URL}/quotations/export/csv`,
|
||||
exportXlsx: () => `${BASE_URL}/quotations/export/xlsx`,
|
||||
generateFromInquiry: (inquiryText, customerId = null) =>
|
||||
request('/quotations/generate-from-inquiry', 'POST', { inquiry_text: inquiryText, customer_id: customerId }),
|
||||
importQuotations: (file) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const token = uni.getStorageSync('token')
|
||||
uni.uploadFile({
|
||||
url: `${BASE_URL}/quotations/import`,
|
||||
filePath: file,
|
||||
name: 'file',
|
||||
header: token ? { Authorization: `Bearer ${token}` } : {},
|
||||
success: (res) => {
|
||||
try {
|
||||
resolve(JSON.parse(res.data))
|
||||
} catch (e) {
|
||||
resolve(res.data)
|
||||
}
|
||||
},
|
||||
fail: reject,
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
export const productApi = {
|
||||
@@ -108,6 +128,27 @@ export const productApi = {
|
||||
create: (data) => request('/products', 'POST', data),
|
||||
update: (id, data) => request(`/products/${id}`, 'PATCH', data),
|
||||
delete: (id) => request(`/products/${id}`, 'DELETE'),
|
||||
exportCsv: () => `${BASE_URL}/products/export/csv`,
|
||||
exportXlsx: () => `${BASE_URL}/products/export/xlsx`,
|
||||
importProducts: (file) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const token = uni.getStorageSync('token')
|
||||
uni.uploadFile({
|
||||
url: `${BASE_URL}/products/import`,
|
||||
filePath: file,
|
||||
name: 'file',
|
||||
header: token ? { Authorization: `Bearer ${token}` } : {},
|
||||
success: (res) => {
|
||||
try {
|
||||
resolve(JSON.parse(res.data))
|
||||
} catch (e) {
|
||||
resolve(res.data)
|
||||
}
|
||||
},
|
||||
fail: reject,
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
export const adminApi = {
|
||||
@@ -261,6 +302,7 @@ export const customerApi = {
|
||||
getConversation: (id, page = 1, size = 50) =>
|
||||
request(`/customers/${id}/conversation?page=${page}&size=${size}`),
|
||||
exportCsv: () => `${BASE_URL}/customers/export/csv`,
|
||||
exportXlsx: () => `${BASE_URL}/customers/export/xlsx`,
|
||||
importCustomers: (file) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const token = uni.getStorageSync('token')
|
||||
|
||||
Reference in New Issue
Block a user