cxw #32
@ -31,6 +31,10 @@ export const PaidMemberBenefitApi = {
|
|||||||
updatePaidMemberBenefit: async (data: PaidMemberBenefitVO) => {
|
updatePaidMemberBenefit: async (data: PaidMemberBenefitVO) => {
|
||||||
return await request.put({ url: `/paidmemberbenefit/paid-member-benefit/update`, data })
|
return await request.put({ url: `/paidmemberbenefit/paid-member-benefit/update`, data })
|
||||||
},
|
},
|
||||||
|
// 修改会员权益状态
|
||||||
|
updatePaidMemberBenefitStatus: async (data: any) => {
|
||||||
|
return await request.put({ url: `/paidmemberbenefit/paid-member-benefit/updateStatus`, data})
|
||||||
|
},
|
||||||
|
|
||||||
// 删除付费会员权益
|
// 删除付费会员权益
|
||||||
deletePaidMemberBenefit: async (id: number) => {
|
deletePaidMemberBenefit: async (id: number) => {
|
||||||
|
@ -227,6 +227,7 @@ export enum DICT_TYPE {
|
|||||||
PROMOTION_BARGAIN_RECORD_STATUS = 'promotion_bargain_record_status', // 砍价记录的状态
|
PROMOTION_BARGAIN_RECORD_STATUS = 'promotion_bargain_record_status', // 砍价记录的状态
|
||||||
PROMOTION_COMBINATION_RECORD_STATUS = 'promotion_combination_record_status', // 拼团记录的状态
|
PROMOTION_COMBINATION_RECORD_STATUS = 'promotion_combination_record_status', // 拼团记录的状态
|
||||||
PROMOTION_BANNER_POSITION = 'promotion_banner_position', // banner 定位
|
PROMOTION_BANNER_POSITION = 'promotion_banner_position', // banner 定位
|
||||||
|
MEMBER_BENEFIT_STATUS = 'member_benefit_status', // 会员权益状态
|
||||||
|
|
||||||
// ========== CRM - 客户管理模块 ==========
|
// ========== CRM - 客户管理模块 ==========
|
||||||
CRM_AUDIT_STATUS = 'crm_audit_status', // CRM 审批状态
|
CRM_AUDIT_STATUS = 'crm_audit_status', // CRM 审批状态
|
||||||
|
@ -17,9 +17,14 @@
|
|||||||
<el-input v-model="formData.intro" placeholder="请输入描述" />
|
<el-input v-model="formData.intro" placeholder="请输入描述" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-radio-group v-model="formData.status">
|
<el-select v-model="formData.status" class="!w-240px" placeholder="请选择" clearable>
|
||||||
<el-radio label="1">请选择字典生成</el-radio>
|
<el-option
|
||||||
</el-radio-group>
|
v-for="dict in getIntDictOptions(DICT_TYPE.MEMBER_BENEFIT_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="排序" prop="sort">
|
<el-form-item label="排序" prop="sort">
|
||||||
<el-input v-model="formData.sort" placeholder="请输入排序" />
|
<el-input v-model="formData.sort" placeholder="请输入排序" />
|
||||||
@ -33,7 +38,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PaidMemberBenefitApi, PaidMemberBenefitVO } from '@/api/mall/promotion/memberbenefit'
|
import { PaidMemberBenefitApi, PaidMemberBenefitVO } from '@/api/mall/promotion/memberbenefit'
|
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
/** 付费会员权益 表单 */
|
/** 付费会员权益 表单 */
|
||||||
defineOptions({ name: 'PaidMemberBenefitForm' })
|
defineOptions({ name: 'PaidMemberBenefitForm' })
|
||||||
|
|
||||||
|
@ -36,13 +36,13 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-select
|
<el-select v-model="queryParams.status" class="!w-240px" placeholder="请选择" clearable>
|
||||||
v-model="queryParams.status"
|
<el-option
|
||||||
placeholder="请选择状态"
|
v-for="dict in getIntDictOptions(DICT_TYPE.MEMBER_BENEFIT_STATUS)"
|
||||||
clearable
|
:key="dict.value"
|
||||||
class="!w-240px"
|
:label="dict.label"
|
||||||
>
|
:value="dict.value"
|
||||||
<el-option label="请选择字典生成" value="" />
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="排序" prop="sort">
|
<!-- <el-form-item label="排序" prop="sort">
|
||||||
@ -96,7 +96,19 @@
|
|||||||
<el-table-column label="名称" align="center" prop="name" />
|
<el-table-column label="名称" align="center" prop="name" />
|
||||||
<el-table-column label="图标地址" align="center" prop="iconUrl" />
|
<el-table-column label="图标地址" align="center" prop="iconUrl" />
|
||||||
<el-table-column label="描述" align="center" prop="intro" />
|
<el-table-column label="描述" align="center" prop="intro" />
|
||||||
<el-table-column label="状态" align="center" prop="status" />
|
<el-table-column align="center" label="状态" min-width="80">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-switch
|
||||||
|
v-model="row.status"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"
|
||||||
|
active-text="显示"
|
||||||
|
inactive-text="隐藏"
|
||||||
|
inline-prompt
|
||||||
|
@click="handleStatusChange(row)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="排序" align="center" prop="sort" />
|
<el-table-column label="排序" align="center" prop="sort" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="创建时间"
|
label="创建时间"
|
||||||
@ -144,7 +156,8 @@ import { dateFormatter } from '@/utils/formatTime'
|
|||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
import { PaidMemberBenefitApi, PaidMemberBenefitVO } from '@/api/mall/promotion/memberbenefit'
|
import { PaidMemberBenefitApi, PaidMemberBenefitVO } from '@/api/mall/promotion/memberbenefit'
|
||||||
import PaidMemberBenefitForm from './PaidMemberBenefitForm.vue'
|
import PaidMemberBenefitForm from './PaidMemberBenefitForm.vue'
|
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import { ProductSpuStatusEnum } from '@/utils/constants'
|
||||||
/** 付费会员权益 列表 */
|
/** 付费会员权益 列表 */
|
||||||
defineOptions({ name: 'PaidMemberBenefit' })
|
defineOptions({ name: 'PaidMemberBenefit' })
|
||||||
|
|
||||||
@ -166,13 +179,13 @@ const queryParams = reactive({
|
|||||||
})
|
})
|
||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
const exportLoading = ref(false) // 导出的加载中
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await PaidMemberBenefitApi.getPaidMemberBenefitPage(queryParams)
|
const data = await PaidMemberBenefitApi.getPaidMemberBenefitPage(queryParams)
|
||||||
list.value = data.list
|
list.value = data.list
|
||||||
|
console.table(list.value)
|
||||||
total.value = data.total
|
total.value = data.total
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
@ -229,4 +242,22 @@ const handleExport = async () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
|
/** 更新显示/隐藏状态 */
|
||||||
|
const handleStatusChange = async (row: any) => {
|
||||||
|
try {
|
||||||
|
// 二次确认
|
||||||
|
const text = row.status ? '显示' : '隐藏'
|
||||||
|
await message.confirm(`确认要${text}"${row.name}"吗?`)
|
||||||
|
// 发起修改
|
||||||
|
await PaidMemberBenefitApi.updatePaidMemberBenefitStatus({id: row.id, status: row.status })
|
||||||
|
message.success(text + '成功')
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {
|
||||||
|
row.status =
|
||||||
|
row.status === ProductSpuStatusEnum.DISABLE.status
|
||||||
|
? ProductSpuStatusEnum.ENABLE.status
|
||||||
|
: ProductSpuStatusEnum.DISABLE.status
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.member.controller.admin.memberbenefit;
|
|||||||
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitPageReqVO;
|
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitPageReqVO;
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitRespVO;
|
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitRespVO;
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitSaveReqVO;
|
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitStatusReqVO;
|
||||||
import cn.iocoder.yudao.module.member.dal.dataobject.memberbenefit.PaidMemberBenefitDO;
|
import cn.iocoder.yudao.module.member.dal.dataobject.memberbenefit.PaidMemberBenefitDO;
|
||||||
import cn.iocoder.yudao.module.member.service.memberbenefit.PaidMemberBenefitService;
|
import cn.iocoder.yudao.module.member.service.memberbenefit.PaidMemberBenefitService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -54,6 +55,13 @@ public class PaidMemberBenefitController {
|
|||||||
paidMemberBenefitService.updatePaidMemberBenefit(updateReqVO);
|
paidMemberBenefitService.updatePaidMemberBenefit(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
@PutMapping("/updateStatus")
|
||||||
|
@Operation(summary = "更新付费会员权益")
|
||||||
|
@PreAuthorize("@ss.hasPermission('paidmemberbenefit:paid-member-benefit:update')")
|
||||||
|
public CommonResult<Boolean> updatePaidMemberBenefitStatus(@RequestBody PaidMemberBenefitStatusReqVO req) {
|
||||||
|
paidMemberBenefitService.updatePaidMemberBenefitStatus(req);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除付费会员权益")
|
@Operation(summary = "删除付费会员权益")
|
||||||
|
@ -25,7 +25,7 @@ public class PaidMemberBenefitPageReqVO extends PageParam {
|
|||||||
private String intro;
|
private String intro;
|
||||||
|
|
||||||
@Schema(description = "状态:(默认)0隐藏 1显示", example = "1")
|
@Schema(description = "状态:(默认)0隐藏 1显示", example = "1")
|
||||||
private Boolean status;
|
private Integer status;
|
||||||
|
|
||||||
@Schema(description = "排序")
|
@Schema(description = "排序")
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
@ -31,7 +31,7 @@ public class PaidMemberBenefitRespVO {
|
|||||||
|
|
||||||
@Schema(description = "状态:(默认)0隐藏 1显示", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "状态:(默认)0隐藏 1显示", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
@ExcelProperty("状态:(默认)0隐藏 1显示")
|
@ExcelProperty("状态:(默认)0隐藏 1显示")
|
||||||
private Boolean status;
|
private Integer status;
|
||||||
|
|
||||||
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@ExcelProperty("排序")
|
@ExcelProperty("排序")
|
||||||
|
@ -25,7 +25,7 @@ public class PaidMemberBenefitSaveReqVO {
|
|||||||
|
|
||||||
@Schema(description = "状态:(默认)0隐藏 1显示", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "状态:(默认)0隐藏 1显示", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
@NotNull(message = "状态:(默认)0隐藏 1显示不能为空")
|
@NotNull(message = "状态:(默认)0隐藏 1显示不能为空")
|
||||||
private Boolean status;
|
private Integer status;
|
||||||
|
|
||||||
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotNull(message = "排序不能为空")
|
@NotNull(message = "排序不能为空")
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
package cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 付费会员权益新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class PaidMemberBenefitStatusReqVO {
|
||||||
|
@Schema(description = " 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "29131")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "状态:(默认)0隐藏 1显示", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@NotNull(message = "状态:(默认)0隐藏 1显示不能为空")
|
||||||
|
private Integer status;
|
||||||
|
}
|
@ -42,7 +42,7 @@ public class PaidMemberBenefitDO extends BaseDO {
|
|||||||
/**
|
/**
|
||||||
* 状态:(默认)0隐藏 1显示
|
* 状态:(默认)0隐藏 1显示
|
||||||
*/
|
*/
|
||||||
private Boolean status;
|
private Integer status;
|
||||||
/**
|
/**
|
||||||
* 排序
|
* 排序
|
||||||
*/
|
*/
|
||||||
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitPageReqVO;
|
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitPageReqVO;
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitSaveReqVO;
|
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitStatusReqVO;
|
||||||
import cn.iocoder.yudao.module.member.dal.dataobject.memberbenefit.PaidMemberBenefitDO;
|
import cn.iocoder.yudao.module.member.dal.dataobject.memberbenefit.PaidMemberBenefitDO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -53,4 +54,9 @@ public interface PaidMemberBenefitService {
|
|||||||
*/
|
*/
|
||||||
PageResult<PaidMemberBenefitDO> getPaidMemberBenefitPage(PaidMemberBenefitPageReqVO pageReqVO);
|
PageResult<PaidMemberBenefitDO> getPaidMemberBenefitPage(PaidMemberBenefitPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新付费会员状态
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
void updatePaidMemberBenefitStatus(PaidMemberBenefitStatusReqVO req);
|
||||||
}
|
}
|
@ -1,7 +1,9 @@
|
|||||||
package cn.iocoder.yudao.module.member.service.memberbenefit;
|
package cn.iocoder.yudao.module.member.service.memberbenefit;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitPageReqVO;
|
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitPageReqVO;
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitSaveReqVO;
|
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.member.controller.admin.memberbenefit.vo.PaidMemberBenefitStatusReqVO;
|
||||||
import cn.iocoder.yudao.module.member.dal.dataobject.memberbenefit.PaidMemberBenefitDO;
|
import cn.iocoder.yudao.module.member.dal.dataobject.memberbenefit.PaidMemberBenefitDO;
|
||||||
import cn.iocoder.yudao.module.member.dal.mysql.memberbenefit.PaidMemberBenefitMapper;
|
import cn.iocoder.yudao.module.member.dal.mysql.memberbenefit.PaidMemberBenefitMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -72,4 +74,12 @@ public class PaidMemberBenefitServiceImpl implements PaidMemberBenefitService {
|
|||||||
return paidMemberBenefitMapper.selectPage(pageReqVO);
|
return paidMemberBenefitMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePaidMemberBenefitStatus(PaidMemberBenefitStatusReqVO req) {
|
||||||
|
// 校验存在
|
||||||
|
validatePaidMemberBenefitExists(req.getId());
|
||||||
|
// 更新状态
|
||||||
|
paidMemberBenefitMapper.updateById(new PaidMemberBenefitDO().setId(req.getId()).setStatus(req.getStatus()));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.srbscribe.service.reservation;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||||
import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper;
|
|
||||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.reservation.vo.LitemallReservationPageReqVO;
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.reservation.vo.LitemallReservationPageReqVO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.reservation.vo.LitemallReservationSaveReqVO;
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.reservation.vo.LitemallReservationSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.technician.vo.ServiceTimeVO;
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.technician.vo.ServiceTimeVO;
|
||||||
@ -18,7 +17,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user