fix(AdminIndex): 修复提交分配时支付图片字段格式问题
修改 submitAssignment 方法中的 payload 结构,将 payment_image_url 改为 payment_object_names 数组以匹配 API 要求
This commit is contained in:
@@ -73,7 +73,8 @@
|
||||
<template #header>
|
||||
<n-space align="center">
|
||||
<span class="table-title">数据列表</span>
|
||||
<n-text depth="3" style="font-size: 12px; font-weight: normal;">共找到 {{ pagination.itemCount }}
|
||||
<n-text depth="3" style="font-size: 12px; font-weight: normal;">共找到 {{ pagination.itemCount
|
||||
}}
|
||||
条记录</n-text>
|
||||
</n-space>
|
||||
</template>
|
||||
@@ -86,16 +87,8 @@
|
||||
</n-button>
|
||||
</template>
|
||||
|
||||
<n-data-table
|
||||
remote
|
||||
:columns="columns"
|
||||
:data="displayData"
|
||||
:scroll-x="1800"
|
||||
:bordered="false"
|
||||
:pagination="pagination"
|
||||
:loading="loading"
|
||||
:row-class-name="() => 'table-row'"
|
||||
/>
|
||||
<n-data-table remote :columns="columns" :data="displayData" :scroll-x="1800" :bordered="false"
|
||||
:pagination="pagination" :loading="loading" :row-class-name="() => 'table-row'" />
|
||||
</n-card>
|
||||
</div>
|
||||
|
||||
@@ -106,7 +99,9 @@
|
||||
<n-space vertical :size="24">
|
||||
<!-- 分配操作区 -->
|
||||
<div class="info-group highlight-group">
|
||||
<div class="group-title"><n-icon><BrushOutline /></n-icon> 执行分配</div>
|
||||
<div class="group-title"><n-icon>
|
||||
<BrushOutline />
|
||||
</n-icon> 执行分配</div>
|
||||
<n-form label-placement="left" label-width="100">
|
||||
<n-form-item label="分配指导师">
|
||||
<n-input v-model:value="editingRow.guideName" placeholder="输入指导师姓名" />
|
||||
@@ -119,22 +114,35 @@
|
||||
|
||||
<!-- 详情展示区 -->
|
||||
<div class="info-group">
|
||||
<div class="group-title"><n-icon><PersonOutline /></n-icon> 客户及成交信息</div>
|
||||
<n-descriptions label-placement="left" :column="2" bordered size="small" class="custom-desc">
|
||||
<n-descriptions-item label="分析师主管">{{ editingRow.analystSupervisor }}</n-descriptions-item>
|
||||
<n-descriptions-item label="分析师部门">{{ editingRow.analystDepartment }}</n-descriptions-item>
|
||||
<n-descriptions-item label="分析师姓名">{{ editingRow.analystName }}</n-descriptions-item>
|
||||
<div class="group-title"><n-icon>
|
||||
<PersonOutline />
|
||||
</n-icon> 客户及成交信息</div>
|
||||
<n-descriptions label-placement="left" :column="2" bordered size="small"
|
||||
class="custom-desc">
|
||||
<n-descriptions-item label="分析师主管">{{ editingRow.analystSupervisor
|
||||
}}</n-descriptions-item>
|
||||
<n-descriptions-item label="分析师部门">{{ editingRow.analystDepartment
|
||||
}}</n-descriptions-item>
|
||||
<n-descriptions-item label="分析师姓名">{{ editingRow.analystName
|
||||
}}</n-descriptions-item>
|
||||
<n-descriptions-item label="家长姓名">{{ editingRow.parentName }}</n-descriptions-item>
|
||||
<n-descriptions-item label="家长电话">{{ editingRow.parentPhone }}</n-descriptions-item>
|
||||
<n-descriptions-item label="身份证号">{{ editingRow.parentIdCard }}</n-descriptions-item>
|
||||
<n-descriptions-item label="成交日期">{{ editingRow.transactionDate }}</n-descriptions-item>
|
||||
<n-descriptions-item label="成交金额"><span class="price-text">¥{{ editingRow.transactionAmount }}</span></n-descriptions-item>
|
||||
<n-descriptions-item label="指导周期" :span="2">{{ editingRow.guidancePeriod }}</n-descriptions-item>
|
||||
<n-descriptions-item label="身份证号">{{ editingRow.parentIdCard
|
||||
}}</n-descriptions-item>
|
||||
<n-descriptions-item label="成交日期">{{ editingRow.transactionDate
|
||||
}}</n-descriptions-item>
|
||||
<n-descriptions-item label="成交金额"><span class="price-text">¥{{
|
||||
editingRow.transactionAmount
|
||||
}}</span></n-descriptions-item>
|
||||
<n-descriptions-item label="指导周期" :span="2">{{ editingRow.guidancePeriod
|
||||
}}</n-descriptions-item>
|
||||
</n-descriptions>
|
||||
</div>
|
||||
|
||||
<div class="info-group">
|
||||
<div class="group-title"><n-icon><FileTrayOutline /></n-icon> 附件文档</div>
|
||||
<div class="group-title"><n-icon>
|
||||
<FileTrayOutline />
|
||||
</n-icon> 附件文档</div>
|
||||
<div class="file-box" v-if="editingRow.files?.length && editingRow.files[0]">
|
||||
<n-button block secondary type="primary" @click="downloadFile">下载附件文档</n-button>
|
||||
</div>
|
||||
@@ -142,16 +150,21 @@
|
||||
</div>
|
||||
|
||||
<div class="info-group">
|
||||
<div class="group-title"><n-icon><ImagesOutline /></n-icon> 付款截图</div>
|
||||
<div class="group-title"><n-icon>
|
||||
<ImagesOutline />
|
||||
</n-icon> 付款截图</div>
|
||||
<n-image-group>
|
||||
<n-space>
|
||||
<n-image v-for="(img, i) in editingRow.paymentImages" :key="i" width="120" height="120" fit="cover" class="preview-img" :src="img" />
|
||||
<n-image v-for="(img, i) in editingRow.paymentImages" :key="i" width="120"
|
||||
height="120" fit="cover" class="preview-img" :src="img" />
|
||||
</n-space>
|
||||
</n-image-group>
|
||||
</div>
|
||||
|
||||
<div class="info-group">
|
||||
<div class="group-title"><n-icon><BrushOutline /></n-icon> 电子签名</div>
|
||||
<div class="group-title"><n-icon>
|
||||
<BrushOutline />
|
||||
</n-icon> 电子签名</div>
|
||||
<div class="signature-wrapper">
|
||||
<n-image v-if="editingRow.signature" width="240" :src="editingRow.signature" />
|
||||
<n-text v-else depth="3">暂无签名数据</n-text>
|
||||
@@ -162,7 +175,8 @@
|
||||
<template #footer>
|
||||
<n-space justify="end">
|
||||
<n-button @click="showDrawer = false">取消</n-button>
|
||||
<n-button type="primary" :loading="submitLoading" @click="handleDrawerSubmit">确认分配并提交</n-button>
|
||||
<n-button type="primary" :loading="submitLoading"
|
||||
@click="handleDrawerSubmit">确认分配并提交</n-button>
|
||||
</n-space>
|
||||
</template>
|
||||
</n-drawer-content>
|
||||
@@ -231,7 +245,7 @@ const fetchData = async () => {
|
||||
page: pagination.page,
|
||||
page_size: pagination.pageSize
|
||||
})
|
||||
|
||||
|
||||
if (searchParams.wecom_id) query.append('wecom_id', searchParams.wecom_id)
|
||||
if (searchParams.status) query.append('status', searchParams.status)
|
||||
|
||||
@@ -258,7 +272,7 @@ const fetchData = async () => {
|
||||
signature: item.signature_image_url,
|
||||
files: item.attachment_file_url ? [item.attachment_file_url] : [],
|
||||
// 交互字段
|
||||
guideName: '',
|
||||
guideName: '',
|
||||
guidePhone: '',
|
||||
isSubmitting: false
|
||||
}))
|
||||
@@ -282,11 +296,14 @@ const submitAssignment = async (row) => {
|
||||
|
||||
row.isSubmitting = true
|
||||
try {
|
||||
// --- 修改开始 ---
|
||||
// 构建与 curl 命令匹配的 payload
|
||||
const payload = {
|
||||
wecom_id: row.id,
|
||||
payment_image_url: row.paymentImages[0] || "",
|
||||
signature_image_url: row.signature || "",
|
||||
attachment_file_url: row.files[0] || "",
|
||||
// payment_object_names 需要是一个数组
|
||||
payment_object_names: row.paymentImages || [],
|
||||
signature_object_name: row.signature || "",
|
||||
attachment_object_name: row.files?.[0] || "",
|
||||
analyst_supervisor: row.analystSupervisor,
|
||||
analyst_department: row.analystDepartment,
|
||||
analyst_name: row.analystName,
|
||||
@@ -299,6 +316,7 @@ const submitAssignment = async (row) => {
|
||||
assignee_name: row.guideName,
|
||||
assignee_phone: row.guidePhone
|
||||
}
|
||||
// --- 修改结束 ---
|
||||
|
||||
const response = await fetch('http://192.168.15.115:5636/api/v1/material/submit', {
|
||||
method: 'POST',
|
||||
@@ -335,9 +353,9 @@ const columns = [
|
||||
title: '状态',
|
||||
key: 'status',
|
||||
width: 90,
|
||||
render: (row) => h(NTag, {
|
||||
type: row.status === 'pending' ? 'warning' : 'success',
|
||||
round: true, size: 'small'
|
||||
render: (row) => h(NTag, {
|
||||
type: row.status === 'pending' ? 'warning' : 'success',
|
||||
round: true, size: 'small'
|
||||
}, { default: () => row.status === 'pending' ? '待处理' : '已处理' })
|
||||
},
|
||||
{ title: '成交金额', key: 'transactionAmount', width: 100, render: (row) => h('span', { class: 'price-text' }, `¥${row.transactionAmount}`) },
|
||||
@@ -413,7 +431,7 @@ const resetSearch = () => {
|
||||
onMounted(() => fetchData())
|
||||
|
||||
const logout = () => { localStorage.clear(); router.push('/login') }
|
||||
const downloadFile = () => { if(editingRow.value.files?.[0]) window.open(editingRow.value.files[0]) }
|
||||
const downloadFile = () => { if (editingRow.value.files?.[0]) window.open(editingRow.value.files[0]) }
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -478,7 +496,8 @@ const downloadFile = () => { if(editingRow.value.files?.[0]) window.open(editing
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.search-card, .table-card {
|
||||
.search-card,
|
||||
.table-card {
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
|
||||
margin-bottom: 20px;
|
||||
|
||||
Reference in New Issue
Block a user