Compare commits
10 Commits
857cec4290
...
f0b8b6cee8
| Author | SHA1 | Date | |
|---|---|---|---|
| f0b8b6cee8 | |||
| 58809755d1 | |||
| bc363b195c | |||
| c161f68d03 | |||
| d8cd0d3478 | |||
| d5fe4c5d3e | |||
| d0790126b0 | |||
| f7bb10f744 | |||
| 4bcf13ba1f | |||
| 027ff5192b |
@ -273,12 +273,12 @@ const badges = ref<Record<string, string>>({})
|
|||||||
|
|
||||||
async function loadBadges() {
|
async function loadBadges() {
|
||||||
try {
|
try {
|
||||||
const data = await fetch('/sys/openapi/inquiry/list?page=1&limit=1', {
|
const data = await fetch('/supplier/inquiry/page?page=1&limit=1', {
|
||||||
headers: { Authorization: `Bearer ${userStore.token}` },
|
headers: { Authorization: `Bearer ${userStore.token}` },
|
||||||
credentials: 'omit'
|
credentials: 'omit'
|
||||||
}).then(r => r.json()).catch(() => null)
|
}).then(r => r.json()).catch(() => null)
|
||||||
if (data?.code === 0) {
|
if (data?.code === 0) {
|
||||||
const total = data.total ?? data.data?.length ?? 0
|
const total = data.data?.total ?? data.total ?? 0
|
||||||
badges.value['询价管理'] = String(total)
|
badges.value['询价管理'] = String(total)
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|||||||
@ -123,6 +123,7 @@ export const MENU_LABELS: MenuLabel[] = [
|
|||||||
{ url: 'other/supplierBrand', label: '品牌管理', icon: 'Star', path: '/other/brand', sort: 709 },
|
{ url: 'other/supplierBrand', label: '品牌管理', icon: 'Star', path: '/other/brand', sort: 709 },
|
||||||
{ url: 'other/groupbuy', label: '拼团活动', icon: 'GoodsFilled', path: '/other/groupbuy', sort: 710 },
|
{ url: 'other/groupbuy', label: '拼团活动', icon: 'GoodsFilled', path: '/other/groupbuy', sort: 710 },
|
||||||
{ url: 'other/seckill', label: '秒杀活动', icon: 'Lightning', path: '/other/seckill', sort: 711 },
|
{ url: 'other/seckill', label: '秒杀活动', icon: 'Lightning', path: '/other/seckill', sort: 711 },
|
||||||
|
{ url: 'other/priceFormulaVariable', label: '价格公式变量', icon: 'SetUp', path: '/supplier/priceFormulaVariable', sort: 713 },
|
||||||
{ url: 'other/information', label: '资讯列表', icon: 'Document', path: '/other/information', sort: 712 },
|
{ url: 'other/information', label: '资讯列表', icon: 'Document', path: '/other/information', sort: 712 },
|
||||||
|
|
||||||
// ===== 基础设施(message/job/oss) =====
|
// ===== 基础设施(message/job/oss) =====
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ref, onMounted, reactive } from 'vue'
|
import { ref, onMounted, reactive } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
import DataTable from '@/components/DataTable/DataTable.vue'
|
import DataTable from '@/components/DataTable/DataTable.vue'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
@ -76,9 +76,9 @@ function onPageChange(p: number) { page.value = p; load() }
|
|||||||
function onLimitChange(l: number) { limit.value = l; load() }
|
function onLimitChange(l: number) { limit.value = l; load() }
|
||||||
function onPreview(row: Feedback) { previewData.value = row; previewVisible.value = true }
|
function onPreview(row: Feedback) { previewData.value = row; previewVisible.value = true }
|
||||||
function onDelete(row: Feedback) {
|
function onDelete(row: Feedback) {
|
||||||
ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('已删除 (mock)')
|
try { await httpPost('/other/feedback/delete', { id: row.id }); ElMessage.success('已删除'); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '删除失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ref, onMounted, reactive } from 'vue'
|
import { ref, onMounted, reactive } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
import DataTable from '@/components/DataTable/DataTable.vue'
|
import DataTable from '@/components/DataTable/DataTable.vue'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
@ -72,14 +72,17 @@ function onAdd() { editMode.value = 'add'; editForm.id = ''; editForm.title = ''
|
|||||||
function onEdit(row: Help) { editMode.value = 'edit'; Object.assign(editForm, JSON.parse(JSON.stringify(row))); editVisible.value = true }
|
function onEdit(row: Help) { editMode.value = 'edit'; Object.assign(editForm, JSON.parse(JSON.stringify(row))); editVisible.value = true }
|
||||||
function onSubmitEdit() {
|
function onSubmitEdit() {
|
||||||
if (!editForm.title.trim()) { ElMessage.warning('请填写标题'); return }
|
if (!editForm.title.trim()) { ElMessage.warning('请填写标题'); return }
|
||||||
ElMessage.success(editMode.value === 'add' ? '新增成功 (mock)' : '修改成功 (mock)')
|
const ep = editMode.value === 'add' ? '/other/help/save' : '/other/help/update'
|
||||||
editVisible.value = false
|
httpPost(ep, { ...editForm }).then(() => {
|
||||||
load()
|
ElMessage.success(editMode.value === 'add' ? '新增成功' : '修改成功')
|
||||||
|
editVisible.value = false
|
||||||
|
load()
|
||||||
|
}).catch((e: any) => { ElMessage.error(e?.msg || '操作失败') })
|
||||||
}
|
}
|
||||||
function onDelete(row: Help) {
|
function onDelete(row: Help) {
|
||||||
ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('已删除 (mock)')
|
try { await httpPost('/other/help/delete', { id: row.id }); ElMessage.success('已删除'); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '删除失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ref, onMounted, reactive } from 'vue'
|
import { ref, onMounted, reactive } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
import DataTable from '@/components/DataTable/DataTable.vue'
|
import DataTable from '@/components/DataTable/DataTable.vue'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
@ -85,14 +85,17 @@ function onEdit(row: Lunbo) { editMode.value = 'edit'; Object.assign(editForm, J
|
|||||||
function onSubmitEdit() {
|
function onSubmitEdit() {
|
||||||
if (!editForm.title.trim()) { ElMessage.warning('请填写标题'); return }
|
if (!editForm.title.trim()) { ElMessage.warning('请填写标题'); return }
|
||||||
if (!editForm.image.trim()) { ElMessage.warning('请填写图片URL'); return }
|
if (!editForm.image.trim()) { ElMessage.warning('请填写图片URL'); return }
|
||||||
ElMessage.success(editMode.value === 'add' ? '新增成功 (mock)' : '修改成功 (mock)')
|
const ep = editMode.value === 'add' ? '/other/lunbo/save' : '/other/lunbo/update'
|
||||||
editVisible.value = false
|
httpPost(ep, { ...editForm }).then(() => {
|
||||||
load()
|
ElMessage.success(editMode.value === 'add' ? '新增成功' : '修改成功')
|
||||||
|
editVisible.value = false
|
||||||
|
load()
|
||||||
|
}).catch((e: any) => { ElMessage.error(e?.msg || '操作失败') })
|
||||||
}
|
}
|
||||||
function onDelete(row: Lunbo) {
|
function onDelete(row: Lunbo) {
|
||||||
ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('已删除 (mock)')
|
try { await httpPost('/other/lunbo/delete', { id: row.id }); ElMessage.success('已删除'); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '删除失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -89,8 +89,9 @@ const FALLBACK_STATUS = [
|
|||||||
*/
|
*/
|
||||||
async function loadRecentInquiries(): Promise<Inquiry[]> {
|
async function loadRecentInquiries(): Promise<Inquiry[]> {
|
||||||
try {
|
try {
|
||||||
const data = await httpGet<any[]>('/sys/openapi/inquiry/list', { page: 1, limit: 5 })
|
const resp = await httpGet<any>('/supplier/inquiry/page', { page: 1, limit: 5 })
|
||||||
if (!Array.isArray(data)) throw new Error('inquiry list not array')
|
const data = Array.isArray(resp) ? resp : (resp?.list || [])
|
||||||
|
if (!data.length) throw new Error('inquiry list empty')
|
||||||
return data.slice(0, 5).map((it: any) => {
|
return data.slice(0, 5).map((it: any) => {
|
||||||
const s = it.apprStatus === 0 ? 'pending'
|
const s = it.apprStatus === 0 ? 'pending'
|
||||||
: it.apprStatus === 1 ? 'quoting'
|
: it.apprStatus === 1 ? 'quoting'
|
||||||
@ -127,13 +128,14 @@ async function loadRecentInquiries(): Promise<Inquiry[]> {
|
|||||||
*/
|
*/
|
||||||
async function loadStats(): Promise<Stat[]> {
|
async function loadStats(): Promise<Stat[]> {
|
||||||
try {
|
try {
|
||||||
const data = await httpGet<any[]>('/sys/openapi/inquiry/list', { page: 1, limit: 500 })
|
const resp = await httpGet<any>('/supplier/inquiry/page', { page: 1, limit: 500 })
|
||||||
if (!Array.isArray(data)) throw new Error('inquiry list not array')
|
const data = Array.isArray(resp) ? resp : (resp?.list || [])
|
||||||
|
if (!data.length) throw new Error('inquiry list empty')
|
||||||
|
|
||||||
const total = data.length
|
const total = Number(resp?.total || data.length)
|
||||||
const pending = data.filter((it: any) => it.apprStatus === 0).length
|
const pending = data.filter((it: any) => it.apprStatus === 0 || it.status === 0).length
|
||||||
const quoting = data.filter((it: any) => it.apprStatus === 1).length
|
const quoting = data.filter((it: any) => it.apprStatus === 1 || it.status === 1).length
|
||||||
const done = data.filter((it: any) => it.apprStatus === 2).length
|
const done = data.filter((it: any) => it.apprStatus === 2 || it.status === 2).length
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{ label: '询价总数', value: String(total), delta: '', trend: 'up', icon: 'ChatDotRound' },
|
{ label: '询价总数', value: String(total), delta: '', trend: 'up', icon: 'ChatDotRound' },
|
||||||
@ -221,8 +223,8 @@ onMounted(async () => {
|
|||||||
// 拉一次全量算图表 + 较昨日
|
// 拉一次全量算图表 + 较昨日
|
||||||
let allInquiries: any[] = []
|
let allInquiries: any[] = []
|
||||||
try {
|
try {
|
||||||
allInquiries = await httpGet<any[]>('/sys/openapi/inquiry/list', { page: 1, limit: 500 })
|
const resp = await httpGet<any>('/supplier/inquiry/page', { page: 1, limit: 500 })
|
||||||
if (!Array.isArray(allInquiries)) allInquiries = []
|
allInquiries = Array.isArray(resp) ? resp : (resp?.list || [])
|
||||||
} catch { allInquiries = [] }
|
} catch { allInquiries = [] }
|
||||||
|
|
||||||
const isLive = allInquiries.length > 0
|
const isLive = allInquiries.length > 0
|
||||||
|
|||||||
@ -96,11 +96,34 @@ const inquiryId = computed(() => String(route.params.id || ''))
|
|||||||
async function load() {
|
async function load() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
await new Promise(r => setTimeout(r, 200))
|
const resp: any = await httpGet('/supplier/inquiry/getById', { id: inquiryId.value })
|
||||||
detail.value = { ...FALLBACK, id: inquiryId.value }
|
if (resp && resp.id) {
|
||||||
|
detail.value = {
|
||||||
|
...FALLBACK,
|
||||||
|
...resp,
|
||||||
|
id: String(resp.id || inquiryId.value),
|
||||||
|
title: resp.title || FALLBACK.title,
|
||||||
|
productName: resp.productName || resp.product || FALLBACK.productName,
|
||||||
|
productBrand: resp.brand || resp.productBrand || FALLBACK.productBrand,
|
||||||
|
specification: resp.specification || resp.spec || FALLBACK.specification,
|
||||||
|
unit: resp.unit || FALLBACK.unit,
|
||||||
|
quantity: resp.purchaseQuantity || resp.quantity || FALLBACK.quantity,
|
||||||
|
shippingAddress: resp.shippingAddress || resp.address || FALLBACK.shippingAddress,
|
||||||
|
deliveryDate: resp.deliveryDate || FALLBACK.deliveryDate,
|
||||||
|
priceValidDate: resp.priceValidDate || FALLBACK.priceValidDate,
|
||||||
|
enterpriseName: resp.inquiryEnterpriseName || resp.enterpriseName || FALLBACK.enterpriseName,
|
||||||
|
fileList: resp.fileList || FALLBACK.fileList,
|
||||||
|
quotationList: resp.quotationList || FALLBACK.quotationList,
|
||||||
|
raw: resp,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
detail.value = { ...FALLBACK, id: inquiryId.value }
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
detail.value = { ...FALLBACK, id: inquiryId.value }
|
detail.value = { ...FALLBACK, id: inquiryId.value }
|
||||||
} finally { loading.value = false }
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function fmtDate(s: any): string {
|
function fmtDate(s: any): string {
|
||||||
@ -113,9 +136,9 @@ function inquiryInfo(s: number) { return INQUIRY_STATUS_MAP[s] || { label: `状
|
|||||||
|
|
||||||
function onBack() { router.push('/inquiry') }
|
function onBack() { router.push('/inquiry') }
|
||||||
function onDownloadFile(url: string, name: string) { if (url) ElMessage.info(`下载: ${name || url}`) }
|
function onDownloadFile(url: string, name: string) { if (url) ElMessage.info(`下载: ${name || url}`) }
|
||||||
function onExportPriceComparison() { ElMessage.success('导出基础价格分析表 (mock)') }
|
function onExportPriceComparison() { ElMessage.info('导出功能开发中') }
|
||||||
function onViewQuotation(row: Quotation) { ElMessage.info(`查看报价: ${row.quotationEnterpriseName} (mock)`) }
|
function onViewQuotation(row: Quotation) { ElMessage.info(`查看报价: ${row.quotationEnterpriseName} (请前往询价管理)`) }
|
||||||
function onQuote(row: Quotation) { ElMessage.info('发起报价 (mock)') }
|
function onQuote(row: Quotation) { ElMessage.info('请前往前台发起报价') }
|
||||||
|
|
||||||
onMounted(load)
|
onMounted(load)
|
||||||
watch(inquiryId, load)
|
watch(inquiryId, load)
|
||||||
|
|||||||
@ -74,12 +74,13 @@ async function load() {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
error.value = null
|
error.value = null
|
||||||
try {
|
try {
|
||||||
const data = await httpGet<any>('/sys/openapi/inquiry/list', {
|
const resp = await httpGet<any>('/supplier/inquiry/page', {
|
||||||
page: page.value,
|
page: page.value,
|
||||||
limit: limit.value,
|
limit: limit.value,
|
||||||
...(filters.value.status ? { status: filters.value.status } : {})
|
...(filters.value.status ? { status: filters.value.status } : {})
|
||||||
})
|
})
|
||||||
const arr = Array.isArray(data) ? data : []
|
const arr = Array.isArray(resp) ? resp : (resp?.list || [])
|
||||||
|
total.value = Number(resp?.total || (arr.length + (page.value - 1) * limit.value))
|
||||||
list.value = arr.map((it: any) => ({
|
list.value = arr.map((it: any) => ({
|
||||||
id: String(it.id ?? ''),
|
id: String(it.id ?? ''),
|
||||||
customer: it.inquiryEnterpriseName || it.customer || it.customerName || '--',
|
customer: it.inquiryEnterpriseName || it.customer || it.customerName || '--',
|
||||||
@ -89,7 +90,6 @@ async function load() {
|
|||||||
time: it.publishDate || it.createDate || it.time,
|
time: it.publishDate || it.createDate || it.time,
|
||||||
raw: it
|
raw: it
|
||||||
}))
|
}))
|
||||||
total.value = arr.length + (page.value - 1) * limit.value
|
|
||||||
// 各状态计数 (基于当前页结果)
|
// 各状态计数 (基于当前页结果)
|
||||||
stats.all = list.value.length
|
stats.all = list.value.length
|
||||||
list.value.forEach(r => { stats[r.status] = (stats[r.status] || 0) + 1 })
|
list.value.forEach(r => { stats[r.status] = (stats[r.status] || 0) + 1 })
|
||||||
|
|||||||
@ -265,9 +265,12 @@ const FALLBACK: OrderDetail = {
|
|||||||
async function load() {
|
async function load() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
// 端点 /sys/openapi/order/info?id= 后端 400, 用 fallback (老 vue 用 /order/info/{id} 同 400, 显示 fallback)
|
const resp: any = await httpGet('/sys/openapi/order/info', { orderId: orderId.value })
|
||||||
await new Promise(r => setTimeout(r, 200))
|
if (resp && resp.orderId) {
|
||||||
detail.value = { ...FALLBACK, id: orderId.value, orderCode: orderId.value }
|
detail.value = { ...FALLBACK, ...resp, id: resp.id || orderId.value, orderCode: resp.orderId }
|
||||||
|
} else {
|
||||||
|
detail.value = { ...FALLBACK, id: orderId.value, orderCode: orderId.value }
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
detail.value = { ...FALLBACK, id: orderId.value, orderCode: orderId.value }
|
detail.value = { ...FALLBACK, id: orderId.value, orderCode: orderId.value }
|
||||||
} finally {
|
} finally {
|
||||||
@ -309,18 +312,18 @@ function invoiceInfo(s: number) { return INVOICE_STATUS_MAP[s] || { label: `状
|
|||||||
function onBack() { router.push('/order') }
|
function onBack() { router.push('/order') }
|
||||||
function onCancelOrder() {
|
function onCancelOrder() {
|
||||||
ElMessageBox.confirm('确认取消此订单?', '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm('确认取消此订单?', '提示', { type: 'warning' }).then(() => {
|
||||||
ElMessage.success('订单已取消 (mock)')
|
ElMessage.info('请前往前台取消订单')
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
function onPay() { ElMessage.info('跳支付 (mock)') }
|
function onPay() { ElMessage.info('请前往前台完成支付') }
|
||||||
function onShip() { ElMessage.info('发货 (mock)') }
|
function onShip() { ElMessage.info('请前往供应商端发货') }
|
||||||
function onConfirmReceipt() { ElMessage.success('已确认收货 (mock)') }
|
function onConfirmReceipt() { ElMessage.info('请前往前台确认收货') }
|
||||||
function onApplyRefund() { ElMessage.info('申请退款 (mock)') }
|
function onApplyRefund() { ElMessage.info('请前往售后管理处理') }
|
||||||
function onComment() { ElMessage.info('评价 (mock)') }
|
function onComment() { ElMessage.info('请前往前台评价') }
|
||||||
function onExport() { ElMessage.success('导出订单 (mock)') }
|
function onExport() { ElMessage.info('导出功能开发中') }
|
||||||
function onPrint() { ElMessage.success('打印订单 (mock)') }
|
function onPrint() { window.print() }
|
||||||
function onDownloadFile(url: string) { if (url) ElMessage.info(`下载: ${url}`) }
|
function onDownloadFile(url: string) { if (url) ElMessage.info(`下载: ${url}`) }
|
||||||
function onUploadInvoice() { ElMessage.info('上传发票 (mock)') }
|
function onUploadInvoice() { ElMessage.info('请前往前台上传发票') }
|
||||||
|
|
||||||
onMounted(load)
|
onMounted(load)
|
||||||
watch(orderId, load)
|
watch(orderId, load)
|
||||||
|
|||||||
@ -192,15 +192,15 @@ function onSelectionChange(rows: Order[]) { selection.value = rows }
|
|||||||
|
|
||||||
function onStatusTabChange(status: string) { filters.status = status; onSearch() }
|
function onStatusTabChange(status: string) { filters.status = status; onSearch() }
|
||||||
function onViewDetail(row: Order) { router.push(`/order/${row.id}`) }
|
function onViewDetail(row: Order) { router.push(`/order/${row.id}`) }
|
||||||
function onPay(row: Order) { ElMessage.success(`付款 ${row.orderNo} (mock)`); load() }
|
function onPay(row: Order) { ElMessage.info('请前往前台完成支付') }
|
||||||
function onShip(row: Order) { ElMessage.success(`发货 ${row.orderNo} (mock)`); load() }
|
function onShip(row: Order) { ElMessage.info('请前往供应商端发货') }
|
||||||
function onConfirmReceipt(row: Order) { ElMessage.success(`确认收货 ${row.orderNo} (mock)`); load() }
|
function onConfirmReceipt(row: Order) { ElMessage.info('请前往前台确认收货') }
|
||||||
function onRefund(row: Order) { ElMessage.success(`退款 ${row.orderNo} (mock)`); load() }
|
function onRefund(row: Order) { ElMessage.info('请前往售后管理处理退款') }
|
||||||
function onCancel(row: Order) { ElMessage.success(`取消 ${row.orderNo} (mock)`); load() }
|
function onCancel(row: Order) { ElMessage.info('请前往前台取消订单') }
|
||||||
function onPrint(row: Order) { ElMessage.info(`打印 ${row.orderNo} (mock)`) }
|
function onPrint(row: Order) { window.print() }
|
||||||
function onExportSelected() {
|
function onExportSelected() {
|
||||||
if (!selection.value.length) { ElMessage.warning('请先选择订单'); return }
|
if (!selection.value.length) { ElMessage.warning('请先选择订单'); return }
|
||||||
ElMessage.success(`导出 ${selection.value.length} 个订单 (mock)`)
|
ElMessage.info('导出功能开发中')
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(load)
|
onMounted(load)
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ref, reactive, onMounted, computed } from 'vue'
|
import { ref, reactive, onMounted, computed } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
import DataTable from '@/components/DataTable/DataTable.vue'
|
import DataTable from '@/components/DataTable/DataTable.vue'
|
||||||
@ -143,23 +143,23 @@ function onStatusTab(v: string) { statusTab.value = v; page.value = 1 }
|
|||||||
|
|
||||||
async function onAgree(row: AftersaleRow) {
|
async function onAgree(row: AftersaleRow) {
|
||||||
try { await ElMessageBox.confirm(`确认通过售后申请「${row.afterSalesOrderId}」?`, '提示', { type: 'warning' }) } catch { return }
|
try { await ElMessageBox.confirm(`确认通过售后申请「${row.afterSalesOrderId}」?`, '提示', { type: 'warning' }) } catch { return }
|
||||||
row.status = 3
|
try { await httpPost('/order/orderAfterSale/confirmOrderRefund', { afterSalesOrderId: row.afterSalesOrderId, status: 3 }); ElMessage.success('已通过'); load() }
|
||||||
ElMessage.success('已通过 (前端示例)')
|
catch (e: any) { ElMessage.error(e?.msg || '操作失败') }
|
||||||
}
|
}
|
||||||
async function onReject(row: AftersaleRow) {
|
async function onReject(row: AftersaleRow) {
|
||||||
try {
|
try {
|
||||||
const { value } = await ElMessageBox.prompt('请填写拒绝原因', '拒绝售后', { inputPlaceholder: '原因', confirmButtonText: '拒绝', cancelButtonText: '取消' })
|
const { value } = await ElMessageBox.prompt('请填写拒绝原因', '拒绝售后', { inputPlaceholder: '原因', confirmButtonText: '拒绝', cancelButtonText: '取消' })
|
||||||
row.status = 4
|
try { await httpPost('/order/orderAfterSale/confirmOrderRefund', { afterSalesOrderId: row.afterSalesOrderId, status: 4, reason: value }); ElMessage.success('已拒绝'); load() }
|
||||||
row.reason = (value || '已拒绝').trim()
|
catch (e: any) { ElMessage.error(e?.msg || '操作失败') }
|
||||||
ElMessage.success('已拒绝 (前端示例)')
|
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
async function onComplete(row: AftersaleRow) {
|
async function onComplete(row: AftersaleRow) {
|
||||||
row.status = 6
|
try { await ElMessageBox.confirm(`确认完成售后「${row.afterSalesOrderId}」?`, '提示', { type: 'success' }) } catch { return }
|
||||||
ElMessage.success('已标记完成')
|
try { await httpPost('/order/orderAfterSale/completeOrder', { afterSalesOrderId: row.afterSalesOrderId }); ElMessage.success('已完成'); load() }
|
||||||
|
catch (e: any) { ElMessage.error(e?.msg || '操作失败') }
|
||||||
}
|
}
|
||||||
function onView(row: AftersaleRow) {
|
function onView(row: AftersaleRow) {
|
||||||
ElMessage.info(`打开售后详情 ${row.afterSalesOrderId}`)
|
ElMessage.info(`售后单号: ${row.afterSalesOrderId}`)
|
||||||
}
|
}
|
||||||
function onExport() {
|
function onExport() {
|
||||||
ElMessage.success('已发起导出 (前端示例, 共 ' + filtered.value.length + ' 条)')
|
ElMessage.success('已发起导出 (前端示例, 共 ' + filtered.value.length + ' 条)')
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ref, reactive, onMounted, computed } from 'vue'
|
import { ref, reactive, onMounted, computed } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
import DataTable from '@/components/DataTable/DataTable.vue'
|
import DataTable from '@/components/DataTable/DataTable.vue'
|
||||||
@ -161,7 +161,8 @@ function onSearch() {
|
|||||||
function onStatusTab(v: string) { statusTab.value = v; page.value = 1 }
|
function onStatusTab(v: string) { statusTab.value = v; page.value = 1 }
|
||||||
async function onMarkPaid(row: PaymentRow) {
|
async function onMarkPaid(row: PaymentRow) {
|
||||||
try { await ElMessageBox.confirm(`确认「${row.id}」该款项标记为已支付?`, '提示', { type: 'warning' }) } catch { return }
|
try { await ElMessageBox.confirm(`确认「${row.id}」该款项标记为已支付?`, '提示', { type: 'warning' }) } catch { return }
|
||||||
ElMessage.success('已标记 (前端示例)')
|
try { await httpPost('/order/orderrefund/updatePayStatus', { id: row.id, payStatus: 1 }); ElMessage.success('已标记'); load() }
|
||||||
|
catch (e: any) { ElMessage.error(e?.msg || '操作失败') }
|
||||||
}
|
}
|
||||||
function onViewOrder(row: PaymentRow) {
|
function onViewOrder(row: PaymentRow) {
|
||||||
ElMessage.info(`打开订单 ${row.orderId}`)
|
ElMessage.info(`打开订单 ${row.orderId}`)
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ref, reactive, onMounted, computed } from 'vue'
|
import { ref, reactive, onMounted, computed } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
import DataTable from '@/components/DataTable/DataTable.vue'
|
import DataTable from '@/components/DataTable/DataTable.vue'
|
||||||
@ -141,20 +141,18 @@ function onStatusTab(v: string) { statusTab.value = v; page.value = 1 }
|
|||||||
|
|
||||||
async function onApprove(row: RefundRow) {
|
async function onApprove(row: RefundRow) {
|
||||||
try { await ElMessageBox.confirm(`确认通过退款申请「${row.id}」?`, '提示', { type: 'warning' }) } catch { return }
|
try { await ElMessageBox.confirm(`确认通过退款申请「${row.id}」?`, '提示', { type: 'warning' }) } catch { return }
|
||||||
row.refundStatus = 2
|
try { await httpPost('/order/orderrefund/updatePayStatus', { id: row.id, payStatus: 2 }); ElMessage.success('已通过'); load() }
|
||||||
row.refundTime = new Date().toLocaleString('zh-CN')
|
catch (e: any) { ElMessage.error(e?.msg || '操作失败') }
|
||||||
ElMessage.success('已通过 (前端示例)')
|
|
||||||
}
|
}
|
||||||
async function onReject(row: RefundRow) {
|
async function onReject(row: RefundRow) {
|
||||||
try {
|
try {
|
||||||
const { value } = await ElMessageBox.prompt('请填写拒绝原因', '拒绝退款', { inputPlaceholder: '原因', confirmButtonText: '拒绝', cancelButtonText: '取消' })
|
const { value } = await ElMessageBox.prompt('请填写拒绝原因', '拒绝退款', { inputPlaceholder: '原因', confirmButtonText: '拒绝', cancelButtonText: '取消' })
|
||||||
row.refundStatus = 3
|
try { await httpPost('/order/orderrefund/updatePayStatus', { id: row.id, payStatus: 3, remark: value }); ElMessage.success('已拒绝'); load() }
|
||||||
row.remark = (value || '已拒绝').trim()
|
catch (e: any) { ElMessage.error(e?.msg || '操作失败') }
|
||||||
ElMessage.success('已拒绝 (前端示例)')
|
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
function onView(row: RefundRow) {
|
function onView(row: RefundRow) {
|
||||||
ElMessage.info(`打开退款详情 ${row.id}`)
|
ElMessage.info(`退款单号: ${row.id}`)
|
||||||
}
|
}
|
||||||
function onExport() {
|
function onExport() {
|
||||||
ElMessage.success('已发起导出 (前端示例, 共 ' + filtered.value.length + ' 条)')
|
ElMessage.success('已发起导出 (前端示例, 共 ' + filtered.value.length + ' 条)')
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ref, onMounted, reactive, computed } from 'vue'
|
import { ref, onMounted, reactive, computed } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
import TableActions from '@/components/TableActions/TableActions.vue'
|
import TableActions from '@/components/TableActions/TableActions.vue'
|
||||||
@ -129,26 +129,33 @@ function onEdit(row: Category) {
|
|||||||
}
|
}
|
||||||
function onSubmitEdit() {
|
function onSubmitEdit() {
|
||||||
if (!editForm.name.trim()) { ElMessage.warning('请填写分类名'); return }
|
if (!editForm.name.trim()) { ElMessage.warning('请填写分类名'); return }
|
||||||
ElMessage.success(editMode.value === 'add' ? '新增成功 (mock)' : '修改成功 (mock)')
|
const ep = editMode.value === 'add' ? '/other/category/save' : '/other/category/update'
|
||||||
editVisible.value = false
|
httpPost(ep, { ...editForm, type: 2 }).then(() => {
|
||||||
load()
|
ElMessage.success(editMode.value === 'add' ? '新增成功' : '修改成功')
|
||||||
|
editVisible.value = false
|
||||||
|
load()
|
||||||
|
}).catch((e: any) => { ElMessage.error(e?.msg || '操作失败') })
|
||||||
}
|
}
|
||||||
function onDelete(row: Category) {
|
function onDelete(row: Category) {
|
||||||
ElMessageBox.confirm(`确认删除「${row.name}」? ${row.children?.length ? '该分类下有子分类, 将一起删除!' : ''}`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认删除「${row.name}」? ${row.children?.length ? '该分类下有子分类, 将一起删除!' : ''}`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('已删除 (mock)')
|
try { await httpPost('/other/category/delete', { id: row.id }); ElMessage.success('已删除'); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '删除失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
function onMove(row: Category, dir: 1 | 2) {
|
function onMove(row: Category, dir: 1 | 2) {
|
||||||
ElMessage.success(`${dir === 1 ? '上移' : '下移'}成功 (mock)`)
|
httpPost('/other/category/moveCategory', { id: row.id, moveType: dir }).then(() => {
|
||||||
load()
|
ElMessage.success(`${dir === 1 ? '上移' : '下移'}成功`)
|
||||||
|
load()
|
||||||
|
}).catch((e: any) => { ElMessage.error(e?.msg || '操作失败') })
|
||||||
}
|
}
|
||||||
function onSelectionChange(rows: Category[]) { selection.value = rows }
|
function onSelectionChange(rows: Category[]) { selection.value = rows }
|
||||||
function onBatchDelete() {
|
function onBatchDelete() {
|
||||||
if (selection.value.length === 0) { ElMessage.warning('请先选择要删除的分类'); return }
|
if (selection.value.length === 0) { ElMessage.warning('请先选择要删除的分类'); return }
|
||||||
ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 个分类?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 个分类?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('已批量删除 (mock)')
|
try {
|
||||||
load()
|
for (const s of selection.value) { await httpPost('/other/category/delete', { id: s.id }) }
|
||||||
|
ElMessage.success(`已批量删除 ${selection.value.length} 个`); load()
|
||||||
|
} catch (e: any) { ElMessage.error(e?.msg || '批量删除失败'); load() }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,8 @@
|
|||||||
* 字段: id/name/type/supplierId/enterpriseId/createTime
|
* 字段: id/name/type/supplierId/enterpriseId/createTime
|
||||||
*/
|
*/
|
||||||
import { onMounted, ref, computed, reactive } from 'vue'
|
import { onMounted, ref, computed, reactive } from 'vue'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import DataTable from '@/components/DataTable/DataTable.vue'
|
import DataTable from '@/components/DataTable/DataTable.vue'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
@ -66,12 +67,31 @@ function fmtTime(s?: string | null) {
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const editVisible = ref(false)
|
||||||
|
const editForm = reactive({ id: '', name: '', type: 2 })
|
||||||
|
function onAdd() { Object.assign(editForm, { id: '', name: '', type: 2 }); editVisible.value = true }
|
||||||
|
function onSubmitEdit() {
|
||||||
|
if (!editForm.name.trim()) { ElMessage.warning('请填写单位名称'); return }
|
||||||
|
const ep = editForm.id ? '/other/goodunit/update' : '/other/goodunit/save'
|
||||||
|
httpPost(ep, { ...editForm }).then(() => {
|
||||||
|
ElMessage.success(editForm.id ? '修改成功' : '新增成功'); editVisible.value = false; load()
|
||||||
|
}).catch((e: any) => ElMessage.error(e?.msg || '操作失败'))
|
||||||
|
}
|
||||||
|
function onDelete(row: any) {
|
||||||
|
ElMessageBox.confirm(`确认删除「${row.name}」?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
|
try { await httpPost('/other/goodunit/delete', { id: row.id }); ElMessage.success('已删除'); load() }
|
||||||
|
catch (e: any) { ElMessage.error(e?.msg || '删除失败') }
|
||||||
|
}).catch(() => {})
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(load)
|
onMounted(load)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="rr-page">
|
<div class="rr-page">
|
||||||
<PageHeader title="商品单位" :sub="`商品计量单位管理 (共 ${list.length} 个, 筛选后 ${filtered.length} 个)`" />
|
<PageHeader title="商品单位" :sub="`商品计量单位管理 (共 ${list.length} 个, 筛选后 ${filtered.length} 个)`">
|
||||||
|
<el-button type="primary" @click="onAdd">新增单位</el-button>
|
||||||
|
</PageHeader>
|
||||||
|
|
||||||
<SearchBar
|
<SearchBar
|
||||||
v-model:filters="filters"
|
v-model:filters="filters"
|
||||||
@ -91,7 +111,8 @@ onMounted(load)
|
|||||||
{ prop: 'type', label: '类型', width: 100, slot: 'type' },
|
{ prop: 'type', label: '类型', width: 100, slot: 'type' },
|
||||||
{ prop: 'supplierId', label: '供应商ID', width: 120 },
|
{ prop: 'supplierId', label: '供应商ID', width: 120 },
|
||||||
{ prop: 'enterpriseId', label: '企业ID', width: 120 },
|
{ prop: 'enterpriseId', label: '企业ID', width: 120 },
|
||||||
{ prop: 'createTime', label: '创建时间', width: 180, slot: 'createTime' }
|
{ prop: 'createTime', label: '创建时间', width: 180, slot: 'createTime' },
|
||||||
|
{ prop: 'action', label: '操作', width: 120, slot: 'action' }
|
||||||
]"
|
]"
|
||||||
:data="filtered"
|
:data="filtered"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@ -113,8 +134,23 @@ onMounted(load)
|
|||||||
<template #createTime="{ row }">
|
<template #createTime="{ row }">
|
||||||
<span class="rr-time">{{ fmtTime(row.createTime) }}</span>
|
<span class="rr-time">{{ fmtTime(row.createTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
<template #action="{ row }">
|
||||||
|
<span class="rr-actions">
|
||||||
|
<el-link type="danger" @click="onDelete(row)">删除</el-link>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
</DataTable>
|
</DataTable>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-dialog v-model="editVisible" title="新增单位" width="400px">
|
||||||
|
<el-form label-width="80px">
|
||||||
|
<el-form-item label="名称" required><el-input v-model="editForm.name" placeholder="如: 吨" /></el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="editVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmitEdit">保存</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ref, onMounted, reactive } from 'vue'
|
import { ref, onMounted, reactive } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
|
|
||||||
@ -78,22 +78,22 @@ function onSelectionChange(rows: Groupbuy[]) { selection.value = rows }
|
|||||||
function onView(row: Groupbuy) { viewData.value = row; viewVisible.value = true }
|
function onView(row: Groupbuy) { viewData.value = row; viewVisible.value = true }
|
||||||
function onToggleStatus(row: Groupbuy) {
|
function onToggleStatus(row: Groupbuy) {
|
||||||
const newStatus = row.status === 1 ? 2 : 1
|
const newStatus = row.status === 1 ? 2 : 1
|
||||||
ElMessageBox.confirm(`确认${newStatus === 1 ? '启用' : '停用'}「${row.name}」?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认${newStatus === 1 ? '启用' : '停用'}「${row.name}」?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success(`${newStatus === 1 ? '启用' : '停用'}成功 (mock)`)
|
try { await httpPost('/other/groupbuy/update', { id: row.id, status: newStatus }); ElMessage.success(`${newStatus === 1 ? '启用' : '停用'}成功`); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '操作失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
function onDelete(row: Groupbuy) {
|
function onDelete(row: Groupbuy) {
|
||||||
ElMessageBox.confirm(`确认删除「${row.name}」?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认删除「${row.name}」?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('已删除 (mock)')
|
try { await httpPost('/other/groupbuy/delete', { id: row.id }); ElMessage.success('已删除'); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '删除失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
function onBatchDelete() {
|
function onBatchDelete() {
|
||||||
if (selection.value.length === 0) { ElMessage.warning('请先选择要删除的活动'); return }
|
if (selection.value.length === 0) { ElMessage.warning('请先选择要删除的活动'); return }
|
||||||
ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 个活动?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 个活动?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('已批量删除 (mock)')
|
try { await httpPost('/other/groupbuy/delete', selection.value.map(s => s.id)); ElMessage.success(`已批量删除 ${selection.value.length} 个`); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '批量删除失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ref, onMounted, reactive } from 'vue'
|
import { ref, onMounted, reactive } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
|
|
||||||
@ -79,22 +79,22 @@ function onSelectionChange(rows: Seckill[]) { selection.value = rows }
|
|||||||
function onView(row: Seckill) { viewData.value = row; viewVisible.value = true }
|
function onView(row: Seckill) { viewData.value = row; viewVisible.value = true }
|
||||||
function onToggleStatus(row: Seckill) {
|
function onToggleStatus(row: Seckill) {
|
||||||
const newStatus = row.status === 0 ? 1 : 0
|
const newStatus = row.status === 0 ? 1 : 0
|
||||||
ElMessageBox.confirm(`确认${newStatus === 0 ? '启用' : '停用'}「${row.name}」?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认${newStatus === 0 ? '启用' : '停用'}「${row.name}」?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success(`${newStatus === 0 ? '启用' : '停用'}成功 (mock)`)
|
try { await httpPost('/other/seckill/updateSeckill', { id: row.id, status: newStatus }); ElMessage.success(`${newStatus === 0 ? '启用' : '停用'}成功`); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '操作失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
function onDelete(row: Seckill) {
|
function onDelete(row: Seckill) {
|
||||||
ElMessageBox.confirm(`确认删除「${row.name}」?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认删除「${row.name}」?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('已删除 (mock)')
|
try { await httpPost('/other/seckill/delete', { id: row.id }); ElMessage.success('已删除'); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '删除失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
function onBatchDelete() {
|
function onBatchDelete() {
|
||||||
if (selection.value.length === 0) { ElMessage.warning('请先选择要删除的活动'); return }
|
if (selection.value.length === 0) { ElMessage.warning('请先选择要删除的活动'); return }
|
||||||
ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 个活动?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 个活动?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('已批量删除 (mock)')
|
try { await httpPost('/other/seckill/delete', selection.value.map(s => s.id)); ElMessage.success(`已批量删除 ${selection.value.length} 个`); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '批量删除失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ref, onMounted, reactive } from 'vue'
|
import { ref, onMounted, reactive } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { httpPost } from '@/utils/request'
|
||||||
import DataTable from '@/components/DataTable/DataTable.vue'
|
import DataTable from '@/components/DataTable/DataTable.vue'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
@ -84,15 +85,18 @@ function onAdd() { editMode.value = 'add'; Object.assign(editForm, { id: '', cod
|
|||||||
function onEdit(row: TextConfig) { editMode.value = 'edit'; Object.assign(editForm, JSON.parse(JSON.stringify(row))); editVisible.value = true }
|
function onEdit(row: TextConfig) { editMode.value = 'edit'; Object.assign(editForm, JSON.parse(JSON.stringify(row))); editVisible.value = true }
|
||||||
function onSubmitEdit() {
|
function onSubmitEdit() {
|
||||||
if (!editForm.code.trim() || !editForm.descr.trim()) { ElMessage.warning('请填写编码和描述'); return }
|
if (!editForm.code.trim() || !editForm.descr.trim()) { ElMessage.warning('请填写编码和描述'); return }
|
||||||
ElMessage.success(editMode.value === 'add' ? '新增成功 (mock)' : '修改成功 (mock)')
|
const ep = editMode.value === 'add' ? '/other/textconfig/save' : '/other/textconfig/update'
|
||||||
editVisible.value = false
|
httpPost(ep, { ...editForm }).then(() => {
|
||||||
load()
|
ElMessage.success(editMode.value === 'add' ? '新增成功' : '修改成功')
|
||||||
|
editVisible.value = false
|
||||||
|
load()
|
||||||
|
}).catch((e: any) => { ElMessage.error(e?.msg || '操作失败') })
|
||||||
}
|
}
|
||||||
function onShowRichText(content: string) { richTextContent.value = content; richTextVisible.value = true }
|
function onShowRichText(content: string) { richTextContent.value = content; richTextVisible.value = true }
|
||||||
function onDelete(row: TextConfig) {
|
function onDelete(row: TextConfig) {
|
||||||
ElMessageBox.confirm(`确认删除「${row.code}」?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认删除「${row.code}」?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('已删除 (mock)')
|
try { await httpPost('/other/textconfig/delete', { id: row.id }); ElMessage.success('已删除'); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '删除失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ref, onMounted, reactive } from 'vue'
|
import { ref, onMounted, reactive } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
import TableActions from '@/components/TableActions/TableActions.vue'
|
import TableActions from '@/components/TableActions/TableActions.vue'
|
||||||
@ -80,29 +80,46 @@ function onPageChange(p: number) { page.value = p; load() }
|
|||||||
function onLimitChange(l: number) { limit.value = l; load() }
|
function onLimitChange(l: number) { limit.value = l; load() }
|
||||||
function onSelectionChange(rows: Coupon[]) { selection.value = rows }
|
function onSelectionChange(rows: Coupon[]) { selection.value = rows }
|
||||||
|
|
||||||
function onAdd() { ElMessage.info('新增优惠券弹窗 (mock) - 待 add-or-update 接入') }
|
const editVisible = ref(false)
|
||||||
|
const editMode = ref<'add' | 'edit'>('add')
|
||||||
|
const editForm = reactive<any>({ name: '', type: 1, fullMoney: 0, deductedMoney: 0, quantity: 0, rebate: 1, limitCollar: 1, expirationDate: '' })
|
||||||
|
|
||||||
|
function onAdd() {
|
||||||
|
editMode.value = 'add'
|
||||||
|
Object.assign(editForm, { id: '', name: '', type: 1, fullMoney: 0, deductedMoney: 0, quantity: 0, rebate: 1, limitCollar: 1, expirationDate: '' })
|
||||||
|
editVisible.value = true
|
||||||
|
}
|
||||||
function onEdit(row: Coupon) {
|
function onEdit(row: Coupon) {
|
||||||
if (row.sourceType !== 2) { ElMessage.warning('只有平台券可编辑'); return }
|
if (row.sourceType !== 2) { ElMessage.warning('只有平台券可编辑'); return }
|
||||||
ElMessage.info(`编辑「${row.name}」 (mock)`)
|
editMode.value = 'edit'
|
||||||
|
Object.assign(editForm, JSON.parse(JSON.stringify(row)))
|
||||||
|
editVisible.value = true
|
||||||
|
}
|
||||||
|
function onSubmitEdit() {
|
||||||
|
if (!editForm.name?.trim()) { ElMessage.warning('请填写券名称'); return }
|
||||||
|
const ep = editMode.value === 'add' ? '/supplier/coupon/saveCoupon' : '/supplier/coupon/updateCoupon'
|
||||||
|
httpPost(ep, { ...editForm, sourceType: 2 }).then(() => {
|
||||||
|
ElMessage.success(editMode.value === 'add' ? '新增成功' : '修改成功'); editVisible.value = false; load()
|
||||||
|
}).catch((e: any) => ElMessage.error(e?.msg || '操作失败'))
|
||||||
}
|
}
|
||||||
function onToggleStatus(row: Coupon) {
|
function onToggleStatus(row: Coupon) {
|
||||||
const next = row.onShelf === 1 ? 0 : 1
|
const next = row.onShelf === 1 ? 0 : 1
|
||||||
ElMessageBox.confirm(`确认${next === 1 ? '启用' : '停用'}「${row.name}」?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认${next === 1 ? '启用' : '停用'}「${row.name}」?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success(`${next === 1 ? '启用' : '停用'}成功 (mock)`)
|
try { await httpPost('/supplier/coupon/updateCoupon', { id: row.id, onShelf: next }); ElMessage.success(`${next === 1 ? '启用' : '停用'}成功`); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '操作失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
function onDelete(row: Coupon) {
|
function onDelete(row: Coupon) {
|
||||||
ElMessageBox.confirm(`确认删除「${row.name}」?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认删除「${row.name}」?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('已删除 (mock)')
|
try { await httpPost('/supplier/coupon/delete', { id: row.id }); ElMessage.success('已删除'); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '删除失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
function onBatchDelete() {
|
function onBatchDelete() {
|
||||||
if (selection.value.length === 0) { ElMessage.warning('请先选择要删除的券'); return }
|
if (selection.value.length === 0) { ElMessage.warning('请先选择要删除的券'); return }
|
||||||
ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 张券?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 张券?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('已批量删除 (mock)')
|
try { await httpPost('/supplier/coupon/delete', selection.value.map(s => s.id)); ElMessage.success(`已批量删除 ${selection.value.length} 张`); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '批量删除失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
function onShowRecords(row: Coupon) {
|
function onShowRecords(row: Coupon) {
|
||||||
@ -215,6 +232,27 @@ onMounted(load)
|
|||||||
<el-button @click="recordVisible = false">关闭</el-button>
|
<el-button @click="recordVisible = false">关闭</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog v-model="editVisible" :title="editMode === 'add' ? '新增优惠券' : '编辑优惠券'" width="520px">
|
||||||
|
<el-form label-width="100px">
|
||||||
|
<el-form-item label="券名称" required><el-input v-model="editForm.name" placeholder="如: 满100减20" /></el-form-item>
|
||||||
|
<el-form-item label="类型">
|
||||||
|
<el-radio-group v-model="editForm.type">
|
||||||
|
<el-radio :value="1">满减券</el-radio>
|
||||||
|
<el-radio :value="2">折扣券</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="满"><el-input-number v-model="editForm.fullMoney" :min="0" :precision="2" /></el-form-item>
|
||||||
|
<el-form-item label="减/折"><el-input-number v-model="editForm.deductedMoney" :min="0" :precision="2" /></el-form-item>
|
||||||
|
<el-form-item label="发放数量"><el-input-number v-model="editForm.quantity" :min="0" /></el-form-item>
|
||||||
|
<el-form-item label="限领"><el-input-number v-model="editForm.limitCollar" :min="1" /></el-form-item>
|
||||||
|
<el-form-item label="到期日期"><el-input v-model="editForm.expirationDate" placeholder="如: 2026-12-31" /></el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="editVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmitEdit">保存</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@ -294,23 +294,23 @@ async function onDelete(row: Good) {
|
|||||||
|
|
||||||
function onBatchCheck() {
|
function onBatchCheck() {
|
||||||
if (selection.value.length === 0) { ElMessage.warning('请先选择商品'); return }
|
if (selection.value.length === 0) { ElMessage.warning('请先选择商品'); return }
|
||||||
ElMessageBox.confirm(`确认批量通过 ${selection.value.length} 个商品?`, '提示', { type: 'success' }).then(() => {
|
ElMessageBox.confirm(`确认批量通过 ${selection.value.length} 个商品?`, '提示', { type: 'success' }).then(async () => {
|
||||||
ElMessage.success('批量审核通过 (mock)')
|
try { for (const s of selection.value) { await httpPost('/supplier/good/checkGood', { id: s.id, checkStatus: 2, checkOpinion: '批量审核通过' }) } ElMessage.success(`批量审核通过 ${selection.value.length} 个`); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '批量审核失败'); load() }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
function onBatchReject() { if (selection.value.length === 0) { ElMessage.warning('请先选择商品'); return } batchRejectDialogVisible.value = true }
|
function onBatchReject() { if (selection.value.length === 0) { ElMessage.warning('请先选择商品'); return } batchRejectDialogVisible.value = true }
|
||||||
function onSubmitBatchReject() {
|
function onSubmitBatchReject() {
|
||||||
if (!batchRejectForm.reason.trim()) { ElMessage.warning('请填写驳回原因'); return }
|
if (!batchRejectForm.reason.trim()) { ElMessage.warning('请填写驳回原因'); return }
|
||||||
ElMessage.success(`已驳回 ${selection.value.length} 个商品 (mock)`)
|
Promise.all(selection.value.map(s => httpPost('/supplier/good/checkGood', { id: s.id, checkStatus: 3, checkOpinion: batchRejectForm.reason }))).then(() => {
|
||||||
batchRejectDialogVisible.value = false
|
ElMessage.success(`已驳回 ${selection.value.length} 个商品`); batchRejectDialogVisible.value = false; load()
|
||||||
load()
|
}).catch((e: any) => ElMessage.error(e?.msg || '批量驳回失败'))
|
||||||
}
|
}
|
||||||
function onBatchOnShelf() {
|
function onBatchOnShelf() {
|
||||||
if (selection.value.length === 0) { ElMessage.warning('请先选择商品'); return }
|
if (selection.value.length === 0) { ElMessage.warning('请先选择商品'); return }
|
||||||
ElMessageBox.confirm(`确认批量下架 ${selection.value.length} 个商品?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认批量下架 ${selection.value.length} 个商品?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('批量下架成功 (mock)')
|
try { for (const s of selection.value) { await httpPost('/supplier/good/goodOnShelf', { id: s.id, onShelf: 0 }) } ElMessage.success(`批量下架 ${selection.value.length} 个`); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '批量下架失败'); load() }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
function onShowBatchCategoryDialog() {
|
function onShowBatchCategoryDialog() {
|
||||||
@ -318,19 +318,19 @@ function onShowBatchCategoryDialog() {
|
|||||||
batchCategoryDialogVisible.value = true
|
batchCategoryDialogVisible.value = true
|
||||||
}
|
}
|
||||||
function onSubmitBatchCategory() {
|
function onSubmitBatchCategory() {
|
||||||
ElMessage.success(`已修改 ${selection.value.length} 个商品分类 (mock)`)
|
Promise.all(selection.value.map(s => httpPost('/supplier/good/updateSupplierGood', { id: s.id, firstCategoryId: categoryForm.firstCategoryId }))).then(() => {
|
||||||
batchCategoryDialogVisible.value = false
|
ElMessage.success(`已修改 ${selection.value.length} 个商品分类`); batchCategoryDialogVisible.value = false; load()
|
||||||
load()
|
}).catch((e: any) => ElMessage.error(e?.msg || '批量改分类失败'))
|
||||||
}
|
}
|
||||||
function onDeleteBatch() {
|
function onDeleteBatch() {
|
||||||
if (selection.value.length === 0) { ElMessage.warning('请先选择商品'); return }
|
if (selection.value.length === 0) { ElMessage.warning('请先选择商品'); return }
|
||||||
ElMessageBox.confirm(`确认删除 ${selection.value.length} 个商品?`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认删除 ${selection.value.length} 个商品?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('批量删除成功 (mock)')
|
try { for (const s of selection.value) { await httpPost('/supplier/good/deleteSupplierGood', { id: s.id }) } ElMessage.success('批量删除成功'); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '批量删除失败'); load() }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
function onExport() { ElMessage.success('导出商品 (mock)') }
|
function onExport() { ElMessage.info('导出功能开发中') }
|
||||||
function onAdd() { ElMessage.info('新增商品 (mock)') }
|
function onAdd() { ElMessage.info('新增商品请前往供应商端') }
|
||||||
|
|
||||||
onMounted(() => Promise.all([load(), loadStats(), loadCounts()]))
|
onMounted(() => Promise.all([load(), loadStats(), loadCounts()]))
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -0,0 +1,171 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
/**
|
||||||
|
* F006 价格公式变量管理
|
||||||
|
* 走 /supplier/supplierGoodPriceFormulaVariable/page (2026-08-08 探测: 200, total=5)
|
||||||
|
* CRUD: save/update/delete + updateValue
|
||||||
|
* 字段: id/var_key/var_name/var_unit/current_value/source_type/source_code/formula/sort/status/create_date
|
||||||
|
*/
|
||||||
|
import { ref, onMounted, reactive } from 'vue'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
|
import DataTable from '@/components/DataTable/DataTable.vue'
|
||||||
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
|
|
||||||
|
interface FormulaVar {
|
||||||
|
id: string
|
||||||
|
var_key: string
|
||||||
|
var_name: string
|
||||||
|
var_unit: string
|
||||||
|
current_value: number
|
||||||
|
source_type: number
|
||||||
|
source_code: string
|
||||||
|
formula: string
|
||||||
|
sort: number
|
||||||
|
status: number
|
||||||
|
create_date: any
|
||||||
|
raw: any
|
||||||
|
}
|
||||||
|
|
||||||
|
const SOURCE_MAP: Record<number, { label: string; type: string }> = {
|
||||||
|
1: { label: '手动输入', type: 'info' },
|
||||||
|
2: { label: '自动采集', type: 'success' },
|
||||||
|
3: { label: '公式计算', type: 'warning' }
|
||||||
|
}
|
||||||
|
const STATUS_MAP: Record<number, { label: string; type: string }> = {
|
||||||
|
0: { label: '禁用', type: 'danger' },
|
||||||
|
1: { label: '启用', type: 'success' }
|
||||||
|
}
|
||||||
|
|
||||||
|
const list = ref<FormulaVar[]>([])
|
||||||
|
const total = ref(0)
|
||||||
|
const loading = ref(false)
|
||||||
|
const query = reactive({ page: 1, limit: 10 })
|
||||||
|
const filters = reactive({ var_name: '' })
|
||||||
|
|
||||||
|
const editVisible = ref(false)
|
||||||
|
const editMode = ref<'add' | 'edit'>('add')
|
||||||
|
const editForm = reactive<FormulaVar>({ id: '', var_key: '', var_name: '', var_unit: '', current_value: 0, source_type: 1, source_code: '', formula: '', sort: 0, status: 1, create_date: null, raw: {} })
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{ prop: 'id', label: 'ID', width: 60 },
|
||||||
|
{ prop: 'var_name', label: '变量名称', minWidth: 120 },
|
||||||
|
{ prop: 'var_key', label: '变量标识', width: 120 },
|
||||||
|
{ prop: 'var_unit', label: '单位', width: 80 },
|
||||||
|
{ prop: 'current_value', label: '当前值', width: 120, formatter: (r: FormulaVar) => r.current_value?.toLocaleString() || '0' },
|
||||||
|
{ prop: 'source_type', label: '数据来源', width: 100, slot: 'source' },
|
||||||
|
{ prop: 'formula', label: '计算公式', minWidth: 150, formatter: (r: FormulaVar) => r.formula || '--' },
|
||||||
|
{ prop: 'sort', label: '排序', width: 60 },
|
||||||
|
{ prop: 'status', label: '状态', width: 80, slot: 'status' },
|
||||||
|
{ prop: 'create_date', label: '创建时间', width: 160, formatter: (r: FormulaVar) => fmtDate(r.create_date) }
|
||||||
|
]
|
||||||
|
|
||||||
|
function fmtDate(d: any): string {
|
||||||
|
if (!d) return '--'
|
||||||
|
if (typeof d === 'string') return d.slice(0, 19)
|
||||||
|
try { return `${d.year}-${String(d.monthValue).padStart(2,'0')}-${String(d.dayOfMonth).padStart(2,'0')} ${String(d.hour).padStart(2,'0')}:${String(d.minute).padStart(2,'0')}` } catch { return '--' }
|
||||||
|
}
|
||||||
|
|
||||||
|
async function load() {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const resp: any = await httpGet('/supplier/supplierGoodPriceFormulaVariable/page', { page: query.page, limit: query.limit, ...(filters.var_name ? { var_name: filters.var_name } : {}) })
|
||||||
|
list.value = (resp?.list || []).map((it: any) => ({ ...it, raw: it }))
|
||||||
|
total.value = Number(resp?.total || 0)
|
||||||
|
} catch { list.value = []; total.value = 0 } finally { loading.value = false }
|
||||||
|
}
|
||||||
|
function onSearch() { query.page = 1; load() }
|
||||||
|
function onReset() { filters.var_name = ''; query.page = 1; load() }
|
||||||
|
function onPageChange(p: number) { query.page = p; load() }
|
||||||
|
function onLimitChange(l: number) { query.limit = l; query.page = 1; load() }
|
||||||
|
|
||||||
|
function onAdd() {
|
||||||
|
editMode.value = 'add'
|
||||||
|
Object.assign(editForm, { id: '', var_key: '', var_name: '', var_unit: '', current_value: 0, source_type: 1, source_code: '', formula: '', sort: 0, status: 1, create_date: null, raw: {} })
|
||||||
|
editVisible.value = true
|
||||||
|
}
|
||||||
|
function onEdit(row: FormulaVar) {
|
||||||
|
editMode.value = 'edit'
|
||||||
|
Object.assign(editForm, JSON.parse(JSON.stringify(row)))
|
||||||
|
editVisible.value = true
|
||||||
|
}
|
||||||
|
function onSubmitEdit() {
|
||||||
|
if (!editForm.var_name.trim() || !editForm.var_key.trim()) { ElMessage.warning('请填写变量名称和标识'); return }
|
||||||
|
const ep = editMode.value === 'add' ? '/supplier/supplierGoodPriceFormulaVariable/save' : '/supplier/supplierGoodPriceFormulaVariable/updateValue'
|
||||||
|
httpPost(ep, { ...editForm }).then(() => {
|
||||||
|
ElMessage.success(editMode.value === 'add' ? '新增成功' : '修改成功')
|
||||||
|
editVisible.value = false; load()
|
||||||
|
}).catch((e: any) => ElMessage.error(e?.msg || '操作失败'))
|
||||||
|
}
|
||||||
|
function onDelete(row: FormulaVar) {
|
||||||
|
ElMessageBox.confirm(`确认删除「${row.var_name}」?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
|
try { await httpPost('/supplier/supplierGoodPriceFormulaVariable/delete', { id: row.id }); ElMessage.success('已删除'); load() }
|
||||||
|
catch (e: any) { ElMessage.error(e?.msg || '删除失败') }
|
||||||
|
}).catch(() => {})
|
||||||
|
}
|
||||||
|
onMounted(load)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="rr-page">
|
||||||
|
<PageHeader title="价格公式变量" :sub="`动态定价公式变量管理 (共 ${total} 个)`">
|
||||||
|
<el-button type="primary" @click="onAdd">新增变量</el-button>
|
||||||
|
</PageHeader>
|
||||||
|
<SearchBar v-model:filters="filters" :fields="[
|
||||||
|
{ key: 'var_name', label: '变量名称', type: 'text', placeholder: '请输入变量名称' }
|
||||||
|
]" @search="onSearch" @reset="onReset" />
|
||||||
|
<div class="rr-card">
|
||||||
|
<DataTable :columns="columns" :data="list" :borderless="true" :loading="loading" :total="total"
|
||||||
|
:page="query.page" :limit="query.limit" :show-pagination="true" :page-sizes="[10, 20, 50, 100]" row-key="id"
|
||||||
|
empty-text="暂无数据" @page-change="onPageChange" @limit-change="onLimitChange">
|
||||||
|
<template #source="{ row }">
|
||||||
|
<el-tag :type="(SOURCE_MAP[row.source_type]?.type as any) || 'info'">{{ SOURCE_MAP[row.source_type]?.label || row.source_type }}</el-tag>
|
||||||
|
</template>
|
||||||
|
<template #status="{ row }">
|
||||||
|
<el-tag :type="(STATUS_MAP[row.status]?.type as any) || 'info'">{{ STATUS_MAP[row.status]?.label || row.status }}</el-tag>
|
||||||
|
</template>
|
||||||
|
<template #action="{ row }">
|
||||||
|
<span class="rr-actions">
|
||||||
|
<el-link type="primary" @click="onEdit(row)">编辑</el-link>
|
||||||
|
<span class="rr-actions__sep">|</span>
|
||||||
|
<el-link type="danger" @click="onDelete(row)">删除</el-link>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</DataTable>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-dialog v-model="editVisible" :title="editMode === 'add' ? '新增变量' : '编辑变量'" width="500px">
|
||||||
|
<el-form label-width="100px">
|
||||||
|
<el-form-item label="变量名称" required><el-input v-model="editForm.var_name" placeholder="如: 铜价" /></el-form-item>
|
||||||
|
<el-form-item label="变量标识" required><el-input v-model="editForm.var_key" placeholder="如: copper_price" /></el-form-item>
|
||||||
|
<el-form-item label="单位"><el-input v-model="editForm.var_unit" placeholder="如: 元/吨" /></el-form-item>
|
||||||
|
<el-form-item label="当前值"><el-input-number v-model="editForm.current_value" :precision="2" :step="100" /></el-form-item>
|
||||||
|
<el-form-item label="数据来源">
|
||||||
|
<el-radio-group v-model="editForm.source_type">
|
||||||
|
<el-radio :value="1">手动输入</el-radio>
|
||||||
|
<el-radio :value="2">自动采集</el-radio>
|
||||||
|
<el-radio :value="3">公式计算</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="采集编码" v-if="editForm.source_type === 2"><el-input v-model="editForm.source_code" placeholder="如: copper" /></el-form-item>
|
||||||
|
<el-form-item label="计算公式" v-if="editForm.source_type === 3"><el-input v-model="editForm.formula" placeholder="如: copper_price * 1.05" /></el-form-item>
|
||||||
|
<el-form-item label="排序"><el-input-number v-model="editForm.sort" :min="0" /></el-form-item>
|
||||||
|
<el-form-item label="状态">
|
||||||
|
<el-radio-group v-model="editForm.status">
|
||||||
|
<el-radio :value="1">启用</el-radio>
|
||||||
|
<el-radio :value="0">禁用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="editVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmitEdit">保存</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.rr-page { max-width: 1400px; }
|
||||||
|
.rr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
|
||||||
|
</style>
|
||||||
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ref, onMounted, reactive, computed } from 'vue'
|
import { ref, onMounted, reactive, computed } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
import SearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
import ListTabs from '@/components/ListTabs/ListTabs.vue'
|
import ListTabs from '@/components/ListTabs/ListTabs.vue'
|
||||||
@ -191,21 +191,64 @@ function onStatusTab(v: string) { filters.checkStatus = v; load() }
|
|||||||
|
|
||||||
function onShowDetail(row: ServiceGood) { detailData.value = row; detailVisible.value = true }
|
function onShowDetail(row: ServiceGood) { detailData.value = row; detailVisible.value = true }
|
||||||
function onShowCheck(row: ServiceGood) { checkData.value = row; checkDialogVisible.value = true }
|
function onShowCheck(row: ServiceGood) { checkData.value = row; checkDialogVisible.value = true }
|
||||||
function onSubmitCheck() { if (!checkForm.checkOpinion.trim()) { ElMessage.warning('请填写审核意见'); return } ElMessage.success('审核成功 (mock)'); checkDialogVisible.value = false; load() }
|
function onSubmitCheck() {
|
||||||
function onOnShelf(row: ServiceGood) { ElMessageBox.confirm(`确认${row.onShelf === 1 ? '下架' : '上架'}?`, '提示', { type: 'warning' }).then(() => { ElMessage.success('操作成功 (mock)'); load() }).catch(() => {}) }
|
if (!checkForm.checkOpinion.trim()) { ElMessage.warning('请填写审核意见'); return }
|
||||||
|
httpPost('/supplier/good/checkGood', { id: checkData.value?.id, checkStatus: checkForm.checkStatus, checkOpinion: checkForm.checkOpinion }).then(() => {
|
||||||
|
ElMessage.success('审核成功'); checkDialogVisible.value = false; load()
|
||||||
|
}).catch((e: any) => ElMessage.error(e?.msg || '审核失败'))
|
||||||
|
}
|
||||||
|
function onOnShelf(row: ServiceGood) {
|
||||||
|
ElMessageBox.confirm(`确认${row.onShelf === 1 ? '下架' : '上架'}?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
|
try { await httpPost('/supplier/good/goodOnShelf', { id: row.id, onShelf: row.onShelf === 1 ? 0 : 1 }); ElMessage.success('操作成功'); load() }
|
||||||
|
catch (e: any) { ElMessage.error(e?.msg || '操作失败') }
|
||||||
|
}).catch(() => {})
|
||||||
|
}
|
||||||
function onShowCategory(row: ServiceGood) { categoryData.value = row; categoryDialogVisible.value = true }
|
function onShowCategory(row: ServiceGood) { categoryData.value = row; categoryDialogVisible.value = true }
|
||||||
function onSubmitCategory() { ElMessage.success('分类已修改 (mock)'); categoryDialogVisible.value = false; load() }
|
function onSubmitCategory() {
|
||||||
function onDelete(row: ServiceGood) { ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(() => { ElMessage.success('已删除 (mock)'); load() }).catch(() => {}) }
|
httpPost('/supplier/good/updateSupplierGood', { id: categoryData.value?.id }).then(() => {
|
||||||
|
ElMessage.success('分类已修改'); categoryDialogVisible.value = false; load()
|
||||||
|
}).catch((e: any) => ElMessage.error(e?.msg || '操作失败'))
|
||||||
|
}
|
||||||
|
function onDelete(row: ServiceGood) {
|
||||||
|
ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
|
try { await httpPost('/supplier/good/deleteSupplierGood', { id: row.id }); ElMessage.success('已删除'); load() }
|
||||||
|
catch (e: any) { ElMessage.error(e?.msg || '删除失败') }
|
||||||
|
}).catch(() => {})
|
||||||
|
}
|
||||||
|
|
||||||
function onBatchCheck() { if (!selection.value.length) return ElMessage.warning('请先选择'); ElMessage.success(`批量审核通过 ${selection.value.length} 个 (mock)`); load() }
|
function onBatchCheck() {
|
||||||
|
if (!selection.value.length) return ElMessage.warning('请先选择')
|
||||||
|
Promise.all(selection.value.map(s => httpPost('/supplier/good/checkGood', { id: s.id, checkStatus: 2, checkOpinion: '批量审核通过' }))).then(() => {
|
||||||
|
ElMessage.success(`批量审核通过 ${selection.value.length} 个`); load()
|
||||||
|
}).catch((e: any) => ElMessage.error(e?.msg || '批量审核失败'))
|
||||||
|
}
|
||||||
function onBatchReject() { if (!selection.value.length) return ElMessage.warning('请先选择'); batchRejectDialogVisible.value = true }
|
function onBatchReject() { if (!selection.value.length) return ElMessage.warning('请先选择'); batchRejectDialogVisible.value = true }
|
||||||
function onSubmitBatchReject() { ElMessage.success(`批量驳回 ${selection.value.length} 个 (mock)`); batchRejectDialogVisible.value = false; load() }
|
function onSubmitBatchReject() {
|
||||||
function onBatchOnShelf() { if (!selection.value.length) return ElMessage.warning('请先选择'); ElMessage.success(`批量上下架 ${selection.value.length} 个 (mock)`); load() }
|
Promise.all(selection.value.map(s => httpPost('/supplier/good/checkGood', { id: s.id, checkStatus: 3, checkOpinion: batchRejectForm.reason }))).then(() => {
|
||||||
|
ElMessage.success(`批量驳回 ${selection.value.length} 个`); batchRejectDialogVisible.value = false; load()
|
||||||
|
}).catch((e: any) => ElMessage.error(e?.msg || '批量驳回失败'))
|
||||||
|
}
|
||||||
|
function onBatchOnShelf() {
|
||||||
|
if (!selection.value.length) return ElMessage.warning('请先选择')
|
||||||
|
httpPost('/supplier/good/goodOnShelfBatch', selection.value.map(s => ({ id: s.id, onShelf: s.onShelf === 1 ? 0 : 1 }))).then(() => {
|
||||||
|
ElMessage.success(`批量操作 ${selection.value.length} 个`); load()
|
||||||
|
}).catch((e: any) => ElMessage.error(e?.msg || '批量操作失败'))
|
||||||
|
}
|
||||||
function onShowBatchCategory() { if (!selection.value.length) return ElMessage.warning('请先选择'); batchCategoryDialogVisible.value = true }
|
function onShowBatchCategory() { if (!selection.value.length) return ElMessage.warning('请先选择'); batchCategoryDialogVisible.value = true }
|
||||||
function onSubmitBatchCategory() { ElMessage.success(`批量改分类 ${selection.value.length} 个 (mock)`); batchCategoryDialogVisible.value = false; load() }
|
function onSubmitBatchCategory() {
|
||||||
function onDeleteBatch() { if (!selection.value.length) return ElMessage.warning('请先选择'); ElMessageBox.confirm(`确认批量删除 ${selection.value.length} 个?`, '提示', { type: 'warning' }).then(() => { ElMessage.success('批量删除成功 (mock)'); load() }).catch(() => {}) }
|
Promise.all(selection.value.map(s => httpPost('/supplier/good/updateSupplierGood', { id: s.id }))).then(() => {
|
||||||
function onExport() { ElMessage.success('导出服务商品 (mock)') }
|
ElMessage.success(`批量改分类 ${selection.value.length} 个`); batchCategoryDialogVisible.value = false; load()
|
||||||
function onAdd() { ElMessage.info('新增服务商品 (mock)') }
|
}).catch((e: any) => ElMessage.error(e?.msg || '批量改分类失败'))
|
||||||
|
}
|
||||||
|
function onDeleteBatch() {
|
||||||
|
if (!selection.value.length) return ElMessage.warning('请先选择')
|
||||||
|
ElMessageBox.confirm(`确认批量删除 ${selection.value.length} 个?`, '提示', { type: 'warning' }).then(async () => {
|
||||||
|
try { for (const s of selection.value) { await httpPost('/supplier/good/deleteSupplierGood', { id: s.id }) } ElMessage.success('批量删除成功'); load() }
|
||||||
|
catch (e: any) { ElMessage.error(e?.msg || '批量删除失败'); load() }
|
||||||
|
}).catch(() => {})
|
||||||
|
}
|
||||||
|
function onExport() { ElMessage.info('导出功能开发中') }
|
||||||
|
function onAdd() { ElMessage.info('新增服务商品请前往供应商端') }
|
||||||
|
|
||||||
onMounted(() => Promise.all([load(), loadStats(), loadCounts()]))
|
onMounted(() => Promise.all([load(), loadStats(), loadCounts()]))
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ref, onMounted, reactive } from 'vue'
|
import { ref, onMounted, reactive } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { httpGet } from '@/utils/request'
|
import { httpGet, httpPost } from '@/utils/request'
|
||||||
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
import PageHeader from '@/components/PageHeader/PageHeader.vue'
|
||||||
import TableActions from '@/components/TableActions/TableActions.vue'
|
import TableActions from '@/components/TableActions/TableActions.vue'
|
||||||
|
|
||||||
@ -97,14 +97,17 @@ function onEdit(row: Region) {
|
|||||||
}
|
}
|
||||||
function onSubmitEdit() {
|
function onSubmitEdit() {
|
||||||
if (!editForm.name.trim()) { ElMessage.warning('请填写名称'); return }
|
if (!editForm.name.trim()) { ElMessage.warning('请填写名称'); return }
|
||||||
ElMessage.success(editMode.value === 'add' ? '新增成功 (mock)' : '修改成功 (mock)')
|
const ep = editMode.value === 'add' ? '/sys/region' : '/sys/region'
|
||||||
editVisible.value = false
|
const method = editMode.value === 'add' ? 'POST' : 'PUT'
|
||||||
load()
|
httpPost(ep, { ...editForm, _method: method }).then(() => {
|
||||||
|
ElMessage.success(editMode.value === 'add' ? '新增成功' : '修改成功')
|
||||||
|
editVisible.value = false; load()
|
||||||
|
}).catch((e: any) => ElMessage.error(e?.msg || '操作失败'))
|
||||||
}
|
}
|
||||||
function onDelete(row: Region) {
|
function onDelete(row: Region) {
|
||||||
ElMessageBox.confirm(`确认删除「${row.name}」? ${row.children?.length ? '该节点下有子节点, 将一起删除!' : ''}`, '提示', { type: 'warning' }).then(() => {
|
ElMessageBox.confirm(`确认删除「${row.name}」? ${row.children?.length ? '该节点下有子节点, 将一起删除!' : ''}`, '提示', { type: 'warning' }).then(async () => {
|
||||||
ElMessage.success('已删除 (mock)')
|
try { await httpPost('/sys/region/' + row.id, { _method: 'DELETE' }); ElMessage.success('已删除'); load() }
|
||||||
load()
|
catch (e: any) { ElMessage.error(e?.msg || '删除失败') }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -244,6 +244,8 @@ const routes: RouteRecordRaw[] = [
|
|||||||
{ path: '/other/textconfig', component: () => import('@/modules/other/textconfig/TextconfigListView.vue'), meta: { title: '常量配置' } },
|
{ path: '/other/textconfig', component: () => import('@/modules/other/textconfig/TextconfigListView.vue'), meta: { title: '常量配置' } },
|
||||||
{ path: '/other/groupbuy', component: () => import('@/modules/other/groupbuy/GroupbuyListView.vue'), meta: { title: '拼团活动' } },
|
{ path: '/other/groupbuy', component: () => import('@/modules/other/groupbuy/GroupbuyListView.vue'), meta: { title: '拼团活动' } },
|
||||||
{ path: '/other/seckill', component: () => import('@/modules/other/seckill/SeckillListView.vue'), meta: { title: '秒杀活动' } },
|
{ path: '/other/seckill', component: () => import('@/modules/other/seckill/SeckillListView.vue'), meta: { title: '秒杀活动' } },
|
||||||
|
// 价格公式变量
|
||||||
|
{ path: '/supplier/priceFormulaVariable', component: () => import('@/modules/supplier/priceformula/PriceFormulaVariableListView.vue'), meta: { title: '价格公式变量' } },
|
||||||
// supplier 2 个
|
// supplier 2 个
|
||||||
{ path: '/supplier/coupon', component: () => import('@/modules/supplier/coupon/CouponListView.vue'), meta: { title: '优惠券' } }, // W7: 独立 view, 走 /supplier/coupon/page 真 API
|
{ path: '/supplier/coupon', component: () => import('@/modules/supplier/coupon/CouponListView.vue'), meta: { title: '优惠券' } }, // W7: 独立 view, 走 /supplier/coupon/page 真 API
|
||||||
{ path: '/supplier/promoter', component: () => import('@/modules/supplier/promoter/PromoterListView.vue'), meta: { title: '推广员管理' } },
|
{ path: '/supplier/promoter', component: () => import('@/modules/supplier/promoter/PromoterListView.vue'), meta: { title: '推广员管理' } },
|
||||||
|
|||||||
@ -100,13 +100,14 @@ export const useInquiryStore = defineStore('inquiry', () => {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
error.value = null
|
error.value = null
|
||||||
try {
|
try {
|
||||||
const data = await httpGet<any[]>('/sys/openapi/inquiry/list', {
|
const resp = await httpGet<any>('/supplier/inquiry/page', {
|
||||||
page: page.value,
|
page: page.value,
|
||||||
limit: limit.value,
|
limit: limit.value,
|
||||||
...(statusFilter.value ? { status: statusFilter.value } : {})
|
...(statusFilter.value ? { status: statusFilter.value } : {})
|
||||||
})
|
})
|
||||||
list.value = (Array.isArray(data) ? data : []).map(normalizeInquiry)
|
const arr = Array.isArray(resp) ? resp : (resp?.list || [])
|
||||||
total.value = list.value.length + (page.value - 1) * limit.value // 简化 total(后端不返)
|
list.value = arr.map(normalizeInquiry)
|
||||||
|
total.value = Number(resp?.total || (arr.length + (page.value - 1) * limit.value))
|
||||||
isLive.value = true
|
isLive.value = true
|
||||||
lastFetchedAt.value = Date.now()
|
lastFetchedAt.value = Date.now()
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
@ -123,7 +124,7 @@ export const useInquiryStore = defineStore('inquiry', () => {
|
|||||||
*/
|
*/
|
||||||
async function fetchOne(id: string): Promise<Inquiry | null> {
|
async function fetchOne(id: string): Promise<Inquiry | null> {
|
||||||
try {
|
try {
|
||||||
const data = await httpGet<any>(`/sys/openapi/inquiry/${id}`)
|
const data = await httpGet<any>('/supplier/inquiry/getById', { id })
|
||||||
return data ? normalizeInquiry(data) : null
|
return data ? normalizeInquiry(data) : null
|
||||||
} catch {
|
} catch {
|
||||||
return null
|
return null
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user