wangfei 6 years ago
parent
commit
fdf73e97a8

+ 12
- 3
src/pages/system/cmsManager/majorProjects/edit.vue View File

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

+ 16
- 1
src/pages/system/goodsManager/goodsTypeManager/add.vue View File

9
               <el-input
9
               <el-input
10
                 placeholder="请输入商品种类"
10
                 placeholder="请输入商品种类"
11
                 v-model="postData.TypeName"
11
                 v-model="postData.TypeName"
12
+                maxlength="10"
12
                 clearable>
13
                 clearable>
13
               </el-input>
14
               </el-input>
14
             </div>
15
             </div>
15
           </div>
16
           </div>
16
         </li>
17
         </li>
17
         <li class="flex-h">
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
           <div class="flex-item">
33
           <div class="flex-item">
20
             <div style="width:50%">
34
             <div style="width:50%">
21
               <el-select v-model="CaseId" placeholder="请选择">
35
               <el-select v-model="CaseId" placeholder="请选择">
52
         CreatUser: '', // 创建者(传空值)
66
         CreatUser: '', // 创建者(传空值)
53
         CreatTime: '', // 创建时间(传空值)
67
         CreatTime: '', // 创建时间(传空值)
54
         Status: '', // 状态(传空值)
68
         Status: '', // 状态(传空值)
69
+        EnglishName: '',
55
       },
70
       },
56
       caseAreaList: [
71
       caseAreaList: [
57
         {
72
         {

+ 17
- 2
src/pages/system/goodsManager/goodsTypeManager/edit.vue View File

9
               <el-input
9
               <el-input
10
                 placeholder="请输入商品种类"
10
                 placeholder="请输入商品种类"
11
                 v-model="postData.TypeName"
11
                 v-model="postData.TypeName"
12
+                maxlength="10"
12
                 clearable>
13
                 clearable>
13
               </el-input>
14
               </el-input>
14
             </div>
15
             </div>
15
           </div>
16
           </div>
16
         </li>
17
         </li>
17
         <li class="flex-h">
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
           <div class="flex-item">
33
           <div class="flex-item">
20
             <div style="width:50%">
34
             <div style="width:50%">
21
               <el-select v-model="CaseId" placeholder="请选择">
35
               <el-select v-model="CaseId" placeholder="请选择">
49
         TypeName: '',
63
         TypeName: '',
50
         Status: '',
64
         Status: '',
51
         OrgId: '',
65
         OrgId: '',
52
-        CaseId: ''
66
+        CaseId: '',
67
+        EnglishName: '',
53
       },
68
       },
54
     }
69
     }
55
   },
70
   },

+ 177
- 0
src/pages/system/newOrder/caseRecord/index.vue View File

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 View File

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

+ 29
- 0
src/store/case/record.js View File

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 View File

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

+ 8
- 0
src/util/api.js View File

196
       method: 'get',
196
       method: 'get',
197
       url: `${baseUrl}${common}/usertype`
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
   goodsManager: {
208
   goodsManager: {
201
     getGoodsSpecList: { // 商品规格列表
209
     getGoodsSpecList: { // 商品规格列表