Bläddra i källkod

Merge branch 'v4' of http://git.ycjcjy.com/welcome/pc-welcome3 into v4

张延森 6 år sedan
förälder
incheckning
bb01a8975f

+ 134
- 0
list.vue Visa fil

@@ -0,0 +1,134 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form :inline="true" :model="formInline" class="demo-form-inline">
4
+      <el-form-item label="预约人姓名">
5
+        <el-input v-model="formInline.personName" placeholder="预约人姓名"></el-input>
6
+      </el-form-item>
7
+      <el-form-item label="预约人电话">
8
+        <el-input v-model="formInline.phone" placeholder="预约人电话"></el-input>
9
+      </el-form-item>   
10
+      <el-form-item label="车牌号">
11
+        <el-input v-model="formInline.platNumber" placeholder="车牌号"></el-input>
12
+      </el-form-item>
13
+      <el-form-item>
14
+        <el-button type="primary" @click="onSubmit">查询</el-button>
15
+      </el-form-item>
16
+    </el-form>
17
+    <el-table
18
+     :data="visitorList.records"
19
+    border>
20
+    <el-table-column
21
+      prop="personName"
22
+      label="预约人姓名"
23
+      width="180">
24
+    </el-table-column>
25
+    <el-table-column
26
+      prop="phone"
27
+      label="预约人电话">
28
+    </el-table-column>
29
+    <el-table-column
30
+      prop="visitDate"
31
+      label="到访时间">
32
+       <template slot-scope="scope">
33
+        <span>{{FormatDate(scope.row.visitDate)}}</span>
34
+      </template>
35
+    </el-table-column>
36
+
37
+    <el-table-column
38
+      prop="personNum"
39
+      label="来访人数">
40
+    </el-table-column>
41
+    <el-table-column
42
+      prop="carNum"
43
+      label="车辆数目">
44
+    </el-table-column>
45
+    <el-table-column
46
+      prop="platNumber"
47
+      label="车牌号">
48
+    </el-table-column>
49
+    <el-table-column
50
+      prop="createDate"
51
+      value-format="yyyy-MM-dd"
52
+      label="创建时间">
53
+      <template slot-scope="scope">
54
+        <span>{{FormatDate(scope.row.createDate)}}</span>
55
+      </template>
56
+    </el-table-column>
57
+    <el-table-column
58
+      prop="remark"
59
+      label="备注">
60
+    </el-table-column>
61
+  </el-table>
62
+    <el-pagination
63
+            style="margin-top:50px;float:right"
64
+            @size-change="handleSizeChange"
65
+            @current-change="handleCurrentChange"
66
+            :current-page="formInline.pageNum"
67
+            :page-sizes="[1,10, 20, 30, 40]"
68
+            :page-size="formInline.pageSize"
69
+            layout="total, sizes, prev, pager, next, jumper"
70
+            :total="visitorList.total || 0">
71
+    </el-pagination>
72
+  </div>
73
+</template>
74
+
75
+<script>
76
+import { createNamespacedHelpers } from 'vuex'
77
+const {mapState: mapVisitorState, mapActions: mapVisitorActions } = createNamespacedHelpers('visitor')
78
+
79
+export default {
80
+  name: 'visitor-index',
81
+  data() {
82
+    return {
83
+      formInline: {
84
+        personName: '',
85
+        phone: '',
86
+        platNumber: '',
87
+        pageNum: 1,
88
+        pageSize: 10
89
+      }
90
+    }
91
+  },
92
+  computed: {
93
+    ...mapVisitorState({
94
+     visitorList: x => x.safety
95
+    })
96
+  },
97
+  created() {
98
+    this.getPage()
99
+  },
100
+  methods: {
101
+    ...mapVisitorActions([
102
+      'getVisitor'
103
+    ]),
104
+    onSubmit() {
105
+      this.getPage()
106
+    },
107
+    getPage() {
108
+      this.getVisitor(this.formInline)
109
+      // window.console.log(this.$store)
110
+      // this.$store.commit('security/foo')
111
+      // this.$store.dispatch('security/getSecurity')
112
+      // this.$store.commit('security/foo')
113
+    },
114
+    handleSizeChange(val) {
115
+      // console.log(`每页 ${val} 条`)
116
+      this.formInline.pageSize = val
117
+      this.getPage()
118
+    },
119
+    handleCurrentChange(val) {
120
+      // console.log(`当前页: ${val}`)
121
+      this.formInline.pageNum = val
122
+      this.getPage()
123
+    },
124
+    FormatDate (date) {
125
+      if (date) {
126
+        return date.split('T')[0] === '0001-01-01' ? '' : date.split('T')[0] + '  ' + date.split('T')[1]
127
+      } else {
128
+        return ''
129
+      }
130
+    },
131
+  }
132
+}
133
+</script>
134
+

+ 30
- 1
src/config/api.js Visa fil

@@ -244,7 +244,36 @@ const apis = {
244 244
       method: 'get',
245 245
       url: `${commPrefix}/sysparam/:id`
246 246
     }
