wangfei 6 年之前
父節點
當前提交
fdf73e97a8

+ 12
- 3
src/pages/system/cmsManager/majorProjects/edit.vue 查看文件

@@ -126,7 +126,7 @@
126 126
               </template>
127 127
             </el-table-column>
128 128
           </el-table>
129
-            <el-button type="primary" size="mini" @click="addCourse">新增</el-button>
129
+            <el-button type="primary" size="mini" @click="coursesShow">新增</el-button>
130 130
         </li>
131 131
         <li class="flex-h">
132 132
           <span>是否前台展示:</span>
@@ -203,6 +203,7 @@ export default {
203 203
       imgs: null,
204 204
       detailimgs: null,
205 205
       selCourseVisible: false,
206
+      selCourseList: [],
206 207
     }
207 208
   },
208 209
   components: {},
@@ -224,6 +225,7 @@ export default {
224 225
       },
225 226
       set (val) {
226 227
         this.UpdateInfo({...this.detail, CaseId: val})
228
+        this.getCourse()
227 229
       }
228 230
     },
229 231
     imgsArr: {
@@ -324,6 +326,9 @@ export default {
324 326
     getDetail () {
325 327
       this.GetCaseInfo({id: this.id})
326 328
     },
329
+    getCourse () {
330
+      this.GetCourseList({caseid: this.CaseId, page: 1, pagesize: 100})
331
+    },
327 332
     toggleSelection (rows) {
328 333
       if (rows) {
329 334
         rows.forEach(row => {
@@ -344,15 +349,18 @@ export default {
344 349
       this.GetCourseList({caseid: this.CaseId, page: 1, pagesize: 100, callback: this.coursesShow})
345 350
     },
346 351
     coursesShow () {
352
+      this.selCourseList = this.detail.Courses || []
347 353
       this.selCourseVisible = true
348 354
       setTimeout(() => {
349
-        this.toggleSelection(this.coursesList.filter(x => (this.detail.Courses || []).filter(y => y.CourseId === x.CourseId).length > 0))
355
+        this.toggleSelection(this.coursesList.filter(x => (this.selCourseList || []).filter(y => y.CourseId === x.CourseId).length > 0))
350 356
       }, 30)
351 357
     },
352 358
     handleSelectionChange (val) {
353
-      this.UpdateInfo({...this.detail, Courses: val})
359
+      this.selCourseList = val
360
+      // this.UpdateInfo({...this.detail, Courses: val})
354 361
     },
355 362
     addCourseOk () {
363
+      this.UpdateInfo({...this.detail, Courses: this.selCourseList})
356 364
       this.selCourseVisible = false
357 365
     },
358 366
     deleteItem (row) {
@@ -360,6 +368,7 @@ export default {
360 368
     }
361 369
   },
362 370
   mounted () {
371
+    this.getCourse()
363 372
     const { id } = this.$route.query
364 373
     this.id = id
365 374
     if (id && id !== '') {

+ 16
- 1
src/pages/system/goodsManager/goodsTypeManager/add.vue 查看文件

@@ -9,13 +9,27 @@
9 9
               <el-input
10 10
                 placeholder="请输入商品种类"
11 11
                 v-model="postData.TypeName"
12
+                maxlength="10"
12 13
                 clearable>
13 14
               </el-input>
14 15
             </div>
15 16
           </div>
16 17
         </li>
17 18
         <li class="flex-h">
18
-          <!-- <span>选择案场:</span> -->
19
+          <span>种类英文:</span>
20
+          <div class="flex-item">
21
+            <div style="width:50%">
22
+              <el-input
23
+                placeholder="请输入种类英文"
24
+                v-model="postData.EnglishName"
25
+                maxlength="10"
26
+                clearable>
27
+              </el-input>
28
+            </div>
29
+          </div>
30
+        </li>
31
+        <li class="flex-h">
32
+          <span>选择案场:</span>
19 33
           <div class="flex-item">
20 34
             <div style="width:50%">
21 35
               <el-select v-model="CaseId" placeholder="请选择">
@@ -52,6 +66,7 @@ export default {
52 66
         CreatUser: '', // 创建者(传空值)
53 67
         CreatTime: '', // 创建时间(传空值)
54 68
         Status: '', // 状态(传空值)
69
+        EnglishName: '',
55 70
       },
56 71
       caseAreaList: [
57 72
         {

+ 17
- 2
src/pages/system/goodsManager/goodsTypeManager/edit.vue 查看文件

@@ -9,13 +9,27 @@
9 9
               <el-input
10 10
                 placeholder="请输入商品种类"
11 11
                 v-model="postData.TypeName"
12
+                maxlength="10"
12 13
                 clearable>
13 14
               </el-input>
14 15
             </div>
15 16
           </div>
16 17
         </li>
17 18
         <li class="flex-h">
18
-          <!-- <span>选择案场:</span> -->
19
+          <span>种类英文:</span>
20
+          <div class="flex-item">
21
+            <div style="width:50%">
22
+              <el-input
23
+                placeholder="请输入种类英文"
24
+                v-model="postData.EnglishName"
25
+                maxlength="10"
26
+                clearable>
27
+              </el-input>
28
+            </div>
29
+          </div>
30
+        </li>
31
+        <li class="flex-h">
32
+          <span>选择案场:</span>
19 33
           <div class="flex-item">
20 34
             <div style="width:50%">
21 35
               <el-select v-model="CaseId" placeholder="请选择">
@@ -49,7 +63,8 @@ export default {
49 63
         TypeName: '',
50 64
         Status: '',
51 65
         OrgId: '',
52
-        CaseId: ''
66
+        CaseId: '',
67
+        EnglishName: '',
53 68
       },
54 69
     }
55 70
   },

+ 177
- 0
src/pages/system/newOrder/caseRecord/index.vue 查看文件

@@ -0,0 +1,177 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h">
6
+          <el-button size="mini" type="success" @click='addRecord'>新增</el-button>
7
+        </div>
8
+        <ul>
9
+          <li>
10
+            <!-- <span>选择案场:</span> -->
11
+            <el-select v-model="CaseId" placeholder="请选择">
12
+              <el-option
13
+                v-for="item in cases"
14
+                :key="item.CaseId"
15
+                :label="item.CaseName"
16
+                :value="item.CaseId">
17
+              </el-option>
18
+            </el-select>
19
+          </li>
20
+        </ul>
21
+        <el-button
22
+          size="mini"
23
+          type="primary" @click="search">搜索</el-button>
24
+      </div>
25
+      <div class="moreFilter"></div>
26
+    </div>
27
+    <div class="system-table-box">
28
+      <el-table :data="records.list" stripe style="width: 100%">
29
+        <el-table-column prop="CaseId" label="案场">
30
+          <template slot-scope="scope">
31
+            {{getCaseName(scope.row.CaseId)}}
32
+          </template>
33
+        </el-table-column>
34
+        <el-table-column prop="Month" label="月份">
35
+        </el-table-column>
36
+        <el-table-column prop="Num" label="规定次数">
37
+        </el-table-column>
38
+        <el-table-column prop="ActrualNum" label="实际次数">
39
+        </el-table-column>
40
+        <el-table-column prop="OverNum" label="超出次数">
41
+        </el-table-column>
42
+        <el-table-column prop="LeftNum" label="剩余次数">
43
+        </el-table-column>
44
+        <el-table-column fixed='right' label="操作" width="300">
45
+          <template slot-scope="scope">
46
+            <el-button size="mini" type="warning" @click="handleReport(scope.$index, scope.row)">导出Excel</el-button>
47
+          </template>
48
+        </el-table-column>
49
+      </el-table>
50
+      <el-pagination
51
+        @current-change="handleCurrentChange"
52
+        :current-page.sync="postData.page"
53
+        :page-size="postData.pagesize"
54
+        layout="prev, pager, next, jumper"
55
+        :total="records.pagenum">
56
+      </el-pagination>
57
+    </div>
58
+    <el-dialog
59
+      title="新增月记录"
60
+      :visible.sync="addVisible"
61
+      width="500px"
62
+      center>
63
+      <div>
64
+        <form class="mainForm">
65
+          <ul>
66
+            <li class="flex-h">
67
+              <span>对应案场:</span>
68
+              <div class="flex-item">
69
+                <div style="width:50%">
70
+                  <el-select v-model="detail.CaseId" placeholder="请选择">
71
+                    <el-option
72
+                      v-for="item in cases"
73
+                      :key="item.CaseId"
74
+                      :label="item.CaseName"
75
+                      :value="item.CaseId">
76
+                    </el-option>
77
+                  </el-select>
78
+                </div>
79
+              </div>
80
+            </li>
81
+            <li class="flex-h">
82
+              <span>月份:</span>
83
+              <div class="flex-item">
84
+                <div style="width:50%">
85
+                  <el-date-picker
86
+                    v-model="detail.Month"
87
+                    type="month"
88
+                    placeholder="选择月">
89
+                  </el-date-picker>
90
+                </div>
91
+              </div>
92
+            </li>
93
+            <li class="flex-h">
94
+              <span>规定次数:</span>
95
+              <div class="flex-item">
96
+                <div style="width:50%">
97
+                  <el-input v-model="detail.Num" placeholder="请输入规定次数"></el-input>
98
+                </div>
99
+              </div>
100
+            </li>
101
+          </ul>
102
+        </form>
103
+      </div>
104
+      <span slot="footer" class="dialog-footer">
105
+        <el-button @click="addVisible = false">取 消</el-button>
106
+        <el-button type="primary" @click="submit">保 存</el-button>
107
+      </span>
108
+    </el-dialog>
109
+  </div>
110
+</template>
111
+
112
+<script>
113
+import { createNamespacedHelpers, mapState } from 'vuex'
114
+
115
+const { mapState: mapRecordState, mapActions: mapRecordActions } = createNamespacedHelpers('caserecord')
116
+
117
+export default {
118
+  name: '',
119
+  data () {
120
+    return {
121
+      addVisible: false,
122
+      detail: {
123
+        CaseId: '',
124
+      },
125
+      postData: {
126
+        caseid: '',
127
+        page: 1,
128
+        pagesize: 10,
129
+      }
130
+    }
131
+  },
132
+  computed: {
133
+    ...mapState({
134
+      cases: x => x.app.cases.list,
135
+      defaultCaseId: x => x.app.cases.default
136
+    }),
137
+    ...mapRecordState({
138
+      records: x => x.recordList,
139
+    }),
140
+    CaseId: {
141
+      get () {
142
+        return this.caseid || this.defaultCaseId
143
+      },
144
+      set (val) {
145
+        this.caseid = val
146
+      }
147
+    }
148
+  },
149
+  methods: {
150
+    ...mapRecordActions([
151
+      'GetRecordList',
152
+    ]),
153
+    getCaseName (caseid) {
154
+      return ((this.cases.filter(x => x.CaseId === caseid) || [])[0] || {}).CaseName
155
+    },
156
+    addRecord () {
157
+      this.addVisible = true
158
+    },
159
+    search () {
160
+      this.getList()
161
+    },
162
+    submit () {
163
+    },
164
+    getList () {
165
+      this.GetRecordList(this.postData)
166
+    },
167
+    handleCurrentChange (val) { // 跳转到分页
168
+      this.postData.page = val
169
+      this.getList()
170
+    },
171
+  }
172
+}
173
+</script>
174
+
175
+<!-- Add "scoped" attribute to limit CSS to this component only -->
176
+<style lang="scss" scoped>
177
+</style>

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

@@ -89,6 +89,8 @@ import vipList from './cardAndCouponManager/vipManager/index' // vip列表
89 89
 import editVip from './cardAndCouponManager/vipManager/edit' // 编辑vip
90 90
 import activateVip from './cardAndCouponManager/vipManager/activateVip' // 激活vip
91 91
 
92
+import caseRecord from './newOrder/caseRecord/index' // 月记录
93
+
92 94
 export default {
93 95
   router: [
94 96
     {
@@ -429,6 +431,11 @@ export default {
429 431
           name: 'newOrderList',
430 432
           component: newOrderList,
431 433
           children: []
434
+        }, { // 月记录
435
+          path: 'caseRecord',
436
+          name: 'caseRecord',
437
+          component: caseRecord,
438
+          children: []
432 439
         }]
433 440
       }, { // 数据统计
434 441
         path: 'dataStatistics',

+ 29
- 0
src/store/case/record.js 查看文件

@@ -0,0 +1,29 @@
1
+import ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    recordList: [],
8
+  },
9
+  mutations: {
10
+    updateList (state, payload) {
11
+      state.recordList = payload || []
12
+    },
13
+  },
14
+  actions: {
15
+    GetRecordList ({ commit }, payload) {
16
+      ajax(api.case.getRecordList.url, {
17
+        method: api.case.getRecordList.method,
18
+        queryData: {
19
+          ...payload,
20
+        }
21
+      }).then(res => {
22
+        commit('updateList', res)
23
+        if (payload.callback) {
24
+          payload.callback()
25
+        }
26
+      })
27
+    },
28
+  }
29
+}

+ 1
- 0
src/store/index.js 查看文件

@@ -24,6 +24,7 @@ export const modules = {
24 24
   verification: () => require('./verification/verification').default,
25 25
   goodsorder: () => require('./goods/order').default,
26 26
   cmscase: () => require('./cms/case').default,
27
+  caserecord: () => require('./case/record').default,
27 28
 }
28 29
 
29 30
 Object.keys(modules).forEach((modKey) => {

+ 8
- 0
src/util/api.js 查看文件

@@ -196,6 +196,14 @@ const $api = {
196 196
       method: 'get',
197 197
       url: `${baseUrl}${common}/usertype`
198 198
     },
199
+    getRecordList: {
200
+      method: 'get',
201
+      url: `${baseUrl}${common}/case/record`
202
+    },
203
+    addRecord: {
204
+      method: 'post',
205
+      url: `${baseUrl}${common}/case/record`
206
+    },
199 207
   },
200 208
   goodsManager: {
201 209
     getGoodsSpecList: { // 商品规格列表