diff --git a/ruoyi-ui/src/views/benyi/planweek/data.vue b/ruoyi-ui/src/views/benyi/planweek/data.vue index f5c33d64f..e661f7df6 100644 --- a/ruoyi-ui/src/views/benyi/planweek/data.vue +++ b/ruoyi-ui/src/views/benyi/planweek/data.vue @@ -194,8 +194,7 @@ type="date" value-format="yyyy-MM-dd" placeholder="选择活动时间" - >> + > @@ -242,6 +241,8 @@ export default { }, data() { return { + starttime: null, + endtime: null, // 遮罩层 loading: true, // 选中数组 @@ -276,17 +277,6 @@ export default { updateuserid: undefined, day: undefined, }, - // 日期控件 只显示今天和今天以后一周时间区间 - pickerOptions7: { - disabledDate(time) { - let curDate = new Date().getTime(); - let three = 7 * 24 * 3600 * 1000; - let threeMonths = curDate + three; - let datestart = Date.now() - 86400000; - return time.getTime() < datestart || time.getTime() > threeMonths; - }, - }, - // 表单参数 form: {}, // 表单校验 @@ -318,6 +308,9 @@ export default { // 周计划 getPlanweek2(planweekid) { getPlanweek(planweekid).then((response) => { + //console.log(response.data); + this.starttime = response.data.starttime; + this.endtime = response.data.endtime; this.queryParams.wid = response.data.id; this.defaultWeekType = response.data.id; this.getList(); @@ -399,6 +392,7 @@ export default { this.open = true; this.title = "添加周计划(家长和教育部门)细化"; this.form.wid = this.queryParams.wid; + this.form.activitytime = this.starttime; }, /** 修改按钮操作 */ handleUpdate(row) { diff --git a/ruoyi-ui/src/views/benyi/planweek/index.vue b/ruoyi-ui/src/views/benyi/planweek/index.vue index 577866992..ae9cf08c0 100644 --- a/ruoyi-ui/src/views/benyi/planweek/index.vue +++ b/ruoyi-ui/src/views/benyi/planweek/index.vue @@ -202,19 +202,62 @@ :title="title" :visible.sync="open" class="v-dialog" - width="1024px" + width="960px" append-to-body > - + + + + + + + + + + - - - - - - - - - - - - - + @@ -409,9 +430,9 @@ export default { starttime: [ { required: true, message: "开始时间不能为空", trigger: "blur" }, ], - endtime: [ - { required: true, message: "结束时间不能为空", trigger: "blur" }, - ], + // endtime: [ + // { required: true, message: "结束时间不能为空", trigger: "blur" }, + // ], themeofweek: [ { required: true, message: "本周主题不能为空", trigger: "blur" }, ], @@ -467,6 +488,10 @@ export default { }); }, methods: { + change: function () { + //console.log(this.form.starttime); + this.form.month=this.form.starttime[0].slice(0,7); + }, /** 查询周计划(家长和教育部门)列表 */ getList() { this.loading = true; @@ -560,9 +585,13 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { this.reset(); + let timeArr = []; const id = row.id || this.ids; getPlanweek(id).then((response) => { this.form = response.data; + timeArr.push(response.data.starttime); + timeArr.push(response.data.endtime); + this.form.starttime = timeArr; this.open = true; this.title = "修改周计划(家长和教育部门)"; }); @@ -595,6 +624,12 @@ export default { submitForm: function () { this.$refs["form"].validate((valid) => { if (valid) { + let timeArr = this.form.starttime; + this.form.starttime = timeArr[0]; + this.form.endtime = timeArr[1]; + // console.log(this.form.starttime); + // console.log(this.form.endtime); + // console.log(this.form.month); if (this.form.id != undefined) { updatePlanweek(this.form).then((response) => { if (response.code === 200) { diff --git a/ruoyi/src/main/resources/mybatis/benyi/ByPlanweekMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/ByPlanweekMapper.xml index c249ccae1..3d6d797a1 100644 --- a/ruoyi/src/main/resources/mybatis/benyi/ByPlanweekMapper.xml +++ b/ruoyi/src/main/resources/mybatis/benyi/ByPlanweekMapper.xml @@ -53,6 +53,7 @@ and weekly = #{weekly} and month = #{month} + order by create_time desc