Skip to content

Commit 70bf234

Browse files
committed
✨ CRM:完善回款列表
1 parent 56d92e5 commit 70bf234

File tree

3 files changed

+110
-9
lines changed

3 files changed

+110
-9
lines changed

src/views/crm/contract/index.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ import ContractForm from './ContractForm.vue'
248248
import { DICT_TYPE } from '@/utils/dict'
249249
import { erpPriceTableColumnFormatter } from '@/utils'
250250
import * as CustomerApi from '@/api/crm/customer'
251+
import { TabsPaneContext } from 'element-plus'
251252
252253
defineOptions({ name: 'CrmContract' })
253254
@@ -271,6 +272,12 @@ const exportLoading = ref(false) // 导出的加载中
271272
const activeName = ref('1') // 列表 tab
272273
const customerList = ref<CustomerApi.CustomerVO[]>([]) // 客户列表
273274
275+
/** tab 切换 */
276+
const handleTabClick = (tab: TabsPaneContext) => {
277+
queryParams.sceneType = tab.paneName
278+
handleQuery()
279+
}
280+
274281
/** 查询列表 */
275282
const getList = async () => {
276283
loading.value = true

src/views/crm/receivable/index.vue

Lines changed: 90 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,79 @@
6666

6767
<!-- 列表 -->
6868
<ContentWrap>
69+
<el-tabs v-model="activeName" @tab-click="handleTabClick">
70+
<el-tab-pane label="我负责的" name="1" />
71+
<el-tab-pane label="我参与的" name="2" />
72+
<el-tab-pane label="下属负责的" name="3" />
73+
</el-tabs>
6974
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
70-
<el-table-column align="center" label="回款编号" prop="no" />
71-
<el-table-column align="center" label="客户" prop="customerName" />
72-
<el-table-column align="center" label="合同" prop="contractName" />
75+
<el-table-column align="center" fixed="left" label="回款编号" prop="no" width="180" />
76+
<el-table-column align="center" label="客户名称" prop="customerName" width="120">
77+
<template #default="scope">
78+
<el-link
79+
:underline="false"
80+
type="primary"
81+
@click="openCustomerDetail(scope.row.customerId)"
82+
>
83+
{{ scope.row.customerName }}
84+
</el-link>
85+
</template>
86+
</el-table-column>
87+
<el-table-column align="center" label="合同编号" prop="contractNo" width="180">
88+
<template #default="scope">
89+
<el-link
90+
:underline="false"
91+
type="primary"
92+
@click="openContractDetail(scope.row.contractId)"
93+
>
94+
{{ scope.row.contract.no }}
95+
</el-link>
96+
</template>
97+
</el-table-column>
7398
<el-table-column
7499
:formatter="dateFormatter2"
75100
align="center"
76101
label="回款日期"
77102
prop="returnTime"
78103
width="150px"
79104
/>
105+
<el-table-column
106+
align="center"
107+
label="回款金额(元)"
108+
prop="price"
109+
width="140"
110+
:formatter="erpPriceTableColumnFormatter"
111+
/>
80112
<el-table-column align="center" label="回款方式" prop="returnType" width="130px">
81113
<template #default="scope">
82114
<dict-tag :type="DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE" :value="scope.row.returnType" />
83115
</template>
84116
</el-table-column>
85-
<el-table-column align="center" label="回款金额(元)" prop="price" />
86-
<el-table-column align="center" label="负责人" prop="ownerUserName" />
87-
<el-table-column align="center" label="备注" prop="remark" />
117+
<el-table-column align="center" label="备注" prop="remark" width="200" />
118+
<el-table-column
119+
align="center"
120+
label="合同金额(元)"
121+
prop="contract.totalPrice"
122+
width="140"
123+
:formatter="erpPriceTableColumnFormatter"
124+
/>
125+
<el-table-column align="center" label="负责人" prop="ownerUserName" width="120" />
126+
<el-table-column align="center" label="所属部门" prop="ownerUserDeptName" width="100px" />
127+
<el-table-column
128+
:formatter="dateFormatter"
129+
align="center"
130+
label="更新时间"
131+
prop="updateTime"
132+
width="180px"
133+
/>
134+
<el-table-column
135+
:formatter="dateFormatter"
136+
align="center"
137+
label="创建时间"
138+
prop="createTime"
139+
width="180px"
140+
/>
141+
<el-table-column align="center" label="创建人" prop="creatorName" width="120" />
88142
<el-table-column align="center" fixed="right" label="回款状态" prop="auditStatus" width="120">
89143
<template #default="scope">
90144
<dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.auditStatus" />
@@ -144,28 +198,38 @@
144198

145199
<script lang="ts" setup>
146200
import { DICT_TYPE } from '@/utils/dict'
147-
import { dateFormatter2 } from '@/utils/formatTime'
201+
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
148202
import download from '@/utils/download'
149203
import * as ReceivableApi from '@/api/crm/receivable'
150204
import ReceivableForm from './ReceivableForm.vue'
151205
import * as CustomerApi from '@/api/crm/customer'
206+
import { TabsPaneContext } from 'element-plus'
207+
import { erpPriceTableColumnFormatter } from '@/utils'
152208
153209
defineOptions({ name: 'Receivable' })
154210
155211
const message = useMessage() // 消息弹窗
156212
const { t } = useI18n() // 国际化
157-
const { push } = useRouter() // 路由
158213
const loading = ref(true) // 列表的加载中
159214
const total = ref(0) // 列表的总页数
160215
const list = ref([]) // 列表的数据
161216
const queryParams = reactive({
162217
pageNo: 1,
163218
pageSize: 10,
219+
sceneType: '1', // 默认和 activeName 相等
164220
no: undefined,
165221
customerId: undefined
166222
})
167223
const queryFormRef = ref() // 搜索的表单
168224
const exportLoading = ref(false) // 导出的加载中
225+
const activeName = ref('1') // 列表 tab
226+
const customerList = ref<CustomerApi.CustomerVO[]>([]) // 客户列表
227+
228+
/** tab 切换 */
229+
const handleTabClick = (tab: TabsPaneContext) => {
230+
queryParams.sceneType = tab.paneName
231+
handleQuery()
232+
}
169233
170234
/** 查询列表 */
171235
const getList = async () => {
@@ -218,10 +282,27 @@ const handleSubmit = async (row: ReceivableApi.ReceivableVO) => {
218282
await getList()
219283
}
220284
285+
/** 打开回款详情 */
286+
const { push } = useRouter()
287+
const openDetail = (id: number) => {
288+
push({ name: 'CrmReceivableDetail', params: { id } })
289+
}
290+
291+
/** 打开客户详情 */
292+
const openCustomerDetail = (id: number) => {
293+
push({ name: 'CrmCustomerDetail', params: { id } })
294+
}
295+
296+
/** 打开合同详情 */
297+
const openContractDetail = (id: number) => {
298+
push({ name: 'CrmContractDetail', params: { id } })
299+
}
300+
221301
/** 查看审批 */
222302
const handleProcessDetail = (row: ReceivableApi.ReceivableVO) => {
223303
push({ name: 'BpmProcessInstanceDetail', query: { id: row.processInstanceId } })
224304
}
305+
225306
// TODO puhui999: 回款流程审批表单详情查看后面完善
226307
/** 导出按钮操作 */
227308
const handleExport = async () => {
@@ -237,7 +318,7 @@ const handleExport = async () => {
237318
exportLoading.value = false
238319
}
239320
}
240-
const customerList = ref<CustomerApi.CustomerVO[]>([]) // 客户列表
321+
241322
/** 初始化 **/
242323
onMounted(async () => {
243324
await getList()

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@
6666

6767
<!-- 列表 -->
6868
<ContentWrap>
69+
<el-tabs v-model="activeName" @tab-click="handleTabClick">
70+
<el-tab-pane label="我负责的" name="1" />
71+
<el-tab-pane label="下属负责的" name="3" />
72+
</el-tabs>
6973
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
7074
<el-table-column align="center" fixed="left" label="客户名称" prop="customerName" width="150">
7175
<template #default="scope">
@@ -217,6 +221,7 @@ import * as ReceivablePlanApi from '@/api/crm/receivable/plan'
217221
import ReceivablePlanForm from './ReceivablePlanForm.vue'
218222
import * as CustomerApi from '@/api/crm/customer'
219223
import { erpPriceInputFormatter, erpPriceTableColumnFormatter } from '@/utils'
224+
import { TabsPaneContext } from 'element-plus'
220225
221226
defineOptions({ name: 'ReceivablePlan' })
222227
@@ -229,13 +234,21 @@ const list = ref([]) // 列表的数据
229234
const queryParams = reactive({
230235
pageNo: 1,
231236
pageSize: 10,
237+
sceneType: '1', // 默认和 activeName 相等
232238
customerId: undefined,
233239
contractNo: undefined
234240
})
235241
const queryFormRef = ref() // 搜索的表单
236242
const exportLoading = ref(false) // 导出的加载中
243+
const activeName = ref('1') // 列表 tab
237244
const customerList = ref<CustomerApi.CustomerVO[]>([]) // 客户列表
238245
246+
/** tab 切换 */
247+
const handleTabClick = (tab: TabsPaneContext) => {
248+
queryParams.sceneType = tab.paneName
249+
handleQuery()
250+
}
251+
239252
/** 查询列表 */
240253
const getList = async () => {
241254
loading.value = true

0 commit comments

Comments
 (0)