修改南通权益

This commit is contained in:
Leo_Ding 2025-06-28 20:45:13 +08:00
parent 2ae4f709b7
commit 70d5b31197
19 changed files with 2608 additions and 32 deletions

View File

@ -22,14 +22,22 @@ const rightEnum = new EnumManager([
// 创建权益类型 // 创建权益类型
const equiteEnum = new EnumManager([ const equiteEnum = new EnumManager([
{value:1, name: 'hotel'}, {value:1, name: 'hotel'},
{value:2,name:'parentchild'}, {value:3,name:'parentchild'},
{value:3,name:'jiazhuang'}, {value:4,name:'jiazhuang'},
{value:4,name:'life'}, {value:5,name:'quanwu'},
{value:5,name:'lvyou'}, {value:6,name:'menchuang'},
{value:6,name:'caizhai'},
{value:7,name:'kangyang'}, {value:7,name:'kangyang'},
{value:8,name:'fangchan'}, {value:9,name:'jdnk'},
{value:9,name:'birth'}, {value:11,name:'aiya'},
{value:12,name:'yllvs'},
{value:15,name:'birth'},
// {value:4,name:'life'},
// {value:5,name:'lvyou'},
// {value:6,name:'caizhai'},
// {value:7,name:'kangyang'},
// {value:8,name:'fangchan'},
]); ]);
export { export {
customersEnum,areaEnum,rightEnum,equiteEnum customersEnum,areaEnum,rightEnum,equiteEnum

View File

@ -1,5 +1,3 @@
export default { export default {
welcome: '欢迎', welcome: '欢迎',
home: '首页', home: '首页',
@ -63,23 +61,38 @@ export default {
rejectOrder: '确定驳回订单', rejectOrder: '确定驳回订单',
paddOrder: '过期订单', paddOrder: '过期订单',
erCodeList: '二维码列表', erCodeList: '二维码列表',
order:"权益订单", order: '权益订单',
points: '积分列表', points: '积分列表',
activity: '活动列表', activity: '活动列表',
equite:'权益兑换',
hotel:'酒店优惠',
parentChild:'亲子礼遇',
jiazhuang:'家装团购',
life:'生活服务',
lvyou:'旅游',
caizhai:'采摘及拍卖',
kangyang:'康养礼遇',
fangchan:'房产礼遇',
birth:'生日礼遇',
productExChange: '产品兑换记录', productExChange: '产品兑换记录',
houseProduct: '案场礼品', houseProduct: '案场礼品',
prizeDraw: '抽奖模块', prizeDraw: '抽奖模块',
lotteryRules: '抽奖规则', lotteryRules: '抽奖规则',
lotteryProduct: '奖品列表', lotteryProduct: '奖品列表',
lotteryOrders: '抽奖记录', lotteryOrders: '抽奖记录',
equite: '南通权益兑换',
hotel: '酒店优惠',
parentChild: '亲子礼遇',
jiazhuang: '家装团购',
life: '生活服务',
lvyou: '旅游',
caizhai: '门窗保养服务',
kangyang: '房屋精保洁',
fangchan: '南通景点年卡',
birth: '生日礼遇',
quanwu:'全屋纱窗',
aiya:'爱牙抵用卷',
yllvs:'医疗绿色',
ycequite: '盐城权益兑换',
ychotel: '酒店优惠',
ycparentChild: '亲子礼遇',
ycjiazhuang: '家装团购',
yclife: '生活服务',
yclvyou: '旅游',
yccaizhai: '采摘及拍卖',
yckangyang: '康养礼遇',
ycfangchan: '房产礼遇',
ycbirth: '生日礼遇',
} }

View File

@ -113,6 +113,39 @@ export default [
permission: '*', permission: '*',
}, },
}, },
{
path: 'quanwu',
name: 'quanwu',
component: 'equite/quanwu/index.vue',
meta: {
title: '全屋纱窗',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'aiya',
name: 'aiya',
component: 'equite/aiya/index.vue',
meta: {
title: '爱牙',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'yllvs',
name: 'yllvs',
component: 'equite/yllvs/index.vue',
meta: {
title: '医疗绿色',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
], ],
}, },
] ]