247
+  },
248
+  cart: {
249
+    list: {
250
+      method: 'get',
251
+      url: `${commPrefix}/carRecord`
252
+    }
253
+  },
254
+  security: {
255
+    list: {
256
+      method: 'get',
257
+      url: `${commPrefix}/firstUsherRecord`
258
+    }
259
+  },
260
+  visitor: {
261
+    list: {
262
+      method: 'get',
263
+      url: `${commPrefix}/visitorAppointmentList`
264
+    }
265
+  },
266
+  lobby: {
267
+    list: {
268
+      method: 'get',
269
+      url: `${commPrefix}/mainUsherRecord`
270
+    }
271
+  },
272
+  followupRecord:{
273
+    list:{
274
+      method:'get',
275
+      url: `${commPrefix}/customerList`
276
+    }
247 277
   }
248 278
 }
249
-
250 279
 export default apis

+ 10
- 0
src/store/index.js Visa fil

@@ -11,6 +11,11 @@ import person from './modules/person'
11 11
 import sysparam from './modules/sysparam'
12 12
 import sysuser from './modules/sysuser'
13 13
 import stats from './modules/stats'
14
+import cart from './modules/cart'
15
+import security from './modules/security'
16
+import visitor from './modules/visitor' 
17
+import lobby from './modules/lobby'
18
+import followup from './modules/followup'
14 19
 
15 20
 Vue.use(Vuex)
16 21
 
@@ -27,6 +32,11 @@ const store = new Vuex.Store({
27 32
     sysparam,
28 33
     sysuser,
29 34
     stats,
35
+    cart,
36
+    security,
37
+    visitor,
38
+    lobby,
39
+    followup
30 40
   }
31 41
 })
32 42
 

+ 23
- 0
src/store/modules/cart.js Visa fil

@@ -0,0 +1,23 @@
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
+    carRecord: {}
9
+  },
10
+  mutations: {
11
+    carRecord(state, payload) {
12
+      state.carRecord = payload || {}
13
+    }
14
+  },
15
+  actions: {
16
+    getCartRecord({ commit }, payload) { // 查询所有
17
+      const api = lodash.get(apis, 'cart.list')
18
+      interact(api, payload).then((data) => {
19
+        commit('carRecord', data)
20
+      })
21
+    }
22
+  }
23
+}

+ 25
- 0
src/store/modules/followup.js Visa fil

@@ -0,0 +1,25 @@
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
+    followup : {},
9
+    sex:""
10
+  },
11
+  mutations: {
12
+    updateFollowup(state, payload) {
13
+      state.followup  = payload || {}
14
+    }
15
+  },
16
+  actions: {
17
+    getFollowup({ commit }, payload) { // 查询所有
18
+      const api = lodash.get(apis, 'followupRecord.list')
19
+      // const api = lodash.get(apis, 'customerList.list')
20
+      interact(api, payload).then((data) => {
21
+        commit('updateFollowup', data)
22
+      })
23
+    }
24
+  }
25
+}

+ 23
- 0
src/store/modules/lobby.js Visa fil

@@ -0,0 +1,23 @@
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
+    safety : {}
9
+  },
10
+  mutations: {
11
+    updateSafety(state, payload) {
12
+      state.safety  = payload || {}
13
+    }
14
+  },
15
+  actions: {
16
+    getLobby({ commit }, payload) { // 查询所有
17
+      const api = lodash.get(apis, 'lobby.list')
18
+      interact(api, payload).then((data) => {
19
+        commit('updateSafety', data)
20
+      })
21
+    }
22
+  }
23
+}

+ 23
- 0
src/store/modules/security.js Visa fil

@@ -0,0 +1,23 @@
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
+    safety : {}
9
+  },
10
+  mutations: {
11
+    updateSafety(state, payload) {
12
+      state.safety  = payload || {}
13
+    }
14
+  },
15
+  actions: {
16
+    getSecurity({ commit }, payload) { // 查询所有
17
+      const api = lodash.get(apis, 'security.list')
18
+      interact(api, payload).then((data) => {
19
+        commit('updateSafety', data)
20
+      })
21
+    }
22
+  }
23
+}

+ 23
- 0
src/store/modules/visitor.js Visa fil

@@ -0,0 +1,23 @@
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
+    safety : {}
9
+  },
10
+  mutations: {
11
+    updateSafety(state, payload) {
12
+      state.safety  = payload || {}
13
+    }
14
+  },
15
+  actions: {
16
+    getVisitor({ commit }, payload) { // 查询所有
17
+      const api = lodash.get(apis, 'visitor.list')
18
+      interact(api, payload).then((data) => {
19
+        commit('updateSafety', data)
20
+      })
21
+    }
22
+  }
23
+}

+ 135
- 0
src/views/cart/list.vue Visa fil

