From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目
---
src/views/crm/receivable/plan/components/ReceivablePlanList.vue | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 173 insertions(+), 0 deletions(-)
diff --git a/src/views/crm/receivable/plan/components/ReceivablePlanList.vue b/src/views/crm/receivable/plan/components/ReceivablePlanList.vue
new file mode 100644
index 0000000..3b80526
--- /dev/null
+++ b/src/views/crm/receivable/plan/components/ReceivablePlanList.vue
@@ -0,0 +1,173 @@
+<template>
+ <!-- 鎿嶄綔鏍� -->
+ <el-row justify="end">
+ <el-button @click="openForm('create', undefined)">
+ <Icon class="mr-5px" icon="icon-park:income" />
+ 鍒涘缓鍥炴璁″垝
+ </el-button>
+ </el-row>
+
+ <!-- 鍒楄〃 -->
+ <ContentWrap class="mt-10px">
+ <el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
+ <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="period" />
+ <el-table-column
+ align="center"
+ label="璁″垝鍥炴(鍏�)"
+ prop="price"
+ width="120"
+ :formatter="erpPriceTableColumnFormatter"
+ />
+ <el-table-column
+ :formatter="dateFormatter2"
+ align="center"
+ label="璁″垝鍥炴鏃ユ湡"
+ prop="returnTime"
+ width="180px"
+ />
+ <el-table-column align="center" label="鎻愬墠鍑犲ぉ鎻愰啋" prop="remindDays" width="150" />
+ <el-table-column
+ :formatter="dateFormatter2"
+ align="center"
+ label="鎻愰啋鏃ユ湡"
+ prop="remindTime"
+ width="180px"
+ />
+ <el-table-column label="璐熻矗浜�" prop="ownerUserName" width="120" />
+ <el-table-column align="center" label="澶囨敞" prop="remark" />
+ <el-table-column align="center" fixed="right" label="鎿嶄綔" width="200px">
+ <template #default="scope">
+ <el-button
+ v-hasPermi="['crm:receivable:create']"
+ link
+ type="primary"
+ @click="createReceivable(scope.row)"
+ :disabled="scope.row.receivableId"
+ >
+ 鍒涘缓鍥炴
+ </el-button>
+ <el-button
+ v-hasPermi="['crm:receivable-plan:update']"
+ link
+ type="primary"
+ @click="openForm('update', scope.row.id)"
+ >
+ 缂栬緫
+ </el-button>
+ <el-button
+ v-hasPermi="['crm:receivable-plan:delete']"
+ link
+ type="danger"
+ @click="handleDelete(scope.row.id)"
+ >
+ 鍒犻櫎
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <!-- 鍒嗛〉 -->
+ <Pagination
+ v-model:limit="queryParams.pageSize"
+ v-model:page="queryParams.pageNo"
+ :total="total"
+ @pagination="getList"
+ />
+ </ContentWrap>
+
+ <!-- 琛ㄥ崟寮圭獥锛氭坊鍔� -->
+ <ReceivableForm ref="formRef" @success="getList" />
+</template>
+<script lang="ts" setup>
+import * as ReceivablePlanApi from '@/api/crm/receivable/plan'
+import ReceivableForm from './../ReceivablePlanForm.vue'
+import { dateFormatter2 } from '@/utils/formatTime'
+import { erpPriceTableColumnFormatter } from '@/utils'
+
+defineOptions({ name: 'CrmReceivablePlanList' })
+const props = defineProps<{
+ customerId?: number // 瀹㈡埛缂栧彿
+ contractId?: number // 鍚堝悓缂栧彿
+}>()
+
+const message = useMessage() // 娑堟伅寮圭獥
+const { t } = useI18n() // 鍥介檯鍖�
+const loading = ref(true) // 鍒楄〃鐨勫姞杞戒腑
+const total = ref(0) // 鍒楄〃鐨勬�婚〉鏁�
+const list = ref([]) // 鍒楄〃鐨勬暟鎹�
+const queryParams = reactive({
+ pageNo: 1,
+ pageSize: 10,
+ customerId: undefined as unknown, // 鍏佽 undefined + number
+ contractId: undefined as unknown // 鍏佽 undefined + number
+})
+
+/** 鏌ヨ鍒楄〃 */
+const getList = async () => {
+ loading.value = true
+ try {
+ if (props.customerId && !props.contractId) {
+ queryParams.customerId = props.customerId
+ } else if (props.customerId && props.contractId) {
+ // 濡傛灉鏄悎鍚岀殑璇濆鎴风紪鍙蜂篃闇�瑕佸甫涓婂洜涓烘潈闄愬熀浜庡鎴�
+ queryParams.customerId = props.customerId
+ queryParams.contractId = props.contractId
+ }
+ const data = await ReceivablePlanApi.getReceivablePlanPageByCustomer(queryParams)
+ list.value = data.list
+ total.value = data.total
+ } finally {
+ loading.value = false
+ }
+}
+
+/** 鎼滅储鎸夐挳鎿嶄綔 */
+const handleQuery = () => {
+ queryParams.pageNo = 1
+ // 缃┖鍙傛暟
+ queryParams.customerId = undefined
+ queryParams.contractId = undefined
+ getList()
+}
+
+/** 娣诲姞/淇敼鎿嶄綔 */
+const formRef = ref()
+const openForm = (type: string, id?: number) => {
+ formRef.value.open(type, id, props.customerId, props.contractId)
+}
+
+/** 鍒涘缓鍥炴 */
+const emits = defineEmits<{
+ (e: 'createReceivable', v: ReceivablePlanApi.ReceivablePlanVO)
+}>()
+const createReceivable = (row: ReceivablePlanApi.ReceivablePlanVO) => {
+ emits('createReceivable', row)
+}
+
+/** 鍒犻櫎鎸夐挳鎿嶄綔 */
+const handleDelete = async (id: number) => {
+ try {
+ // 鍒犻櫎鐨勪簩娆$‘璁�
+ await message.delConfirm()
+ // 鍙戣捣鍒犻櫎
+ await ReceivablePlanApi.deleteReceivablePlan(id)
+ message.success(t('common.delSuccess'))
+ // 鍒锋柊鍒楄〃
+ await getList()
+ } catch {}
+}
+
+/** 鐩戝惉鎵撳紑鐨� customerId + contractId锛屼粠鑰屽姞杞芥渶鏂扮殑鍒楄〃 */
+watch(
+ () => [props.customerId, props.contractId],
+ (newVal) => {
+ // 淇濊瘉鑷冲皯瀹㈡埛缂栧彿鏈夊��
+ if (!newVal[0]) {
+ return
+ }
+ handleQuery()
+ },
+ { immediate: true, deep: true }
+)
+</script>
--
Gitblit v1.8.0