江西小程序管理端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

291 lines
7.3 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="排课计划"></topNavbar>
  4. <view class="pad">
  5. <view class="card">
  6. <view class="row">
  7. <view class="lab">计划开始日期</view>
  8. <view class="rightCon" @click="showClick('classBeginDate')">
  9. <view class="inputBox">
  10. <input type="text" v-model="form.classBeginDate" placeholder="请选择" disabled style="pointer-events: none;">
  11. </view>
  12. <view class="icon">
  13. <u-icon name="arrow-right" :size="12" :color="'#696B72'"></u-icon>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="row">
  18. <view class="lab">计划结束日期</view>
  19. <view class="rightCon" @click="showClick('classEndDate')">
  20. <view class="inputBox">
  21. <input type="text" v-model="form.classEndDate" placeholder="请选择" disabled style="pointer-events: none;">
  22. </view>
  23. <view class="icon">
  24. <u-icon name="arrow-right" :size="12" :color="'#696B72'"></u-icon>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="row">
  29. <view class="lab">选择训练场地</view>
  30. <view class="rightCon" @click="showSite=true">
  31. <view class="inputBox">
  32. <input type="text" v-model="form.siteName" placeholder="请选择" disabled style="pointer-events: none;">
  33. </view>
  34. <view class="icon">
  35. <u-icon name="arrow-right" :size="12" :color="'#696B72'"></u-icon>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="row">
  40. <view class="lab">选择开课时间段</view>
  41. <view class="rightCon" @click="$goPage('/pages/recordEntry/operate/mySchedule/mould/mould')">
  42. <view class="inputBox">
  43. <input type="text" v-model="currentMould.templateName" placeholder="请选择" disabled style="pointer-events: none;">
  44. </view>
  45. <view class="icon">
  46. <u-icon name="arrow-right" :size="12" :color="'#696B72'"></u-icon>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="blueBg">
  51. <view class="time_row hui">
  52. <text>时间段</text> <text>最多人数</text>
  53. </view>
  54. <view class="time_row" v-for="(item,index) in currentMould.detailVO" :key="index">
  55. <text>{{item.startTime}} <text>-</text> {{item.endTime}}</text> <text>{{item.personCount}}</text>
  56. </view>
  57. <!-- <view class="time_row">
  58. <text>8:00-9:00</text> <text>4</text>
  59. </view> -->
  60. </view>
  61. <view class="row">
  62. <view class="lab">训练科目</view>
  63. <view class="rightCon">
  64. <myRadio @changeRadio="changeRadioSubject" :radioData="radiolist1" :radioVal="{value: form.subject}"></myRadio>
  65. </view>
  66. </view>
  67. <view class="row">
  68. <view class="lab">教练车</view>
  69. <view class="rightCon">
  70. <myRadio @changeRadio="changeCarNumber" :radioData="radiolist2" :radioVal="{value: form.carNumber}"></myRadio>
  71. </view>
  72. </view>
  73. <view class="row">
  74. <view class="lab">开放范围</view>
  75. <view class="rightCon">
  76. <myRadio @changeRadio="changeRadioOpenRange" :radioData="radiolist3" :radioVal="{value: form.openRange}"></myRadio>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="btnBg" @click="scheduleClassCreateFn">确认发布</view>
  81. </view>
  82. <u-datetime-picker
  83. :show="show"
  84. :minDate="minDate"
  85. :maxDate="maxDate"
  86. mode="date"
  87. @confirm="changeDate"
  88. @cancel="show=false"
  89. ></u-datetime-picker>
  90. <u-picker :show="showSite" :columns="siteColumns" keyName="name" @confirm="changeSite" @cancel="showSite=false" ></u-picker>
  91. </view>
  92. </template>
  93. <script>
  94. import { scheduleClassCreate, getClassDateLimit, trainingSiteList, } from '@/config/api.js'
  95. export default {
  96. data() {
  97. return {
  98. tmpDateName:'',//选择日期临时变量
  99. minDate: null,
  100. maxDate: null,
  101. show: false,
  102. showSite: false,
  103. form: {
  104. classDate: '',
  105. carNumber: '',
  106. subject: 0, //科目类别:0:不限;2:科目二;3:科目三
  107. openRange: 1, //开放范围:0:自己的学员;1:绑定的驾校的学员
  108. siteName: '',
  109. siteId: ''
  110. },
  111. currentMould: {},
  112. siteColumns: [],
  113. radiolist1: [{
  114. name: '不限制',
  115. id: 0,
  116. disabled: false
  117. },
  118. {
  119. name: '科目二',
  120. id: 2,
  121. disabled: false
  122. },
  123. {
  124. name: '科目三',
  125. id: 3,
  126. disabled: false
  127. },
  128. ],
  129. radiolist2: [{
  130. name: '浙A8888',
  131. id: '浙A8888',
  132. disabled: false
  133. },
  134. {
  135. name: '浙A8889',
  136. id: '浙A8889',
  137. disabled: false
  138. },
  139. ],
  140. radiolist3: [{
  141. name: '我的学员',
  142. id: 0,
  143. disabled: false
  144. },
  145. {
  146. name: '所有学员',
  147. id: 1,
  148. disabled: false
  149. },
  150. ] //开放范围:0:自己的学员;1:绑定的驾校的学员
  151. }
  152. },
  153. onLoad() {
  154. this.form.deptId = this.vuex_deptId
  155. this.form.coachId = this.vuex_coachId
  156. this.getClassDateLimitFn()
  157. this.trainingSiteListFn()
  158. uni.$on('chooseMould',(item)=>{
  159. this.form.templateId = item.id
  160. this.currentMould = item
  161. console.log(item)
  162. })
  163. },
  164. methods: {
  165. // 点击显示选择日期组件
  166. showClick(name) {
  167. this.show = true
  168. this.tmpDateName = name
  169. },
  170. // 选择车牌号
  171. changeCarNumber(val) {
  172. this.form.carNumber = val
  173. },
  174. // 发布排课计划
  175. async scheduleClassCreateFn() {
  176. console.log(this.form)
  177. const res = await scheduleClassCreate(this.form)
  178. if(res.code==0) {
  179. this.$goPage('/pages/recordEntry/operate/mySchedule/mySchedule')
  180. }
  181. console.log(res)
  182. },
  183. // 选择训练场地
  184. changeSite(val) {
  185. let item = val.value[0]
  186. this.form.address = item.address
  187. this.form.seq = item.seq
  188. this.form.area = item.area
  189. this.form.siteName = item.name
  190. this.form.siteId = item.id
  191. this.showSite = false
  192. },
  193. // 获取训练场地
  194. async trainingSiteListFn() {
  195. let obj = {
  196. pageNo: 1,
  197. pageSize: 100,
  198. schoolId: this.vuex_userInfo.user.schoolId
  199. }
  200. const {data: res} = await trainingSiteList(obj)
  201. this.siteColumns = [ res ]
  202. console.log(res)
  203. },
  204. changeRadio(val) {
  205. console.log(val)
  206. },
  207. changeRadioOpenRange(val) {
  208. this.form.openRange = val
  209. },
  210. // 选择科目
  211. changeRadioSubject(val) {
  212. this.form.subject = val
  213. console.log(this.form.subject)
  214. },
  215. // 选择日期
  216. changeDate(val) {
  217. this.form[this.tmpDateName] = this.$u.date(val.value, 'yyyy-mm-dd')
  218. this.show = false
  219. console.log(val)
  220. },
  221. // 获取排课日期范围
  222. async getClassDateLimitFn() {
  223. let obj = {
  224. coachId: this.vuex_coachId
  225. }
  226. const {data: res} = await getClassDateLimit(obj)
  227. this.minDate = new Date(res.beginDateLimit)*1 + 86400000
  228. this.maxDate = new Date(res.endDateLimit)*1
  229. }
  230. }
  231. }
  232. </script>
  233. <style lang="scss" scoped>
  234. .card {
  235. padding: 10rpx 28rpx;
  236. .row {
  237. display: flex;
  238. justify-content: space-between;
  239. padding: 26rpx 0;
  240. .lab {
  241. font-weight: 500;
  242. }
  243. }
  244. }
  245. .btnBg {
  246. width: 396rpx;
  247. margin: 120rpx auto 0 auto;
  248. }
  249. .rightCon {
  250. display: flex;
  251. align-items: center;
  252. .icon {
  253. margin-left: 10rpx;
  254. }
  255. .inputBox {
  256. flex: 1;
  257. input {
  258. text-align: right;
  259. font-size: 28rpx;
  260. color: #333;
  261. }
  262. }
  263. }
  264. .blueBg {
  265. background-color: #E8F3FE;
  266. padding: 12rpx 32rpx;
  267. border-radius: 16rpx;
  268. text-align: center;
  269. .time_row {
  270. display: flex;
  271. justify-content: space-between;
  272. padding: 12rpx 0;
  273. &.hui {
  274. color: #ADADAD;
  275. }
  276. text {
  277. width: 170rpx;
  278. }
  279. }
  280. }
  281. </style>