This commit is contained in:
Leo_Ding 2025-06-30 10:29:42 +08:00
parent 70d5b31197
commit fb8d8644e3
16 changed files with 896 additions and 695 deletions

View File

@ -32,7 +32,15 @@ const equiteEnum = new EnumManager([
{value:12,name:'yllvs'},
{value:15,name:'birth'},
{value:16,name:'ycjztg'},
{value:17,name:'ycqwsc'},
{value:18,name:'ycfwjbj'},
{value:19,name:'ycmcby'},
{value:20,name:'ycxwybm'},
{value:21,name:'ycjd'},
{value:23,name:'ycyllvs'},
{value:24,name:'ycparentchild'},
{value:28,name:'ycbirth'},
// {value:4,name:'life'},
// {value:5,name:'lvyou'},
// {value:6,name:'caizhai'},

View File

@ -81,18 +81,18 @@ export default {
kangyang: '房屋精保洁',
fangchan: '南通景点年卡',
birth: '生日礼遇',
quanwu:'全屋纱窗',
aiya:'爱牙抵用卷',
yllvs:'医疗绿色',
quanwu: '全屋纱窗',
aiya: '爱牙抵用卷',
yllvs: '医疗绿色',
ycequite: '盐城权益兑换',
ychotel: '酒店优惠',
ycparentChild: '亲子礼遇',
ycjiazhuang: '家装团购',
yclife: '生活服务',
yclvyou: '旅游',
yccaizhai: '采摘及拍卖',
yckangyang: '康养礼遇',
ycfangchan: '房产礼遇',
ycjztg: '家装团购',
ycqwsc: '全屋纱窗安装服务',
ycfwjbj: '房屋精保洁',
ycmcby: '门窗保养',
ycxwybm: '盐城享物业便民',
ycjd: '盐城市内景点畅玩',
ycyllvs: '医疗绿色通道',
ycparentChild: '亲子权益',
ycbirth: '生日礼遇',
}

View File

@ -14,19 +14,77 @@ export default [
},
children: [
{
path: 'ychotel',
name: 'ychotel',
component: 'ycequite/ychotel/index.vue',
path: 'ycjztg',
name: 'ycjztg',
component: 'ycequite/ycjztg/index.vue',
meta: {
title: '酒店优惠',
title: '家装团购',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'parentChild',
path: 'ycqwsc',
name: 'ycqwsc',
component: 'ycequite/ycqwsc/index.vue',
meta: {
title: '全屋纱窗安装',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'ycfwjbj',
name: 'ycfwjbj',
component: 'ycequite/ycfwjbj/index.vue',
meta: {
title: '房屋精保洁',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'ycxwybm',
name: 'ycxwybm',
component: 'ycequite/ycxwybm/index.vue',
meta: {
title: '享物业便民',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'ycjd',
name: 'ycjd',
component: 'ycequite/ycjd/index.vue',
meta: {
title: '市内景点畅玩',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'ycyllvs',
name: 'ycyllvs',
component: 'ycequite/ycyllvs/index.vue',
meta: {
title: '医疗绿色通道服务',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
{
path: 'ycparentChild',
name: 'ycparentChild',
component: 'ycequite/ycparentChild/index.vue',
meta: {
@ -36,76 +94,11 @@ export default [
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',
path: 'ycbirth',
name: 'ycbirth',
component: 'ycequite/birth/index.vue',
component: 'ycequite/ycbirth/index.vue',
meta: {
title: '生日礼遇',
isMenu: true,

View File

@ -1,200 +0,0 @@
<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

@ -1,200 +0,0 @@
<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

@ -1,200 +0,0 @@
<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

@ -71,7 +71,7 @@ import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'caizhai',
name: 'ycbirth',
})
const { t } = useI18n() // t
const columns = [
@ -98,7 +98,7 @@ async function getPageList() {
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('caizhai'),
productId: equiteEnum.getValue('ycbirth'),
...searchFormData.value,
})
.catch(() => {

View File

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

View File

@ -71,7 +71,7 @@ import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'life',
name: 'ycjd',
})
const { t } = useI18n() // t
const columns = [
@ -98,7 +98,7 @@ async function getPageList() {
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('life'),
productId: equiteEnum.getValue('ycjd'),
...searchFormData.value,
})
.catch(() => {

View File

@ -71,7 +71,7 @@ import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'hotel',
name: 'ycjztg',
})
const { t } = useI18n() // t
const columns = [
@ -98,7 +98,7 @@ async function getPageList() {
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('hotel'),
productId: equiteEnum.getValue('ycjztg'),
...searchFormData.value,
})
.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: 'ycmcby',
})
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('ycmcby'),
...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,
page: current,
channel: 'product',
productId: equiteEnum.getValue('parentchild'),
productId: equiteEnum.getValue('ycparentchild'),
...searchFormData.value,
})
.catch(() => {

View File

@ -71,7 +71,7 @@ import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { equiteEnum } from "@/enums/useEnum"
defineOptions({
name: 'lvyou',
name: 'ycqw',
})
const { t } = useI18n() // t
const columns = [
@ -98,7 +98,7 @@ async function getPageList() {
pageSize,
page: current,
channel: 'product',
productId: equiteEnum.getValue('lvyou'),
productId: equiteEnum.getValue('ycqw'),
...searchFormData.value,
})
.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: 'ycqwsc',
})
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('ycqwsc'),
...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: 'ycxwybm',
})
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('ycxwybm'),
...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: 'ycyllvs',
})
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('ycyllvs'),
...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>