CRM:完善回款
This commit is contained in:
parent
6725318f27
commit
41e5cf667e
@ -12,7 +12,6 @@ export interface ReceivableVO {
|
|||||||
returnType: string
|
returnType: string
|
||||||
price: number
|
price: number
|
||||||
ownerUserId: number
|
ownerUserId: number
|
||||||
sort: number
|
|
||||||
remark: string
|
remark: string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,3 +49,8 @@ export const deleteReceivable = async (id: number) => {
|
|||||||
export const exportReceivable = async (params) => {
|
export const exportReceivable = async (params) => {
|
||||||
return await request.download({ url: `/crm/receivable/export-excel`, params })
|
return await request.download({ url: `/crm/receivable/export-excel`, params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 提交审核
|
||||||
|
export const submitReceivable = async (id: number) => {
|
||||||
|
return await request.put({ url: `/crm/receivable/submit?id=${id}` })
|
||||||
|
}
|
||||||
|
@ -31,6 +31,13 @@ export const getReceivablePlan = async (id: number) => {
|
|||||||
return await request.get({ url: `/crm/receivable-plan/get?id=` + id })
|
return await request.get({ url: `/crm/receivable-plan/get?id=` + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询回款计划下拉数据
|
||||||
|
export const getReceivablePlanListByContractId = async (customerId: number, contractId: number) => {
|
||||||
|
return await request.get({
|
||||||
|
url: `/crm/receivable-plan/list-all-simple-by-customer?customerId=${customerId}&contractId=${contractId}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 新增回款计划
|
// 新增回款计划
|
||||||
export const createReceivablePlan = async (data: ReceivablePlanVO) => {
|
export const createReceivablePlan = async (data: ReceivablePlanVO) => {
|
||||||
return await request.post({ url: `/crm/receivable-plan/create`, data })
|
return await request.post({ url: `/crm/receivable-plan/create`, data })
|
||||||
|
@ -1,58 +1,65 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
<Dialog v-model="dialogVisible" :title="dialogTitle">
|
||||||
<el-form
|
<el-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
|
v-loading="formLoading"
|
||||||
:model="formData"
|
:model="formData"
|
||||||
:rules="formRules"
|
:rules="formRules"
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
v-loading="formLoading"
|
|
||||||
>
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
<el-form-item label="回款编号" prop="no">
|
<el-form-item label="回款编号" prop="no">
|
||||||
<el-input v-model="formData.no" placeholder="请输入回款编号" />
|
<el-input v-model="formData.no" placeholder="请输入回款编号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="回款计划" prop="planId">
|
</el-col>
|
||||||
<el-input v-model="formData.planId" placeholder="请输入回款计划" />
|
<el-col :span="12">
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="客户名称" prop="customerId">
|
<el-form-item label="客户名称" prop="customerId">
|
||||||
<el-input v-model="formData.customerId" placeholder="请输入客户名称" />
|
<el-select v-model="formData.customerId" class="w-1/1" placeholder="请选择客户">
|
||||||
|
<el-option
|
||||||
|
v-for="item in customerList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
<el-form-item label="合同名称" prop="contractId">
|
<el-form-item label="合同名称" prop="contractId">
|
||||||
<el-input v-model="formData.contractId" placeholder="请输入合同名称" />
|
<el-select
|
||||||
</el-form-item>
|
v-model="formData.contractId"
|
||||||
<!--<el-form-item label="审批状态" prop="checkStatus">
|
:disabled="!formData.customerId"
|
||||||
<el-select v-model="formData.checkStatus" placeholder="请选择审批状态">
|
class="!w-100%"
|
||||||
|
placeholder="请选择合同"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_RECEIVABLE_CHECK_STATUS)"
|
v-for="data in contractList"
|
||||||
:key="dict.value"
|
:key="data.id"
|
||||||
:label="dict.label"
|
:label="data.name"
|
||||||
:value="dict.value"
|
:value="data.id!"
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>-->
|
|
||||||
<!--<el-form-item label="工作流编号" prop="processInstanceId">
|
|
||||||
<el-input v-model="formData.processInstanceId" placeholder="请输入工作流编号" />
|
|
||||||
</el-form-item>-->
|
|
||||||
<el-form-item label="回款日期" prop="returnTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="formData.returnTime"
|
|
||||||
type="date"
|
|
||||||
value-format="x"
|
|
||||||
placeholder="选择回款日期"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="回款方式" prop="returnType">
|
|
||||||
<el-select v-model="formData.returnType" placeholder="请选择回款方式">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="回款金额" prop="price">
|
</el-col>
|
||||||
<el-input-number v-model="formData.price" placeholder="请输入回款金额" />
|
<el-col :span="12">
|
||||||
|
<el-form-item label="回款期数" prop="planId">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.planId"
|
||||||
|
:disabled="!formData.contractId"
|
||||||
|
class="!w-100%"
|
||||||
|
placeholder="请选择回款期数"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="data in receivablePlanList"
|
||||||
|
:key="data.id"
|
||||||
|
:label="data.period + '期'"
|
||||||
|
:value="data.id!"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
<el-form-item label="负责人" prop="ownerUserId">
|
<el-form-item label="负责人" prop="ownerUserId">
|
||||||
<el-select v-model="formData.ownerUserId" clearable placeholder="请输入负责人">
|
<el-select v-model="formData.ownerUserId" clearable placeholder="请输入负责人">
|
||||||
<el-option
|
<el-option
|
||||||
@ -63,36 +70,65 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="批次" prop="batchId">
|
</el-col>
|
||||||
<el-input-number v-model="formData.batchId" placeholder="请输入批次" />
|
<el-col :span="12">
|
||||||
</el-form-item>
|
<el-form-item label="回款方式" prop="returnType">
|
||||||
<el-form-item label="显示排序" prop="sort">
|
<el-select v-model="formData.returnType" placeholder="请选择回款方式">
|
||||||
<el-input-number v-model="formData.sort" :min="0" controls-position="right" />
|
|
||||||
</el-form-item>
|
|
||||||
<!--<el-form-item label="状态" prop="status">
|
|
||||||
<el-select v-model="formData.status" placeholder="请选择状态">
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
v-for="dict in getStrDictOptions(DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>-->
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input type="textarea" :rows="3" v-model="formData.remark" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="回款金额" prop="price">
|
||||||
|
<el-input-number
|
||||||
|
v-model="formData.price"
|
||||||
|
class="!w-100%"
|
||||||
|
controls-position="right"
|
||||||
|
placeholder="请输入回款金额"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="回款日期" prop="returnTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.returnTime"
|
||||||
|
placeholder="选择回款日期"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.remark"
|
||||||
|
:rows="3"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script lang="ts" setup>
|
||||||
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
|
import * as ReceivablePlanApi from '@/api/crm/receivable/plan'
|
||||||
import * as ReceivableApi from '@/api/crm/receivable'
|
import * as ReceivableApi from '@/api/crm/receivable'
|
||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
@ -101,29 +137,19 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|||||||
const dialogTitle = ref('') // 弹窗的标题
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
const formData = ref({
|
const formData = ref<ReceivableApi.ReceivableVO>({} as ReceivableApi.ReceivableVO)
|
||||||
id: undefined,
|
const formRules = reactive({
|
||||||
no: undefined,
|
no: [{ required: true, message: '回款编号不能为空', trigger: 'blur' }],
|
||||||
planId: undefined,
|
customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }],
|
||||||
customerId: undefined,
|
contractId: [{ required: true, message: '合同不能为空', trigger: 'blur' }],
|
||||||
contractId: undefined,
|
auditStatus: [{ required: true, message: '审批状态不能为空', trigger: 'blur' }],
|
||||||
checkStatus: undefined,
|
returnTime: [{ required: true, message: '回款日期不能为空', trigger: 'blur' }],
|
||||||
processInstanceId: undefined,
|
price: [{ required: true, message: '回款金额不能为空', trigger: 'blur' }]
|
||||||
returnTime: undefined,
|
|
||||||
returnType: undefined,
|
|
||||||
price: undefined,
|
|
||||||
ownerUserId: undefined,
|
|
||||||
batchId: undefined,
|
|
||||||
sort: undefined,
|
|
||||||
dataScope: undefined,
|
|
||||||
dataScopeDeptIds: undefined,
|
|
||||||
status: undefined,
|
|
||||||
remark: undefined
|
|
||||||
})
|
})
|
||||||
// const formRules = reactive({
|
|
||||||
// status: [{ required: true, message: '状态不能为空', trigger: 'change' }]
|
|
||||||
// })
|
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
const customerList = ref<CustomerApi.CustomerVO[]>([]) // 客户列表
|
||||||
|
const contractList = ref<ContractApi.ContractVO[]>([]) // 合同列表
|
||||||
|
const receivablePlanList = ref<ReceivablePlanApi.ReceivablePlanVO[]>([]) // 回款计划列表
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (type: string, id?: number) => {
|
const open = async (type: string, id?: number) => {
|
||||||
@ -142,6 +168,12 @@ const open = async (type: string, id?: number) => {
|
|||||||
}
|
}
|
||||||
// 获得用户列表
|
// 获得用户列表
|
||||||
userList.value = await UserApi.getSimpleUserList()
|
userList.value = await UserApi.getSimpleUserList()
|
||||||
|
// 获得客户列表
|
||||||
|
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||||
|
// 默认新建时选中自己
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
formData.value.ownerUserId = useUserStore().getUser.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
@ -173,25 +205,54 @@ const submitForm = async () => {
|
|||||||
|
|
||||||
/** 重置表单 */
|
/** 重置表单 */
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formData.value = {
|
formData.value = {} as ReceivableApi.ReceivableVO
|
||||||
id: undefined,
|
|
||||||
no: undefined,
|
|
||||||
planId: undefined,
|
|
||||||
customerId: undefined,
|
|
||||||
contractId: undefined,
|
|
||||||
checkStatus: undefined,
|
|
||||||
processInstanceId: undefined,
|
|
||||||
returnTime: undefined,
|
|
||||||
returnType: undefined,
|
|
||||||
price: undefined,
|
|
||||||
ownerUserId: undefined,
|
|
||||||
batchId: undefined,
|
|
||||||
sort: undefined,
|
|
||||||
dataScope: undefined,
|
|
||||||
dataScopeDeptIds: undefined,
|
|
||||||
status: undefined,
|
|
||||||
remark: undefined
|
|
||||||
}
|
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getContractList = async (customerId: number) => {
|
||||||
|
contractList.value = await ContractApi.getCrmContractSimpleListByCustomerId(customerId)
|
||||||
|
}
|
||||||
|
const getReceivablePlanList = async (contractId: number) => {
|
||||||
|
receivablePlanList.value = await ReceivablePlanApi.getReceivablePlanListByContractId(
|
||||||
|
formData.value.customerId,
|
||||||
|
contractId
|
||||||
|
)
|
||||||
|
}
|
||||||
|
watch(
|
||||||
|
() => formData.value.customerId,
|
||||||
|
(newVal) => {
|
||||||
|
if (!newVal) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getContractList(newVal)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
watch(
|
||||||
|
() => formData.value.contractId,
|
||||||
|
(newVal) => {
|
||||||
|
if (!newVal) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getReceivablePlanList(newVal)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
watch(
|
||||||
|
() => formData.value.planId,
|
||||||
|
(newVal) => {
|
||||||
|
if (!newVal) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const receivablePlan = receivablePlanList.value.find((item) => item.id === newVal)
|
||||||
|
// 只有没有金额的时候才设置
|
||||||
|
if (!formData.value.price || formData.value.price === 0) {
|
||||||
|
formData.value.price = receivablePlan!.price
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
</script>
|
</script>
|
||||||
|
@ -2,49 +2,63 @@
|
|||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<el-form
|
<el-form
|
||||||
class="-mb-15px"
|
|
||||||
:model="queryParams"
|
|
||||||
ref="queryFormRef"
|
ref="queryFormRef"
|
||||||
:inline="true"
|
:inline="true"
|
||||||
|
:model="queryParams"
|
||||||
|
class="-mb-15px"
|
||||||
label-width="68px"
|
label-width="68px"
|
||||||
>
|
>
|
||||||
<el-form-item label="回款编号" prop="no">
|
<el-form-item label="回款编号" prop="no">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.no"
|
v-model="queryParams.no"
|
||||||
placeholder="请输入回款编号"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入回款编号"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="客户名称" prop="customerId">
|
<el-form-item label="客户名称" prop="customerId">
|
||||||
<el-input
|
<el-select
|
||||||
v-model="queryParams.customerId"
|
v-model="queryParams.customerId"
|
||||||
placeholder="请输入客户名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
|
placeholder="请选择客户"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in customerList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
/>
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
<el-button @click="handleQuery">
|
||||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
<Icon class="mr-5px" icon="ep:search" />
|
||||||
<el-button
|
搜索
|
||||||
type="primary"
|
</el-button>
|
||||||
plain
|
<el-button @click="resetQuery">
|
||||||
@click="openForm('create')"
|
<Icon class="mr-5px" icon="ep:refresh" />
|
||||||
v-hasPermi="['crm:receivable:create']"
|
重置
|
||||||
>
|
|
||||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
v-hasPermi="['crm:receivable:create']"
|
||||||
plain
|
plain
|
||||||
@click="handleExport"
|
type="primary"
|
||||||
:loading="exportLoading"
|
@click="openForm('create')"
|
||||||
v-hasPermi="['crm:receivable:export']"
|
|
||||||
>
|
>
|
||||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
<Icon class="mr-5px" icon="ep:plus" />
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['crm:receivable:export']"
|
||||||
|
:loading="exportLoading"
|
||||||
|
plain
|
||||||
|
type="success"
|
||||||
|
@click="handleExport"
|
||||||
|
>
|
||||||
|
<Icon class="mr-5px" icon="ep:download" />
|
||||||
|
导出
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -52,66 +66,63 @@
|
|||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
|
||||||
<el-table-column label="ID" align="center" prop="id" />
|
<el-table-column align="center" label="回款编号" prop="no" />
|
||||||
<el-table-column label="回款编号" align="center" prop="no" />
|
<el-table-column align="center" label="客户" prop="customerName" />
|
||||||
<!-- <el-table-column label="回款计划ID" align="center" prop="planId" />-->
|
<el-table-column align="center" label="合同" prop="contractName" />
|
||||||
<el-table-column label="客户" align="center" prop="customerId" />
|
|
||||||
<el-table-column label="合同" align="center" prop="contractId" />
|
|
||||||
<el-table-column label="审批状态" align="center" prop="checkStatus" width="130px">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.checkStatus" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<!-- <el-table-column label="工作流编号" align="center" prop="processInstanceId" />-->
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="回款日期"
|
|
||||||
align="center"
|
|
||||||
prop="returnTime"
|
|
||||||
:formatter="dateFormatter2"
|
:formatter="dateFormatter2"
|
||||||
|
align="center"
|
||||||
|
label="回款日期"
|
||||||
|
prop="returnTime"
|
||||||
width="150px"
|
width="150px"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="回款方式" align="center" prop="returnType" width="130px">
|
<el-table-column align="center" label="回款方式" prop="returnType" width="130px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE" :value="scope.row.returnType" />
|
<dict-tag :type="DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE" :value="scope.row.returnType" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="回款金额(元)" align="center" prop="price" />
|
<el-table-column align="center" label="回款金额(元)" prop="price" />
|
||||||
<el-table-column label="负责人" align="center" prop="ownerUserId" />
|
<el-table-column align="center" label="负责人" prop="ownerUserId" />
|
||||||
<el-table-column label="批次" align="center" prop="batchId" />
|
<el-table-column align="center" label="备注" prop="remark" />
|
||||||
<!--<el-table-column label="显示顺序" align="center" prop="sort" />-->
|
<el-table-column align="center" fixed="right" label="回款状态" prop="auditStatus" width="120">
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
<dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.auditStatus" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column align="center" fixed="right" label="操作" width="180px">
|
||||||
<el-table-column
|
|
||||||
label="创建时间"
|
|
||||||
align="center"
|
|
||||||
prop="createTime"
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
width="180px"
|
|
||||||
/>
|
|
||||||
<el-table-column label="操作" align="center" width="180px">
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<!-- todo @liuhongfeng:用路径参数哈,receivableId -->
|
|
||||||
<!--<router-link :to="'/crm/receivable-plan?receivableId=' + scope.row.receivableId">
|
|
||||||
<el-button link type="primary">详情</el-button>
|
|
||||||
</router-link>-->
|
|
||||||
<el-button
|
<el-button
|
||||||
|
v-hasPermi="['crm:receivable:update']"
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="openForm('update', scope.row.id)"
|
@click="openForm('update', scope.row.id)"
|
||||||
v-hasPermi="['crm:receivable:update']"
|
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
|
v-if="scope.row.auditStatus === 0"
|
||||||
|
v-hasPermi="['crm:receivable:update']"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="handleSubmit(scope.row)"
|
||||||
|
>
|
||||||
|
提交审核
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-else
|
||||||
|
v-hasPermi="['crm:receivable:update']"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="handleProcessDetail(scope.row)"
|
||||||
|
>
|
||||||
|
查看审批
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['crm:receivable:delete']"
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete(scope.row.id)"
|
@click="handleDelete(scope.row.id)"
|
||||||
v-hasPermi="['crm:receivable:delete']"
|
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -120,9 +131,9 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
<Pagination
|
<Pagination
|
||||||
:total="total"
|
|
||||||
v-model:page="queryParams.pageNo"
|
|
||||||
v-model:limit="queryParams.pageSize"
|
v-model:limit="queryParams.pageSize"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
:total="total"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
@ -131,26 +142,27 @@
|
|||||||
<ReceivableForm ref="formRef" @success="getList" />
|
<ReceivableForm ref="formRef" @success="getList" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script lang="ts" setup>
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
|
import { dateFormatter2 } from '@/utils/formatTime'
|
||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
import * as ReceivableApi from '@/api/crm/receivable'
|
import * as ReceivableApi from '@/api/crm/receivable'
|
||||||
import ReceivableForm from './ReceivableForm.vue'
|
import ReceivableForm from './ReceivableForm.vue'
|
||||||
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
|
|
||||||
defineOptions({ name: 'Receivable' })
|
defineOptions({ name: 'Receivable' })
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
const { push } = useRouter() // 路由
|
||||||
const loading = ref(true) // 列表的加载中
|
const loading = ref(true) // 列表的加载中
|
||||||
const total = ref(0) // 列表的总页数
|
const total = ref(0) // 列表的总页数
|
||||||
const list = ref([]) // 列表的数据
|
const list = ref([]) // 列表的数据
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
no: null,
|
no: undefined,
|
||||||
customerId: null
|
customerId: undefined
|
||||||
})
|
})
|
||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
const exportLoading = ref(false) // 导出的加载中
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
@ -198,6 +210,19 @@ const handleDelete = async (id: number) => {
|
|||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 提交审核 **/
|
||||||
|
const handleSubmit = async (row: ReceivableApi.ReceivableVO) => {
|
||||||
|
await message.confirm(`您确定提交编号为【${row.no}】的回款审核吗?`)
|
||||||
|
await ReceivableApi.submitReceivable(row.id)
|
||||||
|
message.success('提交审核成功!')
|
||||||
|
await getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查看审批 */
|
||||||
|
const handleProcessDetail = (row: ReceivableApi.ReceivableVO) => {
|
||||||
|
push({ name: 'BpmProcessInstanceDetail', query: { id: row.processInstanceId } })
|
||||||
|
}
|
||||||
|
// TODO puhui999: 回款流程审批表单详情查看后面完善
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
try {
|
try {
|
||||||
@ -212,9 +237,11 @@ const handleExport = async () => {
|
|||||||
exportLoading.value = false
|
exportLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const customerList = ref<CustomerApi.CustomerVO[]>([]) // 客户列表
|
||||||
/** 初始化 **/
|
/** 初始化 **/
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
getList()
|
await getList()
|
||||||
|
// 获得客户列表
|
||||||
|
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
class="-mb-15px"
|
class="-mb-15px"
|
||||||
label-width="68px"
|
label-width="68px"
|
||||||
>
|
>
|
||||||
<el-form-item label="客户" prop="customerId">
|
<el-form-item label="客户名称" prop="customerId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.customerId"
|
v-model="queryParams.customerId"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
@ -70,7 +70,7 @@
|
|||||||
<el-table-column align="center" label="客户名称" prop="customerName" width="150px" />
|
<el-table-column align="center" label="客户名称" prop="customerName" width="150px" />
|
||||||
<el-table-column align="center" label="合同编号" prop="contractNo" width="200px" />
|
<el-table-column align="center" label="合同编号" prop="contractNo" width="200px" />
|
||||||
<el-table-column align="center" label="期数" prop="period" />
|
<el-table-column align="center" label="期数" prop="period" />
|
||||||
<el-table-column align="center" label="计划回款" prop="price" />
|
<el-table-column align="center" label="计划回款(元)" prop="price" width="120" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:formatter="dateFormatter2"
|
:formatter="dateFormatter2"
|
||||||
align="center"
|
align="center"
|
||||||
|
Loading…
Reference in New Issue
Block a user