Commit 5369328b by YunaiV

CRM:完善回款的新增/修改

parent 70bf2341
......@@ -4,7 +4,6 @@ export interface ReceivablePlanVO {
id: number
period: number
receivableId: number
finishStatus: number
price: number
returnTime: Date
remindDays: number
......@@ -43,10 +42,9 @@ export const getReceivablePlan = async (id: number) => {
}
// 查询回款计划下拉数据
// TODO @芋艿:再看看这里
export const getReceivablePlanListByContractId = async (customerId: number, contractId: number) => {
export const getReceivablePlanSimpleList = async (customerId: number, contractId: number) => {
return await request.get({
url: `/crm/receivable-plan/list-all-simple-by-customer?customerId=${customerId}&contractId=${contractId}`
url: `/crm/receivable-plan/simple-list?customerId=${customerId}&contractId=${contractId}`
})
}
......
......@@ -195,7 +195,6 @@
<!-- 表单弹窗:添加/修改 -->
<ReceivableForm ref="formRef" @success="getList" />
</template>
<script lang="ts" setup>
import { DICT_TYPE } from '@/utils/dict'
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
......
......@@ -31,17 +31,6 @@
/>
<el-table-column label="负责人" prop="ownerUserName" width="120" />
<el-table-column align="center" label="备注" prop="remark" />
<el-table-column
align="center"
fixed="right"
label="完成状态"
prop="finishStatus"
width="130px"
>
<template #default="scope">
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.finishStatus" />
</template>
</el-table-column>
<el-table-column align="center" fixed="right" label="操作" width="200px">
<template #default="scope">
<el-button
......@@ -141,6 +130,7 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
// todo @puhui999:拼写错误
const emits = defineEmits<{
(e: 'crateReceivable', v: ReceivablePlanApi.ReceivablePlanVO)
}>()
......@@ -161,6 +151,7 @@ const handleDelete = async (id: number) => {
await getList()
} catch {}
}
/** 监听打开的 customerId + contractId,从而加载最新的列表 */
watch(
() => [props.customerId, props.contractId],
......
......@@ -153,17 +153,6 @@
</template>
</el-table-column>
<el-table-column
align="center"
fixed="right"
label="完成状态"
prop="finishStatus"
width="130px"
>
<template #default="scope">
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.finishStatus" />
</template>
</el-table-column>
<el-table-column
:formatter="dateFormatter"
align="center"
label="更新时间"
......@@ -178,10 +167,18 @@
width="180px"
/>
<el-table-column align="center" label="创建人" prop="creatorName" width="100px" />
<el-table-column align="center" fixed="right" label="操作" width="130px">
<!-- TODO @puhui999:新建回款 -->
<el-table-column align="center" fixed="right" label="操作" width="180px">
<template #default="scope">
<el-button
v-hasPermi="['crm:receivable:create']"
link
type="success"
@click="openReceivableForm(scope.row)"
:disabled="scope.row.receivableId"
>
创建回款
</el-button>
<el-button
v-hasPermi="['crm:receivable-plan:update']"
link
type="primary"
......@@ -211,6 +208,7 @@
<!-- 表单弹窗:添加/修改 -->
<ReceivablePlanForm ref="formRef" @success="getList" />
<ReceivableForm ref="receivableFormRef" @success="getList" />
</template>
<script lang="ts" setup>
......@@ -222,6 +220,7 @@ import ReceivablePlanForm from './ReceivablePlanForm.vue'
import * as CustomerApi from '@/api/crm/customer'
import { erpPriceInputFormatter, erpPriceTableColumnFormatter } from '@/utils'
import { TabsPaneContext } from 'element-plus'
import ReceivableForm from '@/views/crm/receivable/ReceivableForm.vue'
defineOptions({ name: 'ReceivablePlan' })
......@@ -279,6 +278,12 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 创建回款操作 */
const receivableFormRef = ref()
const openReceivableForm = (row: ReceivablePlanApi.ReceivablePlanVO) => {
receivableFormRef.value.open('create', undefined, row)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment