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"
>
-
- {{ STATUS_LABEL[row.status] || row.status }}
+
+
+ {{ row.apprStatus === 1 ? '待审核' : (row.apprStatus === 2 ? '已通过' : (row.apprStatus === 3 ? '已驳回' : '--')) }}
+
{{ fmtDate(row.time) }}