This commit is contained in:
=
2026-07-01 09:21:06 +08:00
parent 3f8f8f5f44
commit 2e3c3e87da
14 changed files with 128 additions and 18 deletions
@@ -239,6 +239,12 @@ const basicForm = {
</template>
</el-table-column>
<el-table-column label="手机号" prop="courseInstructorMobile">
<template v-slot="{row}">
<el-input size="small" v-model="row.courseInstructorMobile" placeholder="请输入手机号"></el-input>
</template>
</el-table-column>
<el-table-column label="分类标识" prop="assort">
<template v-slot="{row}">
<el-input size="small" v-model="row.assort" placeholder="请输入分类标识"></el-input>
@@ -328,7 +334,7 @@ const basicForm = {
formData: {
notice: false,
courseList: [
{ orderNum: 1, courseName: "", courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false },
{ orderNum: 1, courseName: "", courseInstructorMobile: "", courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false },
],
conditionStructure: {
method: "AND",
@@ -462,7 +468,7 @@ const basicForm = {
this.formData.courseList = this.formData.courseList.sort((a, b) => a.orderNum - b.orderNum)
},
addCourse() {
this.formData.courseList.push({ courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false })
this.formData.courseList.push({ courseInstructorMobile: "", courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false })
},
async historicalActChange(val) {
const resp = await this.$axios.post("/platform/trainSignUp/manage/findOne", {id: val})
@@ -572,6 +578,10 @@ const basicForm = {
this.$message.warning("第" + (i + 1) + "行信息填写有误,请核查")
return true
}
if (v.courseInstructorMobile && !/^1[3-9]\d{9}$/.test(v.courseInstructorMobile)) {
this.$message.warning("第" + (i + 1) + "行手机号格式填写有误,请核查")
return true
}
if (v.isMobileSign === true && v.signType === 3 && (v.courseLocationCoordinates === undefined || v.courseLocationCoordinates.length < 2)) {
this.$message.warning("第" + (i + 1) + "行地点坐标填写有误,请核查")
return true
@@ -61,7 +61,7 @@ layout("/layouts/platform.html"){
</el-table-column>
<el-table-column label="操作" width="150px">
<template v-slot="{row}">
<el-button @click="handleUser(row.userId)" size="mini" type="danger" v-if="!row.isDisabled">拉黑</el-button>
<el-button @click="handleUser(row.userId)" size="mini" type="danger" v-if="!row.isDisabled">冻结</el-button>
<el-button @click="handleUser(row.userId)" size="mini" type="success" v-if="row.isDisabled">解封</el-button>
</template>
</el-table-column>
@@ -222,6 +222,8 @@ const apply = {
filterHolidays: false,
holidayList: [],
notApplyTimeList: [],
termStartDate: '',
termEndDate: '',
},
availabilityData: {
date: '',
@@ -513,6 +515,8 @@ const apply = {
filterHolidays: !!this.row.filterHolidays,
holidayList: [],
notApplyTimeList: Array.isArray(this.row.notApplyTimeList) ? this.row.notApplyTimeList : [],
termStartDate: this.row.termStartDate || '',
termEndDate: this.row.termEndDate || '',
}
try {
const res = await this.$axios.post('/platform/siteCug/apply/timeLimitConfig', {
@@ -523,6 +527,8 @@ const apply = {
filterHolidays: !!res.data.filterHolidays,
holidayList: Array.isArray(res.data.holidayList) ? res.data.holidayList : [],
notApplyTimeList: Array.isArray(res.data.notApplyTimeList) ? res.data.notApplyTimeList : [],
termStartDate: res.data.termStartDate || '',
termEndDate: res.data.termEndDate || '',
}
} else {
this.timeLimitConfig = fallback
@@ -599,6 +605,9 @@ const apply = {
this.$nextTick(() => {
this.$refs.formRef?.clearValidate(['applyUnionName', 'clubId'])
})
this.pickerRefreshKey += 1
this.scheduleDate = this.getInitialScheduleDate()
await this.queryAvailability(this.scheduleDate)
},
async loadManagedClubs() {
try {
@@ -671,6 +680,11 @@ const apply = {
if (currentDay.day() === 0 || currentDay.day() === 6) {
return true
}
if (this.formData.reserveType === 'union' && this.timeLimitConfig.termStartDate && this.timeLimitConfig.termEndDate) {
if (currentDay.isBefore(this.timeLimitConfig.termStartDate) || currentDay.isAfter(this.timeLimitConfig.termEndDate)) {
return true
}
}
return this.timeLimitConfig.filterHolidays && this.timeLimitConfig.holidayList.includes(day)
},
normalizeTime(timeStr) {
@@ -81,7 +81,7 @@
<el-tab-pane label="设置场地" name="siteSetting">
<el-row :gutter="20" type="flex">
<el-col :span="12">
<el-col :span="8">
<el-form-item prop="state" label="开启状态">
<el-radio-group v-model="formData.state" size="medium">
<el-radio-button :label="true">开启</el-radio-button>
@@ -89,7 +89,7 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="8">
<el-form-item prop="sexLimit" label="性别限制">
<el-radio-group v-model="formData.sexLimit" size="medium">
<el-radio-button :label="0">不限制</el-radio-button>
@@ -98,10 +98,23 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="本学期时间">
<el-date-picker
v-model="formData.termDateRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
style="width: 100%">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex">
<el-col :span="12">
<el-col :span="8">
<el-form-item prop="reserveTimeType" label="预约时间段类型">
<el-radio-group v-model="formData.reserveTimeType" @change="handleReserveTimeTypeChange" size="medium">
<el-radio-button :label="1">分段预约</el-radio-button>
@@ -109,7 +122,7 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="8">
<el-form-item prop="filterHolidays" label="排除节假日">
<el-radio-group v-model="formData.filterHolidays" size="medium">
<el-radio-button :label="true">是</el-radio-button>
@@ -117,7 +130,7 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="8">
<el-form-item label="禁用时间">
<el-button type="primary" @click="openSetUpTime" size="small">点击设置禁用时间</el-button>
<span style="color: #c64120">您已设置{{ formData.notApplyTimeList ? formData.notApplyTimeList.length : 0 }}个禁用时间</span>
@@ -325,6 +338,7 @@
formData: {
state: true,
sexLimit: 0,
termDateRange: [],
filterHolidays: false,
reserveTimeType: 1,
openHours: [{ startTime: '', endTime: '', timeUnit: 30 }],
@@ -408,6 +422,14 @@
} else {
submitData.openHours = [clone(this.fullDayOpenHourCache || { startTime: '', endTime: '', timeUnit: 60 })]
}
if (Array.isArray(submitData.termDateRange) && submitData.termDateRange.length === 2) {
submitData.termStartDate = submitData.termDateRange[0]
submitData.termEndDate = submitData.termDateRange[1]
} else {
submitData.termStartDate = ''
submitData.termEndDate = ''
}
delete submitData.termDateRange
return submitData
},
initOpenHoursCache() {
@@ -654,11 +676,17 @@
if (!this.formData.fullDayOpenHour) {
this.$set(this.formData, 'fullDayOpenHour', { startTime: '', endTime: '', timeUnit: 30 })
}
if (this.formData.termStartDate && this.formData.termEndDate) {
this.$set(this.formData, 'termDateRange', [this.formData.termStartDate, this.formData.termEndDate])
} else {
this.$set(this.formData, 'termDateRange', [])
}
this.initOpenHoursCache()
} else {
this.formData = {
state: true,
sexLimit: 0,
termDateRange: [],
filterHolidays: false,
reserveTimeType: 1,
openHours: [{ startTime: '', endTime: '', timeUnit: 30 }],
@@ -698,6 +726,11 @@
if (!this.formData.fullDayOpenHour) {
this.$set(this.formData, 'fullDayOpenHour', { startTime: '', endTime: '', timeUnit: 30 })
}
if (this.formData.termStartDate && this.formData.termEndDate) {
this.$set(this.formData, 'termDateRange', [this.formData.termStartDate, this.formData.termEndDate])
} else {
this.$set(this.formData, 'termDateRange', [])
}
this.initOpenHoursCache()
}
if (!stayOnPage) {
@@ -586,6 +586,7 @@ layout("/layouts/platform.html"){
</el-form>
<el-row type="flex" justify="end" class="mt20">
<el-button type="primary" plain @click="onSave">保存</el-button>
<el-button type="primary" plain @click="onNextStep" v-if="showInvoiceTab && activeTabName === 'basic'">下一步</el-button>
<el-button type="primary" @click="onSubmit" v-if="!taskId">提交</el-button>
<el-button type="primary" @click="onFinishTask" v-else>提交</el-button>
</el-row>
@@ -1285,6 +1286,12 @@ layout("/layouts/platform.html"){
})
})
},
// 下一步
onNextStep() {
this.rebuildInvoiceSummary()
this.normalizeFundBalance()
this.activeTabName = "invoice"
},
// 提交验证
validateBeforeSubmit() {
return new Promise((resolve) => {
@@ -1,4 +1,4 @@
<!--#
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
@@ -46,6 +46,7 @@ layout("/layouts/platform_h5.html"){
<table-column label="校区">{{row.campus}}</table-column>
<table-column label="地点">{{row.courseLocation}}</table-column>
<table-column label="联系人">{{row.courseInstructor}}</table-column>
<table-column v-if="row.courseInstructorMobile" label="联系方式">{{row.courseInstructorMobile}}</table-column>
<table-column label="时间">
<span v-if="row.courseTimes && row.courseTimes.length === 1" class="primary-color" @click="onTime(row)">
{{ weekdayCNMap[$moment(row.courseTimes[0].courseDate).day()]
@@ -17,6 +17,8 @@ new Vue({
filterHolidays: false,
holidayList: [],
notApplyTimeList: [],
termStartDate: '',
termEndDate: '',
},
availabilityData: {
date: '',
@@ -282,7 +284,6 @@ new Vue({
this.formData.applyUnionName = user.union ? user.union.name : ''
this.formData.clubId = ''
this.formData.clubName = ''
return
}
if (value === 'club') {
this.formData.applyUnionId = ''
@@ -291,6 +292,9 @@ new Vue({
this.formData.clubName = ''
await this.loadManagedClubs()
}
this.scheduleDate = this.getInitialScheduleDate()
this.schedulePickerDate = this.$moment(this.scheduleDate, 'YYYY-MM-DD').toDate()
await this.queryAvailability(this.scheduleDate)
},
async loadManagedClubs() {
try {
@@ -710,6 +714,11 @@ new Vue({
if (currentDay.day() === 0 || currentDay.day() === 6) {
return true
}
if (this.formData.reserveType === 'union' && this.timeLimitConfig.termStartDate && this.timeLimitConfig.termEndDate) {
if (currentDay.isBefore(this.timeLimitConfig.termStartDate) || currentDay.isAfter(this.timeLimitConfig.termEndDate)) {
return true
}
}
return this.timeLimitConfig.filterHolidays && this.timeLimitConfig.holidayList.includes(day)
},
getDisabledRangesByDay(dayStr) {
@@ -924,6 +933,8 @@ new Vue({
filterHolidays: !!this.row.filterHolidays,
holidayList: [],
notApplyTimeList: Array.isArray(this.row.notApplyTimeList) ? this.row.notApplyTimeList : [],
termStartDate: this.row.termStartDate || '',
termEndDate: this.row.termEndDate || '',
}
try {
const res = await this.$axios.post('/platform/siteCug/apply/timeLimitConfig', {
@@ -934,6 +945,8 @@ new Vue({
filterHolidays: !!res.data.filterHolidays,
holidayList: Array.isArray(res.data.holidayList) ? res.data.holidayList : [],
notApplyTimeList: Array.isArray(res.data.notApplyTimeList) ? res.data.notApplyTimeList : [],
termStartDate: res.data.termStartDate || '',
termEndDate: res.data.termEndDate || '',
}
return
}