|
|
@ -4,10 +4,32 @@ |
|
|
|
<view class="pad"> |
|
|
|
<view class="card"> |
|
|
|
<view class="row"> |
|
|
|
<view class="lab">计划日期</view> |
|
|
|
<view class="rightCon" @click="show=true"> |
|
|
|
<view class="lab">计划开始日期</view> |
|
|
|
<view class="rightCon" @click="showClick('classBeginDate')"> |
|
|
|
<view class="inputBox"> |
|
|
|
<input type="text" v-model="form.classDate" placeholder="请选择" disabled style="pointer-events: none;"> |
|
|
|
<input type="text" v-model="form.classBeginDate" placeholder="请选择" disabled style="pointer-events: none;"> |
|
|
|
</view> |
|
|
|
<view class="icon"> |
|
|
|
<u-icon name="arrow-right" :size="12" :color="'#696B72'"></u-icon> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="row"> |
|
|
|
<view class="lab">计划结束日期</view> |
|
|
|
<view class="rightCon" @click="showClick('classEndDate')"> |
|
|
|
<view class="inputBox"> |
|
|
|
<input type="text" v-model="form.classEndDate" placeholder="请选择" disabled style="pointer-events: none;"> |
|
|
|
</view> |
|
|
|
<view class="icon"> |
|
|
|
<u-icon name="arrow-right" :size="12" :color="'#696B72'"></u-icon> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="row"> |
|
|
|
<view class="lab">选择训练场地</view> |
|
|
|
<view class="rightCon" @click="showSite=true"> |
|
|
|
<view class="inputBox"> |
|
|
|
<input type="text" v-model="form.siteName" placeholder="请选择" disabled style="pointer-events: none;"> |
|
|
|
</view> |
|
|
|
<view class="icon"> |
|
|
|
<u-icon name="arrow-right" :size="12" :color="'#696B72'"></u-icon> |
|
|
@ -18,45 +40,46 @@ |
|
|
|
<view class="lab">选择开课时间段</view> |
|
|
|
<view class="rightCon" @click="$goPage('/pages/recordEntry/operate/mySchedule/mould/mould')"> |
|
|
|
<view class="inputBox"> |
|
|
|
<input type="text" v-model="form.input1" placeholder="请选择" disabled style="pointer-events: none;"> |
|
|
|
<input type="text" v-model="currentMould.templateName" placeholder="请选择" disabled style="pointer-events: none;"> |
|
|
|
</view> |
|
|
|
<view class="icon"> |
|
|
|
<u-icon name="arrow-right" :size="12" :color="'#696B72'"></u-icon> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="blueBg"> |
|
|
|
<view class="time_row hui"> |
|
|
|
<text>时间段</text> <text>最多人数</text> |
|
|
|
</view> |
|
|
|
<view class="time_row"> |
|
|
|
<text>7:00-8:00</text> <text>4人</text> |
|
|
|
<view class="time_row" v-for="(item,index) in currentMould.detailVO" :key="index"> |
|
|
|
<text>{{item.startTime}} <text>-</text> {{item.endTime}}</text> <text>{{item.personCount}}人</text> |
|
|
|
</view> |
|
|
|
<view class="time_row"> |
|
|
|
<!-- <view class="time_row"> |
|
|
|
<text>8:00-9:00</text> <text>4人</text> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
<view class="row"> |
|
|
|
<view class="lab">训练科目</view> |
|
|
|
<view class="rightCon"> |
|
|
|
<myRadio @changeRadio="changeRadio" :radioData="radiolist1"></myRadio> |
|
|
|
<myRadio @changeRadio="changeRadioSubject" :radioData="radiolist1" :radioVal="{value: form.subject}"></myRadio> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="row"> |
|
|
|
<view class="lab">教练车</view> |
|
|
|
<view class="rightCon"> |
|
|
|
<myRadio @changeRadio="changeRadio" :radioData="radiolist2"></myRadio> |
|
|
|
<myRadio @changeRadio="changeCarNumber" :radioData="radiolist2" :radioVal="{value: form.carNumber}"></myRadio> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="row"> |
|
|
|
<view class="lab">开放范围</view> |
|
|
|
<view class="rightCon"> |
|
|
|
<myRadio @changeRadio="changeRadio" :radioData="radiolist3"></myRadio> |
|
|
|
<myRadio @changeRadio="changeRadioOpenRange" :radioData="radiolist3" :radioVal="{value: form.openRange}"></myRadio> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="btnBg">确认发布</view> |
|
|
|
<view class="btnBg" @click="scheduleClassCreateFn">确认发布</view> |
|
|
|
</view> |
|
|
|
<u-datetime-picker |
|
|
|
:show="show" |
|
|
@ -64,41 +87,56 @@ |
|
|
|
:maxDate="maxDate" |
|
|
|
mode="date" |
|
|
|
@confirm="changeDate" |
|
|
|
@cancel="show=false" |
|
|
|
></u-datetime-picker> |
|
|
|
<u-picker :show="showSite" :columns="siteColumns" keyName="name" @confirm="changeSite" @cancel="showSite=false" ></u-picker> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { scheduleClassCreate, getClassDateLimit } from '@/config/api.js' |
|
|
|
import { scheduleClassCreate, getClassDateLimit, trainingSiteList, } from '@/config/api.js' |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
tmpDateName:'',//选择日期临时变量 |
|
|
|
minDate: null, |
|
|
|
maxDate: null, |
|
|
|
show: false, |
|
|
|
showSite: false, |
|
|
|
form: { |
|
|
|
classDate: '', |
|
|
|
radio1: 1 |
|
|
|
carNumber: '', |
|
|
|
subject: 0, //科目类别:0:不限;2:科目二;3:科目三 |
|
|
|
openRange: 1, //开放范围:0:自己的学员;1:绑定的驾校的学员 |
|
|
|
siteName: '', |
|
|
|
siteId: '' |
|
|
|
}, |
|
|
|
currentMould: {}, |
|
|
|
siteColumns: [], |
|
|
|
radiolist1: [{ |
|
|
|
name: '不限制', |
|
|
|
id: 0, |
|
|
|
disabled: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '科目二', |
|
|
|
id: 1, |
|
|
|
id: 2, |
|
|
|
disabled: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '科目三', |
|
|
|
id: 2, |
|
|
|
id: 3, |
|
|
|
disabled: false |
|
|
|
}, |
|
|
|
], |
|
|
|
radiolist2: [{ |
|
|
|
name: '浙A8888', |
|
|
|
id: 1, |
|
|
|
id: '浙A8888', |
|
|
|
disabled: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '浙A8889', |
|
|
|
id: 2, |
|
|
|
id: '浙A8889', |
|
|
|
disabled: false |
|
|
|
}, |
|
|
|
], |
|
|
@ -116,24 +154,71 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.form.deptId = this.vuex_deptId |
|
|
|
this.form.coachId = this.vuex_coachId |
|
|
|
this.getClassDateLimitFn() |
|
|
|
this.trainingSiteListFn() |
|
|
|
uni.$on('chooseMould',(item)=>{ |
|
|
|
this.form.templateId = item.id |
|
|
|
this.currentMould = item |
|
|
|
console.log(item) |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
changeRadio(val) { |
|
|
|
console.log(val) |
|
|
|
// 点击显示选择日期组件 |
|
|
|
showClick(name) { |
|
|
|
this.show = true |
|
|
|
this.tmpDateName = name |
|
|
|
}, |
|
|
|
// 选择日期 |
|
|
|
changeDate(val) { |
|
|
|
this.form.classDate = this.$u.date(val.value, 'yyyy-mm-dd') |
|
|
|
console.log(val) |
|
|
|
// 选择车牌号 |
|
|
|
changeCarNumber(val) { |
|
|
|
this.form.carNumber = val |
|
|
|
}, |
|
|
|
// 发布排课计划 |
|
|
|
async scheduleClassCreateFn() { |
|
|
|
console.log(this.form) |
|
|
|
const {data: res} = await scheduleClassCreate(this.form) |
|
|
|
console.log(res) |
|
|
|
}, |
|
|
|
// 选择训练场地 |
|
|
|
changeSite(val) { |
|
|
|
let item = val.value[0] |
|
|
|
this.form.address = item.address |
|
|
|
this.form.seq = item.seq |
|
|
|
this.form.area = item.area |
|
|
|
this.form.siteName = item.name |
|
|
|
this.form.siteId = item.id |
|
|
|
this.showSite = false |
|
|
|
}, |
|
|
|
// 获取训练场地 |
|
|
|
async trainingSiteListFn() { |
|
|
|
let obj = { |
|
|
|
coachId: this.vuex_coachId |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 100, |
|
|
|
schoolId: this.vuex_userInfo.user.schoolId |
|
|
|
} |
|
|
|
const {data: res} = await scheduleClassCreate(obj) |
|
|
|
const {data: res} = await trainingSiteList(obj) |
|
|
|
this.siteColumns = [ res ] |
|
|
|
console.log(res) |
|
|
|
}, |
|
|
|
changeRadio(val) { |
|
|
|
console.log(val) |
|
|
|
}, |
|
|
|
changeRadioOpenRange(val) { |
|
|
|
this.form.openRange = val |
|
|
|
}, |
|
|
|
// 选择科目 |
|
|
|
changeRadioSubject(val) { |
|
|
|
this.form.subject = val |
|
|
|
console.log(this.form.subject) |
|
|
|
}, |
|
|
|
// 选择日期 |
|
|
|
changeDate(val) { |
|
|
|
this.form[this.tmpDateName] = this.$u.date(val.value, 'yyyy-mm-dd') |
|
|
|
this.show = false |
|
|
|
console.log(val) |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取排课日期范围 |
|
|
|
async getClassDateLimitFn() { |
|
|
|
let obj = { |
|
|
|