Compare commits
4
Commits
a0732fdb08
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f51b24686f | ||
|
|
3f7b5dc27a | ||
|
|
e944ebf85f | ||
|
|
d5f1c642c4 |
+10
-2
@@ -54,9 +54,8 @@ public class ActivityBasicSettingsController {
|
|||||||
if (parentId != null) {
|
if (parentId != null) {
|
||||||
parentId.setChild(child(parentId.getId()));
|
parentId.setChild(child(parentId.getId()));
|
||||||
list.add(parentId);
|
list.add(parentId);
|
||||||
return Result.success().addData(list);
|
|
||||||
}
|
}
|
||||||
return Result.success();
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ActivityBasicSettings> child(String parentId) {
|
private List<ActivityBasicSettings> child(String parentId) {
|
||||||
@@ -73,6 +72,9 @@ public class ActivityBasicSettingsController {
|
|||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
if (StrUtil.isBlank(parentId)) {
|
if (StrUtil.isBlank(parentId)) {
|
||||||
ActivityBasicSettings rootSetting = dao.fetch(ActivityBasicSettings.class, Cnd.where("parentId", "=", 0));
|
ActivityBasicSettings rootSetting = dao.fetch(ActivityBasicSettings.class, Cnd.where("parentId", "=", 0));
|
||||||
|
if (rootSetting == null) {
|
||||||
|
return Result.success(new Pagination<ActivityBasicSettings>(pageForm.getPageNumber(), pageForm.getPageSize(), 0, new ArrayList<ActivityBasicSettings>()));
|
||||||
|
}
|
||||||
cnd.and("parentId", "=", rootSetting.getId());
|
cnd.and("parentId", "=", rootSetting.getId());
|
||||||
} else {
|
} else {
|
||||||
cnd.and("parentId", "=", parentId);
|
cnd.and("parentId", "=", parentId);
|
||||||
@@ -116,7 +118,13 @@ public class ActivityBasicSettingsController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
public Result getActivityTwoLevelType(String code) {
|
public Result getActivityTwoLevelType(String code) {
|
||||||
|
if (StrUtil.isBlank(code)) {
|
||||||
|
return Result.success(new ArrayList<ActivityBasicSettings>());
|
||||||
|
}
|
||||||
ActivityBasicSettings fetch = dao.fetch(ActivityBasicSettings.class, Cnd.where("code", "=", code));
|
ActivityBasicSettings fetch = dao.fetch(ActivityBasicSettings.class, Cnd.where("code", "=", code));
|
||||||
|
if (fetch == null) {
|
||||||
|
return Result.success(new ArrayList<ActivityBasicSettings>());
|
||||||
|
}
|
||||||
List<ActivityBasicSettings> query = dao.query(ActivityBasicSettings.class, Cnd.where("parentId", "=", fetch.getId()).asc("code"));
|
List<ActivityBasicSettings> query = dao.query(ActivityBasicSettings.class, Cnd.where("parentId", "=", fetch.getId()).asc("code"));
|
||||||
return Result.success(query);
|
return Result.success(query);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -649,8 +649,11 @@ public class TrainSignUpActivityServiceImpl extends BaseServiceImpl<TrainSignUpA
|
|||||||
fillCourseResponsibles(courseList);
|
fillCourseResponsibles(courseList);
|
||||||
|
|
||||||
courseList.forEach(c -> {
|
courseList.forEach(c -> {
|
||||||
if (StrUtil.isNotBlank(c.getCourseType())) {
|
|
||||||
dao().fetchLinks(c, "^(courseTimeList)$", Cnd.NEW().asc("courseStartTime"));
|
dao().fetchLinks(c, "^(courseTimeList)$", Cnd.NEW().asc("courseStartTime"));
|
||||||
|
if (c.getCourseTimeList() == null) {
|
||||||
|
c.setCourseTimeList(new ArrayList<>());
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(c.getCourseType())) {
|
||||||
int courseCount = statisticsService.queryCourseCount(c.getId(), c.getCourseType());
|
int courseCount = statisticsService.queryCourseCount(c.getId(), c.getCourseType());
|
||||||
c.setHasRegisterNum(courseCount);
|
c.setHasRegisterNum(courseCount);
|
||||||
int courseWaitCount = statisticsService.queryCourseWaitCount(c.getId(), c.getCourseType());
|
int courseWaitCount = statisticsService.queryCourseWaitCount(c.getId(), c.getCourseType());
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ layout("/layouts/platform.html"){
|
|||||||
currentTreeNode: null,
|
currentTreeNode: null,
|
||||||
currentTreeData: null,
|
currentTreeData: null,
|
||||||
|
|
||||||
checkData: {},
|
checkData: { id: "0", name: "无(新建根节点)" },
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
|
||||||
basicTypeDialog: false,
|
basicTypeDialog: false,
|
||||||
@@ -146,10 +146,8 @@ layout("/layouts/platform.html"){
|
|||||||
|
|
||||||
getTreeData() {
|
getTreeData() {
|
||||||
this.$axios.post(loc() + "/tree").then((res) => {
|
this.$axios.post(loc() + "/tree").then((res) => {
|
||||||
this.treeData = res.data
|
this.treeData = res.data || []
|
||||||
if (this.treeData) {
|
this.checkData = this.treeData.length ? this.treeData[0] : { id: "0", name: "无(新建根节点)" }
|
||||||
this.checkData = this.treeData[0]
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -370,12 +370,14 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<!--
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="报名表单" prop="formConfig"
|
<el-form-item label="报名表单" prop="formConfig"
|
||||||
v-if="formData.isEnrollSystem&&formData.signUpMethod===1">
|
v-if="formData.isEnrollSystem&&formData.signUpMethod===1">
|
||||||
<custom-form-field v-model="formData.formConfig"></custom-form-field>
|
<custom-form-field v-model="formData.formConfig"></custom-form-field>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
-->
|
||||||
|
|
||||||
<el-col :span="24" v-if="formData.signUpMethod!=null&&formData.isEnrollSystem">
|
<el-col :span="24" v-if="formData.signUpMethod!=null&&formData.isEnrollSystem">
|
||||||
<el-form-item label="封面图" prop="cover">
|
<el-form-item label="封面图" prop="cover">
|
||||||
@@ -592,6 +594,7 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
|
|||||||
name: [{required: true, message: "必填", trigger: ["blur", "change"]}],
|
name: [{required: true, message: "必填", trigger: ["blur", "change"]}],
|
||||||
type: [{required: true, message: "必填", trigger: ["blur", "change"]}],
|
type: [{required: true, message: "必填", trigger: ["blur", "change"]}],
|
||||||
projectTypeCode: [{required: true, message: "必填", trigger: ["blur", "change"]}],
|
projectTypeCode: [{required: true, message: "必填", trigger: ["blur", "change"]}],
|
||||||
|
mobile: this.activity_type === 40001 ? [{pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号码", trigger: ["blur", "change"]}] : [],
|
||||||
address: [{required: true, message: "必填", trigger: ["blur", "change"]}],
|
address: [{required: true, message: "必填", trigger: ["blur", "change"]}],
|
||||||
plannedDate: [{required: true, message: "必填", trigger: ["blur", "change"]}],
|
plannedDate: [{required: true, message: "必填", trigger: ["blur", "change"]}],
|
||||||
time: [{required: true, message: "必填", trigger: ["blur", "change"]}],
|
time: [{required: true, message: "必填", trigger: ["blur", "change"]}],
|
||||||
@@ -725,7 +728,15 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
|
|||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
// 保存
|
// 保存
|
||||||
onSave() {
|
async onSave() {
|
||||||
|
if (this.activity_type === 40001) {
|
||||||
|
const mobileValid = await new Promise(resolve => {
|
||||||
|
this.$refs["addForm"].validateField("mobile", error => resolve(!error))
|
||||||
|
})
|
||||||
|
if (!mobileValid) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!this.formData.projectTypeCode) {
|
if (!this.formData.projectTypeCode) {
|
||||||
this.$message.error("请选择活动项目类型")
|
this.$message.error("请选择活动项目类型")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -585,11 +585,13 @@ const basicForm = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const courseValid = this.formData.courseList.some((v, i) => {
|
const courseValid = this.formData.courseList.some((v, i) => {
|
||||||
// 新活动通过多选关系设置负责人;未重新设置的旧活动仍允许保留历史联系人。
|
const missingFields = []
|
||||||
const hasResponsible = Array.isArray(v.responsibleList)
|
if (!v.courseName) missingFields.push(this.trainType + "名称")
|
||||||
? v.responsibleList.length > 0 : !!v.courseInstructor
|
if (!v.coursePeopleNumber) missingFields.push(this.trainType + "人数(不能为空或为0)")
|
||||||
const basicValid = v.courseName && v.coursePeopleNumber && v.courseLocation && hasResponsible && v.courseType
|
if (!v.courseLocation) missingFields.push(this.trainType + "地点")
|
||||||
|
if (!v.courseType) missingFields.push("类型")
|
||||||
const timeValid =
|
const timeValid =
|
||||||
|
Array.isArray(v.courseTimeList) &&
|
||||||
v.courseTimeList.length > 0 &&
|
v.courseTimeList.length > 0 &&
|
||||||
v.courseTimeList.every((x) => {
|
v.courseTimeList.every((x) => {
|
||||||
return x.courseStartTime && x.courseEndTime && x.courseStartTime < x.courseEndTime
|
return x.courseStartTime && x.courseEndTime && x.courseStartTime < x.courseEndTime
|
||||||
@@ -598,8 +600,8 @@ const basicForm = {
|
|||||||
this.$message.warning("第" + (i + 1) + "行时间填写有误,请核查")
|
this.$message.warning("第" + (i + 1) + "行时间填写有误,请核查")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (!basicValid) {
|
if (missingFields.length > 0) {
|
||||||
this.$message.warning("第" + (i + 1) + "行信息填写有误,请核查")
|
this.$message.warning("第" + (i + 1) + "行请补充:" + missingFields.join("、"))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// 联系方式允许手机号或办公电话,逐人校验,不能只检查兼容展示的第一位。
|
// 联系方式允许手机号或办公电话,逐人校验,不能只检查兼容展示的第一位。
|
||||||
|
|||||||
Reference in New Issue
Block a user