This commit is contained in:
qsh
2024-06-19 00:31:40 +08:00
parent e3c85cbaae
commit 5aab5c0f82
8 changed files with 467 additions and 87 deletions

View File

@@ -2,13 +2,21 @@
<div>
<el-form :model="searchForm" label-width="0" inline>
<el-form-item>
<el-input v-model="searchForm.signId" placeholder="成交单号" />
<el-input v-model="searchForm.signId" placeholder="成交单号" clearable />
</el-form-item>
<el-form-item>
<el-input v-model="searchForm.name" placeholder="线索名称" />
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.dealUser" placeholder="登记人" clearable filterable>
<el-select v-model="searchForm.state" placeholder="审核状态" clearable>
<el-option label="待审核" :value="1" />
<el-option label="已撤销" :value="2" />
<el-option label="已通过" :value="3" />
<el-option label="已驳回" :value="4" />
</el-select>
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.signUser" placeholder="登记人" clearable filterable>
<el-option
v-for="item in userOptions"
:key="item.id"
@@ -27,7 +35,7 @@
/>
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.createUser" placeholder="申请人" clearable filterable>
<el-select v-model="searchForm.applyUser" placeholder="申请人" clearable filterable>
<el-option
v-for="item in userOptions"
:key="item.id"
@@ -38,7 +46,7 @@
</el-form-item>
<el-form-item>
<el-date-picker
v-model="searchForm.createDate"
v-model="searchForm.applyTime"
type="daterange"
range-separator="-"
start-placeholder="申请日期"
@@ -52,29 +60,42 @@
</el-form-item>
</el-form>
<el-table :data="tableList" border>
<el-table-column prop="signId" label="成交单号" width="150px" />
<el-table-column prop="name" label="线索名称" />
<el-table-column prop="phone" label="联系方式" width="150px" />
<el-table-column prop="signId" label="回款金额" />
<el-table-column prop="signId" label="是否结清" />
<el-table-column prop="signId" label="备注" width="200px" />
<el-table-column prop="signId" label="登记" />
<el-table-column prop="signId" label="登记时间" width="150px" />
<el-table-column prop="signId" label="申请" />
<el-table-column prop="signId" label="申请时间" width="150px" />
<el-table-column prop="signId" label="审核状态" fixed="right" />
<el-table v-loading="loading" :data="tableList" border>
<el-table-column prop="signId" label="成交单号" min-width="150px" />
<el-table-column prop="name" label="线索名称" min-width="200px" />
<el-table-column prop="phone" label="联系方式" min-width="150px" />
<el-table-column prop="money" label="回款金额" min-width="90" />
<el-table-column prop="isPayoff" label="是否结清" min-width="90" />
<el-table-column prop="signUserName" label="登记人" min-width="90" />
<el-table-column prop="dealDate" label="登记时间" min-width="150px" />
<el-table-column prop="applyUserName" label="申请人" min-width="90" />
<el-table-column prop="applyTime" label="申请时间" min-width="150px" />
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90" />
<el-table-column label="操作" width="150px" fixed="right">
<template #default="{ row }">
<el-button type="primary" style="padding: 0" text @click="handleDetail(row.id)"
>详情</el-button
<el-button type="primary" style="padding: 0" text @click="handleDetail(row.id)">
详情
</el-button>
<el-button
type="primary"
style="padding: 0"
text
v-if="row.state == 1 && currentUserId == row.applyUser"
v-hasPermi="['clue:order:return']"
@click="handleCancel(row.id)"
>
<el-button type="primary" style="padding: 0" text @click="handleCancel(row.id)"
>撤销</el-button
>
<el-button type="primary" style="padding: 0" text @click="handleAudit(row.id)"
>审核</el-button
撤销
</el-button>
<el-button
type="primary"
style="padding: 0"
text
v-if="row.state == 1"
v-hasPermi="['clue:order:return-audit']"
@click="handleAudit(row.id)"
>
审核
</el-button>
</template>
</el-table-column>
</el-table>
@@ -88,13 +109,23 @@
</template>
<script setup name="Reback">
import * as FeebackApi from '@/api/clue/payment'
import { getSimpleUserList as getUserOption } from '@/api/system/user'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const message = useMessage() // 消息弹窗
const currentUserId = userStore.getUser.id
const searchForm = ref({
signId: undefined,
name: undefined,
state: undefined,
dealDate: [],
dealUser: undefined,
createDate: [],
createUser: undefined,
signUser: undefined,
applyTime: [],
applyUser: undefined,
pageNo: 1,
pageSize: 20
})
@@ -114,16 +145,25 @@ function handleReset() {
signId: undefined,
name: undefined,
dealDate: [],
dealUser: undefined,
createDate: [],
createUser: undefined,
state: undefined,
signUser: undefined,
applyTime: [],
applyUser: undefined,
pageNo: 1,
pageSize: 20
}
}
function getList() {
tableList.value = [{ name: '测试' }]
const loading = ref(false)
async function getList() {
loading.value = true
try {
const data = await FeebackApi.getPaymentPage(searchForm.value)
tableList.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
function batchAudit() {
@@ -133,14 +173,31 @@ function batchAudit() {
function handleDetail(id) {
console.log(id)
}
function handleCancel(id) {
console.log(id)
async function handleCancel(id) {
try {
// 删除的二次确认
await message.confirm('是否确认撤销申请?')
// 发起删除
await FeebackApi.cancelApplyPayment({ id })
message.success('撤销成功!')
// 刷新列表
await getList()
} catch (err) {
console.log(err)
}
}
function handleAudit(id) {
console.log(id)
}
function getOptions() {
getUserOption().then((data) => {
userOptions.value = data
})
}
onMounted(() => {
getOptions()
handleSearch()
})
</script>