View File

@ -16,7 +16,10 @@ import announcement from './announcement'
import order from './order' import order from './order'
import activity from './activity' import activity from './activity'
import equite from './equite' import equite from './equite'
import ycequite from './ycequite'
import lottery from './lottery' import lottery from './lottery'
export default [ export default [
...home, ...home,
...form, ...form,
@ -36,5 +39,6 @@ export default [
...order, ...order,
...activity, ...activity,
...equite, ...equite,
...lottery ...lottery,
...ycequite
] ]

View File

@ -0,0 +1,118 @@
import { DollarOutlined } from '@ant-design/icons-vue'
export default [
{
path: 'ycequite',
name: 'ycequite',
component: 'RouteViewLayout',
meta: {
icon: DollarOutlined,
title: '盐城权益兑换',
isMenu: true,
keepAlive: true,
permission: '*',
},
children: [
{
path: 'ychotel',
name: 'ychotel',
component: 'ycequite/ychotel/index.vue',
meta: {
title: '酒店优惠',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'parentChild',
name: 'ycparentChild',
component: 'ycequite/ycparentChild/index.vue',
meta: {
title: '亲子权益',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'jiazhuang',
name: 'ycjiazhuang',
component: 'ycequite/jiazhuang/index.vue',
meta: {
title: '家装团购',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'life',
name: 'yclife',
component: 'ycequite/life/index.vue',
meta: {
title: '生活服务',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'lvyou',
name: 'yclvyou',
component: 'ycequite/lvyou/index.vue',
meta: {
title: '旅游待遇',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'caizhai',
name: 'yccaizhai',
component: 'ycequite/caizhai/index.vue',
meta: {
title: '采摘及拍卖',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'kangyang',
name: 'yckangyang',
component: 'ycequite/kangyang/index.vue',
meta: {
title: '康养礼遇',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'fangchan',
name: 'ycfangchan',
component: 'ycequite/fangchan/index.vue',
meta: {
title: '房产礼遇',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'birth',
name: 'ycbirth',
component: 'ycequite/birth/index.vue',
meta: {
title: '生日礼遇',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
],
},
]

View File

@ -0,0 +1,200 @@
<template>
<!-- <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item label="岗位名称" name="name">
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option value="">全部</a-select-option>
<a-select-option value="enabled">启用</a-select-option>
<a-select-option value="disabled">停用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col class="align-right" v-bind="colSpan">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'createdAt'">
<span>{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'expireAt'">
<span>{{ dayjs(record.expireAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'status'">
<a-tag color="green" v-if="record.status === 'success'">已核销</a-tag>
<a-tag v-if="record.status === 'checked'">待核销</a-tag>
</template>
<template v-if="'action' === column.key">
<x-action-button v-if="record.status==='checked'" @click="checkHandler(record)">
<a-tooltip>
<template #title>核销</template>
<edit-outlined /> </a-tooltip></x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'aiya',
})
const { t } = useI18n() // t
const columns = [
{ title: '联系人电话', dataIndex: 'conCatPhone' },
{ title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}
*/
async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.productOrder
.getProjectList({
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('aiya'),
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
}
}
/**核销 */
const checkHandler = (record) => {
Modal.confirm({
title: '即将核销是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk:async () => {
const params = {
...record,
status: 'success'
}
const { success } = await apis.productOrder.updateItem(params.id, params).catch(() => {
// throw new Error()
})
if (config('http.code.success') === success) {
// resolve()
message.success('核销成功')
await getPageList()
}
},
})
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -98,7 +98,7 @@ async function getPageList() {
pageSize, pageSize,
page: current, page: current,
channel: 'product', channel: 'product',
productId: equiteEnum.getValue('caizhai'), productId: equiteEnum.getValue('menchuang'),
...searchFormData.value, ...searchFormData.value,
}) })
.catch(() => { .catch(() => {

View File

@ -98,7 +98,7 @@ async function getPageList() {
pageSize, pageSize,
page: current, page: current,
channel: 'product', channel: 'product',
productId: equiteEnum.getValue('fangchan'), productId: equiteEnum.getValue('jdnk'),
...searchFormData.value, ...searchFormData.value,
}) })
.catch(() => { .catch(() => {

View File

@ -0,0 +1,200 @@
<template>
<!-- <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item label="岗位名称" name="name">
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option value="">全部</a-select-option>
<a-select-option value="enabled">启用</a-select-option>
<a-select-option value="disabled">停用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col class="align-right" v-bind="colSpan">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'createdAt'">
<span>{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'expireAt'">
<span>{{ dayjs(record.expireAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'status'">
<a-tag color="green" v-if="record.status === 'success'">已核销</a-tag>
<a-tag v-if="record.status === 'checked'">待核销</a-tag>
</template>
<template v-if="'action' === column.key">
<x-action-button v-if="record.status==='checked'" @click="checkHandler(record)">
<a-tooltip>
<template #title>核销</template>
<edit-outlined /> </a-tooltip></x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'birth',
})
const { t } = useI18n() // t
const columns = [
{ title: '联系人电话', dataIndex: 'conCatPhone' },
{ title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}
*/
async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.productOrder
.getProjectList({
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('quanwu'),
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
}
}
/**核销 */
const checkHandler = (record) => {
Modal.confirm({
title: '即将核销是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk:async () => {
const params = {
...record,
status: 'success'
}
const { success } = await apis.productOrder.updateItem(params.id, params).catch(() => {
// throw new Error()
})
if (config('http.code.success') === success) {
// resolve()
message.success('核销成功')
await getPageList()
}
},
})
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,200 @@
<template>
<!-- <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item label="岗位名称" name="name">
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option value="">全部</a-select-option>
<a-select-option value="enabled">启用</a-select-option>
<a-select-option value="disabled">停用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col class="align-right" v-bind="colSpan">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'createdAt'">
<span>{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'expireAt'">
<span>{{ dayjs(record.expireAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'status'">
<a-tag color="green" v-if="record.status === 'success'">已核销</a-tag>
<a-tag v-if="record.status === 'checked'">待核销</a-tag>
</template>
<template v-if="'action' === column.key">
<x-action-button v-if="record.status==='checked'" @click="checkHandler(record)">
<a-tooltip>
<template #title>核销</template>
<edit-outlined /> </a-tooltip></x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'yllvs',
})
const { t } = useI18n() // t
const columns = [
{ title: '联系人电话', dataIndex: 'conCatPhone' },
{ title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}
*/
async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.productOrder
.getProjectList({
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('yllvs'),
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
}
}
/**核销 */
const checkHandler = (record) => {
Modal.confirm({
title: '即将核销是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk:async () => {
const params = {
...record,
status: 'success'
}
const { success } = await apis.productOrder.updateItem(params.id, params).catch(() => {
// throw new Error()
})
if (config('http.code.success') === success) {
// resolve()
message.success('核销成功')
await getPageList()
}
},
})
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,200 @@
<template>
<!-- <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item label="岗位名称" name="name">
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option value="">全部</a-select-option>
<a-select-option value="enabled">启用</a-select-option>
<a-select-option value="disabled">停用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col class="align-right" v-bind="colSpan">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'createdAt'">
<span>{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'expireAt'">
<span>{{ dayjs(record.expireAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'status'">
<a-tag color="green" v-if="record.status === 'success'">已核销</a-tag>
<a-tag v-if="record.status === 'checked'">待核销</a-tag>
</template>
<template v-if="'action' === column.key">
<x-action-button v-if="record.status==='checked'" @click="checkHandler(record)">
<a-tooltip>
<template #title>核销</template>
<edit-outlined /> </a-tooltip></x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'birth',
})
const { t } = useI18n() // t
const columns = [
{ title: '联系人电话', dataIndex: 'conCatPhone' },
{ title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}
*/
async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.productOrder
.getProjectList({
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('birth'),
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
}
}
/**核销 */
const checkHandler = (record) => {
Modal.confirm({
title: '即将核销是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk:async () => {
const params = {
...record,
status: 'success'
}
const { success } = await apis.productOrder.updateItem(params.id, params).catch(() => {
// throw new Error()
})
if (config('http.code.success') === success) {
// resolve()
message.success('核销成功')
await getPageList()
}
},
})
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,200 @@
<template>
<!-- <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item label="岗位名称" name="name">
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option value="">全部</a-select-option>
<a-select-option value="enabled">启用</a-select-option>
<a-select-option value="disabled">停用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col class="align-right" v-bind="colSpan">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'createdAt'">
<span>{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'expireAt'">
<span>{{ dayjs(record.expireAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'status'">
<a-tag color="green" v-if="record.status === 'success'">已核销</a-tag>
<a-tag v-if="record.status === 'checked'">待核销</a-tag>
</template>
<template v-if="'action' === column.key">
<x-action-button v-if="record.status==='checked'" @click="checkHandler(record)">
<a-tooltip>
<template #title>核销</template>
<edit-outlined /> </a-tooltip></x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'caizhai',
})
const { t } = useI18n() // t
const columns = [
{ title: '联系人电话', dataIndex: 'conCatPhone' },
{ title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}
*/
async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.productOrder
.getProjectList({
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('caizhai'),
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
}
}
/**核销 */
const checkHandler = (record) => {
Modal.confirm({
title: '即将核销是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk:async () => {
const params = {
...record,
status: 'success'
}
const { success } = await apis.productOrder.updateItem(params.id, params).catch(() => {
// throw new Error()
})
if (config('http.code.success') === success) {
// resolve()
message.success('核销成功')
await getPageList()
}
},
})
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,200 @@
<template>
<!-- <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item label="岗位名称" name="name">
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option value="">全部</a-select-option>
<a-select-option value="enabled">启用</a-select-option>
<a-select-option value="disabled">停用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col class="align-right" v-bind="colSpan">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'createdAt'">
<span>{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'expireAt'">
<span>{{ dayjs(record.expireAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'status'">
<a-tag color="green" v-if="record.status === 'success'">已核销</a-tag>
<a-tag v-if="record.status === 'checked'">待核销</a-tag>
</template>
<template v-if="'action' === column.key">
<x-action-button v-if="record.status==='checked'" @click="checkHandler(record)">
<a-tooltip>
<template #title>核销</template>
<edit-outlined /> </a-tooltip></x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'fangchan',
})
const { t } = useI18n() // t
const columns = [
{ title: '联系人电话', dataIndex: 'conCatPhone' },
{ title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}
*/
async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.productOrder
.getProjectList({
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('fangchan'),
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
}
}
/**核销 */
const checkHandler = (record) => {
Modal.confirm({
title: '即将核销是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk:async () => {
const params = {
...record,
status: 'success'
}
const { success } = await apis.productOrder.updateItem(params.id, params).catch(() => {
// throw new Error()
})
if (config('http.code.success') === success) {
// resolve()
message.success('核销成功')
await getPageList()
}
},
})
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,200 @@
<template>
<!-- <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item label="岗位名称" name="name">
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option value="">全部</a-select-option>
<a-select-option value="enabled">启用</a-select-option>
<a-select-option value="disabled">停用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col class="align-right" v-bind="colSpan">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'createdAt'">
<span>{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'expireAt'">
<span>{{ dayjs(record.expireAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'status'">
<a-tag color="green" v-if="record.status === 'success'">已核销</a-tag>
<a-tag v-if="record.status === 'checked'">待核销</a-tag>
</template>
<template v-if="'action' === column.key">
<x-action-button v-if="record.status==='checked'" @click="checkHandler(record)">
<a-tooltip>
<template #title>核销</template>
<edit-outlined /> </a-tooltip></x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'hotel',
})
const { t } = useI18n() // t
const columns = [
{ title: '联系人电话', dataIndex: 'conCatPhone' },
{ title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}
*/
async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.productOrder
.getProjectList({
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('hotel'),
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
}
}
/**核销 */
const checkHandler = (record) => {
Modal.confirm({
title: '即将核销是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk:async () => {
const params = {
...record,
status: 'success'
}
const { success } = await apis.productOrder.updateItem(params.id, params).catch(() => {
// throw new Error()
})
if (config('http.code.success') === success) {
// resolve()
message.success('核销成功')
await getPageList()
}
},
})
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,200 @@
<template>
<!-- <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item label="岗位名称" name="name">
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option value="">全部</a-select-option>
<a-select-option value="enabled">启用</a-select-option>
<a-select-option value="disabled">停用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col class="align-right" v-bind="colSpan">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'createdAt'">
<span>{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'expireAt'">
<span>{{ dayjs(record.expireAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'status'">
<a-tag color="green" v-if="record.status === 'success'">已核销</a-tag>
<a-tag v-if="record.status === 'checked'">待核销</a-tag>
</template>
<template v-if="'action' === column.key">
<x-action-button v-if="record.status==='checked'" @click="checkHandler(record)">
<a-tooltip>
<template #title>核销</template>
<edit-outlined /> </a-tooltip></x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'jiazhuang',
})
const { t } = useI18n() // t
const columns = [
{ title: '联系人电话', dataIndex: 'conCatPhone' },
{ title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}
*/
async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.productOrder
.getProjectList({
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('jiazhuang'),
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
}
}
/**核销 */
const checkHandler = (record) => {
Modal.confirm({
title: '即将核销是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk:async () => {
const params = {
...record,
status: 'success'
}
const { success } = await apis.productOrder.updateItem(params.id, params).catch(() => {
// throw new Error()
})
if (config('http.code.success') === success) {
// resolve()
message.success('核销成功')
await getPageList()
}
},
})
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,200 @@
<template>
<!-- <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item label="岗位名称" name="name">
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option value="">全部</a-select-option>
<a-select-option value="enabled">启用</a-select-option>
<a-select-option value="disabled">停用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col class="align-right" v-bind="colSpan">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'createdAt'">
<span>{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'expireAt'">
<span>{{ dayjs(record.expireAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'status'">
<a-tag color="green" v-if="record.status === 'success'">已核销</a-tag>
<a-tag v-if="record.status === 'checked'">待核销</a-tag>
</template>
<template v-if="'action' === column.key">
<x-action-button v-if="record.status==='checked'" @click="checkHandler(record)">
<a-tooltip>
<template #title>核销</template>
<edit-outlined /> </a-tooltip></x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'kangyang',
})
const { t } = useI18n() // t
const columns = [
{ title: '联系人电话', dataIndex: 'conCatPhone' },
{ title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}
*/
async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.productOrder
.getProjectList({
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('kangyang'),
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
}
}
/**核销 */
const checkHandler = (record) => {
Modal.confirm({
title: '即将核销是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk:async () => {
const params = {
...record,
status: 'success'
}
const { success } = await apis.productOrder.updateItem(params.id, params).catch(() => {
// throw new Error()
})
if (config('http.code.success') === success) {
// resolve()
message.success('核销成功')
await getPageList()
}
},
})
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,200 @@
<template>
<!-- <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item label="岗位名称" name="name">
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option value="">全部</a-select-option>
<a-select-option value="enabled">启用</a-select-option>
<a-select-option value="disabled">停用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col class="align-right" v-bind="colSpan">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'createdAt'">
<span>{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'expireAt'">
<span>{{ dayjs(record.expireAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'status'">
<a-tag color="green" v-if="record.status === 'success'">已核销</a-tag>
<a-tag v-if="record.status === 'checked'">待核销</a-tag>
</template>
<template v-if="'action' === column.key">
<x-action-button v-if="record.status==='checked'" @click="checkHandler(record)">
<a-tooltip>
<template #title>核销</template>
<edit-outlined /> </a-tooltip></x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'life',
})
const { t } = useI18n() // t
const columns = [
{ title: '联系人电话', dataIndex: 'conCatPhone' },
{ title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}
*/
async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.productOrder
.getProjectList({
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('life'),
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
}
}
/**核销 */
const checkHandler = (record) => {
Modal.confirm({
title: '即将核销是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk:async () => {
const params = {
...record,
status: 'success'
}
const { success } = await apis.productOrder.updateItem(params.id, params).catch(() => {
// throw new Error()
})
if (config('http.code.success') === success) {
// resolve()
message.success('核销成功')
await getPageList()
}
},
})
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,200 @@
<template>
<!-- <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item label="岗位名称" name="name">
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option value="">全部</a-select-option>
<a-select-option value="enabled">启用</a-select-option>
<a-select-option value="disabled">停用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col class="align-right" v-bind="colSpan">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'createdAt'">
<span>{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'expireAt'">
<span>{{ dayjs(record.expireAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'status'">
<a-tag color="green" v-if="record.status === 'success'">已核销</a-tag>
<a-tag v-if="record.status === 'checked'">待核销</a-tag>
</template>
<template v-if="'action' === column.key">
<x-action-button v-if="record.status==='checked'" @click="checkHandler(record)">
<a-tooltip>
<template #title>核销</template>
<edit-outlined /> </a-tooltip></x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'lvyou',
})
const { t } = useI18n() // t
const columns = [
{ title: '联系人电话', dataIndex: 'conCatPhone' },
{ title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}
*/
async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.productOrder
.getProjectList({
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('lvyou'),
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
}
}
/**核销 */
const checkHandler = (record) => {
Modal.confirm({
title: '即将核销是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk:async () => {
const params = {
...record,
status: 'success'
}
const { success } = await apis.productOrder.updateItem(params.id, params).catch(() => {
// throw new Error()
})
if (config('http.code.success') === success) {
// resolve()
message.success('核销成功')
await getPageList()
}
},
})
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,200 @@
<template>
<!-- <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item label="岗位名称" name="name">
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option value="">全部</a-select-option>
<a-select-option value="enabled">启用</a-select-option>
<a-select-option value="disabled">停用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col class="align-right" v-bind="colSpan">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'createdAt'">
<span>{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'expireAt'">
<span>{{ dayjs(record.expireAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'status'">
<a-tag color="green" v-if="record.status === 'success'">已核销</a-tag>
<a-tag v-if="record.status === 'checked'">待核销</a-tag>
</template>
<template v-if="'action' === column.key">
<x-action-button v-if="record.status==='checked'" @click="checkHandler(record)">
<a-tooltip>
<template #title>核销</template>
<edit-outlined /> </a-tooltip></x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'ycparentChild',
})
const { t } = useI18n() // t
const columns = [
{ title: '联系人电话', dataIndex: 'conCatPhone' },
{ title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}
*/
async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.productOrder
.getProjectList({
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('parentchild'),
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
}
}
/**核销 */
const checkHandler = (record) => {
Modal.confirm({
title: '即将核销是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk:async () => {
const params = {
...record,
status: 'success'
}
const { success } = await apis.productOrder.updateItem(params.id, params).catch(() => {
// throw new Error()
})
if (config('http.code.success') === success) {
// resolve()
message.success('核销成功')
await getPageList()
}
},
})
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>