generated from Leo_Ding/web-template
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96999caa3b | ||
|
|
e4dca18e39 | ||
|
|
f72a65b86d | ||
|
|
0ae00153d1 | ||
|
|
27cb890c3e | ||
|
|
0876bccea2 | ||
|
|
e4cd59b4ec | ||
|
|
1b99986398 | ||
|
|
a6f6435da9 | ||
|
|
e91f27049d | ||
|
|
a6456363cf | ||
|
|
70d652b22f | ||
|
|
d675006ed1 | ||
|
|
978ba2146b | ||
|
|
c8e856d944 | ||
|
|
99b938b9e0 | ||
|
|
82d3f96698 | ||
|
|
9663ab92f4 | ||
|
|
dbd9a06ee1 | ||
|
|
9a17513b61 | ||
|
|
7956f87572 | ||
|
|
3fb319bb7b | ||
|
|
5e6b2eec02 | ||
|
|
4f06cb9c78 | ||
|
|
1f6fb8db7a | ||
|
|
a20a8356d4 | ||
|
|
bbe42b4222 |
1
.env.dev
1
.env.dev
@ -12,6 +12,7 @@ VITE_ROUTER_BASE=/
|
||||
VITE_ROUTER_HISTORY=hash
|
||||
|
||||
# api
|
||||
# VITE_API_BASIC=https://jinshan.nantong.info
|
||||
VITE_API_BASIC=http://10.10.1.6:8071
|
||||
VITE_API_HTTP=/api/v1/
|
||||
# storage
|
||||
|
||||
@ -4,14 +4,14 @@ NODE_ENV=production
|
||||
# app
|
||||
VITE_TITLE=JinShan-Admin
|
||||
VITE_PUBLIC_PATH=/
|
||||
VITE_OUT_DIR=dist
|
||||
VITE_OUT_DIR=index
|
||||
VITE_PERMISSION=true
|
||||
|
||||
# router
|
||||
VITE_ROUTER_HISTORY=hash
|
||||
|
||||
# api
|
||||
VITE_API_BASIC=/
|
||||
VITE_API_BASIC=https://jinshan.nantong.info
|
||||
VITE_API_HTTP=/api/v1/
|
||||
|
||||
# storage
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,6 +9,7 @@ lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
index
|
||||
dist-ssr
|
||||
*.local
|
||||
*/.vitepress/cache/**/*
|
||||
|
||||
@ -13,4 +13,6 @@ export const updateItem = (id, params) => request.basic.put(`/api/v1/activities/
|
||||
// 删除数据
|
||||
export const delItem = (id) => request.basic.delete(`/api/v1/activities/${id}`)
|
||||
//获取活动报名列表
|
||||
export const getActivityList=(params)=>request.basic.get('/api/v1/activity-details',params)
|
||||
export const getActivityList = (params) => request.basic.get('/api/v1/activity-registers', params)
|
||||
// 导出文件
|
||||
export const exportFile = (params) => request.basic.get('/api/v1/activity-registers/export', params, { responseType: 'blob' })
|
||||
@ -6,6 +6,9 @@ export const getRegion = (params) => request.basic.get('/region', params)
|
||||
// 获取 验证码ID
|
||||
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,{
|
||||
headers: {
|
||||
|
||||
14
src/apis/modules/orderArea.js
Normal file
14
src/apis/modules/orderArea.js
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* 图片管理接口
|
||||
*/
|
||||
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}`)
|
||||
18
src/apis/modules/vote.js
Normal file
18
src/apis/modules/vote.js
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* 区域模块接口
|
||||
*/
|
||||
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",
|
||||
"name": "会议室",
|
||||
"name": "会客厅",
|
||||
"font_class": "huiyishi1",
|
||||
"unicode": "e60a",
|
||||
"unicode_decimal": 58890
|
||||
@ -35,7 +35,7 @@
|
||||
},
|
||||
{
|
||||
"icon_id": "4942645",
|
||||
"name": "会议室",
|
||||
"name": "会客厅",
|
||||
"font_class": "huiyishi",
|
||||
"unicode": "e614",
|
||||
"unicode_decimal": 58900
|
||||
|
||||
@ -136,6 +136,7 @@ const handleChange = ({ file, fileList: updatedList }) => {
|
||||
|
||||
// 修复自定义上传方法
|
||||
const handleCustomRequest = async (options) => {
|
||||
console.log("==options",options)
|
||||
const { file, onProgress, onSuccess, onError } = options;
|
||||
|
||||
try {
|
||||
|
||||
@ -42,7 +42,7 @@ const workTypeStatus = new EnumManager([
|
||||
{ value: 98, name: '禁用', color: '#bfbfbf' }, // 灰色(失效色)
|
||||
{ value: 99, name: '审核不通过', color: '#ff4d4f' } // 红色(错误色)
|
||||
])
|
||||
//会议室类型状态
|
||||
//会客厅类型状态
|
||||
const mettingStatus = new EnumManager([
|
||||
{ value: 1, name: '待审核', color: '#faad14' }, // 黄色(警告色)
|
||||
{ value: 2, name: '启用中', color: '#52c41a' }, // 绿色(进行中)
|
||||
|
||||
@ -45,9 +45,12 @@ export default {
|
||||
server:'周边服务',
|
||||
serverList: '门店列表',
|
||||
serverType: '门店分类',
|
||||
mettingMgt:'会议室管理',
|
||||
mettingRoom:'会议室列表',
|
||||
mettingMgt:'城市会客厅管理',
|
||||
mettingRoom:'城市会客厅',
|
||||
mettingYuYue:'预约记录',
|
||||
customer:'用户管理',
|
||||
aiHelper:'AI助手'
|
||||
aiHelper:'AI助手',
|
||||
abbreviation:'活动报名',
|
||||
orderArea:'工单区域管理',
|
||||
vote:'信息登记',
|
||||
}
|
||||
|
||||
@ -135,6 +135,18 @@ export default [
|
||||
permission: '*',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'workOrder/orderArea',
|
||||
name: 'orderArea',
|
||||
component: 'pages/workOrder/orderArea/index.vue',
|
||||
meta: {
|
||||
icon: '',
|
||||
title: '工单区域管理',
|
||||
isMenu: true,
|
||||
keepAlive: true,
|
||||
permission: '*',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@ -181,7 +193,7 @@ export default [
|
||||
component: 'RouteViewLayout',
|
||||
meta: {
|
||||
icon: 'icon-huiyishi1',
|
||||
title: '会议室管理',
|
||||
title: '会客厅管理',
|
||||
isMenu: true,
|
||||
keepAlive: true,
|
||||
permission: '*',
|
||||
@ -193,7 +205,7 @@ export default [
|
||||
component: 'pages/mettingMgt/mettingList/index.vue',
|
||||
meta: {
|
||||
icon: '',
|
||||
title: '会议室',
|
||||
title: '会客厅',
|
||||
isMenu: true,
|
||||
keepAlive: true,
|
||||
permission: '*',
|
||||
@ -205,7 +217,7 @@ export default [
|
||||
component: 'pages/mettingMgt/mettingYuYue/index.vue',
|
||||
meta: {
|
||||
icon: '',
|
||||
title: '会议室预约',
|
||||
title: '会客厅预约',
|
||||
isMenu: true,
|
||||
keepAlive: true,
|
||||
permission: '*',
|
||||
@ -225,4 +237,28 @@ export default [
|
||||
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,6 +10,7 @@ const MSG_ERROR_KEY = Symbol('GLOBAL_ERROR')
|
||||
const options = {
|
||||
enableAbortController: true,
|
||||
interceptorRequest: (request) => {
|
||||
console.log('interceptorRequest', request)
|
||||
const userStore = useUserStore()
|
||||
const isLogin = userStore.isLogin
|
||||
const token = userStore.token
|
||||
@ -20,9 +21,10 @@ const options = {
|
||||
},
|
||||
interceptorRequestCatch: () => {},
|
||||
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 || {}
|
||||
if (![true].includes(success)) {
|
||||
if (![true].includes(success) && !list.includes(response.config.url)) {
|
||||
message.error({
|
||||
content: msg,
|
||||
key: MSG_ERROR_KEY,
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item name="captcha_code">
|
||||
<a-form-item name="captcha_code">
|
||||
<a-space>
|
||||
<a-input v-model:value="formData.captcha_code" size="large" type="text"
|
||||
:placeholder="$t('pages.login.captcha.placeholder')" @pressEnter="handleLogin">
|
||||
@ -31,7 +31,7 @@
|
||||
<a-image @click="getCaptcha" :preview="false" :width="140" :height="42"
|
||||
:src="captcha_img" />
|
||||
</a-space>
|
||||
</a-form-item> -->
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-button type="primary" size="large" block :loading="loading" @click="handleLogin">{{
|
||||
$t('pages.login.submit') }}
|
||||
@ -44,7 +44,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { Modal, notification } from 'ant-design-vue'
|
||||
import { Modal, notification, message } from 'ant-design-vue'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { LockOutlined, UserOutlined, SafetyOutlined } from '@ant-design/icons-vue'
|
||||
@ -87,11 +87,24 @@ onMounted(() => {
|
||||
* 获取 验证码ID
|
||||
*/
|
||||
async function getCaptcha() {
|
||||
const { data } = await apis.common.getCaptcha().catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
captcha_id.value = data.captcha_id
|
||||
captcha_img.value = httpApi + `?id=${data.captcha_id}`
|
||||
try {
|
||||
// 1. 获取 captcha_id
|
||||
const response = await apis.common.getCaptcha()
|
||||
const data = response.data
|
||||
if (!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 = ''
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 登录
|
||||
@ -100,26 +113,33 @@ async function getCaptcha() {
|
||||
async function handleLogin() {
|
||||
formRef.value.validate().then(async (values) => {
|
||||
values.captcha_id = captcha_id.value
|
||||
if (values.password === 'abc-123') values.password = md5(values.password)
|
||||
loading.value = true
|
||||
const { success } = await userStore
|
||||
.login({
|
||||
...values,
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
getCaptcha()
|
||||
})
|
||||
loading.value = false
|
||||
if (config('http.code.success') === success) {
|
||||
// 加载完成
|
||||
if (appStore.complete) {
|
||||
goIndex()
|
||||
} else {
|
||||
await appStore.init()
|
||||
goIndex()
|
||||
}
|
||||
if (values.password === 'abc-123') {
|
||||
values.password = md5(values.password)
|
||||
}
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
const response = await userStore.login({ ...values })
|
||||
loading.value = false
|
||||
if (config('http.code.success') === response.success) {
|
||||
if (appStore.complete) {
|
||||
goIndex()
|
||||
} else {
|
||||
await appStore.init()
|
||||
goIndex()
|
||||
}
|
||||
} else {
|
||||
message.error(t(response.msg))
|
||||
}
|
||||
} catch (error) {
|
||||
loading.value = false
|
||||
getCaptcha()
|
||||
const msg = error.msg || error.message || '登录失败,请重试'
|
||||
message.error(t(msg))
|
||||
console.log("登录出错:", error)
|
||||
}
|
||||
}).catch(validationError => {
|
||||
console.log('表单校验失败', validationError)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
251
src/views/pages/abbreviationList/components/EditDialog.vue
Normal file
251
src/views/pages/abbreviationList/components/EditDialog.vue
Normal file
@ -0,0 +1,251 @@
|
||||
<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>
|
||||
283
src/views/pages/abbreviationList/index.vue
Normal file
283
src/views/pages/abbreviationList/index.vue
Normal file
@ -0,0 +1,283 @@
|
||||
<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>
|
||||
<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-form ref="formRef" :model="formData" :rules="formRules">
|
||||
<a-card class="mb-8-2">
|
||||
@ -10,32 +10,67 @@
|
||||
<a-input :placeholder="'请输入活动标题'" v-model:value="formData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'活动内容'" name="content">
|
||||
<x-editor v-model="formData.content"></x-editor>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'活动时间'" name="openAt">
|
||||
<a-input v-model:value="formData.openAt" placeholder="请输入活动时间" />
|
||||
<a-form-item :label="'报名截止时间'" name="endSignupAt">
|
||||
<a-date-picker
|
||||
v-model:value="formData.endSignupAt"
|
||||
placeholder="请输入报名截止时间"
|
||||
style="width: 100%;"
|
||||
show-time
|
||||
:format="displayFormat"
|
||||
:value-format="valueFormat"
|
||||
/>
|
||||
</a-form-item>
|
||||
</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-radio-group v-model:value="formData.status" :options="activatyStatus.getAll()" disabled></a-radio-group>
|
||||
<a-radio-group v-model:value="formData.status" :options="activatyStatus.getAll()"
|
||||
disabled></a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<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-col>
|
||||
<a-col :span="12">
|
||||
<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-col>
|
||||
</a-row>
|
||||
@ -54,27 +89,43 @@ import { useForm, useModal, useSpining } from '@/hooks'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import dayjs from 'dayjs'
|
||||
import utc from 'dayjs/plugin/utc'
|
||||
import timezone from 'dayjs/plugin/timezone'
|
||||
import GxUpload from '@/components/GxUpload/index.vue'
|
||||
import { spliceUrl } from "@/utils/util"
|
||||
import { activatyStatus } from '@/enums/index'
|
||||
|
||||
// 扩展dayjs的时区功能
|
||||
dayjs.extend(utc)
|
||||
dayjs.extend(timezone)
|
||||
|
||||
const emit = defineEmits(['ok'])
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const { t } = useI18n()
|
||||
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 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 = {
|
||||
title: [{ 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' }],
|
||||
activityContent:[{ required: true, message: '请输入活动内容' }]
|
||||
endSignupAt: [{ required: true, message: '请选择报名截止时间', trigger: 'change' }],
|
||||
startAt: [{ required: true, message: '请选择活动开始时间', trigger: 'change' }],
|
||||
endAt: [{ required: true, message: '请选择活动结束时间', trigger: 'change' }],
|
||||
activityContent: [{ required: true, message: '请输入活动内容' }]
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
|
||||
// Initialize if needed
|
||||
})
|
||||
|
||||
/**
|
||||
@ -85,8 +136,8 @@ function handleCreate() {
|
||||
type: 'create',
|
||||
title: '新增活动',
|
||||
})
|
||||
// initData()
|
||||
formData.value.status = 1
|
||||
formData.value.maxSignupNum = 0
|
||||
}
|
||||
|
||||
/**
|
||||
@ -105,26 +156,32 @@ async function handleEdit(record = {}) {
|
||||
return
|
||||
}
|
||||
hideSpining()
|
||||
formData.value = { ...data }
|
||||
if (data.images && data.images.length > 0) {
|
||||
formData.value.images = data.images.map(item => config('http.apiBasic') + item)
|
||||
}else{
|
||||
formData.value.images=[]
|
||||
|
||||
// 转换后端时间格式为组件需要的格式
|
||||
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.cover){
|
||||
formData.value.cover=[config('http.apiBasic')+data.cover]
|
||||
}else{
|
||||
formData.value.cover=[]
|
||||
|
||||
if (data.images && data.images.length > 0) {
|
||||
formData.value.images = data.images.map( item => config('http.apiBasic') + item)
|
||||
} else {
|
||||
formData.value.images = []
|
||||
}
|
||||
if (data.cover) {
|
||||
formData.value.cover = [config('http.apiBasic') + data.cover]
|
||||
} else {
|
||||
formData.value.cover = []
|
||||
}
|
||||
} catch (error) {
|
||||
message.error({ content: error.message })
|
||||
hideSpining()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
const uploadSuccess = (data) => {
|
||||
fileList.value.push(data)
|
||||
}
|
||||
/**
|
||||
* 确定
|
||||
*/
|
||||
@ -132,12 +189,23 @@ function handleOk() {
|
||||
formRef.value.validateFields().then(async (values) => {
|
||||
try {
|
||||
showLoading()
|
||||
|
||||
// 处理时间格式,确保符合要求
|
||||
const formatTime = (timeStr) => {
|
||||
if (!timeStr) return null;
|
||||
// 确保时间字符串正确转换为所需格式
|
||||
return dayjs(timeStr).format(valueFormat);
|
||||
};
|
||||
|
||||
const params = {
|
||||
...values,
|
||||
cover: formData.value.cover?spliceUrl(formData.value.cover[0]):'',
|
||||
maxSignupNum: parseInt(values.maxSignupNum) || 0,
|
||||
cover: formData.value.cover ? spliceUrl(formData.value.cover[0]) : '',
|
||||
images: formData.value.images ? formData.value.images.map(item => spliceUrl(item)) : [],
|
||||
status:1
|
||||
signupNum: formData.value.signupNum || 0,
|
||||
status: 1
|
||||
}
|
||||
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
case 'create':
|
||||
@ -146,7 +214,7 @@ function handleOk() {
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
result = await apis.activity.updateItem(formData.value.id, params).catch(() => {
|
||||
result = await apis.activity.updateItem(formData.value.id, params).catch((error) => {
|
||||
throw new Error(error)
|
||||
})
|
||||
break
|
||||
@ -161,12 +229,11 @@ function handleOk() {
|
||||
hideLoading()
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
hideLoading()
|
||||
})
|
||||
.catch((e) => {
|
||||
hideLoading()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 取消
|
||||
*/
|
||||
@ -174,13 +241,6 @@ function handleCancel() {
|
||||
formData.value.areaId = 1
|
||||
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-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 :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="maxNum">
|
||||
<a-form-item :label="'会客厅人数'" name="maxNum">
|
||||
<a-input-number :placeholder="'请输入排序'" v-model:value="formData.maxNum"
|
||||
style="width: 100%;">
|
||||
<template #addonAfter>
|
||||
@ -21,12 +21,12 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'会议室描述'" name="content">
|
||||
<a-form-item :label="'会客厅描述'" name="content">
|
||||
<x-editor v-model="formData.content"></x-editor>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@ -65,9 +65,9 @@ const cancelText = ref(t('button.cancel'))
|
||||
const okText = ref(t('button.confirm'))
|
||||
const treeData = ref([])
|
||||
formRules.value = {
|
||||
title: { required: true, message: '请输入会议室名称' },
|
||||
title: { required: true, message: '请输入会客厅名称' },
|
||||
maxNum: { required: true, message: '请输入人数' },
|
||||
content: { required: true, message: '请输入会议室描述' },
|
||||
content: { required: true, message: '请输入会客厅描述' },
|
||||
status: { required: true, message: '请选择状态', trigger: 'change' },
|
||||
imgs: { required: true, message: '请选择状态', trigger: 'change' }
|
||||
}
|
||||
@ -117,7 +117,9 @@ function handleOk() {
|
||||
const params = {
|
||||
...values,
|
||||
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
|
||||
switch (modal.value.type) {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新增会议室
|
||||
新增会客厅
|
||||
</a-button>
|
||||
</x-action-bar>
|
||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||
@ -81,9 +81,9 @@ const { t } = useI18n() // 解构出t方法
|
||||
const content=ref('')
|
||||
const contentView=ref(false)
|
||||
const columns = [
|
||||
{ title: '会议室名称', dataIndex: 'title' },
|
||||
{ title: '会议室描述', dataIndex: 'content',align:'center' },
|
||||
{ title: '会议室人数', dataIndex: 'maxNum' },
|
||||
{ title: '会客厅名称', dataIndex: 'title' },
|
||||
{ title: '会客厅描述', dataIndex: 'content',align:'center' },
|
||||
{ title: '会客厅人数', dataIndex: 'maxNum' },
|
||||
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -1,4 +1,29 @@
|
||||
<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-col flex="auto">
|
||||
<a-card type="flex">
|
||||
@ -7,10 +32,48 @@
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'startAt' === column.dataIndex">
|
||||
<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 v-if="'action' === column.key">
|
||||
<x-action-button @click="auditHandleEdit(record)" v-if="record.status === 1">
|
||||
<x-action-button @click="auditHandleEdit(record)" v-if="record.status === 2">
|
||||
<a-tooltip>
|
||||
<template #title>审核</template>
|
||||
<i class='iconfont icon-shenhe' style='font-size:14px;color:#faad14'></i>
|
||||
@ -22,12 +85,12 @@
|
||||
</a-card>
|
||||
</a-col>
|
||||
</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">
|
||||
<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>
|
||||
:options="[{ value: 3, label: '通过' }, { value: 99, label: '驳回' }]"></a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item :label="'备注'" name="">
|
||||
<a-textarea v-model:value="remark"></a-textarea>
|
||||
@ -43,30 +106,55 @@ 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 { PlusOutlined, EditOutlined, DownloadOutlined } from '@ant-design/icons-vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { orderStatus } from '@/enums/index.js'
|
||||
import { status } from 'nprogress'
|
||||
import dayjs from 'dayjs'
|
||||
import axios from 'axios'
|
||||
defineOptions({
|
||||
name: 'mettingYuYue',
|
||||
})
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = [
|
||||
{ title: '用户', dataIndex: 'concatName' },
|
||||
{ title: '手机号', dataIndex: 'concatPhone' },
|
||||
{ title: '会议室', dataIndex: 'roomName' },
|
||||
{ title: '时间段', dataIndex: 'startAt', width: 300, align: 'center' },
|
||||
{ title: '备注', dataIndex: 'remark' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
{ title: '申请状态', dataIndex: 'status' },
|
||||
// { title: '负责人', dataIndex: 'concatName' },
|
||||
// { title: '负责人手机号', dataIndex: 'concatPhone' },
|
||||
{ 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()
|
||||
searchFormData.value = {
|
||||
applyType: '',
|
||||
}
|
||||
const remark = ref('')
|
||||
const currentInfo = ref({})
|
||||
const auditStatus = ref(2)
|
||||
const auditStatus = ref(3)
|
||||
const editDialogRef = ref()
|
||||
const open = ref(false)
|
||||
const imgOpen = ref(false)
|
||||
const currentForm = ref({})
|
||||
const applyThemeMap = {
|
||||
1: '开会',
|
||||
2: '学术报告',
|
||||
3: '活动',
|
||||
4: '其他',
|
||||
}
|
||||
getPageList()
|
||||
/**
|
||||
* 获取用户列表
|
||||
@ -78,6 +166,7 @@ async function getPageList() {
|
||||
const { pageSize, current } = paginationState
|
||||
const { success, data, total } = await apis.mettingYuYue
|
||||
.getDataList({
|
||||
applyType: searchFormData.value.applyType,
|
||||
pageSize,
|
||||
current: current,
|
||||
})
|
||||
@ -96,13 +185,9 @@ async function getPageList() {
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
const auditHandleEdit = (obj = {}, type) => {
|
||||
currentInfo.value = obj
|
||||
if (type === 'audit') {
|
||||
open.value = true
|
||||
} else {
|
||||
imgOpen.value = true
|
||||
}
|
||||
const auditHandleEdit = (obj = {}) => {
|
||||
currentForm.value = obj
|
||||
open.value = true
|
||||
|
||||
}
|
||||
const handleClick = async () => {
|
||||
@ -132,9 +217,10 @@ const handleAuditEdit = async () => {
|
||||
const params = {
|
||||
...currentForm.value,
|
||||
status: auditStatus.value,
|
||||
remark: remark.value
|
||||
remark: remark.value,
|
||||
// num: currentForm.value.num || 0,
|
||||
}
|
||||
const result = await apis.mettingRoom.updateMenu(currentForm.value.id, params).catch(() => {
|
||||
const result = await apis.mettingYuYue.updateMenu(currentForm.value.id, params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (config('http.code.success') === result?.success) {
|
||||
@ -177,6 +263,7 @@ function handleResetSearch() {
|
||||
async function onOk() {
|
||||
await getPageList()
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
|
||||
@ -31,6 +31,11 @@
|
||||
<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%"
|
||||
@ -39,13 +44,13 @@
|
||||
</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-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="content"
|
||||
<a-textarea :placeholder="'请输入店铺描述'" v-model:value="formData.content"
|
||||
:auto-size="{ minRows: 2, maxRows: 5 }"></a-textarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@ -56,9 +61,9 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'详情图片'" name="img">
|
||||
<a-form-item :label="'详情图片'" name="imgs">
|
||||
<gx-upload v-model="formData.img" accept-types=".jpg,.png,.webp"
|
||||
:fileNumber="1" />
|
||||
:fileNumber="10" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -122,11 +127,10 @@ formRules.value = {
|
||||
typeId: [{ required: true, message: '请选择产品类别名称', trigger: 'change' }],
|
||||
sequence: { required: true, message: '请输入排序' },
|
||||
storeName: { required: true, message: '请输入门店名称' },
|
||||
openAt: { required: true, message: '请输入营业时间' },
|
||||
longitude: { required: true, message: '请输入经度' },
|
||||
latitude: { required: true, message: '请输入纬度' },
|
||||
storeAddress: { required: true, message: '请输入门店地址' },
|
||||
status:{required: true, message: '请选择状态', trigger: 'change'}
|
||||
status: { required: true, message: '请选择状态', trigger: 'change' }
|
||||
}
|
||||
const initData = async () => {
|
||||
try {
|
||||
@ -160,14 +164,14 @@ async function handleEdit(record = {}) {
|
||||
type: 'edit',
|
||||
title: '编辑',
|
||||
})
|
||||
const { data, success } = await apis.serverList.getMenu(record.id).catch()
|
||||
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.img?[config('http.apiBasic')+data.img]:[]
|
||||
formData.value.storeCover = data.storeCover ? [config('http.apiBasic') + data.storeCover] : []
|
||||
formData.value.img = data.imgs?.map(url => config('http.apiBasic') + url) || []
|
||||
initData()
|
||||
}
|
||||
/**
|
||||
@ -181,11 +185,12 @@ function handleOk() {
|
||||
const params = {
|
||||
...values,
|
||||
storeCover: formData.value.storeCover ? spliceUrl(formData.value.storeCover[0]) : '',
|
||||
img: formData.value.img ? spliceUrl(formData.value.img[0]) : '',
|
||||
imgs: formData.value.img?.map(url => spliceUrl(url)) || [],
|
||||
latitude: parseFloat(formData.value.latitude),
|
||||
longitude: parseFloat(formData.value.longitude),
|
||||
status:1
|
||||
status: 1
|
||||
}
|
||||
console.log("====",params)
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
case 'create':
|
||||
|
||||
@ -229,4 +229,4 @@ async function onOk() {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped></style>
|
||||
251
src/views/pages/vote/components/EditDialog.vue
Normal file
251
src/views/pages/vote/components/EditDialog.vue
Normal file
@ -0,0 +1,251 @@
|
||||
<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>
|
||||
288
src/views/pages/vote/index.vue
Normal file
288
src/views/pages/vote/index.vue
Normal file
@ -0,0 +1,288 @@
|
||||
<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>
|
||||
176
src/views/pages/workOrder/orderArea/components/EditDialog.vue
Normal file
176
src/views/pages/workOrder/orderArea/components/EditDialog.vue
Normal file
@ -0,0 +1,176 @@
|
||||
<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>
|
||||
206
src/views/pages/workOrder/orderArea/index.vue
Normal file
206
src/views/pages/workOrder/orderArea/index.vue
Normal file
@ -0,0 +1,206 @@
|
||||
<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-card type="flex">
|
||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||
:pagination="paginationState" @change="onTableChange">
|
||||
:pagination="paginationState" @change="onTableChange" :scroll="{ x: 1000 }">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'url' === column.dataIndex">
|
||||
<a-button type="link" @click="auditHandleEdit(record, 'img')">点击查看</a-button>
|
||||
@ -12,6 +12,9 @@
|
||||
<a-tag :color="orderStatus.getColor(record.status)">{{
|
||||
orderStatus.getName(record.status) }}</a-tag>
|
||||
</template>
|
||||
<template v-if="'createdAt' === column.dataIndex">
|
||||
{{ dayjs(record.createdAt).format('YYYY-MM-DD') }}
|
||||
</template>
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="auditHandleEdit(record, 'audit')" v-if="record.status === 1">
|
||||
<a-tooltip>
|
||||
@ -19,7 +22,13 @@
|
||||
<i class='iconfont icon-shenhe' style='font-size:14px;color:#faad14'></i>
|
||||
</a-tooltip>
|
||||
</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)" v-if="record.status!==98">
|
||||
<x-action-button @click="auditHandleFinish(record)" v-if="record.status === 2">
|
||||
<a-tooltip>
|
||||
<template #title> {{ '完成' }}</template>
|
||||
<CheckCircleOutlined />
|
||||
</a-tooltip>
|
||||
</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)" v-if="record.status !== 98">
|
||||
<a-tooltip>
|
||||
<template #title>撤销</template>
|
||||
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button>
|
||||
@ -56,7 +65,7 @@
|
||||
</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">
|
||||
@ -77,23 +86,27 @@ 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 { PlusOutlined, CheckCircleOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { orderStatus } from '@/enums/index.js'
|
||||
import { status } from 'nprogress'
|
||||
import dayjs from 'dayjs'
|
||||
defineOptions({
|
||||
name: 'orderList',
|
||||
})
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = [
|
||||
{ title: '用户名称', dataIndex: 'customerName' },
|
||||
{ title: '工单分类', dataIndex: 'label' },
|
||||
{ title: '工单标题', dataIndex: 'title', ellipsis: true },
|
||||
{ title: '工单内容', dataIndex: 'content', ellipsis: true },
|
||||
{ title: '图片/视频', dataIndex: 'url', width: 120,align:'center' },
|
||||
{ title: '工作地点', dataIndex: 'address', ellipsis: true },
|
||||
{ title: '创建时间', dataIndex: 'createAt' },
|
||||
{ title: '上门时间', dataIndex: 'startAt' },
|
||||
// { title: '用户名称', dataIndex: 'customerName', width: 100 },
|
||||
{ title: '工单分类', dataIndex: 'orderType', width: 100 },
|
||||
{ title: '工单区域', dataIndex: 'orderAreaName', width: 150 },
|
||||
// { title: '工单标题', dataIndex: 'content', ellipsis: true },
|
||||
{ title: '工单内容', dataIndex: 'title', ellipsis: true, width: 200 },
|
||||
{ title: '图片/视频', dataIndex: 'url', width: 100, align: 'center' },
|
||||
|
||||
{ title: '维修地点', dataIndex: 'address', ellipsis: true, width: 200 },
|
||||
{ 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: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
@ -103,7 +116,7 @@ const currentInfo = ref({})
|
||||
const auditStatus = ref(2)
|
||||
const editDialogRef = ref()
|
||||
const open = ref(false)
|
||||
const imgOpen=ref(false)
|
||||
const imgOpen = ref(false)
|
||||
getPageList()
|
||||
/**
|
||||
* 获取用户列表
|
||||
@ -154,7 +167,7 @@ const handleClick = async () => {
|
||||
})
|
||||
if (config('http.code.success') === result?.success) {
|
||||
message.success('已审核')
|
||||
open.value=false
|
||||
open.value = false
|
||||
getPageList()
|
||||
}
|
||||
} catch (error) {
|
||||
@ -162,6 +175,36 @@ const handleClick = async () => {
|
||||
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()
|
||||
}
|
||||
})()
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@ -174,12 +217,11 @@ function handleDelete(value) {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
try {
|
||||
const params={
|
||||
const params = {
|
||||
...value,
|
||||
status:98
|
||||
}
|
||||
console.log(params)
|
||||
const { success } = await apis.orderList.updateMenu(value.id, params).catch(() => {
|
||||
const { success } = await apis.orderList.delMenu(value.id, params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (config('http.code.success') === success) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user