CRM:完善回款 plan 列表

This commit is contained in:
YunaiV 2024-02-25 09:23:36 +08:00
parent f30f71b775
commit 5cb86589c6
3 changed files with 90 additions and 10 deletions

View File

@ -14,6 +14,10 @@ export interface ReceivablePlanVO {
contractId: number contractId: number
ownerUserId: number ownerUserId: number
remark: string remark: string
receivable?: {
price: number
returnTime: Date
}
} }
// 查询回款计划列表 // 查询回款计划列表

View File

@ -81,6 +81,7 @@ const submitForm = async () => {
const formData = new FormData() const formData = new FormData()
formData.append('updateSupport', updateSupport.value) formData.append('updateSupport', updateSupport.value)
formData.append('file', fileList.value[0].raw) formData.append('file', fileList.value[0].raw)
// TODO @ uploadHeaders
await CustomerApi.handleImport(formData) await CustomerApi.handleImport(formData)
} }

View File

@ -67,10 +67,27 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true"> <el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
<el-table-column align="center" label="客户名称" prop="customerName" width="150px" /> <el-table-column align="center" fixed="left" label="客户名称" prop="customerName" width="150">
<template #default="scope">
<el-link
:underline="false"
type="primary"
@click="openCustomerDetail(scope.row.customerId)"
>
{{ scope.row.customerName }}
</el-link>
</template>
</el-table-column>
<el-table-column align="center" label="合同编号" prop="contractNo" width="200px" /> <el-table-column align="center" label="合同编号" prop="contractNo" width="200px" />
<!-- TODO @puhui999这里可以点到详情最新版本他有了单独的详情哈 -->
<el-table-column align="center" label="期数" prop="period" /> <el-table-column align="center" label="期数" prop="period" />
<el-table-column align="center" label="计划回款(元)" prop="price" width="120" /> <el-table-column
align="center"
label="计划回款金额(元)"
prop="price"
width="160"
:formatter="erpPriceTableColumnFormatter"
/>
<el-table-column <el-table-column
:formatter="dateFormatter2" :formatter="dateFormatter2"
align="center" align="center"
@ -80,14 +97,52 @@
/> />
<el-table-column align="center" label="提前几天提醒" prop="remindDays" width="150" /> <el-table-column align="center" label="提前几天提醒" prop="remindDays" width="150" />
<el-table-column <el-table-column
:formatter="dateFormatter2"
align="center" align="center"
label="提醒日期" label="提醒日期"
prop="remindTime" prop="remindTime"
width="180px" width="180px"
:formatter="dateFormatter2"
/> />
<el-table-column label="负责人" prop="ownerUserName" width="120" /> <el-table-column align="center" label="回款方式" prop="returnType" width="130px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE" :value="scope.row.returnType" />
</template>
</el-table-column>
<el-table-column align="center" label="备注" prop="remark" /> <el-table-column align="center" label="备注" prop="remark" />
<el-table-column label="负责人" prop="ownerUserName" width="120" />
<el-table-column
align="center"
label="实际回款金额(元)"
prop="receivable.price"
width="160"
>
<template #default="scope">
<el-text v-if="scope.row.receivable">
{{ erpPriceInputFormatter(scope.row.receivable.price) }}
</el-text>
<el-text v-else>{{ erpPriceInputFormatter(0) }}</el-text>
</template>
</el-table-column>
<el-table-column
align="center"
label="实际回款日期"
prop="receivable.returnTime"
width="180px"
:formatter="dateFormatter2"
/>
<el-table-column
align="center"
label="实际回款金额(元)"
prop="receivable.price"
width="160"
>
<template #default="scope">
<el-text v-if="scope.row.receivable">
{{ erpPriceInputFormatter(scope.row.price - scope.row.receivable.price) }}
</el-text>
<el-text v-else>{{ erpPriceInputFormatter(scope.row.price) }}</el-text>
</template>
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
fixed="right" fixed="right"
@ -99,7 +154,23 @@
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.finishStatus" /> <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.finishStatus" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
:formatter="dateFormatter"
align="center"
label="更新时间"
prop="updateTime"
width="180px"
/>
<el-table-column
:formatter="dateFormatter"
align="center"
label="创建时间"
prop="createTime"
width="180px"
/>
<el-table-column align="center" label="创建人" prop="creatorName" width="100px" />
<el-table-column align="center" fixed="right" label="操作" width="130px"> <el-table-column align="center" fixed="right" label="操作" width="130px">
<!-- TODO @puhui999新建回款 -->
<template #default="scope"> <template #default="scope">
<el-button <el-button
v-hasPermi="['crm:receivable-plan:update']" v-hasPermi="['crm:receivable-plan:update']"
@ -135,12 +206,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import { DICT_TYPE } from '@/utils/dict' import { DICT_TYPE } from '@/utils/dict'
import { dateFormatter2 } from '@/utils/formatTime' import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import * as ReceivablePlanApi from '@/api/crm/receivable/plan' import * as ReceivablePlanApi from '@/api/crm/receivable/plan'
import ReceivablePlanForm from './ReceivablePlanForm.vue' import ReceivablePlanForm from './ReceivablePlanForm.vue'
import * as UserApi from '@/api/system/user'
import * as CustomerApi from '@/api/crm/customer' import * as CustomerApi from '@/api/crm/customer'
import { erpPriceInputFormatter, erpPriceTableColumnFormatter } from '@/utils'
defineOptions({ name: 'ReceivablePlan' }) defineOptions({ name: 'ReceivablePlan' })
@ -150,7 +221,6 @@ const { t } = useI18n() // 国际化
const loading = ref(true) // const loading = ref(true) //
const total = ref(0) // const total = ref(0) //
const list = ref([]) // const list = ref([]) //
const userList = ref<UserApi.UserVO[]>([]) //
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@ -159,6 +229,7 @@ const queryParams = reactive({
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) // const exportLoading = ref(false) //
const customerList = ref<CustomerApi.CustomerVO[]>([]) //
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
@ -217,12 +288,16 @@ const handleExport = async () => {
exportLoading.value = false exportLoading.value = false
} }
} }
const customerList = ref<CustomerApi.CustomerVO[]>([]) //
/** 打开客户详情 */
const { push } = useRouter()
const openCustomerDetail = (id: number) => {
push({ name: 'CrmCustomerDetail', params: { id } })
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
await getList() await getList()
//
userList.value = await UserApi.getSimpleUserList()
// //
customerList.value = await CustomerApi.getCustomerSimpleList() customerList.value = await CustomerApi.getCustomerSimpleList()
}) })