许成详 6 年之前
父節點
當前提交
dcc8dd2101

+ 217
- 0
src/pages/system/courseManager/scheduleManager/edit.vue 查看文件

@@ -0,0 +1,217 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h"></div>
6
+        <ul>
7
+          <li>
8
+            <el-select v-model="postData.caseid" placeholder="请选择">
9
+              <el-option
10
+                v-for="item in cases"
11
+                :key="item.CaseId"
12
+                :label="item.CaseName"
13
+                :value="item.CaseId">
14
+              </el-option>
15
+            </el-select>
16
+          </li>
17
+          <li>
18
+            <el-input
19
+              placeholder="请输入课程名称"
20
+              v-model="postData.name"
21
+            >
22
+            </el-input>
23
+          </li>
24
+        </ul>
25
+        <el-button
26
+          size="mini"
27
+          type="primary" @click="search">搜索</el-button>
28
+      </div>
29
+      <div class="moreFilter"></div>
30
+    </div>
31
+    <div class="system-table-box">
32
+      <el-table
33
+        :data="currentList"
34
+        stripe
35
+        style="width: 100%">
36
+        <el-table-column
37
+          prop="CourseName"
38
+          label="课程名称">
39
+        </el-table-column>
40
+        <el-table-column
41
+          prop="Price"
42
+          label="课程价格">
43
+        </el-table-column>
44
+        <el-table-column
45
+          prop="CourseNum"
46
+          label="课时数">
47
+        </el-table-column>
48
+        <el-table-column
49
+          prop="ScheduleNum"
50
+          label="已排课时数">
51
+        </el-table-column>
52
+        <el-table-column
53
+          prop="LocationId"
54
+          label="课程分类">
55
+        </el-table-column>
56
+        <el-table-column
57
+          prop="CaseName"
58
+          label="所在案场">
59
+        </el-table-column>
60
+        <el-table-column
61
+          label="操作">
62
+          <template slot-scope="scope">
63
+            <el-button
64
+              size="mini"
65
+              type="success"
66
+              @click="setCourseDate(item)">设置课程时间</el-button>
67
+          </template>
68
+        </el-table-column>
69
+      </el-table>
70
+    </div>
71
+    <el-pagination
72
+      @current-change="handleCurrentChange"
73
+      :current-page.sync="postData.page"
74
+      :page-size="postData.pagesize"
75
+      layout="prev, pager, next, jumper"
76
+      :total="total">
77
+    </el-pagination>
78
+    <el-dialog
79
+      title="设置课时时间"
80
+      :visible.sync="centerDialogVisible"
81
+      width="500px"
82
+      center>
83
+      <div>
84
+        <ul class="courseDetailForm">
85
+          <li class="flex-h">
86
+            <span>开始时间:</span>
87
+            <div class="flex-item">
88
+              <div>
89
+                <el-date-picker
90
+                  v-model="currentCourseItem.BeginDate"
91
+                  type="date"
92
+                  placeholder="选择开始日期">
93
+                </el-date-picker>
94
+              </div>
95
+            </div>
96
+          </li>
97
+          <li class="flex-h">
98
+            <span>结束时间:</span>
99
+            <div class="flex-item">
100
+              <div>
101
+                <el-date-picker
102
+                  v-model="currentCourseItem.EndDate"
103
+                  type="date"
104
+                  placeholder="选择结束日期">
105
+                </el-date-picker>
106
+              </div>
107
+            </div>
108
+          </li>
109
+          <li class="flex-h">
110
+            <span>课时名称:</span>
111
+            <div class="flex-item">
112
+              <div>
113
+                <el-input
114
+                  placeholder="请输入课时名称"
115
+                  v-model="currentCourseItem.DetailName"
116
+                  clearable>
117
+                </el-input>
118
+              </div>
119
+            </div>
120
+          </li>
121
+          <li class="flex-h">
122
+            <span>课时描述:</span>
123
+            <div class="flex-item">
124
+              <div>
125
+                <el-input
126
+                  type="textarea"
127
+                  placeholder="请输入课时描述"
128
+                  v-model="currentCourseItem.DetailDesc"
129
+                  clearable>
130
+                </el-input>
131
+              </div>
132
+            </div>
133
+          </li>
134
+        </ul>
135
+      </div>
136
+      <span slot="footer" class="dialog-footer">
137
+        <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
138
+        <el-button type="danger" @click="centerDialogVisible = false">取 消</el-button>
139
+      </span>
140
+    </el-dialog>
141
+  </div>
142
+</template>
143
+
144
+<script>
145
+import { mapState } from 'vuex'
146
+
147
+export default {
148
+  name: '',
149
+  data () {
150
+    return {
151
+      currentCourseItem: { // 当前设置课程时间
152
+        BeginDate: null,
153
+        EndDate: null,
154
+        DetailName: null,
155
+        DetailDesc: null,
156
+      },
157
+      centerDialogVisible: false,
158
+      total: 0,
159
+      postData: { // 表格搜索条件
160
+        caseid: '', // 案场id
161
+        page: 1, // 当前页码
162
+        pagesize: 10, // 请求数据量
163
+        typeid: '', // 课程类型
164
+        name: '', // 课程名称
165
+      },
166
+      currentList: [{
167
+        CourseName: 'xxx',
168
+        Price: 'xxx',
169
+        CourseNum: 'xxx',
170
+        ScheduleNum: 'xxx',
171
+        LocationId: 'xxx',
172
+        CaseName: 'xxx',
173
+      }],
174
+      courseTypeList: [],
175
+    }
176
+  },
177
+  mounted () {
178
+    this.$nextTick(function () {
179
+      this.getList()
180
+    })
181
+  },
182
+  computed: {
183
+    ...mapState({
184
+      cases: x => x.app.cases.list,
185
+      defaultCaseId: x => x.app.cases.default
186
+    }),
187
+    CaseId: {
188
+      get () {
189
+        return this.postData.caseid || this.defaultCaseId
190
+      },
191
+      set (val) {
192
+        this.postData.caseid = val
193
+      }
194
+    }
195
+  },
196
+  methods: {
197
+    setCourseDate (item) { // 设置课程时间
198
+      this.centerDialogVisible = true
199
+    },
200
+    search () { // 搜索
201
+      this.postData.page = 1
202
+      this.currentList = []
203
+      this.getList()
204
+    },
205
+    getList () { // 获取列表
206
+    },
207
+    handleCurrentChange (val) { // 跳转到分页
208
+      this.getList()
209
+    },
210
+  }
211
+}
212
+</script>
213
+
214
+<!-- Add "scoped" attribute to limit CSS to this component only -->
215
+<style lang="scss" scoped>
216
+@import "page.scss";
217
+</style>

+ 1
- 1
src/pages/system/courseManager/scheduleManager/index.vue 查看文件

@@ -144,7 +144,7 @@ export default {
144 144
   },
145 145
   methods: {
146 146
     addSchedule () { // 新增排课
147
-
147
+      this.$router.push({name: 'editSchedule', query: {}})
148 148
     },
149 149
     eventClick (event, jsEvent, pos) { // 点击日历
150 150
       console.log(event, jsEvent, pos)

+ 7
- 1
src/pages/system/page.js 查看文件

@@ -65,6 +65,7 @@ import courseList from './courseManager/courseList/index' // 课程列表
65 65
 import addCourse from './courseManager/courseList/add' // 新增课程
66 66
 import courseTag from './courseManager/courseTag/index' // 课程标签
67 67
 import scheduleManager from './courseManager/scheduleManager/index' // 排课管理
68
+import editSchedule from './courseManager/scheduleManager/edit' // 新增、编辑排课
68 69
 
69 70
 import dataStatistics from './dataStatistics/index' // 数据统计
70 71
 import frontEndUserList from './dataStatistics/frontEndUserList/index' // 课程管理
@@ -363,7 +364,12 @@ export default {
363 364
           path: 'scheduleManager',
364 365
           name: 'scheduleManager',
365 366
           component: scheduleManager,
366
-          children: []
367
+          children: [{ // 新增、编辑排课
368
+            path: 'editSchedule',
369
+            name: 'editSchedule',
370
+            component: editSchedule,
371
+            children: []
372
+          }]
367 373
         }, { // 课程标签
368 374
           path: 'courseTag',
369 375
           name: 'courseTag',