修改 付款 收款 和认领页面
This commit is contained in:
@@ -18,9 +18,9 @@
|
||||
</div>
|
||||
|
||||
<div class="boxshadow">
|
||||
<el-tabs v-model="activeTab" @tab-click="handleTabChange">
|
||||
<el-tab-pane label="未认领" name="unclaimed"></el-tab-pane>
|
||||
<el-tab-pane label="已认领" name="claimed"></el-tab-pane>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="未认领" name="not"></el-tab-pane>
|
||||
<el-tab-pane label="已认领" name="already"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<ArtTable
|
||||
ref="tableRef"
|
||||
@@ -34,26 +34,16 @@
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<template #default>
|
||||
<ElTableColumn label="阿里订单号/PI号" prop="flows_name" min-width="140" />
|
||||
<ElTableColumn label="创建日期" prop="biz_desc" min-width="160" />
|
||||
<ElTableColumn label="内勤" prop="initiator_name" min-width="120">
|
||||
<template #default="scope">
|
||||
<div style="display: flex; align-items: center">
|
||||
<img class="avatar" :src="scope.row.initiator_avatar" alt="" />
|
||||
<p>{{ scope.row.initiator_name }}</p>
|
||||
</div>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="付款来源" prop="approver_name" min-width="120" />
|
||||
<ElTableColumn label="汇款人" prop="status_desc" min-width="120" />
|
||||
<ElTableColumn label="账户" prop="created_at" min-width="120" />
|
||||
<ElTableColumn label="账币种户" prop="created_at" min-width="120" />
|
||||
<ElTableColumn label="金额" prop="created_at" min-width="120" />
|
||||
<ElTableColumn label="创建日期" prop="created_at" min-width="160" />
|
||||
<ElTableColumn label="付款来源" prop="country_name" min-width="120" />
|
||||
<ElTableColumn label="汇款人" prop="remitter" min-width="120" />
|
||||
<ElTableColumn label="账户" prop="account_name" min-width="120" />
|
||||
<ElTableColumn label="账币" prop="currency_name" min-width="120" />
|
||||
<ElTableColumn label="金额" prop="amount" min-width="120" />
|
||||
<ElTableColumn label="操作" fixed="right" min-width="140" align="center">
|
||||
<template #default>
|
||||
<template #default="scope">
|
||||
<ElRow :gutter="10" justify="center">
|
||||
<el-link
|
||||
v-if="hasAuth('receipt_records@show')"
|
||||
type="primary"
|
||||
underline="never"
|
||||
@click="handleView()"
|
||||
@@ -62,20 +52,12 @@
|
||||
<i class="iconfont-sys"></i> 查看
|
||||
</el-link>
|
||||
<el-link
|
||||
v-if="hasAuth('receipt_records@update')"
|
||||
v-if="!scope.row.payment_apply_id"
|
||||
type="success"
|
||||
underline="never"
|
||||
@click="handleEdit()"
|
||||
@click="handleClaim(scope.row)"
|
||||
>
|
||||
<i class="iconfont-sys"></i> 修改
|
||||
</el-link>
|
||||
<el-link
|
||||
v-if="hasAuth('receipt_records@destroy')"
|
||||
type="danger"
|
||||
underline="never"
|
||||
@click="handleDelete()"
|
||||
>
|
||||
<i class="iconfont-sys"></i> 删除
|
||||
<i class="iconfont-sys"></i> 认领
|
||||
</el-link>
|
||||
</ElRow>
|
||||
</template>
|
||||
@@ -83,15 +65,23 @@
|
||||
</template>
|
||||
</ArtTable>
|
||||
</div>
|
||||
|
||||
<!-- 付款记录选择对话框 -->
|
||||
<PaymentRecordDialog
|
||||
v-model="paymentDialogVisible"
|
||||
:receipt-id="currentReceiptId"
|
||||
@confirm="handlePaymentRecordConfirm"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { manageService } from '@/api/adminApi'
|
||||
import { financeService } from '@/api/financeApi'
|
||||
import { financeService } from '@/api/admin/finance'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import PaymentRecordDialog from '@/components/custom/PaymentRecordDialog.vue'
|
||||
defineOptions({ name: 'Adminclaim' })
|
||||
const { hasAuth } = useAuth()
|
||||
const loading = ref(false)
|
||||
@@ -99,7 +89,11 @@
|
||||
const tableRef = ref()
|
||||
const tableData = ref<any[]>([])
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 10, total: 0 })
|
||||
const activeTab = ref('unclaimed')
|
||||
const activeTab = ref('not')
|
||||
|
||||
// 付款记录对话框相关
|
||||
const paymentDialogVisible = ref(false)
|
||||
const currentReceiptId = ref<string | number>('')
|
||||
|
||||
// 审批弹出框相关
|
||||
onMounted(() => {
|
||||
@@ -110,7 +104,10 @@
|
||||
pagination.currentPage = 1
|
||||
// 不自动请求,保持与截图行为一致,点击搜索或回车触发
|
||||
})
|
||||
|
||||
watch([activeTab], () => {
|
||||
pagination.currentPage = 1
|
||||
getList()
|
||||
})
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -118,11 +115,11 @@
|
||||
const params = {
|
||||
current: currentPage,
|
||||
size: pageSize,
|
||||
scene: 'todo',
|
||||
payment_apply: activeTab.value,
|
||||
keyword: keyword.value
|
||||
}
|
||||
|
||||
const { records, current, size, total } = await manageService.stockapprovalrecord(params)
|
||||
const { records, current, size, total } = await financeService.getReceiptList(params)
|
||||
tableData.value = records || []
|
||||
Object.assign(pagination, { currentPage: current, pageSize: size, total })
|
||||
} catch (error) {
|
||||
@@ -141,13 +138,31 @@
|
||||
getList()
|
||||
}
|
||||
const handleView = () => {}
|
||||
const handleEdit = () => {}
|
||||
const handleDelete = () => {}
|
||||
const handleTabChange = (tab: any) => {
|
||||
activeTab.value = tab.name
|
||||
pagination.currentPage = 1
|
||||
getList()
|
||||
|
||||
// 处理认领操作
|
||||
const handleClaim = (row: any) => {
|
||||
currentReceiptId.value = row.id
|
||||
paymentDialogVisible.value = true
|
||||
}
|
||||
|
||||
// 处理付款记录确认绑定
|
||||
const handlePaymentRecordConfirm = async (paymentRecord: any) => {
|
||||
try {
|
||||
const params = {
|
||||
id: currentReceiptId.value,
|
||||
payment_apply_id: paymentRecord.id
|
||||
}
|
||||
|
||||
await financeService.bindPaymentRecord(params)
|
||||
ElMessage.success('认领成功')
|
||||
getList() // 刷新列表
|
||||
} catch (error) {
|
||||
console.error('认领失败:', error)
|
||||
ElMessage.error('认领失败,请稍后重试')
|
||||
}
|
||||
}
|
||||
|
||||
const handleDelete = () => {}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
v-if="hasAuth('payment_records@show')"
|
||||
type="primary"
|
||||
underline="never"
|
||||
@click="handleView()"
|
||||
@click="handleView(scope.row)"
|
||||
style="margin-right: 8px"
|
||||
>
|
||||
<i class="iconfont-sys"></i> 查看
|
||||
@@ -362,6 +362,12 @@
|
||||
<ElButton type="primary" @click="orderPicker.visible = false">关闭</ElButton>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 付款记录详情查看对话框 -->
|
||||
<PaymentRecordDetailDialog
|
||||
v-model="detailDialogVisible"
|
||||
:payment-id="currentPaymentId"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts"></script>
|
||||
@@ -369,6 +375,7 @@
|
||||
import { commonService } from '@/api/commonApi'
|
||||
import { financeService } from '@/api/admin/finance'
|
||||
import { UserService } from '@/api/usersApi'
|
||||
import PaymentRecordDetailDialog from '@/components/custom/PaymentRecordDetailDialog.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { purchaseService } from '@/api/admin/procurement'
|
||||
@@ -593,6 +600,10 @@
|
||||
const createLoading = ref(false)
|
||||
const isEdit = ref(false)
|
||||
const currentId = ref<string | number | null>(null)
|
||||
|
||||
// 详情对话框相关
|
||||
const detailDialogVisible = ref(false)
|
||||
const currentPaymentId = ref<string | number>('')
|
||||
const createFormRef = ref<FormInstance>()
|
||||
const form = ref({
|
||||
payment_apply_id: '',
|
||||
@@ -609,7 +620,7 @@
|
||||
swift: '',
|
||||
voucher_file: [] as string[],
|
||||
voucher_file_list: [] as string[],
|
||||
submit_files: [] as string[],
|
||||
submit_files: [] as object[],
|
||||
submit_files_list: [] as string[]
|
||||
})
|
||||
const createRules: FormRules = {
|
||||
@@ -668,6 +679,7 @@
|
||||
const payload: any = { ...form.value }
|
||||
delete payload.submit_files_list
|
||||
delete payload.voucher_file_list
|
||||
delete payload.sales_user_name
|
||||
payload.voucher_file = payload.voucher_file.join(',')
|
||||
// 将所选备货单 ID 列表传给后端字段(兼容旧字段)
|
||||
if (Array.isArray(payload.stock_id)) {
|
||||
@@ -688,6 +700,7 @@
|
||||
const { message } = await financeService.updatePayment(forms)
|
||||
ElMessage.success(message)
|
||||
} else {
|
||||
// console.log('payload:', payload)
|
||||
const { message } = await financeService.addPayment(payload)
|
||||
ElMessage.success(message)
|
||||
}
|
||||
@@ -698,7 +711,10 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleView = () => {}
|
||||
const handleView = (row: any) => {
|
||||
currentPaymentId.value = row.id
|
||||
detailDialogVisible.value = true
|
||||
}
|
||||
const handleEdit = async (row?: any) => {
|
||||
resetCreateForm()
|
||||
isEdit.value = true
|
||||
@@ -722,7 +738,7 @@
|
||||
}
|
||||
form.value.sales_user_id = row.sales_user_id ?? form.value.sales_user_id
|
||||
form.value.sales_user_name = row.sales_user_name ?? form.value.sales_user_name
|
||||
form.value.corp_id = row.corp_id ?? form.value.corp_id
|
||||
form.value.corp_id = String(row.corp_id ?? '')
|
||||
form.value.country_id = row.country_id ?? form.value.country_id
|
||||
form.value.remitter = row.remitter ?? form.value.remitter
|
||||
form.value.account_id = row.account_id ?? form.value.account_id
|
||||
@@ -747,18 +763,11 @@
|
||||
}
|
||||
// 处理入账资料提交文件
|
||||
if (row.submit_files) {
|
||||
const submitFiles = Array.isArray(row.submit_files)
|
||||
? row.submit_files
|
||||
: String(row.submit_files)
|
||||
.split(',')
|
||||
.map((s: string) => s.trim())
|
||||
.filter(Boolean)
|
||||
const submitFiles = row.submit_files
|
||||
form.value.submit_files = submitFiles
|
||||
// 构造预览URL列表
|
||||
const baseUrl = import.meta.env.VITE_API_URL || ''
|
||||
form.value.submit_files_list = submitFiles.map((file: string) =>
|
||||
file.startsWith('http') ? file : `${baseUrl}/${file}`
|
||||
)
|
||||
form.value.submit_files_list = submitFiles.map((file: any) => file.file_name)
|
||||
}
|
||||
}
|
||||
loadOptions()
|
||||
@@ -805,7 +814,13 @@
|
||||
const fileName = response?.data?.file_name || ''
|
||||
const fileUrl = response?.data?.file_url || response?.data?.full_url || response?.url || ''
|
||||
const names = Array.isArray(form.value.submit_files) ? [...form.value.submit_files] : []
|
||||
if (fileName) names.push(fileName)
|
||||
const files = ref({
|
||||
file_src: '',
|
||||
file_name: ''
|
||||
})
|
||||
files.value.file_src = fileName
|
||||
files.value.file_name = response?.data?.original_name || ''
|
||||
if (fileName) names.push(files.value)
|
||||
form.value.submit_files = names
|
||||
const list = Array.isArray(form.value.submit_files_list) ? form.value.submit_files_list : []
|
||||
list.push(fileUrl)
|
||||
|
||||
@@ -46,6 +46,12 @@
|
||||
<ElTableColumn label="币种" prop="currency_name" min-width="120" />
|
||||
<ElTableColumn label="金额" prop="amount" min-width="120" />
|
||||
<ElTableColumn label="折让金额" prop="discount_amount" min-width="120" />
|
||||
<ElTableColumn label="入账" prop="id" min-width="120">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.received_at">{{ scope.row.received_at }}</span>
|
||||
<el-button v-else type="primary" size="small" @click="handlebtn">确认入账</el-button>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="操作" fixed="right" min-width="140" align="center">
|
||||
<template #default="scope">
|
||||
<ElRow :gutter="10" justify="center">
|
||||
@@ -53,7 +59,7 @@
|
||||
v-if="hasAuth('receipt_records@show')"
|
||||
type="primary"
|
||||
underline="never"
|
||||
@click="handleView()"
|
||||
@click="handleView(scope.row)"
|
||||
style="margin-right: 8px"
|
||||
>
|
||||
<i class="iconfont-sys"></i> 查看
|
||||
@@ -246,6 +252,118 @@
|
||||
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-model="dialogVisibleshow"
|
||||
title="查看收款记录"
|
||||
width="900px"
|
||||
class="receipt-dialog"
|
||||
>
|
||||
<el-form ref="createFormRef" :model="formshow" label-width="180px" class="receipt-form">
|
||||
<ElRow :gutter="12" class="item-row-wrap">
|
||||
<ElCol :sm="24" :md="12" :lg="12">
|
||||
<el-form-item label="付款来源">
|
||||
<el-input v-model="formshow.country_name" disabled />
|
||||
</el-form-item>
|
||||
</ElCol>
|
||||
<ElCol :sm="24" :md="12" :lg="12">
|
||||
<el-form-item label="汇款人">
|
||||
<el-input v-model="formshow.remitter" disabled />
|
||||
</el-form-item>
|
||||
</ElCol>
|
||||
<ElCol :sm="24" :md="12" :lg="12">
|
||||
<el-form-item label="账户">
|
||||
<el-input v-model="formshow.account_name" disabled />
|
||||
</el-form-item>
|
||||
</ElCol>
|
||||
<ElCol :sm="24" :md="12" :lg="12">
|
||||
<el-form-item label="币种">
|
||||
<el-input v-model="formshow.currency_name" disabled />
|
||||
</el-form-item>
|
||||
</ElCol>
|
||||
<ElCol :sm="24" :md="12" :lg="12">
|
||||
<el-form-item label="金额">
|
||||
<el-input v-model="formshow.amount" disabled />
|
||||
</el-form-item>
|
||||
</ElCol>
|
||||
<ElCol :sm="24" :md="12" :lg="12">
|
||||
<el-form-item label="到账时间">
|
||||
<el-input v-model="formshow.arrived_at" disabled />
|
||||
</el-form-item>
|
||||
</ElCol>
|
||||
<ElCol :sm="24" :md="12" :lg="12">
|
||||
<el-form-item label="折让金额">
|
||||
<el-input v-model="formshow.discount_amount" disabled />
|
||||
</el-form-item>
|
||||
</ElCol>
|
||||
<ElCol :sm="24" :md="12" :lg="12">
|
||||
<el-form-item label="收汇凭证号">
|
||||
<el-input v-model="formshow.voucher_no" disabled />
|
||||
</el-form-item>
|
||||
</ElCol>
|
||||
<ElCol :sm="24" :md="12" :lg="12">
|
||||
<el-form-item label="实际汇率(出纳)">
|
||||
<el-input v-model="formshow.exchange_rate" disabled />
|
||||
</el-form-item>
|
||||
</ElCol>
|
||||
<ElCol :sm="24" :md="12" :lg="12">
|
||||
<el-form-item label="总金额(人民币)实际汇率">
|
||||
<el-input v-model="formshow.total_amount_cny" disabled />
|
||||
</el-form-item>
|
||||
</ElCol>
|
||||
<ElCol :sm="24" :md="12" :lg="12">
|
||||
<el-form-item label="是否转回内地">
|
||||
<el-radio-group v-model="formshow.is_domestic_return" disabled>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</ElCol>
|
||||
<ElCol :sm="24" :md="12" :lg="12">
|
||||
<el-form-item label="外汇到账回单(出纳)">
|
||||
<div
|
||||
v-if="
|
||||
Array.isArray(formshow.fx_receipt_file_list) &&
|
||||
formshow.fx_receipt_file_list.length
|
||||
"
|
||||
style="margin-top: 8px"
|
||||
>
|
||||
<div
|
||||
v-for="(u, i) in formshow.fx_receipt_file_list"
|
||||
:key="i"
|
||||
style="display: flex; align-items: center; gap: 8px; margin-bottom: 6px"
|
||||
>
|
||||
<img
|
||||
v-if="/\.(png|jpe?g|gif|webp|bmp|svg)(\?|$)/i.test((u || '').split('?')[0])"
|
||||
:src="u"
|
||||
style="
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
object-fit: cover;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--el-border-color);
|
||||
"
|
||||
/>
|
||||
<a
|
||||
v-else
|
||||
:href="u"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
style="
|
||||
flex: 1;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
width: 200px;
|
||||
"
|
||||
>{{ (u || '').split('?')[0].split('/').pop() }}</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</ElCol>
|
||||
</ElRow>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -262,6 +380,7 @@
|
||||
defineOptions({ name: 'AdminReceiptRecords' })
|
||||
const { hasAuth } = useAuth()
|
||||
const loading = ref(false)
|
||||
const dialogVisibleshow = ref(false)
|
||||
const keyword = ref('')
|
||||
const tableRef = ref()
|
||||
const tableData = ref<any[]>([])
|
||||
@@ -366,7 +485,21 @@
|
||||
account_id: [{ required: true, message: '请选择账户', trigger: 'change' }],
|
||||
currency_id: [{ required: true, message: '请选择币种', trigger: 'change' }]
|
||||
}
|
||||
|
||||
const formshow = ref({
|
||||
country_name: '',
|
||||
remitter: '',
|
||||
account_name: '',
|
||||
currency_name: '',
|
||||
amount: '',
|
||||
arrived_at: '',
|
||||
discount_amount: '',
|
||||
voucher_no: '',
|
||||
total_amount_cny: '',
|
||||
exchange_rate: '',
|
||||
is_domestic_return: 0,
|
||||
fx_receipt_file: '',
|
||||
fx_receipt_file_list: [] as string[]
|
||||
})
|
||||
const resetCreateForm = () => {
|
||||
Object.assign(form.value, {
|
||||
country_id: '',
|
||||
@@ -403,7 +536,11 @@
|
||||
createLoading.value = true
|
||||
// TODO: 根据新增/编辑调用对应接口
|
||||
if (isEdit.value) {
|
||||
const forms = { ...form.value, id: currentId.value }
|
||||
const formData = { ...form.value }
|
||||
if ('fx_receipt_file_list' in formData) {
|
||||
delete formData.fx_receipt_file_list
|
||||
}
|
||||
const forms = { ...formData, id: currentId.value }
|
||||
const { message } = await financeService.updateReceipt(forms)
|
||||
ElMessage.success(message)
|
||||
} else {
|
||||
@@ -417,7 +554,15 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleView = () => {}
|
||||
const handleView = (row?: any) => {
|
||||
const fx_receipt_file_full = []
|
||||
if (row.fx_receipt_file_full) {
|
||||
fx_receipt_file_full.push(row.fx_receipt_file_full)
|
||||
}
|
||||
formshow.value = row
|
||||
formshow.value.fx_receipt_file_list = fx_receipt_file_full
|
||||
dialogVisibleshow.value = true
|
||||
}
|
||||
const handleEdit = (row?: any) => {
|
||||
resetCreateForm()
|
||||
isEdit.value = true
|
||||
@@ -435,8 +580,13 @@
|
||||
form.value.exchange_rate = row.exchange_rate ?? form.value.exchange_rate
|
||||
form.value.is_domestic_return = row.is_domestic_return ?? form.value.is_domestic_return
|
||||
form.value.fx_receipt_file = row.fx_receipt_file ?? form.value.fx_receipt_file
|
||||
form.value.fx_receipt_file_list = Array.isArray(row.fx_receipt_file_list)
|
||||
? row.fx_receipt_file_list
|
||||
|
||||
const fx_receipt_file_full = []
|
||||
if (row.fx_receipt_file_full) {
|
||||
fx_receipt_file_full.push(row.fx_receipt_file_full)
|
||||
}
|
||||
form.value.fx_receipt_file_list = Array.isArray(fx_receipt_file_full)
|
||||
? fx_receipt_file_full
|
||||
: form.value.fx_receipt_file_list
|
||||
}
|
||||
fetchAccountOptions()
|
||||
@@ -444,6 +594,18 @@
|
||||
fetchCountryOptions()
|
||||
dialogVisible.value = true
|
||||
}
|
||||
const handlebtn = () => {
|
||||
ElMessageBox.confirm('你是否确认入账?', '入账', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// financeService.deleteReceipt({ id: currentId.value }).then((res) => {
|
||||
// ElMessage.success(res.message)
|
||||
// getList()
|
||||
// })
|
||||
})
|
||||
}
|
||||
const handleDelete = () => {
|
||||
ElMessageBox.confirm('确定删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
|
||||
Reference in New Issue
Block a user