@@ -0,0 +1,135 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form :inline="true" :model="formInline" class="demo-form-inline">
4
+      <el-form-item label="车牌">
5
+        <el-input v-model="formInline.plateNumber" placeholder="车牌"></el-input>
6
+      </el-form-item>
7
+      <!-- <el-form-item label="客户姓名">
8
+        <el-input v-model="formInline.customerName" placeholder="客户姓名"></el-input>
9
+      </el-form-item> -->
10
+      <!-- <el-form-item label="手机">
11
+        <el-input v-model="formInline.phone" placeholder="手机"></el-input>
12
+      </el-form-item> -->
13
+      <el-form-item label="来访时间">
14
+        <el-date-picker
15
+                v-model="formInline.recordDate"
16
+                type="date"
17
+                value-format="yyyy-MM-dd"
18
+                placeholder="来访时间">
19
+        </el-date-picker>
20
+      </el-form-item>
21
+      <el-form-item>
22
+        <el-button type="primary" @click="onSubmit">查询</el-button>
23
+      </el-form-item>
24
+    </el-form>
25
+    <el-table
26
+            :data="cartList.records"
27
+            border
28
+            style="width: 100%">
29
+      <el-table-column
30
+              prop="serialNo"
31
+              label="序号"
32
+              align='center'
33
+              width="180"/>
34
+      <el-table-column
35
+              prop="plateNumber"
36
+              align='center'
37
+              label="车牌"/>
38
+      <el-table-column
39
+              prop="driverImage"
40
+              align='center'
41
+              label="驾驶员照片">
42
+        <template slot-scope="scope">
43
+          <el-image
44
+                  style="width: 100px; height: 100px"
45
+                  :src="scope.row.driverImage"
46
+                  fit="fill"></el-image>
47
+        </template>
48
+      </el-table-column>
49
+      <!-- <el-table-column
50
+              prop="customerName"
51
+              label="客户姓名"/>
52
+      <el-table-column
53
+              prop="phone"
54
+              label="手机号"/> -->
55
+      <el-table-column
56
+              prop="createDate"
57
+              align='center'
58
+              label="来访时间">
59
+              <template slot-scope="scope">
60
+                <span> {{ FormatDate(scope.row.createDate) }} </span>
61
+              </template>
62
+      </el-table-column>
63
+    </el-table>
64
+    <el-pagination
65
+            style="margin-top:50px;float:right"
66
+            @size-change="handleSizeChange"
67
+            @current-change="handleCurrentChange"
68
+            :current-page="formInline.pageNum"
69
+            :page-sizes="[1,10, 20, 30, 40]"
70
+            :page-size="formInline.pageSize"
71
+            layout="total, sizes, prev, pager, next, jumper"
72
+            :total="cartList.total || 0">
73
+    </el-pagination>
74
+  </div>
75
+</template>
76
+
77
+<script>
78
+import { createNamespacedHelpers } from 'vuex'
79
+const {mapState: mapCartState, mapActions: mapCartActions} = createNamespacedHelpers('cart')
80
+
81
+export default {
82
+  name: 'cart-index',
83
+  data() {
84
+    return {
85
+      formInline: {
86
+        plateNumber: '',
87
+        recordDate: '',
88
+        customerName: '',
89
+        phone: '',
90
+        pageNum: 1,
91
+        pageSize: 10,
92
+        listLoading: true
93
+      }
94
+    }
95
+   
96
+  },
97
+  computed: {
98
+    ...mapCartState({
99
+      cartList: x => x.carRecord
100
+    })
101
+  },
102
+  created() {
103
+    this.getPage()
104
+  },
105
+  methods: {
106
+    ...mapCartActions([
107
+      'getCartRecord'
108
+    ]),
109
+    onSubmit() {
110
+      this.getPage()
111
+    },
112
+    getPage() {
113
+      this.getCartRecord(this.formInline)
114
+    },
115
+    handleSizeChange(val) {
116
+      // console.log(`每页 ${val} 条`)
117
+      this.formInline.pageSize = val
118
+      this.getPage()
119
+    },
120
+    handleCurrentChange(val) {
121
+      // console.log(`当前页: ${val}`)
122
+      this.formInline.pageNum = val
123
+      this.getPage()
124
+    },
125
+    FormatDate (date) {
126
+      if (date) {
127
+        return date.split('T')[0] === '0001-01-01' ? '' : date.split('T')[0] + '  ' + date.split('T')[1]
128
+      } else {
129
+        return ''
130
+      }
131
+    },
132
+  }
133
+}
134
+</script>
135
+

+ 218
- 0
src/views/followup/list.vue Visa fil

