parent
1fa79f9d9e
commit
ef2a70e3f8
@ -23,6 +23,11 @@ export const getReceivablePlanPage = async (params) => {
|
||||
return await request.get({ url: `/crm/receivable-plan/page`, params })
|
||||
}
|
||||
|
||||
// 查询回款计划列表
|
||||
export const getReceivablePlanPageByCustomer = async (params) => {
|
||||
return await request.get({ url: `/crm/receivable-plan/page-by-customer`, params })
|
||||
}
|
||||
|
||||
// 查询回款计划详情
|
||||
export const getReceivablePlan = async (id: number) => {
|
||||
return await request.get({ url: `/crm/receivable-plan/get?id=` + id })
|
@ -192,7 +192,7 @@ export enum DICT_TYPE {
|
||||
// ========== CRM - 客户管理模块 ==========
|
||||
CRM_AUDIT_STATUS = 'crm_audit_status', // CRM 审批状态
|
||||
CRM_BIZ_TYPE = 'crm_biz_type', // CRM 业务类型
|
||||
CRM_RETURN_TYPE = 'crm_return_type',
|
||||
CRM_RECEIVABLE_RETURN_TYPE = 'crm_receivable_return_type', // CRM 回款的还款方式
|
||||
CRM_CUSTOMER_INDUSTRY = 'crm_customer_industry',
|
||||
CRM_CUSTOMER_LEVEL = 'crm_customer_level',
|
||||
CRM_CUSTOMER_SOURCE = 'crm_customer_source',
|
||||
|
@ -25,6 +25,7 @@
|
||||
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.master" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- TODO 芋艿:【操作:设为首要联系人】 -->
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
|
@ -19,6 +19,7 @@
|
||||
<ContractList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="回款" lazy>
|
||||
<ReceivablePlanList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
||||
<ReceivableList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="回访" lazy>TODO 待开发</el-tab-pane>
|
||||
@ -34,6 +35,7 @@ import ContactList from '@/views/crm/contact/components/ContactList.vue' // 联
|
||||
import ContractList from '@/views/crm/contract/components/ContractList.vue' // 合同列表
|
||||
import BusinessList from '@/views/crm/business/components/BusinessList.vue' // 商机列表
|
||||
import ReceivableList from '@/views/crm/receivable/components/ReceivableList.vue' // 回款列表
|
||||
import ReceivablePlanList from '@/views/crm/receivable/plan/components/ReceivablePlanList.vue' // 回款计划列表
|
||||
import PermissionList from '@/views/crm/permission/components/PermissionList.vue' // 团队成员列表(权限)
|
||||
import { BizTypeEnum } from '@/api/crm/permission'
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
<el-form-item label="回款方式" prop="returnType">
|
||||
<el-select v-model="formData.returnType" placeholder="请选择回款方式">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.CRM_RETURN_TYPE)"
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
@ -73,7 +73,7 @@
|
||||
/>
|
||||
<el-table-column label="回款方式" align="center" prop="returnType" width="130px">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_RETURN_TYPE" :value="scope.row.returnType" />
|
||||
<dict-tag :type="DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE" :value="scope.row.returnType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="回款金额(元)" align="center" prop="price" />
|
||||
|
@ -88,7 +88,7 @@
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as ReceivablePlanApi from '@/api/crm/receivablePlan'
|
||||
import * as ReceivablePlanApi from '@/api/crm/receivable/plan'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
128
src/views/crm/receivable/plan/components/ReceivablePlanList.vue
Normal file
128
src/views/crm/receivable/plan/components/ReceivablePlanList.vue
Normal file
@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<!-- 操作栏 -->
|
||||
<el-row justify="end">
|
||||
<el-button @click="openForm">
|
||||
<Icon class="mr-5px" icon="icon-park:income" />
|
||||
创建回款计划
|
||||
</el-button>
|
||||
</el-row>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap class="mt-10px">
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="期数" fixed="left" align="center" prop="no">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" :underline="false" @click="openDetail(scope.row.id)">
|
||||
{{ scope.row.period }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户名称" align="center" prop="customerName" />
|
||||
<el-table-column label="合同编号" align="center" prop="contractNo" />
|
||||
<el-table-column
|
||||
label="计划还款金额(元)"
|
||||
align="center"
|
||||
prop="price"
|
||||
:formatter="fenToYuanFormat"
|
||||
/>
|
||||
<el-table-column
|
||||
label="计划还款日期"
|
||||
align="center"
|
||||
prop="returnTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column align="center" label="计划还款方式" prop="auditStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE" :value="scope.row.returnType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提前几日提醒" align="center" prop="remindDays" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<!-- TODO 芋艿:新建回款、编辑、删除 -->
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加 -->
|
||||
<ReceivableForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as ReceivablePlanApi from '@/api/crm/receivable/plan'
|
||||
import ReceivableForm from './../ReceivablePlanForm.vue'
|
||||
import { BizTypeEnum } from '@/api/crm/permission'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { fenToYuanFormat } from '@/utils/formatter'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
|
||||
defineOptions({ name: 'CrmReceivablePlanList' })
|
||||
const props = defineProps<{
|
||||
bizType: number // 业务类型
|
||||
bizId: number // 业务编号
|
||||
}>()
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const total = ref(0) // 列表的总页数
|
||||
const list = ref([]) // 列表的数据
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
customerId: undefined as unknown // 允许 undefined + number
|
||||
})
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
// 置空参数
|
||||
queryParams.customerId = undefined
|
||||
// 执行查询
|
||||
let data = { list: [], total: 0 }
|
||||
switch (props.bizType) {
|
||||
case BizTypeEnum.CRM_CUSTOMER:
|
||||
queryParams.customerId = props.bizId
|
||||
data = await ReceivablePlanApi.getReceivablePlanPageByCustomer(queryParams)
|
||||
break
|
||||
default:
|
||||
return
|
||||
}
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 添加 */
|
||||
const formRef = ref()
|
||||
const openForm = () => {
|
||||
formRef.value.open('create')
|
||||
}
|
||||
|
||||
/** 打开合同详情 */
|
||||
const { push } = useRouter()
|
||||
const openDetail = (id: number) => {
|
||||
push({ name: 'CrmReceivablePlanDetail', params: { id } })
|
||||
}
|
||||
|
||||
/** 监听打开的 bizId + bizType,从而加载最新的列表 */
|
||||
watch(
|
||||
() => [props.bizId, props.bizType],
|
||||
() => {
|
||||
handleQuery()
|
||||
},
|
||||
{ immediate: true, deep: true }
|
||||
)
|
||||
</script>
|
@ -26,96 +26,6 @@
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="完成状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择完成状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审批状态" prop="checkStatus">
|
||||
<el-select
|
||||
v-model="queryParams.checkStatus"
|
||||
placeholder="请选择审批状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.CRM_AUDIT_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="回款日期" prop="returnTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.returnTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="提前几天提醒" prop="remindDays">
|
||||
<el-input
|
||||
v-model="queryParams.remindDays"
|
||||
placeholder="请输入提前几天提醒"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<!--<el-form-item label="提醒日期" prop="remindTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.remindTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<!--<el-form-item label="负责人" prop="ownerUserId">
|
||||
<el-input
|
||||
v-model="queryParams.ownerUserId"
|
||||
placeholder="请输入负责人"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="queryParams.remark"
|
||||
placeholder="请输入备注"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
@ -224,10 +134,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import * as ReceivablePlanApi from '@/api/crm/receivablePlan'
|
||||
import * as ReceivablePlanApi from '@/api/crm/receivable/plan'
|
||||
import ReceivablePlanForm from './ReceivablePlanForm.vue'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
|
||||
@ -243,17 +153,8 @@ const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
period: null,
|
||||
status: null,
|
||||
checkStatus: null,
|
||||
returnTime: [],
|
||||
remindDays: null,
|
||||
remindTime: [],
|
||||
customerId: null,
|
||||
contractId: null,
|
||||
ownerUserId: null,
|
||||
remark: null,
|
||||
createTime: []
|
||||
contractId: null
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
Loading…
Reference in New Issue
Block a user