Pārlūkot izejas kodu

dailyRegistration

张延森 5 gadus atpakaļ
vecāks
revīzija
d89fb727ee

+ 2
- 0
list.vue Parādīt failu

@@ -102,6 +102,8 @@ export default {
102 102
       'getVisitor'
103 103
     ]),
104 104
     onSubmit() {
105
+      this.formInline.pageNum = 1
106
+      this.formInline.pageSize = 10
105 107
       this.getPage()
106 108
     },
107 109
     getPage() {

+ 11
- 0
src/config/api.js Parādīt failu

@@ -322,6 +322,17 @@ const apis = {
322 322
       url: `${commPrefix}/mainUsherRecord`
323 323
     }
324 324
   },
325
+  dailyRegistration: {
326
+    list: {
327
+      method: 'get',
328
+      url: `${commPrefix}/usherRecords`
329
+    },
330
+    excel: {
331
+      method: 'get',
332
+      url: `${commPrefix}/excel/usherListExcel`
333
+    },
334
+    
335
+  },
325 336
   followupRecord:{
326 337
     list:{
327 338
       method:'get',

+ 2
- 0
src/store/index.js Parādīt failu

@@ -17,6 +17,7 @@ import management from './modules/management'
17 17
 import visitor from './modules/visitor' 
18 18
 import lobby from './modules/lobby'
19 19
 import followup from './modules/followup'
20
+import dailyRegistration from './modules/dailyRegistration'
20 21
 import sysyrole from './modules/role'
21 22
 import goods from './modules/goods'
22 23
 import sysmenu from './modules/sysmenu'
@@ -42,6 +43,7 @@ const store = new Vuex.Store({
42 43
     visitor,
43 44
     lobby,
44 45
     followup,
46
+    dailyRegistration,
45 47
     sysyrole,
46 48
     goods,
47 49
     sysmenu,

+ 33
- 0
src/store/modules/dailyRegistration.js Parādīt failu

@@ -0,0 +1,33 @@
1
+import lodash from 'lodash'
2
+import { interact } from '../../utils'
3
+import apis from '../../config/api'
4
+
5
+export default {
6
+  namespaced: true,
7
+  state: {
8
+    dailyList : {},
9
+    excelList : {},
10
+  },
11
+  mutations: {
12
+    updateDailyList(state, payload) {
13
+      state.dailyList  = payload || {}
14
+    },
15
+    updateUsherListExcel(state, payload) {
16
+      state.excelList  = payload || {}
17
+    },
18
+  },
19
+  actions: {
20
+    getDailyRegistration({ commit }, payload) { // 查询所有
21
+      const api = lodash.get(apis, 'dailyRegistration.list')
22
+      interact(api, payload).then((data) => {
23
+        commit('updateDailyList', data)
24
+      })
25
+    },
26
+    getUsherListExcel({ commit }, payload) { // 导出
27
+      const api = lodash.get(apis, 'dailyRegistration.excel')
28
+      interact(api, payload).then((data) => {
29
+        commit('updateUsherListExcel', data)
30
+      })
31
+    },
32
+  }
33
+}

+ 2
- 0
src/views/carManagement/management.vue Parādīt failu

@@ -119,6 +119,8 @@ export default {
119 119
       "deleteManagement"
120 120
     ]),
121 121
     onSubmit() {
122
+      this.formInline.pageNum = 1
123
+      this.formInline.pageSize = 10
122 124
       this.getPage();
123 125
     },
124 126
     joinWhite(row) {

+ 2
- 0
src/views/cart/list.vue Parādīt failu

@@ -104,6 +104,8 @@ export default {
104 104
       'getCartRecord'
105 105
     ]),
106 106
     onSubmit() {
107
+      this.formInline.pageNum = 1
108
+      this.formInline.pageSize = 10
107 109
       this.getPage()
108 110
     },
109 111
     getPage() {

+ 219
- 0
src/views/dailyRegistration/index.vue Parādīt failu

@@ -0,0 +1,219 @@
1
+<template>
2
+  <div id="daily" class="daily">
3
+    <el-form :inline="true" :model="formInline" class="demo-form-inline">
4
+      <el-form-item label="到访日期">
5
+        <el-date-picker
6
+          v-model="formInline.startTime"
7
+          type="date"
8
+          value-format="yyyy-MM-dd"
9
+          placeholder="">
10
+        </el-date-picker>
11
+      </el-form-item>
12
+      <el-form-item label="~">
13
+        <el-date-picker
14
+          v-model="formInline.endTime"
15
+          type="date"
16
+          value-format="yyyy-MM-dd"
17
+          placeholder="">
18
+        </el-date-picker>
19
+      </el-form-item>
20
+      <el-form-item label="客户类型">
21
+        <el-select v-model="formInline.customerType" clearable placeholder="请选择">
22
+          <el-option label="渠道客户" value="channel" />
23
+          <el-option label="自销客户" value="self"/>
24
+        </el-select>
25
+       </el-form-item> 
26
+      <el-form-item label="客户来源">
27
+        <el-select v-model="formInline.customerSource " clearable placeholder="请选择">
28
+          <el-option label="自然" value="109" />
29
+          <el-option label="自拓" value="110"/>
30
+          <el-option label="自渠" value="111"/>
31
+          <el-option label="老客" value="112"/>
32
+        </el-select>
33
+       </el-form-item> 
34
+      <el-form-item label="姓名">
35
+        <el-input v-model="formInline.personName" placeholder="输入姓名"></el-input>
36
+      </el-form-item>
37
+      <el-form-item label="手机号">
38
+        <el-input v-model="formInline.phone" placeholder="输入手机号"></el-input>
39
+      </el-form-item>   
40
+      <el-form-item label="接待人">
41
+        <el-input v-model="formInline.receiver" placeholder="输入接待人"></el-input>
42
+      </el-form-item>
43
+      </el-form-item>   
44
+        <el-button type="primary" @click="onSubmit">查询</el-button> 
45
+        <el-button type="info" @click="clear">重置</el-button>
46
+      </el-form-item>
47
+    </el-form>
48
+    <div style="height:70px;line-height:70px">
49
+      <a href="excel/usherListExcel">导出</a>
50
+        <el-button type="primary" @click="outPut" style="float:right"></el-button> 
51
+    </div>
52
+    <el-table
53
+    :data="dailyList.records"
54
+    border>
55
+    <el-table-column
56
+      prop="customerType"
57
+      label="客户类型"
58
+      align='center'>
59
+          <template slot-scope="scope">
60
+             <!-- <span>{{ scope.row.customerType =='channel'? '渠道客户':'自销客户' }}</span> -->
61
+          </template>
62
+    </el-table-column>
63
+    <el-table-column
64
+      prop="personName"
65
+      label="姓名"
66
+      align='center'>
67
+    </el-table-column>
68
+    <el-table-column
69
+      prop="phone"
70
+      label="手机号"
71
+      align='center'>
72
+    </el-table-column>
73
+    <el-table-column
74
+      prop="personNum"
75
+      label="来访人数"
76
+      align='center'>
77
+    </el-table-column>
78
+    <el-table-column
79
+    align='center'
80
+      prop="visiteDate"
81
+      label="到访时间"
82
+      width="160%">
83
+       <template slot-scope="scope">
84
+        <span>{{FormatDate(scope.row.visiteDate)}}</span>
85
+      </template>
86
+    </el-table-column>
87
+    <el-table-column
88
+      prop="customerSource"
89
+      label="客户来源"
90
+      align='center'>
91
+          <template slot-scope="scope">
92
+             <span>{{ scope.row.customerSource |filterCustomerSource }}</span>
93
+          </template>
94
+    </el-table-column>
95
+    <el-table-column
96
+      prop="plateNumber"
97
+      align='center'
98
+      label="车牌">
99
+    </el-table-column>
100
+    <el-table-column
101
+      prop="receiver"
102
+      align='center'
103
+      label="接待人">
104
+    </el-table-column>
105
+    <el-table-column
106
+      prop="appointmentName"
107
+      align='center'
108
+      label="预约人">
109
+    </el-table-column>
110
+  </el-table>
111
+    <el-pagination
112
+            style="margin-top:50px;float:right"
113
+            @size-change="handleSizeChange"
114
+            @current-change="handleCurrentChange"
115
+            :current-page="formInline.pageNum"
116
+            :page-sizes="[1,10, 20, 30, 40]"
117
+            :page-size="formInline.pageSize"
118
+            layout="total, sizes, prev, pager, next, jumper"
119
+            :total="dailyList.total || 0">
120
+    </el-pagination>
121
+  </div>
122
+</template>
123
+
124
+<script>
125
+import { createNamespacedHelpers } from 'vuex'
126
+const {mapState: mapDailyRegistrationState, mapActions: mapDailyRegistrationActions } = createNamespacedHelpers('dailyRegistration')
127
+
128
+export default {
129
+  name: 'visitor-index',
130
+  data() {
131
+    return {
132
+      formInline: {
133
+        startTime :'',
134
+        endTime :'',
135
+        personName: '',
136
+        phone: '',
137
+        customerType: '',
138
+        customerSource : '',
139
+        receiver : '',
140
+        pageNum: 1,
141
+        pageSize: 10
142
+      }
143
+    }
144
+  },
145
+  computed: {
146
+    ...mapDailyRegistrationState({
147
+    dailyList: x => x.dailyList,
148
+    excelList: x => x.excelList
149
+    })
150
+  },
151
+  created() {
152
+    this.getPage()
153
+  },
154
+  filters:{
155
+    filterCustomerSource(val){
156
+      if(val=='109'){
157
+        return  '自然'
158
+      }
159
+      else if(val=='110'){
160
+        return  '自拓'
161
+      }
162
+      else if(val=='111'){
163
+        return  '自渠'
164
+      }
165
+      else if(val=='112'){
166
+        return  '老客'
167
+      }else{
168
+        return
169
+      }
170
+    }
171
+  },
172
+  methods: {
173
+    ...mapDailyRegistrationActions([
174
+      'getDailyRegistration',
175
+      'getUsherListExcel'
176
+    ]),
177
+    onSubmit() {
178
+      this.formInline.pageNum = 1
179
+      this.formInline.pageSize = 10
180
+      this.getPage()
181
+    },
182
+    outPut(){
183
+      this.getUsherListExcel(this.formInline)
184
+    },
185
+    getPage() {
186
+      this.getDailyRegistration(this.formInline)
187
+   
188
+    },
189
+    handleSizeChange(val) {
190
+      // console.log(`每页 ${val} 条`)
191
+      this.formInline.pageSize = val
192
+      this.getPage()
193
+    },
194
+    handleCurrentChange(val) {
195
+      // console.log(`当前页: ${val}`)
196
+      this.formInline.pageNum = val
197
+      this.getPage()
198
+    },
199
+    FormatDate (date) {
200
+      if (date) {
201
+        return date.split('T')[0] === '0001-01-01' ? '' : date.split('T')[0] + '  ' + date.split('T')[1]
202
+      } else {
203
+        return ''
204
+      }
205
+    },
206
+    clear(){
207
+      this.formInline.personName = ''
208
+      this.formInline.phone = ''
209
+      this.formInline.platNumber = ''
210
+      this.formInline.appointment = ''
211
+      this.formInline.pageNum = 1
212
+      this.formInline.pageSize = 10
213
+      this.getPage()
214
+    }
215
+  }
216
+}
217
+</script>
218
+
219
+

+ 2
- 0
src/views/followup/list.vue Parādīt failu

@@ -227,6 +227,8 @@ export default {
227 227
       'getSysUserList'
228 228
     ]),
229 229
     onSubmit() {
230
+      this.formInline.pageNum = 1
231
+      this.formInline.pageSize = 10
230 232
       this.getPage()
231 233
     },
232 234
     getUserList () {

+ 11
- 0
src/views/index.js Parādīt failu

@@ -273,6 +273,7 @@ const pages = [
273 273
           title: '预约信息',
274 274
         },
275 275
       },
276
+    
276 277
       {
277 278
         path: 'car',
278 279
         name: 'carlist',
@@ -321,6 +322,16 @@ const pages = [
321 322
           title: '客户列表',
322 323
         },
323 324
       },  
325
+      {
326
+        path: 'dailyRegistration',
327
+        name: 'dailyRegistration',
328
+        component: () => import('./dailyRegistration/index.vue'),
329
+        meta: {
330
+          menuShow: true,
331
+          title: '每日登记报表',
332
+        },
333
+      }, 
334
+     
324 335
     ],
325 336
   },
326 337
   {

+ 2
- 0
src/views/lobby/list.vue Parādīt failu

@@ -149,6 +149,8 @@ export default {
149 149
       'getLobby'
150 150
     ]),
151 151
     onSubmit() {
152
+      this.formInline.pageNum = 1
153
+      this.formInline.pageSize = 10
152 154
       this.getPage()
153 155
     },
154 156
     getPage() {

+ 2
- 0
src/views/security/list.vue Parādīt failu

@@ -124,6 +124,8 @@ export default {
124 124
       'getSecurity'
125 125
     ]),
126 126
     onSubmit() {
127
+      this.formInline.pageNum = 1
128
+      this.formInline.pageSize = 10
127 129
       this.getPage()
128 130
     },
129 131
     getPage() {

+ 2
- 0
src/views/sysuser/role/list.vue Parādīt failu

@@ -86,6 +86,8 @@ export default {
86 86
       return dayjs(dt).format('YYYY-MM-DD HH:mm')
87 87
     },
88 88
     onSubmit() {
89
+      this.formInline.pageNum = 1
90
+      this.formInline.pageSize = 10
89 91
       this.getPage()
90 92
     },
91 93
     getPage() {

+ 2
- 0
src/views/sysuser/userRole/list.vue Parādīt failu

@@ -91,6 +91,8 @@ export default {
91 91
       'deleteRole'
92 92
     ]),
93 93
     onSubmit() {
94
+      this.formInline.pageNum = 1
95
+      this.formInline.pageSize = 10
94 96
       this.getPage()
95 97
     },
96 98
     getPage() {

+ 2
- 0
src/views/visitor/list.vue Parādīt failu

@@ -112,6 +112,8 @@ export default {
112 112
       'getVisitor'
113 113
     ]),
114 114
     onSubmit() {
115
+      this.formInline.pageNum = 1
116
+      this.formInline.pageSize = 10
115 117
       this.getPage()
116 118
     },
117 119
     getPage() {

+ 2
- 1
vue.config.js Parādīt failu

@@ -3,7 +3,8 @@ module.exports = {
3 3
   devServer: {
4 4
     proxy: {
5 5
       '/api': {
6
-        target: 'http://127.0.0.1:8080',
6
+        target: 'http://192.168.0.238:8080',
7
+        // target: 'http://127.0.0.1:8080',
7 8
         changeOrigin: true,
8 9
         pathRewrite: {
9 10
           '^/api': '/'