核销记录添加编辑功能

This commit is contained in:
Leo_Ding 2025-09-30 15:50:58 +08:00
parent 0dc1d5dc88
commit 899b75ed27
5 changed files with 31 additions and 25 deletions

View File

@ -13,7 +13,7 @@ VITE_ROUTER_HISTORY=hash
# api
# VITE_API_BASIC=https://zh.shibeitong.com
VITE_API_BASIC=http://10.10.1.6:8070
VITE_API_BASIC=http://10.10.1.39:8070
VITE_API_HTTP=/api/v1/
# storage
VITE_STORAGE_NAMESPACE = gin-admin_local_

View File

@ -14,3 +14,5 @@ export const updateItem = (id, params) => request.basic.put(`/api/v1/sign-reward
export const delItem = (id) => request.basic.delete(`/api/v1/sign-rewards/${id}`)
// 获取签到列表
export const getSignInList = (params) => request.basic.get('/api/v1/sign-reward-logs', params)
// 获取签到列表核销
export const updateSingInItem = (id, params) => request.basic.put(`/api/v1/sign-reward-logs/${id}`, params)

View File

@ -6,8 +6,8 @@
<a-card class="mb-8-2">
<a-row :gutter="12">
<a-col :span="24">
<a-form-item :label="'浏览时长'" name="duration">
<a-input :placeholder="'请输入浏览时长'" v-model:value="formData.duration"></a-input>
<a-form-item :label="'浏览时长/秒'" name="duration">
<a-input-number :placeholder="'请输入浏览时长'" v-model:value="formData.duration" style="width: 100%;"></a-input-number>
</a-form-item>
</a-col>
<a-col :span="24">
@ -29,12 +29,12 @@
style="width: 100%;"></a-input-number>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item :label="'信件内容'">
<!-- <a-col :span="24">
<a-form-item :label="'规则说明'">
<x-editor v-model="editorContent" :uploadHandler="uploadHandler"
:height="300"></x-editor>
</a-form-item>
</a-col>
</a-col> -->
<a-col :span="24">
<a-form-item :label="'状态'" name="status">
<a-radio-group v-model:value="formData.status" :options="[
@ -111,7 +111,7 @@ async function handleEdit(record = {}) {
...data,
cycleType: data.maxDays < 0 ? '自然月' : '固定天数',
}
editorContent.value = decryptString(data.content) || ''
// editorContent.value = decryptString(data.content) || ''
} catch (error) {
message.error({ content: error.message })
hideSpining()
@ -128,7 +128,7 @@ function handleOk() {
showLoading()
const params = {
...formData.value,
content: encryptString(editorContent.value),
// content: encryptString(editorContent.value),
}
let result = null

View File

@ -49,15 +49,15 @@
<span>{{ record.duration }}</span>
</template>
<template v-if="column.dataIndex === 'maxCount'">
<span>{{ signInEnum.getName(record.maxCount) }}</span>
<span>{{ record.maxCount }}</span>
</template>
<template v-if="column.dataIndex === 'maxDays'">
<span>{{ record.maxDays }}</span>
</template>
<template v-if="column.dataIndex === 'content'">
<!-- <template v-if="column.dataIndex === 'content'">
<span style="cursor: pointer;color:#1677ff;"
@click="content = decryptString(record.content) || '';qropen = true" type="link">点击查看</span>
</template>
</template> -->
<template v-if="'status' === column.dataIndex">
<a-tag v-if="record.status === 'enabled'" :color="'green'">启用</a-tag>
<a-tag v-if="record.status === 'disabled'" :color="'red'">停用</a-tag>
@ -108,7 +108,7 @@ const columns = [
{ title: '次数/每周期', dataIndex: 'maxCount',align: 'center' },
{ title: '奖励积分', dataIndex: 'points', width: 100, align: 'center' },
{ title: '天数/每周期', dataIndex: 'maxDays', align: 'center' },
{ title: '规则内容', dataIndex: 'content', align: 'center' },
// { title: '', dataIndex: 'content', align: 'center' },
{ title: '状态', dataIndex: 'status', align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]

View File

@ -56,20 +56,20 @@
<span>{{ record.signYear + '年' + record.signMonth + '月' }}</span>
</template>
<template v-if="'status' === column.dataIndex">
<a-tag v-if="record.status === 'checking'" :color="'orange'">待核销</a-tag>
<a-tag v-if="record.status === 'checked'" :color="'green'">已核销</a-tag>
<a-tag v-if="record.status === 'checked'" :color="'orange'">待核销</a-tag>
<a-tag v-if="record.status === 'success'" :color="'green'">已核销</a-tag>
</template>
<!-- <template v-if="'action' === column.key">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
<template v-if="'action' === column.key">
<x-action-button v-if="record.status === 'checked'" @click="handleDelete(record)">
<a-tooltip>
<template #title> {{ $t('pages.system.user.edit') }}</template>
<template #title>核销</template>
<edit-outlined /> </a-tooltip></x-action-button>
<x-action-button @click="handleDelete(record)">
<!-- <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> -->
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button> -->
</template>
</template>
</a-table>
</a-card>
@ -100,7 +100,7 @@ const columns = [
{ title: '客户电话', dataIndex: 'customerPhone', width: 130, align: 'center' },
{ title: '所属日期', dataIndex: 'signMonth', align: 'center' },
{ title: '状态', dataIndex: 'status', 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' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
@ -135,21 +135,25 @@ async function getPageList() {
/**
* 删除
*/
function handleDelete({ id }) {
function handleDelete(params) {
Modal.confirm({
title: t('pages.system.user.delTip'),
title: '即将核销,是否继续?',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.signIn.delItem(id).catch(() => {
const form={
...params,
status:'success'
}
const { success } = await apis.signIn.updateSingInItem(form.id,form).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
message.success('核销成功')
await getPageList()
}
} catch (error) {