Compare commits

..

No commits in common. "master" and "main" have entirely different histories.
master ... main

27 changed files with 142 additions and 1894 deletions

View File

@ -12,7 +12,6 @@ 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

View File

@ -4,14 +4,14 @@ NODE_ENV=production
# app
VITE_TITLE=JinShan-Admin
VITE_PUBLIC_PATH=/
VITE_OUT_DIR=index
VITE_OUT_DIR=dist
VITE_PERMISSION=true
# router
VITE_ROUTER_HISTORY=hash
# api
VITE_API_BASIC=https://jinshan.nantong.info
VITE_API_BASIC=/
VITE_API_HTTP=/api/v1/
# storage

1
.gitignore vendored
View File

@ -9,7 +9,6 @@ lerna-debug.log*
node_modules
dist
index
dist-ssr
*.local
*/.vitepress/cache/**/*

View File

@ -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 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' })
export const getActivityList=(params)=>request.basic.get('/api/v1/activity-details',params)

View File

@ -6,9 +6,6 @@ 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: {

View File

@ -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}`)

View File

@ -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' })

View File

@ -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

View File

@ -136,7 +136,6 @@ const handleChange = ({ file, fileList: updatedList }) => {
//
const handleCustomRequest = async (options) => {
console.log("==options",options)
const { file, onProgress, onSuccess, onError } = options;
try {

View File

@ -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' }, // 绿色(进行中)

View File

@ -45,12 +45,9 @@ export default {
server:'周边服务',
serverList: '门店列表',
serverType: '门店分类',
mettingMgt:'城市会客厅管理',
mettingRoom:'城市会客厅',
mettingMgt:'会议室管理',
mettingRoom:'会议室列表',
mettingYuYue:'预约记录',
customer:'用户管理',
aiHelper:'AI助手',
abbreviation:'活动报名',
orderArea:'工单区域管理',
vote:'信息登记',
aiHelper:'AI助手'
}

View File

@ -135,18 +135,6 @@ export default [
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',
meta: {
icon: 'icon-huiyishi1',
title: '会客厅管理',
title: '会议室管理',
isMenu: true,
keepAlive: true,
permission: '*',
@ -205,7 +193,7 @@ export default [
component: 'pages/mettingMgt/mettingList/index.vue',
meta: {
icon: '',
title: '会客厅',
title: '会议室',
isMenu: true,
keepAlive: true,
permission: '*',
@ -217,7 +205,7 @@ export default [
component: 'pages/mettingMgt/mettingYuYue/index.vue',
meta: {
icon: '',
title: '会客厅预约',
title: '会议室预约',
isMenu: true,
keepAlive: true,
permission: '*',
@ -237,28 +225,4 @@ 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: '*',
},
},
]

View File

@ -10,7 +10,6 @@ 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
@ -21,10 +20,9 @@ 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) && !list.includes(response.config.url)) {
if (![true].includes(success)) {
message.error({
content: msg,
key: MSG_ERROR_KEY,

View File

@ -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, message } from 'ant-design-vue'
import { Modal, notification } 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,24 +87,11 @@ onMounted(() => {
* 获取 验证码ID
*/
async function getCaptcha() {
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 = ''
}
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}`
}
/**
* 登录
@ -113,33 +100,26 @@ 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)
}
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()
}
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 {
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)
})
}

View File

@ -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>

View File

@ -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>

View File

@ -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,67 +10,32 @@
<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="endSignupAt">
<a-date-picker
v-model:value="formData.endSignupAt"
placeholder="请输入报名截止时间"
style="width: 100%;"
show-time
:format="displayFormat"
:value-format="valueFormat"
/>
<a-form-item :label="'活动时间'" name="openAt">
<a-input v-model:value="formData.openAt" placeholder="请输入活动时间" />
</a-form-item>
</a-col>
<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-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>
@ -89,43 +54,27 @@ 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()
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 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' }],
endSignupAt: [{ required: true, message: '请选择报名截止时间', trigger: 'change' }],
startAt: [{ required: true, message: '请选择活动开始时间', trigger: 'change' }],
endAt: [{ required: true, message: '请选择活动结束时间', trigger: 'change' }],
activityContent: [{ required: true, message: '请输入活动内容' }]
activityContent:[{ required: true, message: '请输入活动内容' }]
}
onBeforeMount(() => {
// Initialize if needed
})
/**
@ -136,8 +85,8 @@ function handleCreate() {
type: 'create',
title: '新增活动',
})
// initData()
formData.value.status = 1
formData.value.maxSignupNum = 0
}
/**
@ -156,32 +105,26 @@ async function handleEdit(record = {}) {
return
}
hideSpining()
//
formData.value = {
...data,
//
endSignupAt: data.endSignupAt ? dayjs(data.endSignupAt) : null,
startAt: data.startAt ? dayjs(data.startAt) : null,
endAt: data.endAt ? dayjs(data.endAt) : null
}
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.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 = []
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)
}
/**
* 确定
*/
@ -189,23 +132,12 @@ 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,
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)) : [],
signupNum: formData.value.signupNum || 0,
status: 1
status:1
}
let result = null
switch (modal.value.type) {
case 'create':
@ -214,7 +146,7 @@ function handleOk() {
})
break
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)
})
break
@ -229,11 +161,12 @@ function handleOk() {
hideLoading()
}
})
.catch((e) => {
hideLoading()
})
.catch((e) => {
hideLoading()
})
}
/**
* 取消
*/
@ -241,6 +174,13 @@ 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)
};
/**
* 关闭后

View File

@ -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,9 +117,7 @@ function handleOk() {
const params = {
...values,
status:1,
imgs:formData.value.imgs.length>0?formData.value.imgs.map(item=>spliceUrl(item)):[],
num:formData.value.num||0,
roomType:formData.value.roomType||1,
imgs:formData.value.imgs.length>0?formData.value.imgs.map(item=>spliceUrl(item)):[]
}
let result = null
switch (modal.value.type) {

View File

@ -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' },
]

View File

@ -1,29 +1,4 @@
<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">
@ -32,48 +7,10 @@
<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>
</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>
dayjs(record.endAt).format('YYYY-MM-DD HH:mm:ss')}}</span>
</template>
<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>
<template #title>审核</template>
<i class='iconfont icon-shenhe' style='font-size:14px;color:#faad14'></i>
@ -85,12 +22,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: 3, label: '通过' }, { value: 99, label: '驳回' }]"></a-radio-group>
: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>
@ -106,55 +43,30 @@ import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
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 { 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: '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' },
{ title: '时间段', dataIndex: 'startAt', width: 300, align: 'center' },
{ title: '备注', dataIndex: 'remark' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
searchFormData.value = {
applyType: '',
}
const remark = ref('')
const currentInfo = ref({})
const auditStatus = ref(3)
const auditStatus = ref(2)
const editDialogRef = ref()
const open = ref(false)
const currentForm = ref({})
const applyThemeMap = {
1: '开会',
2: '学术报告',
3: '活动',
4: '其他',
}
const imgOpen = ref(false)
getPageList()
/**
* 获取用户列表
@ -166,7 +78,6 @@ async function getPageList() {
const { pageSize, current } = paginationState
const { success, data, total } = await apis.mettingYuYue
.getDataList({
applyType: searchFormData.value.applyType,
pageSize,
current: current,
})
@ -185,9 +96,13 @@ async function getPageList() {
hideLoading()
}
}
const auditHandleEdit = (obj = {}) => {
currentForm.value = obj
open.value = true
const auditHandleEdit = (obj = {}, type) => {
currentInfo.value = obj
if (type === 'audit') {
open.value = true
} else {
imgOpen.value = true
}
}
const handleClick = async () => {
@ -217,10 +132,9 @@ const handleAuditEdit = async () => {
const params = {
...currentForm.value,
status: auditStatus.value,
remark: remark.value,
// num: currentForm.value.num || 0,
remark: remark.value
}
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()
})
if (config('http.code.success') === result?.success) {
@ -263,7 +177,6 @@ function handleResetSearch() {
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -31,11 +31,6 @@
<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%"
@ -44,13 +39,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="formData.content"
<a-textarea :placeholder="'请输入店铺描述'" v-model:value="content"
:auto-size="{ minRows: 2, maxRows: 5 }"></a-textarea>
</a-form-item>
</a-col>
@ -61,9 +56,9 @@
</a-form-item>
</a-col>
<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"
:fileNumber="10" />
:fileNumber="1" />
</a-form-item>
</a-col>
</a-row>
@ -127,10 +122,11 @@ 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 {
@ -164,14 +160,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.imgs?.map(url => config('http.apiBasic') + url) || []
formData.value.storeCover=data.storeCover?[config('http.apiBasic')+data.storeCover]:[]
formData.value.img=data.img?[config('http.apiBasic')+data.img]:[]
initData()
}
/**
@ -185,12 +181,11 @@ function handleOk() {
const params = {
...values,
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),
longitude: parseFloat(formData.value.longitude),
status: 1
status:1
}
console.log("====",params)
let result = null
switch (modal.value.type) {
case 'create':

View File

@ -229,4 +229,4 @@ async function onOk() {
}
</script>
<style lang="less" scoped></style>
<style lang="less" scoped></style>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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" :scroll="{ x: 1000 }">
:pagination="paginationState" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="'url' === column.dataIndex">
<a-button type="link" @click="auditHandleEdit(record, 'img')">点击查看</a-button>
@ -12,9 +12,6 @@
<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>
@ -22,13 +19,7 @@
<i class='iconfont icon-shenhe' style='font-size:14px;color:#faad14'></i>
</a-tooltip>
</x-action-button>
<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">
<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>
@ -65,7 +56,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">
@ -86,27 +77,23 @@ import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
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 { orderStatus } from '@/enums/index.js'
import dayjs from 'dayjs'
import { status } from 'nprogress'
defineOptions({
name: 'orderList',
})
const { t } = useI18n() // t
const columns = [
// { 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: '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: 'status', width: 120, 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 editDialogRef = ref()
const open = ref(false)
const imgOpen = ref(false)
const imgOpen=ref(false)
getPageList()
/**
* 获取用户列表
@ -167,7 +154,7 @@ const handleClick = async () => {
})
if (config('http.code.success') === result?.success) {
message.success('已审核')
open.value = false
open.value=false
getPageList()
}
} catch (error) {
@ -175,36 +162,6 @@ 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()
}
})()
})
},
})
}
/**
* 删除
*/
@ -217,11 +174,12 @@ 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.delMenu(value.id, params).catch(() => {
const { success } = await apis.orderList.updateMenu(value.id, params).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {