江西小程序管理端
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.

288 lines
7.2 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. <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: 1,
  143. disabled: false
  144. },
  145. {
  146. name: '所有学员',
  147. id: 2,
  148. disabled: false
  149. },
  150. ]
  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 {data: res} = await scheduleClassCreate(this.form)
  178. console.log(res)
  179. },
  180. // 选择训练场地
  181. changeSite(val) {
  182. let item = val.value[0]
  183. this.form.address = item.address
  184. this.form.seq = item.seq
  185. this.form.area = item.area
  186. this.form.siteName = item.name
  187. this.form.siteId = item.id
  188. this.showSite = false
  189. },
  190. // 获取训练场地
  191. async trainingSiteListFn() {
  192. let obj = {
  193. pageNo: 1,
  194. pageSize: 100,
  195. schoolId: this.vuex_userInfo.user.schoolId
  196. }
  197. const {data: res} = await trainingSiteList(obj)
  198. this.siteColumns = [ res ]
  199. console.log(res)
  200. },
  201. changeRadio(val) {
  202. console.log(val)
  203. },
  204. changeRadioOpenRange(val) {
  205. this.form.openRange = val
  206. },
  207. // 选择科目
  208. changeRadioSubject(val) {
  209. this.form.subject = val
  210. console.log(this.form.subject)
  211. },
  212. // 选择日期
  213. changeDate(val) {
  214. this.form[this.tmpDateName] = this.$u.date(val.value, 'yyyy-mm-dd')
  215. this.show = false
  216. console.log(val)
  217. },
  218. // 获取排课日期范围
  219. async getClassDateLimitFn() {
  220. let obj = {
  221. coachId: this.vuex_coachId
  222. }
  223. const {data: res} = await getClassDateLimit(obj)
  224. this.minDate = new Date(res.beginDateLimit)*1 + 86400000
  225. this.maxDate = new Date(res.endDateLimit)*1
  226. }
  227. }
  228. }
  229. </script>
  230. <style lang="scss" scoped>
  231. .card {
  232. padding: 10rpx 28rpx;
  233. .row {
  234. display: flex;
  235. justify-content: space-between;
  236. padding: 26rpx 0;
  237. .lab {
  238. font-weight: 500;
  239. }
  240. }
  241. }
  242. .btnBg {
  243. width: 396rpx;
  244. margin: 120rpx auto 0 auto;
  245. }
  246. .rightCon {
  247. display: flex;
  248. align-items: center;
  249. .icon {
  250. margin-left: 10rpx;
  251. }
  252. .inputBox {
  253. flex: 1;
  254. input {
  255. text-align: right;
  256. font-size: 28rpx;
  257. color: #333;
  258. }
  259. }
  260. }
  261. .blueBg {
  262. background-color: #E8F3FE;
  263. padding: 12rpx 32rpx;
  264. border-radius: 16rpx;
  265. text-align: center;
  266. .time_row {
  267. display: flex;
  268. justify-content: space-between;
  269. padding: 12rpx 0;
  270. &.hui {
  271. color: #ADADAD;
  272. }
  273. text {
  274. width: 170rpx;
  275. }
  276. }
  277. }
  278. </style>