|
@@ -145,6 +145,26 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="是否跳过节假日" width="160">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item
|
|
|
+ :prop="'classs.' + type + '.cycle.' + scope.$index + '.holiday'"
|
|
|
+ :rules="[{ required: true, message: '请选择是否跳过节假日' }]"
|
|
|
+ inline-message
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ v-model.trim="scope.row.holiday"
|
|
|
+ style="width: 100% !important"
|
|
|
+ placeholder="是否跳过节假日"
|
|
|
+ filterable
|
|
|
+ @change="holidayChange(scope.row)"
|
|
|
+ >
|
|
|
+ <el-option label="是" :value="true"></el-option>
|
|
|
+ <el-option label="否" :value="false"> </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="排课起始时间" width="170">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
@@ -189,25 +209,6 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="是否跳过节假日" width="160">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-form-item
|
|
|
- :prop="'classs.' + type + '.cycle.' + scope.$index + '.holiday'"
|
|
|
- :rules="[{ required: true, message: '请选择是否跳过节假日' }]"
|
|
|
- inline-message
|
|
|
- >
|
|
|
- <el-select
|
|
|
- v-model.trim="scope.row.holiday"
|
|
|
- style="width: 100% !important"
|
|
|
- placeholder="是否跳过节假日"
|
|
|
- filterable
|
|
|
- >
|
|
|
- <el-option label="是" :value="true"></el-option>
|
|
|
- <el-option label="否" :value="false"> </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
<el-table-column prop="date" width="50px">
|
|
|
<template slot-scope="scope">
|
|
|
<i
|
|
@@ -241,7 +242,7 @@ for (const item of classTimeList) {
|
|
|
}
|
|
|
|
|
|
export default {
|
|
|
- props: ["form", "type", "surplustime", "prices", "selectPrice"],
|
|
|
+ props: ["form", "type", "surplustime", "prices", "selectPrice", "holidays"],
|
|
|
data() {
|
|
|
return {
|
|
|
classTimeListByType,
|
|
@@ -250,7 +251,7 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
// console.log("surplustime", this.surplustime);
|
|
|
- console.log(this.form.cycle);
|
|
|
+ // console.log(this.form.cycle);
|
|
|
},
|
|
|
computed: {
|
|
|
pickerOptions() {
|
|
@@ -338,6 +339,20 @@ export default {
|
|
|
}
|
|
|
this.updateUseTime()
|
|
|
},
|
|
|
+ holidayChange(row) {
|
|
|
+ if(row){
|
|
|
+ this.$set(
|
|
|
+ row,
|
|
|
+ "startDate",
|
|
|
+ ''
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ row,
|
|
|
+ "endDate",
|
|
|
+ ''
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
getUseTime(row) {
|
|
|
if(row){
|
|
|
this.$set(
|
|
@@ -368,10 +383,16 @@ export default {
|
|
|
row.dayOfWeek - date.getDay() >= 0
|
|
|
? (num = row.dayOfWeek - date.getDay())
|
|
|
: (num = row.dayOfWeek - date.getDay() + 7);
|
|
|
+ let end = dayjs(val).add(num+(row.expectCourseNum*7), 'day')
|
|
|
+ for (const d of this.holidays) {
|
|
|
+ if (dayjs(d).isBetween(row.startDate, end.format('YYYY-MM-DD'), null, '[]')) {
|
|
|
+ end = end.add(7, 'day')
|
|
|
+ }
|
|
|
+ }
|
|
|
this.$set(
|
|
|
row,
|
|
|
"endDate",
|
|
|
- dayjs(val).add(num+(row.expectCourseNum*7), 'day').format('YYYY-MM-DD')
|
|
|
+ end.format('YYYY-MM-DD')
|
|
|
);
|
|
|
}else{
|
|
|
this.$set(
|