This commit is contained in:
qsh
2024-07-31 18:35:36 +08:00
parent 1e40357e51
commit 48689642d8
9 changed files with 287 additions and 129 deletions

View File

@@ -94,9 +94,58 @@
>
<el-table-column type="selection" width="60" :selectable="(row) => row.state == 1" />
<el-table-column prop="signId" label="成交单号" min-width="180px" />
<el-table-column prop="name" label="线索名称" min-width="150px" />
<el-table-column prop="phone" label="联系方式" min-width="150px" />
<el-table-column prop="money" label="回款金额" min-width="150px" />
<el-table-column prop="name" label="线索名称" width="150px" />
<el-table-column prop="phone" label="联系方式" width="120px" />companyProfit
<el-table-column prop="money" label="回款金额" min-width="120px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.money"
size="small"
:min="0"
:controls="false"
style="width: 100%"
/>
<div v-else>{{ row.money }}</div>
</template>
</el-table-column>
<el-table-column
v-if="appStore.getAppInfo?.instanceType == 2"
prop="companyProfit"
label="公司利润"
min-width="120px"
>
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.companyProfit"
size="small"
:min="0"
:controls="false"
style="width: 100%"
/>
<div v-else>{{ row.companyProfit }}</div>
</template>
</el-table-column>
<el-table-column
v-if="appStore.getAppInfo?.instanceType == 2"
prop="personProfit"
label="员工利润"
min-width="120px"
>
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.personProfit"
size="small"
:min="0"
:controls="false"
style="width: 100%"
/>
<div v-else>{{ row.personProfit }}</div>
</template>
</el-table-column>
<el-table-column prop="signPrice" label="成交价" min-width="90" />
<el-table-column prop="isPayoff" label="是否结清" min-width="90" />
<el-table-column
v-if="appStore.getAppInfo?.instanceType == 1"
@@ -125,7 +174,7 @@
:formatter="dateFormatter"
/>
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90" />
<el-table-column label="操作" width="150px" fixed="right">
<el-table-column label="操作" width="220px" fixed="right">
<template #default="{ row }">
<el-button type="primary" style="padding: 0" text @click="handleDetail(row)">
详情
@@ -140,6 +189,15 @@
>
撤销
</el-button>
<el-button
type="primary"
style="padding: 0"
text
v-if="row.state == 1"
@click="handleUpdate(row)"
>
<span>{{ row.edit ? '保存' : '修改金额' }}</span>
</el-button>
<el-button
type="primary"
style="padding: 0"
@@ -226,7 +284,7 @@ function handleReset() {
}
}
const totalMoney = ref(0)
const totalInfo = ref({})
const loading = ref(false)
async function getList() {
loading.value = true
@@ -234,7 +292,7 @@ async function getList() {
const data = await FeebackApi.getPaymentPage(removeNullField(searchForm.value))
tableList.value = data.list
total.value = data.total
totalMoney.value = data.totalAmount
totalInfo.value = data.totalData
} finally {
loading.value = false
}
@@ -291,7 +349,13 @@ function getSummaries(param) {
if (index === 0) {
sums[index] = '合计'
} else if (column.property == 'money') {
sums[index] = totalMoney.value
sums[index] = totalInfo.value.totalMoney
} else if (column.property == 'personProfit') {
sums[index] = totalInfo.value.totalPersonProfit
} else if (column.property == 'companyProfit') {
sums[index] = totalInfo.value.totalPersonProfit
} else if (column.property == 'signPrice') {
sums[index] = totalInfo.value.totalSignPrice
} else {
sums[index] = ''
}
@@ -300,6 +364,23 @@ function getSummaries(param) {
return sums
}
async function handleUpdate(row) {
if (row.edit) {
// 删除的二次确认
await message.confirm('是否确认修改回款金额?')
// 保存
FeebackApi.updateApplyPayment({ id: row.id, money: row.money })
.then(() => {
message.success('修改成功')
})
.finally(() => {
row.edit = false
})
} else {
row.edit = true
}
}
onMounted(() => {
getOptions()
handleSearch()