@@ -0,0 +1,218 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form :inline="true" :model="formInline" class="demo-form-inline">
4
+      <el-form-item label="客户姓名">
5
+        <el-input v-model="formInline.customerName" placeholder="客户姓名"></el-input>
6
+      </el-form-item> 
7
+      <el-form-item label="客户电话">
8
+        <el-input v-model="formInline.phone" placeholder="客户电话"></el-input>
9
+      </el-form-item>   
10
+      <el-form-item label="客户车牌号">
11
+        <el-input v-model="formInline.platNumber" placeholder="车牌号"></el-input>
12
+      </el-form-item>
13
+      <el-form-item>
14
+        <el-button type="primary" @click="onSubmit">查询</el-button>
15
+        <el-button type="info" @click="clear">重置</el-button>
16
+      </el-form-item>
17
+    </el-form>
18
+    <el-table
19
+    :data="FollowupList.records"
20
+    border>
21
+    <el-table-column
22
+      prop="customerId"
23
+      align='center'
24
+      label="客户ID">
25
+    </el-table-column>
26
+    <el-table-column
27
+      prop="customerName"
28
+      align='center'
29
+      label="客户姓名">
30
+    </el-table-column>
31
+    <el-table-column
32
+      prop="sex"
33
+      align='center'
34
+      label="性别">
35
+      <template slot-scope="scope">
36
+        <span>{{scope.row.sex ===1? '男':'女' }}</span>
37
+      </template>
38
+    </el-table-column>
39
+    <el-table-column
40
+      prop="phone"
41
+      align='center'
42
+      label="电话">
43
+    </el-table-column>
44
+    <el-table-column
45
+      prop="avatar"
46
+      align='center'
47
+      label="头像">
48
+      <template slot-scope="scope">
49
+        <el-image
50
+          style="width: 100px; height: 100px"
51
+          :src="scope.row.avatar"
52
+          fit="fill">
53
+        </el-image>
54
+      </template>
55
+    </el-table-column>
56
+    <el-table-column
57
+      prop="plateNumber"
58
+      align='center'
59
+      label="车牌">
60
+    </el-table-column>
61
+    <el-table-column
62
+      prop="carModel"
63
+      align='center'
64
+      label="车型">
65
+    </el-table-column>
66
+    <el-table-column
67
+      prop="channel"
68
+      align='center'
69
+      label="客户来源">
70
+    </el-table-column>
71
+    <el-table-column
72
+      prop="purpose"
73
+      align='center'
74
+      label="来访目的">
75
+      <template slot-scope="scope">
76
+        <span>{{scope.row.purpose ===1? '看房':'其他' }}</span>
77
+      </template>
78
+    </el-table-column>
79
+    <el-table-column
80
+      prop="favorHouse"
81
+      align='center'
82
+      label="意向房源">
83
+      <template slot-scope="scope">
84
+        <span>{{favorHouse(scope.row.favorHouse)}}</span>
85
+      </template>
86
+    </el-table-column>
87
+    <el-table-column
88
+      prop="favorLevel"
89
+      align='center'
90
+      label="意向等级">
91
+      <template slot-scope="scope">
92
+        <span>{{favorLevel(scope.row.favorLevel)}}</span>
93
+      </template>
94
+    </el-table-column>
95
+    <el-table-column prop="remark" label="备注" align="center">
96
+          <template slot-scope="scope">
97
+            <a :title="scope.row.remark" v-if="scope.row.remark != null ">
98
+              <span style="color: #8B8378  ">
99
+              {{ scope.row.remark.length>='15'?scope.row.remark.substring(0,15)+'..':scope.row.remark }}
100
+              </span>
101
+              <span v-if="scope.row.remark==='null'">
102
+              {{ scope.row.remark='' }}
103
+              </span>
104
+            </a>
105
+          </template>
106
+      </el-table-column>
107
+    <!-- <el-table-column
108
+      prop="status"
109
+      label="状态">
110
+    </el-table-column> -->
111
+    <el-table-column
112
+      prop="createDate"
113
+      label="创建时间">
114
+    </el-table-column>
115
+    <!-- <el-table-column
116
+      prop="consultantId"
117
+      label="置业ID">
118
+    </el-table-column> -->
119
+    <!-- <el-table-column
120
+      prop="realtyConsultant"
121
+      label="置业名称">
122
+    </el-table-column> -->
123
+  </el-table>
124
+    <el-pagination
125
+            style="margin-top:50px;float:right"
126
+            @size-change="handleSizeChange"
127
+            @current-change="handleCurrentChange"
128
+            :current-page="formInline.pageNum"
129
+            :page-sizes="[1,10, 20, 30, 40]"
130
+            :page-size="formInline.pageSize"
131
+            layout="total, sizes, prev, pager, next, jumper"
132
+            :total="FollowupList.total || 0">
133
+    </el-pagination>
134
+  </div>
135
+</template>
136
+<script>
137
+import { createNamespacedHelpers } from 'vuex'
138
+const {mapState: mapFollowupState, mapActions: mapFollowupActions } = createNamespacedHelpers('followup')
139
+
140
+export default {
141
+  name: 'followup-index',
142
+  data() {
143
+    return {
144
+      formInline: {
145
+        customerName:'',
146
+        personName: '',
147
+        phone: '',
148
+        platNumber: '',
149
+        pageNum: 1,
150
+        pageSize: 10
151
+      }
152
+    }
153
+  },
154
+  computed: {
155
+    ...mapFollowupState({
156
+    FollowupList: x => x.followup
157
+    })
158
+  },
159
+  created() {
160
+    this.getPage()
161
+  },
162
+  methods: {
163
+    ...mapFollowupActions([
164
+      'getFollowup'
165
+    ]),
166
+    onSubmit() {
167
+      this.getPage()
168
+    },
169
+    getPage() {
170
+      this.getFollowup(this.formInline)
171
+      // window.console.log(this.$store)
172
+      // this.$store.commit('security/foo')
173
+      // this.$store.dispatch('security/getSecurity')
174
+      // this.$store.commit('security/foo')
175
+    },
176
+    handleSizeChange(val) {
177
+      // console.log(`每页 ${val} 条`)
178
+      this.formInline.pageSize = val
179
+     c
180
+    },
181
+    handleCurrentChange(val) {
182
+      // console.log(`当前页: ${val}`)
183
+      this.formInline.pageNum = val
184
+      this.getPage()
185
+    },
186
+    favorHouse (msg) {
187
+      if (msg == '1') {
188
+        return "三房"
189
+      } else if(msg == '2'){
190
+        return "四房"
191
+      }else if(msg == '3'){
192
+        return "四房以上"
193
+      }
194
+    },
195
+    favorLevel (msg) {
196
+      if (msg == 'A') {
197
+        return "买房"
198
+      } else if(msg == 'B'){
199
+        return "有意向金"
200
+      }else if(msg == 'C'){
201
+        return "考虑中"
202
+      }else if(msg == 'D'){
203
+        return "不买"
204
+      }
205
+    },
206
+    clear(){
207
+      this.formInline.customerName = ''
208
+      this.formInline.phone = ''
209
+      this.formInline.platNumber = ''
210
+      this.formInline.pageNum = 1
211
+      this.formInline.pageSize = 10
212
+      this.getPage()
213
+    }
214
+   
215
+  }
216
+}
217
+</script>
218
+

