Browse Source

更新

master
unknown 11 months ago
parent
commit
7283a68e37
  1. 10
      components/myRadio/myRadio.vue
  2. 4
      config/api.js
  3. 38
      pages/recordEntry/operate/mySchedule/mould/mould.vue
  4. 6
      pages/recordEntry/operate/mySchedule/mouldEdit/mouldAdd.vue
  5. 37
      pages/recordEntry/operate/mySchedule/mouldEdit/mouldEdit.vue
  6. 137
      pages/recordEntry/operate/mySchedule/plan/plan.vue
  7. 2
      store/modules/user.js

10
components/myRadio/myRadio.vue

@ -1,7 +1,7 @@
<template>
<view class="radioBox">
<u-radio-group
v-model="value"
v-model="radioVal.value"
placement="row"
size="14"
>
@ -21,12 +21,8 @@
<script>
export default {
props: {
radioData: {
type: Array,
default: []
}
},
props: ['radioData', 'radioVal'],
data() {
return {
value: ''

4
config/api.js

@ -31,9 +31,11 @@ export const getClassCreate = (data) => http.post('business/booking/schedule-tem
// 排课模板分页
export const scheduleTemplatePage = (params) => http.get('business/booking/schedule-template/page', {params} ,)
// 更新排课模版
export const scheduleTemplateUpdate = (data) => http.post('business/booking/schedule-template/update', data ,)
export const scheduleTemplateUpdate = (data) => http.put('business/booking/schedule-template/update', data ,)
// 获取排课模版
export const scheduleTemplateGet = (params) => http.get('business/booking/schedule-template/get', {params} ,)
// 训练场地
export const trainingSiteList = (params) => http.get('business/training-site/list', {params} ,)

38
pages/recordEntry/operate/mySchedule/mould/mould.vue

@ -2,7 +2,7 @@
<view class="pageBgImg">
<topNavbar title="模板"></topNavbar>
<view class="pad">
<view class="card" v-for="(item,index) in list" :key="index">
<view class="card" v-for="(item,index) in list" :key="index" @click="chooseMould(item)">
<view class="tit_row">
<view class="tit">{{item.templateName}}</view>
<view class="manage" @click="$goPage('/pages/recordEntry/operate/mySchedule/mouldEdit/mouldEdit?id='+item.id)">管理</view>
@ -12,17 +12,22 @@
<view class="text">时间段</view>
<view class="text">最多人数</view>
</view>
<view class="li" v-for="(item2,index2) in item.detailVO" :key="index">
<view class="li" v-for="(item2,index2) in item.detailVO" :key="index2">
<view class="text">{{ item2.startTime}} <text>-</text> {{item2.endTime}}</view>
<view class="text">{{ item2.personCount }}</view>
</view>
</view>
</view>
</view>
<view style="padding-bottom: 20rpx;" v-if="list.length>10">
<u-loadmore :status="status" />
</view>
<view class="btn_footer">
<view class="btnBorder" @click="$goPage('/pages/recordEntry/operate/mySchedule/mouldEdit/mouldAdd' )">新增模版</view>
</view>
</view>
</template>
@ -36,21 +41,44 @@
params: {
pageNo: 1,
pageSize: 20
}
},
status: 'loading'
}
},
onLoad() {
this.params.coachId = this.vuex_coachId
this.scheduleTemplatePageFn()
uni.$on('refreshMould', ()=>{
this.initList()
})
},
onPullDownRefresh() {
this.initList()
},
onReachBottom() {
if(this.total>this.list.length) {
this.scheduleTemplatePageFn()
}
},
methods: {
chooseMould(item) {
uni.$emit('chooseMould', item)
uni.navigateBack()
},
initList() {
this.status = 'loading'
this.params.pageNo =1
this.list = []
this.scheduleTemplatePageFn()
},
async scheduleTemplatePageFn() {
const {data: res} = await scheduleTemplatePage(this.params)
this.params.pageNo ++
this.list.push(...res.list)
this.total = res.total
if(this.list.length>=this.total) {
this.status = 'nomore'
}
}
}
}

