@@ -5,7 +5,7 @@ | |||
<link rel="icon" type="image/svg+xml" href="/logo_1.jpg" /> | |||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |||
<title>菊城人才市场后台管理</title> | |||
<script type="module" crossorigin src="/assets/index-Dtax0FNS.js"></script> | |||
<script type="module" crossorigin src="/assets/index-wtIp4hAK.js"></script> | |||
<link rel="stylesheet" crossorigin href="/assets/index-DSahY579.css"> | |||
</head> | |||
<body> |
@@ -233,4 +233,15 @@ export const GetCustomerDetail = getModel(url.CustomerDetail); | |||
export const PostEsJobseeker = postModel(url.EsJobseeker); | |||
export const PostTokenizerModify = postModel(url.TokenizerModify); | |||
export const GetTokenizerGet = getModel(url.TokenizerGet); | |||
export const GetTokenizerGet = getModel(url.TokenizerGet); | |||
// VIP充值 | |||
export const PostFeePackageAdd = postModel(url.FeePackageAdd); | |||
export const PostFeePackageDel = postModel(url.FeePackageDel); | |||
export const PostFeePackageUpdate = postModel(url.FeePackageUpdate); | |||
export const GetFeePackageList = getModel(url.FeePackageList); | |||
export const GetFeePackageDetail = getModel(url.FeePackageDetail); | |||
export const GetFeeOrderList = getModel(url.FeeOrderList); | |||
export const GetFeeOrderDetail = getModel(url.FeeOrderDetail); |
@@ -37,7 +37,7 @@ declare namespace urlType { | |||
companyJobList : String, | |||
companyJobInfo : String, | |||
CompanyRecruiters : String, | |||
CompanyTurnJobseeker: String, | |||
CompanyTurnJobseeker : String, | |||
companyDepartmentAdd : String, | |||
companyDepartmentEdit : String, | |||
@@ -214,5 +214,13 @@ declare namespace urlType { | |||
TokenizerModify : String, | |||
TokenizerGet : String, | |||
FeePackageAdd : String, | |||
FeePackageDel : String, | |||
FeePackageUpdate : String, | |||
FeePackageList : String, | |||
FeePackageDetail : String, | |||
FeeOrderList : String, | |||
FeeOrderDetail : String, | |||
} | |||
} |
@@ -226,4 +226,14 @@ export const url : urlType.url = { | |||
CustomerUpdate: common + '/customer/update', // 编辑 | |||
CustomerList: common + '/customer/list', // 列表 | |||
CustomerDetail: common + '/customer/detail', // 详情 | |||
// VIP充值 | |||
FeePackageAdd: admin + '/fee/package_add', // 添加 | |||
FeePackageDel: admin + '/fee/del', // 删除 | |||
FeePackageUpdate: admin + '/fee/package_edit', // 编辑 | |||
FeePackageList: admin + '/fee/package_list', // 列表 | |||
FeePackageDetail: admin + '/fee/package_info', // 详情 | |||
FeeOrderList: admin + '/fee/order_list', // 列表 | |||
FeeOrderDetail: admin + '/fee/order_info', // 详情 | |||
} |
@@ -544,5 +544,36 @@ const FeedbackRoute : AppRouteRecordRaw = { | |||
// ], | |||
// }; | |||
// 付费管理 | |||
const BuyRoute : AppRouteRecordRaw = { | |||
path: '/buy', | |||
name: 'buy', | |||
component: routerList.Buy, | |||
meta: { | |||
title: '付费管理', | |||
icon: HomeOutlined | |||
}, | |||
children: [ | |||
{ | |||
path: '/buy/package', | |||
name: 'buyPackage', | |||
component: routerList.BuyPackage, | |||
meta: { | |||
title: '套餐列表', | |||
icon: HomeOutlined | |||
}, | |||
}, | |||
{ | |||
path: '/buy/order', | |||
name: 'buyOrder', | |||
component: routerList.BuyOrder, | |||
meta: { | |||
title: '订单列表', | |||
icon: HomeOutlined | |||
}, | |||
} | |||
], | |||
}; | |||
export const routesModuleList : AppRouteModule[] = [CompanyRoute, JokSeekerRoute, JokFairRoute, InformationRoute, AdvertisementRoute, ActivityRoute, StatisticsRoute,PermissionRoute, SettingRoute, OtherRoute, FeedbackRoute]; | |||
export const routesModuleList : AppRouteModule[] = [CompanyRoute,BuyRoute, JokSeekerRoute, JokFairRoute, InformationRoute, AdvertisementRoute, ActivityRoute, StatisticsRoute,PermissionRoute, SettingRoute, OtherRoute, FeedbackRoute]; |
@@ -67,6 +67,11 @@ import FeedbackList from '@/views/feedback/list/index.vue'; | |||
import Customer from '@/views/customer/index.vue'; | |||
import CustomerList from '@/views/customer/list/index.vue'; | |||
// 付费套餐管理 | |||
import Buy from '@/views/buy/index.vue'; | |||
import BuyPackage from '@/views/buy/package/index.vue'; | |||
import BuyOrder from '@/views/buy/order/index.vue'; | |||
export const routerList = { | |||
Permission, | |||
ROLE, | |||
@@ -115,5 +120,8 @@ export const routerList = { | |||
Feedback, | |||
FeedbackList, | |||
Customer, | |||
CustomerList | |||
CustomerList, | |||
Buy, | |||
BuyPackage, | |||
BuyOrder | |||
} |
@@ -0,0 +1,9 @@ | |||
<template> | |||
<router-view></router-view> | |||
</template> | |||
<script> | |||
</script> | |||
<style> | |||
</style> |
@@ -0,0 +1,43 @@ | |||
declare namespace companyListType { | |||
type addrFormType = { | |||
full_name ?: String, | |||
registration_number ?: String, | |||
establishment_date ?: String, | |||
contact ?: String, | |||
phone ?: String, | |||
mobile ?: String, | |||
email ?: String, | |||
fax ?: String, | |||
website ?: String, | |||
province ?: Number, | |||
city ?: Number, | |||
district ?: Number, | |||
street ?: Number, | |||
address ?: String, | |||
industry ?: Number, | |||
nature ?: Number, | |||
scale ?: Number, | |||
introduction ?: String, | |||
photo ?: String, | |||
photo_status ?: Number, | |||
license_path ?: String, | |||
license_status : '', | |||
login_name ?: String, | |||
login_pwd ?: String, | |||
company_photos ?: Object[] | |||
} | |||
type addOtherFormType = { | |||
chengli_date?: String, | |||
content?: String, | |||
photo_img?: String, | |||
license_img?: String, | |||
company_photo_img?: String, | |||
company_photos ?: String[], | |||
company_address_cascader?: String, | |||
company_industry_cascader?: String, | |||
company_nature_cascader?: String, | |||
company_scale_cascader?: String, | |||
} | |||
} | |||
@@ -0,0 +1,170 @@ | |||
<template> | |||
<a-modal v-model:visible="openAddModel" :title="title" ok-text="提交" cancel-text="取消" @ok="sumbitForm" | |||
@cancel="cancelModal" width="50%"> | |||
<a-form :model="createForm" layout="vertical"> | |||
<a-row gutter="20"> | |||
<a-col span="24"> | |||
<a-form-item required label="选择门店地址"> | |||
<a-switch v-model:checked="showMap"> </a-switch> | |||
<div v-if="showMap"> | |||
<v-map @getLoc="getLoc"></v-map> | |||
</div> | |||
</a-form-item> | |||
</a-col> | |||
<a-col span="24"> | |||
<a-form-item required label="门店地址" name="address"> | |||
<a-input v-model:value="createForm.address" placeholder="请选择门店地址" /> | |||
</a-form-item> | |||
</a-col> | |||
<a-col span="24"> | |||
<a-form-item required label="门店名" name="store_name"> | |||
<a-input v-model:value="createForm.store_name" placeholder="请输入门店名" /> | |||
</a-form-item> | |||
</a-col> | |||
<a-col span="24"> | |||
<a-form-item required label="联系人" name="contact_person"> | |||
<a-input v-model:value="createForm.contact_person" placeholder="请输入联系人" /> | |||
</a-form-item> | |||
</a-col> | |||
<a-col span="24"> | |||
<a-form-item required label="联系电话" name="mobile"> | |||
<a-input v-model:value="createForm.mobile" placeholder="请输入联系电话" /> | |||
</a-form-item> | |||
</a-col> | |||
<a-col span="24"> | |||
<a-form-item required label="审核电话" name="audit_mobile"> | |||
<a-input v-model:value="createForm.audit_mobile" placeholder="请输入审核电话" /> | |||
</a-form-item> | |||
</a-col> | |||
<a-col span="24"> | |||
<a-form-item required label="所属社区" name="communal"> | |||
<a-input v-model:value="createForm.communal" placeholder="请输入所属社区" /> | |||
</a-form-item> | |||
</a-col> | |||
<a-col span="24"> | |||
<a-form-item label="地址分类" name="cate"> | |||
<search-select placeholder="请搜索选择地址分类" :list="cate_list" :select_value="createForm.cate" | |||
@searchData="cateSearch" @getSelectValue="getCateValue"></search-select> | |||
</a-form-item> | |||
</a-col> | |||
</a-row> | |||
</a-form> | |||
</a-modal> | |||
</template> | |||
<script setup lang="ts"> | |||
import { ref, onMounted, computed, defineProps, watch, defineEmits } from 'vue'; | |||
import { GetActivityaddressCate, PostActivityaddressAdd, PostActivityaddressUpdate } from '@/apis/models'; | |||
import vMap from '@/components/map/map-iframe.vue' | |||
import { dataForm, otherDataForm, reset } from '@/views/company/department/add/data.js'; | |||
import { useCommon } from '@/hooks/useCommon'; | |||
let { store, openAddModel, hideModal, message } = useCommon(); | |||
const emit = defineEmits(); | |||
let props = defineProps(['edit_record']); | |||
let title = ref<String>('新增活动地址'); | |||
let showMap = ref<Boolean>(false); | |||
let createForm = ref(dataForm) | |||
let addOtherForm = ref(otherDataForm) | |||
onMounted(() => { | |||
cateSearch({ page: 1, pagesize: 10 }) | |||
}) | |||
// 选择企业 | |||
let cate_list = ref<Object[]>([]) | |||
const cateSearch = (val : Object) => { | |||
GetActivityaddressCate(val).then((res : object) => { | |||
const data = res.data.activity_address_cate.map((item : object) => ({ | |||
label: item, | |||
value: item, | |||
})); | |||
cate_list.value = data; | |||
}) | |||
} | |||
const getCateValue = (val : Object) => { | |||
createForm.value.cate = val.key; | |||
} | |||
// 经纬度 | |||
const getLoc = (mapData : Object) => { | |||
console.log(mapData) | |||
createForm.value.address = mapData.poiaddress; | |||
createForm.value.lat = mapData.latlng.lat; | |||
createForm.value.lng = mapData.latlng.lng; | |||
showMap.value = false; | |||
} | |||
const sumbitForm = () => { | |||
if(!createForm.value.address) { | |||
message.error('请选择门店地址'); | |||
return false; | |||
} | |||
if (createForm.value.address && createForm.value.store_name && createForm.value.contact_person && createForm.value.mobile && createForm.value.audit_mobile && createForm.value.communal && createForm.value.cate) { | |||
if (!createForm.value.id) { | |||
PostActivityaddressAdd(createForm.value).then(res => { | |||
message.success('创建活动地址'); | |||
hideModal(); | |||
resetForm(); | |||
emit('successAdd'); | |||
}).catch(err => { | |||
}) | |||
} else { | |||
PostActivityaddressUpdate(createForm.value).then(res => { | |||
message.success('修改活动地址成功'); | |||
hideModal(); | |||
resetForm(); | |||
emit('successAdd'); | |||
}).catch(err => { | |||
}) | |||
} | |||
} else { | |||
message.warning('请补充完整信息'); | |||
} | |||
} | |||
const resetForm = () => { | |||
createForm.value = reset().dataForm; | |||
} | |||
const cancelModal = () => { | |||
emit('closeAdd'); | |||
resetForm(); | |||
hideModal(); | |||
showMap.value = false; | |||
} | |||
openAddModel = computed(() => { | |||
return store.state.openAddModel; | |||
}) | |||
watch(() => props.edit_record, (newVal) => { | |||
if (newVal) { | |||
title.value = '编辑活动地址'; | |||
console.log(newVal) | |||
createForm.value = { | |||
id: newVal.id, | |||
address: newVal.address, | |||
lat: newVal.lat, | |||
lng: newVal.lng, | |||
store_name: newVal.store_name, | |||
contact_person: newVal.contact_person, | |||
mobile: newVal.mobile, | |||
audit_mobile: newVal.audit_mobile, | |||
communal: newVal.communal, | |||
cate: newVal.cate, | |||
} | |||
} else { | |||
title.value = '新增活动地址'; | |||
} | |||
}) | |||
</script> | |||
<style> | |||
</style> |
@@ -0,0 +1,35 @@ | |||
export let dataForm = { | |||
address: '', | |||
store_name: '', | |||
lat: '', | |||
lng: '', | |||
contact_person: '', | |||
mobile: '', | |||
audit_mobile: '', | |||
communal: '', | |||
cate: '' | |||
} | |||
export let otherDataForm = { | |||
cate: '', | |||
} | |||
export const reset = () => { | |||
dataForm = { | |||
address: '', | |||
store_name: '', | |||
lat: '', | |||
lng: '', | |||
contact_person: '', | |||
mobile: '', | |||
audit_mobile: '', | |||
communal: '', | |||
cate: '' | |||
}; | |||
otherDataForm = { | |||
cate: '', | |||
} | |||
return { dataForm, otherDataForm } | |||
} |
@@ -0,0 +1,34 @@ | |||
export const cols = <ColType.type[]>[ | |||
{ | |||
title: '地址名', | |||
dataIndex: 'address' | |||
}, | |||
{ | |||
title: '门店名', | |||
dataIndex: 'store_name' | |||
}, | |||
{ | |||
title: '联系人', | |||
dataIndex: 'contact_person' | |||
}, | |||
{ | |||
title: '联系电话', | |||
dataIndex: 'mobile' | |||
},{ | |||
title: '审核电话', | |||
dataIndex: 'audit_mobile' | |||
},{ | |||
title: '所属社区', | |||
dataIndex: 'communal' | |||
},{ | |||
title: '地址分类', | |||
dataIndex: 'cate' | |||
}, | |||
{ | |||
title: '操作', | |||
dataIndex: 'operation', | |||
slots: { | |||
customRender: 'operation' | |||
} | |||
} | |||
]; |
@@ -0,0 +1,115 @@ | |||
<template> | |||
<address-search @searchData="searchData" @clearData="clearData" :search_params="commomParams.search"></address-search> | |||
<a-c-operation @refresh="clearData"> | |||
<a-col> | |||
<a-button type="primary" @click="download">导出参与活动用户</a-button> | |||
</a-col> | |||
</a-c-operation> | |||
<a-c-table :data="commomParams.table.data" :columns="commomParams.table.columns" :pagination="commomParams.page" | |||
@page="getPage" :loading="loading"> | |||
<template #default="{ record }"> | |||
<a-row :gutter="10"> | |||
<a-col><a-button type="primary" size="small" primary @click="edit(record)">编辑</a-button></a-col> | |||
<a-popconfirm title="是否删除该地址?" @confirm="delOneRole(record.id)"> | |||
<a-col><a-button type="primary" size="small" danger>删除</a-button></a-col> | |||
</a-popconfirm> | |||
</a-row> | |||
</template> | |||
</a-c-table> | |||
<address-add :edit_record="edit_record" @successAdd="successAdd" @closeAdd="closeAdd"></address-add> | |||
</template> | |||
<script lang="ts" setup> | |||
import { ref, onMounted, watch, computed } from 'vue'; | |||
import AddressSearch from '@/views/buy/order/search/index.vue'; | |||
import AddressAdd from '@/views/buy/order/add/add.vue'; | |||
import { GetFeeOrderList, GetFeeOrderDetail } from '@/apis/models'; | |||
import { useCommon } from '@/hooks/useCommon'; | |||
import { cols } from '@/views/buy/order/columns'; | |||
let { store, commomParams, showModal, showOtherModal1, message } = useCommon(); | |||
let loading = ref<Boolean>(true); | |||
onMounted(() => { | |||
getData(commomParams.value.search); | |||
}) | |||
const searchData = (data : object) => { | |||
commomParams.value.search = data | |||
getData(); | |||
} | |||
const clearData = (data : object) => { | |||
if (data) { | |||
commomParams.value.search = data | |||
} else { | |||
commomParams.value.search = { | |||
page: 1, | |||
pagesize: 10, | |||
sort: 'id', | |||
sortby: 'desc', | |||
keyword: '' | |||
} | |||
} | |||
getData(); | |||
} | |||
const getPage = (data : object) => { | |||
commomParams.value.search.page = data.current; | |||
commomParams.value.search.pagesize = data.pageSize; | |||
getData(); | |||
} | |||
const getData = async () => { | |||
try { | |||
loading.value = true; | |||
let res = await GetActivityaddressList(commomParams.value.search); | |||
loading.value = false; | |||
commomParams.value.table.data = res.data.addresss; | |||
commomParams.value.table.columns = cols; | |||
commomParams.value.page = { | |||
current: commomParams.value.search.page, | |||
pageSize: commomParams.value.search.pagesize, | |||
total: res.data.total, | |||
pageSizeOptions: ['10', '20', '30', '40'], | |||
hideOnSinglePage: false, | |||
showSizeChanger: true | |||
}; | |||
} catch { | |||
loading.value = false; | |||
} | |||
} | |||
// 编辑 | |||
let edit_record = ref<Object>(null) | |||
const edit = (record : object) => { | |||
edit_record.value = record; | |||
showModal() | |||
} | |||
const successAdd = () => { | |||
getData(); | |||
} | |||
const closeAdd = () => { | |||
edit_record.value = null; | |||
} | |||
// 删除 | |||
const delOneRole = (id : number) => { | |||
commomParams.value.delRecord = { id: id }; | |||
PostActivityaddressDel(commomParams.value.delRecord).then(res => { | |||
message.success('删除成功'); | |||
getData(); | |||
}) | |||
} | |||
const download = () => { | |||
PostActivityExportUsers().then(res => { | |||
let url = 'https://rcsc-test.jcjob.cn/img' + res.data.excel_url; | |||
window.open(url); | |||
}) | |||
} | |||
</script> | |||
<style lang="less" scoped> | |||
</style> |
@@ -0,0 +1,94 @@ | |||
<template> | |||
<a-drawer :width="500" title="搜索" placement="right" :open="openSearchModel" @close="onClose"> | |||
<template #extra> | |||
<a-button style="margin-right: 8px" @click="clearSearch">清空搜索</a-button> | |||
<a-button type="primary" @click="getData">搜索</a-button> | |||
</template> | |||
<a-form :model="commomParams.search"> | |||
<a-row :gutter="[10]"> | |||
<a-col span="24"> | |||
<a-form-item> | |||
<a-input addon-before="地址" v-model:value="commomParams.search.keyword" | |||
placeholder="请输入地址" @keyup.enter="getData"/> | |||
</a-form-item> | |||
</a-col> | |||
<a-col span="24"> | |||
<a-form-item> | |||
<search-select placeholder="请搜索选择地址分类" :list="cate_list" :select_value="commomParams.search.cate" | |||
@searchData="cateSearch" @getSelectValue="getCateValue"></search-select> | |||
</a-form-item> | |||
</a-col> | |||
</a-row> | |||
</a-form> | |||
</a-drawer> | |||
</template> | |||
<script lang="ts" setup> | |||
import { ref, onMounted, watch, computed } from 'vue'; | |||
import { GetActivityaddressCate} from '@/apis/models'; | |||
import { useCommon } from '@/hooks/useCommon'; | |||
let { store, commomParams, openSearchModel, hideSearch } = useCommon(); | |||
let props = defineProps(['search_params']); | |||
const emit = defineEmits(); | |||
openSearchModel = computed(() => { | |||
return store.state.openSearchModel; | |||
}) | |||
onMounted(() => { | |||
cateSearch() | |||
}) | |||
interface listType { | |||
cate : String | |||
} | |||
commomParams.value.search = commomParams.value.search as listType; | |||
commomParams.value.search.cate = null; | |||
// watch(() => props.search_params, (newVal) => { | |||
// emit('searchData', commomParams.value.search) | |||
// }) | |||
const getData = () => { | |||
emit('searchData', commomParams.value.search); | |||
hideSearch() | |||
} | |||
// 清空搜索 | |||
const clearSearch = () => { | |||
commomParams.value.search = { | |||
page: 1, | |||
pagesize: 10, | |||
sort: 'id', | |||
sortby: 'desc', | |||
keyword: '' | |||
} | |||
emit('clearData', commomParams.value.search); | |||
hideSearch() | |||
} | |||
const onClose = () => { | |||
clearSearch() | |||
hideSearch() | |||
} | |||
let cate_list = ref<Object[]>([]) | |||
const cateSearch = (val : Object) => { | |||
GetActivityaddressCate(val).then((res : object) => { | |||
const data = res.data.activity_address_cate.map((item : object) => ({ | |||
label: item, | |||
value: item, | |||
})); | |||
cate_list.value = data; | |||
}) | |||
} | |||
const getCateValue = (val : Object) => { | |||
commomParams.value.search.cate = val.key; | |||
getData() | |||
} | |||
</script> | |||
<style> | |||
</style> |
@@ -0,0 +1,16 @@ | |||
declare namespace companyListType { | |||
type addrFormType = { | |||
name ?: String, | |||
type ?: Number, | |||
price ?: Number, | |||
point ?: Number, | |||
day ?: Number, | |||
ad ?: Number, | |||
ad_day ?: Number, | |||
} | |||
type addOtherFormType = { | |||
} | |||
} | |||
@@ -0,0 +1,149 @@ | |||
<template> | |||
<a-modal v-model:visible="openAddModel" :title="title" ok-text="提交" cancel-text="取消" @ok="sumbitForm" | |||
@cancel="cancelModal" width="50%"> | |||
<a-form :model="createForm" layout="vertical"> | |||
<a-row gutter="20"> | |||
<a-col span="24"> | |||
<a-form-item required label="套餐名称"> | |||
<a-input v-model:value="createForm.name" placeholder="请输入套餐名称" /> | |||
</a-form-item> | |||
</a-col> | |||
<a-col span="24"> | |||
<a-form-item required label="套餐类型"> | |||
<a-select v-model:value="createForm.type" placeholder="请选择套餐类型" @change="statusChange"> | |||
<a-select-option :value="1">会员套餐</a-select-option> | |||
<a-select-option :value="2">服务点数</a-select-option> | |||
</a-select> | |||
</a-form-item> | |||
</a-col> | |||
<a-col span="24"> | |||
<a-form-item required label="点数值"> | |||
<a-input-number :min="0" type="number" v-model:value="createForm.point" | |||
placeholder="请输入点数值" style="width: 100%;" /> | |||
</a-form-item> | |||
</a-col> | |||
<a-col span="24"> | |||
<a-form-item required label="价格(元)"> | |||
<a-input-number :min="0" type="number" v-model:value="createForm.price" | |||
placeholder="请输入价格" style="width: 100%;" /> | |||
</a-form-item> | |||
</a-col> | |||
</a-row> | |||
</a-form> | |||
</a-modal> | |||
</template> | |||
<script setup lang="ts"> | |||
import { ref, onMounted, computed, defineProps, watch, defineEmits } from 'vue'; | |||
import { GetActivityaddressCate, PostActivityaddressAdd, PostActivityaddressUpdate } from '@/apis/models'; | |||
import { dataForm, otherDataForm, reset } from '@/views/buy/package/add/data.js'; | |||
import { useCommon } from '@/hooks/useCommon'; | |||
let { store, openAddModel, hideModal, message } = useCommon(); | |||
const emit = defineEmits(); | |||
let props = defineProps(['edit_record']); | |||
let title = ref<String>('新增套餐'); | |||
let showMap = ref<Boolean>(false); | |||
let createForm = ref(dataForm) | |||
let addOtherForm = ref(otherDataForm) | |||
onMounted(() => { | |||
}) | |||
// 选择企业 | |||
let cate_list = ref<Object[]>([]) | |||
const cateSearch = (val : Object) => { | |||
GetActivityaddressCate(val).then((res : object) => { | |||
const data = res.data.activity_address_cate.map((item : object) => ({ | |||
label: item, | |||
value: item, | |||
})); | |||
cate_list.value = data; | |||
}) | |||
} | |||
const getCateValue = (val : Object) => { | |||
createForm.value.cate = val.key; | |||
} | |||
// 经纬度 | |||
const getLoc = (mapData : Object) => { | |||
console.log(mapData) | |||
createForm.value.address = mapData.poiaddress; | |||
createForm.value.lat = mapData.latlng.lat; | |||
createForm.value.lng = mapData.latlng.lng; | |||
showMap.value = false; | |||
} | |||
const sumbitForm = () => { | |||
if(!createForm.value.address) { | |||
message.error('请选择门店地址'); | |||
return false; | |||
} | |||
if (createForm.value.address && createForm.value.store_name && createForm.value.contact_person && createForm.value.mobile && createForm.value.audit_mobile && createForm.value.communal && createForm.value.cate) { | |||
if (!createForm.value.id) { | |||
PostActivityaddressAdd(createForm.value).then(res => { | |||
message.success('创建活动地址'); | |||
hideModal(); | |||
resetForm(); | |||
emit('successAdd'); | |||
}).catch(err => { | |||
}) | |||
} else { | |||
PostActivityaddressUpdate(createForm.value).then(res => { | |||
message.success('修改活动地址成功'); | |||
hideModal(); | |||
resetForm(); | |||
emit('successAdd'); | |||
}).catch(err => { | |||
}) | |||
} | |||
} else { | |||
message.warning('请补充完整信息'); | |||
} | |||
} | |||
const resetForm = () => { | |||
createForm.value = reset().dataForm; | |||
} | |||
const cancelModal = () => { | |||
emit('closeAdd'); | |||
resetForm(); | |||
hideModal(); | |||
showMap.value = false; | |||
} | |||
openAddModel = computed(() => { | |||
return store.state.openAddModel; | |||
}) | |||
watch(() => props.edit_record, (newVal) => { | |||
if (newVal) { | |||
title.value = '编辑活动地址'; | |||
console.log(newVal) | |||
createForm.value = { | |||
id: newVal.id, | |||
address: newVal.address, | |||
lat: newVal.lat, | |||
lng: newVal.lng, | |||
store_name: newVal.store_name, | |||
contact_person: newVal.contact_person, | |||
mobile: newVal.mobile, | |||
audit_mobile: newVal.audit_mobile, | |||
communal: newVal.communal, | |||
cate: newVal.cate, | |||
} | |||
} else { | |||
title.value = '新增活动地址'; | |||
} | |||
}) | |||
</script> | |||
<style> | |||
</style> |
@@ -0,0 +1,30 @@ | |||
export let dataForm = { | |||
name: '', | |||
type: 1, | |||
price: 0, | |||
point: 0, | |||
day: 1, | |||
ad: 0, | |||
ad_day: 0, | |||
} | |||
export let otherDataForm = { | |||
} | |||
export const reset = () => { | |||
dataForm = { | |||
name: '', | |||
type: 1, | |||
price: 0, | |||
point: 0, | |||
day: 1, | |||
ad: 0, | |||
ad_day: 0, | |||
}; | |||
otherDataForm = { | |||
} | |||
return { dataForm, otherDataForm } | |||
} |
@@ -0,0 +1,34 @@ | |||
export const cols = <ColType.type[]>[ | |||
{ | |||
title: '套餐名', | |||
dataIndex: 'name' | |||
}, | |||
{ | |||
title: '套餐类型', | |||
dataIndex: 'type_text' | |||
}, | |||
{ | |||
title: '价格(元)', | |||
dataIndex: 'price' | |||
}, | |||
{ | |||
title: '点数', | |||
dataIndex: 'point' | |||
},{ | |||
title: '会员期延长天数', | |||
dataIndex: 'day' | |||
},{ | |||
title: '广告', | |||
dataIndex: 'ad' | |||
},{ | |||
title: '广告时间', | |||
dataIndex: 'ad_day' | |||
}, | |||
{ | |||
title: '操作', | |||
dataIndex: 'operation', | |||
slots: { | |||
customRender: 'operation' | |||
} | |||
} | |||
]; |
@@ -0,0 +1,106 @@ | |||
<template> | |||
<package-search @searchData="searchData" @clearData="clearData" :search_params="commomParams.search"></package-search> | |||
<a-c-operation @refresh="clearData"> | |||
</a-c-operation> | |||
<a-c-table :data="commomParams.table.data" :columns="commomParams.table.columns" :pagination="commomParams.page" | |||
@page="getPage" :loading="loading"> | |||
<template #default="{ record }"> | |||
<a-row :gutter="10"> | |||
<a-col><a-button type="primary" size="small" primary @click="edit(record)">编辑</a-button></a-col> | |||
<a-popconfirm title="是否删除该地址?" @confirm="delOneRole(record.id)"> | |||
<a-col><a-button type="primary" size="small" danger>删除</a-button></a-col> | |||
</a-popconfirm> | |||
</a-row> | |||
</template> | |||
</a-c-table> | |||
<package-add :edit_record="edit_record" @successAdd="successAdd" @closeAdd="closeAdd"></package-add> | |||
</template> | |||
<script lang="ts" setup> | |||
import { ref, onMounted, watch, computed } from 'vue'; | |||
import PackageSearch from '@/views/buy/package/search/index.vue'; | |||
import PackageAdd from '@/views/buy/package/add/add.vue'; | |||
import { GetFeePackageList, PostFeePackageDel } from '@/apis/models'; | |||
import { useCommon } from '@/hooks/useCommon'; | |||
import { cols } from '@/views/buy/package/columns'; | |||
let { store, commomParams, showModal, showOtherModal1, message } = useCommon(); | |||
let loading = ref<Boolean>(true); | |||
onMounted(() => { | |||
getData(commomParams.value.search); | |||
}) | |||
const searchData = (data : object) => { | |||
commomParams.value.search = data | |||
getData(); | |||
} | |||
const clearData = (data : object) => { | |||
if (data) { | |||
commomParams.value.search = data | |||
} else { | |||
commomParams.value.search = { | |||
page: 1, | |||
pagesize: 10, | |||
sort: 'id', | |||
sortby: 'desc', | |||
keyword: '' | |||
} | |||
} | |||
getData(); | |||
} | |||
const getPage = (data : object) => { | |||
commomParams.value.search.page = data.current; | |||
commomParams.value.search.pagesize = data.pageSize; | |||
getData(); | |||
} | |||
const getData = async () => { | |||
try { | |||
loading.value = true; | |||
let res = await GetFeePackageList(commomParams.value.search); | |||
loading.value = false; | |||
commomParams.value.table.data = res.data.list; | |||
commomParams.value.table.columns = cols; | |||
commomParams.value.page = { | |||
current: commomParams.value.search.page, | |||
pageSize: commomParams.value.search.pagesize, | |||
total: res.data.total, | |||
pageSizeOptions: ['10', '20', '30', '40'], | |||
hideOnSinglePage: false, | |||
showSizeChanger: true | |||
}; | |||
} catch { | |||
loading.value = false; | |||
} | |||
} | |||
// 编辑 | |||
let edit_record = ref<Object>(null) | |||
const edit = (record : object) => { | |||
edit_record.value = record; | |||
showModal() | |||
} | |||
const successAdd = () => { | |||
getData(); | |||
} | |||
const closeAdd = () => { | |||
edit_record.value = null; | |||
} | |||
// 删除 | |||
const delOneRole = (id : number) => { | |||
commomParams.value.delRecord = { id: id }; | |||
PostFeePackageDel(commomParams.value.delRecord).then(res => { | |||
message.success('删除成功'); | |||
getData(); | |||
}) | |||
} | |||
</script> | |||
<style lang="less" scoped> | |||
</style> |
@@ -0,0 +1,83 @@ | |||
<template> | |||
<a-drawer :width="500" title="搜索" placement="right" :open="openSearchModel" @close="onClose"> | |||
<template #extra> | |||
<a-button style="margin-right: 8px" @click="clearSearch">清空搜索</a-button> | |||
<a-button type="primary" @click="getData">搜索</a-button> | |||
</template> | |||
<a-form :model="commomParams.search"> | |||
<a-row :gutter="[10]"> | |||
<a-col span="24"> | |||
<a-form-item> | |||
<a-input addon-before="套餐名" v-model:value="commomParams.search.keyword" | |||
placeholder="请输入套餐名" @keyup.enter="getData"/> | |||
</a-form-item> | |||
</a-col> | |||
<a-col span="24"> | |||
<a-form-item> | |||
<a-select v-model:value="commomParams.search.type" placeholder="请选择套餐类型" @change="statusChange"> | |||
<a-select-option :value="0">全部</a-select-option> | |||
<a-select-option :value="1">会员套餐</a-select-option> | |||
<a-select-option :value="2">服务点数</a-select-option> | |||
</a-select> | |||
</a-form-item> | |||
</a-col> | |||
</a-row> | |||
</a-form> | |||
</a-drawer> | |||
</template> | |||
<script lang="ts" setup> | |||
import { ref, onMounted, watch, computed } from 'vue'; | |||
import { GetActivityaddressCate} from '@/apis/models'; | |||
import { useCommon } from '@/hooks/useCommon'; | |||
let { store, commomParams, openSearchModel, hideSearch } = useCommon(); | |||
let props = defineProps(['search_params']); | |||
const emit = defineEmits(); | |||
openSearchModel = computed(() => { | |||
return store.state.openSearchModel; | |||
}) | |||
interface listType { | |||
status : Number | 0, | |||
} | |||
commomParams.value.search = commomParams.value.search as listType; | |||
commomParams.value.search.status = null; | |||
// watch(() => props.search_params, (newVal) => { | |||
// emit('searchData', commomParams.value.search) | |||
// }) | |||
const getData = () => { | |||
emit('searchData', commomParams.value.search); | |||
hideSearch() | |||
} | |||
// 清空搜索 | |||
const clearSearch = () => { | |||
commomParams.value.search = { | |||
page: 1, | |||
pagesize: 10, | |||
sort: 'id', | |||
sortby: 'desc', | |||
keyword: '' | |||
} | |||
emit('clearData', commomParams.value.search); | |||
hideSearch() | |||
} | |||
const onClose = () => { | |||
clearSearch() | |||
hideSearch() | |||
} | |||
const statusChange = (val) => { | |||
getData() | |||
} | |||
</script> | |||
<style> | |||
</style> |
@@ -3,11 +3,9 @@ | |||
<a-typography> | |||
<a-typography-title :level="3">{{detailData.title}}</a-typography-title> | |||
<a-typography-paragraph>发布时间:{{detailData.created_at}}</a-typography-paragraph> | |||
<a-typography-text> | |||
<div v-html="detailData.content"> | |||
</div> | |||
</a-typography-text> | |||
</a-typography> | |||
<div class="ql-editor" v-html="detailData.content"> | |||
</div> | |||
</a-modal> | |||
</template> | |||