福利项目开启关闭按钮
This commit is contained in:
@@ -83,6 +83,7 @@ public class WelfareMineController {
|
|||||||
cnd.and("wp.isDisabled", "=", 0);
|
cnd.and("wp.isDisabled", "=", 0);
|
||||||
cnd.andEX("YEAR(wp.choiceTimeStart)", "=", year);
|
cnd.andEX("YEAR(wp.choiceTimeStart)", "=", year);
|
||||||
cnd.andEX("wl.userId", "=", SecurityUtil.getUserId());
|
cnd.andEX("wl.userId", "=", SecurityUtil.getUserId());
|
||||||
|
cnd.andEX("wp.isUnseal", "=", true);
|
||||||
cnd.desc("wp.choiceTimeStart");
|
cnd.desc("wp.choiceTimeStart");
|
||||||
cnd.groupBy("wl.id");
|
cnd.groupBy("wl.id");
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
|
|||||||
+12
@@ -1,6 +1,7 @@
|
|||||||
package com.budwk.app.zhgh.welfare.controller;
|
package com.budwk.app.zhgh.welfare.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.dev33.satoken.annotation.SaMode;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.budwk.app.base.annotation.SLog;
|
import com.budwk.app.base.annotation.SLog;
|
||||||
import com.budwk.app.base.page.Pagination;
|
import com.budwk.app.base.page.Pagination;
|
||||||
@@ -80,6 +81,7 @@ public class WelfareProjectMangeController {
|
|||||||
if (StrUtil.isNotBlank(project.getId())) {
|
if (StrUtil.isNotBlank(project.getId())) {
|
||||||
projectService.updateProject(project);
|
projectService.updateProject(project);
|
||||||
} else {
|
} else {
|
||||||
|
project.setIsUnseal(false);
|
||||||
projectService.saveProject(project);
|
projectService.saveProject(project);
|
||||||
}
|
}
|
||||||
return Result.success();
|
return Result.success();
|
||||||
@@ -146,4 +148,14 @@ public class WelfareProjectMangeController {
|
|||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@SaCheckPermission("welfare.project.mange")
|
||||||
|
public Result welfareStatusChange(@Valid String id, @Valid Boolean isUnseal) {
|
||||||
|
projectService.update(Chain.make("isUnseal", isUnseal), Cnd.where("id", "=", id));
|
||||||
|
projectService.dao().update(WelfareProject.class,
|
||||||
|
Chain.make("isUnseal", isUnseal),
|
||||||
|
Cnd.where("id", "=", id));
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public class WelfareUserSelectController {
|
|||||||
cnd.andEX("YEAR(wp.choiceTimeStart)", "in", year);
|
cnd.andEX("YEAR(wp.choiceTimeStart)", "in", year);
|
||||||
cnd.and("wp.isDisabled", "=", 0);
|
cnd.and("wp.isDisabled", "=", 0);
|
||||||
cnd.groupBy("wp.id");
|
cnd.groupBy("wp.id");
|
||||||
|
cnd.andEX("wp.isUnseal", "=", true);
|
||||||
cnd.desc("YEAR(wp.choiceTimeStart)");
|
cnd.desc("YEAR(wp.choiceTimeStart)");
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
Pagination pagination = welfareProjectService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
Pagination pagination = welfareProjectService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||||
|
|||||||
@@ -74,6 +74,11 @@ public class WelfareProject extends BaseModel implements SysHomeConvert {
|
|||||||
@ColDefine(type = ColType.DATETIME)
|
@ColDefine(type = ColType.DATETIME)
|
||||||
private Date choiceTimeEnd;
|
private Date choiceTimeEnd;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("是否开启")
|
||||||
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
|
private Boolean isUnseal;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@Comment("逾期补发结束时间")
|
@Comment("逾期补发结束时间")
|
||||||
@ColDefine(type = ColType.DATETIME)
|
@ColDefine(type = ColType.DATETIME)
|
||||||
|
|||||||
@@ -51,6 +51,14 @@ layout("/layouts/platform.html"){
|
|||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
v-for="column in tableColumns"
|
v-for="column in tableColumns"
|
||||||
>
|
>
|
||||||
|
<template scope="{row}" v-if="column.prop=='isUnseal'">
|
||||||
|
<el-switch
|
||||||
|
@change="(val)=>{welfareStatusChange(row.id,row.isUnseal)}"
|
||||||
|
active-color="#13ce66"
|
||||||
|
inactive-color="#ff4949"
|
||||||
|
v-model="row.isUnseal">
|
||||||
|
</el-switch>
|
||||||
|
</template>
|
||||||
<!-- <template scope="{row}" v-if="column.prop=='gift'">-->
|
<!-- <template scope="{row}" v-if="column.prop=='gift'">-->
|
||||||
<!-- <span v-if="row.flexible">福利套餐</span>-->
|
<!-- <span v-if="row.flexible">福利套餐</span>-->
|
||||||
<!-- <span v-else>{{row.gift}}</span>-->
|
<!-- <span v-else>{{row.gift}}</span>-->
|
||||||
@@ -261,7 +269,8 @@ layout("/layouts/platform.html"){
|
|||||||
{ prop: "year", label: "年度" },
|
{ prop: "year", label: "年度" },
|
||||||
{ prop: "name", label: "项目名称" },
|
{ prop: "name", label: "项目名称" },
|
||||||
{ prop: "choiceTimeStart", label: "开始选择时间" },
|
{ prop: "choiceTimeStart", label: "开始选择时间" },
|
||||||
{ prop: "choiceTimeEnd", label: "结束选择时间" }
|
{ prop: "choiceTimeEnd", label: "结束选择时间" },
|
||||||
|
{prop: "isUnseal", label: "是否开启"},
|
||||||
|
|
||||||
// { prop: "gift", label: "福利礼品" },
|
// { prop: "gift", label: "福利礼品" },
|
||||||
// { prop: "provideTimeStart", label: "发放时间" }
|
// { prop: "provideTimeStart", label: "发放时间" }
|
||||||
@@ -296,6 +305,19 @@ layout("/layouts/platform.html"){
|
|||||||
this.sendMsg(data)
|
this.sendMsg(data)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async welfareStatusChange(id, isUnseal) {
|
||||||
|
|
||||||
|
const resp = await this.$axios.post("/platform/welfare/project/mange/welfareStatusChange", {
|
||||||
|
id: id,
|
||||||
|
isUnseal: isUnseal
|
||||||
|
})
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.doSearch()
|
||||||
|
this.$message.success(resp.msg)
|
||||||
|
} else {
|
||||||
|
this.$message.error(resp.msg)
|
||||||
|
}
|
||||||
|
},
|
||||||
async save() {
|
async save() {
|
||||||
const formValid = await this.$refs["form"].validate()
|
const formValid = await this.$refs["form"].validate()
|
||||||
if (formValid) {
|
if (formValid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user