This commit is contained in:
qiuyuan 2025-08-06 19:18:51 +08:00
parent 7956f87572
commit 9a17513b61
3 changed files with 47 additions and 28 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<a-modal :open="modal.open" :title="modal.title" :width="640" :confirm-loading="modal.confirmLoading" <a-modal :open="modal.open" :title="modal.title" :width="640" :confirm-loading="modal.confirmLoading"
:after-close="onAfterClose" :cancel-text="cancelText" :ok-text="okText" @ok="handleOk" @cancel="handleCancel" > :after-close="onAfterClose" :cancel-text="cancelText" :ok-text="okText" @ok="handleOk" @cancel="handleCancel">
<a-spin :spinning="spining"> <a-spin :spinning="spining">
<a-form ref="formRef" :model="formData" :rules="formRules"> <a-form ref="formRef" :model="formData" :rules="formRules">
<a-card class="mb-8-2"> <a-card class="mb-8-2">
@ -21,21 +21,34 @@
<a-input v-model:value="formData.openAt" placeholder="请输入活动时间" /> <a-input v-model:value="formData.openAt" placeholder="请输入活动时间" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24">
<a-form-item label="活动开始时间" name="startAt">
<a-date-picker v-model:value="formData.startAt" placeholder="请选择活动开始时间"
style="width: 100%;" />
</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%;" />
</a-form-item>
</a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item :label="'状态'" name="status"> <a-form-item :label="'状态'" name="status">
<a-radio-group v-model:value="formData.status" :options="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-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item :label="'活动图片'" name="cover"> <a-form-item :label="'活动图片'" name="cover">
<gx-upload v-model="formData.cover" accept-types=".jpg,.png,.webp" <gx-upload v-model="formData.cover" accept-types=".jpg,.png,.webp" :fileNumber="1" />
:fileNumber="1" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item :label="'背景图片'" name="images"> <a-form-item :label="'背景图片'" name="images">
<gx-upload v-model="formData.images" accept-types=".jpg,.png,.webp" <gx-upload v-model="formData.images" accept-types=".jpg,.png,.webp" :fileNumber="1" />
:fileNumber="1" />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -68,9 +81,9 @@ const fileList = ref([])
formRules.value = { formRules.value = {
title: [{ required: true, message: '请输入活动名称' }], title: [{ required: true, message: '请输入活动名称' }],
openAt: [{ required: true, message: '请输入活动时间' }], openAt: [{ required: true, message: '请输入活动时间' }],
cover: [{required: false, message: '请上传图片', trigger: 'change'}], cover: [{ required: false, message: '请上传图片', trigger: 'change' }],
images: [{ required: false, message: '请上传图片', trigger: 'change' }], images: [{ required: false, message: '请上传图片', trigger: 'change' }],
activityContent:[{ required: true, message: '请输入活动内容' }] activityContent: [{ required: true, message: '请输入活动内容' }]
} }
onBeforeMount(() => { onBeforeMount(() => {
@ -108,13 +121,13 @@ async function handleEdit(record = {}) {
formData.value = { ...data } formData.value = { ...data }
if (data.images && data.images.length > 0) { if (data.images && data.images.length > 0) {
formData.value.images = data.images.map(item => config('http.apiBasic') + item) formData.value.images = data.images.map(item => config('http.apiBasic') + item)
}else{ } else {
formData.value.images=[] formData.value.images = []
} }
if(data.cover){ if (data.cover) {
formData.value.cover=[config('http.apiBasic')+data.cover] formData.value.cover = [config('http.apiBasic') + data.cover]
}else{ } else {
formData.value.cover=[] formData.value.cover = []
} }
} catch (error) { } catch (error) {
message.error({ content: error.message }) message.error({ content: error.message })
@ -134,9 +147,9 @@ function handleOk() {
showLoading() showLoading()
const params = { const params = {
...values, ...values,
cover: formData.value.cover?spliceUrl(formData.value.cover[0]):'', cover: formData.value.cover ? spliceUrl(formData.value.cover[0]) : '',
images: formData.value.images ? formData.value.images.map(item => spliceUrl(item)) : [], images: formData.value.images ? formData.value.images.map(item => spliceUrl(item)) : [],
status:1 status: 1
} }
let result = null let result = null
switch (modal.value.type) { switch (modal.value.type) {

View File

@ -12,6 +12,9 @@
<a-tag :color="orderStatus.getColor(record.status)">{{ <a-tag :color="orderStatus.getColor(record.status)">{{
orderStatus.getName(record.status) }}</a-tag> orderStatus.getName(record.status) }}</a-tag>
</template> </template>
<template v-if="'createdAt' === column.dataIndex">
{{ dayjs(record.createdAt).format('YYYY-MM-DD') }}
</template>
<template v-if="'action' === column.key"> <template v-if="'action' === column.key">
<x-action-button @click="auditHandleEdit(record, 'audit')" v-if="record.status === 1"> <x-action-button @click="auditHandleEdit(record, 'audit')" v-if="record.status === 1">
<a-tooltip> <a-tooltip>
@ -80,20 +83,23 @@ import EditDialog from './components/EditDialog.vue'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue' import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { orderStatus } from '@/enums/index.js' import { orderStatus } from '@/enums/index.js'
import { status } from 'nprogress' import dayjs from 'dayjs'
defineOptions({ defineOptions({
name: 'orderList', name: 'orderList',
}) })
const { t } = useI18n() // t const { t } = useI18n() // t
const columns = [ const columns = [
{ title: '用户名称', dataIndex: 'customerName' }, // { title: '', dataIndex: 'customerName', width: 100 },
{ title: '工单分类', dataIndex: 'label' }, { title: '工单分类', dataIndex: 'label', width: 100 },
{ title: '工单标题', dataIndex: 'title', ellipsis: true }, // { title: '', dataIndex: 'content', ellipsis: true },
{ title: '工单内容', dataIndex: 'content', ellipsis: true }, { title: '工单内容', dataIndex: 'title', ellipsis: true, width: 200 },
{ title: '图片/视频', dataIndex: 'url', width: 120,align:'center' }, { title: '图片/视频', dataIndex: 'url', width: 100, align: 'center' },
{ title: '工作地点', dataIndex: 'address', ellipsis: true },
{ title: '创建时间', dataIndex: 'createAt' }, { title: '维修地点', dataIndex: 'address', ellipsis: true, width: 200 },
{ title: '上门时间', dataIndex: 'startAt' }, { title: '报修人', dataIndex: 'concatName', width: 180 },
{ title: '联系电话', dataIndex: 'customerPhone', width: 180 },
{ title: '创建时间', dataIndex: 'createdAt', width: 180 },
// { title: '', dataIndex: 'startAt' },
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' }, { title: '状态', dataIndex: 'status', width: 120, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]