generated from Leo_Ding/web-template
核销记录添加编辑功能
This commit is contained in:
parent
0dc1d5dc88
commit
899b75ed27
2
.env.dev
2
.env.dev
@ -13,7 +13,7 @@ VITE_ROUTER_HISTORY=hash
|
|||||||
|
|
||||||
# api
|
# api
|
||||||
# VITE_API_BASIC=https://zh.shibeitong.com
|
# 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/
|
VITE_API_HTTP=/api/v1/
|
||||||
# storage
|
# storage
|
||||||
VITE_STORAGE_NAMESPACE = gin-admin_local_
|
VITE_STORAGE_NAMESPACE = gin-admin_local_
|
||||||
|
|||||||
@ -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 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 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)
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
<a-card class="mb-8-2">
|
<a-card class="mb-8-2">
|
||||||
<a-row :gutter="12">
|
<a-row :gutter="12">
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'浏览时长'" name="duration">
|
<a-form-item :label="'浏览时长/秒'" name="duration">
|
||||||
<a-input :placeholder="'请输入浏览时长'" v-model:value="formData.duration"></a-input>
|
<a-input-number :placeholder="'请输入浏览时长'" v-model:value="formData.duration" style="width: 100%;"></a-input-number>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
@ -29,12 +29,12 @@
|
|||||||
style="width: 100%;"></a-input-number>
|
style="width: 100%;"></a-input-number>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<!-- <a-col :span="24">
|
||||||
<a-form-item :label="'信件内容'">
|
<a-form-item :label="'规则说明'">
|
||||||
<x-editor v-model="editorContent" :uploadHandler="uploadHandler"
|
<x-editor v-model="editorContent" :uploadHandler="uploadHandler"
|
||||||
:height="300"></x-editor>
|
:height="300"></x-editor>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</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="[
|
<a-radio-group v-model:value="formData.status" :options="[
|
||||||
@ -111,7 +111,7 @@ async function handleEdit(record = {}) {
|
|||||||
...data,
|
...data,
|
||||||
cycleType: data.maxDays < 0 ? '自然月' : '固定天数',
|
cycleType: data.maxDays < 0 ? '自然月' : '固定天数',
|
||||||
}
|
}
|
||||||
editorContent.value = decryptString(data.content) || ''
|
// editorContent.value = decryptString(data.content) || ''
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error({ content: error.message })
|
message.error({ content: error.message })
|
||||||
hideSpining()
|
hideSpining()
|
||||||
@ -128,7 +128,7 @@ function handleOk() {
|
|||||||
showLoading()
|
showLoading()
|
||||||
const params = {
|
const params = {
|
||||||
...formData.value,
|
...formData.value,
|
||||||
content: encryptString(editorContent.value),
|
// content: encryptString(editorContent.value),
|
||||||
|
|
||||||
}
|
}
|
||||||
let result = null
|
let result = null
|
||||||
|
|||||||
@ -49,15 +49,15 @@
|
|||||||
<span>{{ record.duration }}</span>
|
<span>{{ record.duration }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'maxCount'">
|
<template v-if="column.dataIndex === 'maxCount'">
|
||||||
<span>{{ signInEnum.getName(record.maxCount) }}</span>
|
<span>{{ record.maxCount }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'maxDays'">
|
<template v-if="column.dataIndex === 'maxDays'">
|
||||||
<span>{{ record.maxDays }}</span>
|
<span>{{ record.maxDays }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'content'">
|
<!-- <template v-if="column.dataIndex === 'content'">
|
||||||
<span style="cursor: pointer;color:#1677ff;"
|
<span style="cursor: pointer;color:#1677ff;"
|
||||||
@click="content = decryptString(record.content) || '';qropen = true" type="link">点击查看</span>
|
@click="content = decryptString(record.content) || '';qropen = true" type="link">点击查看</span>
|
||||||
</template>
|
</template> -->
|
||||||
<template v-if="'status' === column.dataIndex">
|
<template v-if="'status' === column.dataIndex">
|
||||||
<a-tag v-if="record.status === 'enabled'" :color="'green'">启用</a-tag>
|
<a-tag v-if="record.status === 'enabled'" :color="'green'">启用</a-tag>
|
||||||
<a-tag v-if="record.status === 'disabled'" :color="'red'">停用</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: 'maxCount',align: 'center' },
|
||||||
{ title: '奖励积分', dataIndex: 'points', width: 100, align: 'center' },
|
{ title: '奖励积分', dataIndex: 'points', width: 100, align: 'center' },
|
||||||
{ title: '天数/每周期', dataIndex: 'maxDays', align: 'center' },
|
{ title: '天数/每周期', dataIndex: 'maxDays', align: 'center' },
|
||||||
{ title: '规则内容', dataIndex: 'content', align: 'center' },
|
// { title: '规则内容', dataIndex: 'content', align: 'center' },
|
||||||
{ title: '状态', dataIndex: 'status', 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' },
|
||||||
]
|
]
|
||||||
|
|||||||
@ -56,20 +56,20 @@
|
|||||||
<span>{{ record.signYear + '年' + record.signMonth + '月' }}</span>
|
<span>{{ record.signYear + '年' + record.signMonth + '月' }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="'status' === column.dataIndex">
|
<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="'orange'">待核销</a-tag>
|
||||||
<a-tag v-if="record.status === 'checked'" :color="'green'">已核销</a-tag>
|
<a-tag v-if="record.status === 'success'" :color="'green'">已核销</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 v-if="record.status === 'checked'" @click="handleDelete(record)">
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template #title> {{ $t('pages.system.user.edit') }}</template>
|
<template #title>核销</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)">
|
||||||
<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> -->
|
||||||
</template> -->
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
</a-card>
|
</a-card>
|
||||||
@ -100,7 +100,7 @@ const columns = [
|
|||||||
{ title: '客户电话', dataIndex: 'customerPhone', width: 130, align: 'center' },
|
{ title: '客户电话', dataIndex: 'customerPhone', width: 130, align: 'center' },
|
||||||
{ title: '所属日期', dataIndex: 'signMonth', align: 'center' },
|
{ title: '所属日期', dataIndex: 'signMonth', align: 'center' },
|
||||||
{ title: '状态', dataIndex: 'status', 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 { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
|
||||||
const editDialogRef = ref()
|
const editDialogRef = ref()
|
||||||
@ -135,21 +135,25 @@ async function getPageList() {
|
|||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
function handleDelete({ id }) {
|
function handleDelete(params) {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: t('pages.system.user.delTip'),
|
title: '即将核销,是否继续?',
|
||||||
content: t('button.confirm'),
|
content: t('button.confirm'),
|
||||||
okText: t('button.confirm'),
|
okText: t('button.confirm'),
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
; (async () => {
|
; (async () => {
|
||||||
try {
|
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()
|
throw new Error()
|
||||||
})
|
})
|
||||||
if (config('http.code.success') === success) {
|
if (config('http.code.success') === success) {
|
||||||
resolve()
|
resolve()
|
||||||
message.success(t('component.message.success.delete'))
|
message.success('核销成功')
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user