From d49e839280ce2cb3ad9c822a590f3f9cafff240d Mon Sep 17 00:00:00 2001 From: zou Date: Mon, 31 Aug 2026 17:52:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(F006):=20=E8=AF=A2=E4=BB=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=8A=A0=E5=AE=A1=E6=A0=B8=E7=8A=B6=E6=80=81tab(?= =?UTF-8?q?=E5=85=A8=E9=83=A8/=E5=BE=85=E5=AE=A1=E6=A0=B8/=E5=B7=B2?= =?UTF-8?q?=E9=80=9A=E8=BF=87/=E5=B7=B2=E9=A9=B3=E5=9B=9E)=20+=20=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E5=AE=A1=E6=A0=B8=E9=80=9A=E8=BF=87/?= =?UTF-8?q?=E9=A9=B3=E5=9B=9E=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/inquiry/InquiryDetailView.vue | 31 ++++++++++++++++++++++- src/modules/inquiry/InquiryListView.vue | 29 +++++++++++++-------- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/src/modules/inquiry/InquiryDetailView.vue b/src/modules/inquiry/InquiryDetailView.vue index 9037022..906cf8c 100644 --- a/src/modules/inquiry/InquiryDetailView.vue +++ b/src/modules/inquiry/InquiryDetailView.vue @@ -11,7 +11,7 @@ import { ref, onMounted, watch, computed } from 'vue' import { useRoute, useRouter } from 'vue-router' import { ElMessage } from 'element-plus' -import { httpGet } from '@/utils/request' +import { httpGet, httpPost } from '@/utils/request' import PageHeader from '@/components/PageHeader/PageHeader.vue' interface Inquiry { @@ -126,6 +126,31 @@ async function load() { } } +// === 审核操作: apprStatus 2=通过 3=驳回 === +const auditLoading = ref(false) +async function onAudit(status: number) { + const note = status === 3 ? prompt('请输入驳回原因:') : '' + if (status === 3 && note === null) return + auditLoading.value = true + try { + const res: any = await httpPost('/supplier/inquiry/saveInquiryAudit', { + id: detail.value?.id, + apprStatus: status, + ...(status === 3 && note ? { auditNote: note } : {}), + }) + if (res?.code === 0) { + ElMessage.success(status === 2 ? '审核通过,询价已发布' : '已驳回') + load() + } else { + ElMessage.error(res?.msg || '操作失败') + } + } catch (e: any) { + ElMessage.error(e?.msg || e?.message || '操作失败') + } finally { + auditLoading.value = false + } +} + function fmtDate(s: any): string { if (!s) return '--' return String(s).substring(0, 19).replace('T', ' ') @@ -165,6 +190,10 @@ watch(inquiryId, load)
+ 导出基础价格分析表
diff --git a/src/modules/inquiry/InquiryListView.vue b/src/modules/inquiry/InquiryListView.vue index 6d48a31..3d1f675 100644 --- a/src/modules/inquiry/InquiryListView.vue +++ b/src/modules/inquiry/InquiryListView.vue @@ -52,7 +52,8 @@ const limit = ref(10) const filters = ref({ status: '', customer: '', - searchKey: '' + searchKey: '', + apprStatus: '' }) function fmtDate(ts?: string | number | null) { @@ -77,7 +78,7 @@ async function load() { const resp = await httpGet('/supplier/inquiry/page', { page: page.value, limit: limit.value, - ...(filters.value.status ? { status: filters.value.status } : {}) + ...(filters.value.apprStatus ? { apprStatus: filters.value.apprStatus } : {}) }) const arr = Array.isArray(resp) ? resp : (resp?.list || []) total.value = Number(resp?.total || (arr.length + (page.value - 1) * limit.value)) @@ -87,6 +88,7 @@ async function load() { product: it.title || it.product || it.productName || '--', qty: it.purchaseQuantity || it.qty || '--', status: it.status || (it.apprStatus != null ? (['pending','quoting','done','cancelled'][it.apprStatus] || 'pending') : 'pending'), + apprStatus: it.apprStatus, time: it.publishDate || it.createDate || it.time, raw: it })) @@ -104,16 +106,19 @@ async function load() { function onSearch() { page.value = 1; load() } -const tabItems = computed(() => STATUS_TABS.map(t => ({ - key: t.value, - label: t.label, - count: t.value === '' ? stats.all : (stats[t.value] || 0) -}))) +// 审核状态 tab (运营审核用): ''=全部 1=待审核 2=已通过 3=已驳回 +const AUDIT_TABS = [ + { value: '', label: '全部' }, + { value: '1', label: '待审核' }, + { value: '2', label: '已通过' }, + { value: '3', label: '已驳回' }, +] +const tabItems = computed(() => AUDIT_TABS.map(t => ({ key: t.value, label: t.label }))) function onReset() { filters.value.status = ''; filters.value.customer = ''; filters.value.searchKey = ''; page.value = 1; load() } function onPageChange(p: number) { page.value = p; load() } function onLimitChange(l: number) { limit.value = l; page.value = 1; load() } function onStatusTab(v: string) { - filters.value.status = v + filters.value.apprStatus = v page.value = 1 load() } @@ -125,7 +130,7 @@ const columns = computed(() => [ { prop: 'customer', label: '客户', minWidth: 180 }, { prop: 'product', label: '商品', minWidth: 180 }, { prop: 'qty', label: '数量', width: 120 }, - { prop: 'status', label: '状态', width: 100, slot: 'status' }, + { prop: 'apprStatus', label: '审核状态', width: 100, slot: 'apprStatus' }, { prop: 'time', label: '时间', width: 170, slot: 'time' }, { label: '操作', width: 100, slot: 'action' } ]) @@ -165,8 +170,10 @@ onMounted(() => { load() }) @limit-change="onLimitChange" @row-click="onRowClick" > -