Skip to content

Commit 5cb8658

Browse files
committed
✨ CRM:完善回款 plan 列表
1 parent f30f71b commit 5cb8658

File tree

3 files changed

+90
-10
lines changed

3 files changed

+90
-10
lines changed

src/api/crm/receivable/plan/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ export interface ReceivablePlanVO {
1414
contractId: number
1515
ownerUserId: number
1616
remark: string
17+
receivable?: {
18+
price: number
19+
returnTime: Date
20+
}
1721
}
1822

1923
// 查询回款计划列表

src/views/crm/customer/CustomerImportForm.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const submitForm = async () => {
8181
const formData = new FormData()
8282
formData.append('updateSupport', updateSupport.value)
8383
formData.append('file', fileList.value[0].raw)
84+
// TODO @芋艿:后面是不是可以采用这种形式,去掉 uploadHeaders
8485
await CustomerApi.handleImport(formData)
8586
}
8687

src/views/crm/receivable/plan/index.vue

Lines changed: 85 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,27 @@
6767
<!-- 列表 -->
6868
<ContentWrap>
6969
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
70-
<el-table-column align="center" label="客户名称" prop="customerName" width="150px" />
70+
<el-table-column align="center" fixed="left" label="客户名称" prop="customerName" width="150">
71+
<template #default="scope">
72+
<el-link
73+
:underline="false"
74+
type="primary"
75+
@click="openCustomerDetail(scope.row.customerId)"
76+
>
77+
{{ scope.row.customerName }}
78+
</el-link>
79+
</template>
80+
</el-table-column>
7181
<el-table-column align="center" label="合同编号" prop="contractNo" width="200px" />
82+
<!-- TODO @puhui999:这里可以点到详情;最新版本,他有了单独的详情哈 -->
7283
<el-table-column align="center" label="期数" prop="period" />
73-
<el-table-column align="center" label="计划回款(元)" prop="price" width="120" />
84+
<el-table-column
85+
align="center"
86+
label="计划回款金额(元)"
87+
prop="price"
88+
width="160"
89+
:formatter="erpPriceTableColumnFormatter"
90+
/>
7491
<el-table-column
7592
:formatter="dateFormatter2"
7693
align="center"
@@ -80,14 +97,52 @@
8097
/>
8198
<el-table-column align="center" label="提前几天提醒" prop="remindDays" width="150" />
8299
<el-table-column
83-
:formatter="dateFormatter2"
84100
align="center"
85101
label="提醒日期"
86102
prop="remindTime"
87103
width="180px"
104+
:formatter="dateFormatter2"
88105
/>
89-
<el-table-column label="负责人" prop="ownerUserName" width="120" />
106+
<el-table-column align="center" label="回款方式" prop="returnType" width="130px">
107+
<template #default="scope">
108+
<dict-tag :type="DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE" :value="scope.row.returnType" />
109+
</template>
110+
</el-table-column>
90111
<el-table-column align="center" label="备注" prop="remark" />
112+
<el-table-column label="负责人" prop="ownerUserName" width="120" />
113+
<el-table-column
114+
align="center"
115+
label="实际回款金额(元)"
116+
prop="receivable.price"
117+
width="160"
118+
>
119+
<template #default="scope">
120+
<el-text v-if="scope.row.receivable">
121+
{{ erpPriceInputFormatter(scope.row.receivable.price) }}
122+
</el-text>
123+
<el-text v-else>{{ erpPriceInputFormatter(0) }}</el-text>
124+
</template>
125+
</el-table-column>
126+
<el-table-column
127+
align="center"
128+
label="实际回款日期"
129+
prop="receivable.returnTime"
130+
width="180px"
131+
:formatter="dateFormatter2"
132+
/>
133+
<el-table-column
134+
align="center"
135+
label="实际回款金额(元)"
136+
prop="receivable.price"
137+
width="160"
138+
>
139+
<template #default="scope">
140+
<el-text v-if="scope.row.receivable">
141+
{{ erpPriceInputFormatter(scope.row.price - scope.row.receivable.price) }}
142+
</el-text>
143+
<el-text v-else>{{ erpPriceInputFormatter(scope.row.price) }}</el-text>
144+
</template>
145+
</el-table-column>
91146
<el-table-column
92147
align="center"
93148
fixed="right"
@@ -99,7 +154,23 @@
99154
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.finishStatus" />
100155
</template>
101156
</el-table-column>
157+
<el-table-column
158+
:formatter="dateFormatter"
159+
align="center"
160+
label="更新时间"
161+
prop="updateTime"
162+
width="180px"
163+
/>
164+
<el-table-column
165+
:formatter="dateFormatter"
166+
align="center"
167+
label="创建时间"
168+
prop="createTime"
169+
width="180px"
170+
/>
171+
<el-table-column align="center" label="创建人" prop="creatorName" width="100px" />
102172
<el-table-column align="center" fixed="right" label="操作" width="130px">
173+
<!-- TODO @puhui999:新建回款 -->
103174
<template #default="scope">
104175
<el-button
105176
v-hasPermi="['crm:receivable-plan:update']"
@@ -135,12 +206,12 @@
135206

136207
<script lang="ts" setup>
137208
import { DICT_TYPE } from '@/utils/dict'
138-
import { dateFormatter2 } from '@/utils/formatTime'
209+
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
139210
import download from '@/utils/download'
140211
import * as ReceivablePlanApi from '@/api/crm/receivable/plan'
141212
import ReceivablePlanForm from './ReceivablePlanForm.vue'
142-
import * as UserApi from '@/api/system/user'
143213
import * as CustomerApi from '@/api/crm/customer'
214+
import { erpPriceInputFormatter, erpPriceTableColumnFormatter } from '@/utils'
144215
145216
defineOptions({ name: 'ReceivablePlan' })
146217
@@ -150,7 +221,6 @@ const { t } = useI18n() // 国际化
150221
const loading = ref(true) // 列表的加载中
151222
const total = ref(0) // 列表的总页数
152223
const list = ref([]) // 列表的数据
153-
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
154224
const queryParams = reactive({
155225
pageNo: 1,
156226
pageSize: 10,
@@ -159,6 +229,7 @@ const queryParams = reactive({
159229
})
160230
const queryFormRef = ref() // 搜索的表单
161231
const exportLoading = ref(false) // 导出的加载中
232+
const customerList = ref<CustomerApi.CustomerVO[]>([]) // 客户列表
162233
163234
/** 查询列表 */
164235
const getList = async () => {
@@ -217,12 +288,16 @@ const handleExport = async () => {
217288
exportLoading.value = false
218289
}
219290
}
220-
const customerList = ref<CustomerApi.CustomerVO[]>([]) // 客户列表
291+
292+
/** 打开客户详情 */
293+
const { push } = useRouter()
294+
const openCustomerDetail = (id: number) => {
295+
push({ name: 'CrmCustomerDetail', params: { id } })
296+
}
297+
221298
/** 初始化 **/
222299
onMounted(async () => {
223300
await getList()
224-
// 获取用户列表
225-
userList.value = await UserApi.getSimpleUserList()
226301
// 获得客户列表
227302
customerList.value = await CustomerApi.getCustomerSimpleList()
228303
})

0 commit comments

Comments
 (0)