+ 45
- 0
src/views/index.js Visa fil

@@ -108,8 +108,44 @@ const pages = [
108 108
           title: '来访致辞编辑',
109 109
         },
110 110
       },
111
+      {
112
+        path: 'cartRecord',
113
+        name: 'cartRecord',
114
+        component: () => import('./cart/list.vue'),
115
+        meta: {
116
+          menuShow: true,
117
+          title: '访客车辆记录',
118
+        },
119
+      },
120
+      {
121
+        path: 'visitor',
122
+        name: 'visitor',
123
+        component: () => import('./visitor/list.vue'),
124
+        meta: {
125
+          menuShow: true,
126
+          title: '访客预约信息',
127
+        },
128
+      },
111 129
     ]
112 130
   },
131
+  {
132
+    path: 'security',
133
+    name: 'securitylist',
134
+    component: () => import('./security/list.vue'),
135
+    meta: {
136
+      menuShow: true,
137
+      title: '安保记录',
138
+    },
139
+  },
140
+  {
141
+    path: 'lobby',
142
+    name: 'lobby',
143
+    component: () => import('./lobby/list.vue'),
144
+    meta: {
145
+      menuShow: true,
146
+      title: '大厅迎宾列表',
147
+    },
148
+  },
113 149
   {
114 150
     path: 'person',
115 151
     name: 'personlist',
@@ -119,6 +155,15 @@ const pages = [
119 155
       title: '人员列表',
120 156
     },
121 157
   },
