generated from Leo_Ding/web-template
1
This commit is contained in:
parent
28a0e90b2f
commit
3f5e002f43
14
src/apis/modules/equiteType.js
Normal file
14
src/apis/modules/equiteType.js
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* 区域模块接口
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
// 获取项目列表
|
||||
export const getProjectList = (params) => request.basic.get('/api/v1/product-categories', params)
|
||||
// 获取单挑数据
|
||||
export const getItem = (id) => request.basic.get(`/api/v1/product-categories/${id}`)
|
||||
// 添加条目
|
||||
export const createProject = (params) => request.basic.post('/api/v1/product-categories', params)
|
||||
// 更新role
|
||||
export const updateItem = (id, params) => request.basic.put(`/api/v1/product-categories/${id}`, params)
|
||||
// 删除数据
|
||||
export const delItem = (id) => request.basic.delete(`/api/v1/product-categories/${id}`)
|
||||
@ -99,5 +99,6 @@ export default {
|
||||
ycbirth: '生日礼遇',
|
||||
activityOrder:'活动报名列表',
|
||||
banner:'首页轮播图',
|
||||
equiteMgt:'权益兑换'
|
||||
equiteMgt:'权益兑换',
|
||||
equiteType:'权益兑换类型'
|
||||
}
|
||||
|
||||
@ -13,5 +13,18 @@ export default [
|
||||
permission: '*',
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
path: 'equiteType/index',
|
||||
name: 'equiteType',
|
||||
component: 'equiteType/index.vue',
|
||||
meta: {
|
||||
icon: CoffeeOutlined,
|
||||
title: '权益类型',
|
||||
isMenu: true,
|
||||
keepAlive: true,
|
||||
permission: '*',
|
||||
}
|
||||
|
||||
},
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,9 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -21,7 +21,12 @@
|
||||
<a-input :placeholder="'请输入订单电话'" v-model:value="formData.concatPhone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'排序'" name="sequence">
|
||||
<a-input-number :placeholder="'请输入排序'" style="width: 100%;"
|
||||
v-model:value="formData.sequence"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'所需积分'" name="price">
|
||||
<a-input-number :placeholder="'请输入所需积分'" style="width: 100%;"
|
||||
@ -29,8 +34,8 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'库存'" name="stock">
|
||||
<a-input-number :placeholder="'请输入库存数量'" style="width: 100%;"
|
||||
<a-form-item :label="'已兑'" name="stock">
|
||||
<a-input-number :placeholder="'请输入已兑数量'" style="width: 100%;"
|
||||
v-model:value="formData.stock"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@ -151,7 +156,8 @@ formRules.value = {
|
||||
concatName: [{ required: true, message: '请输入订单联系人' }],
|
||||
concatPhone: [{ required: true, message: '请输入订单电话' }],
|
||||
price: [{ required: true, message: '请输入所需积分' }],
|
||||
stock: [{ required: true, message: '请输入库存数量' }],
|
||||
sequence: [{ required: true, message: '请输入排序' }],
|
||||
stock: [{ required: true, message: '请输入已兑数量' }],
|
||||
maxNum: [{ required: true, message: '请输入兑换数量上限' }],
|
||||
canNum: [{ required: true, message: '请输入兑换次数上限' }],
|
||||
// details: [{ required: true, message: '请输入详情' }],
|
||||
|
||||
@ -118,7 +118,7 @@ import { PlusOutlined, EditOutlined, DeleteOutlined, QrcodeOutlined } from '@ant
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
defineOptions({
|
||||
name: 'equiteMgt',
|
||||
name: 'equiteType',
|
||||
})
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const open = ref(false)
|
||||
@ -131,7 +131,8 @@ const columns = [
|
||||
{ title: '订单联系人', dataIndex: 'concatName', width: 200 },
|
||||
{ title: '订单电话', dataIndex: 'concatPhone', width: 200 },
|
||||
{ title: '所需积分', dataIndex: 'price', width: 100, align: 'center' },
|
||||
{ title: '库存', dataIndex: 'stock', width: 100, align: 'center' },
|
||||
{ title: '已兑', dataIndex: 'stock', width: 100, align: 'center' },
|
||||
{ title: '排序', dataIndex: 'sequence', width: 100, align: 'center' },
|
||||
{ title: '兑换数量上限', dataIndex: 'maxNum', width: 120 },
|
||||
{ title: '兑换次数上限', dataIndex: 'canNum', width: 120 },
|
||||
{ title: '详情', dataIndex: 'details', align: 'center', width: 100 },
|
||||
|
||||
168
src/views/equiteType/components/EditDialog.vue
Normal file
168
src/views/equiteType/components/EditDialog.vue
Normal file
@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<a-modal :open="modal.open" :title="modal.title" :width="640" :confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose" :cancel-text="cancelText" :ok-text="okText" @ok="handleOk" @cancel="handleCancel">
|
||||
<a-spin :spinning="spining">
|
||||
<a-form ref="formRef" :model="formData" :rules="formRules">
|
||||
<a-card class="mb-8-2">
|
||||
<a-row :gutter="12">
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'名称'" name="name">
|
||||
<a-input :placeholder="'名称'" v-model:value="formData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'排序'" name="sequence">
|
||||
<a-input-number :placeholder="'请输入排序'" style="width: 100%;"
|
||||
v-model:value="formData.sequence"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'状态'" name="status">
|
||||
<a-radio-group v-model:value="formData.status" :options="[
|
||||
{ label: '启用', value: 'enabled' },
|
||||
{ label: '停用', value: 'disabled' },
|
||||
]"></a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { ref, onBeforeMount } from 'vue'
|
||||
import { config } from '@/config'
|
||||
import apis from '@/apis'
|
||||
import { useForm, useModal, useSpining } from '@/hooks'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import dayjs from 'dayjs'
|
||||
import GxUpload from '@/components/GxUpload/index.vue'
|
||||
import { spliceUrl } from '@/utils/util'
|
||||
const areaFormRef = ref()
|
||||
const emit = defineEmits(['ok'])
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
const { formRecord, formData, formRef, formRules, resetForm } = useForm()
|
||||
const { spining, showSpining, hideSpining } = useSpining()
|
||||
const cancelText = ref(t('button.cancel'))
|
||||
const okText = ref(t('button.confirm'))
|
||||
const rolesValue = ref([])
|
||||
const roles = ref([])
|
||||
const ceshi = ref('1222')
|
||||
|
||||
const areaList = ref([])
|
||||
const childOpen = ref(false)
|
||||
const fileList = ref([])
|
||||
const formArea = ref({ name: '', status: 'enabled' })
|
||||
formRules.value = {
|
||||
name: { required: true, message: '请输入案场名称' },
|
||||
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
function handleCreate() {
|
||||
showModal({
|
||||
type: 'create',
|
||||
title: '新增',
|
||||
})
|
||||
// initData()
|
||||
formData.value.status = 'enabled'
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
async function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '编辑',
|
||||
})
|
||||
try {
|
||||
showSpining()
|
||||
const { data, success } = await apis.equiteType.getItem(record.id).catch()
|
||||
if (!success) {
|
||||
hideModal()
|
||||
return
|
||||
}
|
||||
hideSpining()
|
||||
formData.value = { ...data }
|
||||
} catch (error) {
|
||||
message.error({ content: error.message })
|
||||
hideSpining()
|
||||
}
|
||||
|
||||
}
|
||||
const uploadSuccess = (data) => {
|
||||
fileList.value.push(data)
|
||||
}
|
||||
/**
|
||||
* 确定
|
||||
*/
|
||||
function handleOk() {
|
||||
formRef.value.validateFields().then(async (values) => {
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
name: formData.value.name,
|
||||
status: formData.value.status,
|
||||
sequence: formData.value.sequence
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
case 'create':
|
||||
result = await apis.equiteType.createProject(params).catch((error) => {
|
||||
throw new Error(error)
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
result = await apis.equiteType.updateItem(formData.value.id, params).catch(() => {
|
||||
throw new Error(error)
|
||||
})
|
||||
break
|
||||
}
|
||||
hideLoading()
|
||||
if (config('http.code.success') === result?.success) {
|
||||
hideModal()
|
||||
emit('ok')
|
||||
}
|
||||
} catch (error) {
|
||||
message.error({ content: error.message })
|
||||
hideLoading()
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
hideLoading()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 取消
|
||||
*/
|
||||
function handleCancel() {
|
||||
hideModal()
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭后
|
||||
*/
|
||||
function onAfterClose() {
|
||||
resetForm()
|
||||
hideLoading()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleCreate,
|
||||
handleEdit,
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
214
src/views/equiteType/index.vue
Normal file
214
src/views/equiteType/index.vue
Normal file
@ -0,0 +1,214 @@
|
||||
<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">
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button type="primary" @click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新增类型
|
||||
</a-button>
|
||||
</x-action-bar>
|
||||
<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 === 'img'">
|
||||
<a-image :width="60" :src="config('http.apiBasic')+record.img || $imageErr.imgErr" />
|
||||
</template>
|
||||
<template v-if="'status' === column.dataIndex">
|
||||
<a-tag v-if="record.status === 'enabled'" :color="'green'">启用</a-tag>
|
||||
<a-tag v-if="record.status === 'disabled'" :color="'red'">停用</a-tag>
|
||||
</template>
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
|
||||
<a-tooltip>
|
||||
<template #title> {{ $t('pages.system.user.edit') }}</template>
|
||||
<edit-outlined /> </a-tooltip></x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">
|
||||
<a-tooltip>
|
||||
<template #title>{{ $t('pages.system.delete') }}</template>
|
||||
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-modal v-model:open="qropen" :title="'生成二维码'" @ok="qropen = false" :footer="null">
|
||||
<a-card class="mb-8-2"
|
||||
style="display: flex;align-items: center;flex-direction: column;justify-content: center;">
|
||||
<x-qrCode :value="qrValue" :icon="qrlogo" :iconBackgroundColor="'#ffffff'" :size="180"></x-qrCode>
|
||||
</a-card>
|
||||
</a-modal>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import apis from '@/apis'
|
||||
import { formatUtcDateTime } from '@/utils/util'
|
||||
import { config } from '@/config'
|
||||
import { statusUserTypeEnum } from '@/enums/system'
|
||||
import { usePagination } from '@/hooks'
|
||||
import EditDialog from './components/EditDialog.vue'
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined,QrcodeOutlined } from '@ant-design/icons-vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import qrlogo from '@/assets/qrlogo.png'
|
||||
const content = ref('')
|
||||
const qrValue = ref('')
|
||||
const qropen = ref(false)
|
||||
defineOptions({
|
||||
name: 'projectList',
|
||||
})
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = [
|
||||
{ title: '名称名称', dataIndex: 'name', key: 'title' },
|
||||
{ title: '状态', dataIndex: 'status', width: 100,align:'center' },
|
||||
{ title: '排序号', dataIndex: 'sequence', width: 100,align:'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 150, 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.equiteType
|
||||
.getProjectList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value,
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (config('http.code.success') === success) {
|
||||
listData.value = data
|
||||
paginationState.total = total
|
||||
}
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
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.equiteType.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()
|
||||
}
|
||||
const createQrcode = (params) => {
|
||||
const {name,areaId,id}=params
|
||||
const item={ title:name,
|
||||
typer:'activity',
|
||||
pathUrl:'/pages/sceneDetail/index.vue',
|
||||
areaId,
|
||||
relationId:id,
|
||||
kvalue1:'',
|
||||
kvalue2:'',
|
||||
kvalue3:'',
|
||||
kvalue4:'',
|
||||
kvalue5:'',}
|
||||
qrValue.value = JSON.stringify(item)
|
||||
console.log(qrValue.value)
|
||||
qropen.value = true
|
||||
}
|
||||
/**
|
||||
* 编辑完成
|
||||
*/
|
||||
async function onOk() {
|
||||
await getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,7 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -80,6 +80,8 @@ const columns = [
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -79,6 +79,8 @@ const columns = [
|
||||
{ title: '联系人姓名', dataIndex: 'concatName' },
|
||||
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
|
||||
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
|
||||
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
|
||||
|
||||
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user