generated from Leo_Ding/web-template
Compare commits
No commits in common. "master" and "main" have entirely different histories.
1
.env.dev
1
.env.dev
@ -12,7 +12,6 @@ VITE_ROUTER_BASE=/
|
|||||||
VITE_ROUTER_HISTORY=hash
|
VITE_ROUTER_HISTORY=hash
|
||||||
|
|
||||||
# api
|
# api
|
||||||
# VITE_API_BASIC=https://jinshan.nantong.info
|
|
||||||
VITE_API_BASIC=http://10.10.1.6:8071
|
VITE_API_BASIC=http://10.10.1.6:8071
|
||||||
VITE_API_HTTP=/api/v1/
|
VITE_API_HTTP=/api/v1/
|
||||||
# storage
|
# storage
|
||||||
|
|||||||
@ -4,14 +4,14 @@ NODE_ENV=production
|
|||||||
# app
|
# app
|
||||||
VITE_TITLE=JinShan-Admin
|
VITE_TITLE=JinShan-Admin
|
||||||
VITE_PUBLIC_PATH=/
|
VITE_PUBLIC_PATH=/
|
||||||
VITE_OUT_DIR=index
|
VITE_OUT_DIR=dist
|
||||||
VITE_PERMISSION=true
|
VITE_PERMISSION=true
|
||||||
|
|
||||||
# router
|
# router
|
||||||
VITE_ROUTER_HISTORY=hash
|
VITE_ROUTER_HISTORY=hash
|
||||||
|
|
||||||
# api
|
# api
|
||||||
VITE_API_BASIC=https://jinshan.nantong.info
|
VITE_API_BASIC=/
|
||||||
VITE_API_HTTP=/api/v1/
|
VITE_API_HTTP=/api/v1/
|
||||||
|
|
||||||
# storage
|
# storage
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,7 +9,6 @@ lerna-debug.log*
|
|||||||
|
|
||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
index
|
|
||||||
dist-ssr
|
dist-ssr
|
||||||
*.local
|
*.local
|
||||||
*/.vitepress/cache/**/*
|
*/.vitepress/cache/**/*
|
||||||
|
|||||||
@ -13,6 +13,4 @@ export const updateItem = (id, params) => request.basic.put(`/api/v1/activities/
|
|||||||
// 删除数据
|
// 删除数据
|
||||||
export const delItem = (id) => request.basic.delete(`/api/v1/activities/${id}`)
|
export const delItem = (id) => request.basic.delete(`/api/v1/activities/${id}`)
|
||||||
//获取活动报名列表
|
//获取活动报名列表
|
||||||
export const getActivityList = (params) => request.basic.get('/api/v1/activity-registers', params)
|
export const getActivityList=(params)=>request.basic.get('/api/v1/activity-details',params)
|
||||||
// 导出文件
|
|
||||||
export const exportFile = (params) => request.basic.get('/api/v1/activity-registers/export', params, { responseType: 'blob' })
|
|
||||||
@ -6,9 +6,6 @@ export const getRegion = (params) => request.basic.get('/region', params)
|
|||||||
// 获取 验证码ID
|
// 获取 验证码ID
|
||||||
export const getCaptcha = (params) => request.basic.get('/api/v1/captcha/id', params)
|
export const getCaptcha = (params) => request.basic.get('/api/v1/captcha/id', params)
|
||||||
|
|
||||||
// 获取图片
|
|
||||||
export const getCaptchaImage = (params) => request.basic.get('/api/v1/captcha/image', params , { responseType: 'blob' })
|
|
||||||
|
|
||||||
//上传图片
|
//上传图片
|
||||||
export const uploadFile=(params)=>request.basic.post('/api/v1/upload',params,{
|
export const uploadFile=(params)=>request.basic.post('/api/v1/upload',params,{
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
/**
|
|
||||||
* 图片管理接口
|
|
||||||
*/
|
|
||||||
import request from '@/utils/request'
|
|
||||||
// 获取列表
|
|
||||||
export const getDataList = (params) => request.basic.get('/api/v1/order-areas', params)
|
|
||||||
// 获取菜单条数据
|
|
||||||
export const getMenu = (id) => request.basic.get(`/api/v1/order-areas/${id}`)
|
|
||||||
// 添加菜单
|
|
||||||
export const createMenu = (params) => request.basic.post('/api/v1/order-areas', params)
|
|
||||||
// 更新菜单
|
|
||||||
export const updateMenu = (id, params) => request.basic.put(`/api/v1/order-areas/${id}`, params)
|
|
||||||
// 删除菜单
|
|
||||||
export const delMenu = (id) => request.basic.delete(`/api/v1/order-areas/${id}`)
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
/**
|
|
||||||
* 区域模块接口
|
|
||||||
*/
|
|
||||||
import request from '@/utils/request'
|
|
||||||
// 获取项目列表
|
|
||||||
export const getElectionList = (params) => request.basic.get('/api/v1/election-registrations', params)
|
|
||||||
// 获取单挑数据
|
|
||||||
export const getItem = (id) => request.basic.get(`/api/v1/activities/${id}`)
|
|
||||||
// 添加条目
|
|
||||||
export const createProject = (params) => request.basic.post('/api/v1/activities', params)
|
|
||||||
// 更新role
|
|
||||||
export const updateItem = (id, params) => request.basic.put(`/api/v1/activities/${id}`, params)
|
|
||||||
// 删除数据
|
|
||||||
export const delItem = (id) => request.basic.delete(`/api/v1/activities/${id}`)
|
|
||||||
//获取活动报名列表
|
|
||||||
export const getActivityList = (params) => request.basic.get('/api/v1/activity-registers', params)
|
|
||||||
// 导出文件
|
|
||||||
export const exportFile = (params) => request.basic.get('/api/v1/election-registrations/export', params, { responseType: 'blob' })
|
|
||||||
@ -21,7 +21,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "7414004",
|
"icon_id": "7414004",
|
||||||
"name": "会客厅",
|
"name": "会议室",
|
||||||
"font_class": "huiyishi1",
|
"font_class": "huiyishi1",
|
||||||
"unicode": "e60a",
|
"unicode": "e60a",
|
||||||
"unicode_decimal": 58890
|
"unicode_decimal": 58890
|
||||||
@ -35,7 +35,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "4942645",
|
"icon_id": "4942645",
|
||||||
"name": "会客厅",
|
"name": "会议室",
|
||||||
"font_class": "huiyishi",
|
"font_class": "huiyishi",
|
||||||
"unicode": "e614",
|
"unicode": "e614",
|
||||||
"unicode_decimal": 58900
|
"unicode_decimal": 58900
|
||||||
|
|||||||
@ -136,7 +136,6 @@ const handleChange = ({ file, fileList: updatedList }) => {
|
|||||||
|
|
||||||
// 修复自定义上传方法
|
// 修复自定义上传方法
|
||||||
const handleCustomRequest = async (options) => {
|
const handleCustomRequest = async (options) => {
|
||||||
console.log("==options",options)
|
|
||||||
const { file, onProgress, onSuccess, onError } = options;
|
const { file, onProgress, onSuccess, onError } = options;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -42,7 +42,7 @@ const workTypeStatus = new EnumManager([
|
|||||||
{ value: 98, name: '禁用', color: '#bfbfbf' }, // 灰色(失效色)
|
{ value: 98, name: '禁用', color: '#bfbfbf' }, // 灰色(失效色)
|
||||||
{ value: 99, name: '审核不通过', color: '#ff4d4f' } // 红色(错误色)
|
{ value: 99, name: '审核不通过', color: '#ff4d4f' } // 红色(错误色)
|
||||||
])
|
])
|
||||||
//会客厅类型状态
|
//会议室类型状态
|
||||||
const mettingStatus = new EnumManager([
|
const mettingStatus = new EnumManager([
|
||||||
{ value: 1, name: '待审核', color: '#faad14' }, // 黄色(警告色)
|
{ value: 1, name: '待审核', color: '#faad14' }, // 黄色(警告色)
|
||||||
{ value: 2, name: '启用中', color: '#52c41a' }, // 绿色(进行中)
|
{ value: 2, name: '启用中', color: '#52c41a' }, // 绿色(进行中)
|
||||||
|
|||||||
@ -45,12 +45,9 @@ export default {
|
|||||||
server:'周边服务',
|
server:'周边服务',
|
||||||
serverList: '门店列表',
|
serverList: '门店列表',
|
||||||
serverType: '门店分类',
|
serverType: '门店分类',
|
||||||
mettingMgt:'城市会客厅管理',
|
mettingMgt:'会议室管理',
|
||||||
mettingRoom:'城市会客厅',
|
mettingRoom:'会议室列表',
|
||||||
mettingYuYue:'预约记录',
|
mettingYuYue:'预约记录',
|
||||||
customer:'用户管理',
|
customer:'用户管理',
|
||||||
aiHelper:'AI助手',
|
aiHelper:'AI助手'
|
||||||
abbreviation:'活动报名',
|
|
||||||
orderArea:'工单区域管理',
|
|
||||||
vote:'信息登记',
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,18 +135,6 @@ export default [
|
|||||||
permission: '*',
|
permission: '*',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: 'workOrder/orderArea',
|
|
||||||
name: 'orderArea',
|
|
||||||
component: 'pages/workOrder/orderArea/index.vue',
|
|
||||||
meta: {
|
|
||||||
icon: '',
|
|
||||||
title: '工单区域管理',
|
|
||||||
isMenu: true,
|
|
||||||
keepAlive: true,
|
|
||||||
permission: '*',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -193,7 +181,7 @@ export default [
|
|||||||
component: 'RouteViewLayout',
|
component: 'RouteViewLayout',
|
||||||
meta: {
|
meta: {
|
||||||
icon: 'icon-huiyishi1',
|
icon: 'icon-huiyishi1',
|
||||||
title: '会客厅管理',
|
title: '会议室管理',
|
||||||
isMenu: true,
|
isMenu: true,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
permission: '*',
|
permission: '*',
|
||||||
@ -205,7 +193,7 @@ export default [
|
|||||||
component: 'pages/mettingMgt/mettingList/index.vue',
|
component: 'pages/mettingMgt/mettingList/index.vue',
|
||||||
meta: {
|
meta: {
|
||||||
icon: '',
|
icon: '',
|
||||||
title: '会客厅',
|
title: '会议室',
|
||||||
isMenu: true,
|
isMenu: true,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
permission: '*',
|
permission: '*',
|
||||||
@ -217,7 +205,7 @@ export default [
|
|||||||
component: 'pages/mettingMgt/mettingYuYue/index.vue',
|
component: 'pages/mettingMgt/mettingYuYue/index.vue',
|
||||||
meta: {
|
meta: {
|
||||||
icon: '',
|
icon: '',
|
||||||
title: '会客厅预约',
|
title: '会议室预约',
|
||||||
isMenu: true,
|
isMenu: true,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
permission: '*',
|
permission: '*',
|
||||||
@ -237,28 +225,4 @@ export default [
|
|||||||
permission: '*',
|
permission: '*',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: 'abbreviation/index',
|
|
||||||
name: 'abbreviation',
|
|
||||||
component: 'pages/abbreviationList/index.vue',
|
|
||||||
meta: {
|
|
||||||
icon: 'icon-yonghu',
|
|
||||||
title: '活动报名',
|
|
||||||
isMenu: true,
|
|
||||||
keepAlive: true,
|
|
||||||
permission: '*',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'vote/index',
|
|
||||||
name: 'vote',
|
|
||||||
component: 'pages/vote/index.vue',
|
|
||||||
meta: {
|
|
||||||
icon: 'icon-yonghu',
|
|
||||||
title: '信息登记',
|
|
||||||
isMenu: true,
|
|
||||||
keepAlive: true,
|
|
||||||
permission: '*',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
|
|||||||
@ -10,7 +10,6 @@ const MSG_ERROR_KEY = Symbol('GLOBAL_ERROR')
|
|||||||
const options = {
|
const options = {
|
||||||
enableAbortController: true,
|
enableAbortController: true,
|
||||||
interceptorRequest: (request) => {
|
interceptorRequest: (request) => {
|
||||||
console.log('interceptorRequest', request)
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const isLogin = userStore.isLogin
|
const isLogin = userStore.isLogin
|
||||||
const token = userStore.token
|
const token = userStore.token
|
||||||
@ -21,10 +20,9 @@ const options = {
|
|||||||
},
|
},
|
||||||
interceptorRequestCatch: () => {},
|
interceptorRequestCatch: () => {},
|
||||||
interceptorResponse: (response) => {
|
interceptorResponse: (response) => {
|
||||||
const list=['/api/v1/activity-registers/export', '/api/v1/captcha/image','/api/v1/election-registrations/export']
|
|
||||||
// 错误处理
|
// 错误处理
|
||||||
const { success, msg = 'Network Error' } = response.data || {}
|
const { success, msg = 'Network Error' } = response.data || {}
|
||||||
if (![true].includes(success) && !list.includes(response.config.url)) {
|
if (![true].includes(success)) {
|
||||||
message.error({
|
message.error({
|
||||||
content: msg,
|
content: msg,
|
||||||
key: MSG_ERROR_KEY,
|
key: MSG_ERROR_KEY,
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-input>
|
</a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item name="captcha_code">
|
<!-- <a-form-item name="captcha_code">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-input v-model:value="formData.captcha_code" size="large" type="text"
|
<a-input v-model:value="formData.captcha_code" size="large" type="text"
|
||||||
:placeholder="$t('pages.login.captcha.placeholder')" @pressEnter="handleLogin">
|
:placeholder="$t('pages.login.captcha.placeholder')" @pressEnter="handleLogin">
|
||||||
@ -31,7 +31,7 @@
|
|||||||
<a-image @click="getCaptcha" :preview="false" :width="140" :height="42"
|
<a-image @click="getCaptcha" :preview="false" :width="140" :height="42"
|
||||||
:src="captcha_img" />
|
:src="captcha_img" />
|
||||||
</a-space>
|
</a-space>
|
||||||
</a-form-item>
|
</a-form-item> -->
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-button type="primary" size="large" block :loading="loading" @click="handleLogin">{{
|
<a-button type="primary" size="large" block :loading="loading" @click="handleLogin">{{
|
||||||
$t('pages.login.submit') }}
|
$t('pages.login.submit') }}
|
||||||
@ -44,7 +44,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { Modal, notification, message } from 'ant-design-vue'
|
import { Modal, notification } from 'ant-design-vue'
|
||||||
import { computed, onMounted, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import { LockOutlined, UserOutlined, SafetyOutlined } from '@ant-design/icons-vue'
|
import { LockOutlined, UserOutlined, SafetyOutlined } from '@ant-design/icons-vue'
|
||||||
@ -87,24 +87,11 @@ onMounted(() => {
|
|||||||
* 获取 验证码ID
|
* 获取 验证码ID
|
||||||
*/
|
*/
|
||||||
async function getCaptcha() {
|
async function getCaptcha() {
|
||||||
try {
|
const { data } = await apis.common.getCaptcha().catch((err) => {
|
||||||
// 1. 获取 captcha_id
|
console.log(err)
|
||||||
const response = await apis.common.getCaptcha()
|
})
|
||||||
const data = response.data
|
captcha_id.value = data.captcha_id
|
||||||
if (!data?.captcha_id) {
|
captcha_img.value = httpApi + `?id=${data.captcha_id}`
|
||||||
console.warn('验证码ID缺失')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
captcha_id.value = data.captcha_id
|
|
||||||
const imageResponse = await apis.common.getCaptchaImage({ id: data.captcha_id })
|
|
||||||
console.log('Blob 对象:', imageResponse)
|
|
||||||
const blobUrl = URL.createObjectURL(imageResponse)
|
|
||||||
captcha_img.value = blobUrl
|
|
||||||
console.log('验证码图片URL:', blobUrl)
|
|
||||||
} catch (err) {
|
|
||||||
console.error('获取验证码失败:', err)
|
|
||||||
captcha_img.value = ''
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 登录
|
* 登录
|
||||||
@ -113,33 +100,26 @@ async function getCaptcha() {
|
|||||||
async function handleLogin() {
|
async function handleLogin() {
|
||||||
formRef.value.validate().then(async (values) => {
|
formRef.value.validate().then(async (values) => {
|
||||||
values.captcha_id = captcha_id.value
|
values.captcha_id = captcha_id.value
|
||||||
if (values.password === 'abc-123') {
|
if (values.password === 'abc-123') values.password = md5(values.password)
|
||||||
values.password = md5(values.password)
|
|
||||||
}
|
|
||||||
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
const { success } = await userStore
|
||||||
const response = await userStore.login({ ...values })
|
.login({
|
||||||
loading.value = false
|
...values,
|
||||||
if (config('http.code.success') === response.success) {
|
})
|
||||||
if (appStore.complete) {
|
.catch(() => {
|
||||||
goIndex()
|
loading.value = false
|
||||||
} else {
|
getCaptcha()
|
||||||
await appStore.init()
|
})
|
||||||
goIndex()
|
loading.value = false
|
||||||
}
|
if (config('http.code.success') === success) {
|
||||||
|
// 加载完成
|
||||||
|
if (appStore.complete) {
|
||||||
|
goIndex()
|
||||||
} else {
|
} else {
|
||||||
message.error(t(response.msg))
|
await appStore.init()
|
||||||
|
goIndex()
|
||||||
}
|
}
|
||||||
} catch (error) {
|
|
||||||
loading.value = false
|
|
||||||
getCaptcha()
|
|
||||||
const msg = error.msg || error.message || '登录失败,请重试'
|
|
||||||
message.error(t(msg))
|
|
||||||
console.log("登录出错:", error)
|
|
||||||
}
|
}
|
||||||
}).catch(validationError => {
|
|
||||||
console.log('表单校验失败', validationError)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,251 +0,0 @@
|
|||||||
<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-tabs v-model:activeKey="activeKey">
|
|
||||||
<a-tab-pane key="1" tab="基本信息">
|
|
||||||
<a-row :gutter="12">
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'产品分类'" name="typeId">
|
|
||||||
<a-select ref="select" v-model:value="formData.typeId" style="width: 100%">
|
|
||||||
<a-select-option v-for="item in typeList" :value="item.value">{{
|
|
||||||
item.label }}</a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'产品排序'" name="sequence">
|
|
||||||
<a-input-number :placeholder="'请输入排序'" v-model:value="formData.sequence"
|
|
||||||
style="width: 100%;"></a-input-number>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'门店名称'" name="storeName">
|
|
||||||
<a-input :placeholder="'请输入门店名称'" v-model:value="formData.storeName"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'营业时间'" name="openAt">
|
|
||||||
<a-input :placeholder="'请输入营业时间'" v-model:value="formData.openAt"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'联系电话'" name="openAt">
|
|
||||||
<a-input :placeholder="'请输入联系电话'" v-model:value="formData.concatPhone"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'标签'" name="labels">
|
|
||||||
<a-select v-model:value="formData.labels" mode="tags" style="width: 100%"
|
|
||||||
placeholder="输入标签然后回车"></a-select>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'状态'" name="status">
|
|
||||||
<a-radio-group v-model:value="formData.status" :options="storeStatus.getAll()"
|
|
||||||
disabled></a-radio-group>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'店铺描述'" name="content">
|
|
||||||
<a-textarea :placeholder="'请输入店铺描述'" v-model:value="formData.content"
|
|
||||||
:auto-size="{ minRows: 2, maxRows: 5 }"></a-textarea>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-form-item :label="'店铺封面'" name="storeCover">
|
|
||||||
<gx-upload v-model="formData.storeCover" accept-types=".jpg,.png,.webp"
|
|
||||||
:fileNumber="1" />
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-form-item :label="'详情图片'" name="imgs">
|
|
||||||
<gx-upload v-model="formData.img" accept-types=".jpg,.png,.webp"
|
|
||||||
:fileNumber="10" />
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
</a-tab-pane>
|
|
||||||
<a-tab-pane key="2" tab="位置信息">
|
|
||||||
<a-row :gutter="12">
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-form-item :label="'经度'" name="longitude">
|
|
||||||
<a-input :placeholder="'请输入经度'" v-model:value="formData.longitude"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-form-item :label="'纬度'" name="latitude">
|
|
||||||
<a-input :placeholder="'请输入纬度'" v-model:value="formData.latitude"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'详细地址'" name="storeAddress">
|
|
||||||
<a-input :placeholder="'请输入详细地址'"
|
|
||||||
v-model:value="formData.storeAddress"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<gx-map @handleGetLng="handleGetLng" />
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
</a-tab-pane>
|
|
||||||
</a-tabs>
|
|
||||||
|
|
||||||
|
|
||||||
</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 { storeStatus } from '@/enums/index.js'
|
|
||||||
import { spliceUrl } from '@/utils/util'
|
|
||||||
import { init } from 'echarts'
|
|
||||||
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 typeList = ref([])
|
|
||||||
const searchValue = ref('')
|
|
||||||
const activeKey = ref('1')
|
|
||||||
formRules.value = {
|
|
||||||
typeId: [{ required: true, message: '请选择产品类别名称', trigger: 'change' }],
|
|
||||||
sequence: { required: true, message: '请输入排序' },
|
|
||||||
storeName: { required: true, message: '请输入门店名称' },
|
|
||||||
longitude: { required: true, message: '请输入经度' },
|
|
||||||
latitude: { required: true, message: '请输入纬度' },
|
|
||||||
storeAddress: { required: true, message: '请输入门店地址' },
|
|
||||||
status: { required: true, message: '请选择状态', trigger: 'change' }
|
|
||||||
}
|
|
||||||
const initData = async () => {
|
|
||||||
try {
|
|
||||||
showSpining()
|
|
||||||
const { data, success } = await apis.serverType.getDataList({ pageSize: 99, current: 1 })
|
|
||||||
if (success) {
|
|
||||||
typeList.value = data.map(item => ({ value: item.id, label: item.label }))
|
|
||||||
hideSpining()
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
hideSpining()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 新建
|
|
||||||
*/
|
|
||||||
function handleCreate() {
|
|
||||||
showModal({
|
|
||||||
type: 'create',
|
|
||||||
title: '新增',
|
|
||||||
})
|
|
||||||
initData()
|
|
||||||
formData.value.status = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*/
|
|
||||||
async function handleEdit(record = {}) {
|
|
||||||
showModal({
|
|
||||||
type: 'edit',
|
|
||||||
title: '编辑',
|
|
||||||
})
|
|
||||||
const { data, success } = await apis.serverList.getMenu(record.id).catch()
|
|
||||||
if (!success) {
|
|
||||||
hideModal()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
formData.value = { ...data }
|
|
||||||
formData.value.storeCover = data.storeCover ? [config('http.apiBasic') + data.storeCover] : []
|
|
||||||
formData.value.img = data.imgs?.map(url => config('http.apiBasic') + url) || []
|
|
||||||
initData()
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 确定
|
|
||||||
*/
|
|
||||||
function handleOk() {
|
|
||||||
formRef.value.validateFields().then(async (values) => {
|
|
||||||
try {
|
|
||||||
showLoading()
|
|
||||||
console.log(formData.value)
|
|
||||||
const params = {
|
|
||||||
...values,
|
|
||||||
storeCover: formData.value.storeCover ? spliceUrl(formData.value.storeCover[0]) : '',
|
|
||||||
imgs: formData.value.img?.map(url => spliceUrl(url)) || [],
|
|
||||||
latitude: parseFloat(formData.value.latitude),
|
|
||||||
longitude: parseFloat(formData.value.longitude),
|
|
||||||
status: 1
|
|
||||||
}
|
|
||||||
console.log("====",params)
|
|
||||||
let result = null
|
|
||||||
switch (modal.value.type) {
|
|
||||||
case 'create':
|
|
||||||
result = await apis.serverList.createMenu(params).catch((error) => {
|
|
||||||
throw new Error(error)
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 'edit':
|
|
||||||
result = await apis.serverList.updateMenu(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) => {
|
|
||||||
console.log(e)
|
|
||||||
hideLoading()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const handleGetLng = (obj = {}) => {
|
|
||||||
formData.value.longitude = obj.lng
|
|
||||||
formData.value.latitude = obj.lat
|
|
||||||
formData.value.storeAddress = obj.address
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消
|
|
||||||
*/
|
|
||||||
function handleCancel() {
|
|
||||||
hideModal()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关闭后
|
|
||||||
*/
|
|
||||||
function onAfterClose() {
|
|
||||||
resetForm()
|
|
||||||
hideLoading()
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
handleCreate,
|
|
||||||
handleEdit,
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
|
||||||
@ -1,283 +0,0 @@
|
|||||||
<template>
|
|
||||||
<x-search-bar class="mb-8-2">
|
|
||||||
<template #default="{ gutter, colSpan }">
|
|
||||||
<a-form :model="searchFormData" layout="inline">
|
|
||||||
<a-row :gutter="12">
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-form-item label="活动名称" name="name">
|
|
||||||
<a-select v-model:value="searchFormData.activityId">
|
|
||||||
<a-select-option v-for="item of activityList" :value="item.id">{{ item.title
|
|
||||||
}}</a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col class="align-right" :span="12">
|
|
||||||
<a-space>
|
|
||||||
<a-button @click="handleExport">导出文件</a-button>
|
|
||||||
<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" @change="onTableChange">
|
|
||||||
<template #bodyCell="{ column, record }">
|
|
||||||
<template v-if="'createdAt' === column.dataIndex">
|
|
||||||
{{ dayjs(record.createdAt).format('YYYY-MM-DD') }}
|
|
||||||
</template>
|
|
||||||
<template v-if="'ActivityCover' === column.dataIndex">
|
|
||||||
<a-image :width="60"
|
|
||||||
:src="record.ActivityCover ? config('http.apiBasic') + record.ActivityCover : errImg" />
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</a-table>
|
|
||||||
</a-card>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-modal v-model:open="open" :title="'审核'" @ok="handleClick">
|
|
||||||
<a-card class="mb-8-2">
|
|
||||||
|
|
||||||
<a-form-item label="审核" name="">
|
|
||||||
<a-radio-group v-model:value="auditStatus">
|
|
||||||
<a-radio :value="2">通过</a-radio>
|
|
||||||
<a-radio :value="99">不通过</a-radio>
|
|
||||||
</a-radio-group>
|
|
||||||
</a-form-item>
|
|
||||||
|
|
||||||
<a-form-item label="备注" name="">
|
|
||||||
<a-textarea :placeholder="'请输入审核备注'" v-model:value="remark"
|
|
||||||
:auto-size="{ minRows: 2, maxRows: 5 }"></a-textarea>
|
|
||||||
</a-form-item>
|
|
||||||
|
|
||||||
</a-card>
|
|
||||||
</a-modal>
|
|
||||||
<a-modal v-model:open="imgOpen" :title="'图片/视频'" @ok="imgOpen = false">
|
|
||||||
<a-card class="mb-8-2">
|
|
||||||
<a-form-item :label="'图片'" name="images">
|
|
||||||
<template v-if="currentInfo.images && currentInfo.images.length > 0">
|
|
||||||
<a-image-preview-group>
|
|
||||||
<a-image v-for="item in currentInfo.images" :width="200"
|
|
||||||
:src="config('http.apiBasic') + item" />
|
|
||||||
</a-image-preview-group>
|
|
||||||
</template>
|
|
||||||
<template v-else>暂无</template>
|
|
||||||
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="视频" name="video">
|
|
||||||
<template v-if="currentInfo.videos && currentInfo.videos.length > 0">
|
|
||||||
<video width="320" height="240" controls>
|
|
||||||
<source v-for="item in currentInfo.videos" :src="config('http.apiBasic') + item">
|
|
||||||
</video>
|
|
||||||
</template>
|
|
||||||
<template>暂无</template>
|
|
||||||
</a-form-item>
|
|
||||||
</a-card>
|
|
||||||
</a-modal>
|
|
||||||
</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 dayjs from 'dayjs'
|
|
||||||
import EditDialog from './components/EditDialog.vue'
|
|
||||||
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
|
||||||
import { useI18n } from 'vue-i18n'
|
|
||||||
import { orderStatus } from '@/enums/index.js'
|
|
||||||
import { status } from 'nprogress'
|
|
||||||
defineOptions({
|
|
||||||
name: 'orderList',
|
|
||||||
})
|
|
||||||
const { t } = useI18n() // 解构出t方法
|
|
||||||
const columns = [
|
|
||||||
{ title: '用户名', dataIndex: 'customerName' },
|
|
||||||
{ title: '联系方式', dataIndex: 'customerPhone' },
|
|
||||||
{ title: '报名时间', dataIndex: 'createdAt', width: 200, align: 'center' },
|
|
||||||
{ title: '活动名称', dataIndex: 'ActivityTitle' },
|
|
||||||
{ title: '活动封面图', dataIndex: 'ActivityCover', width: 200 },
|
|
||||||
|
|
||||||
]
|
|
||||||
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
|
|
||||||
const remark = ref('')
|
|
||||||
const currentInfo = ref({})
|
|
||||||
const auditStatus = ref(2)
|
|
||||||
const editDialogRef = ref()
|
|
||||||
const open = ref(false)
|
|
||||||
const imgOpen = ref(false)
|
|
||||||
const activityList = ref([])
|
|
||||||
|
|
||||||
getPageList()
|
|
||||||
getActiveList()
|
|
||||||
/**
|
|
||||||
* 获取活动报名列表
|
|
||||||
* @returns {Promise<void>}
|
|
||||||
*/
|
|
||||||
async function getPageList() {
|
|
||||||
try {
|
|
||||||
showLoading()
|
|
||||||
const { pageSize, current } = paginationState
|
|
||||||
const { success, data, total } = await apis.activity
|
|
||||||
.getActivityList({
|
|
||||||
pageSize,
|
|
||||||
current: current,
|
|
||||||
...searchFormData.value,
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
throw new Error()
|
|
||||||
})
|
|
||||||
hideLoading()
|
|
||||||
if (config('http.code.success') === success) {
|
|
||||||
listData.value = data.map(item => ({
|
|
||||||
...item,
|
|
||||||
key: item.value,
|
|
||||||
}))
|
|
||||||
paginationState.total = total
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
hideLoading()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 获取活动列表
|
|
||||||
async function getActiveList() {
|
|
||||||
try {
|
|
||||||
showLoading()
|
|
||||||
const { success, data } = await apis.activity
|
|
||||||
.getProjectList({
|
|
||||||
pageSize: 99,
|
|
||||||
current: 1,
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
throw new Error()
|
|
||||||
})
|
|
||||||
hideLoading()
|
|
||||||
if (config('http.code.success') === success) {
|
|
||||||
activityList.value = data.map(item => ({ id: item.id, title: item.title }))
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
hideLoading()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 下载文件
|
|
||||||
*/
|
|
||||||
async function handleExport() {
|
|
||||||
try {
|
|
||||||
const activityId = searchFormData.value.activityId
|
|
||||||
if (!activityId) {
|
|
||||||
message.warning('请选择活动')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 注意添加 { responseType: 'blob' }
|
|
||||||
const response = await apis.activity.exportFile({ activityId })
|
|
||||||
console.log(response)
|
|
||||||
const url = window.URL.createObjectURL(new Blob([response]))
|
|
||||||
const link = document.createElement('a')
|
|
||||||
link.href = url
|
|
||||||
link.setAttribute('download', '报名表.xlsx') // 设置下载文件名
|
|
||||||
document.body.appendChild(link)
|
|
||||||
link.click()
|
|
||||||
document.body.removeChild(link)
|
|
||||||
window.URL.revokeObjectURL(url)
|
|
||||||
} catch (error) {
|
|
||||||
// message.error('导出失败:' + (error.message || '未知错误'))
|
|
||||||
// console.error('导出文件出错:', error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const handleClick = async () => {
|
|
||||||
try {
|
|
||||||
const params = {
|
|
||||||
...currentInfo.value,
|
|
||||||
status: auditStatus.value,
|
|
||||||
remark: remark.value
|
|
||||||
}
|
|
||||||
const result = await apis.orderList.updateMenu(currentInfo.value.id, params).catch(() => {
|
|
||||||
throw new Error(error)
|
|
||||||
})
|
|
||||||
if (config('http.code.success') === result?.success) {
|
|
||||||
message.success('已审核')
|
|
||||||
open.value = false
|
|
||||||
getPageList()
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
message.error({ content: error.message })
|
|
||||||
hideLoading()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
function handleDelete(value) {
|
|
||||||
Modal.confirm({
|
|
||||||
title: '确定撤销该工单吗',
|
|
||||||
content: t('button.confirm'),
|
|
||||||
okText: t('button.confirm'),
|
|
||||||
onOk: () => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
; (async () => {
|
|
||||||
try {
|
|
||||||
const params = {
|
|
||||||
...value,
|
|
||||||
status: 98
|
|
||||||
}
|
|
||||||
console.log(params)
|
|
||||||
const { success } = await apis.orderList.updateMenu(value.id, params).catch(() => {
|
|
||||||
throw new Error()
|
|
||||||
})
|
|
||||||
if (config('http.code.success') === success) {
|
|
||||||
resolve()
|
|
||||||
message.success('撤销成功')
|
|
||||||
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>
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-modal :open="modal.open" :title="modal.title" :width="640" :confirm-loading="modal.confirmLoading"
|
<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">
|
:after-close="onAfterClose" :cancel-text="cancelText" :ok-text="okText" @ok="handleOk" @cancel="handleCancel" >
|
||||||
<a-spin :spinning="spining">
|
<a-spin :spinning="spining">
|
||||||
<a-form ref="formRef" :model="formData" :rules="formRules">
|
<a-form ref="formRef" :model="formData" :rules="formRules">
|
||||||
<a-card class="mb-8-2">
|
<a-card class="mb-8-2">
|
||||||
@ -10,67 +10,32 @@
|
|||||||
<a-input :placeholder="'请输入活动标题'" v-model:value="formData.title"></a-input>
|
<a-input :placeholder="'请输入活动标题'" v-model:value="formData.title"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'活动内容'" name="content">
|
<a-form-item :label="'活动内容'" name="content">
|
||||||
<x-editor v-model="formData.content"></x-editor>
|
<x-editor v-model="formData.content"></x-editor>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'报名截止时间'" name="endSignupAt">
|
<a-form-item :label="'活动时间'" name="openAt">
|
||||||
<a-date-picker
|
<a-input v-model:value="formData.openAt" placeholder="请输入活动时间" />
|
||||||
v-model:value="formData.endSignupAt"
|
|
||||||
placeholder="请输入报名截止时间"
|
|
||||||
style="width: 100%;"
|
|
||||||
show-time
|
|
||||||
:format="displayFormat"
|
|
||||||
:value-format="valueFormat"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="活动开始时间" name="startAt">
|
|
||||||
<a-date-picker
|
|
||||||
v-model:value="formData.startAt"
|
|
||||||
placeholder="请选择活动开始时间"
|
|
||||||
style="width: 100%;"
|
|
||||||
show-time
|
|
||||||
:format="displayFormat"
|
|
||||||
:value-format="valueFormat"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item label="活动结束时间" name="endAt">
|
|
||||||
<a-date-picker
|
|
||||||
v-model:value="formData.endAt"
|
|
||||||
placeholder="请选择活动结束时间"
|
|
||||||
style="width: 100%;"
|
|
||||||
show-time
|
|
||||||
:format="displayFormat"
|
|
||||||
:value-format="valueFormat"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-form-item :label="'活动报名人数'" name="maxSignupNum">
|
|
||||||
<a-input-number :min="0" :placeholder="'请输入报名人数'" v-model:value="formData.maxSignupNum"
|
|
||||||
style="width: 100%" />
|
|
||||||
</a-form-item>
|
|
||||||
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'状态'" name="status">
|
<a-form-item :label="'状态'" name="status">
|
||||||
<a-radio-group v-model:value="formData.status" :options="activatyStatus.getAll()"
|
<a-radio-group v-model:value="formData.status" :options="activatyStatus.getAll()" disabled></a-radio-group>
|
||||||
disabled></a-radio-group>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item :label="'活动图片'" name="cover">
|
<a-form-item :label="'活动图片'" name="cover">
|
||||||
<gx-upload v-model="formData.cover" accept-types=".jpg,.png,.webp" :fileNumber="1" />
|
<gx-upload v-model="formData.cover" accept-types=".jpg,.png,.webp"
|
||||||
|
:fileNumber="1" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item :label="'背景图片'" name="images">
|
<a-form-item :label="'背景图片'" name="images">
|
||||||
<gx-upload v-model="formData.images" accept-types=".jpg,.png,.webp" :fileNumber="1" />
|
<gx-upload v-model="formData.images" accept-types=".jpg,.png,.webp"
|
||||||
|
:fileNumber="1" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@ -89,43 +54,27 @@ import { useForm, useModal, useSpining } from '@/hooks'
|
|||||||
import { message } from 'ant-design-vue'
|
import { message } from 'ant-design-vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import utc from 'dayjs/plugin/utc'
|
|
||||||
import timezone from 'dayjs/plugin/timezone'
|
|
||||||
import GxUpload from '@/components/GxUpload/index.vue'
|
import GxUpload from '@/components/GxUpload/index.vue'
|
||||||
import { spliceUrl } from "@/utils/util"
|
import { spliceUrl } from "@/utils/util"
|
||||||
import { activatyStatus } from '@/enums/index'
|
import { activatyStatus } from '@/enums/index'
|
||||||
|
|
||||||
// 扩展dayjs的时区功能
|
|
||||||
dayjs.extend(utc)
|
|
||||||
dayjs.extend(timezone)
|
|
||||||
|
|
||||||
const emit = defineEmits(['ok'])
|
const emit = defineEmits(['ok'])
|
||||||
const { t } = useI18n()
|
const { t } = useI18n() // 解构出t方法
|
||||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||||
const { formRecord, formData, formRef, formRules, resetForm } = useForm()
|
const { formRecord, formData, formRef, formRules, resetForm } = useForm()
|
||||||
const { spining, showSpining, hideSpining } = useSpining()
|
const { spining, showSpining, hideSpining } = useSpining()
|
||||||
const cancelText = ref(t('button.cancel'))
|
const cancelText = ref(t('button.cancel'))
|
||||||
const okText = ref(t('button.confirm'))
|
const okText = ref(t('button.confirm'))
|
||||||
const fileList = ref([])
|
const fileList = ref([])
|
||||||
|
|
||||||
// 显示格式 - 用户界面展示的格式
|
|
||||||
const displayFormat = 'YYYY-MM-DD HH:mm:ss'
|
|
||||||
// 值格式 - 传给后台的格式,符合2006-01-02T15:04:05Z07:00
|
|
||||||
const valueFormat = 'YYYY-MM-DDTHH:mm:ssZ'
|
|
||||||
|
|
||||||
formRules.value = {
|
formRules.value = {
|
||||||
title: [{ required: true, message: '请输入活动名称' }],
|
title: [{ required: true, message: '请输入活动名称' }],
|
||||||
openAt: [{ required: true, message: '请输入活动时间' }],
|
openAt: [{ required: true, message: '请输入活动时间' }],
|
||||||
cover: [{ required: false, message: '请上传图片', trigger: 'change' }],
|
cover: [{required: false, message: '请上传图片', trigger: 'change'}],
|
||||||
images: [{ required: false, message: '请上传图片', trigger: 'change' }],
|
images: [{ required: false, message: '请上传图片', trigger: 'change' }],
|
||||||
endSignupAt: [{ required: true, message: '请选择报名截止时间', trigger: 'change' }],
|
activityContent:[{ required: true, message: '请输入活动内容' }]
|
||||||
startAt: [{ required: true, message: '请选择活动开始时间', trigger: 'change' }],
|
|
||||||
endAt: [{ required: true, message: '请选择活动结束时间', trigger: 'change' }],
|
|
||||||
activityContent: [{ required: true, message: '请输入活动内容' }]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
// Initialize if needed
|
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -136,8 +85,8 @@ function handleCreate() {
|
|||||||
type: 'create',
|
type: 'create',
|
||||||
title: '新增活动',
|
title: '新增活动',
|
||||||
})
|
})
|
||||||
|
// initData()
|
||||||
formData.value.status = 1
|
formData.value.status = 1
|
||||||
formData.value.maxSignupNum = 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -156,32 +105,26 @@ async function handleEdit(record = {}) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
hideSpining()
|
hideSpining()
|
||||||
|
formData.value = { ...data }
|
||||||
// 转换后端时间格式为组件需要的格式
|
|
||||||
formData.value = {
|
|
||||||
...data,
|
|
||||||
// 确保时间格式正确解析
|
|
||||||
endSignupAt: data.endSignupAt ? dayjs(data.endSignupAt) : null,
|
|
||||||
startAt: data.startAt ? dayjs(data.startAt) : null,
|
|
||||||
endAt: data.endAt ? dayjs(data.endAt) : null
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.images && data.images.length > 0) {
|
if (data.images && data.images.length > 0) {
|
||||||
formData.value.images = data.images.map( item => config('http.apiBasic') + item)
|
formData.value.images = data.images.map(item => config('http.apiBasic') + item)
|
||||||
} else {
|
}else{
|
||||||
formData.value.images = []
|
formData.value.images=[]
|
||||||
}
|
}
|
||||||
if (data.cover) {
|
if(data.cover){
|
||||||
formData.value.cover = [config('http.apiBasic') + data.cover]
|
formData.value.cover=[config('http.apiBasic')+data.cover]
|
||||||
} else {
|
}else{
|
||||||
formData.value.cover = []
|
formData.value.cover=[]
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error({ content: error.message })
|
message.error({ content: error.message })
|
||||||
hideSpining()
|
hideSpining()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
const uploadSuccess = (data) => {
|
||||||
|
fileList.value.push(data)
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 确定
|
* 确定
|
||||||
*/
|
*/
|
||||||
@ -189,23 +132,12 @@ function handleOk() {
|
|||||||
formRef.value.validateFields().then(async (values) => {
|
formRef.value.validateFields().then(async (values) => {
|
||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
|
|
||||||
// 处理时间格式,确保符合要求
|
|
||||||
const formatTime = (timeStr) => {
|
|
||||||
if (!timeStr) return null;
|
|
||||||
// 确保时间字符串正确转换为所需格式
|
|
||||||
return dayjs(timeStr).format(valueFormat);
|
|
||||||
};
|
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
...values,
|
...values,
|
||||||
maxSignupNum: parseInt(values.maxSignupNum) || 0,
|
cover: formData.value.cover?spliceUrl(formData.value.cover[0]):'',
|
||||||
cover: formData.value.cover ? spliceUrl(formData.value.cover[0]) : '',
|
|
||||||
images: formData.value.images ? formData.value.images.map(item => spliceUrl(item)) : [],
|
images: formData.value.images ? formData.value.images.map(item => spliceUrl(item)) : [],
|
||||||
signupNum: formData.value.signupNum || 0,
|
status:1
|
||||||
status: 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let result = null
|
let result = null
|
||||||
switch (modal.value.type) {
|
switch (modal.value.type) {
|
||||||
case 'create':
|
case 'create':
|
||||||
@ -214,7 +146,7 @@ function handleOk() {
|
|||||||
})
|
})
|
||||||
break
|
break
|
||||||
case 'edit':
|
case 'edit':
|
||||||
result = await apis.activity.updateItem(formData.value.id, params).catch((error) => {
|
result = await apis.activity.updateItem(formData.value.id, params).catch(() => {
|
||||||
throw new Error(error)
|
throw new Error(error)
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
@ -229,11 +161,12 @@ function handleOk() {
|
|||||||
hideLoading()
|
hideLoading()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
hideLoading()
|
hideLoading()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消
|
* 取消
|
||||||
*/
|
*/
|
||||||
@ -241,6 +174,13 @@ function handleCancel() {
|
|||||||
formData.value.areaId = 1
|
formData.value.areaId = 1
|
||||||
hideModal()
|
hideModal()
|
||||||
}
|
}
|
||||||
|
const onRangeChange = (value, dateString) => {
|
||||||
|
console.log('value', value)
|
||||||
|
console.log('Formatted Selected Time: ', dateString);
|
||||||
|
formData.value.startAt = dayjs(dateString[0])
|
||||||
|
formData.value.endAt = dayjs(dateString[1])
|
||||||
|
console.log(formData.value)
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关闭后
|
* 关闭后
|
||||||
|
|||||||
@ -6,12 +6,12 @@
|
|||||||
<a-card class="mb-8-2">
|
<a-card class="mb-8-2">
|
||||||
<a-row :gutter="12">
|
<a-row :gutter="12">
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'会客厅名称'" name="title">
|
<a-form-item :label="'会议室名称'" name="title">
|
||||||
<a-input :placeholder="'请输入会客厅名称'" v-model:value="formData.title"></a-input>
|
<a-input :placeholder="'请输入会议室名称'" v-model:value="formData.title"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'会客厅人数'" name="maxNum">
|
<a-form-item :label="'会议室人数'" name="maxNum">
|
||||||
<a-input-number :placeholder="'请输入排序'" v-model:value="formData.maxNum"
|
<a-input-number :placeholder="'请输入排序'" v-model:value="formData.maxNum"
|
||||||
style="width: 100%;">
|
style="width: 100%;">
|
||||||
<template #addonAfter>
|
<template #addonAfter>
|
||||||
@ -21,12 +21,12 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'会客厅描述'" name="content">
|
<a-form-item :label="'会议室描述'" name="content">
|
||||||
<x-editor v-model="formData.content"></x-editor>
|
<x-editor v-model="formData.content"></x-editor>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'会客厅图片'" name="imgs">
|
<a-form-item :label="'会议室图片'" name="imgs">
|
||||||
<gx-upload v-model="formData.imgs" accept-types=".jpg,.png,.webp" :fileNumber="10" />
|
<gx-upload v-model="formData.imgs" accept-types=".jpg,.png,.webp" :fileNumber="10" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@ -65,9 +65,9 @@ const cancelText = ref(t('button.cancel'))
|
|||||||
const okText = ref(t('button.confirm'))
|
const okText = ref(t('button.confirm'))
|
||||||
const treeData = ref([])
|
const treeData = ref([])
|
||||||
formRules.value = {
|
formRules.value = {
|
||||||
title: { required: true, message: '请输入会客厅名称' },
|
title: { required: true, message: '请输入会议室名称' },
|
||||||
maxNum: { required: true, message: '请输入人数' },
|
maxNum: { required: true, message: '请输入人数' },
|
||||||
content: { required: true, message: '请输入会客厅描述' },
|
content: { required: true, message: '请输入会议室描述' },
|
||||||
status: { required: true, message: '请选择状态', trigger: 'change' },
|
status: { required: true, message: '请选择状态', trigger: 'change' },
|
||||||
imgs: { required: true, message: '请选择状态', trigger: 'change' }
|
imgs: { required: true, message: '请选择状态', trigger: 'change' }
|
||||||
}
|
}
|
||||||
@ -117,9 +117,7 @@ function handleOk() {
|
|||||||
const params = {
|
const params = {
|
||||||
...values,
|
...values,
|
||||||
status:1,
|
status:1,
|
||||||
imgs:formData.value.imgs.length>0?formData.value.imgs.map(item=>spliceUrl(item)):[],
|
imgs:formData.value.imgs.length>0?formData.value.imgs.map(item=>spliceUrl(item)):[]
|
||||||
num:formData.value.num||0,
|
|
||||||
roomType:formData.value.roomType||1,
|
|
||||||
}
|
}
|
||||||
let result = null
|
let result = null
|
||||||
switch (modal.value.type) {
|
switch (modal.value.type) {
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
新增会客厅
|
新增会议室
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar>
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
@ -81,9 +81,9 @@ const { t } = useI18n() // 解构出t方法
|
|||||||
const content=ref('')
|
const content=ref('')
|
||||||
const contentView=ref(false)
|
const contentView=ref(false)
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '会客厅名称', dataIndex: 'title' },
|
{ title: '会议室名称', dataIndex: 'title' },
|
||||||
{ title: '会客厅描述', dataIndex: 'content',align:'center' },
|
{ title: '会议室描述', dataIndex: 'content',align:'center' },
|
||||||
{ title: '会客厅人数', dataIndex: 'maxNum' },
|
{ title: '会议室人数', dataIndex: 'maxNum' },
|
||||||
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
||||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,29 +1,4 @@
|
|||||||
<template>
|
<template>
|
||||||
<x-search-bar class="mb-8-2">
|
|
||||||
<template #default="{ gutter, colSpan }">
|
|
||||||
<a-form :label-col="{ style: { width: '40px' } }" :model="searchFormData" layout="inline">
|
|
||||||
<a-row :gutter="gutter">
|
|
||||||
<a-col v-bind="colSpan">
|
|
||||||
<a-form-item label="状态" name="status">
|
|
||||||
<a-select v-model:value="searchFormData.applyType" allowClear>
|
|
||||||
<a-select-option :value="''">全部</a-select-option>
|
|
||||||
<a-select-option :value="2">个人申请</a-select-option>
|
|
||||||
<a-select-option :value="1">企业申请</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-row :gutter="8" :wrap="false">
|
||||||
<a-col flex="auto">
|
<a-col flex="auto">
|
||||||
<a-card type="flex">
|
<a-card type="flex">
|
||||||
@ -32,48 +7,10 @@
|
|||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="'startAt' === column.dataIndex">
|
<template v-if="'startAt' === column.dataIndex">
|
||||||
<span>{{ dayjs(record.startAt).format('YYYY-MM-DD HH:mm:ss') + ' - ' +
|
<span>{{ dayjs(record.startAt).format('YYYY-MM-DD HH:mm:ss') + ' - ' +
|
||||||
dayjs(record.endAt).format('YYYY-MM-DD HH:mm:ss') }}</span>
|
dayjs(record.endAt).format('YYYY-MM-DD HH:mm:ss')}}</span>
|
||||||
</template>
|
|
||||||
<template v-if="'startTime' === column.dataIndex">
|
|
||||||
<span>{{ record.startTime + ' - ' + record.endTime }}</span>
|
|
||||||
</template>
|
|
||||||
<template v-if="'applyType' === column.dataIndex">
|
|
||||||
<span v-if="record.applyType === 2">个人申请</span>
|
|
||||||
<span v-if="record.applyType === 1">企业申请</span>
|
|
||||||
</template>
|
|
||||||
<template v-if="'status' === column.dataIndex">
|
|
||||||
<a-tag color="#87d068" v-if="record.status === 3">审核通过</a-tag>
|
|
||||||
<a-tag color="#666666" v-if="record.status === 2">待审核</a-tag>
|
|
||||||
<a-tag color="#f50" v-if="record.status === 99">审核不通过</a-tag>
|
|
||||||
<!-- <a-tag color="#87d068" v-if="record.status === 3">审核通过</a-tag> -->
|
|
||||||
</template>
|
|
||||||
<template v-if="'applyTheme' === column.dataIndex">
|
|
||||||
<span>{{ applyThemeMap[record.applyTheme] || '未知' }}</span>
|
|
||||||
</template>
|
|
||||||
<template v-if="'userName' === column.dataIndex">
|
|
||||||
<span v-if="record.applyType === 2">{{ record.userName}}</span>
|
|
||||||
<span v-if="record.applyType === 1">{{ record.companyName}}</span>
|
|
||||||
</template>
|
|
||||||
<template v-if="column.dataIndex === 'applySign'">
|
|
||||||
<a-image :width="60"
|
|
||||||
:src="record.applySign ? config('http.apiBasic') + record.applySign : errImg" />
|
|
||||||
</template>
|
|
||||||
<template v-if="column.dataIndex === 'covenantPdf'">
|
|
||||||
<a v-if="record.covenantPdf" target="_blank"
|
|
||||||
:href="config('http.apiBasic') + record.covenantPdf" rel="noopener noreferrer">
|
|
||||||
查看承诺报表
|
|
||||||
</a>
|
|
||||||
<span v-else>无</span>
|
|
||||||
</template>
|
|
||||||
<template v-if="column.dataIndex === 'applyPdf'">
|
|
||||||
<a v-if="record.applyPdf" target="_blank" :href="config('http.apiBasic') + record.applyPdf"
|
|
||||||
rel="noopener noreferrer">
|
|
||||||
查看申请报表
|
|
||||||
</a>
|
|
||||||
<span v-else>无</span>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="'action' === column.key">
|
<template v-if="'action' === column.key">
|
||||||
<x-action-button @click="auditHandleEdit(record)" v-if="record.status === 2">
|
<x-action-button @click="auditHandleEdit(record)" v-if="record.status === 1">
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template #title>审核</template>
|
<template #title>审核</template>
|
||||||
<i class='iconfont icon-shenhe' style='font-size:14px;color:#faad14'></i>
|
<i class='iconfont icon-shenhe' style='font-size:14px;color:#faad14'></i>
|
||||||
@ -85,12 +22,12 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-modal :open="open" :title="'审核'" :width="640" title="审核" ok-text="确认" cancel-text="取消" @ok="handleAuditEdit"
|
<a-modal :open="open" :title="'审核'" :width="640" title="审核" ok-text="确认" cancel-text="取消" @ok="handleAuditEdit"
|
||||||
@cancel="open = false">
|
@cancel="open = false">
|
||||||
<a-card class="mb-8-2">
|
<a-card class="mb-8-2">
|
||||||
<a-form-item :label="'审核'" name="">
|
<a-form-item :label="'审核'" name="">
|
||||||
<a-radio-group v-model:value="auditStatus"
|
<a-radio-group v-model:value="auditStatus"
|
||||||
:options="[{ value: 3, label: '通过' }, { value: 99, label: '驳回' }]"></a-radio-group>
|
:options="[{ value: 2, label: '通过' }, { value: 99, label: '驳回' }]"></a-radio-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :label="'备注'" name="">
|
<a-form-item :label="'备注'" name="">
|
||||||
<a-textarea v-model:value="remark"></a-textarea>
|
<a-textarea v-model:value="remark"></a-textarea>
|
||||||
@ -106,55 +43,30 @@ import apis from '@/apis'
|
|||||||
import { config } from '@/config'
|
import { config } from '@/config'
|
||||||
import { usePagination } from '@/hooks'
|
import { usePagination } from '@/hooks'
|
||||||
import EditDialog from './components/EditDialog.vue'
|
import EditDialog from './components/EditDialog.vue'
|
||||||
import { PlusOutlined, EditOutlined, DownloadOutlined } from '@ant-design/icons-vue'
|
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { orderStatus } from '@/enums/index.js'
|
import { orderStatus } from '@/enums/index.js'
|
||||||
import { status } from 'nprogress'
|
import { status } from 'nprogress'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import axios from 'axios'
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'mettingYuYue',
|
name: 'mettingYuYue',
|
||||||
})
|
})
|
||||||
const { t } = useI18n() // 解构出t方法
|
const { t } = useI18n() // 解构出t方法
|
||||||
const columns = [
|
const columns = [
|
||||||
|
{ title: '用户', dataIndex: 'concatName' },
|
||||||
|
{ title: '手机号', dataIndex: 'concatPhone' },
|
||||||
{ title: '会议室', dataIndex: 'roomName' },
|
{ title: '会议室', dataIndex: 'roomName' },
|
||||||
{ title: '申请状态', dataIndex: 'status' },
|
{ title: '时间段', dataIndex: 'startAt', width: 300, align: 'center' },
|
||||||
// { title: '负责人', dataIndex: 'concatName' },
|
{ title: '备注', dataIndex: 'remark' },
|
||||||
// { title: '负责人手机号', dataIndex: 'concatPhone' },
|
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||||
{ title: '申请类型', dataIndex: 'applyType', width: 100 },
|
|
||||||
{ title: '申请主题', dataIndex: 'applyTheme', width: 100 },
|
|
||||||
{ title: '申请人', dataIndex: 'userName', width: 100 },
|
|
||||||
// { title: '申请人手机号', dataIndex: 'userPhone' },
|
|
||||||
// { title: '申请人身份证', dataIndex: 'userCardId', width: 120 },
|
|
||||||
{ title: '申请人地址', dataIndex: 'userAddress' },
|
|
||||||
// { title: '公司名字', dataIndex: 'companyName' },
|
|
||||||
{ title: '申请理由', dataIndex: 'reason' },
|
|
||||||
{ title: '场次', dataIndex: 'counter' },
|
|
||||||
{ title: '人数', dataIndex: 'num' },
|
|
||||||
{ title: '预约时间', dataIndex: 'startTime' },
|
|
||||||
// { title: '结束时间', dataIndex: 'endTime' },
|
|
||||||
{ title: '申请签名', dataIndex: 'applySign' },
|
|
||||||
// { title: '备注', dataIndex: 'remark' },
|
|
||||||
{ title: '申请报表', dataIndex: 'applyPdf' },
|
|
||||||
{ title: '承诺报表', dataIndex: 'covenantPdf' },
|
|
||||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 80, align: 'center' },
|
|
||||||
]
|
]
|
||||||
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
|
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
|
||||||
searchFormData.value = {
|
|
||||||
applyType: '',
|
|
||||||
}
|
|
||||||
const remark = ref('')
|
const remark = ref('')
|
||||||
const currentInfo = ref({})
|
const currentInfo = ref({})
|
||||||
const auditStatus = ref(3)
|
const auditStatus = ref(2)
|
||||||
const editDialogRef = ref()
|
const editDialogRef = ref()
|
||||||
const open = ref(false)
|
const open = ref(false)
|
||||||
const currentForm = ref({})
|
const imgOpen = ref(false)
|
||||||
const applyThemeMap = {
|
|
||||||
1: '开会',
|
|
||||||
2: '学术报告',
|
|
||||||
3: '活动',
|
|
||||||
4: '其他',
|
|
||||||
}
|
|
||||||
getPageList()
|
getPageList()
|
||||||
/**
|
/**
|
||||||
* 获取用户列表
|
* 获取用户列表
|
||||||
@ -166,7 +78,6 @@ async function getPageList() {
|
|||||||
const { pageSize, current } = paginationState
|
const { pageSize, current } = paginationState
|
||||||
const { success, data, total } = await apis.mettingYuYue
|
const { success, data, total } = await apis.mettingYuYue
|
||||||
.getDataList({
|
.getDataList({
|
||||||
applyType: searchFormData.value.applyType,
|
|
||||||
pageSize,
|
pageSize,
|
||||||
current: current,
|
current: current,
|
||||||
})
|
})
|
||||||
@ -185,9 +96,13 @@ async function getPageList() {
|
|||||||
hideLoading()
|
hideLoading()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const auditHandleEdit = (obj = {}) => {
|
const auditHandleEdit = (obj = {}, type) => {
|
||||||
currentForm.value = obj
|
currentInfo.value = obj
|
||||||
open.value = true
|
if (type === 'audit') {
|
||||||
|
open.value = true
|
||||||
|
} else {
|
||||||
|
imgOpen.value = true
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
const handleClick = async () => {
|
const handleClick = async () => {
|
||||||
@ -217,10 +132,9 @@ const handleAuditEdit = async () => {
|
|||||||
const params = {
|
const params = {
|
||||||
...currentForm.value,
|
...currentForm.value,
|
||||||
status: auditStatus.value,
|
status: auditStatus.value,
|
||||||
remark: remark.value,
|
remark: remark.value
|
||||||
// num: currentForm.value.num || 0,
|
|
||||||
}
|
}
|
||||||
const result = await apis.mettingYuYue.updateMenu(currentForm.value.id, params).catch(() => {
|
const result = await apis.mettingRoom.updateMenu(currentForm.value.id, params).catch(() => {
|
||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
if (config('http.code.success') === result?.success) {
|
if (config('http.code.success') === result?.success) {
|
||||||
@ -263,7 +177,6 @@ function handleResetSearch() {
|
|||||||
async function onOk() {
|
async function onOk() {
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
|||||||
@ -31,11 +31,6 @@
|
|||||||
<a-input :placeholder="'请输入营业时间'" v-model:value="formData.openAt"></a-input>
|
<a-input :placeholder="'请输入营业时间'" v-model:value="formData.openAt"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'联系电话'" name="openAt">
|
|
||||||
<a-input :placeholder="'请输入联系电话'" v-model:value="formData.concatPhone"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'标签'" name="labels">
|
<a-form-item :label="'标签'" name="labels">
|
||||||
<a-select v-model:value="formData.labels" mode="tags" style="width: 100%"
|
<a-select v-model:value="formData.labels" mode="tags" style="width: 100%"
|
||||||
@ -44,13 +39,13 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'状态'" name="status">
|
<a-form-item :label="'状态'" name="status">
|
||||||
<a-radio-group v-model:value="formData.status" :options="storeStatus.getAll()"
|
<a-radio-group v-model:value="formData.status"
|
||||||
disabled></a-radio-group>
|
:options="storeStatus.getAll()" disabled></a-radio-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'店铺描述'" name="content">
|
<a-form-item :label="'店铺描述'" name="content">
|
||||||
<a-textarea :placeholder="'请输入店铺描述'" v-model:value="formData.content"
|
<a-textarea :placeholder="'请输入店铺描述'" v-model:value="content"
|
||||||
:auto-size="{ minRows: 2, maxRows: 5 }"></a-textarea>
|
:auto-size="{ minRows: 2, maxRows: 5 }"></a-textarea>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@ -61,9 +56,9 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item :label="'详情图片'" name="imgs">
|
<a-form-item :label="'详情图片'" name="img">
|
||||||
<gx-upload v-model="formData.img" accept-types=".jpg,.png,.webp"
|
<gx-upload v-model="formData.img" accept-types=".jpg,.png,.webp"
|
||||||
:fileNumber="10" />
|
:fileNumber="1" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@ -127,10 +122,11 @@ formRules.value = {
|
|||||||
typeId: [{ required: true, message: '请选择产品类别名称', trigger: 'change' }],
|
typeId: [{ required: true, message: '请选择产品类别名称', trigger: 'change' }],
|
||||||
sequence: { required: true, message: '请输入排序' },
|
sequence: { required: true, message: '请输入排序' },
|
||||||
storeName: { required: true, message: '请输入门店名称' },
|
storeName: { required: true, message: '请输入门店名称' },
|
||||||
|
openAt: { required: true, message: '请输入营业时间' },
|
||||||
longitude: { required: true, message: '请输入经度' },
|
longitude: { required: true, message: '请输入经度' },
|
||||||
latitude: { required: true, message: '请输入纬度' },
|
latitude: { required: true, message: '请输入纬度' },
|
||||||
storeAddress: { required: true, message: '请输入门店地址' },
|
storeAddress: { required: true, message: '请输入门店地址' },
|
||||||
status: { required: true, message: '请选择状态', trigger: 'change' }
|
status:{required: true, message: '请选择状态', trigger: 'change'}
|
||||||
}
|
}
|
||||||
const initData = async () => {
|
const initData = async () => {
|
||||||
try {
|
try {
|
||||||
@ -164,14 +160,14 @@ async function handleEdit(record = {}) {
|
|||||||
type: 'edit',
|
type: 'edit',
|
||||||
title: '编辑',
|
title: '编辑',
|
||||||
})
|
})
|
||||||
const { data, success } = await apis.serverList.getMenu(record.id).catch()
|
const { data, success } = await apis.serverList.getMenu(record.id).catch()
|
||||||
if (!success) {
|
if (!success) {
|
||||||
hideModal()
|
hideModal()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
formData.value = { ...data }
|
formData.value = { ...data }
|
||||||
formData.value.storeCover = data.storeCover ? [config('http.apiBasic') + data.storeCover] : []
|
formData.value.storeCover=data.storeCover?[config('http.apiBasic')+data.storeCover]:[]
|
||||||
formData.value.img = data.imgs?.map(url => config('http.apiBasic') + url) || []
|
formData.value.img=data.img?[config('http.apiBasic')+data.img]:[]
|
||||||
initData()
|
initData()
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -185,12 +181,11 @@ function handleOk() {
|
|||||||
const params = {
|
const params = {
|
||||||
...values,
|
...values,
|
||||||
storeCover: formData.value.storeCover ? spliceUrl(formData.value.storeCover[0]) : '',
|
storeCover: formData.value.storeCover ? spliceUrl(formData.value.storeCover[0]) : '',
|
||||||
imgs: formData.value.img?.map(url => spliceUrl(url)) || [],
|
img: formData.value.img ? spliceUrl(formData.value.img[0]) : '',
|
||||||
latitude: parseFloat(formData.value.latitude),
|
latitude: parseFloat(formData.value.latitude),
|
||||||
longitude: parseFloat(formData.value.longitude),
|
longitude: parseFloat(formData.value.longitude),
|
||||||
status: 1
|
status:1
|
||||||
}
|
}
|
||||||
console.log("====",params)
|
|
||||||
let result = null
|
let result = null
|
||||||
switch (modal.value.type) {
|
switch (modal.value.type) {
|
||||||
case 'create':
|
case 'create':
|
||||||
|
|||||||
@ -229,4 +229,4 @@ async function onOk() {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
|||||||
@ -1,251 +0,0 @@
|
|||||||
<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-tabs v-model:activeKey="activeKey">
|
|
||||||
<a-tab-pane key="1" tab="基本信息">
|
|
||||||
<a-row :gutter="12">
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'产品分类'" name="typeId">
|
|
||||||
<a-select ref="select" v-model:value="formData.typeId" style="width: 100%">
|
|
||||||
<a-select-option v-for="item in typeList" :value="item.value">{{
|
|
||||||
item.label }}</a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'产品排序'" name="sequence">
|
|
||||||
<a-input-number :placeholder="'请输入排序'" v-model:value="formData.sequence"
|
|
||||||
style="width: 100%;"></a-input-number>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'门店名称'" name="storeName">
|
|
||||||
<a-input :placeholder="'请输入门店名称'" v-model:value="formData.storeName"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'营业时间'" name="openAt">
|
|
||||||
<a-input :placeholder="'请输入营业时间'" v-model:value="formData.openAt"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'联系电话'" name="openAt">
|
|
||||||
<a-input :placeholder="'请输入联系电话'" v-model:value="formData.concatPhone"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'标签'" name="labels">
|
|
||||||
<a-select v-model:value="formData.labels" mode="tags" style="width: 100%"
|
|
||||||
placeholder="输入标签然后回车"></a-select>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'状态'" name="status">
|
|
||||||
<a-radio-group v-model:value="formData.status" :options="storeStatus.getAll()"
|
|
||||||
disabled></a-radio-group>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'店铺描述'" name="content">
|
|
||||||
<a-textarea :placeholder="'请输入店铺描述'" v-model:value="formData.content"
|
|
||||||
:auto-size="{ minRows: 2, maxRows: 5 }"></a-textarea>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-form-item :label="'店铺封面'" name="storeCover">
|
|
||||||
<gx-upload v-model="formData.storeCover" accept-types=".jpg,.png,.webp"
|
|
||||||
:fileNumber="1" />
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-form-item :label="'详情图片'" name="imgs">
|
|
||||||
<gx-upload v-model="formData.img" accept-types=".jpg,.png,.webp"
|
|
||||||
:fileNumber="10" />
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
</a-tab-pane>
|
|
||||||
<a-tab-pane key="2" tab="位置信息">
|
|
||||||
<a-row :gutter="12">
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-form-item :label="'经度'" name="longitude">
|
|
||||||
<a-input :placeholder="'请输入经度'" v-model:value="formData.longitude"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-form-item :label="'纬度'" name="latitude">
|
|
||||||
<a-input :placeholder="'请输入纬度'" v-model:value="formData.latitude"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'详细地址'" name="storeAddress">
|
|
||||||
<a-input :placeholder="'请输入详细地址'"
|
|
||||||
v-model:value="formData.storeAddress"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<gx-map @handleGetLng="handleGetLng" />
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
</a-tab-pane>
|
|
||||||
</a-tabs>
|
|
||||||
|
|
||||||
|
|
||||||
</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 { storeStatus } from '@/enums/index.js'
|
|
||||||
import { spliceUrl } from '@/utils/util'
|
|
||||||
import { init } from 'echarts'
|
|
||||||
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 typeList = ref([])
|
|
||||||
const searchValue = ref('')
|
|
||||||
const activeKey = ref('1')
|
|
||||||
formRules.value = {
|
|
||||||
typeId: [{ required: true, message: '请选择产品类别名称', trigger: 'change' }],
|
|
||||||
sequence: { required: true, message: '请输入排序' },
|
|
||||||
storeName: { required: true, message: '请输入门店名称' },
|
|
||||||
longitude: { required: true, message: '请输入经度' },
|
|
||||||
latitude: { required: true, message: '请输入纬度' },
|
|
||||||
storeAddress: { required: true, message: '请输入门店地址' },
|
|
||||||
status: { required: true, message: '请选择状态', trigger: 'change' }
|
|
||||||
}
|
|
||||||
const initData = async () => {
|
|
||||||
try {
|
|
||||||
showSpining()
|
|
||||||
const { data, success } = await apis.serverType.getDataList({ pageSize: 99, current: 1 })
|
|
||||||
if (success) {
|
|
||||||
typeList.value = data.map(item => ({ value: item.id, label: item.label }))
|
|
||||||
hideSpining()
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
hideSpining()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 新建
|
|
||||||
*/
|
|
||||||
function handleCreate() {
|
|
||||||
showModal({
|
|
||||||
type: 'create',
|
|
||||||
title: '新增',
|
|
||||||
})
|
|
||||||
initData()
|
|
||||||
formData.value.status = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*/
|
|
||||||
async function handleEdit(record = {}) {
|
|
||||||
showModal({
|
|
||||||
type: 'edit',
|
|
||||||
title: '编辑',
|
|
||||||
})
|
|
||||||
const { data, success } = await apis.serverList.getMenu(record.id).catch()
|
|
||||||
if (!success) {
|
|
||||||
hideModal()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
formData.value = { ...data }
|
|
||||||
formData.value.storeCover = data.storeCover ? [config('http.apiBasic') + data.storeCover] : []
|
|
||||||
formData.value.img = data.imgs?.map(url => config('http.apiBasic') + url) || []
|
|
||||||
initData()
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 确定
|
|
||||||
*/
|
|
||||||
function handleOk() {
|
|
||||||
formRef.value.validateFields().then(async (values) => {
|
|
||||||
try {
|
|
||||||
showLoading()
|
|
||||||
console.log(formData.value)
|
|
||||||
const params = {
|
|
||||||
...values,
|
|
||||||
storeCover: formData.value.storeCover ? spliceUrl(formData.value.storeCover[0]) : '',
|
|
||||||
imgs: formData.value.img?.map(url => spliceUrl(url)) || [],
|
|
||||||
latitude: parseFloat(formData.value.latitude),
|
|
||||||
longitude: parseFloat(formData.value.longitude),
|
|
||||||
status: 1
|
|
||||||
}
|
|
||||||
console.log("====",params)
|
|
||||||
let result = null
|
|
||||||
switch (modal.value.type) {
|
|
||||||
case 'create':
|
|
||||||
result = await apis.serverList.createMenu(params).catch((error) => {
|
|
||||||
throw new Error(error)
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 'edit':
|
|
||||||
result = await apis.serverList.updateMenu(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) => {
|
|
||||||
console.log(e)
|
|
||||||
hideLoading()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const handleGetLng = (obj = {}) => {
|
|
||||||
formData.value.longitude = obj.lng
|
|
||||||
formData.value.latitude = obj.lat
|
|
||||||
formData.value.storeAddress = obj.address
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消
|
|
||||||
*/
|
|
||||||
function handleCancel() {
|
|
||||||
hideModal()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关闭后
|
|
||||||
*/
|
|
||||||
function onAfterClose() {
|
|
||||||
resetForm()
|
|
||||||
hideLoading()
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
handleCreate,
|
|
||||||
handleEdit,
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
|
||||||
@ -1,288 +0,0 @@
|
|||||||
<template>
|
|
||||||
<x-search-bar class="mb-24-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="phone">
|
|
||||||
<a-input placeholder="请输入联系电话" v-model:value="searchFormData.phone"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col v-bind="colSpan">
|
|
||||||
<a-form-item label="身份证号" name="iDCard">
|
|
||||||
<a-input placeholder="请输入身份证号" v-model:value="searchFormData.iDCard"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col v-bind="colSpan">
|
|
||||||
<a-form-item label="住址" name="address">
|
|
||||||
<a-input placeholder="请输入住址" v-model:value="searchFormData.address"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col class="align-right" v-bind="colSpan">
|
|
||||||
<a-space>
|
|
||||||
<a-button @click="handleExport">导出文件</a-button>
|
|
||||||
<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" @change="onTableChange">
|
|
||||||
<template #bodyCell="{ column, record }">
|
|
||||||
<template v-if="'createdAt' === column.dataIndex">
|
|
||||||
{{ dayjs(record.createdAt).format('YYYY-MM-DD') }}
|
|
||||||
</template>
|
|
||||||
<template v-if="'ActivityCover' === column.dataIndex">
|
|
||||||
<a-image :width="60"
|
|
||||||
:src="record.ActivityCover ? config('http.apiBasic') + record.ActivityCover : errImg" />
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</a-table>
|
|
||||||
</a-card>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-modal v-model:open="open" :title="'审核'" @ok="handleClick">
|
|
||||||
<a-card class="mb-8-2">
|
|
||||||
|
|
||||||
<a-form-item label="审核" name="">
|
|
||||||
<a-radio-group v-model:value="auditStatus">
|
|
||||||
<a-radio :value="2">通过</a-radio>
|
|
||||||
<a-radio :value="99">不通过</a-radio>
|
|
||||||
</a-radio-group>
|
|
||||||
</a-form-item>
|
|
||||||
|
|
||||||
<a-form-item label="备注" name="">
|
|
||||||
<a-textarea :placeholder="'请输入审核备注'" v-model:value="remark"
|
|
||||||
:auto-size="{ minRows: 2, maxRows: 5 }"></a-textarea>
|
|
||||||
</a-form-item>
|
|
||||||
|
|
||||||
</a-card>
|
|
||||||
</a-modal>
|
|
||||||
<a-modal v-model:open="imgOpen" :title="'图片/视频'" @ok="imgOpen = false">
|
|
||||||
<a-card class="mb-8-2">
|
|
||||||
<a-form-item :label="'图片'" name="images">
|
|
||||||
<template v-if="currentInfo.images && currentInfo.images.length > 0">
|
|
||||||
<a-image-preview-group>
|
|
||||||
<a-image v-for="item in currentInfo.images" :width="200"
|
|
||||||
:src="config('http.apiBasic') + item" />
|
|
||||||
</a-image-preview-group>
|
|
||||||
</template>
|
|
||||||
<template v-else>暂无</template>
|
|
||||||
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="视频" name="video">
|
|
||||||
<template v-if="currentInfo.videos && currentInfo.videos.length > 0">
|
|
||||||
<video width="320" height="240" controls>
|
|
||||||
<source v-for="item in currentInfo.videos" :src="config('http.apiBasic') + item">
|
|
||||||
</video>
|
|
||||||
</template>
|
|
||||||
<template>暂无</template>
|
|
||||||
</a-form-item>
|
|
||||||
</a-card>
|
|
||||||
</a-modal>
|
|
||||||
</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 dayjs from 'dayjs'
|
|
||||||
// import EditDialog from './components/EditDialog.vue'
|
|
||||||
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
|
||||||
import { useI18n } from 'vue-i18n'
|
|
||||||
import { orderStatus } from '@/enums/index.js'
|
|
||||||
import { status } from 'nprogress'
|
|
||||||
defineOptions({
|
|
||||||
name: 'orderList',
|
|
||||||
})
|
|
||||||
const { t } = useI18n() // 解构出t方法
|
|
||||||
const columns = [
|
|
||||||
{ title: '用户名', dataIndex: 'name' },
|
|
||||||
{ title: '身份证号', dataIndex: 'iDCard' },
|
|
||||||
{ title: '联系电话', dataIndex: 'phone' },
|
|
||||||
{ title: '联系地址', dataIndex: 'address', width: 300 },
|
|
||||||
{ title: '报名时间', dataIndex: 'createdAt', width: 300 },
|
|
||||||
|
|
||||||
]
|
|
||||||
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
|
|
||||||
const remark = ref('')
|
|
||||||
const currentInfo = ref({})
|
|
||||||
const auditStatus = ref(2)
|
|
||||||
const editDialogRef = ref()
|
|
||||||
const open = ref(false)
|
|
||||||
const imgOpen = ref(false)
|
|
||||||
const activityList = ref([])
|
|
||||||
|
|
||||||
getPageList()
|
|
||||||
getActiveList()
|
|
||||||
/**
|
|
||||||
* 获取活动报名列表
|
|
||||||
* @returns {Promise<void>}
|
|
||||||
*/
|
|
||||||
async function getPageList() {
|
|
||||||
try {
|
|
||||||
showLoading()
|
|
||||||
const { pageSize, current } = paginationState
|
|
||||||
const { success, data, total } = await apis.vote
|
|
||||||
.getElectionList({
|
|
||||||
pageSize,
|
|
||||||
current: current,
|
|
||||||
...searchFormData.value,
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
throw new Error()
|
|
||||||
})
|
|
||||||
hideLoading()
|
|
||||||
if (config('http.code.success') === success) {
|
|
||||||
listData.value = data.map(item => ({
|
|
||||||
...item,
|
|
||||||
key: item.value,
|
|
||||||
}))
|
|
||||||
paginationState.total = total
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
hideLoading()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 获取活动列表
|
|
||||||
async function getActiveList() {
|
|
||||||
try {
|
|
||||||
showLoading()
|
|
||||||
const { success, data } = await apis.activity
|
|
||||||
.getProjectList({
|
|
||||||
pageSize: 99,
|
|
||||||
current: 1,
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
throw new Error()
|
|
||||||
})
|
|
||||||
hideLoading()
|
|
||||||
if (config('http.code.success') === success) {
|
|
||||||
activityList.value = data.map(item => ({ id: item.id, title: item.title }))
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
hideLoading()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 下载文件
|
|
||||||
*/
|
|
||||||
async function handleExport() {
|
|
||||||
try {
|
|
||||||
const response = await apis.vote.exportFile()
|
|
||||||
console.log(response)
|
|
||||||
const url = window.URL.createObjectURL(new Blob([response]))
|
|
||||||
const link = document.createElement('a')
|
|
||||||
link.href = url
|
|
||||||
link.setAttribute('download', '报名表.xlsx') // 设置下载文件名
|
|
||||||
document.body.appendChild(link)
|
|
||||||
link.click()
|
|
||||||
document.body.removeChild(link)
|
|
||||||
window.URL.revokeObjectURL(url)
|
|
||||||
} catch (error) {
|
|
||||||
message.error('导出失败:' + (error.message || '未知错误'))
|
|
||||||
console.error('导出文件出错:', error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const handleClick = async () => {
|
|
||||||
try {
|
|
||||||
const params = {
|
|
||||||
...currentInfo.value,
|
|
||||||
status: auditStatus.value,
|
|
||||||
remark: remark.value
|
|
||||||
}
|
|
||||||
const result = await apis.orderList.updateMenu(currentInfo.value.id, params).catch(() => {
|
|
||||||
throw new Error(error)
|
|
||||||
})
|
|
||||||
if (config('http.code.success') === result?.success) {
|
|
||||||
message.success('已审核')
|
|
||||||
open.value = false
|
|
||||||
getPageList()
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
message.error({ content: error.message })
|
|
||||||
hideLoading()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
function handleDelete(value) {
|
|
||||||
Modal.confirm({
|
|
||||||
title: '确定撤销该工单吗',
|
|
||||||
content: t('button.confirm'),
|
|
||||||
okText: t('button.confirm'),
|
|
||||||
onOk: () => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
; (async () => {
|
|
||||||
try {
|
|
||||||
const params = {
|
|
||||||
...value,
|
|
||||||
status: 98
|
|
||||||
}
|
|
||||||
console.log(params)
|
|
||||||
const { success } = await apis.orderList.updateMenu(value.id, params).catch(() => {
|
|
||||||
throw new Error()
|
|
||||||
})
|
|
||||||
if (config('http.code.success') === success) {
|
|
||||||
resolve()
|
|
||||||
message.success('撤销成功')
|
|
||||||
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>
|
|
||||||
@ -1,176 +0,0 @@
|
|||||||
<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="title">
|
|
||||||
<a-input :placeholder="'请输入区域名称'" v-model:value="formData.title"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'区域排序'" name="sequence">
|
|
||||||
<a-input-number :placeholder="'请输入排序'" v-model:value="formData.sequence"
|
|
||||||
style="width: 100%;"></a-input-number>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'区域联系人'" name="concatName">
|
|
||||||
<a-input :placeholder="'请输区域联系人'" v-model:value="formData.concatName"
|
|
||||||
style="width: 100%;"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'联系电话'" name="concatPhone">
|
|
||||||
<a-input :placeholder="'请输入联系电话'" v-model:value="formData.concatPhone"
|
|
||||||
@input="formData.concatPhone = formData.concatPhone.replace(/[^0-9]/g, '')"
|
|
||||||
style="width: 100%;" />
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'备注'" name="remark">
|
|
||||||
<a-textarea :placeholder="'请输备注'" v-model:value="formData.remark"
|
|
||||||
style="width: 100%;"></a-textarea>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item :label="'状态'" name="status">
|
|
||||||
<a-radio-group v-model:value="formData.status" :options="workTypeStatus.getAll()"
|
|
||||||
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 { workTypeStatus } from '@/enums/index.js'
|
|
||||||
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 treeData = ref([])
|
|
||||||
formRules.value = {
|
|
||||||
title: { required: true, message: '请输入区域名称' },
|
|
||||||
sequence: { required: true, message: '请输入排序' },
|
|
||||||
concatName: { required: true, message: '请输入联系人' },
|
|
||||||
concatPhone: { required: true, message: '请输入联系电话' },
|
|
||||||
status: { required: true, message: '请选择状态', trigger: 'change' }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新建
|
|
||||||
*/
|
|
||||||
function handleCreate() {
|
|
||||||
showModal({
|
|
||||||
type: 'create',
|
|
||||||
title: '新增区域',
|
|
||||||
})
|
|
||||||
formData.value.status = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*/
|
|
||||||
async function handleEdit(record = {}) {
|
|
||||||
showModal({
|
|
||||||
type: 'edit',
|
|
||||||
title: '编辑分类',
|
|
||||||
})
|
|
||||||
try {
|
|
||||||
showSpining()
|
|
||||||
const { data, success } = await apis.orderArea.getMenu(record.id).catch()
|
|
||||||
if (!success) {
|
|
||||||
hideModal()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
hideSpining()
|
|
||||||
formData.value = { ...data }
|
|
||||||
} catch (error) {
|
|
||||||
message.error({ content: error.message })
|
|
||||||
hideSpining()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 确定
|
|
||||||
*/
|
|
||||||
function handleOk() {
|
|
||||||
formRef.value.validateFields().then(async (values) => {
|
|
||||||
try {
|
|
||||||
showLoading()
|
|
||||||
const params = {
|
|
||||||
...values,
|
|
||||||
status: 1
|
|
||||||
}
|
|
||||||
let result = null
|
|
||||||
switch (modal.value.type) {
|
|
||||||
case 'create':
|
|
||||||
result = await apis.orderArea.createMenu(params).catch((error) => {
|
|
||||||
throw new Error(error)
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 'edit':
|
|
||||||
result = await apis.orderArea.updateMenu(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>
|
|
||||||
@ -1,206 +0,0 @@
|
|||||||
<template>
|
|
||||||
<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" @change="onTableChange">
|
|
||||||
<template #bodyCell="{ column, record }">
|
|
||||||
<template v-if="'status' === column.dataIndex">
|
|
||||||
<a-tag :color="workTypeStatus.getColor(record.status)">{{
|
|
||||||
workTypeStatus.getName(record.status) }}</a-tag>
|
|
||||||
</template>
|
|
||||||
<template v-if="'action' === column.key">
|
|
||||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
|
|
||||||
<a-tooltip>
|
|
||||||
<template #title>编辑区域</template>
|
|
||||||
<edit-outlined />
|
|
||||||
</a-tooltip>
|
|
||||||
</x-action-button>
|
|
||||||
<x-action-button @click="auditHandleEdit(record)" v-if="record.status === 1">
|
|
||||||
<a-tooltip>
|
|
||||||
<template #title>审核</template>
|
|
||||||
<i class='iconfont icon-shenhe' style='font-size:14px;color:#faad14'></i>
|
|
||||||
</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 :open="open" :title="'审核'" :width="640" title="审核" ok-text="确认" cancel-text="取消" @ok="handleAuditEdit"
|
|
||||||
@cancel="open = false">
|
|
||||||
<a-card class="mb-8-2">
|
|
||||||
<a-form-item :label="'审核'" name="">
|
|
||||||
<a-radio-group v-model:value="auditStatus"
|
|
||||||
:options="[{ value: 2, label: '通过' }, { value: 99, label: '不通过' }]"></a-radio-group>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item :label="'备注'" name="">
|
|
||||||
<a-textarea v-model:value="remark"></a-textarea>
|
|
||||||
</a-form-item>
|
|
||||||
</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 { config } from '@/config'
|
|
||||||
import { usePagination } from '@/hooks'
|
|
||||||
import EditDialog from './components/EditDialog.vue'
|
|
||||||
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
|
||||||
import { useI18n } from 'vue-i18n'
|
|
||||||
import { workTypeStatus } from '@/enums/index.js'
|
|
||||||
defineOptions({
|
|
||||||
name: 'orderArea',
|
|
||||||
})
|
|
||||||
const currentForm = ref({})
|
|
||||||
const open = ref(false)
|
|
||||||
const auditStatus = ref(2)
|
|
||||||
const remark = ref('')
|
|
||||||
const { t } = useI18n() // 解构出t方法
|
|
||||||
const columns = [
|
|
||||||
{ title: '区域名称', dataIndex: 'title' },
|
|
||||||
// { title: '分类排序', dataIndex: 'sequence' },
|
|
||||||
{ title: '区域联系人', dataIndex: 'concatName' },
|
|
||||||
{ title: '联系电话', dataIndex: 'concatPhone' },
|
|
||||||
{ title: '备注', dataIndex: 'remark' },
|
|
||||||
{ title: '状态', dataIndex: 'status', width: 120, 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.orderArea
|
|
||||||
.getDataList({
|
|
||||||
pageSize,
|
|
||||||
current: current,
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
throw new Error()
|
|
||||||
})
|
|
||||||
hideLoading()
|
|
||||||
if (config('http.code.success') === success) {
|
|
||||||
listData.value = data.map(item => ({
|
|
||||||
...item,
|
|
||||||
key: item.value
|
|
||||||
}))
|
|
||||||
paginationState.total = total
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
hideLoading()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const auditHandleEdit = (params) => {
|
|
||||||
currentForm.value = params
|
|
||||||
open.value = true
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 审核
|
|
||||||
*/
|
|
||||||
const handleAuditEdit = async () => {
|
|
||||||
try {
|
|
||||||
const params = {
|
|
||||||
...currentForm.value,
|
|
||||||
status: auditStatus.value,
|
|
||||||
remark: remark.value
|
|
||||||
}
|
|
||||||
const result = await apis.orderArea.updateMenu(currentForm.value.id, params).catch(() => {
|
|
||||||
throw new Error()
|
|
||||||
})
|
|
||||||
if (config('http.code.success') === result?.success) {
|
|
||||||
getPageList()
|
|
||||||
open.value = false
|
|
||||||
message.success('审核成功')
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
message.error(error.message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页
|
|
||||||
*/
|
|
||||||
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()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
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.orderArea.delMenu(id).catch(() => {
|
|
||||||
throw new Error()
|
|
||||||
})
|
|
||||||
if (config('http.code.success') === success) {
|
|
||||||
resolve()
|
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
reject()
|
|
||||||
}
|
|
||||||
})()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
|
||||||
@ -3,7 +3,7 @@
|
|||||||
<a-col flex="auto">
|
<a-col flex="auto">
|
||||||
<a-card type="flex">
|
<a-card type="flex">
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
:pagination="paginationState" @change="onTableChange" :scroll="{ x: 1000 }">
|
:pagination="paginationState" @change="onTableChange">
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="'url' === column.dataIndex">
|
<template v-if="'url' === column.dataIndex">
|
||||||
<a-button type="link" @click="auditHandleEdit(record, 'img')">点击查看</a-button>
|
<a-button type="link" @click="auditHandleEdit(record, 'img')">点击查看</a-button>
|
||||||
@ -12,9 +12,6 @@
|
|||||||
<a-tag :color="orderStatus.getColor(record.status)">{{
|
<a-tag :color="orderStatus.getColor(record.status)">{{
|
||||||
orderStatus.getName(record.status) }}</a-tag>
|
orderStatus.getName(record.status) }}</a-tag>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="'createdAt' === column.dataIndex">
|
|
||||||
{{ dayjs(record.createdAt).format('YYYY-MM-DD') }}
|
|
||||||
</template>
|
|
||||||
<template v-if="'action' === column.key">
|
<template v-if="'action' === column.key">
|
||||||
<x-action-button @click="auditHandleEdit(record, 'audit')" v-if="record.status === 1">
|
<x-action-button @click="auditHandleEdit(record, 'audit')" v-if="record.status === 1">
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
@ -22,13 +19,7 @@
|
|||||||
<i class='iconfont icon-shenhe' style='font-size:14px;color:#faad14'></i>
|
<i class='iconfont icon-shenhe' style='font-size:14px;color:#faad14'></i>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</x-action-button>
|
</x-action-button>
|
||||||
<x-action-button @click="auditHandleFinish(record)" v-if="record.status === 2">
|
<x-action-button @click="handleDelete(record)" v-if="record.status!==98">
|
||||||
<a-tooltip>
|
|
||||||
<template #title> {{ '完成' }}</template>
|
|
||||||
<CheckCircleOutlined />
|
|
||||||
</a-tooltip>
|
|
||||||
</x-action-button>
|
|
||||||
<x-action-button @click="handleDelete(record)" v-if="record.status !== 98">
|
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template #title>撤销</template>
|
<template #title>撤销</template>
|
||||||
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button>
|
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button>
|
||||||
@ -65,7 +56,7 @@
|
|||||||
</a-image-preview-group>
|
</a-image-preview-group>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>暂无</template>
|
<template v-else>暂无</template>
|
||||||
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="视频" name="video">
|
<a-form-item label="视频" name="video">
|
||||||
<template v-if="currentInfo.videos && currentInfo.videos.length > 0">
|
<template v-if="currentInfo.videos && currentInfo.videos.length > 0">
|
||||||
@ -86,27 +77,23 @@ import apis from '@/apis'
|
|||||||
import { config } from '@/config'
|
import { config } from '@/config'
|
||||||
import { usePagination } from '@/hooks'
|
import { usePagination } from '@/hooks'
|
||||||
import EditDialog from './components/EditDialog.vue'
|
import EditDialog from './components/EditDialog.vue'
|
||||||
import { PlusOutlined, CheckCircleOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { orderStatus } from '@/enums/index.js'
|
import { orderStatus } from '@/enums/index.js'
|
||||||
import dayjs from 'dayjs'
|
import { status } from 'nprogress'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'orderList',
|
name: 'orderList',
|
||||||
})
|
})
|
||||||
const { t } = useI18n() // 解构出t方法
|
const { t } = useI18n() // 解构出t方法
|
||||||
const columns = [
|
const columns = [
|
||||||
// { title: '用户名称', dataIndex: 'customerName', width: 100 },
|
{ title: '用户名称', dataIndex: 'customerName' },
|
||||||
{ title: '工单分类', dataIndex: 'orderType', width: 100 },
|
{ title: '工单分类', dataIndex: 'label' },
|
||||||
{ title: '工单区域', dataIndex: 'orderAreaName', width: 150 },
|
{ title: '工单标题', dataIndex: 'title', ellipsis: true },
|
||||||
// { title: '工单标题', dataIndex: 'content', ellipsis: true },
|
{ title: '工单内容', dataIndex: 'content', ellipsis: true },
|
||||||
{ title: '工单内容', dataIndex: 'title', ellipsis: true, width: 200 },
|
{ title: '图片/视频', dataIndex: 'url', width: 120,align:'center' },
|
||||||
{ title: '图片/视频', dataIndex: 'url', width: 100, align: 'center' },
|
{ title: '工作地点', dataIndex: 'address', ellipsis: true },
|
||||||
|
{ title: '创建时间', dataIndex: 'createAt' },
|
||||||
{ title: '维修地点', dataIndex: 'address', ellipsis: true, width: 200 },
|
{ title: '上门时间', dataIndex: 'startAt' },
|
||||||
{ title: '报修人', dataIndex: 'concatName', width: 180 },
|
|
||||||
{ title: '联系电话', dataIndex: 'customerPhone', width: 180 },
|
|
||||||
{ title: '创建时间', dataIndex: 'createdAt', width: 180 },
|
|
||||||
// { title: '上门时间', dataIndex: 'startAt' },
|
|
||||||
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
||||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||||
]
|
]
|
||||||
@ -116,7 +103,7 @@ const currentInfo = ref({})
|
|||||||
const auditStatus = ref(2)
|
const auditStatus = ref(2)
|
||||||
const editDialogRef = ref()
|
const editDialogRef = ref()
|
||||||
const open = ref(false)
|
const open = ref(false)
|
||||||
const imgOpen = ref(false)
|
const imgOpen=ref(false)
|
||||||
getPageList()
|
getPageList()
|
||||||
/**
|
/**
|
||||||
* 获取用户列表
|
* 获取用户列表
|
||||||
@ -167,7 +154,7 @@ const handleClick = async () => {
|
|||||||
})
|
})
|
||||||
if (config('http.code.success') === result?.success) {
|
if (config('http.code.success') === result?.success) {
|
||||||
message.success('已审核')
|
message.success('已审核')
|
||||||
open.value = false
|
open.value=false
|
||||||
getPageList()
|
getPageList()
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -175,36 +162,6 @@ const handleClick = async () => {
|
|||||||
hideLoading()
|
hideLoading()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function auditHandleFinish(params){
|
|
||||||
Modal.confirm({
|
|
||||||
title: '确定完成该工单吗',
|
|
||||||
content: t('button.confirm'),
|
|
||||||
okText: t('button.confirm'),
|
|
||||||
onOk: () => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
; (async () => {
|
|
||||||
try {
|
|
||||||
const updateParams = {
|
|
||||||
...params,
|
|
||||||
status: 3
|
|
||||||
}
|
|
||||||
console.log(updateParams)
|
|
||||||
const { success } = await apis.orderList.updateMenu(params.id, updateParams).catch(() => {
|
|
||||||
throw new Error()
|
|
||||||
})
|
|
||||||
if (config('http.code.success') === success) {
|
|
||||||
resolve()
|
|
||||||
message.success('操作成功')
|
|
||||||
await getPageList()
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
reject()
|
|
||||||
}
|
|
||||||
})()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@ -217,11 +174,12 @@ function handleDelete(value) {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
; (async () => {
|
; (async () => {
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params={
|
||||||
...value,
|
...value,
|
||||||
|
status:98
|
||||||
}
|
}
|
||||||
console.log(params)
|
console.log(params)
|
||||||
const { success } = await apis.orderList.delMenu(value.id, params).catch(() => {
|
const { success } = await apis.orderList.updateMenu(value.id, params).catch(() => {
|
||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
if (config('http.code.success') === success) {
|
if (config('http.code.success') === success) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user