20 changed files with 1703 additions and 1908 deletions
@ -1,38 +1,38 @@ |
|||||
{ |
{ |
||||
"source": "来源", |
"source":"来源", |
||||
"sourcePlaceholder": "请输入来源", |
"sourcePlaceholder":"请输入来源", |
||||
"sourceChannel": "来源渠道", |
"sourceChannel":"来源渠道", |
||||
"sourceChannelPlaceholder": "请输入来源渠道", |
"sourceChannelPlaceholder":"请输入来源渠道", |
||||
"consultant": "顾问", |
"consultant":"顾问", |
||||
"name": "姓名", |
"name":"姓名", |
||||
"namePlaceholder": "请输入姓名", |
"namePlaceholder":"请输入姓名", |
||||
"age": "年龄", |
"age":"年龄", |
||||
"agePlaceholder": "请输入年龄", |
"agePlaceholder":"请输入年龄", |
||||
"gender": "性别", |
"gender":"性别", |
||||
"genderPlaceholder": "请输入性别", |
"genderPlaceholder":"请输入性别", |
||||
"phoneNumber": "联系电话", |
"phoneNumber":"联系电话", |
||||
"phoneNumberPlaceholder": "请输入联系电话", |
"phoneNumberPlaceholder":"请输入联系电话", |
||||
"demand": "需求", |
"demand":"需求", |
||||
"demandPlaceholder": "请输入需求", |
"demandPlaceholder":"请输入需求", |
||||
"purchasingPower": "购买力", |
"purchasingPower":"购买力", |
||||
"purchasingPowerPlaceholder": "请输入购买力", |
"purchasingPowerPlaceholder":"请输入购买力", |
||||
"cognitiveIdea": "认知理念", |
"cognitiveIdea":"认知理念", |
||||
"cognitiveIdeaPlaceholder": "请输入认知理念", |
"cognitiveIdeaPlaceholder":"请输入认知理念", |
||||
"optionalClassTime": "可选上课时间", |
"optionalClassTime":"可选上课时间", |
||||
"optionalClassTimePlaceholder": "请输入可选上课时间", |
"optionalClassTimePlaceholder":"请输入可选上课时间", |
||||
"distance": "距离", |
"distance":"距离", |
||||
"distancePlaceholder": "请输入距离", |
"distancePlaceholder":"请输入距离", |
||||
"decisionMaker": "决策人", |
"decisionMaker":"决策人", |
||||
"decisionMakerPlaceholder": "请输入决策人", |
"decisionMakerPlaceholder":"请输入决策人", |
||||
"initialIntent": "客户初步意向度", |
"initialIntent":"客户初步意向度", |
||||
"initialIntentPlaceholder": "请输入客户初步意向度", |
"initialIntentPlaceholder":"请输入客户初步意向度", |
||||
"campus": "所属校区", |
"campus":"所属校区", |
||||
"campusPlaceholder": "请输入所属校区", |
"campusPlaceholder":"请输入所属校区", |
||||
"status": "客户状态", |
"status":"客户状态", |
||||
"statusPlaceholder": "请输入客户状态", |
"statusPlaceholder":"请输入客户状态", |
||||
"addCustomerResources": "添加客户资源", |
"addCustomerResources":"添加客户资源", |
||||
"updateCustomerResources": "编辑客户资源", |
"updateCustomerResources":"编辑客户资源", |
||||
"customerResourcesDeleteTips": "确定要删除该数据吗?", |
"customerResourcesDeleteTips":"确定要删除该数据吗?", |
||||
"startDate": "请选择开始时间", |
"startDate":"请选择开始时间", |
||||
"endDate": "请选择结束时间" |
"endDate":"请选择结束时间" |
||||
} |
} |
||||
@ -1,35 +1,29 @@ |
|||||
{ |
{ |
||||
"id": "编号", |
"purchasePower":"需求购买力", |
||||
"idPlaceholder": "请输入编号", |
"purchasePowerPlaceholder":"请输入需求购买力", |
||||
"purchasePower": "需求购买力", |
"conceptAwareness":"认知理念", |
||||
"purchasePowerPlaceholder": "请输入需求购买力", |
"conceptAwarenessPlaceholder":"请输入认知理念", |
||||
"conceptAwareness": "认知理念", |
"preferredClassTime":"可选上课时间", |
||||
"conceptAwarenessPlaceholder": "请输入认知理念", |
"preferredClassTimePlaceholder":"请输入可选上课时间", |
||||
"preferredClassTime": "可选上课时间", |
"distance":"距离", |
||||
"preferredClassTimePlaceholder": "请输入可选上课时间", |
"distancePlaceholder":"请输入距离", |
||||
"distance": "距离", |
"communication":"沟通备注", |
||||
"distancePlaceholder": "请输入距离", |
"communicationPlaceholder":"请输入沟通备注", |
||||
"communication": "沟通备注", |
"promisedVisitTime":"承诺到访时间", |
||||
"communicationPlaceholder": "请输入沟通备注", |
"promisedVisitTimePlaceholder":"请输入承诺到访时间", |
||||
"promisedVisitTime": "承诺到访时间", |
"actualVisitTime":"实际到访时间", |
||||
"promisedVisitTimePlaceholder": "请输入承诺到访时间", |
"actualVisitTimePlaceholder":"请输入实际到访时间", |
||||
"actualVisitTime": "实际到访时间", |
"callIntent":"电话后的意向程度", |
||||
"actualVisitTimePlaceholder": "请输入实际到访时间", |
"callIntentPlaceholder":"请输入电话后的意向程度", |
||||
"callIntent": "电话后的意向程度: low-低, medium-中, high-高", |
"firstVisitStatus":"一访情况", |
||||
"callIntentPlaceholder": "请输入电话后的意向程度: low-低, medium-中, high-高", |
"firstVisitStatusPlaceholder":"请输入一访情况", |
||||
"firstVisitStatus": "一访情况", |
"secondVisitStatus":"二访情况", |
||||
"firstVisitStatusPlaceholder": "请输入一访情况", |
"secondVisitStatusPlaceholder":"请输入二访情况", |
||||
"secondVisitStatus": "二访情况", |
"isClosed":"是否关单", |
||||
"secondVisitStatusPlaceholder": "请输入二访情况", |
"isClosedPlaceholder":"请输入是否关单", |
||||
"isClosed": "是否关单: 1-是, 0-否", |
"addSixSpeed":"添加六一速", |
||||
"isClosedPlaceholder": "请输入是否关单: 1-是, 0-否", |
"updateSixSpeed":"编辑六一速", |
||||
"staffId": "人员ID", |
"sixSpeedDeleteTips":"确定要删除该数据吗?", |
||||
"staffIdPlaceholder": "请输入人员ID", |
"startDate":"请选择开始时间", |
||||
"resourceId": "资源ID", |
"endDate":"请选择结束时间" |
||||
"resourceIdPlaceholder": "请输入资源ID", |
} |
||||
"addSixSpeed": "添加六一速", |
|
||||
"updateSixSpeed": "编辑六一速", |
|
||||
"sixSpeedDeleteTips": "确定要删除该数据吗?", |
|
||||
"startDate": "请选择开始时间", |
|
||||
"endDate": "请选择结束时间" |
|
||||
} |
|
||||
File diff suppressed because it is too large
@ -1,311 +1,231 @@ |
|||||
<template> |
<template> |
||||
<div class="main-container"> |
<div class="main-container"> |
||||
<el-card class="box-card !border-none" shadow="never"> |
<el-card class="box-card !border-none" shadow="never"> |
||||
<div class="flex justify-between items-center"> |
|
||||
<span class="text-lg">{{ pageName }}</span> |
<div class="flex justify-between items-center"> |
||||
<el-button type="primary" @click="addEvent"> |
<span class="text-lg">{{pageName}}</span> |
||||
{{ t('addCustomerResources') }} |
<el-button type="primary" @click="addEvent"> |
||||
</el-button> |
{{ t('addCustomerResources') }} |
||||
</div> |
</el-button> |
||||
|
</div> |
||||
<el-card |
|
||||
class="box-card !border-none my-[10px] table-search-wrap" |
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
||||
shadow="never" |
<el-form :inline="true" :model="customerResourcesTable.searchParam" ref="searchFormRef"> |
||||
> |
<el-form-item :label="t('name')" prop="name"> |
||||
<el-form |
<el-input v-model="customerResourcesTable.searchParam.name" :placeholder="t('namePlaceholder')" /> |
||||
:inline="true" |
</el-form-item> |
||||
:model="customerResourcesTable.searchParam" |
<el-form-item :label="t('phoneNumber')" prop="phone_number"> |
||||
ref="searchFormRef" |
<el-input v-model="customerResourcesTable.searchParam.phone_number" :placeholder="t('phoneNumberPlaceholder')" /> |
||||
> |
</el-form-item> |
||||
<el-form-item :label="t('name')" prop="name"> |
<el-form-item> |
||||
<el-input |
<el-button type="primary" @click="loadCustomerResourcesList()">{{ t('search') }}</el-button> |
||||
v-model="customerResourcesTable.searchParam.name" |
<el-button @click="resetForm(searchFormRef)">{{ t('reset') }}</el-button> |
||||
:placeholder="t('namePlaceholder')" |
</el-form-item> |
||||
/> |
</el-form> |
||||
</el-form-item> |
</el-card> |
||||
<el-form-item :label="t('phoneNumber')" prop="phone_number"> |
|
||||
<el-input |
<div class="mt-[10px]"> |
||||
v-model="customerResourcesTable.searchParam.phone_number" |
<el-table :data="customerResourcesTable.data" size="large" v-loading="customerResourcesTable.loading"> |
||||
:placeholder="t('phoneNumberPlaceholder')" |
<template #empty> |
||||
/> |
<span>{{ !customerResourcesTable.loading ? t('emptyData') : '' }}</span> |
||||
</el-form-item> |
</template> |
||||
|
<el-table-column :label="t('source')" min-width="180" align="center" :show-overflow-tooltip="true"> |
||||
<el-form-item> |
<template #default="{ row }"> |
||||
<el-button type="primary" @click="loadCustomerResourcesList()">{{ |
<div v-for="(item, index) in sourceList"> |
||||
t('search') |
<div v-if="item.value == row.source">{{ item.name }}</div> |
||||
}}</el-button> |
</div> |
||||
<el-button @click="resetForm(searchFormRef)">{{ |
</template> |
||||
t('reset') |
</el-table-column> |
||||
}}</el-button> |
|
||||
</el-form-item> |
<el-table-column prop="consultant_name" :label="t('consultant')" min-width="120" :show-overflow-tooltip="true"/> |
||||
</el-form> |
|
||||
</el-card> |
<el-table-column prop="name" :label="t('name')" min-width="120" :show-overflow-tooltip="true"/> |
||||
|
|
||||
<div class="mt-[10px]"> |
<el-table-column prop="age" :label="t('age')" min-width="120" :show-overflow-tooltip="true"/> |
||||
<el-table |
|
||||
:data="customerResourcesTable.data" |
<el-table-column :label="t('gender')" min-width="180" align="center" :show-overflow-tooltip="true"> |
||||
size="large" |
<template #default="{ row }"> |
||||
v-loading="customerResourcesTable.loading" |
<div v-for="(item, index) in genderList"> |
||||
> |
<div v-if="item.value == row.gender">{{ item.name }}</div> |
||||
<template #empty> |
</div> |
||||
<span>{{ |
</template> |
||||
!customerResourcesTable.loading ? t('emptyData') : '' |
</el-table-column> |
||||
}}</span> |
|
||||
</template> |
<el-table-column prop="phone_number" :label="t('phoneNumber')" min-width="120" :show-overflow-tooltip="true"/> |
||||
<el-table-column |
|
||||
:label="t('source')" |
<el-table-column prop="decision_maker" :label="t('decisionMaker')" min-width="120" :show-overflow-tooltip="true"/> |
||||
min-width="180" |
|
||||
align="center" |
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
||||
:show-overflow-tooltip="true" |
<template #default="{ row }"> |
||||
> |
<el-button type="primary" link @click="editEvent(row)">{{ t('edit') }}</el-button> |
||||
<template #default="{ row }"> |
<el-button type="primary" link @click="deleteEvent(row.id)">{{ t('delete') }}</el-button> |
||||
<div v-for="(item, index) in sourceList"> |
</template> |
||||
<div v-if="item.value == row.source">{{ item.name }}</div> |
</el-table-column> |
||||
</div> |
|
||||
</template> |
</el-table> |
||||
</el-table-column> |
<div class="mt-[16px] flex justify-end"> |
||||
|
<el-pagination v-model:current-page="customerResourcesTable.page" v-model:page-size="customerResourcesTable.limit" |
||||
<el-table-column |
layout="total, sizes, prev, pager, next, jumper" :total="customerResourcesTable.total" |
||||
prop="consultant" |
@size-change="loadCustomerResourcesList()" @current-change="loadCustomerResourcesList" /> |
||||
:label="t('consultant')" |
</div> |
||||
min-width="120" |
</div> |
||||
:show-overflow-tooltip="true" |
|
||||
/> |
<edit ref="editCustomerResourcesDialog" @complete="loadCustomerResourcesList" /> |
||||
|
</el-card> |
||||
<el-table-column |
</div> |
||||
prop="name" |
</template> |
||||
:label="t('name')" |
|
||||
min-width="120" |
<script lang="ts" setup> |
||||
:show-overflow-tooltip="true" |
import { reactive, ref, watch } from 'vue' |
||||
/> |
import { t } from '@/lang' |
||||
|
import { useDictionary } from '@/app/api/dict' |
||||
<el-table-column |
import { getCustomerResourcesList, deleteCustomerResources, getWithPersonnelList, getWithCampusList } from '@/app/api/customer_resources' |
||||
prop="age" |
import { img } from '@/utils/common' |
||||
:label="t('age')" |
import { ElMessageBox,FormInstance } from 'element-plus' |
||||
min-width="120" |
import Edit from '@/app/views/customer_resources/components/customer-resources-edit.vue' |
||||
:show-overflow-tooltip="true" |
import { useRoute } from 'vue-router' |
||||
/> |
const route = useRoute() |
||||
|
const pageName = route.meta.title; |
||||
<el-table-column |
|
||||
:label="t('gender')" |
let customerResourcesTable = reactive({ |
||||
min-width="180" |
page: 1, |
||||
align="center" |
limit: 10, |
||||
:show-overflow-tooltip="true" |
total: 0, |
||||
> |
loading: true, |
||||
<template #default="{ row }"> |
data: [], |
||||
<div v-for="(item, index) in genderList"> |
searchParam:{ |
||||
<div v-if="item.value == row.gender">{{ item.name }}</div> |
"name":"", |
||||
</div> |
"phone_number":"" |
||||
</template> |
} |
||||
</el-table-column> |
}) |
||||
|
|
||||
<el-table-column |
const searchFormRef = ref<FormInstance>() |
||||
prop="phone_number" |
|
||||
:label="t('phoneNumber')" |
// 选中数据 |
||||
min-width="120" |
const selectData = ref<any[]>([]) |
||||
:show-overflow-tooltip="true" |
|
||||
/> |
// 字典数据 |
||||
|
const sourceList = ref([] as any[]) |
||||
<el-table-column |
const sourceDictList = async () => { |
||||
prop="decision_maker" |
sourceList.value = await (await useDictionary('source')).data.dictionary |
||||
:label="t('decisionMaker')" |
} |
||||
min-width="120" |
sourceDictList(); |
||||
:show-overflow-tooltip="true" |
const source_channelList = ref([] as any[]) |
||||
/> |
const source_channelDictList = async () => { |
||||
|
source_channelList.value = await (await useDictionary('SourceChannel')).data.dictionary |
||||
<el-table-column |
} |
||||
:label="t('operation')" |
source_channelDictList(); |
||||
fixed="right" |
const genderList = ref([] as any[]) |
||||
min-width="120" |
const genderDictList = async () => { |
||||
> |
genderList.value = await (await useDictionary('zy_sex')).data.dictionary |
||||
<template #default="{ row }"> |
} |
||||
<el-button type="primary" link @click="editEvent(row)">{{ |
genderDictList(); |
||||
t('edit') |
const purchasing_powerList = ref([] as any[]) |
||||
}}</el-button> |
const purchasing_powerDictList = async () => { |
||||
<el-button type="primary" link @click="deleteEvent(row.id)">{{ |
purchasing_powerList.value = await (await useDictionary('customer_purchasing_power')).data.dictionary |
||||
t('delete') |
} |
||||
}}</el-button> |
purchasing_powerDictList(); |
||||
</template> |
const cognitive_ideaList = ref([] as any[]) |
||||
</el-table-column> |
const cognitive_ideaDictList = async () => { |
||||
</el-table> |
cognitive_ideaList.value = await (await useDictionary('cognitive_concept')).data.dictionary |
||||
<div class="mt-[16px] flex justify-end"> |
} |
||||
<el-pagination |
cognitive_ideaDictList(); |
||||
v-model:current-page="customerResourcesTable.page" |
const initial_intentList = ref([] as any[]) |
||||
v-model:page-size="customerResourcesTable.limit" |
const initial_intentDictList = async () => { |
||||
layout="total, sizes, prev, pager, next, jumper" |
initial_intentList.value = await (await useDictionary('preliminarycustomerintention')).data.dictionary |
||||
:total="customerResourcesTable.total" |
} |
||||
@size-change="loadCustomerResourcesList()" |
initial_intentDictList(); |
||||
@current-change="loadCustomerResourcesList" |
const statusList = ref([] as any[]) |
||||
/> |
const statusDictList = async () => { |
||||
</div> |
statusList.value = await (await useDictionary('kh_status')).data.dictionary |
||||
</div> |
} |
||||
|
statusDictList(); |
||||
<edit |
|
||||
ref="editCustomerResourcesDialog" |
/** |
||||
@complete="loadCustomerResourcesList" |
* 获取客户资源列表 |
||||
/> |
*/ |
||||
</el-card> |
const loadCustomerResourcesList = (page: number = 1) => { |
||||
</div> |
customerResourcesTable.loading = true |
||||
</template> |
customerResourcesTable.page = page |
||||
|
|
||||
<script lang="ts" setup> |
getCustomerResourcesList({ |
||||
import { reactive, ref, watch } from 'vue' |
page: customerResourcesTable.page, |
||||
import { t } from '@/lang' |
limit: customerResourcesTable.limit, |
||||
import { useDictionary } from '@/app/api/dict' |
...customerResourcesTable.searchParam |
||||
import { |
}).then(res => { |
||||
getCustomerResourcesList, |
customerResourcesTable.loading = false |
||||
deleteCustomerResources, |
customerResourcesTable.data = res.data.data |
||||
getWithCampusList, |
customerResourcesTable.total = res.data.total |
||||
} from '@/app/api/customer_resources' |
}).catch(() => { |
||||
import { img } from '@/utils/common' |
customerResourcesTable.loading = false |
||||
import { ElMessageBox, FormInstance } from 'element-plus' |
}) |
||||
import Edit from '@/app/views/customer_resources/components/customer-resources-edit.vue' |
} |
||||
import { useRoute } from 'vue-router' |
loadCustomerResourcesList() |
||||
const route = useRoute() |
|
||||
const pageName = route.meta.title |
const editCustomerResourcesDialog: Record<string, any> | null = ref(null) |
||||
|
|
||||
let customerResourcesTable = reactive({ |
/** |
||||
page: 1, |
* 添加客户资源 |
||||
limit: 10, |
*/ |
||||
total: 0, |
const addEvent = () => { |
||||
loading: true, |
editCustomerResourcesDialog.value.setFormData() |
||||
data: [], |
editCustomerResourcesDialog.value.showDialog = true |
||||
searchParam: { |
} |
||||
name: '', |
|
||||
phone_number: '', |
/** |
||||
}, |
* 编辑客户资源 |
||||
}) |
* @param data |
||||
|
*/ |
||||
const searchFormRef = ref<FormInstance>() |
const editEvent = (data: any) => { |
||||
|
editCustomerResourcesDialog.value.setFormData(data) |
||||
// 选中数据 |
editCustomerResourcesDialog.value.showDialog = true |
||||
const selectData = ref<any[]>([]) |
} |
||||
|
|
||||
// 字典数据 |
/** |
||||
const sourceList = ref([] as any[]) |
* 删除客户资源 |
||||
const sourceDictList = async () => { |
*/ |
||||
sourceList.value = await (await useDictionary('source')).data.dictionary |
const deleteEvent = (id: number) => { |
||||
} |
ElMessageBox.confirm(t('customerResourcesDeleteTips'), t('warning'), |
||||
sourceDictList() |
{ |
||||
const source_channelList = ref([] as any[]) |
confirmButtonText: t('confirm'), |
||||
const source_channelDictList = async () => { |
cancelButtonText: t('cancel'), |
||||
source_channelList.value = await ( |
type: 'warning', |
||||
await useDictionary('SourceChannel') |
} |
||||
).data.dictionary |
).then(() => { |
||||
} |
deleteCustomerResources(id).then(() => { |
||||
source_channelDictList() |
loadCustomerResourcesList() |
||||
const genderList = ref([] as any[]) |
}).catch(() => { |
||||
const genderDictList = async () => { |
}) |
||||
genderList.value = await (await useDictionary('zy_sex')).data.dictionary |
}) |
||||
} |
} |
||||
genderDictList() |
|
||||
const purchasing_powerList = ref([] as any[]) |
|
||||
const purchasing_powerDictList = async () => { |
const consultantList = ref([]) |
||||
purchasing_powerList.value = await ( |
const setConsultantList = async () => { |
||||
await useDictionary('customer_purchasing_power') |
consultantList.value = await (await getWithPersonnelList({})).data |
||||
).data.dictionary |
} |
||||
} |
setConsultantList() |
||||
purchasing_powerDictList() |
const campusList = ref([]) |
||||
const cognitive_ideaList = ref([] as any[]) |
const setCampusList = async () => { |
||||
const cognitive_ideaDictList = async () => { |
campusList.value = await (await getWithCampusList({})).data |
||||
cognitive_ideaList.value = await ( |
} |
||||
await useDictionary('cognitive_concept') |
setCampusList() |
||||
).data.dictionary |
|
||||
} |
const resetForm = (formEl: FormInstance | undefined) => { |
||||
cognitive_ideaDictList() |
if (!formEl) return |
||||
const initial_intentList = ref([] as any[]) |
formEl.resetFields() |
||||
const initial_intentDictList = async () => { |
loadCustomerResourcesList() |
||||
initial_intentList.value = await ( |
} |
||||
await useDictionary('preliminarycustomerintention') |
</script> |
||||
).data.dictionary |
|
||||
} |
<style lang="scss" scoped> |
||||
initial_intentDictList() |
/* 多行超出隐藏 */ |
||||
const statusList = ref([] as any[]) |
.multi-hidden { |
||||
const statusDictList = async () => { |
word-break: break-all; |
||||
statusList.value = await (await useDictionary('kh_status')).data.dictionary |
text-overflow: ellipsis; |
||||
} |
overflow: hidden; |
||||
statusDictList() |
display: -webkit-box; |
||||
|
-webkit-line-clamp: 2; |
||||
/** |
-webkit-box-orient: vertical; |
||||
* 获取客户资源列表 |
} |
||||
*/ |
</style> |
||||
const loadCustomerResourcesList = (page: number = 1) => { |
|
||||
customerResourcesTable.loading = true |
|
||||
customerResourcesTable.page = page |
|
||||
|
|
||||
getCustomerResourcesList({ |
|
||||
page: customerResourcesTable.page, |
|
||||
limit: customerResourcesTable.limit, |
|
||||
...customerResourcesTable.searchParam, |
|
||||
}) |
|
||||
.then((res) => { |
|
||||
customerResourcesTable.loading = false |
|
||||
customerResourcesTable.data = res.data.data |
|
||||
customerResourcesTable.total = res.data.total |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
customerResourcesTable.loading = false |
|
||||
}) |
|
||||
} |
|
||||
loadCustomerResourcesList() |
|
||||
|
|
||||
const editCustomerResourcesDialog: Record<string, any> | null = ref(null) |
|
||||
|
|
||||
/** |
|
||||
* 添加客户资源 |
|
||||
*/ |
|
||||
const addEvent = () => { |
|
||||
editCustomerResourcesDialog.value.setFormData() |
|
||||
editCustomerResourcesDialog.value.showDialog = true |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 编辑客户资源 |
|
||||
* @param data |
|
||||
*/ |
|
||||
const editEvent = (data: any) => { |
|
||||
editCustomerResourcesDialog.value.setFormData(data) |
|
||||
editCustomerResourcesDialog.value.showDialog = true |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 删除客户资源 |
|
||||
*/ |
|
||||
const deleteEvent = (id: number) => { |
|
||||
ElMessageBox.confirm(t('customerResourcesDeleteTips'), t('warning'), { |
|
||||
confirmButtonText: t('confirm'), |
|
||||
cancelButtonText: t('cancel'), |
|
||||
type: 'warning', |
|
||||
}).then(() => { |
|
||||
deleteCustomerResources(id) |
|
||||
.then(() => { |
|
||||
loadCustomerResourcesList() |
|
||||
}) |
|
||||
.catch(() => {}) |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
const campusList = ref([]) |
|
||||
const setCampusList = async () => { |
|
||||
campusList.value = await (await getWithCampusList({})).data |
|
||||
} |
|
||||
setCampusList() |
|
||||
|
|
||||
const resetForm = (formEl: FormInstance | undefined) => { |
|
||||
if (!formEl) return |
|
||||
formEl.resetFields() |
|
||||
loadCustomerResourcesList() |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
/* 多行超出隐藏 */ |
|
||||
.multi-hidden { |
|
||||
word-break: break-all; |
|
||||
text-overflow: ellipsis; |
|
||||
overflow: hidden; |
|
||||
display: -webkit-box; |
|
||||
-webkit-line-clamp: 2; |
|
||||
-webkit-box-orient: vertical; |
|
||||
} |
|
||||
</style> |
|
||||
|
|||||
@ -1,358 +1,323 @@ |
|||||
<template> |
<template> |
||||
<el-dialog |
<el-dialog v-model="showDialog" :title="formData.id ? t('updateSixSpeed') : t('addSixSpeed')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
||||
v-model="showDialog" |
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
||||
:title="formData.id ? t('updateSixSpeed') : t('addSixSpeed')" |
<el-form-item :label="t('purchasePower')" prop="purchase_power"> |
||||
width="50%" |
<el-select class="input-width" v-model="formData.purchase_power" clearable :placeholder="t('purchasePowerPlaceholder')"> |
||||
class="diy-dialog-wrap" |
<el-option label="请选择" value=""></el-option> |
||||
:destroy-on-close="true" |
<el-option |
||||
> |
v-for="(item, index) in purchase_powerList" |
||||
<el-form |
:key="index" |
||||
:model="formData" |
:label="item.name" |
||||
label-width="120px" |
:value="item.value" |
||||
ref="formRef" |
/> |
||||
:rules="formRules" |
</el-select> |
||||
class="page-form" |
</el-form-item> |
||||
v-loading="loading" |
|
||||
> |
<el-form-item :label="t('conceptAwareness')" prop="concept_awareness"> |
||||
<el-form-item :label="t('purchasePower')" prop="purchase_power"> |
<el-select class="input-width" v-model="formData.concept_awareness" clearable :placeholder="t('conceptAwarenessPlaceholder')"> |
||||
<el-input |
<el-option label="请选择" value=""></el-option> |
||||
v-model="formData.purchase_power" |
<el-option |
||||
clearable |
v-for="(item, index) in concept_awarenessList" |
||||
:placeholder="t('purchasePowerPlaceholder')" |
:key="index" |
||||
class="input-width" |
:label="item.name" |
||||
/> |
:value="item.value" |
||||
</el-form-item> |
/> |
||||
|
</el-select> |
||||
<el-form-item :label="t('conceptAwareness')" prop="concept_awareness"> |
</el-form-item> |
||||
<el-input |
|
||||
v-model="formData.concept_awareness" |
<el-form-item :label="t('preferredClassTime')" prop="preferred_class_time" class="input-width"> |
||||
clearable |
<el-date-picker |
||||
:placeholder="t('conceptAwarenessPlaceholder')" |
class="flex-1 !flex" |
||||
class="input-width" |
v-model="formData.preferred_class_time" |
||||
/> |
clearable |
||||
</el-form-item> |
type="datetime" |
||||
|
value-format="YYYY-MM-DD HH:mm:ss" |
||||
<el-form-item |
:placeholder="t('preferredClassTimePlaceholder')"> |
||||
:label="t('preferredClassTime')" |
</el-date-picker> |
||||
prop="preferred_class_time" |
</el-form-item> |
||||
> |
<el-form-item :label="t('distance')" prop="distance"> |
||||
<el-input |
<el-input v-model="formData.distance" clearable :placeholder="t('distancePlaceholder')" class="input-width" /> |
||||
v-model="formData.preferred_class_time" |
</el-form-item> |
||||
clearable |
|
||||
:placeholder="t('preferredClassTimePlaceholder')" |
<el-form-item :label="t('communication')" prop="communication"> |
||||
class="input-width" |
<el-input v-model="formData.communication" type="textarea" rows="4" clearable :placeholder="t('communicationPlaceholder')" class="input-width"/> |
||||
/> |
</el-form-item> |
||||
</el-form-item> |
<el-form-item :label="t('promisedVisitTime')" prop="promised_visit_time" class="input-width"> |
||||
|
<el-date-picker |
||||
<el-form-item :label="t('distance')" prop="distance"> |
class="flex-1 !flex" |
||||
<el-input |
v-model="formData.promised_visit_time" |
||||
v-model="formData.distance" |
clearable |
||||
clearable |
type="datetime" |
||||
:placeholder="t('distancePlaceholder')" |
value-format="YYYY-MM-DD HH:mm:ss" |
||||
class="input-width" |
:placeholder="t('promisedVisitTimePlaceholder')"> |
||||
/> |
</el-date-picker> |
||||
</el-form-item> |
</el-form-item> |
||||
|
<el-form-item :label="t('actualVisitTime')" class="input-width"> |
||||
<el-form-item :label="t('communication')" prop="communication"> |
<el-date-picker |
||||
<el-input |
class="flex-1 !flex" |
||||
v-model="formData.communication" |
v-model="formData.actual_visit_time" |
||||
clearable |
clearable |
||||
:placeholder="t('communicationPlaceholder')" |
type="datetime" |
||||
class="input-width" |
value-format="YYYY-MM-DD HH:mm:ss" |
||||
/> |
:placeholder="t('actualVisitTimePlaceholder')"> |
||||
</el-form-item> |
</el-date-picker> |
||||
|
</el-form-item> |
||||
<el-form-item :label="t('promisedVisitTime')" prop="promised_visit_time"> |
<el-form-item :label="t('callIntent')" prop="call_intent"> |
||||
<el-input |
<el-select class="input-width" v-model="formData.call_intent" clearable :placeholder="t('callIntentPlaceholder')"> |
||||
v-model="formData.promised_visit_time" |
<el-option label="请选择" value=""></el-option> |
||||
clearable |
<el-option |
||||
:placeholder="t('promisedVisitTimePlaceholder')" |
v-for="(item, index) in call_intentList" |
||||
class="input-width" |
:key="index" |
||||
/> |
:label="item.name" |
||||
</el-form-item> |
:value="item.value" |
||||
|
/> |
||||
<el-form-item :label="t('actualVisitTime')"> |
</el-select> |
||||
<el-input |
</el-form-item> |
||||
v-model="formData.actual_visit_time" |
|
||||
clearable |
<el-form-item :label="t('firstVisitStatus')" > |
||||
:placeholder="t('actualVisitTimePlaceholder')" |
<el-input v-model="formData.first_visit_status" type="textarea" rows="4" clearable :placeholder="t('firstVisitStatusPlaceholder')" class="input-width"/> |
||||
class="input-width" |
</el-form-item> |
||||
/> |
<el-form-item :label="t('secondVisitStatus')" > |
||||
</el-form-item> |
<el-input v-model="formData.second_visit_status" type="textarea" rows="4" clearable :placeholder="t('secondVisitStatusPlaceholder')" class="input-width"/> |
||||
|
</el-form-item> |
||||
<el-form-item :label="t('callIntent')" prop="call_intent"> |
<el-form-item :label="t('isClosed')" prop="is_closed"> |
||||
<el-input |
<el-select class="input-width" v-model="formData.is_closed" clearable :placeholder="t('isClosedPlaceholder')"> |
||||
v-model="formData.call_intent" |
<el-option label="请选择" value=""></el-option> |
||||
clearable |
<el-option |
||||
:placeholder="t('callIntentPlaceholder')" |
v-for="(item, index) in is_closedList" |
||||
class="input-width" |
:key="index" |
||||
/> |
:label="item.name" |
||||
</el-form-item> |
:value="item.value" |
||||
|
/> |
||||
<el-form-item :label="t('firstVisitStatus')"> |
</el-select> |
||||
<el-input |
</el-form-item> |
||||
v-model="formData.first_visit_status" |
|
||||
clearable |
</el-form> |
||||
:placeholder="t('firstVisitStatusPlaceholder')" |
|
||||
class="input-width" |
<template #footer> |
||||
/> |
<span class="dialog-footer"> |
||||
</el-form-item> |
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
||||
|
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
||||
<el-form-item :label="t('secondVisitStatus')"> |
t('confirm') |
||||
<el-input |
}}</el-button> |
||||
v-model="formData.second_visit_status" |
</span> |
||||
clearable |
</template> |
||||
:placeholder="t('secondVisitStatusPlaceholder')" |
</el-dialog> |
||||
class="input-width" |
</template> |
||||
/> |
|
||||
</el-form-item> |
<script lang="ts" setup> |
||||
|
import { ref, reactive, computed, watch } from 'vue' |
||||
<el-form-item :label="t('isClosed')" prop="is_closed"> |
import { useDictionary } from '@/app/api/dict' |
||||
<el-input |
import { t } from '@/lang' |
||||
v-model="formData.is_closed" |
import type { FormInstance } from 'element-plus' |
||||
clearable |
import { addSixSpeed, editSixSpeed, getSixSpeedInfo, getWithPersonnelList, getWithCustomerResourcesList } from '@/app/api/six_speed' |
||||
:placeholder="t('isClosedPlaceholder')" |
|
||||
class="input-width" |
let showDialog = ref(false) |
||||
/> |
const loading = ref(false) |
||||
</el-form-item> |
|
||||
|
/** |
||||
<el-form-item :label="t('staffId')" prop="staff_id"> |
* 表单数据 |
||||
<el-input |
*/ |
||||
v-model="formData.staff_id" |
const initialFormData = { |
||||
clearable |
id: '', |
||||
:placeholder="t('staffIdPlaceholder')" |
purchase_power: '', |
||||
class="input-width" |
concept_awareness: '', |
||||
/> |
preferred_class_time: '', |
||||
</el-form-item> |
distance: '', |
||||
|
communication: '', |
||||
<el-form-item :label="t('resourceId')" prop="resource_id"> |
promised_visit_time: '', |
||||
<el-input |
actual_visit_time: '', |
||||
v-model="formData.resource_id" |
call_intent: '', |
||||
clearable |
first_visit_status: '', |
||||
:placeholder="t('resourceIdPlaceholder')" |
second_visit_status: '', |
||||
class="input-width" |
is_closed: '', |
||||
/> |
} |
||||
</el-form-item> |
const formData: Record<string, any> = reactive({ ...initialFormData }) |
||||
</el-form> |
|
||||
|
const formRef = ref<FormInstance>() |
||||
<template #footer> |
|
||||
<span class="dialog-footer"> |
// 表单验证规则 |
||||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
const formRules = computed(() => { |
||||
<el-button |
return { |
||||
type="primary" |
purchase_power: [ |
||||
:loading="loading" |
{ required: true, message: t('purchasePowerPlaceholder'), trigger: 'blur' }, |
||||
@click="confirm(formRef)" |
|
||||
>{{ t('confirm') }}</el-button |
] |
||||
> |
, |
||||
</span> |
concept_awareness: [ |
||||
</template> |
{ required: true, message: t('conceptAwarenessPlaceholder'), trigger: 'blur' }, |
||||
</el-dialog> |
|
||||
</template> |
] |
||||
|
, |
||||
<script lang="ts" setup> |
preferred_class_time: [ |
||||
import { ref, reactive, computed, watch } from 'vue' |
{ required: true, message: t('preferredClassTimePlaceholder'), trigger: 'blur' }, |
||||
import { useDictionary } from '@/app/api/dict' |
|
||||
import { t } from '@/lang' |
] |
||||
import type { FormInstance } from 'element-plus' |
, |
||||
import { addSixSpeed, editSixSpeed, getSixSpeedInfo } from '@/app/api/six_speed' |
distance: [ |
||||
|
{ required: true, message: t('distancePlaceholder'), trigger: 'blur' }, |
||||
let showDialog = ref(false) |
|
||||
const loading = ref(false) |
] |
||||
|
, |
||||
/** |
communication: [ |
||||
* 表单数据 |
{ required: true, message: t('communicationPlaceholder'), trigger: 'blur' }, |
||||
*/ |
|
||||
const initialFormData = { |
] |
||||
id: '', |
, |
||||
purchase_power: '', |
promised_visit_time: [ |
||||
concept_awareness: '', |
{ required: true, message: t('promisedVisitTimePlaceholder'), trigger: 'blur' }, |
||||
preferred_class_time: '', |
|
||||
distance: '', |
] |
||||
communication: '', |
, |
||||
promised_visit_time: '', |
actual_visit_time: [ |
||||
actual_visit_time: '', |
{ required: true, message: t('actualVisitTimePlaceholder'), trigger: 'blur' }, |
||||
call_intent: '', |
|
||||
first_visit_status: '', |
] |
||||
second_visit_status: '', |
, |
||||
is_closed: '', |
call_intent: [ |
||||
staff_id: '', |
{ required: true, message: t('callIntentPlaceholder'), trigger: 'blur' }, |
||||
resource_id: '', |
|
||||
} |
] |
||||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
, |
||||
|
first_visit_status: [ |
||||
const formRef = ref<FormInstance>() |
{ required: true, message: t('firstVisitStatusPlaceholder'), trigger: 'blur' }, |
||||
|
|
||||
// 表单验证规则 |
] |
||||
const formRules = computed(() => { |
, |
||||
return { |
second_visit_status: [ |
||||
purchase_power: [ |
{ required: true, message: t('secondVisitStatusPlaceholder'), trigger: 'blur' }, |
||||
{ |
|
||||
required: true, |
] |
||||
message: t('purchasePowerPlaceholder'), |
, |
||||
trigger: 'blur', |
is_closed: [ |
||||
}, |
{ required: true, message: t('isClosedPlaceholder'), trigger: 'blur' }, |
||||
], |
|
||||
concept_awareness: [ |
] |
||||
{ |
, |
||||
required: true, |
} |
||||
message: t('conceptAwarenessPlaceholder'), |
}) |
||||
trigger: 'blur', |
|
||||
}, |
const emit = defineEmits(['complete']) |
||||
], |
|
||||
preferred_class_time: [ |
/** |
||||
{ |
* 确认 |
||||
required: true, |
* @param formEl |
||||
message: t('preferredClassTimePlaceholder'), |
*/ |
||||
trigger: 'blur', |
const confirm = async (formEl: FormInstance | undefined) => { |
||||
}, |
if (loading.value || !formEl) return |
||||
], |
let save = formData.id ? editSixSpeed : addSixSpeed |
||||
distance: [ |
|
||||
{ required: true, message: t('distancePlaceholder'), trigger: 'blur' }, |
await formEl.validate(async (valid) => { |
||||
], |
if (valid) { |
||||
communication: [ |
loading.value = true |
||||
{ |
|
||||
required: true, |
let data = formData |
||||
message: t('communicationPlaceholder'), |
|
||||
trigger: 'blur', |
save(data).then(res => { |
||||
}, |
loading.value = false |
||||
], |
showDialog.value = false |
||||
promised_visit_time: [ |
emit('complete') |
||||
{ |
}).catch(err => { |
||||
required: true, |
loading.value = false |
||||
message: t('promisedVisitTimePlaceholder'), |
}) |
||||
trigger: 'blur', |
} |
||||
}, |
}) |
||||
], |
} |
||||
actual_visit_time: [ |
|
||||
{ |
// 获取字典数据 |
||||
required: true, |
let purchase_powerList = ref([]) |
||||
message: t('actualVisitTimePlaceholder'), |
const purchase_powerDictList = async () => { |
||||
trigger: 'blur', |
purchase_powerList.value = await (await useDictionary('customer_purchasing_power')).data.dictionary |
||||
}, |
} |
||||
], |
purchase_powerDictList(); |
||||
call_intent: [ |
watch(() => purchase_powerList.value, () => { formData.purchase_power = purchase_powerList.value[0].value }) |
||||
{ required: true, message: t('callIntentPlaceholder'), trigger: 'blur' }, |
let concept_awarenessList = ref([]) |
||||
], |
const concept_awarenessDictList = async () => { |
||||
first_visit_status: [ |
concept_awarenessList.value = await (await useDictionary('cognitive_concept')).data.dictionary |
||||
{ |
} |
||||
required: true, |
concept_awarenessDictList(); |
||||
message: t('firstVisitStatusPlaceholder'), |
watch(() => concept_awarenessList.value, () => { formData.concept_awareness = concept_awarenessList.value[0].value }) |
||||
trigger: 'blur', |
let call_intentList = ref([]) |
||||
}, |
const call_intentDictList = async () => { |
||||
], |
call_intentList.value = await (await useDictionary('preliminarycustomerintention')).data.dictionary |
||||
second_visit_status: [ |
} |
||||
{ |
call_intentDictList(); |
||||
required: true, |
watch(() => call_intentList.value, () => { formData.call_intent = call_intentList.value[0].value }) |
||||
message: t('secondVisitStatusPlaceholder'), |
let is_closedList = ref([]) |
||||
trigger: 'blur', |
const is_closedDictList = async () => { |
||||
}, |
is_closedList.value = await (await useDictionary('global_true_or_false')).data.dictionary |
||||
], |
} |
||||
is_closed: [ |
is_closedDictList(); |
||||
{ required: true, message: t('isClosedPlaceholder'), trigger: 'blur' }, |
watch(() => is_closedList.value, () => { formData.is_closed = is_closedList.value[0].value }) |
||||
], |
|
||||
staff_id: [ |
|
||||
{ required: true, message: t('staffIdPlaceholder'), trigger: 'blur' }, |
const staffIdList = ref([] as any[]) |
||||
], |
const setStaffIdList = async () => { |
||||
resource_id: [ |
staffIdList.value = await (await getWithPersonnelList({})).data |
||||
{ required: true, message: t('resourceIdPlaceholder'), trigger: 'blur' }, |
} |
||||
], |
setStaffIdList() |
||||
} |
const resourceIdList = ref([] as any[]) |
||||
}) |
const setResourceIdList = async () => { |
||||
|
resourceIdList.value = await (await getWithCustomerResourcesList({})).data |
||||
const emit = defineEmits(['complete']) |
} |
||||
|
setResourceIdList() |
||||
/** |
const setFormData = async (row: any = null) => { |
||||
* 确认 |
Object.assign(formData, initialFormData) |
||||
* @param formEl |
loading.value = true |
||||
*/ |
if(row){ |
||||
const confirm = async (formEl: FormInstance | undefined) => { |
const data = await (await getSixSpeedInfo(row.id)).data |
||||
if (loading.value || !formEl) return |
if (data) Object.keys(formData).forEach((key: string) => { |
||||
let save = formData.id ? editSixSpeed : addSixSpeed |
if (data[key] != undefined) formData[key] = data[key] |
||||
|
}) |
||||
await formEl.validate(async (valid) => { |
} |
||||
if (valid) { |
loading.value = false |
||||
loading.value = true |
} |
||||
|
|
||||
let data = formData |
// 验证手机号格式 |
||||
|
const mobileVerify = (rule: any, value: any, callback: any) => { |
||||
save(data) |
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
||||
.then((res) => { |
callback(new Error(t('generateMobile'))) |
||||
loading.value = false |
} else { |
||||
showDialog.value = false |
callback() |
||||
emit('complete') |
} |
||||
}) |
} |
||||
.catch((err) => { |
|
||||
loading.value = false |
// 验证身份证号 |
||||
}) |
const idCardVerify = (rule: any, value: any, callback: any) => { |
||||
} |
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
||||
}) |
callback(new Error(t('generateIdCard'))) |
||||
} |
} else { |
||||
|
callback() |
||||
// 获取字典数据 |
} |
||||
|
} |
||||
const setFormData = async (row: any = null) => { |
|
||||
Object.assign(formData, initialFormData) |
// 验证邮箱号 |
||||
loading.value = true |
const emailVerify = (rule: any, value: any, callback: any) => { |
||||
if (row) { |
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
||||
const data = await (await getSixSpeedInfo(row.id)).data |
callback(new Error(t('generateEmail'))) |
||||
if (data) |
} else { |
||||
Object.keys(formData).forEach((key: string) => { |
callback() |
||||
if (data[key] != undefined) formData[key] = data[key] |
} |
||||
}) |
} |
||||
} |
|
||||
loading.value = false |
// 验证请输入整数 |
||||
} |
const numberVerify = (rule: any, value: any, callback: any) => { |
||||
|
if (!Number.isInteger(value)) { |
||||
// 验证手机号格式 |
callback(new Error(t('generateNumber'))) |
||||
const mobileVerify = (rule: any, value: any, callback: any) => { |
} else { |
||||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
callback() |
||||
callback(new Error(t('generateMobile'))) |
} |
||||
} else { |
} |
||||
callback() |
|
||||
} |
defineExpose({ |
||||
} |
showDialog, |
||||
|
setFormData |
||||
// 验证身份证号 |
}) |
||||
const idCardVerify = (rule: any, value: any, callback: any) => { |
</script> |
||||
if ( |
|
||||
value && |
<style lang="scss" scoped></style> |
||||
!/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test( |
<style lang="scss"> |
||||
value |
.diy-dialog-wrap .el-form-item__label{ |
||||
) |
height: auto !important; |
||||
) { |
} |
||||
callback(new Error(t('generateIdCard'))) |
</style> |
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// 验证邮箱号 |
|
||||
const emailVerify = (rule: any, value: any, callback: any) => { |
|
||||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|
||||
callback(new Error(t('generateEmail'))) |
|
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// 验证请输入整数 |
|
||||
const numberVerify = (rule: any, value: any, callback: any) => { |
|
||||
if (!Number.isInteger(value)) { |
|
||||
callback(new Error(t('generateNumber'))) |
|
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
defineExpose({ |
|
||||
showDialog, |
|
||||
setFormData, |
|
||||
}) |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped></style> |
|
||||
<style lang="scss"> |
|
||||
.diy-dialog-wrap .el-form-item__label { |
|
||||
height: auto !important; |
|
||||
} |
|
||||
</style> |
|
||||
|
|||||
@ -1,372 +1,214 @@ |
|||||
<template> |
<template> |
||||
<div class="main-container"> |
<div class="main-container"> |
||||
<el-card class="box-card !border-none" shadow="never"> |
<el-card class="box-card !border-none" shadow="never"> |
||||
<div class="flex justify-between items-center"> |
|
||||
<span class="text-lg">{{ pageName }}</span> |
<div class="flex justify-between items-center"> |
||||
<el-button type="primary" @click="addEvent"> |
<span class="text-lg">{{pageName}}</span> |
||||
{{ t('addSixSpeed') }} |
<el-button type="primary" @click="addEvent"> |
||||
</el-button> |
{{ t('addSixSpeed') }} |
||||
</div> |
</el-button> |
||||
|
</div> |
||||
<el-card |
|
||||
class="box-card !border-none my-[10px] table-search-wrap" |
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
||||
shadow="never" |
<el-form :inline="true" :model="sixSpeedTable.searchParam" ref="searchFormRef"> |
||||
> |
|
||||
<el-form |
<el-form-item> |
||||
:inline="true" |
<el-button type="primary" @click="loadSixSpeedList()">{{ t('search') }}</el-button> |
||||
:model="sixSpeedTable.searchParam" |
<el-button @click="resetForm(searchFormRef)">{{ t('reset') }}</el-button> |
||||
ref="searchFormRef" |
</el-form-item> |
||||
> |
</el-form> |
||||
<el-form-item :label="t('purchasePower')" prop="purchase_power"> |
</el-card> |
||||
<el-input |
|
||||
v-model="sixSpeedTable.searchParam.purchase_power" |
<div class="mt-[10px]"> |
||||
:placeholder="t('purchasePowerPlaceholder')" |
<el-table :data="sixSpeedTable.data" size="large" v-loading="sixSpeedTable.loading"> |
||||
/> |
<template #empty> |
||||
</el-form-item> |
<span>{{ !sixSpeedTable.loading ? t('emptyData') : '' }}</span> |
||||
<el-form-item :label="t('conceptAwareness')" prop="concept_awareness"> |
</template> |
||||
<el-input |
<el-table-column prop="preferred_class_time" :label="t('preferredClassTime')" min-width="120" :show-overflow-tooltip="true"/> |
||||
v-model="sixSpeedTable.searchParam.concept_awareness" |
|
||||
:placeholder="t('conceptAwarenessPlaceholder')" |
<el-table-column prop="distance" :label="t('distance')" min-width="120" :show-overflow-tooltip="true"/> |
||||
/> |
|
||||
</el-form-item> |
<el-table-column prop="communication" :label="t('communication')" min-width="120" :show-overflow-tooltip="true"/> |
||||
<el-form-item |
|
||||
:label="t('preferredClassTime')" |
<el-table-column prop="promised_visit_time" :label="t('promisedVisitTime')" min-width="120" :show-overflow-tooltip="true"/> |
||||
prop="preferred_class_time" |
|
||||
> |
<el-table-column prop="actual_visit_time" :label="t('actualVisitTime')" min-width="120" :show-overflow-tooltip="true"/> |
||||
<el-input |
|
||||
v-model="sixSpeedTable.searchParam.preferred_class_time" |
<el-table-column :label="t('callIntent')" min-width="180" align="center" :show-overflow-tooltip="true"> |
||||
:placeholder="t('preferredClassTimePlaceholder')" |
<template #default="{ row }"> |
||||
/> |
<div v-for="(item, index) in call_intentList"> |
||||
</el-form-item> |
<div v-if="item.value == row.call_intent">{{ item.name }}</div> |
||||
<el-form-item :label="t('distance')" prop="distance"> |
</div> |
||||
<el-input |
</template> |
||||
v-model="sixSpeedTable.searchParam.distance" |
</el-table-column> |
||||
:placeholder="t('distancePlaceholder')" |
|
||||
/> |
<el-table-column prop="first_visit_status" :label="t('firstVisitStatus')" min-width="120" :show-overflow-tooltip="true"/> |
||||
</el-form-item> |
|
||||
<el-form-item :label="t('communication')" prop="communication"> |
<el-table-column prop="second_visit_status" :label="t('secondVisitStatus')" min-width="120" :show-overflow-tooltip="true"/> |
||||
<el-input |
|
||||
v-model="sixSpeedTable.searchParam.communication" |
<el-table-column :label="t('isClosed')" min-width="180" align="center" :show-overflow-tooltip="true"> |
||||
:placeholder="t('communicationPlaceholder')" |
<template #default="{ row }"> |
||||
/> |
<div v-for="(item, index) in is_closedList"> |
||||
</el-form-item> |
<div v-if="item.value == row.is_closed">{{ item.name }}</div> |
||||
<el-form-item |
</div> |
||||
:label="t('promisedVisitTime')" |
</template> |
||||
prop="promised_visit_time" |
</el-table-column> |
||||
> |
|
||||
<el-input |
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
||||
v-model="sixSpeedTable.searchParam.promised_visit_time" |
<template #default="{ row }"> |
||||
:placeholder="t('promisedVisitTimePlaceholder')" |
<el-button type="primary" link @click="editEvent(row)">{{ t('edit') }}</el-button> |
||||
/> |
<el-button type="primary" link @click="deleteEvent(row.id)">{{ t('delete') }}</el-button> |
||||
</el-form-item> |
</template> |
||||
<el-form-item :label="t('actualVisitTime')" prop="actual_visit_time"> |
</el-table-column> |
||||
<el-input |
|
||||
v-model="sixSpeedTable.searchParam.actual_visit_time" |
</el-table> |
||||
:placeholder="t('actualVisitTimePlaceholder')" |
<div class="mt-[16px] flex justify-end"> |
||||
/> |
<el-pagination v-model:current-page="sixSpeedTable.page" v-model:page-size="sixSpeedTable.limit" |
||||
</el-form-item> |
layout="total, sizes, prev, pager, next, jumper" :total="sixSpeedTable.total" |
||||
<el-form-item :label="t('callIntent')" prop="call_intent"> |
@size-change="loadSixSpeedList()" @current-change="loadSixSpeedList" /> |
||||
<el-input |
</div> |
||||
v-model="sixSpeedTable.searchParam.call_intent" |
</div> |
||||
:placeholder="t('callIntentPlaceholder')" |
|
||||
/> |
<edit ref="editSixSpeedDialog" @complete="loadSixSpeedList" /> |
||||
</el-form-item> |
</el-card> |
||||
<el-form-item |
</div> |
||||
:label="t('firstVisitStatus')" |
</template> |
||||
prop="first_visit_status" |
|
||||
> |
<script lang="ts" setup> |
||||
<el-input |
import { reactive, ref, watch } from 'vue' |
||||
v-model="sixSpeedTable.searchParam.first_visit_status" |
import { t } from '@/lang' |
||||
:placeholder="t('firstVisitStatusPlaceholder')" |
import { useDictionary } from '@/app/api/dict' |
||||
/> |
import { getSixSpeedList, deleteSixSpeed, getWithPersonnelList, getWithCustomerResourcesList } from '@/app/api/six_speed' |
||||
</el-form-item> |
import { img } from '@/utils/common' |
||||
<el-form-item |
import { ElMessageBox,FormInstance } from 'element-plus' |
||||
:label="t('secondVisitStatus')" |
import Edit from '@/app/views/six_speed/components/six-speed-edit.vue' |
||||
prop="second_visit_status" |
import { useRoute } from 'vue-router' |
||||
> |
const route = useRoute() |
||||
<el-input |
const pageName = route.meta.title; |
||||
v-model="sixSpeedTable.searchParam.second_visit_status" |
|
||||
:placeholder="t('secondVisitStatusPlaceholder')" |
let sixSpeedTable = reactive({ |
||||
/> |
page: 1, |
||||
</el-form-item> |
limit: 10, |
||||
<el-form-item :label="t('isClosed')" prop="is_closed"> |
total: 0, |
||||
<el-input |
loading: true, |
||||
v-model="sixSpeedTable.searchParam.is_closed" |
data: [], |
||||
:placeholder="t('isClosedPlaceholder')" |
searchParam:{ |
||||
/> |
|
||||
</el-form-item> |
} |
||||
<el-form-item :label="t('staffId')" prop="staff_id"> |
}) |
||||
<el-input |
|
||||
v-model="sixSpeedTable.searchParam.staff_id" |
const searchFormRef = ref<FormInstance>() |
||||
:placeholder="t('staffIdPlaceholder')" |
|
||||
/> |
// 选中数据 |
||||
</el-form-item> |
const selectData = ref<any[]>([]) |
||||
<el-form-item :label="t('resourceId')" prop="resource_id"> |
|
||||
<el-input |
// 字典数据 |
||||
v-model="sixSpeedTable.searchParam.resource_id" |
const purchase_powerList = ref([] as any[]) |
||||
:placeholder="t('resourceIdPlaceholder')" |
const purchase_powerDictList = async () => { |
||||
/> |
purchase_powerList.value = await (await useDictionary('customer_purchasing_power')).data.dictionary |
||||
</el-form-item> |
} |
||||
|
purchase_powerDictList(); |
||||
<el-form-item> |
const concept_awarenessList = ref([] as any[]) |
||||
<el-button type="primary" @click="loadSixSpeedList()">{{ |
const concept_awarenessDictList = async () => { |
||||
t('search') |
concept_awarenessList.value = await (await useDictionary('cognitive_concept')).data.dictionary |
||||
}}</el-button> |
} |
||||
<el-button @click="resetForm(searchFormRef)">{{ |
concept_awarenessDictList(); |
||||
t('reset') |
const call_intentList = ref([] as any[]) |
||||
}}</el-button> |
const call_intentDictList = async () => { |
||||
</el-form-item> |
call_intentList.value = await (await useDictionary('preliminarycustomerintention')).data.dictionary |
||||
</el-form> |
} |
||||
</el-card> |
call_intentDictList(); |
||||
|
const is_closedList = ref([] as any[]) |
||||
<div class="mt-[10px]"> |
const is_closedDictList = async () => { |
||||
<el-table |
is_closedList.value = await (await useDictionary('global_true_or_false')).data.dictionary |
||||
:data="sixSpeedTable.data" |
} |
||||
size="large" |
is_closedDictList(); |
||||
v-loading="sixSpeedTable.loading" |
|
||||
> |
/** |
||||
<template #empty> |
* 获取六一速列表 |
||||
<span>{{ !sixSpeedTable.loading ? t('emptyData') : '' }}</span> |
*/ |
||||
</template> |
const loadSixSpeedList = (page: number = 1) => { |
||||
<el-table-column |
sixSpeedTable.loading = true |
||||
prop="purchase_power" |
sixSpeedTable.page = page |
||||
:label="t('purchasePower')" |
|
||||
min-width="120" |
getSixSpeedList({ |
||||
:show-overflow-tooltip="true" |
page: sixSpeedTable.page, |
||||
/> |
limit: sixSpeedTable.limit, |
||||
|
...sixSpeedTable.searchParam |
||||
<el-table-column |
}).then(res => { |
||||
prop="concept_awareness" |
sixSpeedTable.loading = false |
||||
:label="t('conceptAwareness')" |
sixSpeedTable.data = res.data.data |
||||
min-width="120" |
sixSpeedTable.total = res.data.total |
||||
:show-overflow-tooltip="true" |
}).catch(() => { |
||||
/> |
sixSpeedTable.loading = false |
||||
|
}) |
||||
<el-table-column |
} |
||||
prop="preferred_class_time" |
loadSixSpeedList() |
||||
:label="t('preferredClassTime')" |
|
||||
min-width="120" |
const editSixSpeedDialog: Record<string, any> | null = ref(null) |
||||
:show-overflow-tooltip="true" |
|
||||
/> |
/** |
||||
|
* 添加六一速 |
||||
<el-table-column |
*/ |
||||
prop="distance" |
const addEvent = () => { |
||||
:label="t('distance')" |
editSixSpeedDialog.value.setFormData() |
||||
min-width="120" |
editSixSpeedDialog.value.showDialog = true |
||||
:show-overflow-tooltip="true" |
} |
||||
/> |
|
||||
|
/** |
||||
<el-table-column |
* 编辑六一速 |
||||
prop="communication" |
* @param data |
||||
:label="t('communication')" |
*/ |
||||
min-width="120" |
const editEvent = (data: any) => { |
||||
:show-overflow-tooltip="true" |
editSixSpeedDialog.value.setFormData(data) |
||||
/> |
editSixSpeedDialog.value.showDialog = true |
||||
|
} |
||||
<el-table-column |
|
||||
prop="promised_visit_time" |
/** |
||||
:label="t('promisedVisitTime')" |
* 删除六一速 |
||||
min-width="120" |
*/ |
||||
:show-overflow-tooltip="true" |
const deleteEvent = (id: number) => { |
||||
/> |
ElMessageBox.confirm(t('sixSpeedDeleteTips'), t('warning'), |
||||
|
{ |
||||
<el-table-column |
confirmButtonText: t('confirm'), |
||||
prop="actual_visit_time" |
cancelButtonText: t('cancel'), |
||||
:label="t('actualVisitTime')" |
type: 'warning', |
||||
min-width="120" |
} |
||||
:show-overflow-tooltip="true" |
).then(() => { |
||||
/> |
deleteSixSpeed(id).then(() => { |
||||
|
loadSixSpeedList() |
||||
<el-table-column |
}).catch(() => { |
||||
prop="call_intent" |
}) |
||||
:label="t('callIntent')" |
}) |
||||
min-width="120" |
} |
||||
:show-overflow-tooltip="true" |
|
||||
/> |
|
||||
|
const staffIdList = ref([]) |
||||
<el-table-column |
const setStaffIdList = async () => { |
||||
prop="first_visit_status" |
staffIdList.value = await (await getWithPersonnelList({})).data |
||||
:label="t('firstVisitStatus')" |
} |
||||
min-width="120" |
setStaffIdList() |
||||
:show-overflow-tooltip="true" |
const resourceIdList = ref([]) |
||||
/> |
const setResourceIdList = async () => { |
||||
|
resourceIdList.value = await (await getWithCustomerResourcesList({})).data |
||||
<el-table-column |
} |
||||
prop="second_visit_status" |
setResourceIdList() |
||||
:label="t('secondVisitStatus')" |
|
||||
min-width="120" |
const resetForm = (formEl: FormInstance | undefined) => { |
||||
:show-overflow-tooltip="true" |
if (!formEl) return |
||||
/> |
formEl.resetFields() |
||||
|
loadSixSpeedList() |
||||
<el-table-column |
} |
||||
prop="is_closed" |
</script> |
||||
:label="t('isClosed')" |
|
||||
min-width="120" |
<style lang="scss" scoped> |
||||
:show-overflow-tooltip="true" |
/* 多行超出隐藏 */ |
||||
/> |
.multi-hidden { |
||||
|
word-break: break-all; |
||||
<el-table-column |
text-overflow: ellipsis; |
||||
prop="staff_id" |
overflow: hidden; |
||||
:label="t('staffId')" |
display: -webkit-box; |
||||
min-width="120" |
-webkit-line-clamp: 2; |
||||
:show-overflow-tooltip="true" |
-webkit-box-orient: vertical; |
||||
/> |
} |
||||
|
</style> |
||||
<el-table-column |
|
||||
prop="resource_id" |
|
||||
:label="t('resourceId')" |
|
||||
min-width="120" |
|
||||
:show-overflow-tooltip="true" |
|
||||
/> |
|
||||
|
|
||||
<el-table-column |
|
||||
:label="t('operation')" |
|
||||
fixed="right" |
|
||||
min-width="120" |
|
||||
> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="primary" link @click="editEvent(row)">{{ |
|
||||
t('edit') |
|
||||
}}</el-button> |
|
||||
<el-button type="primary" link @click="deleteEvent(row.id)">{{ |
|
||||
t('delete') |
|
||||
}}</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<div class="mt-[16px] flex justify-end"> |
|
||||
<el-pagination |
|
||||
v-model:current-page="sixSpeedTable.page" |
|
||||
v-model:page-size="sixSpeedTable.limit" |
|
||||
layout="total, sizes, prev, pager, next, jumper" |
|
||||
:total="sixSpeedTable.total" |
|
||||
@size-change="loadSixSpeedList()" |
|
||||
@current-change="loadSixSpeedList" |
|
||||
/> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<edit ref="editSixSpeedDialog" @complete="loadSixSpeedList" /> |
|
||||
</el-card> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script lang="ts" setup> |
|
||||
import { reactive, ref, watch } from 'vue' |
|
||||
import { t } from '@/lang' |
|
||||
import { useDictionary } from '@/app/api/dict' |
|
||||
import { getSixSpeedList, deleteSixSpeed } from '@/app/api/six_speed' |
|
||||
import { img } from '@/utils/common' |
|
||||
import { ElMessageBox, FormInstance } from 'element-plus' |
|
||||
import Edit from '@/app/views/six_speed/components/six-speed-edit.vue' |
|
||||
import { useRoute } from 'vue-router' |
|
||||
const route = useRoute() |
|
||||
const pageName = route.meta.title |
|
||||
|
|
||||
let sixSpeedTable = reactive({ |
|
||||
page: 1, |
|
||||
limit: 10, |
|
||||
total: 0, |
|
||||
loading: true, |
|
||||
data: [], |
|
||||
searchParam: { |
|
||||
purchase_power: '', |
|
||||
concept_awareness: '', |
|
||||
preferred_class_time: '', |
|
||||
distance: '', |
|
||||
communication: '', |
|
||||
promised_visit_time: '', |
|
||||
actual_visit_time: '', |
|
||||
call_intent: '', |
|
||||
first_visit_status: '', |
|
||||
second_visit_status: '', |
|
||||
is_closed: '', |
|
||||
staff_id: '', |
|
||||
resource_id: '', |
|
||||
}, |
|
||||
}) |
|
||||
|
|
||||
const searchFormRef = ref<FormInstance>() |
|
||||
|
|
||||
// 选中数据 |
|
||||
const selectData = ref<any[]>([]) |
|
||||
|
|
||||
// 字典数据 |
|
||||
|
|
||||
/** |
|
||||
* 获取六一速列表 |
|
||||
*/ |
|
||||
const loadSixSpeedList = (page: number = 1) => { |
|
||||
sixSpeedTable.loading = true |
|
||||
sixSpeedTable.page = page |
|
||||
|
|
||||
getSixSpeedList({ |
|
||||
page: sixSpeedTable.page, |
|
||||
limit: sixSpeedTable.limit, |
|
||||
...sixSpeedTable.searchParam, |
|
||||
}) |
|
||||
.then((res) => { |
|
||||
sixSpeedTable.loading = false |
|
||||
sixSpeedTable.data = res.data.data |
|
||||
sixSpeedTable.total = res.data.total |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
sixSpeedTable.loading = false |
|
||||
}) |
|
||||
} |
|
||||
loadSixSpeedList() |
|
||||
|
|
||||
const editSixSpeedDialog: Record<string, any> | null = ref(null) |
|
||||
|
|
||||
/** |
|
||||
* 添加六一速 |
|
||||
*/ |
|
||||
const addEvent = () => { |
|
||||
editSixSpeedDialog.value.setFormData() |
|
||||
editSixSpeedDialog.value.showDialog = true |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 编辑六一速 |
|
||||
* @param data |
|
||||
*/ |
|
||||
const editEvent = (data: any) => { |
|
||||
editSixSpeedDialog.value.setFormData(data) |
|
||||
editSixSpeedDialog.value.showDialog = true |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 删除六一速 |
|
||||
*/ |
|
||||
const deleteEvent = (id: number) => { |
|
||||
ElMessageBox.confirm(t('sixSpeedDeleteTips'), t('warning'), { |
|
||||
confirmButtonText: t('confirm'), |
|
||||
cancelButtonText: t('cancel'), |
|
||||
type: 'warning', |
|
||||
}).then(() => { |
|
||||
deleteSixSpeed(id) |
|
||||
.then(() => { |
|
||||
loadSixSpeedList() |
|
||||
}) |
|
||||
.catch(() => {}) |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
const resetForm = (formEl: FormInstance | undefined) => { |
|
||||
if (!formEl) return |
|
||||
formEl.resetFields() |
|
||||
loadSixSpeedList() |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
/* 多行超出隐藏 */ |
|
||||
.multi-hidden { |
|
||||
word-break: break-all; |
|
||||
text-overflow: ellipsis; |
|
||||
overflow: hidden; |
|
||||
display: -webkit-box; |
|
||||
-webkit-line-clamp: 2; |
|
||||
-webkit-box-orient: vertical; |
|
||||
} |
|
||||
</style> |
|
||||
|
|||||
Loading…
Reference in new issue