|
|
|
@ -3,7 +3,7 @@ |
|
|
|
<el-card class="box-card !border-none" shadow="never"> |
|
|
|
|
|
|
|
<div class="flex justify-between items-center"> |
|
|
|
<span class="text-lg">{{pageName}}</span> |
|
|
|
<span class="text-lg">{{ pageName }}</span> |
|
|
|
<el-button type="primary" @click="addEvent"> |
|
|
|
{{ t('addSales') }} |
|
|
|
</el-button> |
|
|
|
@ -12,14 +12,15 @@ |
|
|
|
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|
|
|
<el-form :inline="true" :model="salesTable.searchParam" ref="searchFormRef"> |
|
|
|
<el-form-item :label="t('studentPhone')" prop="student_phone"> |
|
|
|
<el-input v-model="salesTable.searchParam.student_phone" :placeholder="t('studentPhonePlaceholder')" /> |
|
|
|
<el-input v-model="salesTable.searchParam.student_phone" :placeholder="t('studentPhonePlaceholder')"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="t('studentName')" prop="student_name"> |
|
|
|
<el-input v-model="salesTable.searchParam.student_name" :placeholder="t('studentNamePlaceholder')" /> |
|
|
|
<el-input v-model="salesTable.searchParam.student_name" :placeholder="t('studentNamePlaceholder')"/> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item :label="t('sex')" prop="sex"> |
|
|
|
<el-select class="w-[280px]" v-model="salesTable.searchParam.sex" clearable :placeholder="t('sexPlaceholder')"> |
|
|
|
<el-select class="w-[280px]" v-model="salesTable.searchParam.sex" clearable |
|
|
|
:placeholder="t('sexPlaceholder')"> |
|
|
|
<el-option label="全部" value=""></el-option> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in sexList" |
|
|
|
@ -35,17 +36,18 @@ |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item :label="t('schoolName')" prop="school_name"> |
|
|
|
<el-input v-model="salesTable.searchParam.school_name" :placeholder="t('schoolNamePlaceholder')" /> |
|
|
|
<el-input v-model="salesTable.searchParam.school_name" :placeholder="t('schoolNamePlaceholder')"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="t('grade')" prop="grade"> |
|
|
|
<el-input v-model="salesTable.searchParam.grade" :placeholder="t('gradePlaceholder')" /> |
|
|
|
<el-input v-model="salesTable.searchParam.grade" :placeholder="t('gradePlaceholder')"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="t('className')" prop="class_name"> |
|
|
|
<el-input v-model="salesTable.searchParam.class_name" :placeholder="t('classNamePlaceholder')" /> |
|
|
|
<el-input v-model="salesTable.searchParam.class_name" :placeholder="t('classNamePlaceholder')"/> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item :label="t('sourceChannel')" prop="source_channel"> |
|
|
|
<el-select class="w-[280px]" v-model="salesTable.searchParam.source_channel" clearable :placeholder="t('sourceChannelPlaceholder')"> |
|
|
|
<el-select class="w-[280px]" v-model="salesTable.searchParam.source_channel" clearable |
|
|
|
:placeholder="t('sourceChannelPlaceholder')"> |
|
|
|
<el-option label="全部" value=""></el-option> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in source_channelList" |
|
|
|
@ -58,7 +60,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item :label="t('customerSource')" prop="customer_source"> |
|
|
|
<el-select class="w-[280px]" v-model="salesTable.searchParam.customer_source" clearable :placeholder="t('customerSourcePlaceholder')"> |
|
|
|
<el-select class="w-[280px]" v-model="salesTable.searchParam.customer_source" clearable |
|
|
|
:placeholder="t('customerSourcePlaceholder')"> |
|
|
|
<el-option label="全部" value=""></el-option> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in customer_sourceList" |
|
|
|
@ -71,7 +74,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item :label="t('addStaffId')" prop="add_staff_id"> |
|
|
|
<el-select class="w-[280px]" v-model="salesTable.searchParam.add_staff_id" clearable :placeholder="t('addStaffIdPlaceholder')"> |
|
|
|
<el-select class="w-[280px]" v-model="salesTable.searchParam.add_staff_id" clearable |
|
|
|
:placeholder="t('addStaffIdPlaceholder')"> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in addStaffIdList" |
|
|
|
:key="index" |
|
|
|
@ -83,7 +87,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item :label="t('getStaffId')" prop="get_staff_id"> |
|
|
|
<el-select class="w-[280px]" v-model="salesTable.searchParam.get_staff_id" clearable :placeholder="t('getStaffIdPlaceholder')"> |
|
|
|
<el-select class="w-[280px]" v-model="salesTable.searchParam.get_staff_id" clearable |
|
|
|
:placeholder="t('getStaffIdPlaceholder')"> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in getStaffIdList" |
|
|
|
:key="index" |
|
|
|
@ -94,50 +99,29 @@ |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item :label="t('contactName')" prop="contact_name"> |
|
|
|
<el-input v-model="salesTable.searchParam.contact_name" :placeholder="t('contactNamePlaceholder')" /> |
|
|
|
<el-input v-model="salesTable.searchParam.contact_name" :placeholder="t('contactNamePlaceholder')"/> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item :label="t('provinceId')" prop="province_id"> |
|
|
|
<el-select class="w-[280px]" v-model="salesTable.searchParam.province_id" clearable :placeholder="t('provinceIdPlaceholder')"> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in provinceIdList" |
|
|
|
:key="index" |
|
|
|
:label="item['name']" |
|
|
|
:value="item['id']" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item :label="t('cityId')" prop="city_id"> |
|
|
|
<el-select class="w-[280px]" v-model="salesTable.searchParam.city_id" clearable :placeholder="t('cityIdPlaceholder')"> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in cityIdList" |
|
|
|
:key="index" |
|
|
|
:label="item['name']" |
|
|
|
:value="item['id']" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item :label="t('districtId')" prop="district_id"> |
|
|
|
<el-select class="w-[280px]" v-model="salesTable.searchParam.district_id" clearable :placeholder="t('districtIdPlaceholder')"> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in districtIdList" |
|
|
|
:key="index" |
|
|
|
:label="item['name']" |
|
|
|
:value="item['id']" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<el-form-item :label="t('所在地')" prop="province_id"> |
|
|
|
<el-cascader |
|
|
|
class="input-width" |
|
|
|
v-model="salesTable.searchParam.full_address_id" |
|
|
|
:options="options_area" |
|
|
|
:props="{ |
|
|
|
label: 'name', // 指定显示文本字段 |
|
|
|
value: 'id', // 指定值字段 |
|
|
|
children: 'children' // 指定子节点字段 |
|
|
|
}" |
|
|
|
@change="changeArea"></el-cascader> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item :label="t('communityName')" prop="community_name"> |
|
|
|
<el-input v-model="salesTable.searchParam.community_name" :placeholder="t('communityNamePlaceholder')" /> |
|
|
|
<el-input v-model="salesTable.searchParam.community_name" :placeholder="t('communityNamePlaceholder')"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="t('createTime')" prop="create_time"> |
|
|
|
<el-date-picker v-model="salesTable.searchParam.create_time" type="datetimerange" format="YYYY-MM-DD hh:mm:ss" |
|
|
|
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" /> |
|
|
|
<el-date-picker v-model="salesTable.searchParam.create_time" type="datetimerange" |
|
|
|
format="YYYY-MM-DD hh:mm:ss" |
|
|
|
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')"/> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
@ -155,7 +139,8 @@ |
|
|
|
</template> |
|
|
|
<el-table-column prop="id" :label="t('id')" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
<el-table-column prop="student_phone" :label="t('studentPhone')" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
<el-table-column prop="student_phone" :label="t('studentPhone')" min-width="120" |
|
|
|
:show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
<el-table-column prop="student_name" :label="t('studentName')" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
@ -191,19 +176,24 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="add_staff_id_name" :label="t('addStaffId')" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
<el-table-column prop="add_staff_id_name" :label="t('addStaffId')" min-width="120" |
|
|
|
:show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
<el-table-column prop="get_staff_id_name" :label="t('getStaffId')" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
<el-table-column prop="get_staff_id_name" :label="t('getStaffId')" min-width="120" |
|
|
|
:show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
<el-table-column prop="contact_name" :label="t('contactName')" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
<el-table-column prop="province_id_name" :label="t('provinceId')" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
<el-table-column prop="province_id_name" :label="t('provinceId')" min-width="120" |
|
|
|
:show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
<el-table-column prop="city_id_name" :label="t('cityId')" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
<el-table-column prop="district_id_name" :label="t('districtId')" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
<el-table-column prop="district_id_name" :label="t('districtId')" min-width="120" |
|
|
|
:show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
<el-table-column prop="community_name" :label="t('communityName')" min-width="120" :show-overflow-tooltip="true"/> |
|
|
|
<el-table-column prop="community_name" :label="t('communityName')" min-width="120" |
|
|
|
:show-overflow-tooltip="true"/> |
|
|
|
|
|
|
|
<el-table-column :label="t('customerTags')" min-width="180" align="center" :show-overflow-tooltip="true"> |
|
|
|
<template #default="{ row }"> |
|
|
|
@ -237,7 +227,7 @@ |
|
|
|
<div class="mt-[16px] flex justify-end"> |
|
|
|
<el-pagination v-model:current-page="salesTable.page" v-model:page-size="salesTable.limit" |
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="salesTable.total" |
|
|
|
@size-change="loadSalesList()" @current-change="loadSalesList" /> |
|
|
|
@size-change="loadSalesList()" @current-change="loadSalesList"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -247,14 +237,16 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
import { reactive, ref, watch } from 'vue' |
|
|
|
import { t } from '@/lang' |
|
|
|
import { useDictionary } from '@/app/api/dict' |
|
|
|
import {reactive, ref, watch} from 'vue' |
|
|
|
import {t} from '@/lang' |
|
|
|
import {useDictionary} from '@/app/api/dict' |
|
|
|
import {getSalesList, deleteSales, getWithStaffList, getWithSysAreaList} from '@/addon/zhjw/api/sales' |
|
|
|
import { img } from '@/utils/common' |
|
|
|
import { ElMessageBox,FormInstance } from 'element-plus' |
|
|
|
import { useRouter } from 'vue-router' |
|
|
|
import { useRoute } from 'vue-router' |
|
|
|
import {img} from '@/utils/common' |
|
|
|
import {ElMessageBox, FormInstance} from 'element-plus' |
|
|
|
import {useRouter} from 'vue-router' |
|
|
|
import {useRoute} from 'vue-router' |
|
|
|
import {getAreaTree} from "@/addon/zhjw/api/common"; |
|
|
|
|
|
|
|
const route = useRoute() |
|
|
|
const pageName = route.meta.title; |
|
|
|
|
|
|
|
@ -264,54 +256,78 @@ let salesTable = reactive({ |
|
|
|
total: 0, |
|
|
|
loading: true, |
|
|
|
data: [], |
|
|
|
searchParam:{ |
|
|
|
"student_phone":"", |
|
|
|
"student_name":"", |
|
|
|
"sex":"", |
|
|
|
"age":[], |
|
|
|
"school_name":"", |
|
|
|
"grade":"", |
|
|
|
"class_name":"", |
|
|
|
"source_channel":"", |
|
|
|
"customer_source":"", |
|
|
|
"add_staff_id":"", |
|
|
|
"get_staff_id":"", |
|
|
|
"contact_name":"", |
|
|
|
"province_id":"", |
|
|
|
"city_id":"", |
|
|
|
"district_id":"", |
|
|
|
"community_name":"", |
|
|
|
"customer_tags":"", |
|
|
|
"create_time":"" |
|
|
|
searchParam: { |
|
|
|
"student_phone": "", |
|
|
|
"student_name": "", |
|
|
|
"sex": "", |
|
|
|
"age": [], |
|
|
|
"school_name": "", |
|
|
|
"grade": "", |
|
|
|
"class_name": "", |
|
|
|
"source_channel": "", |
|
|
|
"customer_source": "", |
|
|
|
"add_staff_id": "", |
|
|
|
"get_staff_id": "", |
|
|
|
"contact_name": "", |
|
|
|
"province_id": "", |
|
|
|
"city_id": "", |
|
|
|
"district_id": "", |
|
|
|
"community_name": "", |
|
|
|
"customer_tags": "", |
|
|
|
"create_time": "" |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
const searchFormRef = ref<FormInstance>() |
|
|
|
|
|
|
|
//地址下拉三级联动 |
|
|
|
const options_area = ref([]);//地址选择树形结构 |
|
|
|
//获取地址树形结构 |
|
|
|
const getAreaTreeArr = async () => { |
|
|
|
options_area.value = await (await getAreaTree()).data |
|
|
|
} |
|
|
|
getAreaTreeArr() |
|
|
|
//监听地址选择 |
|
|
|
const changeArea = (selectedValues: any[]) => { |
|
|
|
console.log('用户选择的地址值:', selectedValues); |
|
|
|
|
|
|
|
// 将选中的地址信息存储到 formData 中 |
|
|
|
if (selectedValues.length >= 1) { |
|
|
|
|
|
|
|
salesTable.searchParam.province_id = selectedValues[0]; // 省级 ID |
|
|
|
} |
|
|
|
if (selectedValues.length >= 2) { |
|
|
|
salesTable.searchParam.city_id = selectedValues[1]; // 市级 ID |
|
|
|
} |
|
|
|
if (selectedValues.length >= 3) { |
|
|
|
salesTable.searchParam.district_id = selectedValues[2]; // 区级 ID |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
// 选中数据 |
|
|
|
const selectData = ref<any[]>([]) |
|
|
|
|
|
|
|
// 字典数据 |
|
|
|
const sexList = ref([] as any[]) |
|
|
|
const sexDictList = async () => { |
|
|
|
const sexList = ref([] as any[]) |
|
|
|
const sexDictList = async () => { |
|
|
|
sexList.value = await (await useDictionary('users_sex')).data.dictionary |
|
|
|
} |
|
|
|
sexDictList(); |
|
|
|
const source_channelList = ref([] as any[]) |
|
|
|
const source_channelDictList = async () => { |
|
|
|
} |
|
|
|
sexDictList(); |
|
|
|
const source_channelList = ref([] as any[]) |
|
|
|
const source_channelDictList = async () => { |
|
|
|
source_channelList.value = await (await useDictionary('source_channel')).data.dictionary |
|
|
|
} |
|
|
|
source_channelDictList(); |
|
|
|
const customer_sourceList = ref([] as any[]) |
|
|
|
const customer_sourceDictList = async () => { |
|
|
|
} |
|
|
|
source_channelDictList(); |
|
|
|
const customer_sourceList = ref([] as any[]) |
|
|
|
const customer_sourceDictList = async () => { |
|
|
|
customer_sourceList.value = await (await useDictionary('customer_source')).data.dictionary |
|
|
|
} |
|
|
|
customer_sourceDictList(); |
|
|
|
const customer_tagsList = ref([] as any[]) |
|
|
|
const customer_tagsDictList = async () => { |
|
|
|
} |
|
|
|
customer_sourceDictList(); |
|
|
|
const customer_tagsList = ref([] as any[]) |
|
|
|
const customer_tagsDictList = async () => { |
|
|
|
customer_tagsList.value = await (await useDictionary('customer_tags')).data.dictionary |
|
|
|
} |
|
|
|
customer_tagsDictList(); |
|
|
|
} |
|
|
|
customer_tagsDictList(); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -349,7 +365,7 @@ const addEvent = () => { |
|
|
|
* @param data |
|
|
|
*/ |
|
|
|
const editEvent = (data: any) => { |
|
|
|
router.push('/sales/sales_edit?id='+data.id) |
|
|
|
router.push('/sales/sales_edit?id=' + data.id) |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -371,31 +387,17 @@ const deleteEvent = (id: number) => { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const addStaffIdList = ref([]) |
|
|
|
const setAddStaffIdList = async () => { |
|
|
|
addStaffIdList.value = await (await getWithStaffList({})).data |
|
|
|
} |
|
|
|
setAddStaffIdList() |
|
|
|
const getStaffIdList = ref([]) |
|
|
|
const setGetStaffIdList = async () => { |
|
|
|
getStaffIdList.value = await (await getWithStaffList({})).data |
|
|
|
} |
|
|
|
setGetStaffIdList() |
|
|
|
const provinceIdList = ref([]) |
|
|
|
const setProvinceIdList = async () => { |
|
|
|
provinceIdList.value = await (await getWithSysAreaList({})).data |
|
|
|
} |
|
|
|
setProvinceIdList() |
|
|
|
const cityIdList = ref([]) |
|
|
|
const setCityIdList = async () => { |
|
|
|
cityIdList.value = await (await getWithSysAreaList({})).data |
|
|
|
} |
|
|
|
setCityIdList() |
|
|
|
const districtIdList = ref([]) |
|
|
|
const setDistrictIdList = async () => { |
|
|
|
districtIdList.value = await (await getWithSysAreaList({})).data |
|
|
|
} |
|
|
|
setDistrictIdList() |
|
|
|
const addStaffIdList = ref([]) |
|
|
|
const getStaffIdList = ref([]) |
|
|
|
const getStaffIdListApi = async () => { |
|
|
|
let data = await (await getWithStaffList({})).data |
|
|
|
addStaffIdList.value = data |
|
|
|
|
|
|
|
getStaffIdList.value = data |
|
|
|
} |
|
|
|
getStaffIdListApi() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const resetForm = (formEl: FormInstance | undefined) => { |
|
|
|
if (!formEl) return |
|
|
|
@ -413,5 +415,5 @@ const resetForm = (formEl: FormInstance | undefined) => { |
|
|
|
display: -webkit-box; |
|
|
|
-webkit-line-clamp: 2; |
|
|
|
-webkit-box-orient: vertical; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
|