|
|
|
@ -8,7 +8,7 @@
|
|
|
|
|
<!-- 批量操作、更多操作 -->
|
|
|
|
|
<a-card :bordered="false" :body-style="{ paddingBottom: 0 }">
|
|
|
|
|
<div class="download">
|
|
|
|
|
<a-button @click.stop="downloadTemplate">导出</a-button>
|
|
|
|
|
<a-button @click.stop="exportModel = true">导出</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
</a-card>
|
|
|
|
|
<!-- 底部表格 -->
|
|
|
|
@ -71,6 +71,18 @@
|
|
|
|
|
</template> -->
|
|
|
|
|
</template>
|
|
|
|
|
</pro-table>
|
|
|
|
|
<a-modal v-model:visible="exportModel" title="导出" @cancel="cancelModel">
|
|
|
|
|
<!-- <a-input
|
|
|
|
|
v-model:value="searchData.nid"
|
|
|
|
|
placeholder="请输入号码"
|
|
|
|
|
allow-clear
|
|
|
|
|
style="width: 220px; margin-bottom: 10px"
|
|
|
|
|
/> -->
|
|
|
|
|
<a-range-picker v-model:value="searchData.exportDate" format="YYYY-MM-DD HH:mm:ss" show-time />
|
|
|
|
|
<template #footer>
|
|
|
|
|
<a-button key="submit" type="primary" @click="downloadTemplate">导出</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
</a-modal>
|
|
|
|
|
<!-- 详情弹窗 -->
|
|
|
|
|
<customer-list-view-modal ref="customerListViewModalRef" @submit-success="reloadTable" />
|
|
|
|
|
<!-- 编辑弹窗 -->
|
|
|
|
@ -100,6 +112,7 @@ import CustomerListEditModal from '@/views/customermanagement/customerList/custo
|
|
|
|
|
import { exportClueData, isEffective } from '@/api/customermanagement/customerList'
|
|
|
|
|
import { remoteFileDownload } from '@/utils/file-utils'
|
|
|
|
|
import { doRequest } from '@/utils/axios/request'
|
|
|
|
|
import type { Dayjs } from 'dayjs'
|
|
|
|
|
// import { useRoute } from 'vue-router'
|
|
|
|
|
//删除
|
|
|
|
|
// import { doRequest } from '@/utils/axios/request'
|
|
|
|
@ -107,10 +120,16 @@ import { doRequest } from '@/utils/axios/request'
|
|
|
|
|
// const route = useRoute()
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'CustomerList' })
|
|
|
|
|
type RangeValue = [Dayjs, Dayjs]
|
|
|
|
|
//获取当前账号角色
|
|
|
|
|
import { useUserStore } from '@/stores/user-store'
|
|
|
|
|
const { userInfo } = useUserStore()
|
|
|
|
|
const salesmanType = ref<number | undefined>()
|
|
|
|
|
const exportModel = ref(false)
|
|
|
|
|
const searchData = reactive({
|
|
|
|
|
nid: '',
|
|
|
|
|
exportDate: []
|
|
|
|
|
})
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
salesmanType.value = userInfo?.salesmanType
|
|
|
|
|
const savedUserData = localStorage.getItem('clueId')
|
|
|
|
@ -175,7 +194,10 @@ const handleView = (record: CustomerListRecord, tabIndex: string) => {
|
|
|
|
|
customerListViewModalRef.value?.open(FormAction.UPDATE, record, tabIndex)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const cancelModel = () => {
|
|
|
|
|
searchData.nid = ''
|
|
|
|
|
searchData.exportDate = []
|
|
|
|
|
}
|
|
|
|
|
//编辑
|
|
|
|
|
const handleEdit = (record: CustomerListRecord, tabIndex: string) => {
|
|
|
|
|
customerListEditModalRef.value?.open(FormAction.UPDATE, record, tabIndex)
|
|
|
|
@ -330,9 +352,20 @@ const switchChange = (record: any) => {
|
|
|
|
|
}
|
|
|
|
|
// 导出
|
|
|
|
|
function downloadTemplate() {
|
|
|
|
|
exportClueData(searchParams).then(res => {
|
|
|
|
|
const data: any = searchData
|
|
|
|
|
if (data.exportDate && data.exportDate.length == 2) {
|
|
|
|
|
data.startTime = data.exportDate[0].format('YYYY-MM-DD HH:mm:ss')
|
|
|
|
|
data.endTime = data.exportDate[1].format('YYYY-MM-DD HH:mm:ss')
|
|
|
|
|
delete data.exportDate
|
|
|
|
|
}
|
|
|
|
|
exportClueData(data)
|
|
|
|
|
.then(res => {
|
|
|
|
|
exportModel.value = false
|
|
|
|
|
remoteFileDownload(res)
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
exportModel.value = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|