Просмотр исходного кода

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/pc-admin

张延森 6 лет назад
Родитель
Сommit
eed69a2951

+ 1
- 0
public/index.html Просмотреть файл

@@ -6,6 +6,7 @@
6 6
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
7 7
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8 8
     <link rel="stylesheet" href="//at.alicdn.com/t/font_1070150_8lyiyriedbr.css">
9
+    <link rel="stylesheet" href="//at.alicdn.com/t/font_1320815_gazogjls0pk.css">
9 10
     <title>后台管理系统</title>
10 11
   </head>
11 12
   <body>

+ 52
- 1
src/config/api.js Просмотреть файл

@@ -127,6 +127,54 @@ const apis = {
127 127
       url: `${commPrefix}/customer/add`
128 128
     }
129 129
   },
130
+  activity:{
131
+    list:{
132
+      method:'get',
133
+      url: `${commPrefix}/iBuildingDynamicList`
134
+    },
135
+    buildingAll:{
136
+      method:'get',
137
+      url: `${commPrefix}/buildingAll`
138
+    },
139
+    activityAdd:{
140
+      method:'post',
141
+      url: `${commPrefix}/buildingDynamic/add`
142
+    },
143
+    activityDetails:{
144
+      method:'get',
145
+      url: `${commPrefix}/buildingDynamic/Details`
146
+    },
147
+    updateActivity:{
148
+      method:'PUT',
149
+      url: `${commPrefix}/buildingDynamic/update`
150
+    },
151
+    getSignList:{
152
+      method:'get',
153
+      url: `${commPrefix}/SignList`
154
+    },
155
+    finishActivity:{
156
+      method:'put',
157
+      url: `${commPrefix}/buildingDynamic/finish`
158
+    }
159
+  },
160
+  recommendCustomer:{
161
+    list:{
162
+      method:'get',
163
+      url: `${commPrefix}/customer/recommend`
164
+    },
165
+    getById: {
166
+      method:'get',
167
+      url: `${commPrefix}/customer/recommend/getById/:id`
168
+    },
169
+    update: {
170
+      method:'put',
171
+      url: `${commPrefix}/customer/recommend/edit/:id`
172
+    },
173
+    recommendCustomerList: {
174
+      method:'get',
175
+      url: `${commPrefix}/customer/recommend/:id`
176
+    }
177
+  },
130 178
   goods:{
131 179
     list:{
132 180
       method:'get',
@@ -219,8 +267,11 @@ const apis = {
219 267
     list:{
220 268
       method:'get',
221 269
       url: `${commPrefix}/taPointsExchange`
270
+    },
271
+    change: {
272
+      method: 'put',
273
+      url: `${commPrefix}/taPointsExchange/change`
222 274
     }
223 275
   },
224 276
 }
225
-
226 277
 export default apis

+ 2
- 0
src/store/index.js Просмотреть файл

@@ -14,10 +14,12 @@ const store = new Vuex.Store({
14 14
     customer: require('./modules/customer').default,
15 15
     building: require('./modules/building').default,
16 16
     img: require('./modules/img').default,
17
+    activity: require('./modules/activity').default,
17 18
     goods: require('./modules/goods').default,
18 19
     points: require('./modules/points').default,
19 20
     exchange: require('./modules/exchange').default,
20 21
     news
22
+
21 23
   }
22 24
 })
23 25
 

+ 79
- 0
src/store/modules/activity.js Просмотреть файл

@@ -0,0 +1,79 @@
1
+import apis from '../../config/api'
2
+import request from '../../utils/request'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    list: [],
8
+    detail: {},
9
+  },
10
+  mutations: {},
11
+  actions: {
12
+    getActivityList (context, payload) {
13
+      return request({
14
+        ...apis.activity.list,
15
+        params: payload,
16
+      })
17
+    },
18
+    addActivity({ commit }, payload) {
19
+      return new Promise((resolve, reject) => {
20
+        request({
21
+          ...apis.activity.activityAdd,
22
+          data: payload,
23
+        }).then((data) => {
24
+          window.console.log(data)
25
+          commit('updateList', { ...data, list: data.records})
26
+          resolve(data)
27
+        }).catch(({ message }) => {
28
+          if (typeof message === 'string') {
29
+            reject(message)
30
+          }
31
+        })
32
+      })
33
+    },
34
+    activityDetails (context, payload) {
35
+      return request({
36
+        ...apis.activity.activityDetails,
37
+        params: payload,
38
+      })
39
+    },
40
+    updateActivity({ commit }, payload) {
41
+      return new Promise((resolve, reject) => {
42
+        request({
43
+          ...apis.activity.updateActivity,
44
+          data: payload,
45
+        }).then((data) => {
46
+          window.console.log(data)
47
+          commit('updateList', { ...data, list: data.records})
48
+          resolve(data)
49
+        }).catch(({ message }) => {
50
+          if (typeof message === 'string') {
51
+            reject(message)
52
+          }
53
+        })
54
+      })
55
+    },
56
+    // 活动报名列表
57
+    getSignList (context, payload) {
58
+      return request({
59
+        ...apis.activity.getSignList,
60
+        params: payload,
61
+      })
62
+    },
63
+    // 结束报名
64
+    finishActivity({ commit }, payload) {
65
+      return new Promise((resolve, reject) => {
66
+        request({
67
+          ...apis.activity.finishActivity,
68
+          data: payload,
69
+        }).then((data) => {
70
+          resolve(data)
71
+        }).catch(({ message }) => {
72
+          if (typeof message === 'string') {
73
+            reject(message)
74
+          }
75
+        })
76
+      })
77
+    },
78
+  },
79
+}

+ 51
- 0
src/store/modules/customer.js Просмотреть файл

@@ -32,7 +32,58 @@ export default {
32 32
           }
33 33
         })
34 34
       })
35
+    },
36
+    getRecommendCustomers ({ commit }, payload) { // 查询推荐客户列表
37
+      return new Promise((resolve, reject) => {
38
+        request({
39
+          ...apis.recommendCustomer.list,
40
+          params: payload,
41
+        }).then((data) => {
42
+          resolve(data)
43
+        }).catch(({ message }) => {
44
+            reject(message)
45
+        })
46
+      })
47
+    },
48
+    getRecommendCustomersGetById ({ commit }, payload) { // 根据Id查询列表
49
+      return new Promise((resolve, reject) => {
50
+        request({
51
+          ...apis.recommendCustomer.getById,
52
+          urlData: { id: payload.customerId},
53
+        }).then((data) => {
54
+          resolve(data)
55
+        }).catch(({ message }) => {
56
+          reject(message)
57
+        })
58
+      })
59
+    },
60
+    getRecommendCustomersUpdate ({ commit }, payload) { // 根据Id查询列表
61
+      return new Promise((resolve, reject) => {
62
+        request({
63
+          ...apis.recommendCustomer.update,
64
+          urlData: { id: payload.customerId},
65
+          data: payload
66
+        }).then((data) => {
67
+          resolve(data)
68
+        }).catch(({ message }) => {
69
+          reject(message)
70
+        })
71
+      })
72
+    },
73
+    recommendCustomerList({ commit }, payload) { // 推荐客户列表
74
+      return new Promise((resolve, reject) => {
75
+        request({
76
+          ...apis.recommendCustomer.recommendCustomerList,
77
+          urlData: { id: payload.customerId},
78
+          params: payload
79
+        }).then((data) => {
80
+          resolve(data)
81
+        }).catch(({ message }) => {
82
+          reject(message)
83
+        })
84
+      })
35 85
     }
86
+
36 87
     
37 88
   }
38 89
 }

+ 2
- 2
src/store/modules/exchange.js Просмотреть файл

@@ -96,10 +96,10 @@ export default {
96 96
         })
97 97
       })
98 98
     },