6
pages/recordEntry/operate/mySchedule/mouldEdit/mouldAdd.vue

@ -52,8 +52,10 @@
:minHour="datePicker.minHour"
:maxHour="datePicker.maxHour"
:minMinute="datePicker.minMinute"
:maxMinute="datePicker.maxMinute"
:maxMinute="0"
@confirm="confirmTime"
@close="show=false"
@cancel="show=false"
></u-datetime-picker>
</view>
</template>
@ -66,7 +68,7 @@
datePicker: {
minHour: 0,
maxHour: 0,
maxMinute: 59,
maxMinute: 0,
minMinute: 0
},
FormData: {},

37
pages/recordEntry/operate/mySchedule/mouldEdit/mouldEdit.vue

@ -42,24 +42,26 @@
<view class="text">添加</view>
</view>
<view class="btnBg" @click="$u.throttle(getClassCreateFn, 500)">保存为模板</view>
<view class="btnBg" @click="$u.debounce(scheduleTemplateUpdateFn, 500)">保存为模板</view>
</view>
<u-datetime-picker
:show="show"
v-model="value1"
mode="time"
:minHour="datePicker.minHour"
:maxHour="datePicker.maxHour"
:minMinute="datePicker.minMinute"
:maxMinute="datePicker.maxMinute"
@confirm="confirmTime"
@close="show=false"
@cancel="show=false"
:closeOnClickOverlay="true"
></u-datetime-picker>
</view>
</template>
<script>
import { getClassCreate, getClassTimeLimt, scheduleTemplateGet } from '@/config/api.js'
import { getClassCreate, getClassTimeLimt, scheduleTemplateGet, scheduleTemplateUpdate } from '@/config/api.js'
export default {
data() {
@ -67,7 +69,7 @@
datePicker: {
minHour: 0,
maxHour: 0,
maxMinute: 59,
maxMinute: 0,
minMinute: 0
},
FormData: {},
@ -78,23 +80,22 @@
},
onLoad(options) {
this.id = options.id
// this.initFormData()
this.scheduleTemplateGetFn()
this.getClassTimeLimtFn()
},
methods: {
initFormData() {
this.FormData = {
templateName: '',
scheduleClassTemplateDetailList: [
{startTime: '',endTime: '', personCount: 1, id: new Date() * 1}
]}
this.FormData.coachId = this.vuex_coachId
this.FormData.deptId = this.vuex_deptId
closeFn(val) {
console.log('val')
},
//
async scheduleTemplateGetFn() {
const {data: res} = await scheduleTemplateGet({id: this.id})
this.FormData = res
this.$set(this.FormData, 'scheduleClassTemplateDetailList', res.detailVO)
delete this.FormData.detailVO
console.log(this.FormData)
},
//
async getClassTimeLimtFn() {
@ -104,7 +105,7 @@
console.log(this.datePicker)
},
//
async getClassCreateFn() {
async scheduleTemplateUpdateFn() {
this.FormData.scheduleClassTemplateDetailList.forEach((item)=>{
})
@ -113,9 +114,11 @@
if(!item.endTime||!item.startTime||!item.personCount)
return this.$u.toast('请输入完整的信息')
}
const {data: res} = await getClassCreate(this.FormData)
if(res) this.$u.toast('创建成功')
this.initFormData()
const {data: res} = await scheduleTemplateUpdate(this.FormData)
if(res) this.$u.toast('更新成功')
uni.$emit('refreshMould')
uni.navigateBack()
// this.initFormData()
},
addFn() {
let obj = {startTime: '',endTime: '', people: 1, id: new Date() * 1}

137
pages/recordEntry/operate/mySchedule/plan/plan.vue

@ -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, //:023
openRange: 1, //01
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 = {

2
store/modules/user.js

@ -41,7 +41,7 @@ const user = {
state.vuex_userInfo = {}
state.vuex_TenantId = ''
uni.navigateTo({
url: '/pages/userCenter/login/loginByPhone'
url: '/pages/login/login'
})
}
},

Loading…
Cancel
Save