158
+  {
159
+    path: 'followup',
160
+    name: 'followuplist',
161
+    component: () => import('./followup/list.vue'),
162
+    meta: {
163
+      menuShow: true,
164
+      title: '客户列表',
165
+    },
166
+  },
122 167
   {
123 168
     path: 'person/edit',
124 169
     name: 'personedit',

+ 190
- 0
src/views/lobby/list.vue Visa fil

@@ -0,0 +1,190 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form :inline="true" :model="formInline" class="demo-form-inline">
4
+      <el-form-item label="来访人电话">
5
+        <el-input v-model="formInline.phone" placeholder="预约人电话"></el-input>
6
+      </el-form-item>   
7
+      <el-form-item label="来访人车牌号">
8
+        <el-input v-model="formInline.platNumber" placeholder="车牌号"></el-input>
9
+      </el-form-item>
10
+      <el-form-item label="来访人员姓名">
11
+        <el-input v-model="formInline.personName" placeholder="来访人员姓名"></el-input>
12
+      </el-form-item>
13
+      <el-form-item label="是否预约">
14
+        <el-select v-model="formInline.appointment" clearable placeholder="请选择">
15
+          <el-option label="是" value="1" />
16
+          <el-option label="否" value="0"/>
17
+        </el-select>
18
+        <el-form-item>
19
+      </el-form-item>   
20
+        <el-button type="primary" @click="onSubmit">查询</el-button> 
21
+        <el-button type="info" @click="clear">重置</el-button>
22
+      </el-form-item>
23
+    </el-form>
24
+    <el-table
25
+    :data="lobbyList.records"
26
+    border>
27
+    <el-table-column
28
+      prop="recId"
29
+      label="来访人员ID"
30
+      align='center'>
31
+    </el-table-column>
32
+    <el-table-column
33
+      prop="plateNumber"
34
+      label="车牌"
35
+      align='center'>
36
+    </el-table-column>
37
+    <el-table-column
38
+      prop="carModel"
39
+      label="车型"
40
+      align='center'>
41
+    </el-table-column>
42
+    <el-table-column
43
+      prop="color"
44
+      label="颜色"
45
+      align='center'>
46
+    </el-table-column>
47
+    <el-table-column label="头像" width="150" >
48
+           <template scope="scope">
49
+              <img :src="scope.row.carImage" width="150" class="head_pic"/>
50
+          </template>
51
+    </el-table-column>
52
+    <el-table-column
53
+      prop="personName"
54
+      label="来访人姓名"
55
+      align='center'>
56
+    </el-table-column>
57
+    <el-table-column
58
+      prop="visiteDate"
59
+      label="来访时间"
60
+      width="160%">
61
+       <template slot-scope="scope">
62
+        <span>{{FormatDate(scope.row.visiteDate)}}</span>
63
+      </template>
64
+    </el-table-column>
65
+
66
+    <el-table-column
67
+      prop="phone"
68
+      label="来访手机"
69
+      align='center'>
70
+    </el-table-column>
71
+    <el-table-column
72
+      prop="sex"
73
+      label="性别"
74
+      align='center'>
75
+          <template slot-scope="scope">
76
+             <span>{{ scope.row.sex =='1'? '男':'女' }}</span>
77
+          </template>
78
+    </el-table-column>
79
+    <el-table-column
80
+      prop="personNum"
81
+      label="来访人数">
82
+    </el-table-column>
83
+    <el-table-column
84
+      prop="appointment"
85
+      label="是否预约"
86
+      align='center'>
87
+            <template slot-scope="scope">
88
+                <span>{{scope.row.appointment ==1? '是':'否' }}</span>      
89
+            </template>
90
+    </el-table-column>
91
+    <el-table-column
92
+      prop="channel"
93
+      label="来访渠道"
94
+      align='center'>
95
+            <template slot-scope="scope">
96
+                <span>{{ scope.row.purpose == 1?'到访':'其他' }} </span>
97
+            </template>
98
+    </el-table-column>
99
+    <el-table-column
100
+      prop="purpose"
101
+      label="来访目的"
102
+      align='center'>
103
+            <template slot-scope="scope">
104
+                <span>{{ scope.row.purpose == 1?'看房':'其他' }} </span>
105
+            </template>
106
+    </el-table-column>
107
+  </el-table>
108
+    <el-pagination
109
+            style="margin-top:50px;float:right"
110
+            @size-change="handleSizeChange"
111
+            @current-change="handleCurrentChange"
112
+            :current-page="formInline.pageNum"
113
+            :page-sizes="[1,10, 20, 30, 40]"
114
+            :page-size="formInline.pageSize"
115
+            layout="total, sizes, prev, pager, next, jumper"
116
+            :total="lobbyList.total || 0">
117
+    </el-pagination>
118
+  </div>
119
+</template>
120
+
121
+<script>
122
+import { createNamespacedHelpers } from 'vuex'
123
+const {mapState: mapLobbyState, mapActions: mapLobbyActions } = createNamespacedHelpers('lobby')
124
+
125
+export default {
126
+  name: 'visitor-index',
127
+  data() {
128
+    return {
129
+      formInline: {
130
+        personName: '',
131
+        phone: '',
132
+        platNumber: '',
133
+        appointment: '',
134
+        pageNum: 1,
135
+        pageSize: 10
136
+      }
137
+    }
138
+  },
139
+  computed: {
140
+    ...mapLobbyState({
141
+    lobbyList: x => x.safety
142
+    })
143
+  },
144
+  created() {
145
+    this.getPage()
146
+  },
147
+  methods: {
148
+    ...mapLobbyActions([
149
+      'getLobby'
150
+    ]),
151
+    onSubmit() {
152
+      this.getPage()
153
+    },
154
+    getPage() {
155
+      this.getLobby(this.formInline)
156
+      // window.console.log(this.$store)
157
+      // this.$store.commit('security/foo')
158
+      // this.$store.dispatch('security/getSecurity')
159
+      // this.$store.commit('security/foo')
160
+    },
161
+    handleSizeChange(val) {
162
+      // console.log(`每页 ${val} 条`)
163
+      this.formInline.pageSize = val
164
+      this.getPage()
165
+    },
166
+    handleCurrentChange(val) {
167
+      // console.log(`当前页: ${val}`)
168
+      this.formInline.pageNum = val
169
+      this.getPage()
170
+    },
171
+    FormatDate (date) {
172
+      if (date) {
173
+        return date.split('T')[0] === '0001-01-01' ? '' : date.split('T')[0] + '  ' + date.split('T')[1]
174
+      } else {
175
+        return ''
176
+      }
177
+    },
178
+    clear(){
179
+      this.formInline.personName = ''
180
+      this.formInline.phone = ''
181
+      this.formInline.platNumber = ''
182
+      this.formInline.appointment = ''
183
+      this.formInline.pageNum = 1
184
+      this.formInline.pageSize = 10
185
+      this.getPage()
186
+    }
187
+  }
188
+}
189
+</script>
190
+

+ 157
- 0
src/views/security/list.vue Visa fil

@@ -0,0 +1,157 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form :inline="true" :model="formInline" class="demo-form-inline">
4
+      <el-form-item label="车牌">
5
+        <el-input v-model="formInline.plateNumber" placeholder="车牌"></el-input>
6
+      </el-form-item>
7
+      <el-form-item label="来访时间">
8
+        <el-date-picker
9
+                v-model="formInline.visiteDate"
10
+                type="date"
11
+                value-format="yyyy-MM-dd"
12
+                placeholder="来访时间">
13
+        </el-date-picker>
14
+      </el-form-item>
15
+      <el-form-item>
16
+        <el-button type="primary" @click="onSubmit">查询</el-button>
17
+      </el-form-item>
18
+    </el-form>
19
+    <el-table
20
+            :data="securityList.records"
21
+            border
22
+            style="width: 100%">
23
+      <!-- <el-table-column
24
+              prop="recId"
25
+              label="序号"
26
+              width="180"/> -->
27
+      <el-table-column
28
+              prop="plateNumber"
29
+              label="车牌"/>
30
+      <el-table-column
31
+              prop="carModel"
32
+              label="车型">
33
+      </el-table-column>
34
+      <el-table-column
35
+              prop="color"
36
+              label="颜色"/>
37
+      <el-table-column
38
+              prop="personNum"
39
+              label="人数"/>
40
+      <el-table-column
41
+              prop="appointment"
42
+              label="是否预约">
43
+              <template slot-scope="scope">
44
+                <span>{{scope.row.appointment ==1? '是':'否' }}</span>
45
+              </template>
46
+      </el-table-column>
47
+      <el-table-column
48
+              prop="appointment"
49
+              label="来访时间">
50
+              <template slot-scope="scope">
51
+                <span>{{FormatDate(scope.row.visiteDate)}}</span>
52
+              </template>
53
+      </el-table-column>
54
+      <el-table-column
55
+              prop="channel"
56
+              label="来访渠道">
57
+              <template slot-scope="scope">
58
+                <span>{{ scope.row.channel == 1?'到访':'其他' }} </span>
59
+              </template>
60
+      </el-table-column>
61
+      <el-table-column
62
+              prop="purpose"
63
+              label="来访目的">
64
+               <template slot-scope="scope">
65
+                <span>{{ scope.row.purpose == 1?'看房':'其他' }} </span>
66
+              </template>
67
+      </el-table-column>
68
+      <el-table-column
69
+              prop="carImage"
70
+              label="车辆图片">
71
+              <template slot-scope="scope">
72
+              <el-image
73
+                  style="width: 100px; height: 100px"
74
+                  :src="scope.row.carImage"
75
+                  fit="fill"></el-image>
76
+              </template>
77
+      </el-table-column>
78
+       <el-table-column
79
+              prop="personName"
80
+              label="来访人">
81
+      </el-table-column>
82
+    </el-table>
83
+    <el-pagination
84
+            style="margin-top:50px;float:right"
85
+            @size-change="handleSizeChange"
86
+            @current-change="handleCurrentChange"
87
+            :current-page="formInline.pageNum"
88
+            :page-sizes="[1,10, 20, 30, 40]"
89
+            :page-size="formInline.pageSize"
90
+            layout="total, sizes, prev, pager, next, jumper"
91
+            :total="securityList.total || 0">
92
+    </el-pagination>
93
+  </div>
94
+</template>
95
+
96
+<script>
97
+import { createNamespacedHelpers } from 'vuex'
98
+const {mapState: mapSecurityState, mapActions: mapSecurityActions } = createNamespacedHelpers('security')
99
+
100
+export default {
101
+  name: 'security-index',
102
+  data() {
103
+    return {
104
+      formInline: {
105
+        plateNumber: '',
106
+        recId: '',
107
+        visiteDate: '',
108
+        customerName: '',
109
+        phone: '',
110
+        pageNum: 1,
111
+        pageSize: 10
112
+      }
113
+    }
114
+  },
115
+  computed: {
116
+    ...mapSecurityState({
117
+     securityList: x => x.safety
118
+    })
119
+  },
120
+  created() {
121
+    this.getPage()
122
+  },
123
+  methods: {
124
+    ...mapSecurityActions([
125
+      'getSecurity'
126
+    ]),
127
+    onSubmit() {
128
+      this.getPage()
129
+    },
130
+    getPage() {
131
+      this.getSecurity(this.formInline)
132
+      // window.console.log(this.$store)
133
+      // this.$store.commit('security/foo')
134
+      // this.$store.dispatch('security/getSecurity')
135
+      // this.$store.commit('security/foo')
136
+    },
137
+    handleSizeChange(val) {
138
+      // console.log(`每页 ${val} 条`)
139
+      this.formInline.pageSize = val
140
+      this.getPage()
141
+    },
142
+    handleCurrentChange(val) {
143
+      // console.log(`当前页: ${val}`)
144
+      this.formInline.pageNum = val
145
+      this.getPage()
146
+    },
147
+    FormatDate (date) {
148
+      if (date) {
149
+        return date.split('T')[0] === '0001-01-01' ? '' : date.split('T')[0] + '  ' + date.split('T')[1]
150
+      } else {
151
+        return ''
152
+      }
153
+    },
154
+  }
155
+}
156
+</script>
157
+

+ 144
- 0
src/views/visitor/list.vue Visa fil

@@ -0,0 +1,144 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form :inline="true" :model="formInline" class="demo-form-inline">
4
+      <el-form-item label="预约人姓名">
5
+        <el-input v-model="formInline.personName" placeholder="预约人姓名"></el-input>
6
+      </el-form-item>
7
+      <el-form-item label="预约人电话">
8
+        <el-input v-model="formInline.phone" placeholder="预约人电话"></el-input>
9
+      </el-form-item>   
10
+      <el-form-item label="车牌号">
11
+        <el-input v-model="formInline.platNumber" placeholder="车牌号"></el-input>
12
+      </el-form-item>
13
+      <el-form-item>
14
+        <el-button type="primary" @click="onSubmit">查询</el-button>
15
+      </el-form-item>
16
+    </el-form>
17
+    <el-table
18
+     :data="visitorList.records"
19
+    border>
20
+    <el-table-column
21
+      prop="personName"
22
+      label="预约人姓名"
23
+      width="180">
24
+    </el-table-column>
25
+    <el-table-column
26
+      prop="phone"
27
+      label="预约人电话">
28
+    </el-table-column>
29
+    <el-table-column
30
+      prop="visitDate"
31
+      label="到访时间">
32
+       <template slot-scope="scope">
33
+        <span>{{FormatDate(scope.row.visitDate)}}</span>
34
+      </template>
35
+    </el-table-column>
36
+
37
+    <el-table-column
38
+      prop="personNum"
39
+      label="来访人数">
40
+    </el-table-column>
41
+    <el-table-column
42
+      prop="carNum"
43
+      label="车辆数目">
44
+    </el-table-column>
45
+    <el-table-column
46
+      prop="platNumber"
47
+      label="车牌号">
48
+    </el-table-column>
49
+    <el-table-column
50
+      prop="createDate"
51
+      value-format="yyyy-MM-dd"
52
+      label="创建时间">
53
+      <template slot-scope="scope">
54
+        <span>{{FormatDate(scope.row.createDate)}}</span>
55
+      </template>
56
+    </el-table-column>
57
+    <el-table-column
58
+      prop="remark"
59
+      label="备注">
60
+      <template slot-scope="scope">
61
+            <a :title="scope.row.remark" v-if="scope.row.remark != null ">
62
+              <span style="color: #8B8378  ">
63
+              {{ scope.row.remark.length>='15'?scope.row.remark.substring(0,15)+'..':scope.row.remark }}
64
+              </span>
65
+              <span v-if="scope.row.remark==='null'">
66
+              {{ scope.row.remark='' }}
67
+              </span>
68
+            </a>
69
+          </template>
70
+    </el-table-column>
71
+  </el-table>
72
+    <el-pagination
73
+            style="margin-top:50px;float:right"
74
+            @size-change="handleSizeChange"
75
+            @current-change="handleCurrentChange"
76
+            :current-page="formInline.pageNum"
77
+            :page-sizes="[1,10, 20, 30, 40]"
78
+            :page-size="formInline.pageSize"
79
+            layout="total, sizes, prev, pager, next, jumper"
80
+            :total="visitorList.total || 0">
81
+    </el-pagination>
82
+  </div>
83
+</template>
84
+
85
+<script>
86
+import { createNamespacedHelpers } from 'vuex'
87
+const {mapState: mapVisitorState, mapActions: mapVisitorActions } = createNamespacedHelpers('visitor')
88
+
89
+export default {
90
+  name: 'visitor-index',
91
+  data() {
92
+    return {
93
+      formInline: {
94
+        personName: '',
95
+        phone: '',
96
+        platNumber: '',
97
+        pageNum: 1,
98
+        pageSize: 10
99
+      }
100
+    }
101
+  },
102
+  computed: {
103
+    ...mapVisitorState({
104
+     visitorList: x => x.safety
105
+    })
106
+  },
107
+  created() {
108
+    this.getPage()
109
+  },
110
+  methods: {
111
+    ...mapVisitorActions([
112
+      'getVisitor'
113
+    ]),
114
+    onSubmit() {
115
+      this.getPage()
116
+    },
117
+    getPage() {
118
+      this.getVisitor(this.formInline)
119
+      // window.console.log(this.$store)
120
+      // this.$store.commit('security/foo')
121
+      // this.$store.dispatch('security/getSecurity')
122
+      // this.$store.commit('security/foo')
123
+    },
124
+    handleSizeChange(val) {
125
+      // console.log(`每页 ${val} 条`)
126
+      this.formInline.pageSize = val
127
+      this.getPage()
128
+    },
129
+    handleCurrentChange(val) {
130
+      // console.log(`当前页: ${val}`)
131
+      this.formInline.pageNum = val
132
+      this.getPage()
133
+    },
134
+    FormatDate (date) {
135
+      if (date) {
136
+        return date.split('T')[0] === '0001-01-01' ? '' : date.split('T')[0] + '  ' + date.split('T')[1]
137
+      } else {
138
+        return ''
139
+      }
140
+    },
141
+  }
142
+}
143
+</script>
144
+

+ 1
- 1
vue.config.js Visa fil

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