99
-    changeGoodsStatus (_, payload) {
99
+    changeExchangeStatus (_, payload) {
100 100
       return new Promise((resolve, reject) => {
101 101
         request({
102
-          ...apis.goods.change,
102
+          ...apis.exchange.change,
103 103
           data: payload,
104 104
         }).then((data) => {
105 105
           resolve(data)

+ 261
- 0
src/views/activity/add.vue Просмотреть файл

@@ -0,0 +1,261 @@
1
+<template>
2
+  <el-form ref="form" :model="dynamic" label-width="160px">
3
+    <el-form-item label="所属项目">
4
+      <el-select v-model="activityQuery.buildingId" placeholder="请选择">
5
+        <el-option v-for="(build,i) in buildings.list || []" :key="i" :label="build.buildingName" :value="build.buildingId"></el-option>
6
+      </el-select>
7
+    </el-form-item>
8
+    <el-form-item label="主图:">
9
+          <el-upload
10
+            :action="upFileUrl"
11
+            name='file'
12
+            list-type="picture-card"
13
+            :headers="uploadHeaders"
14
+            :file-list="imgList"
15
+            :show-file-list="true"
16
+            :before-upload="beforeImgUpload"
17
+            :on-success="handleAvatarSuccess"
18
+            :on-remove="handleRemove">
19
+            <i class="el-icon-plus"></i>
20
+          </el-upload>
21
+          <el-dialog :visible.sync="dialogVisible">
22
+            <img width="100%" :src="dialogImageUrl" alt="">
23
+          </el-dialog>
24
+    </el-form-item>
25
+    <el-form-item label="活动标题">
26
+      <el-input v-model="activityQuery.title"></el-input>
27
+    </el-form-item>
28
+    <el-form-item label="活动时间">
29
+       <el-date-picker v-model="activityQuery.startDate"  type="datetime" placeholder="选择日期"/>
30
+       <!-- <el-date-picker
31
+                  v-model="detail.reportDate"
32
+                  type="datetime"
33
+                  placeholder="选择日期时间">
34
+          </el-date-picker> -->
35
+        <span>-</span>
36
+       <el-date-picker v-model="activityQuery.endDate"  type="datetime" placeholder="选择日期"/>   
37
+    </el-form-item>
38
+    <el-form-item label="活动地点">
39
+      <el-input  v-model="activityQuery.address"></el-input>
40
+    </el-form-item>
41
+    <el-form-item  label="活动人数">
42
+      <el-input v-model="activityQuery.personNum" ></el-input>
43
+    </el-form-item>
44
+    <!-- <el-form-item label="链接地址">
45
+      <el-input v-model="dynamic.url"></el-input>
46
+    </el-form-item> -->
47
+    <el-form-item label="活动详情">
48
+      <div id="websiteEditorElem" style="height: 400px"></div>
49
+    </el-form-item>
50
+    <el-form-item label="是否需要报名">
51
+       <el-radio v-model="activityQuery.isEnlist" label="1">是</el-radio>
52
+       <el-radio v-model="activityQuery.isEnlist" label="0">否</el-radio>
53
+    </el-form-item>
54
+    <el-form-item label="活动时间" v-if="activityQuery.isEnlist == '1'">
55
+       <el-date-picker v-model="activityQuery.enlistStart" type="date" placeholder="选择日期"/>
56
+        <span>-</span>
57
+       <el-date-picker v-model="activityQuery.enlistEnd" type="date" placeholder="选择日期"/>   
58
+    </el-form-item>
59
+    <el-form-item>
60
+      <el-button type="primary" @click="onSubmit">保存</el-button>
61
+
62
+    </el-form-item>
63
+  </el-form>
64
+</template>
65
+
66
+<script>
67
+import { createNamespacedHelpers } from 'vuex'
68
+import apis from '../../config/api'
69
+import E from 'wangeditor'
70
+
71
+const { mapState: mapDynamicState, mapActions: mapDynamicActions, mapMutations: mapDynamicMutations } = createNamespacedHelpers('building')
72
+const { mapState: mapActivityState, mapActions: mapActivityActions } = createNamespacedHelpers('activity')
73
+const { mapState: mapBuildingState, mapActions: mapBuildingActions } = createNamespacedHelpers('building')
74
+const { mapActions: mapImgActions } = createNamespacedHelpers('img')
75
+
76
+export default {
77
+  data () {
78
+    return {
79
+      url:'',
80
+      buildingId:'',
81
+      upFileUrl: apis.file.upload.url,
82
+      radio:'1',
83
+      imgList: [],
84
+      dialogVisible: false,
85
+      dialogImageUrl: "",
86
+      activityQuery: {
87
+       url:'',
88
+       startDate:'',
89
+       endDate:'',
90
+       buildingId:'',
91
+       title:'',
92
+       isEnlist:'1',
93
+       text:'',
94
+       enlistStart:'',
95
+       enlistEnd:'',
96
+       personNum:'',
97
+      }
98
+      
99
+    }
100
+  },
101
+  computed: {
102
+    ...mapDynamicState({
103
+      detail: x => x.detail,
104
+    }),
105
+    dynamic: {
106
+      get () {
107
+        return this.detail
108
+      },
109
+      set (val) {
110
+        return this.updateDetail(val)
111
+      }
112
+    },
113
+    ...mapBuildingState({
114
+      buildings: x => x.buildings
115
+    }),
116
+    uploadHeaders () {
117
+                const token = localStorage.getItem('x-token') || ''
118
+                return {
119
+                    Authorization: `Bearer ${token}`
120
+                }
121
+            }
122
+  },
123
+  methods: {
124
+    ...mapBuildingActions([
125
+      'getBuildings'
126
+    ]),
127
+    ...mapDynamicMutations([
128
+      'updateDetail'
129
+    ]),
130
+    ...mapDynamicActions([
131
+      'getDetail',
132
+      'editDynamics'
133
+    ]),
134
+        ...mapActivityActions([
135
+      'addActivity',
136
+    ]),
137
+    ...mapImgActions([
138
+      'uploadImg'
139
+    ]),
140
+    beforeImgUpload (file) {
141
+      if (file.type !== 'image/jpeg' && file.type !== 'image/png') {
142
+        this.$message.error('上传图片只能是 JPG 或 PNG 格式!')
143
+        return false
144
+      }
145
+      // if (file.size / 1024 > 300) {
146
+      //   this.$message.error('图片大小不允许超过300k!')
147
+      //   return false
148
+      // }
149
+      this.loading = this.$loading({
150
+        lock: true,
151
+        text: '上传中...',
152
+        spinner: 'el-icon-loading',
153
+        background: 'rgba(0, 0, 0, 0.7)'
154
+      })
155
+
156
+      return true
157
+    },
158
+    handleRemove(file, fileList) {
159
+      this.imgList = fileList;
160
+    },
161
+
162
+    handleAvatarSuccess (res) {
163
+      this.activityQuery.url = res.data
164
+      this.updateDetail({...this.dynamic, imgUrl: res.data})
165
+      this.loading.close()
166
+    },
167
+    onSubmit () {
168
+      // if (!this.detail.dynamicId) {
169
+        // 新增
170
+        console.log('this.imgList[0]',this.imgList[0])
171
+        // this.activityQuery.url = this.imgList[0]
172
+        this.addActivity(
173
+          JSON.stringify(this.activityQuery)
174
+        ).then(() => {
175
+          this.onCancel()
176
+          
177
+        })
178
+        this.$router.push({ name: "activity-list" });
179
+      // } else {
180
+      //   // 修改
181
+      //   this.editDynamics({
182
+      //     detail: JSON.stringify(this.detail)
183
+      //   }).then(() => {
184
+      //     this.onCancel()
185
+      //   })
186
+      // }
187
+    },
188
+    onCancel () {
189
+      this.$router.push({name: 'dynamiclist'})
190
+    }
191
+  },
192
+  mounted () {
193
+    const _that = this
194
+    const phoneEditor = new E('#websiteEditorElem')
195
+    phoneEditor.customConfig.zIndex = 1
196
+    phoneEditor.customConfig.onchange = function (html) {
197
+      _that.dynamic = {..._that.dynamic, url: html}
198
+        _that.activityQuery.text =_that.dynamic.url
199
+    }
200
+    // phoneEditor.customConfig.uploadImgServer = this.upFileUrl
201
+    // phoneEditor.customConfig.uploadFileName = 'uploadFiles'
202
+
203
+    phoneEditor.customConfig.customUploadImg = function (files, insert) {
204
+      _that.uploadImg(files[0]).then(data => {
205
+        insert(data)
206
+      })
207
+    }
208
+    phoneEditor.customConfig.menus = [
209
+      'head',  // 标题
210
+      'bold',  // 粗体
211
+      'fontSize',  // 字号
212
+      'fontName',  // 字体
213
+      'italic',  // 斜体
214
+      'underline',  // 下划线
215
+      'strikeThrough',  // 删除线
216
+      'foreColor',  // 文字颜色
217
+      'backColor',  // 背景颜色
218
+      'justify',  // 对齐方式
219
+      'image',  // 插入图片
220
+    ]
221
+    phoneEditor.create()
222
+    
223
+    this.getBuildings({
224
+      pageNum: 1,
225
+      pageSize: 100,
226
+    }).then(() => {
227
+      if ((this.$route.query.id || '') !== '') {
228
+        this.getDetail({id: this.$route.query.id}).then((data) => {
229
+          phoneEditor.txt.html(data.url)
230
+        })
231
+      }
232
+    })
233
+  }
234
+}
235
+</script>
236
+
237
+<style lang="scss">
238
+  .avatar-uploader .el-upload {
239
+    border: 1px dashed #d9d9d9;
240
+    border-radius: 6px;
241
+    cursor: pointer;
242
+    position: relative;
243
+    overflow: hidden;
244
+  }
245
+  .avatar-uploader .el-upload:hover {
246
+    border-color: #409EFF;
247
+  }
248
+  .avatar-uploader-icon {
249
+    font-size: 28px;
250
+    color: #8c939d;
251
+    width: 178px;
252
+    height: 178px;
253
+    line-height: 178px;
254
+    text-align: center;
255
+  }
256
+  .avatar {
257
+    width: 178px;
258
+    height: 178px;
259
+    display: block;
260
+  }
261
+</style>

+ 262
- 0
src/views/activity/edit.vue Просмотреть файл

@@ -0,0 +1,262 @@
1
+<template>
2
+  <el-form ref="form" label-width="160px">
3
+    <el-form-item label="所属项目">
4
+      <el-select v-model="activityQuery.buildingId" placeholder="请选择">
5
+        <el-option v-for="(build,i) in buildings.list || []" :key="i" :label="build.buildingName" :value="build.buildingId"></el-option>
6
+      </el-select>
7
+    </el-form-item>
8
+    <el-form-item label="主图:">
9
+          <el-upload
10
+                :headers="uploadHeaders"
11
+                :action="upFileUrl"
12
+                :show-file-list="false"
13
+                :on-success="handleAvatarSuccess">
14
+              <img v-if="imageUrl" :src="imageUrl" class="avatar">
15
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
16
+          </el-upload>
17
+    </el-form-item>
18
+    <el-form-item label="活动标题">
19
+      <el-input v-model="activityQuery.title"></el-input>
20
+    </el-form-item>
21
+    <el-form-item label="活动时间">
22
+       <el-date-picker v-model="activityQuery.startDate" type="date" placeholder="选择日期"/>
23
+        <span>-</span>
24
+       <el-date-picker v-model="activityQuery.endDate" type="date" placeholder="选择日期"/>   
25
+    </el-form-item>
26
+    <el-form-item label="活动地点">
27
+      <el-input  v-model="activityQuery.address"></el-input>
28
+    </el-form-item>
29
+    <el-form-item label="活动人数">
30
+      <el-input v-model="activityQuery.personNum"></el-input>
31
+    </el-form-item>
32
+    <!-- <el-form-item label="链接地址">
33
+      <el-input v-model="dynamic.url"></el-input>
34
+    </el-form-item> -->
35
+    <el-form-item label="活动详情">
36
+      <div id="websiteEditorElem" style="height: 400px"></div>
37
+    </el-form-item>
38
+    <el-form-item label="是否需要报名">
39
+       <el-radio v-model="activityQuery.isEnlist" label="1">是</el-radio>
40
+       <el-radio v-model="activityQuery.isEnlist" label="0">否</el-radio>
41
+    </el-form-item>
42
+    <el-form-item label="活动时间" v-if="activityQuery.isEnlist == '1'">
43
+       <el-date-picker v-model="activityQuery.enlistStart" type="date" placeholder="选择日期"/>
44
+        <span>-</span>
45
+       <el-date-picker v-model="activityQuery.enlistEnd" type="date" placeholder="选择日期"/>   
46
+    </el-form-item>
47
+    <el-form-item>
48
+      <el-button type="primary" @click="onSubmit">保存</el-button>
49
+      <el-button @click="onCancel">取消</el-button>
50
+    </el-form-item>
51
+  </el-form>
52
+</template>
53
+
54
+<script>
55
+import { createNamespacedHelpers } from 'vuex'
56
+import apis from '../../config/api'
57
+import E from 'wangeditor'
58
+
59
+const { mapState: mapDynamicState, mapActions: mapDynamicActions, mapMutations: mapDynamicMutations } = createNamespacedHelpers('building')
60
+const { mapState: mapActivityState, mapActions: mapActivityActions } = createNamespacedHelpers('activity')
61
+const { mapState: mapBuildingState, mapActions: mapBuildingActions } = createNamespacedHelpers('building')
62
+const { mapActions: mapImgActions } = createNamespacedHelpers('img')
63
+
64
+export default {
65
+  data () {
66
+    return {
67
+      url:'',
68
+      buildingId:'',
69
+      upFileUrl: apis.file.upload.url,
70
+      radio:'1',
71
+      imageUrl: '',
72
+      imgList: [],
73
+      dialogVisible: false,
74
+      dialogImageUrl: "",
75
+      activityQuery: {
76
+       dynamicId:'',
77
+       buildingId:'',
78
+       url:'',
79
+       startDate:'',
80
+       endDate:'',
81
+       buildingId:'',
82
+       title:'',
83
+       isEnlist:'',
84
+       text:'',
85
+       enlistStart:'',
86
+       enlistEnd:'',
87
+       address:'',
88
+       personNum:''
89
+      }
90
+      
91
+    }
92
+  },
93
+  computed: {
94
+    ...mapDynamicState({
95
+      detail: x => x.detail,
96
+    }),
97
+    dynamic: {
98
+      get () {
99
+        return this.detail
100
+      },
101
+      set (val) {
102
+        return this.updateDetail(val)
103
+      }
104
+    },
105
+    ...mapBuildingState({
106
+      buildings: x => x.buildings
107
+    }),
108
+    uploadHeaders () {
109
+                const token = localStorage.getItem('x-token') || ''
110
+                return {
111
+                    Authorization: `Bearer ${token}`
112
+                }
113
+            }
114
+  },
115
+  methods: {
116
+    ...mapBuildingActions([
117
+      'getBuildings'
118
+    ]),
119
+    ...mapDynamicMutations([
120
+      'updateDetail'
121
+    ]),
122
+    ...mapDynamicActions([
123
+      'getDetail',
124
+      'editDynamics'
125
+    ]),
126
+        ...mapActivityActions([
127
+      'addActivity',
128
+      'activityDetails',
129
+      'updateActivity'
130
+    ]),
131
+    ...mapImgActions([
132
+      'uploadImg'
133
+    ]),
134
+    beforeImgUpload (file) {
135
+      if (file.type !== 'image/jpeg' && file.type !== 'image/png') {
136
+        this.$message.error('上传图片只能是 JPG 或 PNG 格式!')
137
+        return false
138
+      }
139
+      // if (file.size / 1024 > 300) {
140
+      //   this.$message.error('图片大小不允许超过300k!')
141
+      //   return false
142
+      // }
143
+      this.loading = this.$loading({
144
+        lock: true,
145
+        text: '上传中...',
146
+        spinner: 'el-icon-loading',
147
+        background: 'rgba(0, 0, 0, 0.7)'
148
+      })
149
+
150
+      return true
151
+    },
152
+    handleRemove(file, fileList) {
153
+      this.imgList = fileList;
154
+    },
155
+
156
+    handleAvatarSuccess (res) {
157
+      this.activityQuery.url = res.data
158
+      this.updateDetail({...this.dynamic, imgUrl: res.data})
159
+      this.loading.close()
160
+    },
161
+    onSubmit () {
162
+        // 新增
163
+        console.log('this.imgList[0]',this.imgList[0])
164
+        // this.activityQuery.url = this.imgList[0]
165
+        this.updateActivity(
166
+           JSON.stringify(this.activityQuery)
167
+        ).then(() => {
168
+          this.onCancel()
169
+          
170
+        })
171
+        this.$router.push({ name: "activity-list" });
172
+    },
173
+    onCancel () {
174
+      this.$router.push({name: 'dynamiclist'})
175
+    },
176
+    getDetails(){
177
+      this.activityQuery.dynamicId = this.$route.query.row
178
+        this.activityDetails(this.activityQuery).then((data) => {
179
+          console.log('55',data)
180
+        this.activityQuery.buildingId = data.buildingId
181
+        this.activityQuery.title = data.title
182
+        this.activityQuery.startDate = data.startDate
183
+        this.activityQuery.endDate = data.endDate
184
+        this.activityQuery.address = data.address
185
+        this.activityQuery.personNum = data.personNum
186
+        this.imageUrl = data.url
187
+        this.activityQuery.isEnlist = data.isEnlist
188
+        
189
+       
190
+        })
191
+    }
192
+  },
193
+  mounted () {
194
+    const _that = this
195
+    const phoneEditor = new E('#websiteEditorElem')
196
+    phoneEditor.customConfig.zIndex = 1
197
+    phoneEditor.customConfig.onchange = function (html) {
198
+      _that.dynamic = {..._that.dynamic, url: html}
199
+        _that.activityQuery.text =_that.dynamic.url
200
+    }
201
+    // phoneEditor.customConfig.uploadImgServer = this.upFileUrl
202
+    // phoneEditor.customConfig.uploadFileName = 'uploadFiles'
203
+
204
+    phoneEditor.customConfig.customUploadImg = function (files, insert) {
205
+      _that.uploadImg(files[0]).then(data => {
206
+        insert(data)
207
+      })
208
+    }
209
+    phoneEditor.customConfig.menus = [
210
+      'head',  // 标题
211
+      'bold',  // 粗体
212
+      'fontSize',  // 字号
213
+      'fontName',  // 字体
214
+      'italic',  // 斜体
215
+      'underline',  // 下划线
216
+      'strikeThrough',  // 删除线
217
+      'foreColor',  // 文字颜色
218
+      'backColor',  // 背景颜色
219
+      'justify',  // 对齐方式
220
+      'image',  // 插入图片
221
+    ]
222
+    phoneEditor.create()
223
+    this.getDetails()
224
+    this.getBuildings({
225
+      pageNum: 1,
226
+      pageSize: 100,
227
+    }).then(() => {
228
+      if ((this.$route.query.id || '') !== '') {
229
+        this.getDetail({id: this.$route.query.id}).then((data) => {
230
+          phoneEditor.txt.html(data.url)
231
+        })
232
+      }
233
+    })
234
+  }
235
+}
236
+</script>
237
+
238
+<style lang="scss">
239
+  .avatar-uploader .el-upload {
240
+    border: 1px dashed #d9d9d9;
241
+    border-radius: 6px;
242
+    cursor: pointer;
243
+    position: relative;
244
+    overflow: hidden;
245
+  }
246
+  .avatar-uploader .el-upload:hover {
247
+    border-color: #409EFF;
248
+  }
249
+  .avatar-uploader-icon {
250
+    font-size: 28px;
251
+    color: #8c939d;
252
+    width: 178px;
253
+    height: 178px;
254
+    line-height: 178px;
255
+    text-align: center;
256
+  }
257
+  .avatar {
258
+    width: 178px;
259
+    height: 178px;
260
+    display: block;
261
+  }
262
+</style>

+ 238
- 0
src/views/activity/list.vue Просмотреть файл

@@ -0,0 +1,238 @@
1
+<template>
2
+<div class="list">
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='addDynamic'>新增</el-button>
7
+        </div>
8
+        <ul>
9
+          <li>
10
+           <el-select v-model="filterData.buildingId"  placeholder="请选择">
11
+              <el-option v-for="site in buildings" :label="site.buildingName" :value="site.buildingId" :key="site.buildingId"></el-option>
12
+           </el-select>
13
+          </li>
14
+
15
+        </ul>
16
+        <el-button
17
+          size="mini"
18
+          type="primary" @click="search">查询</el-button>
19
+      </div>
20
+      <div class="moreFilter"></div>
21
+    </div>
22
+  <el-table
23
+    :data="list || []"
24
+    style="width: 100%">
25
+    <el-table-column
26
+      prop="title"
27
+      label="活动标题">
28
+    </el-table-column>
29
+    <el-table-column
30
+      prop="tel"
31
+      label="活动时间">
32
+     <template slot-scope="scope">
33
+        <span>{{ formateDate(scope.row.startDate)}} ~ {{ formateDate(scope.row.startDate)}}</span>
34
+      </template>
35
+    </el-table-column>
36
+    <el-table-column
37
+      prop="count"
38
+      label="已参加人数">
39
+    </el-table-column>
40
+    <el-table-column
41
+      prop="pvNum"
42
+      label="阅读量">
43
+      </el-table-column>
44
+      <el-table-column
45
+      prop="shareNum"
46
+      label="转发数">
47
+    </el-table-column>
48
+    <el-table-column
49
+      prop="favorNum"
50
+      label="点赞数">
51
+    </el-table-column>
52
+    <el-table-column
53
+      prop="saveNum"
54
+      label="收藏数">
55
+    </el-table-column>
56
+    <el-table-column   label="状态">
57
+      <template slot-scope="scope">
58
+      <span v-if="scope.row.isEnlist == '0'">未开始</span>
59
+      <span v-if="scope.row.isEnlist == '1'">进行中</span>
60
+      <span v-if="scope.row.isEnlist == '2'">已结束</span>
61
+      </template>
62
+    </el-table-column>
63
+    <el-table-column
64
+      fixed="right"
65
+      label="操作">
66
+      <template slot-scope="scope">
67
+        <!-- <el-button type="text" @click="toDetail(scope.row)" size="small">{{scope.row.status == 1?'停用':'启用'}}</el-button> -->
68
+         <el-button type="text" @click="getSignList(scope.row.dynamicId)" size="small" v-if="scope.row.isEnlist == '1' || scope.row.isEnlist === '2'">报名记录</el-button>
69
+         <el-button type="text" @click="toDetail(scope.row.dynamicId)" size="small" v-if="scope.row.isEnlist == '0'">编辑</el-button>
70
+        <el-button type="text" @click="finish(scope.row.dynamicId)" size="small" v-if="scope.row.isEnlist == '1'">结束活动</el-button>
71
+        <el-button type="text" @click="top(scope.row.dynamicId)" size="small">置顶</el-button>
72
+      </template>
73
+    </el-table-column>
74
+  </el-table>
75
+  <el-pagination
76
+    small
77
+    style="margin-top:10px;"
78
+    layout="prev, pager, next"
79
+    :current-page.sync="filterData.pageNum"
80
+    :pageSize="filterData.pageSize"
81
+    :total="filterData.total || 0"
82
+    @current-change="getPageList"
83
+  >
84
+  </el-pagination>
85
+</div>
86
+</template>
87
+
88
+<script>
89
+import dayjs from 'dayjs'
90
+import { createNamespacedHelpers } from "vuex";
91
+const { mapState: mapBuildingState, mapActions: mapBuildingActions } = createNamespacedHelpers('building')
92
+const { mapActions: mapActivity } = createNamespacedHelpers("activity");
93
+
94
+export default {
95
+  name: "consultant-list",
96
+  data() {
97
+    return {
98
+      filterData: {
99
+        dynamicId:'',
100
+        name: "",
101
+        phone: "",
102
+        buildingId:'',
103
+        pageNum:1,
104
+        pageSize:10,
105
+        total:0,
106
+        top:''
107
+      },
108
+      
109
+      buildingForm: {
110
+        pageNum: 1,
111
+        pageSize: 100
112
+      },
113
+      list: [],
114
+      buildings:[],
115
+      pageNavi: {
116
+        current: 1,
117
+        pageSize: 10,
118
+        total: 0
119
+      },
120
+      searchName: ""
121
+    };
122
+  },
123
+  computed: {},
124
+  methods: {
125
+        ...mapBuildingActions([
126
+      'getBuildings'
127
+    ]),
128
+    ...mapActivity([
129
+      "getActivityList",
130
+      'finishActivity'
131
+      ]),
132
+    getList() {
133
+      this.getActivityList(this.filterData,this.filterData.pageSize,this.filterData.pageNum).then(res => {
134
+          this.list = res.list;
135
+          this.filterData.pageSize =res.pageSize 
136
+          this.filterData.pageNum =res.pageNum
137
+          this.filterData.total =res.total
138
+        })
139
+        .catch(err => {
140
+          this.$notify.error(err.msg || err.message);
141
+        });
142
+    },
143
+    // 结束活动
144
+    finish(id){
145
+      this.filterData.dynamicId = id
146
+          this.finishActivity(
147
+          JSON.stringify(this.filterData)
148
+        ).then((res) => {
149
+           this.getList();
150
+          this.getBuildList()   
151
+        })
152
+       
153
+    },
154
+    top(id){
155
+          this.filterData.dynamicId = id
156
+          this.filterData.top = 1
157
+          this.finishActivity(
158
+          JSON.stringify(this.filterData)
159
+        ).then((res) => {
160
+           this.getList();
161
+          this.getBuildList()   
162
+        })  
163
+    },
164
+    addDynamic() {
165
+      this.$router.push({ name: "activity-add" });
166
+      console.log('11111')
167
+    },
168
+    toDetail(row) {
169
+      this.$router.push({ name: "activity-edit",query: { row }});
170
+      console.log('row',row)
171
+    },
172
+    search() {
173
+      this.filterData.current = 1;
174
+      this.getList();
175
+    },
176
+     getBuildList() {
177
+        this.$store.dispatch('building/getBuildings', this.buildingForm).then((res) => {
178
+            this.buildings = res.records  
179
+        }).catch(() => {
180
+             console.log('building/getBuildings err')
181
+        })
182
+    },
183
+    getPageList(){
184
+       this.getList();
185
+    },
186
+    getSignList(id){
187
+      this.$router.push({ name: "activity-signList",query: { id } }); 
188
+    },
189
+    formateDate(dt) {
190
+      return !dt ? '' : dayjs(dt).format('YYYY-MM-DD HH:mm')
191
+    },
192
+  },
193
+  created() {
194
+    this.pageNavi.current = this.$route.query.page || 1;
195
+    this.getList();
196
+    this.getBuildList()
197
+  }
198
+};
199
+</script>
200
+
201
+<style lang="scss" scoped>
202
+.list {
203
+  .header {
204
+    width: 50px;
205
+    height: 50px;
206
+    border-radius: 50%;
207
+  }
208
+}
209
+.system-table-search {
210
+  width: calc(100% - 40px);
211
+  margin: 20px auto 0;
212
+}
213
+
214
+.system-table-search li {
215
+  margin-right: 20px;
216
+}
217
+
218
+.system-table-search ul {
219
+  font-size: 0;
220
+  white-space: nowrap;
221
+}
222
+
223
+.system-table-search ul > li {
224
+  display: inline-block;
225
+}
226
+
227
+.flex-h {
228
+  display: flex;
229
+  align-items: center;
230
+}
231
+
232
+.flex-item {
233
+  flex: 1;
234
+  -webkit-flex: 1;
235
+  position: relative;
236
+  overflow: hidden;
237
+}
238
+</style>

+ 133
- 0
src/views/activity/signList.vue Просмотреть файл

@@ -0,0 +1,133 @@
1
+<template>
2
+<div class="list">
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='activityLiest'>返回</el-button>
7
+        </div>
8
+      </div>
9
+      <div class="moreFilter"></div>
10
+    </div>
11
+  <el-table
12
+    :data="list || []"
13
+    style="width: 100%">
14
+    <el-table-column
15
+      prop="name"
16
+      label="姓名">
17
+    </el-table-column>
18
+    <el-table-column
19
+      prop="phone"
20
+      label="手机号">
21
+    </el-table-column>
22
+    <el-table-column
23
+      prop="createDate"
24
+      label="报名时间">
25
+      <template slot-scope="scope">
26
+        <span>{{ formateDate(scope.row.createDate)}}</span>
27
+      </template>
28
+    </el-table-column>
29
+  </el-table>
30
+  <el-pagination
31
+    small
32
+    style="margin-top:10px;"
33
+    layout="prev, pager, next"
34
+    :current-page.sync="filterData.pageNum"
35
+    :pageSize="filterData.pageSize"
36
+    :total="filterData.total || 0"
37
+    @current-change="getPageList" >
38
+  </el-pagination>
39
+</div>
40
+</template>
41
+
42
+<script>
43
+import dayjs from 'dayjs'
44
+import { createNamespacedHelpers } from "vuex";
45
+const { mapActions: mapActivity } = createNamespacedHelpers("activity");
46
+
47
+export default {
48
+  name: "consultant-list",
49
+  data() {
50
+    return {
51
+      filterData: {
52
+        name: "",
53
+        phone: "",
54
+        buildingId:'',
55
+        pageNum:1,
56
+        pageSize:10,
57
+        total:0,
58
+        dynamicId:'',
59
+      },
60
+      list:[],
61
+    };
62
+  },
63
+  computed: {},
64
+  methods: {
65
+    ...mapActivity([
66
+        "getSignList"
67
+    ]),
68
+    getList() {
69
+      this.getSignList(this.filterData,this.filterData.pageSize,this.filterData.pageNum).then(res => {
70
+          this.list = res.list.data
71
+          this.filterData.pageSize =res.pageSize 
72
+          this.filterData.pageNum =res.pageNum
73
+          this.filterData.total =res.total
74
+        }).catch(err => {
75
+          this.$notify.error(err.msg || err.message);
76
+        });
77
+    },
78
+    // 活动列表
79
+    activityLiest(){
80
+     this.$router.push({ name: "activity-list" });
81
+    },
82
+    getPageList(){
83
+       this.getList();
84
+    },
85
+    formateDate(dt) {
86
+      return !dt ? '' : dayjs(dt).format('YYYY-MM-DD HH:mm')
87
+    },
88
+  },
89
+  created() {
90
+    this.filterData.dynamicId = this.$route.query.id
91
+    this.getList();
92
+  }
93
+};
94
+</script>
95
+
96
+<style lang="scss" scoped>
97
+.list {
98
+  .header {
99
+    width: 50px;
100
+    height: 50px;
101
+    border-radius: 50%;
102
+  }
103
+}
104
+.system-table-search {
105
+  width: calc(100% - 40px);
106
+  margin: 20px auto 0;
107
+}
108
+
109
+.system-table-search li {
110
+  margin-right: 20px;
111
+}
112
+
113
+.system-table-search ul {
114
+  font-size: 0;
115
+  white-space: nowrap;
116
+}
117
+
118
+.system-table-search ul > li {
119
+  display: inline-block;
120
+}
121
+
122
+.flex-h {
123
+  display: flex;
124
+  align-items: center;
125
+}
126
+
127
+.flex-item {
128
+  flex: 1;
129
+  -webkit-flex: 1;
130
+  position: relative;
131
+  overflow: hidden;
132
+}
133
+</style>

+ 94
- 67
src/views/customer/editRecommend.vue Просмотреть файл

@@ -3,82 +3,91 @@
3 3
     <div class="form-wrapper">
4 4
       <el-form label-width="200px" :model="detail">
5 5
         <el-form-item label="意向项目:">
6
-          <el-input v-model="detail.name"></el-input>
6
+          <el-input v-model="detail.intention"></el-input>
7 7
         </el-form-item>
8 8
         <el-form-item label="客户照片:">
9
-        <el-upload
10
-            :action="upFileUrl"
11
-            name='file'
12
-            list-type="picture-card"
13
-            :headers="uploadHeaders"
14
-            :file-list="imgList"
15
-            :show-file-list="true"
16
-            :before-upload="beforeImgUpload"
17
-            :on-success="handleAvatarSuccess"
18
-            :on-remove="handleRemove">
19
-            <i class="el-icon-plus"></i>
9
+          <el-upload
10
+                  :headers="uploadHeaders"
11
+                  :action="upFileUrl"
12
+                  :show-file-list="false"
13
+                  :on-success="handleAvatarSuccess">
14
+            <img v-if="imageUrl" :src="imageUrl" class="avatar">
15
+            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
20 16
           </el-upload>
21
-          <el-dialog :visible.sync="dialogVisible">
22
-            <img width="100%" :src="dialogImageUrl" alt="">
23
-          </el-dialog>
24 17
       </el-form-item>
25 18
         <el-form-item label="客户姓名:">
26
-          <el-input v-model="detail.company"></el-input>
19
+          <el-input v-model="detail.name"></el-input>
27 20
         </el-form-item>
28 21
         <el-form-item label="客户电话:">
29
-          <el-input v-model="detail.department"></el-input>
22
+          <el-input v-model="detail.phone"></el-input>
30 23
         </el-form-item>
31 24
         <el-form-item label="客户性别:">
32
-          <el-radio-group v-model="detail.isMain">
25
+          <el-radio-group v-model="detail.sex">
33 26
             <el-radio :label="1">男</el-radio>
34 27
             <el-radio :label="0">女</el-radio>
35 28
           </el-radio-group>
36 29
         </el-form-item>
37 30
         <el-form-item label="预约到访时间:">
38
-          <el-input v-model="detail.department"></el-input>
31
+          <el-date-picker
32
+                  v-model="detail.appointmentTime"
33
+                  type="datetime"
34
+                  placeholder="选择日期时间">
35
+          </el-date-picker>
39 36
         </el-form-item>
40 37
         <el-form-item label="到访人数:">
41
-          <el-input v-model="detail.department"></el-input>
38
+          <el-input v-model="detail.visiteNum"></el-input>
42 39
         </el-form-item>
43 40
         <el-form-item label="客户描述:">
44
-            <el-input type="textarea" :rows="5"  v-model="detail.introduction"></el-input>
41
+            <el-input type="textarea" :rows="5"  v-model="detail.describe"></el-input>
45 42
         </el-form-item>
46 43
         <el-form-item label="物业类型:">
47
-          <el-input v-model="detail.department"></el-input>
44
+          <el-input v-model="detail.realtyManageType"></el-input>
48 45
         </el-form-item>
49 46
         <el-form-item label="需求类型:">
50
-          <el-input v-model="detail.department"></el-input>
47
+          <el-input v-model="detail.demandType"></el-input>
51 48
         </el-form-item>
52 49
         <el-form-item label="价格区间:">
53
-          <el-input v-model="detail.department"></el-input>
50
+          <el-input v-model="detail.priceRange"></el-input>
54 51
         </el-form-item>
55 52
         <el-form-item label="报备日期:">
56
-          <el-input v-model="detail.department"></el-input>
53
+          <el-date-picker
54
+                  v-model="detail.reportDate"
55
+                  type="datetime"
56
+                  placeholder="选择日期时间">
57
+          </el-date-picker>
57 58
         </el-form-item>
58 59
         <el-form-item label="状态:">
59
-          <el-select v-model="detail.buildings" placeholder="请选择">
60
-            <el-option v-for="(build,i) in buildings.list || []" :key="i" :label="build.buildingName" :value="build.buildingId"></el-option>
60
+          <el-select v-model="detail.status" placeholder="请选择">
61
+            <el-option v-for="(item,i) in gridData || []" :key="i" :label="item.name" :value="item.value"></el-option>
61 62
           </el-select>
62 63
         </el-form-item>
63 64
         <el-form-item label="归属置业顾问:">
64
-          <p style="margin:0">{{consultant}}<span @click="dialogTableVisible=true" class="choose">请选择</span></p>
65
+          <p style="margin:0">{{detail.consultantName}}<span @click="dialogTableVisible=true" class="choose">请选择</span></p>
65 66
         </el-form-item>
66 67
         <el-form-item>
67 68
           <el-button type="primary" @click="submitForm">修改并审核通过</el-button>
68 69
           <el-button @click="$router.go(-1)">驳回</el-button>
69 70
         </el-form-item>
70
-        <el-dialog title="选择置业顾问" :visible.sync="dialogTableVisible">
71
-      <el-table :data="gridData">
72
-        <el-table-column property="date" label="姓名"></el-table-column>
73
-        <el-table-column property="name" label="电话"></el-table-column>
74
-        <el-table-column property="name" label="部门"></el-table-column>
75
-        <el-table-column property="name" label="岗位"></el-table-column>
71
+    <el-dialog title="选择置业顾问" :visible.sync="dialogTableVisible">
72
+      <el-table :data="consultantList">
73
+        <el-table-column property="name" label="姓名"></el-table-column>
74
+        <el-table-column property="phone" label="电话"></el-table-column>
75
+        <el-table-column property="department" label="部门"></el-table-column>
76
+        <el-table-column property="post" label="岗位"></el-table-column>
76 77
         <el-table-column fixed="right" label="操作">
77 78
           <template slot-scope="scope">
78 79
             <el-button type="text" @click="handleDel(scope.row)" size="small">选择</el-button>
79 80
           </template>
80 81
         </el-table-column>
81 82
       </el-table>
83
+          <el-pagination
84
+                  @size-change="dialogHandleSizeChange"
85
+                  @current-change="dialogHandleCurrentChange"
86
+                  :current-page.sync="dialogForm.pageNumber"
87
+                  :page-size="dialogForm.pageSize"
88
+                  layout="total, prev, pager, next"
89
+                  :total="dialogTotal">
90
+          </el-pagination>
82 91
     </el-dialog>
83 92
       </el-form>
84 93
     </div>
@@ -101,42 +110,52 @@ export default {
101 110
     return {
102 111
       upFileUrl: apis.file.upload.url,
103 112
       detail: {
113
+        customerId: '',
114
+        consultantName: '',
104 115
         name: undefined,
105 116
         company: undefined,
106 117
         department: undefined,
107 118
         post: undefined,
108 119
         tel: undefined,
109 120
         photo: undefined,
110
-        status: 1,
111
-        buildings: []
121
+        status: '1',
122
+        buildings: [],
123
+        realtyConsultant: ''
124
+      },
125
+      dialogForm: {
126
+        pageNumber: 1,
127
+        pageSize: 100
112 128
       },
113
-      imgList: [],
129
+      dialogTotal: 0,
130
+      consultantList: [],
131
+      imageUrl: '',
114 132
       dialogVisible: false,
115 133
       dialogImageUrl: "",
116 134
       dialogTableVisible: false, //选择置业顾问弹框
117 135
       consultant:"",
118 136
       gridData: [
119 137
         {
120
-          date: "2016-05-02",
121
-          name: "王小虎"
138
+          name: "报备",
139
+          value: '1'
122 140
         },
123 141
         {
124
-          date: "2016-05-04",
125
-          name: "王小虎"
142
+          name: "到访",
143
+          value: '2'
126 144
         },
127 145
         {
128
-          date: "2016-05-01",
129
-          name: "王小虎"
146
+          name: "认购",
147
+          value: '3'
130 148
         },
131 149
         {
132
-          date: "2016-05-03",
133
-          name: "王小虎"
150
+          name: "签约",
151
+          value: '4'
134 152
         }
135 153
       ]
136 154
     };
137 155
   },
138 156
   created() {
139 157
     this.init();
158
+    this.getConsultantsList()
140 159
   },
141 160
   computed: {
142 161
     ...mapBuildingState({
@@ -154,9 +173,12 @@ export default {
154 173
     ...mapPersonActions(["getConsultant", "editConsultant"]),
155 174
 
156 175
     init() {
157
-      if (this.$route.params.id) {
158
-        this.getConsultant({ id: this.$route.params.id }).then(data => {
176
+      this.detail.customerId = this.$route.query.id
177
+      if (this.detail.customerId !== undefined) {
178
+        this.$store.dispatch('customer/getRecommendCustomersGetById',this.detail).then(data => {
159 179
           this.detail = data;
180
+          this.dialogImageUrl = data.picture
181
+          this.imageUrl = data.picture
160 182
         });
161 183
       }
162 184
     },
@@ -171,7 +193,8 @@ export default {
171 193
             type: "success",
172 194
             message: "选择成功!"
173 195
           });
174
-          this.consultant = row.name
196
+          this.detail.realtyConsultant = row.personId
197
+          this.detail.consultantName = row.name
175 198
           this.dialogTableVisible = false;
176 199
         })
177 200
         .catch(() => {
@@ -200,12 +223,8 @@ export default {
200 223
       return true;
201 224
     },
202 225
     handleAvatarSuccess(res) {
203
-      this.imgList = [
204
-        ...this.imgList,
205
-        {
206
-          url: res.data
207
-        }
208
-      ];
226
+      this.imageUrl = res.data
227
+      this.detail.picture = res.data
209 228
       this.hideLoadding();
210 229
     },
211 230
     handleRemove(file, fileList) {
@@ -213,7 +232,7 @@ export default {
213 232
     },
214 233
     submitForm() {
215 234
       this.showLoadding("保存中...");
216
-      this.editConsultant(this.detail)
235
+      this.$store.dispatch('customer/getRecommendCustomersUpdate',this.detail)
217 236
         .then(res => {
218 237
           if (res.personId) {
219 238
             this.detail = res;
@@ -221,6 +240,7 @@ export default {
221 240
 
222 241
           this.hideLoadding();
223 242
           this.$notify.info("保存成功");
243
+          this.$router.go(-1)
224 244
         })
225 245
         .catch(err => {
226 246
           this.hideLoadding();
@@ -239,20 +259,27 @@ export default {
239 259
 
240 260
     hideLoadding() {
241 261
       if (this.loading) this.loading.close();
262
+    },
263
+    getConsultantsList() {
264
+      this.$store.dispatch('persons/getConsultants', this.dialogForm).then((res) => {
265
+        this.consultantList = res.records
266
+        this.dialogForm.pageNumber = res.current
267
+        this.dialogForm.pageSize = res.size
268
+        this.dialogTotal = res.total
269
+      }).catch(()=> {
270
+        console.log('persons/getConsultants err')
271
+      })
272
+    },
273
+    dialogHandleSizeChange(value) {
274
+      this.dialogForm.pageSize = value
275
+      this.getConsultantsList()
276
+    },
277
+    dialogHandleCurrentChange(value) {
278
+      this.dialogForm.pageNumber = 1
279
+      this.dialogForm.pageSize = value
280
+      this.getConsultantsList()
242 281
     }
243 282
   },
244
-  mounted() {
245
-    const _that = this;
246
-
247
-    this.getBuildings({
248
-      pageNum: 1,
249
-      pageSize: 100
250
-    }).then(() => {
251
-      if ((this.$route.query.id || "") !== "") {
252
-        this.getDetail({ id: this.$route.query.id }).then(data => {});
253
-      }
254
-    });
255
-  }
256 283
 };
257 284
 </script>
258 285
 

+ 203
- 47
src/views/customer/recommendCustomer.vue Просмотреть файл

@@ -5,50 +5,49 @@
5 5
         <ul>
6 6
           <li>
7 7
             <span>姓名</span>
8
-            <el-input v-model="name" ></el-input>
8
+            <el-input v-model="form.name" ></el-input>
9 9
           </li>
10 10
           <li>
11 11
             <span>电话</span>
12
-            <el-input v-model="name" ></el-input>
12
+            <el-input v-model="form.tel" ></el-input>
13 13
           </li>
14 14
           <li>
15 15
             <span>推荐人</span>
16
-            <el-input v-model="name" ></el-input>
16
+            <el-input v-model="form.consultName" ></el-input>
17 17
           </li>
18 18
           <li>
19 19
             <span>推荐人电话</span>
20
-            <el-input v-model="name" ></el-input>
21
-          </li>
22
-          <li>
23
-            <span>状态</span>
24
-            <el-select v-model="name" placeholder="请选择">
25
-              <el-option v-for="(item,i) in gridData || []" :key="i" :label="item.name" :value="item.id"></el-option>
26
-            </el-select>
20
+            <el-input v-model="form.consultTel" ></el-input>
27 21
           </li>
22
+<!--          <li>-->
23
+<!--            <span>状态</span>-->
24
+<!--            <el-select v-model="form.status" placeholder="请选择">-->
25
+<!--              <el-option v-for="(item,i) in gridData || []" :key="i" :label="item.name" :value="item.value"></el-option>-->
26
+<!--            </el-select>-->
27
+<!--          </li>-->
28 28
         </ul>
29 29
         <el-button
30 30
           size="mini"
31 31
           type="primary" @click="search">查询</el-button>
32 32
       </div>
33 33
     </div>
34
-    <el-table :data="dynamics.list || []" style="width: 100%">
34
+    <el-table :data="list || []"
35
+              border
36
+              style="width: 100%">
35 37
       <el-table-column
36 38
         type="index"
37 39
         width="50">
38
-        <template slot-scope="scope">
39
-          <span>{{ GetIndex(scope.$index) }}</span>
40
-        </template>
41 40
       </el-table-column>
42 41
       <el-table-column
43 42
         label="头像">
44 43
         <template slot-scope="scope">
45 44
           <div class="header">
46
-            <img :src="scope.row.imgUrl" alt="" />
45
+            <img :src="scope.row.picture" alt="" />
47 46
           </div>
48 47
         </template>
49 48
       </el-table-column>
50 49
       <el-table-column
51
-        prop="title"
50
+        prop="name"
52 51
         label="姓名">
53 52
       </el-table-column>
54 53
       <el-table-column
@@ -59,29 +58,39 @@
59 58
         prop="sex"
60 59
         width="100"
61 60
         label="性别">
61
+        <template slot-scope="scope">{{ scope.row.sex === 1 ? '男' : '女' }}</template>
62 62
       </el-table-column>
63 63
       <el-table-column
64
-        prop="sex"
64
+        prop="intention"
65 65
         label="意向项目">
66 66
       </el-table-column>
67 67
       <el-table-column  label="推荐人">
68 68
         <template slot-scope="scope">
69 69
           <span>{{scope.row.name}}</span>
70
-          <p>{{scope.row.tel}}</p>
70
+          <p>{{scope.row.phone}}</p>
71 71
         </template>
72 72
       </el-table-column>
73 73
       <el-table-column
74
-        prop="createDate"
74
+        prop="reportDate"
75 75
         label="推荐时间">
76
+          <template slot-scope="scope">{{ formateDate(scope.row.reportDate) }}</template>
76 77
       </el-table-column>
77 78
       <el-table-column  label="状态">
78 79
         <template slot-scope="scope">
79
-          <span>{{scope.row.status==1?'已通过':scope.row.status==0?'已驳回':'未审核'}}</span>
80
+          <span>{{scope.row.status == 1 ? '报备': scope.row.status == 2 ? '到访' : scope.row.status == 3 ? '认购' : '签约' }}</span>
80 81
         </template>
81 82
       </el-table-column>
82
-      <el-table-column fixed="right" width="100" label="操作">
83
+      <el-table-column fixed="right" width="200" label="操作">
83 84
         <template slot-scope="scope">
84
-          <el-button type="text" @click="toEditRecommend(scope.row)" size="small">{{scope.row.status==1?'查看详情':'审核'}}</el-button>
85
+          <router-link :to="{ name:'editRecommend', query: { id: scope.row.customerId } }">编辑</router-link>
86
+          &nbsp;
87
+          <a href="javascript: void(0);" @click="showDialogConsultants(scope.row)">调整归属</a>
88
+          &nbsp;
89
+          <router-link :to="{ name:'editRecommend', query: { id: scope.row.customerId } }">积分记录</router-link>
90
+          &nbsp;
91
+          <a href="javascript: void(0);" @click="showRecommendCustomerList(scope.row)">推荐客户</a>
92
+          &nbsp;
93
+          <router-link :to="{ name:'editRecommend', query: { id: scope.row.customerId } }">查看详情</router-link>
85 94
         </template>
86 95
       </el-table-column>
87 96
     </el-table>
@@ -89,15 +98,67 @@
89 98
       small
90 99
       style="margin-top:10px;"
91 100
       layout="prev, pager, next"
92
-      :current-page.sync="currentPage"
93
-      :pageSize="pageSize"
101
+      :current-page.sync="form.pageNumber"
102
+      :pageSize="form.pageSize"
94 103
       @current-change="getList"
95 104
     >
96 105
     </el-pagination>
106
+
107
+
108
+    <el-dialog title="选择置业顾问" :visible.sync="dialogTableVisible">
109
+      <el-table :data="consultantList">
110
+        <el-table-column property="name" label="姓名"></el-table-column>
111
+        <el-table-column property="phone" label="电话"></el-table-column>
112
+        <el-table-column property="department" label="部门"></el-table-column>
113
+        <el-table-column property="post" label="岗位"></el-table-column>
114
+        <el-table-column fixed="right" label="操作">
115
+          <template slot-scope="scope">
116
+<!--            <el-button type="text" @click="handleDel(scope.row)" size="small">选择</el-button>-->
117
+            <el-radio v-model="dialogConsultantForm.realtyConsultant" :label="scope.row.personId"></el-radio>
118
+          </template>
119
+        </el-table-column>
120
+      </el-table>
121
+      <el-pagination
122
+              @size-change="dialogHandleSizeChange"
123
+              @current-change="dialogHandleCurrentChange"
124
+              :current-page.sync="dialogForm.pageNumber"
125
+              :page-size="dialogForm.pageSize"
126
+              layout="total, prev, pager, next"
127
+              :total="dialogTotal">
128
+      </el-pagination>
129
+      <el-button type="primary" @click="handleDel" size="small">确定</el-button>
130
+    </el-dialog>
131
+
132
+
133
+    <el-dialog title="推荐客户" :visible.sync="dialogRecommendedTableVisible">
134
+      <el-table :data="recommendedConsultantList">
135
+        <el-table-column property="name" label="姓名"></el-table-column>
136
+        <el-table-column property="phone" label="电话"></el-table-column>
137
+        <el-table-column property="sex" label="性别">
138
+          <template slot-scope="scope"> {{ scope.row.sex === 1 ? '男' : '女' }}</template>
139
+        </el-table-column>
140
+        <el-table-column property="intention" label="意向项目"></el-table-column>
141
+        <el-table-column property="post" label="推荐时间"></el-table-column>
142
+        <el-table-column fixed="right" label="状态">
143
+          <template slot-scope="scope">
144
+            {{ scope.row.status == 1 ? '报备': scope.row.status == 2 ? '到访' : scope.row.status == 3 ? '认购' : scope.row.status == 4 ? '签约' : '无效' }}
145
+          </template>
146
+        </el-table-column>
147
+      </el-table>
148
+      <el-pagination
149
+              @size-change="recommendedDialogHandleSizeChange"
150
+              @current-change="recommendedDialogHandleCurrentChange"
151
+              :current-page.sync="recommendedDialogConsultantForm.pageNumber"
152
+              :page-size="recommendedDialogConsultantForm.pageSize"
153
+              layout="total, prev, pager, next"
154
+              :total="recommendedDialogTotal">
155
+      </el-pagination>
156
+    </el-dialog>
97 157
   </div>
98 158
 </template>
99 159
 <script>
100 160
 import { createNamespacedHelpers } from "vuex";
161
+import dayjs from 'dayjs'
101 162
 const {
102 163
   mapState: mapDynamicState,
103 164
   mapActions: mapDynamicActions
@@ -109,9 +170,16 @@ const {
109 170
 export default {
110 171
   data() {
111 172
     return {
112
-      pageSize: 20,
113
-      currentPage: 1,
114
-      name: "",
173
+      form: {
174
+        pageSize: 10,
175
+        pageNumber: 1,
176
+        name: "",
177
+        consultName: '',
178
+        consultTel: '',
179
+        status: ''
180
+      },
181
+      list: [],
182
+      total: 0,
115 183
       sex: "",
116 184
       phone: "",
117 185
       picture: "",
@@ -128,26 +196,42 @@ export default {
128 196
       personId: "",
129 197
       gridData: [
130 198
         {
131
-          date: "2016-05-02",
132
-          name: "王小虎",
133
-          id: "1"
199
+          name: "报备",
200
+          value: 1
134 201
         },
135 202
         {
136
-          date: "2016-05-04",
137
-          name: "王小虎",
138
-          id: "2"
203
+          name: "到访",
204
+          value: 2
139 205
         },
140 206
         {
141
-          date: "2016-05-01",
142
-          name: "王小虎",
143
-          id: "3"
207
+          name: "认购",
208
+          value: 3
144 209
         },
145 210
         {
146
-          date: "2016-05-03",
147
-          name: "王小虎",
148
-          id: "4"
211
+          name: "签约",
212
+          value: 4
149 213
         }
150
-      ]
214
+      ],
215
+      dialogTableVisible: false, //选择置业顾问弹框
216
+      consultantList: [],
217
+      dialogForm: {
218
+        pageNumber: 1,
219
+        pageSize: 10
220
+      },
221
+      dialogTotal: 0,
222
+      dialogConsultantForm: {
223
+        customerId: '', // 客户Id
224
+        realtyConsultant: '' // 置业顾问
225
+      },
226
+      // 推荐客户
227
+      dialogRecommendedTableVisible: false,
228
+      recommendedConsultantList: [],
229
+      recommendedDialogTotal: 0,
230
+      recommendedDialogConsultantForm: {
231
+        customerId: '', // 客户Id
232
+        pageNumber: 1,
233
+        pageSize: 10
234
+      },
151 235
     };
152 236
   },
153 237
   computed: {
@@ -162,7 +246,7 @@ export default {
162 246
     this.getList();
163 247
   },
164 248
   methods: {
165
-    ...mapCustomerActions(["getCustomers", "getDetail"]),
249
+    ...mapCustomerActions(["getCustomers", "getDetail", "getRecommendCustomers"]),
166 250
     ...mapDynamicActions([
167 251
       "getDynamics",
168 252
       "setDetailNull",
@@ -173,12 +257,17 @@ export default {
173 257
     GetIndex(inx) {
174 258
       return (this.currentPage - 1) * this.pageSize + inx + 1;
175 259
     },
260
+    formateDate(dt) {
261
+      return !dt ? '' : dayjs(dt).format('YYYY-MM-DD HH:mm')
262
+    },
176 263
     getList() {
177
-      this.getDynamics({
178
-        pageNum: this.currentPage,
179
-        pageSize: this.pageSize,
180
-        name: this.name,
181
-        buildingId: this.buildingId
264
+      this.getRecommendCustomers(this.form).then((res) => {
265
+        this.list = res.records
266
+        this.form.pageSize = res.size
267
+        this.form.pageNumber = res.current
268
+        this.total = res.total
269
+      }).catch(() => {
270
+        console.log('getRecommendCustomers err')
182 271
       });
183 272
     },
184 273
 
@@ -214,7 +303,74 @@ export default {
214 303
     search() {
215 304
       this.currentPage = 1;
216 305
       this.getList();
217
-    }
306
+    },
307
+    handleDel() {
308
+      this.dialogSubmitForm(this.dialogConsultantForm.customerId, this.dialogConsultantForm.realtyConsultant)
309
+      this.dialogTableVisible = false
310
+    },
311
+    dialogHandleSizeChange(value) {
312
+      this.dialogForm.pageSize = value
313
+      this.getConsultantsList()
314
+    },
315
+    dialogHandleCurrentChange(value) {
316
+      this.dialogForm.pageNumber = 1
317
+      this.dialogForm.pageSize = value
318
+      this.getConsultantsList()
319
+    },
320
+    getConsultantsList() {
321
+      this.$store.dispatch('persons/getConsultants', this.dialogForm).then((res) => {
322
+        this.consultantList = res.records
323
+        this.dialogForm.pageNumber = res.current
324
+        this.dialogForm.pageSize = res.size
325
+        this.dialogTotal = res.total
326
+      }).catch(()=> {
327
+        console.log('persons/getConsultants err')
328
+      })
329
+    },
330
+    dialogSubmitForm(customerId, realtyConsultant) {
331
+      console.log('提交', this.dialogConsultantForm)
332
+      this.$store.dispatch('customer/getRecommendCustomersUpdate',{customerId:  customerId, realtyConsultant:  realtyConsultant})
333
+              .then(res => {
334
+                if (res.personId) {
335
+                  this.detail = res;
336
+                }
337
+
338
+                this.$notify.info("保存成功");
339
+              })
340
+              .catch(err => {
341
+                this.$notify.error(err.message);
342
+              });
343
+    },
344
+    showDialogConsultants(row) {
345
+      this.dialogTableVisible = true
346
+      this.dialogConsultantForm.customerId = row.customerId
347
+      this.dialogConsultantForm.realtyConsultant = row.realtyConsultant
348
+      this.getConsultantsList()
349
+    },
350
+    getRecommendCustomerList() {
351
+      this.$store.dispatch('customer/recommendCustomerList', this.recommendedDialogConsultantForm).then((res) => {
352
+        this.recommendedConsultantList = res.records
353
+        this.recommendedDialogConsultantForm.pageNumber = res.current
354
+        this.recommendedDialogConsultantForm.pageSize = res.size
355
+        this.recommendedDialogTotal = res.total
356
+      }).catch(()=> {
357
+        console.log('persons/getConsultants err')
358
+      })
359
+    },
360
+    showRecommendCustomerList(row) {
361
+      this.dialogRecommendedTableVisible = true
362
+      this.recommendedDialogConsultantForm.customerId = row.customerId
363
+      this.getRecommendCustomerList()
364
+    },
365
+    recommendedDialogHandleSizeChange(value) {
366
+      this.recommendedDialogConsultantForm.pageSize = value
367
+      this.getRecommendCustomerList()
368
+    },
369
+    recommendedDialogHandleCurrentChange(value) {
370
+      this.recommendedDialogConsultantForm.pageNumber = 1
371
+      this.recommendedDialogConsultantForm.pageSize = value
372
+      this.getConsultantsList()
373
+    },
218 374
   }
219 375
 };
220 376
 </script>

+ 8
- 8
src/views/exchange/list.vue Просмотреть файл

@@ -2,15 +2,15 @@
2 2
 <div class="list">
3 3
         <div class="system-table-search">
4 4
       <div class="flex-h">
5
-        <div class="flex-item flex-h">
5
+        <!-- <div class="flex-item flex-h">
6 6
           <el-button size="mini" type="success" @click='addGoods'>新增</el-button>
7
-        </div>
7
+        </div> -->
8 8
         <el-form :inline="true">
9
-          <el-form-item v-model="filterData.personName" label="用户姓名">
10
-            <el-input placeholder="用户姓名"></el-input>
9
+          <el-form-item label="用户姓名">
10
+            <el-input v-model="filterData.personName" placeholder="用户姓名"></el-input>
11 11
           </el-form-item>
12
-          <el-form-item v-model="filterData.phone" label="手机号">
13
-            <el-input placeholder="手机号"></el-input>
12
+          <el-form-item label="手机号">
13
+            <el-input v-model="filterData.phone" placeholder="手机号"></el-input>
14 14
           </el-form-item>
15 15
           <el-form-item label="用户类型">
16 16
             <el-select v-model="filterData.personType" placeholder="用户类型">
@@ -19,8 +19,8 @@
19 19
               <el-option label="经纪人" value="estate agent"></el-option>
20 20
             </el-select>
21 21
           </el-form-item>
22
-          <el-form-item v-model="filterData.targetName" label="商品名称">
23
-            <el-input placeholder="商品名称"></el-input>
22
+          <el-form-item label="商品名称">
23
+            <el-input v-model="filterData.targetName" placeholder="商品名称"></el-input>
24 24
           </el-form-item>
25 25
           <el-form-item label="兑换时间">
26 26
             <el-date-picker

+ 234
- 0
src/views/exchange/verify.vue Просмотреть файл

@@ -0,0 +1,234 @@
1
+<template>
2
+<el-tabs type="border-card" class="border-card">
3
+  <el-tab-pane label="扫码核销">
4
+    <el-row>
5
+      <el-col :span="8">
6
+        <div class="grid-content">
7
+          <i class="iconfont icon-erweima"></i>
8
+          <p>1</p>
9
+          <p>请用户出示核销的二维码</p>
10
+          <p>请将网页输入法切换成英文</p>
11
+          
12
+        </div>
13
+      </el-col>
14
+      <el-col :span="8">
15
+        <div class="grid-content ">
16
+          <i class="iconfont icon-iconfontscan"></i>
17
+          <p>2</p>
18
+          <p>点击“立即核销”按钮</p>
19
+          <p>使用扫码枪扫描客户二维码</p>
20
+        </div>
21
+      </el-col>
22
+      <el-col :span="8">
23
+        <div class="grid-content">
24
+          <i class="iconfont icon-iconfontzhizuobiaozhun0261"></i>
25
+          <p>3</p>
26
+          <p>根据提示进行核销操作</p>
27
+        </div>
28
+      </el-col>
29
+    </el-row>
30
+    <el-button type="danger" style="margin:20px auto 0 auto;display:block" round>立即核销</el-button>
31
+    
32
+  </el-tab-pane>
33
+  <el-tab-pane label="手机号核销">
34
+    <el-row>
35
+      <el-col :span="12">
36
+        <div class="grid-content">
37
+          <i class="iconfont icon-erweima"></i>
38
+          <p>1</p>
39
+          <p>请输入用户的手机号</p>
40
+          </div>
41
+      </el-col>
42
+      <el-col :span="12">
43
+        <div class="grid-content">
44
+          <i class="iconfont icon-iconfontzhizuobiaozhun0261"></i>
45
+          <p>2</p>
46
+          <p>点击“立即核销”按钮</p>
47
+        </div>
48
+      </el-col>
49
+    </el-row>
50
+    <el-form :inline="true" style="text-align: center;">
51
+      <el-form-item label="">
52
+        <el-input v-model="verifyPhone" placeholder="请输入手机号"></el-input>
53
+      </el-form-item>
54
+      <el-form-item>
55
+        <el-button type="danger" @click="verifyTel">立即核销</el-button>
56
+      </el-form-item>
57
+    </el-form>
58
+  </el-tab-pane>
59
+</el-tabs>
60
+</template>
61
+
62
+<script>
63
+import { createNamespacedHelpers } from "vuex";
64
+import dayjs from "dayjs";
65
+
66
+const { mapActions: mapExchangeActions } = createNamespacedHelpers("exchange");
67
+
68
+export default {
69
+  name: "goods-list",
70
+  data() {
71
+    return {
72
+      filterData: {
73
+        personName: "",
74
+        phone: "",
75
+        personType: "",
76
+        targetName: "",
77
+        startCreateDate: "",
78
+        endCreateDate: "",
79
+        startVerifyDate: "",
80
+        endVerifyDate: "",
81
+        status: ""
82
+      },
83
+      verifyPhone: "",
84
+      list: [],
85
+      pageNavi: {
86
+        current: 1,
87
+        size: 20,
88
+        total: 0
89
+      }
90
+    };
91
+  },
92
+  computed: {},
93
+  methods: {
94
+    ...mapExchangeActions(["getExchanges"]),
95
+    getList() {
96
+      const pageNumber = this.pageNavi.current || 1;
97
+      const pageSize = this.pageNavi.size;
98
+
99
+      this.getExchanges({
100
+        ...this.filterData,
101
+        pageNumber,
102
+        pageSize
103
+      })
104
+        .then(res => {
105
+          const { records, ...pageNavi } = res;
106
+
107
+          this.list = records;
108
+          this.pageNavi = pageNavi;
109
+        })
110
+        .catch(err => {
111
+          this.$notify.error(err.msg || err.message);
112
+        });
113
+    },
114
+    addGoods() {
115
+      this.$router.push({ name: "goods.edit" });
116
+    },
117
+    verifyTel() {
118
+      this.$router.push({
119
+        name: "verify.list",
120
+        params: { tel: this.verifyPhone }
121
+      });
122
+    },
123
+    toDetail(row) {
124
+      this.$router.push({
125
+        name: "goods.edit",
126
+        params: { id: row.goodsId }
127
+      });
128
+    },
129
+    changeStatus(row) {
130
+      this.showLoadding("保存中...");
131
+      this.changeGoodsStatus(row)
132
+        .then(res => {
133
+          this.hideLoadding();
134
+          this.$notify.info("保存成功");
135
+          this.search();
136
+        })
137
+        .catch(err => {
138
+          this.hideLoadding();
139
+          this.$notify.error(err.message);
140
+        });
141
+    },
142
+    showLoadding(text) {
143
+      this.loading = this.$loading({
144
+        text,
145
+        lock: true,
146
+        spinner: "el-icon-loading",
147
+        background: "rgba(255, 255, 255, 0.7)"
148
+      });
149
+    },
150
+    hideLoadding() {
151
+      if (this.loading) this.loading.close();
152
+    },
153
+    search() {
154
+      this.pageNavi.current = 1;
155
+      this.getList();
156
+    },
157
+    newPage(page) {
158
+      this.$router.replace({ name: "goods.list", query: { page } });
159
+    },
160
+    formateDate(dt) {
161
+      return !dt ? "" : dayjs(dt).format("YYYY-MM-DD HH:mm");
162
+    }
163
+  },
164
+  created() {
165
+    this.pageNavi.current = this.$route.query.page || 1;
166
+
167
+    this.getList();
168
+  }
169
+};
170
+</script>
171
+
172
+<style lang="scss" scoped>
173
+.list {
174
+  .header {
175
+    width: 50px;
176
+    height: 50px;
177
+    border-radius: 50%;
178
+  }
179
+  img {
180
+    width: 100%;
181
+    height: 100%;
182
+  }
183
+}
184
+.system-table-search {
185
+  width: calc(100% - 40px);
186
+  margin: 20px auto 0;
187
+}
188
+
189
+.system-table-search li {
190
+  margin-right: 20px;
191
+}
192
+
193
+.system-table-search ul {
194
+  font-size: 0;
195
+  white-space: nowrap;
196
+}
197
+
198
+.system-table-search ul > li {
199
+  display: inline-block;
200
+}
201
+
202
+.flex-h {
203
+  display: flex;
204
+  align-items: center;
205
+}
206
+
207
+.flex-item {
208
+  flex: 1;
209
+  -webkit-flex: 1;
210
+  position: relative;
211
+  overflow: hidden;
212
+}
213
+.border-card {
214
+  .el-row {
215
+    margin: 60px auto;
216
+  }
217
+  .grid-content {
218
+    text-align: center;
219
+
220
+    .iconfont {
221
+      color: #77a5f0;
222
+      font-size: 24px;
223
+      margin-bottom: 8px;
224
+      display: inline-block;
225
+    }
226
+    p {
227
+      font-size: 13px;
228
+      margin: 0;
229
+      line-height: 1.4;
230
+      color: #666;
231
+    }
232
+  }
233
+}
234
+</style>

+ 270
- 0
src/views/exchange/verifyList.vue Просмотреть файл

@@ -0,0 +1,270 @@
1
+<template>
2
+<div class="list">
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='goBacke'>返回</el-button>
7
+        </div>
8
+        <!-- <el-form :inline="true">
9
+          <el-form-item label="用户姓名">
10
+            <el-input v-model="filterData.personName" placeholder="用户姓名"></el-input>
11
+          </el-form-item>
12
+          <el-form-item label="手机号">
13
+            <el-input v-model="filterData.phone" placeholder="手机号"></el-input>
14
+          </el-form-item>
15
+          <el-form-item label="用户类型">
16
+            <el-select v-model="filterData.personType" placeholder="用户类型">
17
+              <el-option label="置业顾问" value="Realty Consultant"></el-option>
18
+              <el-option label="销售主管" value="Sales Executive"></el-option>
19
+              <el-option label="经纪人" value="estate agent"></el-option>
20
+            </el-select>
21
+          </el-form-item>
22
+          <el-form-item label="商品名称">
23
+            <el-input v-model="filterData.targetName" placeholder="商品名称"></el-input>
24
+          </el-form-item>
25
+          <el-form-item label="兑换时间">
26
+            <el-date-picker
27
+                      v-model="filterData.startCreateDate"
28
+                      type="date"
29
+                      placeholder="开始时间">
30
+                    </el-date-picker>
31
+                    <el-date-picker
32
+                      v-model="filterData.endCreateDate"
33
+                      type="date"
34
+                      placeholder="结束时间">
35
+                    </el-date-picker>
36
+          </el-form-item>
37
+          <el-form-item label="领取时间">
38
+          <el-date-picker
39
+                      v-model="filterData.startVerifyDate"
40
+                      type="date"
41
+                      placeholder="开始时间">
42
+                    </el-date-picker>
43
+                    <el-date-picker
44
+                      v-model="filterData.endVerifyDate"
45
+                      type="date"
46
+                      placeholder="结束时间">
47
+                    </el-date-picker>
48
+          </el-form-item>
49
+          <el-form-item label="状态">
50
+            <el-select v-model="filterData.status" placeholder="状态">
51
+              <el-option label="已领取" value="1"></el-option>
52
+              <el-option label="未领取" value="0"></el-option>
53
+            </el-select>
54
+          </el-form-item>
55
+      <el-form-item>
56
+      <el-button type="primary" @click="search">查询</el-button>
57
+  </el-form-item>
58
+</el-form>     -->
59
+      </div>
60
+      <div class="moreFilter"></div>
61
+    </div>
62
+  <el-table
63
+    :data="list || []"
64
+    style="width: 100%">
65
+    <el-table-column
66
+      prop="personName"
67
+      label="用户姓名">
68
+    </el-table-column>
69
+    <!-- <el-table-column
70
+      label="用户类型">
71
+      <template slot-scope="scope">
72
+          <span v-if="scope.row.personType === 'Realty Consultant'">置业顾问</span>
73
+          <span v-if="scope.row.personType === 'Sales Executive'">销售主管</span>
74
+          <span v-if="scope.row.personType === 'estate agent'">经纪人</span>
75
+      </template>
76
+    </el-table-column> -->
77
+    <el-table-column
78
+      prop="phone"
79
+      label="手机号">
80
+    </el-table-column>
81
+    <el-table-column
82
+      label="商品图片">
83
+      <template slot-scope="scope">
84
+          <div class="header">
85
+            <img :src="scope.row.image" alt="" />
86
+          </div>
87
+        </template>
88
+    </el-table-column>
89
+    <el-table-column
90
+      prop="targetName"
91
+      label="兑换商品">
92
+    </el-table-column>
93
+    <el-table-column
94
+      label="兑换时间">
95
+      <template slot-scope="scope">
96
+          <span>{{formateDate(scope.row.createDate)}}</span>
97
+      </template>
98
+    </el-table-column>
99
+    <!-- <el-table-column
100
+      label="领取时间">
101
+      <template slot-scope="scope">
102
+          <span>{{formateDate(scope.row.verifyDate)}}</span>
103
+      </template>
104
+    </el-table-column> -->
105
+    <el-table-column   label="状态">
106
+      <template slot-scope="scope">
107
+        <span :style="{color:(scope.row.status == 1?'':'red')}" >{{scope.row.status == 1 ? '已领取' : '未领取'}}</span>
108
+      </template>
109
+    </el-table-column>
110
+    <el-table-column
111
+      fixed="right"
112
+      label="操作">
113
+      <template slot-scope="scope">
114
+        <el-button type="text" @click="changeStatus(scope.row)" size="small">{{scope.row.status == 1?'':'核销'}}</el-button>
115
+      </template>
116
+    </el-table-column>
117
+  </el-table>
118
+  <el-pagination
119
+    small
120
+    style="margin-top:10px;"
121
+    layout="prev, pager, next"
122
+    :current-page.sync="pageNavi.current"
123
+    :pageSize="pageNavi.size"
124
+    :total="pageNavi.total || 0"
125
+    @current-change="getList"
126
+  >
127
+  </el-pagination>
128
+</div>
129
+</template>
130
+
131
+<script>
132
+import { createNamespacedHelpers } from "vuex";
133
+import dayjs from 'dayjs'
134
+
135
+const { mapActions: mapExchangeActions } = createNamespacedHelpers("exchange");
136
+
137
+export default {
138
+  name: "goods-list",
139
+  data() {
140
+    return {
141
+      filterData: {
142
+        tel: "",
143
+      },
144
+      list: [],
145
+      pageNavi: {
146
+        current: 1,
147
+        size: 20,
148
+        total: 0
149
+      }
150
+    };
151
+  },
152
+  computed: {},
153
+  methods: {
154
+    ...mapExchangeActions(["getExchanges", "changeExchangeStatus"]),
155
+    getList() {
156
+      const pageNumber = this.pageNavi.current || 1;
157
+      const pageSize = this.pageNavi.size;
158
+
159
+      this.getExchanges({
160
+        ...this.filterData,
161
+        pageNumber,
162
+        pageSize
163
+      })
164
+        .then(res => {
165
+          const { records, ...pageNavi } = res;
166
+
167
+          this.list = records;
168
+          this.pageNavi = pageNavi;
169
+        })
170
+        .catch(err => {
171
+          this.$notify.error(err.msg || err.message);
172
+        });
173
+    },
174
+    addGoods() {
175
+      this.$router.push({ name: "goods.edit" });
176
+    },
177
+    goBacke() {
178
+      this.$router.go(-1)
179
+    },
180
+    toDetail(row) {
181
+      this.$router.push({
182
+        name: "goods.edit",
183
+        params: { id: row.goodsId }
184
+      });
185
+    },
186
+    changeStatus(row) {
187
+      this.showLoadding("保存中...");
188
+      this.changeExchangeStatus(row)
189
+        .then(res => {
190
+          this.hideLoadding();
191
+          this.$notify.info("核销成功");
192
+          this.search();
193
+        })
194
+        .catch(err => {
195
+          this.hideLoadding();
196
+          this.$notify.error(err.message);
197
+        });
198
+    },
199
+    showLoadding(text) {
200
+      this.loading = this.$loading({
201
+        text,
202
+        lock: true,
203
+        spinner: "el-icon-loading",
204
+        background: "rgba(255, 255, 255, 0.7)"
205
+      });
206
+    },
207
+    hideLoadding() {
208
+      if (this.loading) this.loading.close();
209
+    },
210
+    search() {
211
+      this.pageNavi.current = 1;
212
+      this.getList();
213
+    },
214
+    newPage(page) {
215
+      this.$router.replace({ name: "goods.list", query: { page } });
216
+    },
217
+    formateDate(dt) {
218
+      return !dt ? '' : dayjs(dt).format('YYYY-MM-DD HH:mm')
219
+    },
220
+  },
221
+  created() {
222
+    this.pageNavi.current = this.$route.query.page || 1;
223
+    this.filterData.tel = this.$route.params.tel
224
+    this.getList();
225
+  }
226
+};
227
+</script>
228
+
229
+<style lang="scss" scoped>
230
+.list {
231
+  .header {
232
+    width: 50px;
233
+    height: 50px;
234
+    border-radius: 50%;
235
+  }
236
+  img {
237
+      width: 100%;
238
+      height: 100%;
239
+    }
240
+}
241
+.system-table-search {
242
+  width: calc(100% - 40px);
243
+  margin: 20px auto 0;
244
+}
245
+
246
+.system-table-search li {
247
+  margin-right: 20px;
248
+}
249
+
250
+.system-table-search ul {
251
+  font-size: 0;
252
+  white-space: nowrap;
253
+}
254
+
255
+.system-table-search ul > li {
256
+  display: inline-block;
257
+}
258
+
259
+.flex-h {
260
+  display: flex;
261
+  align-items: center;
262
+}
263
+
264
+.flex-item {
265
+  flex: 1;
266
+  -webkit-flex: 1;
267
+  position: relative;
268
+  overflow: hidden;
269
+}
270
+</style>

+ 3
- 1
src/views/goods/edit.vue Просмотреть файл

@@ -35,7 +35,7 @@
35 35
           <el-input v-model="detail.inventory"></el-input>
36 36
         </el-form-item>
37 37
         <el-form-item label="商品详情:">
38
-            <div id="websiteEditorElem" style="height: 400px"></div>
38
+            <rich-editor v-model="detail.goodsDescription" style="height: 400px" />
39 39
         </el-form-item>
40 40
         <el-form-item label="状态:">
41 41
           <el-select v-model="detail.status" clearable placeholder="请选择">
@@ -82,6 +82,7 @@ export default {
82 82
         totalNum: '',
83 83
         inventory: '',
84 84
         status: 0,
85
+        goodsDescription: '',
85 86
         address: '',
86 87
         goodsId: '',
87 88
       },
@@ -125,6 +126,7 @@ export default {
125 126
           this.detail.status = data.status
126 127
           this.detail.address = data.address
127 128
           this.detail.goodsId = data.goodsId
129
+          this.detail.goodsDescription = data.goodsDescription
128 130
         });
129 131
       }
130 132
     },

+ 60
- 4
src/views/index.js Просмотреть файл

@@ -68,6 +68,53 @@ const pages = [
68 68
       },
69 69
     ]
70 70
   },
71
+  {
72
+    path: 'activity',
73
+    name: 'activity',
74
+    component: () => import('./index.vue'),
75
+    meta: {
76
+      menuShow: true,
77
+      title: '活动管理',
78
+    },
79
+    children: [
80
+      {
81
+        path: 'activity',
82
+        name: 'activity-list',
83
+        component: () => import('./activity/list.vue'),
84
+        meta: {
85
+          menuShow: true,
86
+          title: '活动列表',
87
+        },
88
+      },
89
+      {
90
+        path: 'activity/add',
91
+        name: 'activity-add',
92
+        component: () => import('./activity/add.vue'),
93
+        meta: {
94
+          menuShow: false,
95
+          title: '活动添加',
96
+        }
97
+      },
98
+      {
99
+        path: 'activity/edit',
100
+        name: 'activity-edit',
101
+        component: () => import('./activity/edit.vue'),
102
+        meta: {
103
+          menuShow: false,
104
+          title: '编辑活动',
105
+        }
106
+      },
107
+      {
108
+        path: 'activity/signList',
109
+        name: 'activity-signList',
110
+        component: () => import('./activity/signList.vue'),
111
+        meta: {
112
+          menuShow: false,
113
+          title: '报名记录',
114
+        },
115
+      }
116
+    ]
117
+  },
71 118
   {
72 119
     path: 'building',
73 120
     name: 'building',
@@ -126,7 +173,7 @@ const pages = [
126 173
       {
127 174
         path: 'customerlist',
128 175
         name: 'customerlist',
129
-        component: () => import('./customer/list.vue'),
176
+        component: () => import('./customer/recommendCustomer.vue'),
130 177
         meta: {
131 178
           menuShow: true,
132 179
           title: '客户列表',
@@ -344,14 +391,23 @@ const pages = [
344 391
         },
345 392
       },
346 393
       {
347
-        path: 'edit/:id?',
348
-        name: 'consultant.edit',
349
-        component: () => import('./consultant/edit.vue'),
394
+        path: 'exchange/verify',
395
+        name: 'exchange.verify',
396
+        component: () => import('./exchange/verify.vue'),
350 397
         meta: {
351 398
           menuShow: true,
352 399
           title: '商品核销',
353 400
         },
354 401
       },
402
+      {
403
+        path: 'verify/list',
404
+        name: 'verify.list',
405
+        component: () => import('./exchange/verifyList.vue'),
406
+        meta: {
407
+          menuShow: false,
408
+          title: '商品展示',
409
+        },
410
+      },
355 411
       {
356 412
         path: 'exchange/list',
357 413
         name: 'exchange.list',

+ 5
- 0
src/views/news/index.vue Просмотреть файл

@@ -40,6 +40,7 @@
40 40
                         prop="createDate"
41 41
                         label="发布时间"
42 42
                         align="center">
43
+                    <template slot-scope="scope">{{ formateDate(scope.row.createDate) }}</template>
43 44
                 </el-table-column>
44 45
                 <el-table-column
45 46
                         prop="pvNum"
@@ -94,6 +95,7 @@
94 95
 </template>
95 96
 
96 97
 <script>
98
+    import dayjs from 'dayjs'
97 99
     export default {
98 100
         name: "newsIndex",
99 101
         data() {
@@ -117,6 +119,9 @@
117 119
           this.getBuildList()
118 120
         },
119 121
         methods: {
122
+            formateDate(dt) {
123
+                return !dt ? '' : dayjs(dt).format('YYYY-MM-DD HH:mm')
124
+            },
120 125
             deleteNews(id) {
121 126
                 // 删除操作
122 127
                 const data = { newsId: id }

+ 2
- 2
vue.config.js Просмотреть файл

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