修复案场礼品bug

This commit is contained in:
Leo_Ding 2025-06-30 14:36:12 +08:00
parent 0aaea60ea5
commit b811bf9370
4 changed files with 8 additions and 7 deletions

View File

@ -78,7 +78,7 @@ export default {
// user // user
'pages.system.user.add': '添加用户', 'pages.system.user.add': '添加用户',
'pages.system.user.edit': '编辑用户', 'pages.system.user.edit': '编辑用户',
'pages.system.user.delTip': '确定删除该用户吗', 'pages.system.user.delTip': '确定删除当前项',
'pages.system.user.form.username': '用户名', 'pages.system.user.form.username': '用户名',
'pages.system.user.form.username.placeholder': '请输入用户名', 'pages.system.user.form.username.placeholder': '请输入用户名',
'pages.system.user.form.username.required': '用户名是必填项!', 'pages.system.user.form.username.required': '用户名是必填项!',

View File

@ -129,14 +129,14 @@ function handleCreate() {
/** /**
* 编辑 * 编辑
*/ */
async function handleEdit(record = {}) { async function handleEdit(id) {
showModal({ showModal({
type: 'edit', type: 'edit',
title: '编辑礼品', title: '编辑礼品',
}) })
try { try {
showSpining() showSpining()
const { data, success } = await apis.houseProduct.getItem(record.id).catch() const { data, success } = await apis.houseProduct.getItem(id).catch()
if (!success) { if (!success) {
hideModal() hideModal()
return return

View File

@ -59,11 +59,11 @@
<a-tag v-if="!record.isDaily" :color="'red'"></a-tag> <a-tag v-if="!record.isDaily" :color="'red'"></a-tag>
</template> </template>
<template v-if="'action' === column.key"> <template v-if="'action' === column.key">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)"> <x-action-button @click="$refs.editDialogRef.handleEdit(record.product.id)">
<a-tooltip> <a-tooltip>
<template #title> {{ $t('pages.system.user.edit') }}</template> <template #title> {{ $t('pages.system.user.edit') }}</template>
<edit-outlined /> </a-tooltip></x-action-button> <edit-outlined /> </a-tooltip></x-action-button>
<x-action-button @click="handleDelete(record)"> <x-action-button @click="handleDelete(record.product.id)">
<a-tooltip> <a-tooltip>
<template #title>{{ $t('pages.system.delete') }}</template> <template #title>{{ $t('pages.system.delete') }}</template>
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button> <delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button>
@ -143,7 +143,7 @@ async function getPageList() {
/** /**
* 删除 * 删除
*/ */
function handleDelete({ id }) { function handleDelete(id) {
Modal.confirm({ Modal.confirm({
title: t('pages.system.user.delTip'), title: t('pages.system.user.delTip'),
content: t('button.confirm'), content: t('button.confirm'),

View File

@ -41,6 +41,7 @@ import { message } from 'ant-design-vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import GxUpload from '@/components/GxUpload/index.vue' import GxUpload from '@/components/GxUpload/index.vue'
import { spliceUrl } from '@/utils/util'
const areaFormRef = ref() const areaFormRef = ref()
const emit = defineEmits(['ok']) const emit = defineEmits(['ok'])
const { t } = useI18n() // t const { t } = useI18n() // t
@ -116,7 +117,7 @@ function handleOk() {
const params = { const params = {
name: formData.value.name, name: formData.value.name,
status: formData.value.status, status: formData.value.status,
img: fileList.value[0] img:formData.value.fileList?spliceUrl(formData.value.fileList[0]):['']
} }
let result = null let result = null
switch (modal.value.type) { switch (modal.value.type) {