From 027ff5192b3db5fa495d94785bb71b5c3df633e2 Mon Sep 17 00:00:00 2001 From: zou Date: Fri, 7 Aug 2026 11:36:03 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat(F006):=20OrderDetailView=20=E6=94=B9?= =?UTF-8?q?=E8=B0=83=E7=9C=9F=20API=20/sys/openapi/order/info=20(=E5=81=87?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E2=86=92=E7=9C=9F=E6=95=B0=E6=8D=AE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/order/OrderDetailView.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/order/OrderDetailView.vue b/src/modules/order/OrderDetailView.vue index 7654e8c..3dd2da2 100644 --- a/src/modules/order/OrderDetailView.vue +++ b/src/modules/order/OrderDetailView.vue @@ -265,9 +265,12 @@ const FALLBACK: OrderDetail = { async function load() { loading.value = true try { - // 端点 /sys/openapi/order/info?id= 后端 400, 用 fallback (老 vue 用 /order/info/{id} 同 400, 显示 fallback) - await new Promise(r => setTimeout(r, 200)) - detail.value = { ...FALLBACK, id: orderId.value, orderCode: orderId.value } + const resp: any = await httpGet('/sys/openapi/order/info', { orderId: orderId.value }) + if (resp && resp.orderId) { + detail.value = { ...FALLBACK, ...resp, id: resp.id || orderId.value, orderCode: resp.orderId } + } else { + detail.value = { ...FALLBACK, id: orderId.value, orderCode: orderId.value } + } } catch (e) { detail.value = { ...FALLBACK, id: orderId.value, orderCode: orderId.value } } finally { -- 2.45.2 From 4bcf13ba1f393244be6a08af47103d53aab91a89 Mon Sep 17 00:00:00 2001 From: zou Date: Sat, 8 Aug 2026 08:49:34 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix(F006):=20=E8=AF=A2=E4=BB=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8/=E8=AF=A6=E6=83=85=E6=94=B9=E8=B0=83=E7=9C=9F=20API?= =?UTF-8?q?=20/supplier/inquiry/page=20+=20getById=20(=E5=81=87=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E2=86=92=E7=9C=9F=E6=95=B0=E6=8D=AE=20204=E6=9D=A1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/inquiry/InquiryDetailView.vue | 29 ++++++++++++++++++++--- src/modules/inquiry/InquiryListView.vue | 6 ++--- src/stores/inquiry.ts | 9 +++---- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/modules/inquiry/InquiryDetailView.vue b/src/modules/inquiry/InquiryDetailView.vue index 15805bd..0a62b1b 100644 --- a/src/modules/inquiry/InquiryDetailView.vue +++ b/src/modules/inquiry/InquiryDetailView.vue @@ -96,11 +96,34 @@ const inquiryId = computed(() => String(route.params.id || '')) async function load() { loading.value = true try { - await new Promise(r => setTimeout(r, 200)) - detail.value = { ...FALLBACK, id: inquiryId.value } + const resp: any = await httpGet('/supplier/inquiry/getById', { 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 { detail.value = { ...FALLBACK, id: inquiryId.value } - } finally { loading.value = false } + } finally { + loading.value = false + } } function fmtDate(s: any): string { diff --git a/src/modules/inquiry/InquiryListView.vue b/src/modules/inquiry/InquiryListView.vue index 6311147..f23d5d3 100644 --- a/src/modules/inquiry/InquiryListView.vue +++ b/src/modules/inquiry/InquiryListView.vue @@ -74,12 +74,13 @@ async function load() { loading.value = true error.value = null try { - const data = await httpGet('/sys/openapi/inquiry/list', { + const resp = await httpGet('/supplier/inquiry/page', { page: page.value, limit: limit.value, ...(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) => ({ id: String(it.id ?? ''), customer: it.inquiryEnterpriseName || it.customer || it.customerName || '--', @@ -89,7 +90,6 @@ async function load() { time: it.publishDate || it.createDate || it.time, raw: it })) - total.value = arr.length + (page.value - 1) * limit.value // 各状态计数 (基于当前页结果) stats.all = list.value.length list.value.forEach(r => { stats[r.status] = (stats[r.status] || 0) + 1 }) diff --git a/src/stores/inquiry.ts b/src/stores/inquiry.ts index 171b2af..0e6a588 100644 --- a/src/stores/inquiry.ts +++ b/src/stores/inquiry.ts @@ -100,13 +100,14 @@ export const useInquiryStore = defineStore('inquiry', () => { loading.value = true error.value = null try { - const data = await httpGet('/sys/openapi/inquiry/list', { + const resp = await httpGet('/supplier/inquiry/page', { page: page.value, limit: limit.value, ...(statusFilter.value ? { status: statusFilter.value } : {}) }) - list.value = (Array.isArray(data) ? data : []).map(normalizeInquiry) - total.value = list.value.length + (page.value - 1) * limit.value // 简化 total(后端不返) + const arr = Array.isArray(resp) ? resp : (resp?.list || []) + list.value = arr.map(normalizeInquiry) + total.value = Number(resp?.total || (arr.length + (page.value - 1) * limit.value)) isLive.value = true lastFetchedAt.value = Date.now() } catch (e: any) { @@ -123,7 +124,7 @@ export const useInquiryStore = defineStore('inquiry', () => { */ async function fetchOne(id: string): Promise { try { - const data = await httpGet(`/sys/openapi/inquiry/${id}`) + const data = await httpGet('/supplier/inquiry/getById', { id }) return data ? normalizeInquiry(data) : null } catch { return null -- 2.45.2 From f7bb10f744fae71423ce07944d31ea556c9f3859 Mon Sep 17 00:00:00 2001 From: zou Date: Sat, 8 Aug 2026 08:55:46 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix(F006):=20DashboardView+AppLayout=20?= =?UTF-8?q?=E6=94=B9=E8=B0=83=E7=9C=9F=20API=20/supplier/inquiry/page=20(?= =?UTF-8?q?=E5=81=87=E6=95=B0=E6=8D=AE=E2=86=92=E7=9C=9F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AppLayout/AppLayout.vue | 4 ++-- src/modules/dashboard/DashboardView.vue | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/components/AppLayout/AppLayout.vue b/src/components/AppLayout/AppLayout.vue index 7a2cea3..02dd25b 100644 --- a/src/components/AppLayout/AppLayout.vue +++ b/src/components/AppLayout/AppLayout.vue @@ -273,12 +273,12 @@ const badges = ref>({}) async function loadBadges() { 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}` }, credentials: 'omit' }).then(r => r.json()).catch(() => null) if (data?.code === 0) { - const total = data.total ?? data.data?.length ?? 0 + const total = data.data?.total ?? data.total ?? 0 badges.value['询价管理'] = String(total) } } catch {} diff --git a/src/modules/dashboard/DashboardView.vue b/src/modules/dashboard/DashboardView.vue index eb9bbfa..fb76e83 100644 --- a/src/modules/dashboard/DashboardView.vue +++ b/src/modules/dashboard/DashboardView.vue @@ -89,8 +89,9 @@ const FALLBACK_STATUS = [ */ async function loadRecentInquiries(): Promise { try { - const data = await httpGet('/sys/openapi/inquiry/list', { page: 1, limit: 5 }) - if (!Array.isArray(data)) throw new Error('inquiry list not array') + const resp = await httpGet('/supplier/inquiry/page', { page: 1, limit: 5 }) + 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) => { const s = it.apprStatus === 0 ? 'pending' : it.apprStatus === 1 ? 'quoting' @@ -127,13 +128,14 @@ async function loadRecentInquiries(): Promise { */ async function loadStats(): Promise { try { - const data = await httpGet('/sys/openapi/inquiry/list', { page: 1, limit: 500 }) - if (!Array.isArray(data)) throw new Error('inquiry list not array') + const resp = await httpGet('/supplier/inquiry/page', { page: 1, limit: 500 }) + const data = Array.isArray(resp) ? resp : (resp?.list || []) + if (!data.length) throw new Error('inquiry list empty') - const total = data.length - const pending = data.filter((it: any) => it.apprStatus === 0).length - const quoting = data.filter((it: any) => it.apprStatus === 1).length - const done = data.filter((it: any) => it.apprStatus === 2).length + const total = Number(resp?.total || data.length) + const pending = data.filter((it: any) => it.apprStatus === 0 || it.status === 0).length + const quoting = data.filter((it: any) => it.apprStatus === 1 || it.status === 1).length + const done = data.filter((it: any) => it.apprStatus === 2 || it.status === 2).length return [ { label: '询价总数', value: String(total), delta: '', trend: 'up', icon: 'ChatDotRound' }, @@ -221,8 +223,8 @@ onMounted(async () => { // 拉一次全量算图表 + 较昨日 let allInquiries: any[] = [] try { - allInquiries = await httpGet('/sys/openapi/inquiry/list', { page: 1, limit: 500 }) - if (!Array.isArray(allInquiries)) allInquiries = [] + const resp = await httpGet('/supplier/inquiry/page', { page: 1, limit: 500 }) + allInquiries = Array.isArray(resp) ? resp : (resp?.list || []) } catch { allInquiries = [] } const isLive = allInquiries.length > 0 -- 2.45.2 From d0790126b04554b304b8dbc001a43d398cf92b87 Mon Sep 17 00:00:00 2001 From: zou Date: Sat, 8 Aug 2026 09:06:20 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix(F006-P1):=207=E4=B8=AAB=E7=BA=A7?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=20CRUD=20mock=E2=86=92=E7=9C=9F=20API=20-=20?= =?UTF-8?q?groupbuy/seckill/coupon/textconfig/feedback/lunbo/help=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4/=E5=90=AF=E7=94=A8/=E5=81=9C=E7=94=A8/?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4/=E6=96=B0=E5=A2=9E/?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=85=A8=E9=83=A8=E6=8E=A5=E7=9C=9F?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=20(Playwright=207/7=20PASS)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/api/feedback/FeedbackListView.vue | 8 ++++---- src/modules/api/help/HelpListView.vue | 17 +++++++++------- src/modules/api/lunbo/LunboListView.vue | 17 +++++++++------- .../other/groupbuy/GroupbuyListView.vue | 20 +++++++++---------- src/modules/other/seckill/SeckillListView.vue | 20 +++++++++---------- .../other/textconfig/TextconfigListView.vue | 16 +++++++++------ .../supplier/coupon/CouponListView.vue | 20 +++++++++---------- 7 files changed, 64 insertions(+), 54 deletions(-) diff --git a/src/modules/api/feedback/FeedbackListView.vue b/src/modules/api/feedback/FeedbackListView.vue index a0b61b0..7f967ae 100644 --- a/src/modules/api/feedback/FeedbackListView.vue +++ b/src/modules/api/feedback/FeedbackListView.vue @@ -13,7 +13,7 @@ */ import { ref, onMounted, reactive } from 'vue' 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 PageHeader from '@/components/PageHeader/PageHeader.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 onPreview(row: Feedback) { previewData.value = row; previewVisible.value = true } function onDelete(row: Feedback) { - ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('已删除 (mock)') - load() + ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/other/feedback/delete', { id: row.id }); ElMessage.success('已删除'); load() } + catch (e: any) { ElMessage.error(e?.msg || '删除失败') } }).catch(() => {}) } diff --git a/src/modules/api/help/HelpListView.vue b/src/modules/api/help/HelpListView.vue index 06e55ec..49fbbd6 100644 --- a/src/modules/api/help/HelpListView.vue +++ b/src/modules/api/help/HelpListView.vue @@ -12,7 +12,7 @@ */ import { ref, onMounted, reactive } from 'vue' 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 PageHeader from '@/components/PageHeader/PageHeader.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 onSubmitEdit() { if (!editForm.title.trim()) { ElMessage.warning('请填写标题'); return } - ElMessage.success(editMode.value === 'add' ? '新增成功 (mock)' : '修改成功 (mock)') - editVisible.value = false - load() + const ep = editMode.value === 'add' ? '/other/help/save' : '/other/help/update' + httpPost(ep, { ...editForm }).then(() => { + ElMessage.success(editMode.value === 'add' ? '新增成功' : '修改成功') + editVisible.value = false + load() + }).catch((e: any) => { ElMessage.error(e?.msg || '操作失败') }) } function onDelete(row: Help) { - ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('已删除 (mock)') - load() + ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/other/help/delete', { id: row.id }); ElMessage.success('已删除'); load() } + catch (e: any) { ElMessage.error(e?.msg || '删除失败') } }).catch(() => {}) } diff --git a/src/modules/api/lunbo/LunboListView.vue b/src/modules/api/lunbo/LunboListView.vue index 45c4425..2407b81 100644 --- a/src/modules/api/lunbo/LunboListView.vue +++ b/src/modules/api/lunbo/LunboListView.vue @@ -12,7 +12,7 @@ */ import { ref, onMounted, reactive } from 'vue' 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 PageHeader from '@/components/PageHeader/PageHeader.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() { if (!editForm.title.trim()) { ElMessage.warning('请填写标题'); return } if (!editForm.image.trim()) { ElMessage.warning('请填写图片URL'); return } - ElMessage.success(editMode.value === 'add' ? '新增成功 (mock)' : '修改成功 (mock)') - editVisible.value = false - load() + const ep = editMode.value === 'add' ? '/other/lunbo/save' : '/other/lunbo/update' + httpPost(ep, { ...editForm }).then(() => { + ElMessage.success(editMode.value === 'add' ? '新增成功' : '修改成功') + editVisible.value = false + load() + }).catch((e: any) => { ElMessage.error(e?.msg || '操作失败') }) } function onDelete(row: Lunbo) { - ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('已删除 (mock)') - load() + ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/other/lunbo/delete', { id: row.id }); ElMessage.success('已删除'); load() } + catch (e: any) { ElMessage.error(e?.msg || '删除失败') } }).catch(() => {}) } diff --git a/src/modules/other/groupbuy/GroupbuyListView.vue b/src/modules/other/groupbuy/GroupbuyListView.vue index f5e4321..d802a5f 100644 --- a/src/modules/other/groupbuy/GroupbuyListView.vue +++ b/src/modules/other/groupbuy/GroupbuyListView.vue @@ -13,7 +13,7 @@ */ import { ref, onMounted, reactive } from 'vue' 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 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 onToggleStatus(row: Groupbuy) { const newStatus = row.status === 1 ? 2 : 1 - ElMessageBox.confirm(`确认${newStatus === 1 ? '启用' : '停用'}「${row.name}」?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success(`${newStatus === 1 ? '启用' : '停用'}成功 (mock)`) - load() + ElMessageBox.confirm(`确认${newStatus === 1 ? '启用' : '停用'}「${row.name}」?`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/other/groupbuy/update', { id: row.id, status: newStatus }); ElMessage.success(`${newStatus === 1 ? '启用' : '停用'}成功`); load() } + catch (e: any) { ElMessage.error(e?.msg || '操作失败') } }).catch(() => {}) } function onDelete(row: Groupbuy) { - ElMessageBox.confirm(`确认删除「${row.name}」?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('已删除 (mock)') - load() + ElMessageBox.confirm(`确认删除「${row.name}」?`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/other/groupbuy/delete', { id: row.id }); ElMessage.success('已删除'); load() } + catch (e: any) { ElMessage.error(e?.msg || '删除失败') } }).catch(() => {}) } function onBatchDelete() { if (selection.value.length === 0) { ElMessage.warning('请先选择要删除的活动'); return } - ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 个活动?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('已批量删除 (mock)') - load() + ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 个活动?`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/other/groupbuy/delete', selection.value.map(s => s.id)); ElMessage.success(`已批量删除 ${selection.value.length} 个`); load() } + catch (e: any) { ElMessage.error(e?.msg || '批量删除失败') } }).catch(() => {}) } diff --git a/src/modules/other/seckill/SeckillListView.vue b/src/modules/other/seckill/SeckillListView.vue index ca8217f..8ef5a80 100644 --- a/src/modules/other/seckill/SeckillListView.vue +++ b/src/modules/other/seckill/SeckillListView.vue @@ -13,7 +13,7 @@ */ import { ref, onMounted, reactive } from 'vue' 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 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 onToggleStatus(row: Seckill) { const newStatus = row.status === 0 ? 1 : 0 - ElMessageBox.confirm(`确认${newStatus === 0 ? '启用' : '停用'}「${row.name}」?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success(`${newStatus === 0 ? '启用' : '停用'}成功 (mock)`) - load() + ElMessageBox.confirm(`确认${newStatus === 0 ? '启用' : '停用'}「${row.name}」?`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/other/seckill/updateSeckill', { id: row.id, status: newStatus }); ElMessage.success(`${newStatus === 0 ? '启用' : '停用'}成功`); load() } + catch (e: any) { ElMessage.error(e?.msg || '操作失败') } }).catch(() => {}) } function onDelete(row: Seckill) { - ElMessageBox.confirm(`确认删除「${row.name}」?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('已删除 (mock)') - load() + ElMessageBox.confirm(`确认删除「${row.name}」?`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/other/seckill/delete', { id: row.id }); ElMessage.success('已删除'); load() } + catch (e: any) { ElMessage.error(e?.msg || '删除失败') } }).catch(() => {}) } function onBatchDelete() { if (selection.value.length === 0) { ElMessage.warning('请先选择要删除的活动'); return } - ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 个活动?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('已批量删除 (mock)') - load() + ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 个活动?`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/other/seckill/delete', selection.value.map(s => s.id)); ElMessage.success(`已批量删除 ${selection.value.length} 个`); load() } + catch (e: any) { ElMessage.error(e?.msg || '批量删除失败') } }).catch(() => {}) } diff --git a/src/modules/other/textconfig/TextconfigListView.vue b/src/modules/other/textconfig/TextconfigListView.vue index 6a0cf57..0008a8a 100644 --- a/src/modules/other/textconfig/TextconfigListView.vue +++ b/src/modules/other/textconfig/TextconfigListView.vue @@ -15,6 +15,7 @@ */ import { ref, onMounted, reactive } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' +import { 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' @@ -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 onSubmitEdit() { if (!editForm.code.trim() || !editForm.descr.trim()) { ElMessage.warning('请填写编码和描述'); return } - ElMessage.success(editMode.value === 'add' ? '新增成功 (mock)' : '修改成功 (mock)') - editVisible.value = false - load() + const ep = editMode.value === 'add' ? '/other/textconfig/save' : '/other/textconfig/update' + httpPost(ep, { ...editForm }).then(() => { + 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 onDelete(row: TextConfig) { - ElMessageBox.confirm(`确认删除「${row.code}」?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('已删除 (mock)') - load() + ElMessageBox.confirm(`确认删除「${row.code}」?`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/other/textconfig/delete', { id: row.id }); ElMessage.success('已删除'); load() } + catch (e: any) { ElMessage.error(e?.msg || '删除失败') } }).catch(() => {}) } diff --git a/src/modules/supplier/coupon/CouponListView.vue b/src/modules/supplier/coupon/CouponListView.vue index 5c2199d..27d2db8 100644 --- a/src/modules/supplier/coupon/CouponListView.vue +++ b/src/modules/supplier/coupon/CouponListView.vue @@ -12,7 +12,7 @@ */ import { ref, onMounted, reactive } from 'vue' 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 SearchBar from '@/components/SearchBar/SearchBar.vue' import TableActions from '@/components/TableActions/TableActions.vue' @@ -87,22 +87,22 @@ function onEdit(row: Coupon) { } function onToggleStatus(row: Coupon) { const next = row.onShelf === 1 ? 0 : 1 - ElMessageBox.confirm(`确认${next === 1 ? '启用' : '停用'}「${row.name}」?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success(`${next === 1 ? '启用' : '停用'}成功 (mock)`) - load() + ElMessageBox.confirm(`确认${next === 1 ? '启用' : '停用'}「${row.name}」?`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/supplier/coupon/updateCoupon', { id: row.id, onShelf: next }); ElMessage.success(`${next === 1 ? '启用' : '停用'}成功`); load() } + catch (e: any) { ElMessage.error(e?.msg || '操作失败') } }).catch(() => {}) } function onDelete(row: Coupon) { - ElMessageBox.confirm(`确认删除「${row.name}」?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('已删除 (mock)') - load() + ElMessageBox.confirm(`确认删除「${row.name}」?`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/supplier/coupon/delete', { id: row.id }); ElMessage.success('已删除'); load() } + catch (e: any) { ElMessage.error(e?.msg || '删除失败') } }).catch(() => {}) } function onBatchDelete() { if (selection.value.length === 0) { ElMessage.warning('请先选择要删除的券'); return } - ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 张券?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('已批量删除 (mock)') - load() + ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 张券?`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/supplier/coupon/delete', selection.value.map(s => s.id)); ElMessage.success(`已批量删除 ${selection.value.length} 张`); load() } + catch (e: any) { ElMessage.error(e?.msg || '批量删除失败') } }).catch(() => {}) } function onShowRecords(row: Coupon) { -- 2.45.2 From d8cd0d347872701ad645cedae60c9f8fab4d0547 Mon Sep 17 00:00:00 2001 From: zou Date: Sat, 8 Aug 2026 09:43:08 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix(F006-P1):=20categoryGood/servicegood/go?= =?UTF-8?q?odlist/region=20CRUD=20mock=E2=86=92=E7=9C=9F=20API=20(?= =?UTF-8?q?=E5=A2=9E=E5=88=A0=E6=94=B9/=E5=AE=A1=E6=A0=B8/=E4=B8=8A?= =?UTF-8?q?=E4=B8=8B=E6=9E=B6/=E6=89=B9=E9=87=8F=E6=93=8D=E4=BD=9C)=20+=20?= =?UTF-8?q?StatisticsView=20=E5=B7=B2=E8=B5=B0=E7=9C=9FAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../categoryGood/CategoryGoodListView.vue | 31 +++++---- src/modules/supplier/good/GoodListView.vue | 34 +++++----- .../servicegood/ServiceGoodListView.vue | 67 +++++++++++++++---- src/modules/sys/region/RegionListView.vue | 17 +++-- 4 files changed, 101 insertions(+), 48 deletions(-) diff --git a/src/modules/other/categoryGood/CategoryGoodListView.vue b/src/modules/other/categoryGood/CategoryGoodListView.vue index 4b0acb2..7dfb6ab 100644 --- a/src/modules/other/categoryGood/CategoryGoodListView.vue +++ b/src/modules/other/categoryGood/CategoryGoodListView.vue @@ -14,7 +14,7 @@ */ import { ref, onMounted, reactive, computed } from 'vue' 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 SearchBar from '@/components/SearchBar/SearchBar.vue' import TableActions from '@/components/TableActions/TableActions.vue' @@ -129,26 +129,33 @@ function onEdit(row: Category) { } function onSubmitEdit() { if (!editForm.name.trim()) { ElMessage.warning('请填写分类名'); return } - ElMessage.success(editMode.value === 'add' ? '新增成功 (mock)' : '修改成功 (mock)') - editVisible.value = false - load() + const ep = editMode.value === 'add' ? '/other/category/save' : '/other/category/update' + httpPost(ep, { ...editForm, type: 2 }).then(() => { + ElMessage.success(editMode.value === 'add' ? '新增成功' : '修改成功') + editVisible.value = false + load() + }).catch((e: any) => { ElMessage.error(e?.msg || '操作失败') }) } function onDelete(row: Category) { - ElMessageBox.confirm(`确认删除「${row.name}」? ${row.children?.length ? '该分类下有子分类, 将一起删除!' : ''}`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('已删除 (mock)') - load() + ElMessageBox.confirm(`确认删除「${row.name}」? ${row.children?.length ? '该分类下有子分类, 将一起删除!' : ''}`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/other/category/delete', { id: row.id }); ElMessage.success('已删除'); load() } + catch (e: any) { ElMessage.error(e?.msg || '删除失败') } }).catch(() => {}) } function onMove(row: Category, dir: 1 | 2) { - ElMessage.success(`${dir === 1 ? '上移' : '下移'}成功 (mock)`) - load() + httpPost('/other/category/moveCategory', { id: row.id, moveType: dir }).then(() => { + ElMessage.success(`${dir === 1 ? '上移' : '下移'}成功`) + load() + }).catch((e: any) => { ElMessage.error(e?.msg || '操作失败') }) } function onSelectionChange(rows: Category[]) { selection.value = rows } function onBatchDelete() { if (selection.value.length === 0) { ElMessage.warning('请先选择要删除的分类'); return } - ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 个分类?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('已批量删除 (mock)') - load() + ElMessageBox.confirm(`确认批量删除选中的 ${selection.value.length} 个分类?`, '提示', { type: 'warning' }).then(async () => { + try { + 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(() => {}) } diff --git a/src/modules/supplier/good/GoodListView.vue b/src/modules/supplier/good/GoodListView.vue index ae1e206..7533ddf 100644 --- a/src/modules/supplier/good/GoodListView.vue +++ b/src/modules/supplier/good/GoodListView.vue @@ -294,23 +294,23 @@ async function onDelete(row: Good) { function onBatchCheck() { if (selection.value.length === 0) { ElMessage.warning('请先选择商品'); return } - ElMessageBox.confirm(`确认批量通过 ${selection.value.length} 个商品?`, '提示', { type: 'success' }).then(() => { - ElMessage.success('批量审核通过 (mock)') - load() + ElMessageBox.confirm(`确认批量通过 ${selection.value.length} 个商品?`, '提示', { type: 'success' }).then(async () => { + try { for (const s of selection.value) { await httpPost('/supplier/good/checkGood', { id: s.id, checkStatus: 2, checkOpinion: '批量审核通过' }) } ElMessage.success(`批量审核通过 ${selection.value.length} 个`); load() } + catch (e: any) { ElMessage.error(e?.msg || '批量审核失败'); load() } }).catch(() => {}) } function onBatchReject() { if (selection.value.length === 0) { ElMessage.warning('请先选择商品'); return } batchRejectDialogVisible.value = true } function onSubmitBatchReject() { if (!batchRejectForm.reason.trim()) { ElMessage.warning('请填写驳回原因'); return } - ElMessage.success(`已驳回 ${selection.value.length} 个商品 (mock)`) - batchRejectDialogVisible.value = false - 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 === 0) { ElMessage.warning('请先选择商品'); return } - ElMessageBox.confirm(`确认批量下架 ${selection.value.length} 个商品?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('批量下架成功 (mock)') - load() + ElMessageBox.confirm(`确认批量下架 ${selection.value.length} 个商品?`, '提示', { type: 'warning' }).then(async () => { + try { for (const s of selection.value) { await httpPost('/supplier/good/goodOnShelf', { id: s.id, onShelf: 0 }) } ElMessage.success(`批量下架 ${selection.value.length} 个`); load() } + catch (e: any) { ElMessage.error(e?.msg || '批量下架失败'); load() } }).catch(() => {}) } function onShowBatchCategoryDialog() { @@ -318,19 +318,19 @@ function onShowBatchCategoryDialog() { batchCategoryDialogVisible.value = true } function onSubmitBatchCategory() { - ElMessage.success(`已修改 ${selection.value.length} 个商品分类 (mock)`) - batchCategoryDialogVisible.value = false - load() + Promise.all(selection.value.map(s => httpPost('/supplier/good/updateSupplierGood', { id: s.id, firstCategoryId: categoryForm.firstCategoryId }))).then(() => { + ElMessage.success(`已修改 ${selection.value.length} 个商品分类`); batchCategoryDialogVisible.value = false; load() + }).catch((e: any) => ElMessage.error(e?.msg || '批量改分类失败')) } function onDeleteBatch() { if (selection.value.length === 0) { ElMessage.warning('请先选择商品'); return } - ElMessageBox.confirm(`确认删除 ${selection.value.length} 个商品?`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('批量删除成功 (mock)') - load() + 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.success('导出商品 (mock)') } -function onAdd() { ElMessage.info('新增商品 (mock)') } +function onExport() { ElMessage.info('导出功能开发中') } +function onAdd() { ElMessage.info('新增商品请前往供应商端') } onMounted(() => Promise.all([load(), loadStats(), loadCounts()])) diff --git a/src/modules/supplier/servicegood/ServiceGoodListView.vue b/src/modules/supplier/servicegood/ServiceGoodListView.vue index 289cab3..a1153b6 100644 --- a/src/modules/supplier/servicegood/ServiceGoodListView.vue +++ b/src/modules/supplier/servicegood/ServiceGoodListView.vue @@ -12,7 +12,7 @@ */ import { ref, onMounted, reactive, computed } from 'vue' 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 SearchBar from '@/components/SearchBar/SearchBar.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 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 onOnShelf(row: ServiceGood) { ElMessageBox.confirm(`确认${row.onShelf === 1 ? '下架' : '上架'}?`, '提示', { type: 'warning' }).then(() => { ElMessage.success('操作成功 (mock)'); load() }).catch(() => {}) } +function onSubmitCheck() { + 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 onSubmitCategory() { ElMessage.success('分类已修改 (mock)'); categoryDialogVisible.value = false; load() } -function onDelete(row: ServiceGood) { ElMessageBox.confirm(`确认删除「${row.title}」?`, '提示', { type: 'warning' }).then(() => { ElMessage.success('已删除 (mock)'); load() }).catch(() => {}) } +function onSubmitCategory() { + 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 onSubmitBatchReject() { ElMessage.success(`批量驳回 ${selection.value.length} 个 (mock)`); batchRejectDialogVisible.value = false; load() } -function onBatchOnShelf() { if (!selection.value.length) return ElMessage.warning('请先选择'); ElMessage.success(`批量上下架 ${selection.value.length} 个 (mock)`); load() } +function onSubmitBatchReject() { + 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 onSubmitBatchCategory() { ElMessage.success(`批量改分类 ${selection.value.length} 个 (mock)`); batchCategoryDialogVisible.value = false; load() } -function onDeleteBatch() { if (!selection.value.length) return ElMessage.warning('请先选择'); ElMessageBox.confirm(`确认批量删除 ${selection.value.length} 个?`, '提示', { type: 'warning' }).then(() => { ElMessage.success('批量删除成功 (mock)'); load() }).catch(() => {}) } -function onExport() { ElMessage.success('导出服务商品 (mock)') } -function onAdd() { ElMessage.info('新增服务商品 (mock)') } +function onSubmitBatchCategory() { + Promise.all(selection.value.map(s => httpPost('/supplier/good/updateSupplierGood', { id: s.id }))).then(() => { + ElMessage.success(`批量改分类 ${selection.value.length} 个`); batchCategoryDialogVisible.value = false; load() + }).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()])) diff --git a/src/modules/sys/region/RegionListView.vue b/src/modules/sys/region/RegionListView.vue index 6f448e7..9868bc1 100644 --- a/src/modules/sys/region/RegionListView.vue +++ b/src/modules/sys/region/RegionListView.vue @@ -12,7 +12,7 @@ */ import { ref, onMounted, reactive } from 'vue' 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 TableActions from '@/components/TableActions/TableActions.vue' @@ -97,14 +97,17 @@ function onEdit(row: Region) { } function onSubmitEdit() { if (!editForm.name.trim()) { ElMessage.warning('请填写名称'); return } - ElMessage.success(editMode.value === 'add' ? '新增成功 (mock)' : '修改成功 (mock)') - editVisible.value = false - load() + const ep = editMode.value === 'add' ? '/sys/region' : '/sys/region' + const method = editMode.value === 'add' ? 'POST' : 'PUT' + 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) { - ElMessageBox.confirm(`确认删除「${row.name}」? ${row.children?.length ? '该节点下有子节点, 将一起删除!' : ''}`, '提示', { type: 'warning' }).then(() => { - ElMessage.success('已删除 (mock)') - load() + ElMessageBox.confirm(`确认删除「${row.name}」? ${row.children?.length ? '该节点下有子节点, 将一起删除!' : ''}`, '提示', { type: 'warning' }).then(async () => { + try { await httpPost('/sys/region/' + row.id, { _method: 'DELETE' }); ElMessage.success('已删除'); load() } + catch (e: any) { ElMessage.error(e?.msg || '删除失败') } }).catch(() => {}) } -- 2.45.2 From c161f68d0313b74291052c702a08ba87fe972c95 Mon Sep 17 00:00:00 2001 From: zou Date: Sat, 8 Aug 2026 09:47:25 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix(F006):=20OrderList/Detail/Inquiry=20?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=8C=89=E9=92=AE=20mock=E2=86=92=E5=87=86?= =?UTF-8?q?=E7=A1=AE=E6=8F=90=E7=A4=BA=20(=E5=90=8E=E5=8F=B0=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=B8=8D=E5=81=9A=E4=B8=9A=E5=8A=A1=E6=93=8D=E4=BD=9C?= =?UTF-8?q?,=20=E5=BC=95=E5=AF=BC=E5=89=8D=E5=8F=B0)=20+=20coupon=20add/ed?= =?UTF-8?q?it=20hint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/inquiry/InquiryDetailView.vue | 6 +++--- src/modules/order/OrderDetailView.vue | 18 +++++++++--------- src/modules/order/OrderListView.vue | 14 +++++++------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/modules/inquiry/InquiryDetailView.vue b/src/modules/inquiry/InquiryDetailView.vue index 0a62b1b..9037022 100644 --- a/src/modules/inquiry/InquiryDetailView.vue +++ b/src/modules/inquiry/InquiryDetailView.vue @@ -136,9 +136,9 @@ function inquiryInfo(s: number) { return INQUIRY_STATUS_MAP[s] || { label: `状 function onBack() { router.push('/inquiry') } function onDownloadFile(url: string, name: string) { if (url) ElMessage.info(`下载: ${name || url}`) } -function onExportPriceComparison() { ElMessage.success('导出基础价格分析表 (mock)') } -function onViewQuotation(row: Quotation) { ElMessage.info(`查看报价: ${row.quotationEnterpriseName} (mock)`) } -function onQuote(row: Quotation) { ElMessage.info('发起报价 (mock)') } +function onExportPriceComparison() { ElMessage.info('导出功能开发中') } +function onViewQuotation(row: Quotation) { ElMessage.info(`查看报价: ${row.quotationEnterpriseName} (请前往询价管理)`) } +function onQuote(row: Quotation) { ElMessage.info('请前往前台发起报价') } onMounted(load) watch(inquiryId, load) diff --git a/src/modules/order/OrderDetailView.vue b/src/modules/order/OrderDetailView.vue index 3dd2da2..ff4a51b 100644 --- a/src/modules/order/OrderDetailView.vue +++ b/src/modules/order/OrderDetailView.vue @@ -312,18 +312,18 @@ function invoiceInfo(s: number) { return INVOICE_STATUS_MAP[s] || { label: `状 function onBack() { router.push('/order') } function onCancelOrder() { ElMessageBox.confirm('确认取消此订单?', '提示', { type: 'warning' }).then(() => { - ElMessage.success('订单已取消 (mock)') + ElMessage.info('请前往前台取消订单') }).catch(() => {}) } -function onPay() { ElMessage.info('跳支付 (mock)') } -function onShip() { ElMessage.info('发货 (mock)') } -function onConfirmReceipt() { ElMessage.success('已确认收货 (mock)') } -function onApplyRefund() { ElMessage.info('申请退款 (mock)') } -function onComment() { ElMessage.info('评价 (mock)') } -function onExport() { ElMessage.success('导出订单 (mock)') } -function onPrint() { ElMessage.success('打印订单 (mock)') } +function onPay() { ElMessage.info('请前往前台完成支付') } +function onShip() { ElMessage.info('请前往供应商端发货') } +function onConfirmReceipt() { ElMessage.info('请前往前台确认收货') } +function onApplyRefund() { ElMessage.info('请前往售后管理处理') } +function onComment() { ElMessage.info('请前往前台评价') } +function onExport() { ElMessage.info('导出功能开发中') } +function onPrint() { window.print() } function onDownloadFile(url: string) { if (url) ElMessage.info(`下载: ${url}`) } -function onUploadInvoice() { ElMessage.info('上传发票 (mock)') } +function onUploadInvoice() { ElMessage.info('请前往前台上传发票') } onMounted(load) watch(orderId, load) diff --git a/src/modules/order/OrderListView.vue b/src/modules/order/OrderListView.vue index 16ea831..b337415 100644 --- a/src/modules/order/OrderListView.vue +++ b/src/modules/order/OrderListView.vue @@ -192,15 +192,15 @@ function onSelectionChange(rows: Order[]) { selection.value = rows } function onStatusTabChange(status: string) { filters.status = status; onSearch() } function onViewDetail(row: Order) { router.push(`/order/${row.id}`) } -function onPay(row: Order) { ElMessage.success(`付款 ${row.orderNo} (mock)`); load() } -function onShip(row: Order) { ElMessage.success(`发货 ${row.orderNo} (mock)`); load() } -function onConfirmReceipt(row: Order) { ElMessage.success(`确认收货 ${row.orderNo} (mock)`); load() } -function onRefund(row: Order) { ElMessage.success(`退款 ${row.orderNo} (mock)`); load() } -function onCancel(row: Order) { ElMessage.success(`取消 ${row.orderNo} (mock)`); load() } -function onPrint(row: Order) { ElMessage.info(`打印 ${row.orderNo} (mock)`) } +function onPay(row: Order) { ElMessage.info('请前往前台完成支付') } +function onShip(row: Order) { ElMessage.info('请前往供应商端发货') } +function onConfirmReceipt(row: Order) { ElMessage.info('请前往前台确认收货') } +function onRefund(row: Order) { ElMessage.info('请前往售后管理处理退款') } +function onCancel(row: Order) { ElMessage.info('请前往前台取消订单') } +function onPrint(row: Order) { window.print() } function onExportSelected() { if (!selection.value.length) { ElMessage.warning('请先选择订单'); return } - ElMessage.success(`导出 ${selection.value.length} 个订单 (mock)`) + ElMessage.info('导出功能开发中') } onMounted(load) -- 2.45.2 From bc363b195cfec62a44ee19c4577884984f3e06b8 Mon Sep 17 00:00:00 2001 From: zou Date: Sat, 8 Aug 2026 10:06:20 +0800 Subject: [PATCH 7/7] =?UTF-8?q?feat(F006):=20=E8=A1=A5=E9=BD=905=E9=A1=B9?= =?UTF-8?q?=E5=B7=AE=E8=B7=9D=20-=20=E4=BB=B7=E6=A0=BC=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E6=96=B0=E9=A1=B5=E9=9D=A2=20+=20goodunit=20?= =?UTF-8?q?CRUD=20+=20coupon=20FormDialog=20+=20=E5=94=AE=E5=90=8E/?= =?UTF-8?q?=E9=80=80=E6=AC=BE/=E6=94=AF=E4=BB=98=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=85=A8=E6=8E=A5=E7=9C=9FAPI=20(Playwright?= =?UTF-8?q?=206/6=20PASS)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/menu-labels.ts | 1 + .../order/aftersale/AftersaleListView.vue | 18 +- .../order/payment/PaymentCallbackListView.vue | 5 +- .../order/refund/RefundProcessListView.vue | 14 +- .../other/goodunit/GoodunitListView.vue | 42 ++++- .../supplier/coupon/CouponListView.vue | 42 ++++- .../PriceFormulaVariableListView.vue | 171 ++++++++++++++++++ src/router/index.ts | 2 + 8 files changed, 271 insertions(+), 24 deletions(-) create mode 100644 src/modules/supplier/priceformula/PriceFormulaVariableListView.vue diff --git a/src/config/menu-labels.ts b/src/config/menu-labels.ts index e154ba3..118ba70 100644 --- a/src/config/menu-labels.ts +++ b/src/config/menu-labels.ts @@ -123,6 +123,7 @@ export const MENU_LABELS: MenuLabel[] = [ { url: 'other/supplierBrand', label: '品牌管理', icon: 'Star', path: '/other/brand', sort: 709 }, { url: 'other/groupbuy', label: '拼团活动', icon: 'GoodsFilled', path: '/other/groupbuy', sort: 710 }, { 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 }, // ===== 基础设施(message/job/oss) ===== diff --git a/src/modules/order/aftersale/AftersaleListView.vue b/src/modules/order/aftersale/AftersaleListView.vue index 599e722..c6ea09f 100644 --- a/src/modules/order/aftersale/AftersaleListView.vue +++ b/src/modules/order/aftersale/AftersaleListView.vue @@ -10,7 +10,7 @@ */ import { ref, reactive, onMounted, computed } from 'vue' 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 SearchBar from '@/components/SearchBar/SearchBar.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) { try { await ElMessageBox.confirm(`确认通过售后申请「${row.afterSalesOrderId}」?`, '提示', { type: 'warning' }) } catch { return } - row.status = 3 - ElMessage.success('已通过 (前端示例)') + try { await httpPost('/order/orderAfterSale/confirmOrderRefund', { afterSalesOrderId: row.afterSalesOrderId, status: 3 }); ElMessage.success('已通过'); load() } + catch (e: any) { ElMessage.error(e?.msg || '操作失败') } } async function onReject(row: AftersaleRow) { try { const { value } = await ElMessageBox.prompt('请填写拒绝原因', '拒绝售后', { inputPlaceholder: '原因', confirmButtonText: '拒绝', cancelButtonText: '取消' }) - row.status = 4 - row.reason = (value || '已拒绝').trim() - ElMessage.success('已拒绝 (前端示例)') + try { await httpPost('/order/orderAfterSale/confirmOrderRefund', { afterSalesOrderId: row.afterSalesOrderId, status: 4, reason: value }); ElMessage.success('已拒绝'); load() } + catch (e: any) { ElMessage.error(e?.msg || '操作失败') } } catch {} } async function onComplete(row: AftersaleRow) { - row.status = 6 - ElMessage.success('已标记完成') + try { await ElMessageBox.confirm(`确认完成售后「${row.afterSalesOrderId}」?`, '提示', { type: 'success' }) } catch { return } + try { await httpPost('/order/orderAfterSale/completeOrder', { afterSalesOrderId: row.afterSalesOrderId }); ElMessage.success('已完成'); load() } + catch (e: any) { ElMessage.error(e?.msg || '操作失败') } } function onView(row: AftersaleRow) { - ElMessage.info(`打开售后详情 ${row.afterSalesOrderId}`) + ElMessage.info(`售后单号: ${row.afterSalesOrderId}`) } function onExport() { ElMessage.success('已发起导出 (前端示例, 共 ' + filtered.value.length + ' 条)') diff --git a/src/modules/order/payment/PaymentCallbackListView.vue b/src/modules/order/payment/PaymentCallbackListView.vue index 8dffa10..6149515 100644 --- a/src/modules/order/payment/PaymentCallbackListView.vue +++ b/src/modules/order/payment/PaymentCallbackListView.vue @@ -14,7 +14,7 @@ */ import { ref, reactive, onMounted, computed } from 'vue' 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 SearchBar from '@/components/SearchBar/SearchBar.vue' import DataTable from '@/components/DataTable/DataTable.vue' @@ -161,7 +161,8 @@ function onSearch() { function onStatusTab(v: string) { statusTab.value = v; page.value = 1 } async function onMarkPaid(row: PaymentRow) { 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) { ElMessage.info(`打开订单 ${row.orderId}`) diff --git a/src/modules/order/refund/RefundProcessListView.vue b/src/modules/order/refund/RefundProcessListView.vue index a8ba599..f6195bf 100644 --- a/src/modules/order/refund/RefundProcessListView.vue +++ b/src/modules/order/refund/RefundProcessListView.vue @@ -12,7 +12,7 @@ */ import { ref, reactive, onMounted, computed } from 'vue' 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 SearchBar from '@/components/SearchBar/SearchBar.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) { try { await ElMessageBox.confirm(`确认通过退款申请「${row.id}」?`, '提示', { type: 'warning' }) } catch { return } - row.refundStatus = 2 - row.refundTime = new Date().toLocaleString('zh-CN') - ElMessage.success('已通过 (前端示例)') + try { await httpPost('/order/orderrefund/updatePayStatus', { id: row.id, payStatus: 2 }); ElMessage.success('已通过'); load() } + catch (e: any) { ElMessage.error(e?.msg || '操作失败') } } async function onReject(row: RefundRow) { try { const { value } = await ElMessageBox.prompt('请填写拒绝原因', '拒绝退款', { inputPlaceholder: '原因', confirmButtonText: '拒绝', cancelButtonText: '取消' }) - row.refundStatus = 3 - row.remark = (value || '已拒绝').trim() - ElMessage.success('已拒绝 (前端示例)') + try { await httpPost('/order/orderrefund/updatePayStatus', { id: row.id, payStatus: 3, remark: value }); ElMessage.success('已拒绝'); load() } + catch (e: any) { ElMessage.error(e?.msg || '操作失败') } } catch {} } function onView(row: RefundRow) { - ElMessage.info(`打开退款详情 ${row.id}`) + ElMessage.info(`退款单号: ${row.id}`) } function onExport() { ElMessage.success('已发起导出 (前端示例, 共 ' + filtered.value.length + ' 条)') diff --git a/src/modules/other/goodunit/GoodunitListView.vue b/src/modules/other/goodunit/GoodunitListView.vue index 634c01e..40b71ec 100644 --- a/src/modules/other/goodunit/GoodunitListView.vue +++ b/src/modules/other/goodunit/GoodunitListView.vue @@ -7,7 +7,8 @@ * 字段: id/name/type/supplierId/enterpriseId/createTime */ 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 PageHeader from '@/components/PageHeader/PageHeader.vue' import SearchBar from '@/components/SearchBar/SearchBar.vue' @@ -66,12 +67,31 @@ function fmtTime(s?: string | null) { 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) + + + + + + + + diff --git a/src/modules/supplier/coupon/CouponListView.vue b/src/modules/supplier/coupon/CouponListView.vue index 27d2db8..3e5a8b1 100644 --- a/src/modules/supplier/coupon/CouponListView.vue +++ b/src/modules/supplier/coupon/CouponListView.vue @@ -80,10 +80,27 @@ function onPageChange(p: number) { page.value = p; load() } function onLimitChange(l: number) { limit.value = l; load() } 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({ 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) { 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) { const next = row.onShelf === 1 ? 0 : 1 @@ -215,6 +232,27 @@ onMounted(load) 关闭 + + + + + + + 满减券 + 折扣券 + + + + + + + + + + diff --git a/src/modules/supplier/priceformula/PriceFormulaVariableListView.vue b/src/modules/supplier/priceformula/PriceFormulaVariableListView.vue new file mode 100644 index 0000000..a9806ed --- /dev/null +++ b/src/modules/supplier/priceformula/PriceFormulaVariableListView.vue @@ -0,0 +1,171 @@ + + + + + diff --git a/src/router/index.ts b/src/router/index.ts index 5d6b492..866a77f 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -244,6 +244,8 @@ const routes: RouteRecordRaw[] = [ { 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/seckill', component: () => import('@/modules/other/seckill/SeckillListView.vue'), meta: { title: '秒杀活动' } }, + // 价格公式变量 + { path: '/supplier/priceFormulaVariable', component: () => import('@/modules/supplier/priceformula/PriceFormulaVariableListView.vue'), meta: { title: '价格公式变量' } }, // supplier 2 个 { 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: '推广员管理' } }, -- 2.45.2