✨ CRM:完善 CRM 跟进记录(商机的展示、添加)
parent
a9e4ef9b7b
commit
28eb23738c
@ -1,71 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-table :data="list" :show-overflow-tooltip="true" :stripe="true" height="200">
|
|
||||||
<el-table-column align="center" label="商机名称" prop="name" />
|
|
||||||
<el-table-column align="center" label="客户名称" prop="customerName" />
|
|
||||||
<el-table-column align="center" label="商机金额" prop="price" />
|
|
||||||
<el-table-column
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
align="center"
|
|
||||||
label="预计成交日期"
|
|
||||||
prop="dealTime"
|
|
||||||
width="120px"
|
|
||||||
/>
|
|
||||||
<el-table-column align="center" label="商机状态类型" prop="statusTypeName" width="120" />
|
|
||||||
<el-table-column align="center" label="商机状态" prop="statusName" />
|
|
||||||
<el-table-column
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
align="center"
|
|
||||||
label="更新时间"
|
|
||||||
prop="updateTime"
|
|
||||||
width="180px"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
align="center"
|
|
||||||
label="创建时间"
|
|
||||||
prop="createTime"
|
|
||||||
width="180px"
|
|
||||||
/>
|
|
||||||
<el-table-column align="center" label="负责人" prop="ownerUserName" width="120" />
|
|
||||||
<el-table-column align="center" label="创建人" prop="creatorName" width="120" />
|
|
||||||
<el-table-column align="center" label="备注" prop="remark" />
|
|
||||||
<el-table-column align="center" fixed="right" label="操作" width="130">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button link type="danger" @click="handleDelete(scope.row.id)"> 移除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
|
||||||
import * as BusinessApi from '@/api/crm/business'
|
|
||||||
|
|
||||||
defineOptions({ name: 'BusinessList' })
|
|
||||||
const props = withDefaults(defineProps<{ businessIds: number[] }>(), {
|
|
||||||
businessIds: () => []
|
|
||||||
})
|
|
||||||
const list = ref<BusinessApi.BusinessVO[]>([] as BusinessApi.BusinessVO[])
|
|
||||||
watch(
|
|
||||||
() => props.businessIds,
|
|
||||||
(val) => {
|
|
||||||
if (!val || val.length === 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
list.value = BusinessApi.getBusinessListByIds(unref(val)) as unknown as BusinessApi.BusinessVO[]
|
|
||||||
}
|
|
||||||
)
|
|
||||||
const emits = defineEmits<{
|
|
||||||
(e: 'update:businessIds', businessIds: number[]): void
|
|
||||||
}>()
|
|
||||||
const handleDelete = (id: number) => {
|
|
||||||
const index = list.value.findIndex((item) => item.id === id)
|
|
||||||
if (index !== -1) {
|
|
||||||
list.value.splice(index, 1)
|
|
||||||
}
|
|
||||||
emits(
|
|
||||||
'update:businessIds',
|
|
||||||
list.value.map((item) => item.id)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
<template>
|
||||||
|
<el-table :data="formData" :show-overflow-tooltip="true" :stripe="true" height="120">
|
||||||
|
<el-table-column label="商机名称" fixed="left" align="center" prop="name" />
|
||||||
|
<el-table-column
|
||||||
|
label="商机金额"
|
||||||
|
align="center"
|
||||||
|
prop="totalPrice"
|
||||||
|
:formatter="erpPriceTableColumnFormatter"
|
||||||
|
/>
|
||||||
|
<el-table-column label="客户名称" align="center" prop="customerName" />
|
||||||
|
<el-table-column label="商机组" align="center" prop="statusTypeName" />
|
||||||
|
<el-table-column label="商机阶段" align="center" prop="statusName" />
|
||||||
|
<el-table-column align="center" fixed="right" label="操作" width="80">
|
||||||
|
<template #default="{ $index }">
|
||||||
|
<el-button link type="danger" @click="handleDelete($index)"> 移除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { erpPriceTableColumnFormatter } from '@/utils'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
businesses: undefined
|
||||||
|
}>()
|
||||||
|
const formData = ref([])
|
||||||
|
|
||||||
|
/** 初始化商机列表 */
|
||||||
|
watch(
|
||||||
|
() => props.businesses,
|
||||||
|
async (val) => {
|
||||||
|
formData.value = val
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = (index: number) => {
|
||||||
|
formData.value.splice(index, 1)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -1,6 +1,4 @@
|
|||||||
import BusinessList from './BusinessList.vue'
|
|
||||||
import BusinessTableSelect from './BusinessTableSelect.vue'
|
|
||||||
import ContactList from './ContactList.vue'
|
import ContactList from './ContactList.vue'
|
||||||
import ContactTableSelect from './ContactTableSelect.vue'
|
import ContactTableSelect from './ContactTableSelect.vue'
|
||||||
|
|
||||||
export { BusinessList, BusinessTableSelect, ContactList, ContactTableSelect }
|
export { ContactList, ContactTableSelect }
|
||||||
|
|||||||
Loading…
Reference in New Issue