增加校文体部负责人权限

This commit is contained in:
Paidax
2025-04-07 11:28:33 +08:00
parent 335cd4370f
commit f7bf1fb558
23 changed files with 496 additions and 475 deletions
@@ -235,7 +235,7 @@ public class ActivityBasicScopeController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,H06,H10")) { if (!ShiroUtil.hasAnyRoles("sysadmin,H06,H10,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasAnyRoles(new String[]{"H04", "club01"})) { if (ShiroUtil.hasAnyRoles(new String[]{"H04", "club01"})) {
cnd.and("creator", "=", ShiroUtil.getPrincipalProperty("id")); cnd.and("creator", "=", ShiroUtil.getPrincipalProperty("id"));
} }
@@ -284,7 +284,7 @@ public class ActivityBasicScopeController {
addv("is_H04", ShiroUtil.hasRole("H04")); addv("is_H04", ShiroUtil.hasRole("H04"));
addv("is_H02", ShiroUtil.hasRole("club01")); addv("is_H02", ShiroUtil.hasRole("club01"));
addv("is_H03", ShiroUtil.hasRole("SchoolUnionMemberAdmin")); addv("is_H03", ShiroUtil.hasRole("SchoolUnionMemberAdmin"));
addv("is_sysadmin", ShiroUtil.hasRole("sysadmin")); addv("is_sysadmin", ShiroUtil.hasRole("sysadmin,SCHOOL_UNION_SPORTS_ADMIN"));
addv("unionid", Vi.getUnionId()); addv("unionid", Vi.getUnionId());
}}; }};
} }
@@ -97,7 +97,7 @@ public class ActivityBasicUserController {
cnd.andEX("u.unitid", "=", unitId); cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.personType", "=", personType); cnd.andEX("u.personType", "=", personType);
cnd.andEX("u.userState", "=", userState); cnd.andEX("u.userState", "=", userState);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.andEX("aus.creator", "=", ShiroUtil.getPrincipalProperty("id")); cnd.andEX("aus.creator", "=", ShiroUtil.getPrincipalProperty("id"));
} }
@@ -202,7 +202,7 @@ public class ActivityUnionController {
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) { if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
cnd.and(searchName, "like", "%" + searchKeyword + "%"); cnd.and(searchName, "like", "%" + searchKeyword + "%");
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and("gh.id", "=", basicUnit.getUnionid()); cnd.and("gh.id", "=", basicUnit.getUnionid());
} }
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderBy)) { if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderBy)) {
@@ -233,7 +233,7 @@ public class ActivityUnionController {
try { try {
union.setSource("activity"); union.setSource("activity");
sysUnionService.insert(union); sysUnionService.insert(union);
if (!ShiroUtil.hasAnyRoles("sysadmin.H04")) { if (!ShiroUtil.hasAnyRoles("sysadmin.H04,SCHOOL_UNION_SPORTS_ADMIN")) {
sysUnitService.dao().update(ActivityBasicUnit.class, Chain.make("unionid", union.getId()), Cnd.where("id", "=", Vi.getUnit().getId())); sysUnitService.dao().update(ActivityBasicUnit.class, Chain.make("unionid", union.getId()), Cnd.where("id", "=", Vi.getUnit().getId()));
} }
return Result.success(); return Result.success();
@@ -187,7 +187,7 @@ public class ActivityApplyController {
// cnd.and(new Static("now() > school.applyEndTime")); // cnd.and(new Static("now() > school.applyEndTime"));
// } // }
if (!ShiroUtil.hasAnyRoles("H04,sysadmin")) { if (!ShiroUtil.hasAnyRoles("H04,sysadmin,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and(new Static("JSON_CONTAINS(school.applyWay,JSON_ARRAY( 1))>0")); cnd.and(new Static("JSON_CONTAINS(school.applyWay,JSON_ARRAY( 1))>0"));
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(ShiroUtil.getUserId()))); cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(ShiroUtil.getUserId())));
} }
@@ -664,7 +664,7 @@ public class ActivityApplyController {
""").setParam("unionId", getUnionId()).setParam("userId", ShiroUtil.getUserId()); """).setParam("unionId", getUnionId()).setParam("userId", ShiroUtil.getUserId());
if (!ShiroUtil.hasAnyRoles("H04,sysadmin")) { if (!ShiroUtil.hasAnyRoles("H04,sysadmin,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.where().andLike("school.applyWay ", "1"); cnd.where().andLike("school.applyWay ", "1");
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(ShiroUtil.getUserId()))); cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(ShiroUtil.getUserId())));
} }
@@ -232,7 +232,7 @@ public class ActivityCommonController {
app.sex app.sex
""").setParam("id", id); """).setParam("id", id);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06") && ShiroUtil.hasRole("H04")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN") && ShiroUtil.hasRole("H04")) {
sql1.setVar("union", " AND app.unionId = '" + unionid + "' "); sql1.setVar("union", " AND app.unionId = '" + unionid + "' ");
} }
@@ -245,7 +245,7 @@ public class ActivityCommonController {
Cnd unionCnd = Cnd.NEW(); Cnd unionCnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06") && ShiroUtil.hasRole("H04")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN") && ShiroUtil.hasRole("H04")) {
unionCnd.and("id", "=", unionid); unionCnd.and("id", "=", unionid);
} }
@@ -117,7 +117,7 @@ public class ActivityInfoManageController {
} else if ("four".equals(query)) { } else if ("four".equals(query)) {
cnd.and(new Static("now() > school.endTime")); cnd.and(new Static("now() > school.endTime"));
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("school.belongUnionId", "=", Vi.getUnionId()); cnd.and("school.belongUnionId", "=", Vi.getUnionId());
} }
@@ -88,7 +88,7 @@ public class ActivityReadingController {
cnd.and("close", "!=", true); cnd.and("close", "!=", true);
cnd.and("YEAR(startTime)", "=", year); cnd.and("YEAR(startTime)", "=", year);
cnd.and("activityLevel", "=", activityLevel); cnd.and("activityLevel", "=", activityLevel);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (activityLevel.equals("40002")) { if (activityLevel.equals("40002")) {
cnd.and("belongUnionId", "=", getUnionId()); cnd.and("belongUnionId", "=", getUnionId());
} }
@@ -135,7 +135,7 @@ public class ActivityReadingController {
cnd.and("app.activityId", "=", id); cnd.and("app.activityId", "=", id);
// cnd.and("YEAR(app.applyDate)", "=", year); // cnd.and("YEAR(app.applyDate)", "=", year);
sql.setCondition(cnd); sql.setCondition(cnd);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04") && activityLevel.equals("40002")) { if (ShiroUtil.hasRole("H04") && activityLevel.equals("40002")) {
cnd.and("app.activityUnionId", "=", basicUnit.getUnionid()); cnd.and("app.activityUnionId", "=", basicUnit.getUnionid());
cnd.and("school.belongUnionId", "=", basicUnit.getUnionid()); cnd.and("school.belongUnionId", "=", basicUnit.getUnionid());
@@ -150,7 +150,7 @@ public class ActivityReadingController {
List<NutMap> apply = new ArrayList(); List<NutMap> apply = new ArrayList();
Cnd unionCnd = Cnd.NEW(); Cnd unionCnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
unionCnd.and("id", "=", basicUnit.getUnionid()); unionCnd.and("id", "=", basicUnit.getUnionid());
} }
@@ -353,7 +353,7 @@ public class ActivityReadingController {
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,H10")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,H10,SCHOOL_UNION_SPORTS_ADMIN")) {
if (!user.getUnionid().equals(getUnionId())) { if (!user.getUnionid().equals(getUnionId())) {
setObj(v.getLoginName() + "此用户不是本工会人员"); setObj(v.getLoginName() + "此用户不是本工会人员");
throw new RuntimeException(v.getLoginName() + "此用户不是本工会人员"); throw new RuntimeException(v.getLoginName() + "此用户不是本工会人员");
@@ -214,7 +214,7 @@ public class ActivityRemindController {
@ViReturn @ViReturn
public Object getActivitys() { public Object getActivitys() {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("belongUnionId", "=", Vi.getUnionId()); cnd.and("belongUnionId", "=", Vi.getUnionId());
} }
@@ -79,7 +79,7 @@ public class SiteRecordController {
cnd.and("asr.isRetire","=",isRetire); cnd.and("asr.isRetire","=",isRetire);
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and("asr.reserve_person_unionid", "=", Vi.getUnionId()); cnd.and("asr.reserve_person_unionid", "=", Vi.getUnionId());
} }
if (Strings.isNotBlank(time)) { if (Strings.isNotBlank(time)) {
@@ -100,7 +100,7 @@ public class SiteReserveController {
if (StrUtil.isNotBlank(isRetire)) { if (StrUtil.isNotBlank(isRetire)) {
cnd.and("asr.isRetire","=",isRetire); cnd.and("asr.isRetire","=",isRetire);
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and("reserve_person_id", "=", ShiroUtil.getPrincipalProperty("id")); cnd.and("reserve_person_id", "=", ShiroUtil.getPrincipalProperty("id"));
} }
if (Strings.isNotBlank(time)) { if (Strings.isNotBlank(time)) {
@@ -84,7 +84,7 @@ public class SiteUnionProcessController {
CndPlus cnd = CndPlus.create(); CndPlus cnd = CndPlus.create();
cnd.and("asr.reserve_state", "true".equals(isAudit) ? ">" : "false".equals(isAudit) ? "=" : ">=", 6098); cnd.and("asr.reserve_state", "true".equals(isAudit) ? ">" : "false".equals(isAudit) ? "=" : ">=", 6098);
cnd.and("asr.isRetire","=",0); cnd.and("asr.isRetire","=",0);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and("reserve_person_unionid", "=", Vi.getUnionId()); cnd.and("reserve_person_unionid", "=", Vi.getUnionId());
} }
if (Strings.isNotBlank(time)) { if (Strings.isNotBlank(time)) {
@@ -101,7 +101,7 @@ public class ActivityUnionApplyUserController {
cnd.where().andLike("tissue.name", name); cnd.where().andLike("tissue.name", name);
} }
if (!ShiroUtil.hasAnyRoles("A06,sysadmin")) { if (!ShiroUtil.hasAnyRoles("A06,sysadmin,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=tissue.groupId AND userId='%s') >0".formatted(ShiroUtil.getUserId()))); cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=tissue.groupId AND userId='%s') >0".formatted(ShiroUtil.getUserId())));
} }
@@ -124,7 +124,7 @@ public class ActivityUnionManageController {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT id userId,username userName,loginname loginName,sex,mobile,unitname unitName,unionname unionName FROM `user` $condition SELECT id userId,username userName,loginname loginName,sex,mobile,unitname unitName,unionname unionName FROM `user` $condition
"""); """);
if (!ShiroUtil.hasRole("sysadmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin,SCHOOL_UNION_SPORTS_ADMIN")) {
if (activity_type == 40002) { if (activity_type == 40002) {
cnd.and("unionId", "=", Vi.getUnionId()); cnd.and("unionId", "=", Vi.getUnionId());
} else if (activity_type == 40003) { } else if (activity_type == 40003) {
@@ -158,7 +158,7 @@ public class ActivityUnionManageController {
tissue.setUserId(ShiroUtil.getUserId()); tissue.setUserId(ShiroUtil.getUserId());
} }
tissue.setApplyTime(DateUtil.getDate()); tissue.setApplyTime(DateUtil.getDate());
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
tissue.setState(1); tissue.setState(1);
} else { } else {
tissue.setState(3); tissue.setState(3);
@@ -86,7 +86,7 @@ public class ActivityUnionUserStatisticsController {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("atp.tissueId", "=", activityId); cnd.and("atp.tissueId", "=", activityId);
cnd.andEX("u.unionId", "=", unionId); cnd.andEX("u.unionId", "=", unionId);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (!tissue.getUserId().equals(ShiroUtil.getUserId())) { if (!tissue.getUserId().equals(ShiroUtil.getUserId())) {
if (type == 40002) { if (type == 40002) {
cnd.and("unionId", "=", Vi.getUnionId()); cnd.and("unionId", "=", Vi.getUnionId());
@@ -110,13 +110,13 @@ public class ActivityUnionYearSummaryController {
str += " left join `user` u on su.userId = u.id"; str += " left join `user` u on su.userId = u.id";
if ("2".equals(summaryFrom)) { if ("2".equals(summaryFrom)) {
str += " left join sys_union un on su.tissueId = un.id"; str += " left join sys_union un on su.tissueId = un.id";
if (!ShiroUtil.hasAnyRoles(new String[]{"sysadmin", "A06"})) { if (!ShiroUtil.hasAnyRoles(new String[]{"sysadmin", "A06", "SCHOOL_UNION_SPORTS_ADMIN"})) {
cnd.and("su.tissueId", "=", Vi.getUnionId()); cnd.and("su.tissueId", "=", Vi.getUnionId());
} }
} }
if ("3".equals(summaryFrom)) { if ("3".equals(summaryFrom)) {
str += " left join sys_club club on su.tissueId = club.id"; str += " left join sys_club club on su.tissueId = club.id";
if (!ShiroUtil.hasAnyRoles(new String[]{"sysadmin", "A06"})) { if (!ShiroUtil.hasAnyRoles(new String[]{"sysadmin", "A06", "SCHOOL_UNION_SPORTS_ADMIN"})) {
cnd.and("su.tissueId", "=", vi.getClubId()); cnd.and("su.tissueId", "=", vi.getClubId());
} }
} }
@@ -53,7 +53,7 @@ public class ActivityPlanServiceImpl extends ViServiceImpl<ActivityPlan> impleme
cnd.where().andLike("ap.name", name); cnd.where().andLike("ap.name", name);
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("tissueId", "in", vi.getMangeUnionStr()); cnd.and("tissueId", "in", vi.getMangeUnionStr());
} else if (ShiroUtil.hasRole("club01")) { } else if (ShiroUtil.hasRole("club01")) {
@@ -76,7 +76,7 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
cnd.where().andLike("tissue.name", name); cnd.where().andLike("tissue.name", name);
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and("tissue.userId", "=", ShiroUtil.getUserId()); cnd.and("tissue.userId", "=", ShiroUtil.getUserId());
/* if (ShiroUtil.hasRole("H04")) { /* if (ShiroUtil.hasRole("H04")) {
cnd.and("tissue.unionId", "in", vi.getMangeUnionStr()); cnd.and("tissue.unionId", "in", vi.getMangeUnionStr());
@@ -4,7 +4,6 @@ layout("/layouts/platform.html"){
<style> <style>
.query-row { .query-row {
} }
.query-title { .query-title {
@@ -14,16 +13,12 @@ layout("/layouts/platform.html"){
} }
.query-content { .query-content {
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<guava> <guava>
<user-data-scope <user-data-scope ref="userDataScope" :group_id.sync="formData.activityGroupId"></user-data-scope>
ref="userDataScope"
:group_id.sync="formData.activityGroupId"
></user-data-scope>
</guava> </guava>
<!--<guava> <!--<guava>
<el-card shadow="never"> <el-card shadow="never">
@@ -179,19 +174,19 @@ layout("/layouts/platform.html"){
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [initTableMixins], mixins: [initTableMixins],
components: { components: {
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'), "dict-select": httpVueLoader("/components/plugins/DictSelect.vue?v=1.0.0"),
'user-data-scope': httpVueLoader('/components/plugins/UserDataScope.vue'), "user-data-scope": httpVueLoader("/components/plugins/UserDataScope.vue")
}, },
computed: { computed: {
currentGroupName() { currentGroupName() {
if (this.pageForm.groupId) { if (this.pageForm.groupId) {
const group = this.activityGroupList.find(v => v.groupId === this.pageForm.groupId) const group = this.activityGroupList.find((v) => v.groupId === this.pageForm.groupId)
return group.groupName + '人员' return group.groupName + "人员"
} }
return '全部人员' return "全部人员"
} }
}, },
data() { data() {
@@ -208,33 +203,33 @@ layout("/layouts/platform.html"){
personTypes: [], personTypes: [],
userStates: [], userStates: [],
memberStatus: [], memberStatus: [],
year: moment().format('YYYY') year: moment().format("YYYY")
}, },
tableColumns: [ tableColumns: [
{prop: 'loginName', label: '工号'}, { prop: "loginName", label: "工号" },
{prop: 'userName', label: '姓名'}, { prop: "userName", label: "姓名" },
{prop: 'sex', label: '性别'}, { prop: "sex", label: "性别" },
{prop: 'birthday', label: '出生年月'}, { prop: "birthday", label: "出生年月" },
{prop: 'mobile', label: '联系电话'}, { prop: "mobile", label: "联系电话" },
{prop: 'personType', label: '人员类型', sortable: true}, { prop: "personType", label: "人员类型", sortable: true },
{prop: 'userState', label: '在职状态', sortable: true}, { prop: "userState", label: "在职状态", sortable: true },
{prop: 'unitName', label: '所属单位', sortable: true}, { prop: "unitName", label: "所属单位", sortable: true },
{prop: 'unionName', label: '所属工会', sortable: true}, { prop: "unionName", label: "所属工会", sortable: true },
{prop: 'activityUnionName', label: '活动工会', sortable: true}, { prop: "activityUnionName", label: "活动工会", sortable: true },
{prop: 'groupName', label: '所属分组', sortable: true}, { prop: "groupName", label: "所属分组", sortable: true }
], ]
} }
}, },
methods: { methods: {
async doDelete(id, groupId) { async doDelete(id, groupId) {
const confirm = await this.$confirm('您确定要删除吗?', '提示', { const confirm = await this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning"
}) })
if (confirm === 'confirm') { if (confirm === "confirm") {
this.pageForm.id = id this.pageForm.id = id
const resp = await $.post(loc() + '/doDelete', this.pageForm) const resp = await $.post(loc() + "/doDelete", this.pageForm)
if (resp.code === 0) { if (resp.code === 0) {
this.notifySuccess(resp.msg) this.notifySuccess(resp.msg)
this.doSearch() this.doSearch()
@@ -243,7 +238,10 @@ layout("/layouts/platform.html"){
}, },
async flushUnits() { async flushUnits() {
this.$set(this.pageForm, "unitId", "") this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') { if (
"${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')||@shiro.hasRole('SCHOOL_UNION_SPORTS_ADMIN')}" ===
"true"
) {
this.units = await getUnits(this.pageForm.unionId) this.units = await getUnits(this.pageForm.unionId)
this.ActivityUnits = await getActivityUnits(this.pageForm.activityUnionId) this.ActivityUnits = await getActivityUnits(this.pageForm.activityUnionId)
} else { } else {
@@ -252,7 +250,7 @@ layout("/layouts/platform.html"){
this.doSearch() this.doSearch()
}, },
async getActivityGroup() { async getActivityGroup() {
const resp = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup') const resp = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
this.activityGroupList = resp.data this.activityGroupList = resp.data
if (resp.data && resp.data.length > 0) { if (resp.data && resp.data.length > 0) {
this.$set(this.pageForm, "groupId", resp.data[0].groupId) this.$set(this.pageForm, "groupId", resp.data[0].groupId)
@@ -265,7 +263,6 @@ layout("/layouts/platform.html"){
this.unions = await getUnions(null) this.unions = await getUnions(null)
this.ActivityUnions = await getActivityUnions() this.ActivityUnions = await getActivityUnions()
this.flushUnits() this.flushUnits()
} }
}) })
</script> </script>
@@ -2,7 +2,7 @@
layout("/layouts/platform.html"){ layout("/layouts/platform.html"){
#--> #-->
<link rel="stylesheet" href="${base!}/assets/platform/plugins/jqFullCalendar/css/fullcalendar.css"> <link rel="stylesheet" href="${base!}/assets/platform/plugins/jqFullCalendar/css/fullcalendar.css" />
<script src="${base!}/assets/platform/plugins/jqFullCalendar/js/fullcalendar.min.js"></script> <script src="${base!}/assets/platform/plugins/jqFullCalendar/js/fullcalendar.min.js"></script>
<script src="${base!}/assets/platform/plugins/jqFullCalendar/js/moment.min.js"></script> <script src="${base!}/assets/platform/plugins/jqFullCalendar/js/moment.min.js"></script>
@@ -25,9 +25,7 @@ layout("/layouts/platform.html"){
} }
.other { .other {
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
@@ -44,19 +42,21 @@ layout("/layouts/platform.html"){
v-model="pageForm.time" v-model="pageForm.time"
placeholder="请选择月份" placeholder="请选择月份"
type="month" type="month"
value-format="yyyy-MM"> value-format="yyyy-MM"
</el-date-picker> ></el-date-picker>
</div> </div>
</div> </div>
<div class="search-item"> <div class="search-item">
<div class="search-item-label">姓名工号:</div> <div class="search-item-label">姓名工号:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword" <el-input
placeholder="请输入内容"
clearable
v-model="pageForm.searchKeyword"
style="width: 100%" style="width: 100%"
@keyup.enter.native="doSearch"> @keyup.enter.native="doSearch"
<el-select v-model="pageForm.searchName" slot="prepend" >
placeholder="查询类型" <el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 80px">
style="width: 80px;">
<el-option label="姓名" value="u.username"></el-option> <el-option label="姓名" value="u.username"></el-option>
<el-option label="工号" value="u.loginname"></el-option> <el-option label="工号" value="u.loginname"></el-option>
</el-select> </el-select>
@@ -67,11 +67,14 @@ layout("/layouts/platform.html"){
<div class="search-item"> <div class="search-item">
<div class="search-item-label">场地名称:</div> <div class="search-item-label">场地名称:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable clearable <el-input
@keyup.enter.native="doSearch"
clearable
clearable
placeholder="请输入场地名称" placeholder="请输入场地名称"
style="width: 100%" style="width: 100%"
v-model="pageForm.siteName"> v-model="pageForm.siteName"
</el-input> ></el-input>
</div> </div>
</div> </div>
@@ -94,8 +97,7 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt20"> <el-card shadow="never" class="mt20">
<vi-title2 title="预约列表"> <vi-title2 title="预约列表">
<template #func> <template #func>
<el-button size="small" type="primary" class="el-icon-date" @click="openCalendar">预约日历 <el-button size="small" type="primary" class="el-icon-date" @click="openCalendar">预约日历</el-button>
</el-button>
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isRetire"> <el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isRetire">
<el-radio-button label="">全部</el-radio-button> <el-radio-button label="">全部</el-radio-button>
<el-radio-button label="1">离退休</el-radio-button> <el-radio-button label="1">离退休</el-radio-button>
@@ -103,11 +105,15 @@ layout("/layouts/platform.html"){
</el-radio-group> </el-radio-group>
</template> </template>
</vi-title2> </vi-title2>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" align="center" header-align="center">
<el-table-column
:index="indexMethod"
align="center" align="center"
header-align="center"> header-align="center"
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index" label="序号"
width="80px"></el-table-column> type="index"
width="80px"
></el-table-column>
<el-table-column <el-table-column
:label="column.label" :label="column.label"
:prop="column.prop" :prop="column.prop"
@@ -117,17 +123,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==='state_name'"> <template scope="{row}" v-if="column.prop==='state_name'">
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>--> <!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
<span v-if="[0].includes(row.stateaudittype)" <span v-if="[0].includes(row.stateaudittype)" style="color: #e6a23c">{{row.state_name}}</span>
style="color: #e6a23c">{{row.state_name}}</span>
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span> <span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span> <span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" <el-table-column align="center" header-align="center" label="操作" fixed="right" width="200px">
width="200px">
<template scope="{row}"> <template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button> <el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
</template> </template>
@@ -148,9 +151,7 @@ layout("/layouts/platform.html"){
<el-dialog title="预约详情" :visible.sync="siteInfoDialog" width="60%"> <el-dialog title="预约详情" :visible.sync="siteInfoDialog" width="60%">
<reserve-info ref="reserveDialogInfo"></reserve-info> <reserve-info ref="reserveDialogInfo"></reserve-info>
</el-dialog> </el-dialog>
</guava> </guava>
</div> </div>
<script> <script>
@@ -158,12 +159,12 @@ layout("/layouts/platform.html"){
const activityUtil = new typeUtil() const activityUtil = new typeUtil()
let calendar = null let calendar = null
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [initTableMixins], mixins: [initTableMixins],
data() { data() {
return { return {
userid: "${@shiro.getPrincipalProperty('id')}", userid: "${@shiro.getPrincipalProperty('id')}",
role: "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}", role: "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')||@shiro.hasRole('SCHOOL_UNION_SPORTS_ADMIN')}",
activityTypeList: [], activityTypeList: [],
siteList: [], siteList: [],
pageForm: { pageForm: {
@@ -171,19 +172,19 @@ layout("/layouts/platform.html"){
searchKeyword: "", searchKeyword: "",
isAudit: false, isAudit: false,
time: "", time: "",
isRetire: '0' isRetire: "0"
}, },
tableColumns: [ tableColumns: [
{label: '场地名称', prop: 'site_name', sortable: true}, { label: "场地名称", prop: "site_name", sortable: true },
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true}, { label: "预约人姓名", prop: "reserve_person_username", sortable: true },
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true}, { label: "预约人部门", prop: "reserve_person_unitname", sortable: true },
// {label: '开始时间', prop: 'reserve_start_time', sortable: true}, // {label: '开始时间', prop: 'reserve_start_time', sortable: true},
// {label: '结束时间', prop: 'reserve_end_time', sortable: true}, // {label: '结束时间', prop: 'reserve_end_time', sortable: true},
{label: '预约时间范围', prop: 'reservationtimestr'}, { label: "预约时间范围", prop: "reservationtimestr" },
{label: '联系电话', prop: 'reserve_person_phone'}, { label: "联系电话", prop: "reserve_person_phone" },
// {label: '活动名称', prop: 'reserve_activity'}, // {label: '活动名称', prop: 'reserve_activity'},
{label: '预约事由', prop: 'reserve_cause'}, { label: "预约事由", prop: "reserve_cause" },
{label: '预约状态', prop: 'state_name'}, { label: "预约状态", prop: "state_name" }
], ],
sites: [], sites: [],
events: [], events: [],
@@ -192,7 +193,7 @@ layout("/layouts/platform.html"){
} }
}, },
components: { components: {
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue?v=' + new Date().getTime()), "reserve-info": httpVueLoader("/components/activity/site/ReserveInfo.vue?v=" + new Date().getTime())
}, },
methods: { methods: {
openView(row) { openView(row) {
@@ -200,13 +201,13 @@ layout("/layouts/platform.html"){
this.$refs.reserve.openView(row.id) this.$refs.reserve.openView(row.id)
}, },
async doDelete(id) { async doDelete(id) {
const confirm = await this.$confirm("您确定要删除此预约吗?", '提示', { const confirm = await this.$confirm("您确定要删除此预约吗?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning"
}) })
if (confirm !== 'confirm') return if (confirm !== "confirm") return
const resp = await $.post('/platform/activity/site/reserve/doDelete', {id, op: 1}) const resp = await $.post("/platform/activity/site/reserve/doDelete", { id, op: 1 })
if (resp.code === 0) { if (resp.code === 0) {
this.notifySuccess(resp.msg) this.notifySuccess(resp.msg)
this.doSearch() this.doSearch()
@@ -215,7 +216,7 @@ layout("/layouts/platform.html"){
} }
}, },
async getSites() { async getSites() {
const {data} = await $.get(loc() + '/getSites') const { data } = await $.get(loc() + "/getSites")
this.sites = data this.sites = data
}, },
@@ -224,20 +225,22 @@ layout("/layouts/platform.html"){
if (calendar) { if (calendar) {
return return
} }
calendar = $('#site-calendar').fullCalendar({ calendar = $("#site-calendar").fullCalendar({
header: { //设置日历头部信息,false,则不显示头部信息。包括left,center,right左中右三个位置 header: {
left: 'prev,next, today', //上一个、下一个、今天 //设置日历头部信息,false,则不显示头部信息。包括left,center,right左中右三个位置
center: 'title', //标题 left: "prev,next, today", //上一个、下一个、今天
right: 'month,agendaWeek,agendaDay' //月、周、日、日程列表 center: "title", //标题
right: "month,agendaWeek,agendaDay" //月、周、日、日程列表
}, },
locale: 'zh-cn', //?没用? locale: "zh-cn", //?没用?
timeFormat: 'HH:mm', //日程事件的时间格式 timeFormat: "HH:mm", //日程事件的时间格式
buttonText: { //各按钮的显示文本信息 buttonText: {
today: '今天', //各按钮的显示文本信息
month: '月', today: "今天",
agendaWeek: '周', month: "月",
agendaDay: '日', agendaWeek: "周",
listMonth: '日程', agendaDay: "日",
listMonth: "日程"
}, },
monthNames: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份全称 monthNames: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份全称
monthNamesShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份简写 monthNamesShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份简写
@@ -254,30 +257,31 @@ layout("/layouts/platform.html"){
firstDay: 1, //一周中显示的第一天是哪天,周日是0,周一是1,类推 firstDay: 1, //一周中显示的第一天是哪天,周日是0,周一是1,类推
hiddenDays: [], //隐藏一周中的某一天或某几天,数组形式,如隐藏周二和周五:[2,5],默认不隐藏,除非weekends设置为false。 hiddenDays: [], //隐藏一周中的某一天或某几天,数组形式,如隐藏周二和周五:[2,5],默认不隐藏,除非weekends设置为false。
weekends: true, //是否显示周六和周日,设为false则不显示周六和周日。默认值为true weekends: true, //是否显示周六和周日,设为false则不显示周六和周日。默认值为true
weekMode: 'fixed', //月视图里显示周的模式,因每月周数不同月视图高度不定。fixed:固定显示6周高,日历高度保持不变liquid:不固定周数,高度随周数变化variable:不固定周数,但高度固定 weekMode: "fixed", //月视图里显示周的模式,因每月周数不同月视图高度不定。fixed:固定显示6周高,日历高度保持不变liquid:不固定周数,高度随周数变化variable:不固定周数,但高度固定
weekNumbers: false, //是否在日历中显示周次(一年中的第几周),如果设置为true,则会在月视图的左侧、周视图和日视图的左上角显示周数。 weekNumbers: false, //是否在日历中显示周次(一年中的第几周),如果设置为true,则会在月视图的左侧、周视图和日视图的左上角显示周数。
weekNumberCalculation: 'iso', //周次的显示格式。 weekNumberCalculation: "iso", //周次的显示格式。
height: that.calendarHeight, //设置日历的高度,包括header日历头部,默认未设置,高度根据aspectRatio值自适应。 height: that.calendarHeight, //设置日历的高度,包括header日历头部,默认未设置,高度根据aspectRatio值自适应。
// contentHeight: 600, //设置日历主体内容的高度,不包括header部分,默认未设置,高度根据aspectRatio值自适应。 // contentHeight: 600, //设置日历主体内容的高度,不包括header部分,默认未设置,高度根据aspectRatio值自适应。
handleWindowResize: true, //是否随浏览器窗口大小变化而自动变化。 handleWindowResize: true, //是否随浏览器窗口大小变化而自动变化。
defaultView: 'agendaWeek', //初始化时默认视图,默认是月month,agendaWeek是周,agendaDay是当天 defaultView: "agendaWeek", //初始化时默认视图,默认是月month,agendaWeek是周,agendaDay是当天
slotEventOverlap: false, //事件是否可以重叠覆盖 slotEventOverlap: false, //事件是否可以重叠覆盖
defaultDate: moment().format('YYYY-MM-DD'), //默认显示那一天的日期视图getDates(true)2020-05-10 defaultDate: moment().format("YYYY-MM-DD"), //默认显示那一天的日期视图getDates(true)2020-05-10
nowIndicator: false, //周/日视图中显示今天当前时间点(以红线标记),默认false不显示 nowIndicator: false, //周/日视图中显示今天当前时间点(以红线标记),默认false不显示
eventLimit: 2, //数据条数太多时,限制显示条数(多余的以“+2more”格式显示),默认false不限制,支持输入数字设定固定的显示条数 eventLimit: 2, //数据条数太多时,限制显示条数(多余的以“+2more”格式显示),默认false不限制,支持输入数字设定固定的显示条数
eventLimitText: "更多", //当一块区域内容太多以"+2 more"格式显示时,这个more的名称自定义(应该与eventLimit: true一并用) eventLimitText: "更多", //当一块区域内容太多以"+2 more"格式显示时,这个more的名称自定义(应该与eventLimit: true一并用)
dayPopoverFormat: "YYYY年M月d日预约信息", //点开"+2 more"弹出的小窗口标题,与eventLimitClick可以结合用 dayPopoverFormat: "YYYY年M月d日预约信息", //点开"+2 more"弹出的小窗口标题,与eventLimitClick可以结合用
render: (view) => { //method,绑定日历到id上。$('#id').fullCalendar('render'); render: (view) => {
//method,绑定日历到id上。$('#id').fullCalendar('render');
}, },
viewRender: (view) => { viewRender: (view) => {
that.getCalendarData() that.getCalendarData()
}, },
eventRender: (info, element) => { eventRender: (info, element) => {
console.log(info) console.log(info)
element.find('.fc-title').append("<br/>申请人:" + info.reserve_person_username) element.find(".fc-title").append("<br/>申请人:" + info.reserve_person_username)
element.find('.fc-title').append("<br/>联系电话:" + info.reserve_person_phone) element.find(".fc-title").append("<br/>联系电话:" + info.reserve_person_phone)
element.find('.fc-title').append("<br/>预约事由:" + info.reserve_cause) element.find(".fc-title").append("<br/>预约事由:" + info.reserve_cause)
element.find('.fc-title').append("<br/>审核状态:" + info.state_name) element.find(".fc-title").append("<br/>审核状态:" + info.state_name)
// $(info.el).html(info.event.title); // $(info.el).html(info.event.title);
}, },
//日历数据源 //日历数据源
@@ -289,7 +293,7 @@ layout("/layouts/platform.html"){
setTimeout(async () => { setTimeout(async () => {
// that.siteInfoDialog = true // that.siteInfoDialog = true
await httpVueLoader('/components/activity/site/ReserveInfo.vue?v=' + new Date().getTime())() await httpVueLoader("/components/activity/site/ReserveInfo.vue?v=" + new Date().getTime())()
// that.$refs.reserveDialogInfo.openView(event.id) // that.$refs.reserveDialogInfo.openView(event.id)
}, 1000) }, 1000)
@@ -323,40 +327,40 @@ layout("/layouts/platform.html"){
selectMirror: true, //镜像 selectMirror: true, //镜像
lazyFetching: false, //是否启用懒加载技术--即只取当前条件下的视图数据,其它数据在切换时触发,默认true只取当前视图的,false是取全视图的 lazyFetching: false, //是否启用懒加载技术--即只取当前条件下的视图数据,其它数据在切换时触发,默认true只取当前视图的,false是取全视图的
defaultTimedEventDuration: "01:00:00", //在Event Object中如果没有end参数时使用,如start=7:00pm,则该日程对象时间范围就是7:00~9:00 defaultTimedEventDuration: "01:00:00", //在Event Object中如果没有end参数时使用,如start=7:00pm,则该日程对象时间范围就是7:00~9:00
defaultAllDayEventDuration: {days: 1}, //默认1天是多长,(有的是采用工作时间模式,所以支持自定义) defaultAllDayEventDuration: { days: 1 } //默认1天是多长,(有的是采用工作时间模式,所以支持自定义)
}); })
}, },
async getCalendarData() { async getCalendarData() {
if (!calendar) { if (!calendar) {
return return
} }
const view = calendar.fullCalendar('getView') const view = calendar.fullCalendar("getView")
//这里取时间戳 //这里取时间戳
const startTimeTs = view.start.format('YYYY-MM-DD HH:mm:ss') const startTimeTs = view.start.format("YYYY-MM-DD HH:mm:ss")
const endTimeTs = view.end.format('YYYY-MM-DD HH:mm:ss') const endTimeTs = view.end.format("YYYY-MM-DD HH:mm:ss")
const {data} = await $.get(loc() + '/getCalendarData', { const { data } = await $.get(loc() + "/getCalendarData", {
siteId: this.pageForm.siteId, siteId: this.pageForm.siteId,
startTimeTs, startTimeTs,
endTimeTs endTimeTs
}) })
if (data && data.length > 0) { if (data && data.length > 0) {
data.map(x => { data.map((x) => {
console.log(x) console.log(x)
if (x.site_id === '83dfd7d780f448aea307d2ce967b51fe') { if (x.site_id === "83dfd7d780f448aea307d2ce967b51fe") {
x.className = 'yantaoshi' x.className = "yantaoshi"
} else if (x.site_id === 'd6ebd7e454a24e3495b0d18438fb6a59') { } else if (x.site_id === "d6ebd7e454a24e3495b0d18438fb6a59") {
x.className = 'duogongnengting' x.className = "duogongnengting"
} else if (x.site_id === 'a6486481018b479ab137bac53936f15e') { } else if (x.site_id === "a6486481018b479ab137bac53936f15e") {
x.className = 'dangyuanzhijia' x.className = "dangyuanzhijia"
} else { } else {
x.className = 'other' x.className = "other"
} }
}) })
let events = data let events = data
calendar.fullCalendar('removeEvents', () => true) calendar.fullCalendar("removeEvents", () => true)
calendar.fullCalendar('addEventSource', events, true); calendar.fullCalendar("addEventSource", events, true)
} else { } else {
calendar.fullCalendar('removeEvents', () => true) calendar.fullCalendar("removeEvents", () => true)
} }
}, },
openCalendar() { openCalendar() {
@@ -369,7 +373,7 @@ layout("/layouts/platform.html"){
async findAllOpenSite() { async findAllOpenSite() {
const { data } = await $.get("/platform/activity/site/apply/getAllSite") const { data } = await $.get("/platform/activity/site/apply/getAllSite")
return data return data
}, }
}, },
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
@@ -381,7 +385,7 @@ layout("/layouts/platform.html"){
this.siteList = await this.findAllOpenSite() this.siteList = await this.findAllOpenSite()
this.pageData() this.pageData()
this.getSites() this.getSites()
}, }
}) })
</script> </script>
<!--# <!--#
@@ -15,19 +15,21 @@ layout("/layouts/platform.html"){
v-model="pageForm.time" v-model="pageForm.time"
placeholder="请选择月份" placeholder="请选择月份"
type="month" type="month"
value-format="yyyy-MM"> value-format="yyyy-MM"
</el-date-picker> ></el-date-picker>
</div> </div>
</div> </div>
<div class="search-item"> <div class="search-item">
<div class="search-item-label">姓名工号:</div> <div class="search-item-label">姓名工号:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword" <el-input
placeholder="请输入内容"
clearable
v-model="pageForm.searchKeyword"
style="width: 100%" style="width: 100%"
@keyup.enter.native="doSearch"> @keyup.enter.native="doSearch"
<el-select v-model="pageForm.searchName" slot="prepend" >
placeholder="查询类型" <el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 80px">
style="width: 80px;">
<el-option label="姓名" value="u.username"></el-option> <el-option label="姓名" value="u.username"></el-option>
<el-option label="工号" value="u.loginname"></el-option> <el-option label="工号" value="u.loginname"></el-option>
</el-select> </el-select>
@@ -38,11 +40,14 @@ layout("/layouts/platform.html"){
<div class="search-item"> <div class="search-item">
<div class="search-item-label">场地名称:</div> <div class="search-item-label">场地名称:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable clearable <el-input
@keyup.enter.native="doSearch"
clearable
clearable
placeholder="请输入场地名称" placeholder="请输入场地名称"
style="width: 100%" style="width: 100%"
v-model="pageForm.siteName"> v-model="pageForm.siteName"
</el-input> ></el-input>
</div> </div>
</div> </div>
@@ -62,12 +67,12 @@ layout("/layouts/platform.html"){
</div> </div>
</el-card> </el-card>
<el-card shadow="never" class="mt10"> <el-card shadow="never" class="mt10">
<table-tool :app="this" label="预约列表"> <table-tool :app="this" label="预约列表">
<template #func> <template #func>
<el-button @click="location.href='/platform/activity/site/apply'" <el-button @click="location.href='/platform/activity/site/apply'" class="mr10" size="small" type="primary">
class="mr10" size="small" type="primary">我要预约</el-button> 我要预约
</el-button>
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isRetire"> <el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isRetire">
<el-radio-button label="">全部</el-radio-button> <el-radio-button label="">全部</el-radio-button>
<el-radio-button label="1">离退休</el-radio-button> <el-radio-button label="1">离退休</el-radio-button>
@@ -75,11 +80,15 @@ layout("/layouts/platform.html"){
</el-radio-group> </el-radio-group>
</template> </template>
</table-tool> </table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" align="center" header-align="center">
<el-table-column
:index="indexMethod"
align="center" align="center"
header-align="center"> header-align="center"
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index" label="序号"
width="80px"></el-table-column> type="index"
width="80px"
></el-table-column>
<el-table-column <el-table-column
:label="column.label" :label="column.label"
:prop="column.prop" :prop="column.prop"
@@ -89,17 +98,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==='state_name'"> <template scope="{row}" v-if="column.prop==='state_name'">
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>--> <!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
<span v-if="[0].includes(row.stateaudittype)" <span v-if="[0].includes(row.stateaudittype)" style="color: #e6a23c">{{row.state_name}}</span>
style="color: #e6a23c">{{row.state_name}}</span>
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span> <span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span> <span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" <el-table-column align="center" header-align="center" label="操作" fixed="right" width="200px">
width="200px">
<template scope="scope"> <template scope="scope">
<!--<el-button @click="() => {dropdownCommand({type:'view',data:scope.row})}" size="mini">查看</el-button> <!--<el-button @click="() => {dropdownCommand({type:'view',data:scope.row})}" size="mini">查看</el-button>
<el-button type="danger" @click="() => {dropdownCommand({type:'delete',data:scope.row})}" size="mini">删除</el-button>--> <el-button type="danger" @click="() => {dropdownCommand({type:'delete',data:scope.row})}" size="mini">删除</el-button>-->
@@ -109,19 +115,15 @@ layout("/layouts/platform.html"){
<span class="ti-angle-down"></span> <span class="ti-angle-down"></span>
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'view',data:scope.row}"> <el-dropdown-item :command="{type:'view',data:scope.row}">查看</el-dropdown-item>
查看
</el-dropdown-item>
<!--# if(@shiro.hasRole('sysadmin')){ #--> <!--# if(@shiro.hasRole('sysadmin')){ #-->
<el-dropdown-item <el-dropdown-item :command="{type:'delete',data:scope.row}">删除</el-dropdown-item>
:command="{type:'delete',data:scope.row}">
删除
</el-dropdown-item>
<!--# } #--> <!--# } #-->
<el-dropdown-item <el-dropdown-item
v-if="scope.row.reserve_person_id === '${@shiro.getPrincipalProperty('id')}' v-if="scope.row.reserve_person_id === '${@shiro.getPrincipalProperty('id')}'
&& (scope.row.reserve_person_union_process == null || scope.row.reserve_person_union_process == '')" && (scope.row.reserve_person_union_process == null || scope.row.reserve_person_union_process == '')"
:command="{type:'cancel',data:scope.row}"> :command="{type:'cancel',data:scope.row}"
>
撤销预约 撤销预约
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
@@ -143,14 +145,14 @@ layout("/layouts/platform.html"){
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #--> <!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const activityUtil = new typeUtil() const activityUtil = new typeUtil()
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [initTableMixins], mixins: [initTableMixins],
data() { data() {
return { return {
activityTypeList: [], activityTypeList: [],
siteList: [], siteList: [],
tableData: [], tableData: [],
userid: '', userid: "",
pageForm: { pageForm: {
searchName: "u.username", searchName: "u.username",
searchKeyword: "", searchKeyword: "",
@@ -159,106 +161,118 @@ layout("/layouts/platform.html"){
totalCount: 0, totalCount: 0,
pageOrderName: "", pageOrderName: "",
pageOrderBy: "", pageOrderBy: "",
time: '', time: "",
isRetire: '0' isRetire: "0"
}, },
tableColumns: [ tableColumns: [
{label: '场地名称', prop: 'site_name', sortable: true}, { label: "场地名称", prop: "site_name", sortable: true },
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true}, { label: "预约人姓名", prop: "reserve_person_username", sortable: true },
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true}, { label: "预约人部门", prop: "reserve_person_unitname", sortable: true },
// {label: '开始时间', prop: 'reserve_start_time', sortable: true}, // {label: '开始时间', prop: 'reserve_start_time', sortable: true},
// {label: '结束时间', prop: 'reserve_end_time', sortable: true}, // {label: '结束时间', prop: 'reserve_end_time', sortable: true},
{label: '预约时间范围', prop: 'reservationtimestr'}, { label: "预约时间范围", prop: "reservationtimestr" },
{label: '联系电话', prop: 'reserve_person_phone'}, { label: "联系电话", prop: "reserve_person_phone" },
// {label: '活动名称', prop: 'reserve_activity'}, // {label: '活动名称', prop: 'reserve_activity'},
{label: '预约事由', prop: 'reserve_cause'}, { label: "预约事由", prop: "reserve_cause" },
{label: '预约状态', prop: 'state_name'}, { label: "预约状态", prop: "state_name" }
], ]
} }
}, },
components: { components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'), guava: httpVueLoader("/components/plugins/Guava.vue"),
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue?v=' + new Date().getTime()), "reserve-info": httpVueLoader("/components/activity/site/ReserveInfo.vue?v=" + new Date().getTime())
}, },
methods: { methods: {
dropdownCommand(command) { dropdownCommand(command) {
const { type, data } = command const { type, data } = command
if (type === 'view') { if (type === "view") {
this.userid = data.reserve_person_id; this.userid = data.reserve_person_id
this.openView(data) this.openView(data)
} else if (type === 'delete') { } else if (type === "delete") {
this.doClean(data.id) this.doClean(data.id)
} else if (type === 'cancel') { } else if (type === "cancel") {
this.doRevoke(data.id) this.doRevoke(data.id)
} }
}, },
backOption(row) { backOption(row) {
this.$prompt('请填写反馈意见', '提示', { this.$prompt("请填写反馈意见", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
inputValidator: (value) => { inputValidator: (value) => {
if (value === null) { if (value === null) {
return '反馈意见不能为空' return "反馈意见不能为空"
} }
} }
}).then(async ({value}) => { })
const res = await $.post('/mobile/activity/site/info/backOption', { .then(async ({ value }) => {
const res = await $.post("/mobile/activity/site/info/backOption", {
id: row.id, id: row.id,
option: value option: value
}) })
if (res.code === 0) { if (res.code === 0) {
await this.doSearch() await this.doSearch()
this.$notify.success({title: '提示', message: '操作成功!'}); this.$notify.success({ title: "提示", message: "操作成功!" })
} else { } else {
this.$notify.warning({title: '警告', message: '操作失败!'}); this.$notify.warning({ title: "警告", message: "操作失败!" })
} }
}).catch(() => { })
}); .catch(() => {})
}, },
async doClean(id) { async doClean(id) {
this.$confirm("您确定要删除此预约吗?", '提示', { this.$confirm("您确定要删除此预约吗?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning', type: "warning",
callback: (a, b) => { callback: (a, b) => {
if ("confirm" === a) { if ("confirm" === a) {
$.post("/platform/activity/site/apply/doClean", {id}, (data) => { $.post(
"/platform/activity/site/apply/doClean",
{ id },
(data) => {
if (data.code === 0) { if (data.code === 0) {
this.$message.success(data.msg) this.$message.success(data.msg)
this.pageData(); this.pageData()
} else { } else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }
}, "json"); },
"json"
)
} }
} }
}); })
}, },
async doRevoke(id) { async doRevoke(id) {
this.$confirm("您确定要撤销此预约吗?", '提示', { this.$confirm("您确定要撤销此预约吗?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning', type: "warning",
callback: (a, b) => { callback: (a, b) => {
if ("confirm" === a) { if ("confirm" === a) {
$.post("/platform/activity/site/apply/revoke", {id}, (data) => { $.post(
"/platform/activity/site/apply/revoke",
{ id },
(data) => {
if (data.code === 0) { if (data.code === 0) {
this.$message.success(data.msg) this.$message.success(data.msg)
this.pageData(); this.pageData()
} else { } else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }
}, "json"); },
"json"
)
} }
} }
}); })
}, },
openView(row) { openView(row) {
this.$refs.guava.view() this.$refs.guava.view()
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}" const role =
"${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')||@shiro.hasRole('SCHOOL_UNION_SPORTS_ADMIN')}"
this.$refs.reserve.role = role this.$refs.reserve.role = role
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === this.userid const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === this.userid
this.$refs.reserve.backOptionShow = (role || backOptionShow) this.$refs.reserve.backOptionShow = role || backOptionShow
this.$refs.reserve.openView(row.id) this.$refs.reserve.openView(row.id)
}, },
async doSearch() { async doSearch() {
@@ -269,12 +283,12 @@ layout("/layouts/platform.html"){
async findAllOpenSite() { async findAllOpenSite() {
const { data } = await $.get("/platform/activity/site/apply/getAllSite") const { data } = await $.get("/platform/activity/site/apply/getAllSite")
return data return data
}, }
}, },
async created() { async created() {
this.activityTypeList = await activityUtil.getAllType() this.activityTypeList = await activityUtil.getAllType()
this.siteList = await this.findAllOpenSite() this.siteList = await this.findAllOpenSite()
this.pageData(); this.pageData()
} }
}) })
</script> </script>
@@ -15,19 +15,21 @@ layout("/layouts/platform.html"){
v-model="pageForm.time" v-model="pageForm.time"
placeholder="请选择月份" placeholder="请选择月份"
type="month" type="month"
value-format="yyyy-MM"> value-format="yyyy-MM"
</el-date-picker> ></el-date-picker>
</div> </div>
</div> </div>
<div class="search-item"> <div class="search-item">
<div class="search-item-label">姓名工号:</div> <div class="search-item-label">姓名工号:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword" <el-input
placeholder="请输入内容"
clearable
v-model="pageForm.searchKeyword"
style="width: 100%" style="width: 100%"
@keyup.enter.native="doSearch"> @keyup.enter.native="doSearch"
<el-select v-model="pageForm.searchName" slot="prepend" >
placeholder="查询类型" <el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 80px">
style="width: 80px;">
<el-option label="姓名" value="u.username"></el-option> <el-option label="姓名" value="u.username"></el-option>
<el-option label="工号" value="u.loginname"></el-option> <el-option label="工号" value="u.loginname"></el-option>
</el-select> </el-select>
@@ -38,11 +40,14 @@ layout("/layouts/platform.html"){
<div class="search-item"> <div class="search-item">
<div class="search-item-label">场地名称:</div> <div class="search-item-label">场地名称:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable clearable <el-input
@keyup.enter.native="doSearch"
clearable
clearable
placeholder="请输入场地名称" placeholder="请输入场地名称"
style="width: 100%" style="width: 100%"
v-model="pageForm.siteName"> v-model="pageForm.siteName"
</el-input> ></el-input>
</div> </div>
</div> </div>
@@ -71,11 +76,15 @@ layout("/layouts/platform.html"){
</el-radio-group> </el-radio-group>
</template> </template>
</table-tool> </table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" align="center" header-align="center">
<el-table-column
:index="indexMethod"
align="center" align="center"
header-align="center"> header-align="center"
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index" label="序号"
width="80px"></el-table-column> type="index"
width="80px"
></el-table-column>
<el-table-column <el-table-column
:label="column.label" :label="column.label"
:prop="column.prop" :prop="column.prop"
@@ -85,22 +94,17 @@ 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==='state_name'"> <template scope="{row}" v-if="column.prop==='state_name'">
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>--> <!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
<span v-if="[0].includes(row.stateaudittype)" <span v-if="[0].includes(row.stateaudittype)" style="color: #e6a23c">{{row.state_name}}</span>
style="color: #e6a23c">{{row.state_name}}</span>
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span> <span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span> <span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" <el-table-column align="center" header-align="center" label="操作" fixed="right" width="200px">
width="200px">
<template scope="{row}"> <template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button> <el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.reserve_state == 6090" @click="doProcess(row)" size="mini" <el-button v-if="row.reserve_state == 6090" @click="doProcess(row)" size="mini" type="primary">审核</el-button>
type="primary">审核
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -112,17 +116,11 @@ layout("/layouts/platform.html"){
<reserve-info ref="auditInfo"> <reserve-info ref="auditInfo">
<template #handle> <template #handle>
<el-tab-pane label="离退休工作处审核" name="retire"> <el-tab-pane label="离退休工作处审核" name="retire">
<el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm" <el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm" :rules="formRules">
:rules="formRules"> <el-form-item label="审核人">${@shiro.getPrincipalProperty('username')}</el-form-item>
<el-form-item label="审核人"> <el-form-item label="审核时间">{{moment().format('YYYY-MM-DD')}}</el-form-item>
${@shiro.getPrincipalProperty('username')}
</el-form-item>
<el-form-item label="审核时间">
{{moment().format('YYYY-MM-DD')}}
</el-form-item>
<el-form-item label="审核意见" prop="auditOpinion"> <el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="300" rows="5" type="textarea" <el-input maxlength="300" rows="5" type="textarea" v-model="formData.auditOpinion"></el-input>
v-model="formData.auditOpinion"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="签字" prop="auditSign"> <el-form-item label="签字" prop="auditSign">
<sign :qz.sync="formData.auditSign" prefix="activitySite"></sign> <sign :qz.sync="formData.auditSign" prefix="activitySite"></sign>
@@ -146,7 +144,7 @@ layout("/layouts/platform.html"){
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #--> <!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const activityUtil = new typeUtil() const activityUtil = new typeUtil()
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [initTableMixins], mixins: [initTableMixins],
data() { data() {
return { return {
@@ -157,53 +155,54 @@ layout("/layouts/platform.html"){
searchName: "u.username", searchName: "u.username",
searchKeyword: "", searchKeyword: "",
isAudit: false, isAudit: false,
time: "", time: ""
}, },
tableColumns: [ tableColumns: [
{label: '场地名称', prop: 'site_name', sortable: true}, { label: "场地名称", prop: "site_name", sortable: true },
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true}, { label: "预约人姓名", prop: "reserve_person_username", sortable: true },
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true}, { label: "预约人部门", prop: "reserve_person_unitname", sortable: true },
// {label: '开始时间', prop: 'reserve_start_time', sortable: true}, // {label: '开始时间', prop: 'reserve_start_time', sortable: true},
// {label: '结束时间', prop: 'reserve_end_time', sortable: true}, // {label: '结束时间', prop: 'reserve_end_time', sortable: true},
{label: '预约时间范围', prop: 'reservationtimestr'}, { label: "预约时间范围", prop: "reservationtimestr" },
{label: '联系电话', prop: 'reserve_person_phone'}, { label: "联系电话", prop: "reserve_person_phone" },
// {label: '活动名称', prop: 'reserve_activity'}, // {label: '活动名称', prop: 'reserve_activity'},
{label: '预约事由', prop: 'reserve_cause'}, { label: "预约事由", prop: "reserve_cause" },
{label: '预约状态', prop: 'state_name'}, { label: "预约状态", prop: "state_name" }
], ],
formRules: { formRules: {
auditOpinion: [{required: true, message: '请签字', trigger: ['change', 'blur']}], auditOpinion: [{ required: true, message: "请签字", trigger: ["change", "blur"] }],
auditSign: [{required: true, message: '请签字', trigger: ['change', 'blur']}], auditSign: [{ required: true, message: "请签字", trigger: ["change", "blur"] }]
}, }
} }
}, },
components: { components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'), guava: httpVueLoader("/components/plugins/Guava.vue"),
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue?v=' + new Date().getTime()), "reserve-info": httpVueLoader("/components/activity/site/ReserveInfo.vue?v=" + new Date().getTime()),
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.0'), sign: httpVueLoader("/components/sign/sign.vue?v=2.0.0")
}, },
methods: { methods: {
openView(row) { openView(row) {
this.$refs.guava.view() this.$refs.guava.view()
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}" const role =
"${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')||@shiro.hasRole('SCHOOL_UNION_SPORTS_ADMIN')}"
this.$refs.reserve.role = role this.$refs.reserve.role = role
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id
this.$refs.reserve.backOptionShow = (role || backOptionShow) this.$refs.reserve.backOptionShow = role || backOptionShow
this.$refs.reserve.openView(row.id) this.$refs.reserve.openView(row.id)
}, },
doProcess(row) { doProcess(row) {
this.$refs.guava.edit() this.$refs.guava.edit()
this.$refs.auditInfo.openView(row.id, 'retire') this.$refs.auditInfo.openView(row.id, "retire")
this.formData = { this.formData = {
id: row.id, id: row.id,
auditOpinion: null, auditOpinion: null
} }
}, },
async doReview(row) { async doReview(row) {
const valid = await this.$refs['auditForm'].validate() const valid = await this.$refs["auditForm"].validate()
if (!valid) return if (!valid) return
this.formData.auditPass = row this.formData.auditPass = row
const resp = await $.post('/platform/activity/site/retireProcess/doProcess', { const resp = await $.post("/platform/activity/site/retireProcess/doProcess", {
id: this.formData.id, id: this.formData.id,
audit: JSON.stringify(this.formData) audit: JSON.stringify(this.formData)
}) })
@@ -216,12 +215,12 @@ layout("/layouts/platform.html"){
async findAllOpenSite() { async findAllOpenSite() {
const { data } = await $.get("/platform/activity/site/apply/getAllSite") const { data } = await $.get("/platform/activity/site/apply/getAllSite")
return data return data
}, }
}, },
async created() { async created() {
this.activityTypeList = await activityUtil.getAllType() this.activityTypeList = await activityUtil.getAllType()
this.siteList = await this.findAllOpenSite() this.siteList = await this.findAllOpenSite()
this.pageData(); this.pageData()
} }
}) })
</script> </script>
@@ -15,19 +15,21 @@ layout("/layouts/platform.html"){
v-model="pageForm.time" v-model="pageForm.time"
placeholder="请选择月份" placeholder="请选择月份"
type="month" type="month"
value-format="yyyy-MM"> value-format="yyyy-MM"
</el-date-picker> ></el-date-picker>
</div> </div>
</div> </div>
<div class="search-item"> <div class="search-item">
<div class="search-item-label">姓名工号:</div> <div class="search-item-label">姓名工号:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword" <el-input
placeholder="请输入内容"
clearable
v-model="pageForm.searchKeyword"
style="width: 100%" style="width: 100%"
@keyup.enter.native="doSearch"> @keyup.enter.native="doSearch"
<el-select v-model="pageForm.searchName" slot="prepend" >
placeholder="查询类型" <el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 80px">
style="width: 80px;">
<el-option label="姓名" value="u.username"></el-option> <el-option label="姓名" value="u.username"></el-option>
<el-option label="工号" value="u.loginname"></el-option> <el-option label="工号" value="u.loginname"></el-option>
</el-select> </el-select>
@@ -38,11 +40,14 @@ layout("/layouts/platform.html"){
<div class="search-item"> <div class="search-item">
<div class="search-item-label">场地名称:</div> <div class="search-item-label">场地名称:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable clearable <el-input
@keyup.enter.native="doSearch"
clearable
clearable
placeholder="请输入场地名称" placeholder="请输入场地名称"
style="width: 100%" style="width: 100%"
v-model="pageForm.siteName"> v-model="pageForm.siteName"
</el-input> ></el-input>
</div> </div>
</div> </div>
@@ -76,11 +81,15 @@ layout("/layouts/platform.html"){
</el-radio-group> </el-radio-group>
</template> </template>
</table-tool> </table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" align="center" header-align="center">
<el-table-column
:index="indexMethod"
align="center" align="center"
header-align="center"> header-align="center"
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index" label="序号"
width="80px"></el-table-column> type="index"
width="80px"
></el-table-column>
<el-table-column <el-table-column
:label="column.label" :label="column.label"
:prop="column.prop" :prop="column.prop"
@@ -90,17 +99,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==='state_name'"> <template scope="{row}" v-if="column.prop==='state_name'">
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>--> <!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
<span v-if="[0].includes(row.stateaudittype)" <span v-if="[0].includes(row.stateaudittype)" style="color: #e6a23c">{{row.state_name}}</span>
style="color: #e6a23c">{{row.state_name}}</span>
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span> <span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span> <span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" <el-table-column align="center" header-align="center" label="操作" fixed="right" width="200px">
width="200px">
<template scope="{row}"> <template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button> <el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.reserve_state == 6118" @click="doProcess(row)" size="mini" type="primary">审核</el-button> <el-button v-if="row.reserve_state == 6118" @click="doProcess(row)" size="mini" type="primary">审核</el-button>
@@ -116,15 +122,10 @@ layout("/layouts/platform.html"){
<template #handle> <template #handle>
<el-tab-pane label="校工会审核" name="xghsh"> <el-tab-pane label="校工会审核" name="xghsh">
<el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm" :rules="formRules"> <el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm" :rules="formRules">
<el-form-item label="审核人"> <el-form-item label="审核人">${@shiro.getPrincipalProperty('username')}</el-form-item>
${@shiro.getPrincipalProperty('username')} <el-form-item label="审核时间">{{moment().format('YYYY-MM-DD')}}</el-form-item>
</el-form-item>
<el-form-item label="审核时间">
{{moment().format('YYYY-MM-DD')}}
</el-form-item>
<el-form-item label="审核意见" prop="auditOpinion"> <el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="300" rows="5" type="textarea" <el-input maxlength="300" rows="5" type="textarea" v-model="formData.auditOpinion"></el-input>
v-model="formData.auditOpinion"></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item label="签字" prop="auditSign">--> <!-- <el-form-item label="签字" prop="auditSign">-->
<!-- <sign :qz.sync="formData.auditSign" prefix="activitySite"></sign>--> <!-- <sign :qz.sync="formData.auditSign" prefix="activitySite"></sign>-->
@@ -143,14 +144,13 @@ layout("/layouts/platform.html"){
<reserve-info ref="reserve"></reserve-info> <reserve-info ref="reserve"></reserve-info>
</template> </template>
</guava> </guava>
</div> </div>
<script> <script>
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #--> <!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const activityUtil = new typeUtil() const activityUtil = new typeUtil()
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [initTableMixins], mixins: [initTableMixins],
data() { data() {
return { return {
@@ -162,53 +162,54 @@ layout("/layouts/platform.html"){
searchKeyword: "", searchKeyword: "",
isAudit: false, isAudit: false,
time: "", time: "",
isRetire: '0' isRetire: "0"
}, },
tableColumns: [ tableColumns: [
{label: '场地名称', prop: 'site_name', sortable: true}, { label: "场地名称", prop: "site_name", sortable: true },
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true}, { label: "预约人姓名", prop: "reserve_person_username", sortable: true },
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true}, { label: "预约人部门", prop: "reserve_person_unitname", sortable: true },
// {label: '开始时间', prop: 'reserve_start_time', sortable: true}, // {label: '开始时间', prop: 'reserve_start_time', sortable: true},
// {label: '结束时间', prop: 'reserve_end_time', sortable: true}, // {label: '结束时间', prop: 'reserve_end_time', sortable: true},
{label: '预约时间范围', prop: 'reservationtimestr'}, { label: "预约时间范围", prop: "reservationtimestr" },
{label: '联系电话', prop: 'reserve_person_phone'}, { label: "联系电话", prop: "reserve_person_phone" },
// {label: '活动项目', prop: 'reserve_activity'}, // {label: '活动项目', prop: 'reserve_activity'},
{label: '预约事由', prop: 'reserve_cause'}, { label: "预约事由", prop: "reserve_cause" },
{label: '预约状态', prop: 'state_name'}, { label: "预约状态", prop: "state_name" }
], ],
formRules: { formRules: {
auditOpinion: [{required: true, message: '请签字', trigger: ['change', 'blur']}], auditOpinion: [{ required: true, message: "请签字", trigger: ["change", "blur"] }],
auditSign: [{required: true, message: '请签字', trigger: ['change', 'blur']}], auditSign: [{ required: true, message: "请签字", trigger: ["change", "blur"] }]
}, }
} }
}, },
components: { components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'), guava: httpVueLoader("/components/plugins/Guava.vue"),
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue?v=' + new Date().getTime()), "reserve-info": httpVueLoader("/components/activity/site/ReserveInfo.vue?v=" + new Date().getTime()),
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.0'), sign: httpVueLoader("/components/sign/sign.vue?v=2.0.0")
}, },
methods: { methods: {
openView(row) { openView(row) {
this.$refs.guava.view() this.$refs.guava.view()
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}" const role =
"${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')||@shiro.hasRole('SCHOOL_UNION_SPORTS_ADMIN')}"
this.$refs.reserve.role = role this.$refs.reserve.role = role
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id
this.$refs.reserve.backOptionShow = (role || backOptionShow) this.$refs.reserve.backOptionShow = role || backOptionShow
this.$refs.reserve.openView(row.id) this.$refs.reserve.openView(row.id)
}, },
doProcess(row) { doProcess(row) {
this.$refs.guava.edit() this.$refs.guava.edit()
this.$refs.auditInfo.openView(row.id, 'xghsh') this.$refs.auditInfo.openView(row.id, "xghsh")
this.formData = { this.formData = {
id: row.id, id: row.id,
schoolOption: null, schoolOption: null
} }
}, },
async doReview(row) { async doReview(row) {
const valid = await this.$refs['auditForm'].validate() const valid = await this.$refs["auditForm"].validate()
if (!valid) return if (!valid) return
this.formData.auditPass = row this.formData.auditPass = row
const resp = await $.post('/platform/activity/site/review/doProcess', { const resp = await $.post("/platform/activity/site/review/doProcess", {
id: this.formData.id, id: this.formData.id,
audit: JSON.stringify(this.formData) audit: JSON.stringify(this.formData)
}) })
@@ -219,24 +220,29 @@ layout("/layouts/platform.html"){
} }
}, },
doInstructions() { doInstructions() {
$.post(location.href + "/doReview", this.formData, (res) => { $.post(
location.href + "/doReview",
this.formData,
(res) => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success(res.msg) this.$message.success(res.msg)
this.pageData(); this.pageData()
this.$refs.guava.index() this.$refs.guava.index()
} }
}, "json"); },
"json"
)
}, },
async findAllOpenSite() { async findAllOpenSite() {
const { data } = await $.get("/platform/activity/site/apply/getAllSite") const { data } = await $.get("/platform/activity/site/apply/getAllSite")
return data return data
}, }
}, },
async created() { async created() {
this.activityTypeList = await activityUtil.getAllType() this.activityTypeList = await activityUtil.getAllType()
this.siteList = await this.findAllOpenSite() this.siteList = await this.findAllOpenSite()
this.pageData(); this.pageData()
}, }
}) })
</script> </script>
<!--# <!--#
@@ -183,7 +183,8 @@ layout("/layouts/platform.html"){
methods: { methods: {
openView(row) { openView(row) {
this.$refs.guava.view() this.$refs.guava.view()
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}" const role =
"${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')||@shiro.hasRole('SCHOOL_UNION_SPORTS_ADMIN')}"
this.$refs.reserve.role = role this.$refs.reserve.role = role
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id
this.$refs.reserve.backOptionShow = role || backOptionShow this.$refs.reserve.backOptionShow = role || backOptionShow