Pārlūkot izejas kodu

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

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

+ 41
- 1
src/config/api.js Parādīt failu

@@ -173,7 +173,15 @@ const apis = {
173 173
     recommendCustomerList: {
174 174
       method:'get',
175 175
       url: `${commPrefix}/customer/recommend/:id`
176
-    }
176
+    },
177
+    getCustomerDetail: {
178
+      method: `get`,
179
+      url: `${commPrefix}/customer/recommend/get/:id`
180
+    },
181
+    taPointsRecords: { // 积分列表
182
+      method: `get`,
183
+      url: `${commPrefix}/taPointsRecords/:id`
184
+    },
177 185
   },
178 186
   goods:{
179 187
     list:{
@@ -271,6 +279,38 @@ const apis = {
271 279
     change: {
272 280
       method: 'put',
273 281
       url: `${commPrefix}/taPointsExchange/change`
282
+    },
283
+    update: {
284
+      method: 'put',
285
+      url: `${commPrefix}/taPointsExchange/:id`
286
+    }
287
+  },
288
+  carouselFigure:{ // 轮播图列表查询
289
+    list:{
290
+      method:'get',
291
+      url: `${commPrefix}/extendContent`
292
+    },
293
+    handle:{
294
+      method:'get',
295
+      url: `${commPrefix}/extendContent/:id`
296
+    },
297
+    update: {
298
+      method:'put',
299
+      url: `${commPrefix}/extendContent/:id`
300
+    },
301
+    getById: {
302
+      method:'get',
303
+      url: `${commPrefix}/extendContent/:id`
304
+    },
305
+    add: {
306
+      method:'post',
307
+      url: `${commPrefix}/extendContent`
308
+    }
309
+  },
310
+  message:{
311
+    list:{
312
+      method:'get',
313
+      url: `${commPrefix}/taCustomerMessage`
274 314
     }
275 315
   },
276 316
 }

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

@@ -18,6 +18,8 @@ const store = new Vuex.Store({
18 18
     goods: require('./modules/goods').default,
19 19
     points: require('./modules/points').default,
20 20
     exchange: require('./modules/exchange').default,
21
+    carouselFigure: require('./modules/carouselFigure').default,
22
+    message: require('./modules/message').default,
21 23
     news
22 24
 
23 25
   }

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

@@ -43,8 +43,6 @@ export default {
43 43
           ...apis.activity.updateActivity,
44 44
           data: payload,
45 45
         }).then((data) => {
46
-          window.console.log(data)
47
-          commit('updateList', { ...data, list: data.records})
48 46
           resolve(data)
49 47
         }).catch(({ message }) => {
50 48
           if (typeof message === 'string') {

+ 102
- 0
src/store/modules/carouselFigure.js Parādīt failu

@@ -0,0 +1,102 @@
1
+import request from '../../utils/request'
2
+import apis from '../../config/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    carouselList: {},
8
+    // detail: {}
9
+  },
10
+  mutations: {
11
+    updateList (state, payload) {
12
+      state.carouselList = payload
13
+    },
14
+    // updateDetail (state, payload) {
15
+    //   state.detail = payload
16
+    // }
17
+  },
18
+  actions: {
19
+    // setDetailNull ({ commit }) {
20
+    //   commit('updateDetail', {})
21
+    // },
22
+    getExtendContent ({ commit }, payload) {
23
+      return new Promise((resolve, reject) => {
24
+        request({
25
+          ...apis.carouselFigure.list,
26
+          params: payload,
27
+        }).then((data) => {
28
+          commit('updateList', data)
29
+          resolve(data)
30
+        }).catch((err) => {
31
+          const message = err.message || err.msg
32
+          if (typeof message === 'string') {
33
+            reject(message)
34
+          }
35
+        })
36
+      })
37
+    },
38
+    handleExtendContent ({ commit }, payload) {
39
+      return new Promise((resolve, reject) => {
40
+        request({
41
+          ...apis.carouselFigure.handle,
42
+          urlData: { id: payload.contentId },
43
+          params: payload,
44
+        }).then((data) => {
45
+          commit('updateList', data)
46
+          resolve(data)
47
+        }).catch((err) => {
48
+          const message = err.message || err.msg
49
+          if (typeof message === 'string') {
50
+            reject(message)
51
+          }
52
+        })
53
+      })
54
+    },
55
+    updateExtendContent ({ commit }, payload) {
56
+      return new Promise((resolve, reject) => {
57
+        request({
58
+          ...apis.carouselFigure.update,
59
+          urlData: { id: payload.contentId },
60
+          data: payload,
61
+        }).then((data) => {
62
+          resolve(data)
63
+        }).catch((err) => {
64
+          const message = err.message || err.msg
65
+          if (typeof message === 'string') {
66
+            reject(message)
67
+          }
68
+        })
69
+      })
70
+    },
71
+    getByIdExtendContent({ commit }, payload) { // 根据Id查询
72
+      return new Promise((resolve, reject) => {
73
+        request({
74
+          ...apis.carouselFigure.getById,
75
+          urlData: { id: payload.contentId },
76
+        }).then((data) => {
77
+          resolve(data)
78
+        }).catch((err) => {
79
+          const message = err.message || err.msg
80
+          if (typeof message === 'string') {
81
+            reject(message)
82
+          }
83
+        })
84
+      })
85
+    },
86
+    addExtendContent ({ commit }, payload) { // 添加
87
+      return new Promise((resolve, reject) => {
88
+        request({
89
+          ...apis.carouselFigure.add,
90
+          data: payload,
91
+        }).then((data) => {
92
+          resolve(data)
93
+        }).catch((err) => {
94
+          const message = err.message || err.msg
95
+          if (typeof message === 'string') {
96
+            reject(message)
97
+          }
98
+        })
99
+      })
100
+    },
101
+  }
102
+}

+ 27
- 3
src/store/modules/customer.js Parādīt failu

@@ -57,7 +57,7 @@ export default {
57 57
         })
58 58
       })
59 59
     },
60
-    getRecommendCustomersUpdate ({ commit }, payload) { // 根据Id查询列表
60
+    getRecommendCustomersUpdate ({ commit }, payload) { // 修改
61 61
       return new Promise((resolve, reject) => {
62 62
         request({
63 63
           ...apis.recommendCustomer.update,
@@ -82,8 +82,32 @@ export default {
82 82
           reject(message)
83 83
         })
84 84
       })
85
-    }
86
-
85
+    },
86
+    taPointsRecords({ commit }, payload) { // 积分列表
87
+      return new Promise((resolve, reject) => {
88
+        request({
89
+          ...apis.recommendCustomer.taPointsRecords,
90
+          urlData: { id: payload.customerId},
91
+          params: payload
92
+        }).then((data) => {
93
+          resolve(data)
94
+        }).catch(({ message }) => {
95
+          reject(message)
96
+        })
97
+      })
98
+    },
99
+    getCustomerDetail({ commit }, payload) { // 查询客户详情
100
+      return new Promise((resolve, reject) => {
101
+        request({
102
+          ...apis.recommendCustomer.getCustomerDetail,
103
+          urlData: { id: payload.customerId}
104
+        }).then((data) => {
105
+          resolve(data)
106
+        }).catch(({ message }) => {
107
+          reject(message)
108
+        })
109
+    })
110
+}
87 111
     
88 112
   }
89 113
 }

+ 3
- 7
src/store/modules/exchange.js Parādīt failu

@@ -112,19 +112,15 @@ export default {
112 112
         })
113 113
       })
114 114
     },
115
-    cancelDynamic (_, payload) {
115
+    verifyById (_, payload) {
116 116
       return new Promise((resolve, reject) => {
117 117
         request({
118
-          ...apis.dynamic.cancel,
118
+          ...apis.exchange.update,
119 119
           urlData: payload,
120 120
         }).then((data) => {
121 121
           resolve(data)
122 122
         }).catch((err) => {
123
-          const message = err.message || err.msg
124
-
125
-          if (typeof message === 'string') {
126
-            reject(message)
127
-          }
123
+          reject(err)
128 124
         })
129 125
       })
130 126
     }

+ 128
- 0
src/store/modules/message.js Parādīt failu

@@ -0,0 +1,128 @@
1
+import request from '../../utils/request'
2
+import apis from '../../config/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    dynamics: {},
8
+    detail: {}
9
+  },
10
+  mutations: {
11
+    updateList (state, payload) {
12
+      state.dynamics = payload
13
+    },
14
+    updateDetail (state, payload) {
15
+      state.detail = payload
16
+    }
17
+  },
18
+  actions: {
19
+    setDetailNull ({ commit }) {
20
+      commit('updateDetail', {})
21
+    },
22
+    getMessage ({ commit }, payload) {
23
+      return new Promise((resolve, reject) => {
24
+        request({
25
+          ...apis.message.list,
26
+          params: payload,
27
+        }).then((data) => {
28
+          commit('updateList', data)
29
+          resolve(data)
30
+        }).catch((err) => {
31
+          resolve(err)
32
+        })
33
+      })
34
+    },
35
+    getGoodsDetail ({ commit }, payload) {
36
+      return new Promise((resolve, reject) => {
37
+        request({
38
+          ...apis.goods.detail,
39
+          urlData: payload,
40
+        }).then((data) => {
41
+          commit('updateDetail', data)
42
+          resolve(data)
43
+        }).catch((err) => {
44
+          const message = err.message || err.msg
45
+
46
+          if (typeof message === 'string') {
47
+            reject(message)
48
+          }
49
+        })
50
+      })
51
+    },
52
+    addGoods (_, payload) {
53
+      return new Promise((resolve, reject) => {
54
+        request({
55
+          ...apis.goods.add, 
56
+          data: payload,
57
+        }).then((data) => {
58
+          resolve(data)
59
+        }).catch((err) => {
60
+          const message = err.message || err.msg
61
+          if (typeof message === 'string') {
62
+            reject(message)
63
+          }
64
+        })
65
+      })
66
+    },
67
+    editGoods (_, payload) {
68
+      return new Promise((resolve, reject) => {
69
+        request({
70
+          ...apis.goods.edit,
71
+          data: payload,
72
+        }).then((data) => {
73
+          resolve(data)
74
+        }).catch((err) => {
75
+          const message = err.message || err.msg
76
+
77
+          if (typeof message === 'string') {
78
+            reject(message)
79
+          }
80
+        })
81
+      })
82
+    },
83
+    deleteDynamics (_, payload) {
84
+      return new Promise((resolve, reject) => {
85
+        request({
86
+          ...apis.dynamic.delete,
87
+          ...payload
88
+        }).then(() => {
89
+          resolve()
90
+        }).catch(() => {
91
+          reject()
92
+        })
93
+      })
94
+    },
95
+    changeGoodsStatus (_, payload) {
96
+      return new Promise((resolve, reject) => {
97
+        request({
98
+          ...apis.goods.change,
99
+          data: payload,
100
+        }).then((data) => {
101
+          resolve(data)
102
+        }).catch((err) => {
103
+          const message = err.message || err.msg
104
+
105
+          if (typeof message === 'string') {
106
+            reject(message)
107
+          }
108
+        })
109
+      })
110
+    },
111
+    cancelDynamic (_, payload) {
112
+      return new Promise((resolve, reject) => {
113
+        request({
114
+          ...apis.dynamic.cancel,
115
+          urlData: payload,
116
+        }).then((data) => {
117
+          resolve(data)
118
+        }).catch((err) => {
119
+          const message = err.message || err.msg
120
+
121
+          if (typeof message === 'string') {
122
+            reject(message)
123
+          }
124
+        })
125
+      })
126
+    }
127
+  }
128
+}

+ 78
- 38
src/views/activity/add.vue Parādīt failu

@@ -1,6 +1,6 @@
1 1
 <template>
2
-  <el-form ref="form" :model="dynamic" label-width="160px">
3
-    <el-form-item label="所属项目">
2
+  <el-form ref="activityQuery" :model="activityQuery" :rules="rules"  label-width="160px">
3
+    <el-form-item label="所属项目" prop="buildingId">
4 4
       <el-select v-model="activityQuery.buildingId" placeholder="请选择">
5 5
         <el-option v-for="(build,i) in buildings.list || []" :key="i" :label="build.buildingName" :value="build.buildingId"></el-option>
6 6
       </el-select>
@@ -22,24 +22,19 @@
22 22
             <img width="100%" :src="dialogImageUrl" alt="">
23 23
           </el-dialog>
24 24
     </el-form-item>
25
-    <el-form-item label="活动标题">
25
+    <el-form-item label="活动标题" prop="title">
26 26
       <el-input v-model="activityQuery.title"></el-input>
27 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> -->
28
+    <el-form-item label="活动时间" prop="startDate">
29
+       <el-date-picker v-model="activityQuery.startDate" type="datetime" placeholder="选择日期"/>
35 30
         <span>-</span>
36
-       <el-date-picker v-model="activityQuery.endDate"  type="datetime" placeholder="选择日期"/>   
31
+       <el-date-picker v-model="activityQuery.endDate" type="datetime" placeholder="选择日期"/>   
37 32
     </el-form-item>
38
-    <el-form-item label="活动地点">
33
+    <el-form-item label="活动地点" prop="address">
39 34
       <el-input  v-model="activityQuery.address"></el-input>
40 35
     </el-form-item>
41
-    <el-form-item  label="活动人数">
42
-      <el-input v-model="activityQuery.personNum" ></el-input>
36
+    <el-form-item  label="活动人数" prop="personNum">
37
+      <el-input v-model="activityQuery.personNum" type="number"></el-input>
43 38
     </el-form-item>
44 39
     <!-- <el-form-item label="链接地址">
45 40
       <el-input v-model="dynamic.url"></el-input>
@@ -51,13 +46,13 @@
51 46
        <el-radio v-model="activityQuery.isEnlist" label="1">是</el-radio>
52 47
        <el-radio v-model="activityQuery.isEnlist" label="0">否</el-radio>
53 48
     </el-form-item>
54
-    <el-form-item label="活动时间" v-if="activityQuery.isEnlist == '1'">
55
-       <el-date-picker v-model="activityQuery.enlistStart" type="date" placeholder="选择日期"/>
49
+    <el-form-item label="报名时间" v-if="activityQuery.isEnlist == '1'" prop="enlistStart">
50
+       <el-date-picker v-model="activityQuery.enlistStart" type="datetime" placeholder="选择日期"/>
56 51
         <span>-</span>
57
-       <el-date-picker v-model="activityQuery.enlistEnd" type="date" placeholder="选择日期"/>   
52
+       <el-date-picker v-model="activityQuery.enlistEnd" type="datetime" placeholder="选择日期"/>   
58 53
     </el-form-item>
59 54
     <el-form-item>
60
-      <el-button type="primary" @click="onSubmit">保存</el-button>
55
+      <el-button type="primary" @click="onSubmit('activityQuery')">保存</el-button>
61 56
 
62 57
     </el-form-item>
63 58
   </el-form>
@@ -77,7 +72,6 @@ export default {
77 72
   data () {
78 73
     return {
79 74
       url:'',
80
-      buildingId:'',
81 75
       upFileUrl: apis.file.upload.url,
82 76
       radio:'1',
83 77
       imgList: [],
@@ -90,12 +84,40 @@ export default {
90 84
        buildingId:'',
91 85
        title:'',
92 86
        isEnlist:'1',
93
-       text:'',
87
+       desc:'',
94 88
        enlistStart:'',
95 89
        enlistEnd:'',
96 90
        personNum:'',
97
-      }
98
-      
91
+      },
92
+      rules: {
93
+          buildingId: [
94
+            { required: true, message: '请选择所属项目', trigger: 'change' }
95
+          ],
96
+          url: [
97
+            { required: true, message: ' ', trigger: 'change' }
98
+          ],
99
+          title: [
100
+            { required: true, message: '请输入标题', trigger: 'blur' },
101
+          ],
102
+          startDate: [
103
+            { type: 'date', required: true, message: '请选择日期', trigger: 'change' }
104
+          ],
105
+          endDate: [
106
+            { type: 'date', required: true, message: '请选择时间', trigger: 'change' }
107
+          ],
108
+          address: [
109
+            {  required: true, message: '请至少输入活动地点', trigger: 'change' }
110
+          ],
111
+          personNum: [
112
+            { required: true, message: '请输入活动人数', trigger: 'change' }
113
+          ],
114
+          desc: [
115
+            { required: true, message: ' ', trigger: 'blur' }
116
+          ],
117
+          enlistStart:[
118
+            { type: 'date', required: true, message: '请选报名日期', trigger: 'change' }
119
+          ]
120
+        }
99 121
     }
100 122
   },
101 123
   computed: {
@@ -164,11 +186,32 @@ export default {
164 186
       this.updateDetail({...this.dynamic, imgUrl: res.data})
165 187
       this.loading.close()
166 188
     },
167
-    onSubmit () {
168
-      // if (!this.detail.dynamicId) {
169
-        // 新增
170
-        console.log('this.imgList[0]',this.imgList[0])
171
-        // this.activityQuery.url = this.imgList[0]
189
+    onSubmit (formName) {
190
+      this.$refs[formName].validate((valid) => {
191
+      if (valid) {
192
+        // 主图不可为空
193
+        if(this.activityQuery.url ===''){
194
+          this.$message({ showClose: true, message: '请选择主图!',type: 'error'});
195
+        return false
196
+        }
197
+      console.log('this.activityQuery.desc',this.activityQuery.desc)
198
+      const endDate=this.activityQuery.endDate
199
+      const startDate=this.activityQuery.startDate
200
+      if( endDate <= startDate){
201
+        this.$message({ showClose: true, message: '活动结束时间不能小于活动开始时间',type: 'error'});
202
+        return false
203
+      }
204
+      if( this.activityQuery.desc === '' || this.activityQuery.desc === null){
205
+        this.$message({ showClose: true, message: '活动详情不能为空',type: 'error'});
206
+        return false
207
+      }
208
+
209
+      const enlistStart= this.activityQuery.enlistStart
210
+      const enlistEnd= this.activityQuery.enlistEnd
211
+      if(this.activityQuery.isEnlist ==='1' && enlistEnd<= enlistStart ){
212
+        this.$message({ showClose: true, message: '报名结束时间不能小于报名开始时间',type: 'error'});
213
+        return false
214
+      }
172 215
         this.addActivity(
173 216
           JSON.stringify(this.activityQuery)
174 217
         ).then(() => {
@@ -176,26 +219,23 @@ export default {
176 219
           
177 220
         })
178 221
         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
-      // }
222
+          } else {
223
+            console.log('error submit!!');
224
+            return false;
225
+          }
226
+        })
187 227
     },
188 228
     onCancel () {
189 229
       this.$router.push({name: 'dynamiclist'})
190
-    }
230
+    },
191 231
   },
192 232
   mounted () {
193 233
     const _that = this
194 234
     const phoneEditor = new E('#websiteEditorElem')
195 235
     phoneEditor.customConfig.zIndex = 1
196 236
     phoneEditor.customConfig.onchange = function (html) {
197
-      _that.dynamic = {..._that.dynamic, url: html}
198
-        _that.activityQuery.text =_that.dynamic.url
237
+      _that.activityQuery = {..._that.activityQuery, desc: html}
238
+       console.log('that.dynamic.url',_that.activityQuery.desc)
199 239
     }
200 240
     // phoneEditor.customConfig.uploadImgServer = this.upFileUrl
201 241
     // phoneEditor.customConfig.uploadFileName = 'uploadFiles'

+ 97
- 75
src/views/activity/edit.vue Parādīt failu

@@ -1,11 +1,11 @@
1 1
 <template>
2
-  <el-form ref="form" label-width="160px">
3
-    <el-form-item label="所属项目">
4
-      <el-select v-model="activityQuery.buildingId" placeholder="请选择">
2
+  <el-form ref="activityQuery" label-width="160px" :rules="rules" :model="activityQuery">
3
+    <el-form-item label="所属项目" prop="buildingId">
4
+      <el-select v-model="activityQuery.buildingId"  placeholder="请选择">
5 5
         <el-option v-for="(build,i) in buildings.list || []" :key="i" :label="build.buildingName" :value="build.buildingId"></el-option>
6 6
       </el-select>
7 7
     </el-form-item>
8
-    <el-form-item label="主图:">
8
+    <el-form-item label="主图:" prop="buildingId">
9 9
           <el-upload
10 10
                 :headers="uploadHeaders"
11 11
                 :action="upFileUrl"
@@ -15,37 +15,39 @@
15 15
               <i v-else class="el-icon-plus avatar-uploader-icon"></i>
16 16
           </el-upload>
17 17
     </el-form-item>
18
-    <el-form-item label="活动标题">
18
+    <el-form-item label="活动标题" prop="title">
19 19
       <el-input v-model="activityQuery.title"></el-input>
20 20
     </el-form-item>
21
-    <el-form-item label="活动时间">
22
-       <el-date-picker v-model="activityQuery.startDate" type="date" placeholder="选择日期"/>
21
+    <el-form-item label="活动时间" prop="startDate">
22
+       <el-date-picker v-model="activityQuery.startDate" type="datetime" placeholder="选择日期"/>
23 23
         <span>-</span>
24
-       <el-date-picker v-model="activityQuery.endDate" type="date" placeholder="选择日期"/>   
24
+       <el-date-picker v-model="activityQuery.endDate" type="datetime" placeholder="选择日期"/>   
25 25
     </el-form-item>
26
-    <el-form-item label="活动地点">
26
+    <el-form-item label="活动地点"  prop="address">
27 27
       <el-input  v-model="activityQuery.address"></el-input>
28 28
     </el-form-item>
29
-    <el-form-item label="活动人数">
30
-      <el-input v-model="activityQuery.personNum"></el-input>
29
+    <el-form-item label="活动人数" prop="personNum">
30
+      <el-input v-model="activityQuery.personNum" type="number"></el-input>
31 31
     </el-form-item>
32 32
     <!-- <el-form-item label="链接地址">
33 33
       <el-input v-model="dynamic.url"></el-input>
34 34
     </el-form-item> -->
35 35
     <el-form-item label="活动详情">
36
-      <div id="websiteEditorElem" style="height: 400px"></div>
36
+      <div id="desc">
37
+        <rich-editor v-model="activityQuery.desc" style="height: 400px"/>
38
+      </div>   
37 39
     </el-form-item>
38 40
     <el-form-item label="是否需要报名">
39 41
        <el-radio v-model="activityQuery.isEnlist" label="1">是</el-radio>
40 42
        <el-radio v-model="activityQuery.isEnlist" label="0">否</el-radio>
41 43
     </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
+    <el-form-item label="报名时间" v-if="activityQuery.isEnlist == '1'"  prop="enlistStart">
45
+       <el-date-picker v-model="activityQuery.enlistStart" type="datetime" placeholder="选择日期"/>
44 46
         <span>-</span>
45
-       <el-date-picker v-model="activityQuery.enlistEnd" type="date" placeholder="选择日期"/>   
47
+       <el-date-picker v-model="activityQuery.enlistEnd" type="datetime" placeholder="选择日期"/>   
46 48
     </el-form-item>
47 49
     <el-form-item>
48
-      <el-button type="primary" @click="onSubmit">保存</el-button>
50
+      <el-button type="primary" @click="onSubmit('activityQuery')">保存</el-button>
49 51
       <el-button @click="onCancel">取消</el-button>
50 52
     </el-form-item>
51 53
   </el-form>
@@ -55,7 +57,7 @@
55 57
 import { createNamespacedHelpers } from 'vuex'
56 58
 import apis from '../../config/api'
57 59
 import E from 'wangeditor'
58
-
60
+import dayjs from 'dayjs'
59 61
 const { mapState: mapDynamicState, mapActions: mapDynamicActions, mapMutations: mapDynamicMutations } = createNamespacedHelpers('building')
60 62
 const { mapState: mapActivityState, mapActions: mapActivityActions } = createNamespacedHelpers('activity')
61 63
 const { mapState: mapBuildingState, mapActions: mapBuildingActions } = createNamespacedHelpers('building')
@@ -74,19 +76,50 @@ export default {
74 76
       dialogImageUrl: "",
75 77
       activityQuery: {
76 78
        dynamicId:'',
77
-       buildingId:'',
78 79
        url:'',
79 80
        startDate:'',
80 81
        endDate:'',
81 82
        buildingId:'',
82 83
        title:'',
83 84
        isEnlist:'',
84
-       text:'',
85
+       desc:'',
85 86
        enlistStart:'',
86 87
        enlistEnd:'',
87 88
        address:'',
88 89
        personNum:''
89
-      }
90
+      },
91
+      rules: {
92
+          buildingId: [
93
+            { required: true, message: '请选择活动区域', trigger: 'change' }
94
+          ],
95
+          url: [
96
+            { required: true, message: ' ', trigger: 'change' }
97
+          ],
98
+          title: [
99
+            { required: true, message: '请输入活动标题', trigger: 'blur' },
100
+          ],
101
+          startDate: [
102
+            { required: true, message: '请选择日期', trigger: 'change' }
103
+          ],
104
+          endDate: [
105
+            { type: 'date', required: true, message: '请选择时间', trigger: 'change' }
106
+          ],
107
+          address: [
108
+            {  required: true, message: '请输入活动地点', trigger: 'change' }
109
+          ],
110
+          personNum: [
111
+            { required: true, message: '请输入活动人数', trigger: 'change' }
112
+          ],
113
+          desc: [
114
+            { required: true, message: ' ', trigger: 'blur' }
115
+          ],
116
+          // img: [
117
+          //   { required: true, message: ' '}
118
+          // ],
119
+          enlistStart:[
120
+            { type: 'date', required: true, message: '请选择日期', trigger: 'change' }
121
+          ]
122
+        }
90 123
       
91 124
     }
92 125
   },
@@ -154,83 +187,72 @@ export default {
154 187
     },
155 188
 
156 189
     handleAvatarSuccess (res) {
157
-      this.activityQuery.url = res.data
158
-      this.updateDetail({...this.dynamic, imgUrl: res.data})
159
-      this.loading.close()
190
+      this.imageUrl = res.data
160 191
     },
161
-    onSubmit () {
162
-        // 新增
163
-        console.log('this.imgList[0]',this.imgList[0])
164
-        // this.activityQuery.url = this.imgList[0]
165
-        this.updateActivity(
192
+    onSubmit (formName) {
193
+      this.$refs[formName].validate((valid) => {
194
+      if (valid) {
195
+        // 活动时间校验
196
+      const endDate = this.formateDate(this.activityQuery.endDate); 
197
+      const startDate = this.formateDate(this.activityQuery.startDate);           
198
+      if( endDate <= startDate){
199
+        this.$message({ showClose: true, message: '活动结束时间不能小于活动开始时间',type: 'error'});
200
+        return 
201
+      }
202
+      // 富文本校验
203
+      if( this.activityQuery.desc === '' || this.activityQuery.desc === null|| this.activityQuery.desc ==='<p><br></p>'){
204
+        this.$message({ showClose: true, message: '活动详情不能为空',type: 'error'});
205
+        return 
206
+      }
207
+      // 报名时间校验
208
+      const enlistStart = this.formateDate(this.activityQuery.enlistStart); 
209
+      const enlistEnd = this.formateDate(this.activityQuery.enlistEnd);           
210
+      if(this.activityQuery.isEnlist ==='1' && enlistEnd<= enlistStart ){
211
+        this.$message({ showClose: true, message: '报名结束时间不能小于报名开始时间',type: 'error'});
212
+        return 
213
+      }
214
+      this.activityQuery.url = this.imageUrl 
215
+        this.updateActivity(    
166 216
            JSON.stringify(this.activityQuery)
167
-        ).then(() => {
168
-          this.onCancel()
169
-          
217
+        ).then((res) => {
218
+      this.$router.push({ name: "activity-list" });
219
+        })
220
+     
221
+        } else {
222
+            console.log('error submit!!');
223
+            return false;
224
+          }
170 225
         })
171
-        this.$router.push({ name: "activity-list" });
172 226
     },
173 227
     onCancel () {
174
-      this.$router.push({name: 'dynamiclist'})
228
+      this.$router.push({name: 'activity-list'})
175 229
     },
176 230
     getDetails(){
177 231
       this.activityQuery.dynamicId = this.$route.query.row
178 232
         this.activityDetails(this.activityQuery).then((data) => {
179
-          console.log('55',data)
180 233
         this.activityQuery.buildingId = data.buildingId
181 234
         this.activityQuery.title = data.title
182
-        this.activityQuery.startDate = data.startDate
235
+        this.activityQuery.startDate = data.startDate 
183 236
         this.activityQuery.endDate = data.endDate
184 237
         this.activityQuery.address = data.address
185 238
         this.activityQuery.personNum = data.personNum
186 239
         this.imageUrl = data.url
187 240
         this.activityQuery.isEnlist = data.isEnlist
241
+        this.activityQuery.desc = data.desc
188 242
         
189 243
        
190 244
         })
191
-    }
245
+    },
246
+    formateDate(dt) {
247
+      return !dt ? '' : dayjs(dt).format('YYYY-MM-DD HH:mm')
248
+    },
192 249
   },
193 250
   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()
251
+    // const editor = new E('#desc')
252
+    // editor.customConfig.zIndex = 1
253
+    // editor.create()
223 254
     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
-    })
255
+    
234 256
   }
235 257
 }
236 258
 </script>

+ 16
- 5
src/views/activity/list.vue Parādīt failu

@@ -28,9 +28,10 @@
28 28
     </el-table-column>
29 29
     <el-table-column
30 30
       prop="tel"
31
-      label="活动时间">
31
+      label="活动时间"
32
+      width="340">
32 33
      <template slot-scope="scope">
33
-        <span>{{ formateDate(scope.row.startDate)}} ~ {{ formateDate(scope.row.startDate)}}</span>
34
+        <span>{{ formateDate(scope.row.startDate)}}——{{ formateDate(scope.row.endDate)}}</span>
34 35
       </template>
35 36
     </el-table-column>
36 37
     <el-table-column
@@ -142,14 +143,24 @@ export default {
142 143
     },
143 144
     // 结束活动
144 145
     finish(id){
145
-      this.filterData.dynamicId = id
146
+        this.$confirm('结束以后将无法编辑, 是否继续?', '提示', {
147
+          confirmButtonText: '确定',
148
+          cancelButtonText: '取消',
149
+          type: 'warning'
150
+        }).then(() => {
151
+           this.filterData.dynamicId = id
146 152
           this.finishActivity(
147 153
           JSON.stringify(this.filterData)
148 154
         ).then((res) => {
149 155
            this.getList();
150 156
           this.getBuildList()   
151
-        })
152
-       
157
+        })    
158
+          this.$message({
159
+            type: 'success',
160
+            message: '成功!'
161
+          });
162
+        }).catch(() => {       
163
+        });
153 164
     },
154 165
     top(id){
155 166
           this.filterData.dynamicId = id

+ 175
- 164
src/views/carouselFigure/advertisement.vue Parādīt failu

@@ -5,224 +5,235 @@
5 5
         <div class="flex-item flex-h">
6 6
           <el-button size="mini" type="success" @click='addDynamic'>新增</el-button>
7 7
         </div>
8
+        <el-select v-model="buildingId" placeholder="请选择" @change="getList">
9
+          <el-option
10
+                  v-for="item in buildingList"
11
+                  :key="item.buildingId"
12
+                  :label="item.buildingName"
13
+                  :value="item.buildingId">
14
+          </el-option>
15
+        </el-select>
8 16
       </div>
9 17
       <div class="moreFilter"></div>
10 18
     </div>
11
-    <el-table
12
-      :data="dynamics.list || []"
13
-      >
19
+    <el-table :data="carouselList.records || []">
14 20
       <el-table-column
15
-        type="index">
21
+              type="index">
16 22
         <template slot-scope="scope">
17 23
           <span>{{ GetIndex(scope.$index) }}</span>
18 24
         </template>
19 25
       </el-table-column>
20 26
       <el-table-column
21
-        label="主图">
27
+              label="主图">
22 28
         <template slot-scope="scope">
23 29
           <div class="header">
24
-            <img :src="scope.row.imgUrl" alt="" />
30
+            <img :src="scope.row.image" alt="" />
25 31
           </div>
26 32
         </template>
27 33
       </el-table-column>
28 34
       <el-table-column
29
-        prop="title"
30
-        label="类型">
35
+              prop="showType"
36
+              label="类型">
37
+        <template slot-scope="scope">{{ scope.row.showType === 'banner' ? '轮播图' : scope.row.showType === 'screen' ? '开屏' : '' }}</template>
31 38
       </el-table-column>
32 39
       <el-table-column
33
-        prop="createDate"
34
-        label="发布时间">
40
+              label="发布时间"
41
+              width="180">
42
+        <template slot-scope="scope">
43
+          <span>{{FormatDate(scope.row.createDate)}}</span>
44
+        </template>
35 45
       </el-table-column>
36 46
       <el-table-column
37
-        label="状态"
38
-        >
47
+              label="状态">
39 48
         <template slot-scope="scope">
40 49
           <span>{{scope.row.status == 1 ? '启用' : '停用'}}</span>
41 50
         </template>
42 51
       </el-table-column>
43 52
       <el-table-column
44
-        fixed="right"
45
-        label="操作"
46
-        width="180">
53
+              fixed="right"
54
+              label="操作"
55
+              width="180">
47 56
         <template slot-scope="scope">
48 57
           <el-button type="text" @click="handleEdit(scope.row)" v-if="scope.row.status === 0" size="small">编辑</el-button>
49
-          <el-button type="text" @click="handlePulic(scope.row)" size="small" v-if="scope.row.status === 0">启用</el-button>
50
-          <el-button type="text" @click="handleUnPulic(scope.row)" size="small" v-if="scope.row.status === 1">禁用</el-button>
51
-
58
+          <el-button type="text" @click="handlePulic(scope.row.contentId, 1)" size="small" v-if="scope.row.status === 0">启用</el-button>
59
+          <el-button type="text" @click="Prohibit(scope.row.contentId, 0)" size="small" v-if="scope.row.status === 1">禁用</el-button>
52 60
         </template>
53 61
       </el-table-column>
54 62
     </el-table>
55 63
     <el-pagination
56
-      small
57
-      style="margin-top:10px;"
58
-      layout="prev, pager, next"
59
-      :current-page.sync="currentPage"
60
-      :pageSize="pageSize"
61
-      :total="dynamics.total || 0"
62
-      @current-change="getList"
64
+            small
65
+            style="margin-top:10px;"
66
+            layout="prev, pager, next"
67
+            :current-page.sync="currentPage"
68
+            :pageSize="pageSize"
69
+            :total="carouselList.total || 0"
70
+            @current-change="getList"
63 71
     >
64 72
     </el-pagination>
65 73
   </div>
66 74
 </template>
67 75
 
68 76
 <script>
69
-import { createNamespacedHelpers } from 'vuex';
77
+  import { createNamespacedHelpers } from "vuex";
78
+  import dayjs from 'dayjs'
70 79
 
71
-const {mapState: mapDynamicState, mapActions: mapDynamicActions} = createNamespacedHelpers('dynamic')
72
-const {mapState: mapBuildingState, mapActions: mapBuildingActions} = createNamespacedHelpers('building')
80
+  const {
81
+    mapState: mapCarouselFigureState,
82
+    mapActions: mapCarouselFigureActions
83
+  } = createNamespacedHelpers("carouselFigure");
73 84
 
74
-export default {
75
-  data() {
76
-    return {
77
-      pageSize: 20,
78
-      currentPage: 1,
79
-      name: '',
80
-      buildingId: '',
81
-    }
82
-  },
83
-  computed: {
84
-    ...mapDynamicState({
85
-      dynamics: x => x.dynamics
86
-    }),
87
-    ...mapBuildingState({
88
-      buildings: x => x.buildings
89
-    })
90
-  },
91
-  methods: {
92
-    ...mapDynamicActions([
93
-      'getDynamics',
94
-      'setDetailNull',
95
-      'deleteDynamics',
96
-      'publicDynamic',
97
-      'cancelDynamic'
98
-    ]),
99
-    ...mapBuildingActions([
100
-      'getBuildings',
101
-    ]),
102
-    GetIndex (inx) {
103
-      return (this.currentPage - 1) * this.pageSize + inx + 1
104
-    },
105
-    FormatDate (date) {
106
-      if (date) {
107
-        return dayjs(date).formate('yyyy-MM-DD HH:mm:ss')
108
-      } else {
109
-        return ''
110
-      }
85
+  const {
86
+    mapState: mapBuildingState,
87
+    mapActions: mapBuildingActions
88
+  } = createNamespacedHelpers("building");
89
+
90
+  export default {
91
+    data() {
92
+      return {
93
+        pageSize: 20,
94
+        currentPage: 1,
95
+        name: "",
96
+        buildingId: "",
97
+        buildingList: [], // 所属项目
98
+        buildingForm: { // 所属项目条件
99
+          pageNum: 1,
100
+          pageSize: 100
101
+        },
102
+      };
111 103
     },
112
-    getList () {
113
-      this.getDynamics({
114
-        pageNum: this.currentPage,
115
-        pageSize: this.pageSize,
116
-        name: this.name,
117
-        buildingId: this.buildingId
104
+    computed: {
105
+      ...mapCarouselFigureState({
106
+        carouselList: x => x.carouselList
107
+      }),
108
+      ...mapBuildingState({
109
+        buildings: x => x.buildings
118 110
       })
119 111
     },
120
-    getBuildingName (id) {
121
-      return ((this.buildings.list || []).filter(x => x.buildingId === id)[0] || {}).buildingName || ''
122
-    },
123
-    search () {
124
-      this.currentPage = 1
125
-      this.getList()
126
-    },
127
-    handleEdit (row) {
128
-      this.setDetailNull()
129
-      this.$router.push({name: 'advertisementEdit', query: {id: row.dynamicId}})
130
-    },
131
-    handlePulic (row) {
132
-      this.$confirm('确认发布此数据?', '提示', {
133
-        confirmButtonText: '确定',
134
-        cancelButtonText: '取消',
135
-        type: 'warning'
136
-      }).then(() => {
137
-        this.publicDynamic({
138
-          id: row.dynamicId
112
+    methods: {
113
+      ...mapCarouselFigureActions(["getExtendContent","handleExtendContent"]),
114
+      ...mapBuildingActions(["getBuildings"]),
115
+      GetIndex(inx) {
116
+        return (this.currentPage - 1) * this.pageSize + inx + 1;
117
+      },
118
+      FormatDate(date) {
119
+        if (!date || date.indexOf('0001-') > -1) return ''
120
+
121
+        return dayjs(date).format('YYYY-MM-DD HH:mm:ss')
122
+      },
123
+
124
+      getList() {
125
+        this.getExtendContent({
126
+          pageNum: this.currentPage,
127
+          pageSize: this.pageSize,
128
+          buildingId: this.buildingId,
129
+          showType: 'screen'
130
+        });
131
+      },
132
+      getBuildingName(id) {
133
+        return (
134
+                ((this.buildings.list || []).filter(x => x.buildingId === id)[0] || {})
135
+                        .buildingName || ""
136
+        );
137
+      },
138
+      search() {
139
+        this.currentPage = 1;
140
+        this.getList();
141
+      },
142
+      handleEdit(row) {
143
+        this.$router.push({ name: "advertisementEdit", query: { id: row.contentId } });
144
+      },
145
+      handlePulic(contentId, status) {
146
+        this.$confirm("确认发布此数据?", "提示", {
147
+          confirmButtonText: "确定",
148
+          cancelButtonText: "取消",
149
+          type: "warning"
139 150
         }).then(() => {
140
-          this.getList()
141
-        })
142
-      })
143
-    },
144
-    handleUnPulic (row) {
145
-      this.$confirm('确认取消发布此数据?', '提示', {
146
-        confirmButtonText: '确定',
147
-        cancelButtonText: '取消',
148
-        type: 'warning'
149
-      }).then(() => {
150
-        this.cancelDynamic({
151
-          id: row.dynamicId}).then(() => {
152
-          this.getList()
153
-        })
154
-      })
155
-    },
156
-    handleDel (row) {
157
-      this.$confirm('确认删除此数据?', '提示', {
158
-        confirmButtonText: '确定',
159
-        cancelButtonText: '取消',
160
-        type: 'warning'
161
-      }).then(() => {
162
-        if (row.status === 1) {
163
-          this.$message.error('当前活动处于发布状态,不允许删除!')
164
-          return false
165
-        }
166
-        this.deleteDynamics({
167
-          id: row.dynamicId
151
+          this.updateExtendContent(contentId, status)
152
+        });
153
+      },
154
+      Prohibit(contentId, status) {
155
+        this.$confirm("确认停用此轮播图?", "提示", {
156
+          confirmButtonText: "确定",
157
+          cancelButtonText: "取消",
158
+          type: "warning"
159
+        }).then(() => {
160
+          this.updateExtendContent(contentId, status)
161
+        });
162
+      },
163
+      handleDel(contentId, status) {
164
+        this.$confirm("确认删除此数据?", "提示", {
165
+          confirmButtonText: "确定",
166
+          cancelButtonText: "取消",
167
+          type: "warning"
168 168
         }).then(() => {
169
-          this.getList()
169
+          if (row.status === 1) {
170
+            this.$message.error("当前活动处于发布状态,不允许删除!");
171
+            return false;
172
+          }
173
+        });
174
+      },
175
+      updateExtendContent(contentId, status) { // 修改轮播状态
176
+        this.$store.dispatch('carouselFigure/updateExtendContent', { contentId: contentId, status: status }).then((res) => {
177
+          this.getList();
178
+        }).catch(() =>{
179
+          console.log('carouselFigure/updateExtendContent err')
170 180
         })
171
-      })
181
+      },
182
+      addDynamic() {
183
+        this.$router.push({ name: "advertisementEdit" });
184
+      },
185
+      getBuildList() {
186
+        this.$store.dispatch('building/getBuildings', this.buildingForm).then((res) => {
187
+          this.buildingList = res.records
188
+        }).catch(() => {
189
+          console.log('building/getBuildings err')
190
+        })
191
+      },
172 192
     },
173
-    addDynamic () {
174
-      this.setDetailNull()
175
-      this.$router.push({name: 'advertisementEdit'})
193
+    created() {
194
+      this.getBuildList()
195
+      this.getList();
176 196
     }
177
-  },
178
-  created () {
179
-    this.getBuildings({
180
-      pageNum: 1,
181
-      pageSize: 100,
182
-    }).then(() => {
183
-      this.getList()
184
-    })
185
-  }
186
-}
197
+  };
187 198
 </script>
188 199
 
189 200
 <style lang="scss" scoped>
190
-.header{
191
-  width: 50px;
192
-  height: 50px;
193
-  img{
194
-    width: 100%;
195
-    height: 100%;
201
+  .header {
202
+    width: 50px;
203
+    height: 50px;
204
+    img {
205
+      width: 100%;
206
+      height: 100%;
207
+    }
196 208
   }
197
-}
198 209
 
199
-.system-table-search{
200
-  width: calc(100% - 40px);
201
-  margin: 20px auto 0;
202
-}
210
+  .system-table-search {
211
+    width: calc(100% - 40px);
212
+    margin: 20px auto 0;
213
+  }
203 214
 
204
-.system-table-search li{
205
-  margin-right: 20px;
206
-}
215
+  .system-table-search li {
216
+    margin-right: 20px;
217
+  }
207 218
 
208
-.system-table-search ul{
209
-  font-size: 0;
210
-  white-space: nowrap;
211
-}
219
+  .system-table-search ul {
220
+    font-size: 0;
221
+    white-space: nowrap;
222
+  }
212 223
 
213
-.system-table-search ul>li{
214
-  display: inline-block;
215
-}
224
+  .system-table-search ul > li {
225
+    display: inline-block;
226
+  }
216 227
 
217
-.flex-h {
218
-  display: flex;
219
-  display: -webkit-flex;
220
-}
228
+  .flex-h {
229
+    display: flex;
230
+    display: -webkit-flex;
231
+  }
221 232
 
222
-.flex-item {
223
-  flex: 1;
224
-  -webkit-flex: 1;
225
-  position: relative;
226
-  overflow: hidden;
227
-}
233
+  .flex-item {
234
+    flex: 1;
235
+    -webkit-flex: 1;
236
+    position: relative;
237
+    overflow: hidden;
238
+  }
228 239
 </style>

+ 506
- 414
src/views/carouselFigure/advertisementEdit.vue Parādīt failu

@@ -1,454 +1,546 @@
1 1
 <template>
2
-    <div class="edit-carousel">
3
-      <el-form ref="form" :model="building" label-width="180px">
4
-        <el-form-item label="所属项目:">
5
-          <el-select v-model="buildingProperty" multiple placeholder="请选择">
6
-            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
7
-          </el-select>
8
-        </el-form-item>
9
-        <el-form-item label="主图:">
10
-          <el-upload
11
-            :action="upFileUrl"
12
-            name='file'
13
-            list-type="picture-card"
14
-            :headers="uploadHeaders"
15
-            :file-list="imgList"
16
-            :show-file-list="true"
17
-            :before-upload="beforeImgUpload"
18
-            :on-success="handleAvatarSuccess"
19
-            :on-remove="handleRemove">
20
-            <i class="el-icon-plus"></i>
21
-          </el-upload>
22
-          <el-dialog :visible.sync="dialogVisible">
23
-            <img width="100%" :src="dialogImageUrl" alt="">
24
-          </el-dialog>
25
-        </el-form-item>
26
-        <el-form-item label="标题:">
27
-          <el-input v-model="building.tel"></el-input>
28
-        </el-form-item>
29
-        <el-form-item label="类型:">
30
-          <el-select v-model="buildingProperty" multiple placeholder="请选择">
31
-            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
32
-          </el-select>
33
-        </el-form-item>
34
-        <el-form-item label="发布内容:">
35
-          <div id="websiteEditorElem" style="height: 400px"></div>
36
-        </el-form-item>
37
-        <el-form-item label="发布内容:" class="publish">
38
-          <p>活动名称展示处<span class="choose" v-popover:popover4>{{showPlace?showPlace:'请选择'}}</span></p>
39
-          <el-popover ref="popover4"  placement="right"  width="560" v-model="popover4"  trigger="click">
40
-            <el-table :data="gridData">
41
-            <el-table-column width="360" property="name" label="标题"></el-table-column>
42
-            <el-table-column width="200" label="操作">
43
-              <template slot-scope="scope">
44
-                <el-button type="text" @click="handleEdit(scope.row)" size="small">选择</el-button>
45
-        </template>
46
-            </el-table-column>
47
-            </el-table>
48
-          </el-popover>
49
-        </el-form-item>
50
-        <el-form-item label="状态:">
51
-          <el-select v-model="buildingProperty" multiple placeholder="请选择">
52
-            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
53
-          </el-select>
54
-        </el-form-item>
55
-        <el-form-item>
56
-          <el-button type="primary" @click="onSubmit">保存</el-button>
57
-          <el-button @click="onCancel">取消</el-button>
58
-        </el-form-item>
59
-      </el-form>
60
-    </div>    
2
+  <div class="edit-carousel">
3
+    <el-form ref="form" :model="form" label-width="180px">
4
+      <el-form-item label="所属项目:">
5
+        <el-select v-model="form.buildingId" placeholder="请选择">
6
+          <el-option
7
+                  v-for="item in buildingList"
8
+                  :key="item.buildingId"
9
+                  :label="item.buildingName"
10
+                  :value="item.buildingId">
11
+          </el-option>
12
+        </el-select>
13
+      </el-form-item>
14
+      <el-form-item label="主图:">
15
+        <el-upload
16
+                :headers="uploadHeaders"
17
+                :action="upFileUrl"
18
+                :show-file-list="false"
19
+                :on-success="handleAvatarSuccess">
20
+          <img v-if="imageUrl" :src="imageUrl" class="avatar">
21
+          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
22
+        </el-upload>
23
+      </el-form-item>
24
+      <el-form-item label="标题:">
25
+        <el-input v-model="form.title"></el-input>
26
+      </el-form-item>
27
+      <el-form-item label="发布位置:">
28
+        <el-select v-model="form.showPosition" placeholder="请选择">
29
+          <el-option v-for="(item,i) in showPositionList" :key="i" :label="item.name" :value="item.value"></el-option>
30
+        </el-select>
31
+      </el-form-item>
32
+      <el-form-item label="类型:">
33
+        <el-select v-model="form.contentType" placeholder="请选择">
34
+          <el-option v-for="(t,i) in contentTypeList" :key="i" :label="t.name" :value="t.value"></el-option>
35
+        </el-select>
36
+      </el-form-item>
37
+      <el-form-item label="发布内容:" v-if=" form.contentType === 'other'">
38
+        <rich-editor v-model="form.content" style="height: 400px; width: 1000px;" />
39
+      </el-form-item>
40
+      <el-form-item label="发布活动:" class="publish" v-if=" form.contentType === 'activity'">
41
+        <p>{{ showPlace }}<span class="choose" @click="showDial">请选择</span></p>
42
+      </el-form-item>
43
+      <el-form-item label="状态:">
44
+        <el-select v-model="form.status" placeholder="请选择">
45
+          <el-option v-for="(t,i) in extendContentStatus" :key="i" :label="t.name" :value="t.value"></el-option>
46
+        </el-select>
47
+      </el-form-item>
48
+      <el-form-item>
49
+        <el-button type="primary" @click="submitAddOrUpdate">保存</el-button>
50
+        <el-button @click="onCancel">取消</el-button>
51
+      </el-form-item>
52
+
53
+
54
+      <el-dialog title="选择活动" :visible.sync="dialogTableVisible">
55
+        <el-table :data="activityList">
56
+          <el-table-column property="title" label="活动名称"></el-table-column>
57
+          <el-table-column fixed="right" label="操作">
58
+            <template slot-scope="scope">
59
+              <el-button type="text" @click="handleDel(scope.row)" size="small">选择</el-button>
60
+            </template>
61
+          </el-table-column>
62
+        </el-table>
63
+        <el-pagination
64
+                @size-change="dialogHandleSizeChange"
65
+                @current-change="dialogHandleCurrentChange"
66
+                :current-page.sync="activityForm.pageNum"
67
+                :page-size="activityForm.pageSize"
68
+                layout="total, prev, pager, next"
69
+                :total="activityTotal">
70
+        </el-pagination>
71
+      </el-dialog>
72
+    </el-form>
73
+  </div>
61 74
 </template>
62 75
 
63 76
 <script>
64
-import { createNamespacedHelpers } from "vuex";
65
-import apis from "../../config/api";
66
-import { mapState } from "vuex";
67
-import E from "wangeditor";
77
+  import { createNamespacedHelpers } from "vuex";
78
+  import apis from "../../config/api";
79
+  import { mapState } from "vuex";
80
+  import E from "wangeditor";
68 81
 
69
-const {
70
-  mapState: mapBuildingState,
71
-  mapActions: mapBuildingActions,
72
-  mapMutations: mapBuildingMutations
73
-} = createNamespacedHelpers("building");
82
+  const {
83
+    mapState: mapBuildingState,
84
+    mapActions: mapBuildingActions,
85
+    mapMutations: mapBuildingMutations
86
+  } = createNamespacedHelpers("building");
74 87
 
75
-const { mapActions: mapApartmentActions } = createNamespacedHelpers(
76
-  "apartment"
77
-);
88
+  const { mapActions: mapApartmentActions } = createNamespacedHelpers(
89
+          "apartment"
90
+  );
78 91
 
79
-const { mapActions: mapImgActions } = createNamespacedHelpers("img");
92
+  const { mapActions: mapImgActions } = createNamespacedHelpers("img");
80 93
 
81
-export default {
82
-  data() {
83
-    var _self = this;
84
-    return {
85
-      popover4:false,//弹框
86
-      showPlace:'',//活动名称展示处
87
-      gridData: [
88
-        {
89
-          date: "2016-05-02",
90
-          name: "高奢生活,在遇到它之前你想象不到"
94
+  export default {
95
+    data() {
96
+      var _self = this;
97
+      return {
98
+        form: {
99
+          contentId: '',
100
+          buildingId: '',
101
+          image: '',
102
+          title: '',
103
+          showPosition: '',
104
+          contentType: '',
105
+          content: '',
106
+          status: 0,
107
+          targetId: '',
108
+          showType: 'screen'
91 109
         },
92
-        {
93
-          date: "2016-05-04",
94
-          name: "欢乐套圈圈,福利大放送"
110
+        imageUrl: '',
111
+        buildingList: [], // 所属项目
112
+        buildingForm: { // 所属项目条件
113
+          pageNum: 1,
114
+          pageSize: 100
95 115
         },
96
-        {
97
-          date: "2016-05-01",
98
-          name: "上海市普陀区金沙江路 1518 弄"
99
-        }
100
-      ],
101
-      upFileUrl: apis.file.upload.url,
102
-      commPrefix: "",
103
-      imgurl: "",
104
-      loadingZm: false,
105
-      activeName: "detail",
106
-      dialogImageUrl: "",
107
-      dialogVisible: false,
108
-      dialogApartImageUrl: "",
109
-      dialogApartVisible: false,
110
-      showHx: false,
111
-      imgList: [],
112
-      tags: [],
113
-      buildingProperty: [],
114
-      aparments: [],
115
-      aparmentInfo: {},
116
-      aparmentImg: [],
117
-      saleType: [
118
-        {
119
-          id: 1,
120
-          name: "待定"
116
+        showPositionList: [
117
+          {
118
+            name: '首页',
119
+            value: 'index'
120
+          },
121
+          {
122
+            name: '商城',
123
+            value: 'mall'
124
+          }
125
+        ],
126
+        contentTypeList: [
127
+          {
128
+            name: '活动',
129
+            value: 'activity'
130
+          },
131
+          {
132
+            name: '项目',
133
+            value: 'project'
134
+          },
135
+          {
136
+            name: '资讯',
137
+            value: 'news'
138
+          },
139
+          {
140
+            name: '其他',
141
+            value: 'other'
142
+          }
143
+        ],
144
+        extendContentStatus: [ // 状态
145
+          {
146
+            name: "启用",
147
+            value: 1
148
+          },
149
+          {
150
+            name: "停用",
151
+            value: 0
152
+          },
153
+        ],
154
+        activityForm: { // 活动查询条件
155
+          pageNum: 1,
156
+          pageSize: 10
121 157
         },
122
-        {
123
-          id: 2,
124
-          name: "售罄"
125
-        },
126
-        {
127
-          id: 3,
128
-          name: "在售"
129
-        }
130
-      ]
131
-    };
132
-  },
133
-  computed: {
134
-    ...mapBuildingState({
135
-      detail: x => x.detail
136
-    }),
137
-    ...mapState({
138
-      dicts: x => x.dicts
139
-    }),
140
-    building: {
141
-      get() {
142
-        return this.detail;
143
-      },
144
-      set(val) {
145
-        return this.updateDetail(val);
146
-      }
147
-    },
148
-    propertyType() {
149
-      return (this.dicts || []).filter(x => x.type === "propertyType");
150
-    },
151
-    uploadHeaders() {
152
-      const token = localStorage.getItem("x-token") || "";
153
-      return {
154
-        Authorization: `Bearer ${token}`
155
-      };
156
-    }
157
-  },
158
-  methods: {
159
-    ...mapBuildingMutations(["updateDetail"]),
160
-    ...mapBuildingActions(["getDetail", "addBuilding", "editBuilding"]),
161
-    ...mapApartmentActions([
162
-      "getApartments",
163
-      "getApartmentDetail",
164
-      "addApartment",
165
-      "editApartment",
166
-      "deleteApartment"
167
-    ]),
168
-    ...mapImgActions(["uploadImg"]),
169
-    getSaleTypeName(id) {
170
-      return (this.saleType.filter(x => x.id == id)[0] || {}).name;
171
-    },
172
-    onCancel() {
173
-      this.$router.push({ name: "buildinglist" });
174
-    },
175
-    handleRemove(file, fileList) {
176
-      this.imgList = fileList;
177
-    },
178
-    handleAparmentRemove(file, fileList) {
179
-      this.aparmentImg = fileList;
180
-    },
158
+        activityTotal: 0, // 活动总数
159
+        dialogTableVisible: false, //选择活动弹框
160
+        activityList: [], // 活动列表
181 161
 
182
-    beforeImgUpload(file) {
183
-      if (file.type !== "image/jpeg" && file.type !== "image/png") {
184
-        this.$message.error("上传图片只能是 JPG 或 PNG 格式!");
185
-        return false;
186
-      }
187
-      // if (file.size / 1024 > 300) {
188
-      //   this.$message.error('图片大小不允许超过300k!')
189
-      //   return false
190
-      // }
191
-      this.loading = this.$loading({
192
-        lock: true,
193
-        text: "上传中...",
194
-        spinner: "el-icon-loading",
195
-        background: "rgba(0, 0, 0, 0.7)"
196
-      });
197 162
 
198
-      return true;
199
-    },
200
-    handleAvatarSuccess(res) {
201
-      this.imgList = [
202
-        ...this.imgList,
203
-        {
204
-          url: res.data
205
-        }
206
-      ];
207
-      this.loading.close();
208
-    },
209
-    handleMapImgSuccess(res) {
210
-      this.building = { ...this.building, mapImg: res.data };
211
-      this.loading.close();
212
-    },
213
-    handlePosterSuccess(res) {
214
-      this.building = { ...this.building, poster: res.data };
215
-      this.loading.close();
216
-    },
217
-    handleAparmentSuccess(res) {
218
-      this.aparmentImg = [
219
-        ...this.aparmentImg,
220
-        {
221
-          url: res.data
222
-        }
223
-      ];
224
-      this.loading.close();
225
-    },
226
-    onSubmit() {
227
-      const imgs = this.imgList.map((x, i) => {
228
-        return {
229
-          imgType: "banner",
230
-          url: x.url,
231
-          orderNo: i + 1
232
-        };
233
-      });
234
-      const tag = this.tags.map(x => {
235
-        return {
236
-          tagName: x
237
-        };
238
-      });
239
-      const building = {
240
-        ...this.building,
241
-        img: imgs,
242
-        propertyType: this.buildingProperty.join(","),
243
-        tag
163
+
164
+
165
+
166
+
167
+        // 下面的不敢删除
168
+        popover4:false,//弹框
169
+        showPlace:'',//活动名称展示处
170
+        gridData: [
171
+          {
172
+            date: "2016-05-02",
173
+            name: "高奢生活,在遇到它之前你想象不到"
174
+          },
175
+          {
176
+            date: "2016-05-04",
177
+            name: "欢乐套圈圈,福利大放送"
178
+          },
179
+          {
180
+            date: "2016-05-01",
181
+            name: "上海市普陀区金沙江路 1518 弄"
182
+          }
183
+        ],
184
+        upFileUrl: apis.file.upload.url,
185
+        commPrefix: "",
186
+        imgurl: "",
187
+        loadingZm: false,
188
+        activeName: "detail",
189
+        dialogImageUrl: "",
190
+        dialogVisible: false,
191
+        dialogApartImageUrl: "",
192
+        dialogApartVisible: false,
193
+        showHx: false,
194
+        imgList: [],
195
+        tags: [],
196
+        buildingProperty: [],
197
+        aparments: [],
198
+        aparmentInfo: {},
199
+        aparmentImg: [],
200
+        saleType: [
201
+          {
202
+            id: 1,
203
+            name: "待定"
204
+          },
205
+          {
206
+            id: 2,
207
+            name: "售罄"
208
+          },
209
+          {
210
+            id: 3,
211
+            name: "在售"
212
+          }
213
+        ]
244 214
       };
245
-      if (!building.buildingId) {
246
-        // 新增
247
-        this.addBuilding({
248
-          onSuccess: this.onCancel,
249
-          detail: JSON.stringify(building)
250
-        });
251
-      } else {
252
-        // 修改
253
-        this.editBuilding({
254
-          onSuccess: this.onCancel,
255
-          detail: JSON.stringify(building)
256
-        });
257
-      }
258 215
     },
259
-    FormatDate(date) {
260
-      return (date || "").split("T")[0] === "0001-01-01"
261
-        ? ""
262
-        : (date || "").split("T")[0];
263
-    },
264
-    saveAparment() {
265
-      const imgs = this.aparmentImg.map((x, i) => {
216
+    computed: {
217
+      ...mapBuildingState({
218
+        detail: x => x.detail
219
+      }),
220
+      ...mapState({
221
+        dicts: x => x.dicts
222
+      }),
223
+      building: {
224
+        get() {
225
+          return this.detail;
226
+        },
227
+        set(val) {
228
+          return this.updateDetail(val);
229
+        }
230
+      },
231
+      propertyType() {
232
+        return (this.dicts || []).filter(x => x.type === "propertyType");
233
+      },
234
+      uploadHeaders() {
235
+        const token = localStorage.getItem("x-token") || "";
266 236
         return {
267
-          imgType: "aparment",
268
-          url: x.url,
269
-          orderNo: i + 1
237
+          Authorization: `Bearer ${token}`
270 238
         };
271
-      });
272
-      if (!this.aparmentInfo.apartmentId) {
273
-        this.addApartment(
274
-          JSON.stringify({
275
-            ...this.aparmentInfo,
276
-            img: imgs
277
-          })
278
-        ).then(() => {
279
-          this.getAparmentList();
280
-          this.showHx = false;
281
-        });
282
-      } else {
283
-        this.editApartment(
284
-          JSON.stringify({
285
-            ...this.aparmentInfo,
286
-            img: imgs
287
-          })
288
-        ).then(() => {
289
-          this.getAparmentList();
290
-          this.showHx = false;
291
-        });
292 239
       }
293 240
     },
294
-    addHx() {
295
-      this.aparmentImg = [];
296
-      this.aparmentInfo = { buildingId: this.building.buildingId };
297
-      this.showHx = true;
298
-    },
299
-    getAparmentList() {
300
-      this.getApartments({ buildingId: this.$route.query.id }).then(data => {
301
-        this.aparments = data;
302
-      });
303
-    },
304
-    handleEdit(row){
305
-      this.showPlace = row.name
306
-      this.popover4 = false
307
-
241
+    methods: {
242
+      ...mapBuildingMutations(["updateDetail"]),
243
+      ...mapBuildingActions(["getDetail", "addBuilding", "editBuilding"]),
244
+      ...mapApartmentActions([
245
+        "getApartments",
246
+        "getApartmentDetail",
247
+        "addApartment",
248
+        "editApartment",
249
+        "deleteApartment"
250
+      ]),
251
+      ...mapImgActions(["uploadImg"]),
252
+      getSaleTypeName(id) {
253
+        return (this.saleType.filter(x => x.id == id)[0] || {}).name;
254
+      },
255
+      onCancel() {
256
+        this.$router.push({ name: "buildinglist" });
257
+      },
258
+      handleRemove(file, fileList) {
259
+        this.imgList = fileList;
260
+      },
261
+      handleAparmentRemove(file, fileList) {
262
+        this.aparmentImg = fileList;
263
+      },
308 264
 
309
-    },
310
-    // handleEdit(row) {
311
-    //   this.aparmentImg = [];
312
-    //   this.getApartmentDetail({
313
-    //     id: row.apartmentId
314
-    //   }).then(data => {
315
-    //     console.log("...", data);
316
-    //     this.aparmentImg = data.buildingImgList.map(x => {
317
-    //       return {
318
-    //         name: x.imgId,
319
-    //         url: x.url
320
-    //       };
321
-    //     });
322
-    //     this.aparmentInfo = data;
323
-    //     this.showHx = true;
324
-    //   });
325
-    // },
326
-    handleDel(row) {
327
-      this.$confirm("确认删除此数据?", "提示", {
328
-        confirmButtonText: "确定",
329
-        cancelButtonText: "取消",
330
-        type: "warning"
331
-      }).then(() => {
332
-        if (this.building.status === 1) {
333
-          this.$message.error("当前楼盘处于发布状态,不允许删除!");
265
+      beforeImgUpload(file) {
266
+        if (file.type !== "image/jpeg" && file.type !== "image/png") {
267
+          this.$message.error("上传图片只能是 JPG 或 PNG 格式!");
334 268
           return false;
335 269
         }
336
-        this.deleteApartment({
337
-          id: row.apartmentId
338
-        }).then(() => {
339
-          this.getAparmentList();
270
+        // if (file.size / 1024 > 300) {
271
+        //   this.$message.error('图片大小不允许超过300k!')
272
+        //   return false
273
+        // }
274
+        this.loading = this.$loading({
275
+          lock: true,
276
+          text: "上传中...",
277
+          spinner: "el-icon-loading",
278
+          background: "rgba(0, 0, 0, 0.7)"
340 279
         });
341
-      });
342
-    }
343
-  },
344
-  mounted() {
345
-    const _that = this;
346
-    const phoneEditor = new E("#websiteEditorElem");
347
-    phoneEditor.customConfig.onchange = function(html) {
348
-      _that.building = { ..._that.building, remark: html };
349
-    };
350
-    phoneEditor.customConfig.customUploadImg = function(files, insert) {
351
-      _that.uploadImg(files[0]).then(data => {
352
-        insert(data[0]);
353
-      });
354
-    };
355
-    phoneEditor.customConfig.menus = [
356
-      "head", // 标题
357
-      "bold", // 粗体
358
-      "fontSize", // 字号
359
-      "fontName", // 字体
360
-      "italic", // 斜体
361
-      "underline", // 下划线
362
-      "strikeThrough", // 删除线
363
-      "foreColor", // 文字颜色
364
-      "backColor", // 背景颜色
365
-      "justify", // 对齐方式
366
-      "image" // 插入图片
367
-    ];
368
-    phoneEditor.create();
369
-    if ((this.$route.query.id || "") !== "") {
370
-      this.getAparmentList();
371
-      window.console.log(this.getDetail);
372
-      this.getDetail({ id: this.$route.query.id }).then(data => {
373
-        this.buildingProperty = data.propertyType.split(",");
374
-        phoneEditor.txt.html(data.remark);
375
-        this.imgList = data.buildingImg.map(x => {
280
+
281
+        return true;
282
+      },
283
+      handleAvatarSuccess(res) {
284
+        this.imageUrl = res.data
285
+        this.form.image = res.data
286
+      },
287
+      handleMapImgSuccess(res) {
288
+        this.building = { ...this.building, mapImg: res.data };
289
+        this.loading.close();
290
+      },
291
+      handlePosterSuccess(res) {
292
+        this.building = { ...this.building, poster: res.data };
293
+        this.loading.close();
294
+      },
295
+      handleAparmentSuccess(res) {
296
+        this.aparmentImg = [
297
+          ...this.aparmentImg,
298
+          {
299
+            url: res.data
300
+          }
301
+        ];
302
+        this.loading.close();
303
+      },
304
+      onSubmit() {
305
+        const imgs = this.imgList.map((x, i) => {
306
+          return {
307
+            imgType: "banner",
308
+            url: x.url,
309
+            orderNo: i + 1
310
+          };
311
+        });
312
+        const tag = this.tags.map(x => {
313
+          return {
314
+            tagName: x
315
+          };
316
+        });
317
+        const building = {
318
+          ...this.building,
319
+          img: imgs,
320
+          propertyType: this.buildingProperty.join(","),
321
+          tag
322
+        };
323
+        if (!building.buildingId) {
324
+          // 新增
325
+          this.addBuilding({
326
+            onSuccess: this.onCancel,
327
+            detail: JSON.stringify(building)
328
+          });
329
+        } else {
330
+          // 修改
331
+          this.editBuilding({
332
+            onSuccess: this.onCancel,
333
+            detail: JSON.stringify(building)
334
+          });
335
+        }
336
+      },
337
+      FormatDate(date) {
338
+        return (date || "").split("T")[0] === "0001-01-01"
339
+                ? ""
340
+                : (date || "").split("T")[0];
341
+      },
342
+      saveAparment() {
343
+        const imgs = this.aparmentImg.map((x, i) => {
376 344
           return {
377
-            name: x.imgId,
378
-            url: x.url
345
+            imgType: "aparment",
346
+            url: x.url,
347
+            orderNo: i + 1
379 348
           };
380 349
         });
381
-        this.tags = data.buildingTag.map(x => x.tagName);
382
-      });
383
-    } else {
384
-      phoneEditor.txt.html("");
350
+        if (!this.aparmentInfo.apartmentId) {
351
+          this.addApartment(
352
+                  JSON.stringify({
353
+                    ...this.aparmentInfo,
354
+                    img: imgs
355
+                  })
356
+          ).then(() => {
357
+            this.getAparmentList();
358
+            this.showHx = false;
359
+          });
360
+        } else {
361
+          this.editApartment(
362
+                  JSON.stringify({
363
+                    ...this.aparmentInfo,
364
+                    img: imgs
365
+                  })
366
+          ).then(() => {
367
+            this.getAparmentList();
368
+            this.showHx = false;
369
+          });
370
+        }
371
+      },
372
+      addHx() {
373
+        this.aparmentImg = [];
374
+        this.aparmentInfo = { buildingId: this.building.buildingId };
375
+        this.showHx = true;
376
+      },
377
+      getAparmentList() {
378
+        this.getApartments({ buildingId: this.$route.query.id }).then(data => {
379
+          this.aparments = data;
380
+        });
381
+      },
382
+      handleEdit(row){
383
+        this.showPlace = row.name
384
+        this.popover4 = false
385
+
386
+
387
+      },
388
+      // handleEdit(row) {
389
+      //   this.aparmentImg = [];
390
+      //   this.getApartmentDetail({
391
+      //     id: row.apartmentId
392
+      //   }).then(data => {
393
+      //     console.log("...", data);
394
+      //     this.aparmentImg = data.buildingImgList.map(x => {
395
+      //       return {
396
+      //         name: x.imgId,
397
+      //         url: x.url
398
+      //       };
399
+      //     });
400
+      //     this.aparmentInfo = data;
401
+      //     this.showHx = true;
402
+      //   });
403
+      // },
404
+      handleDel(row) { // 选择
405
+        this.form.targetId = row.dynamicId
406
+        this.showPlace = row.title
407
+        this.dialogTableVisible = false
408
+      },
409
+
410
+      showDial() { // 显示活动弹窗
411
+        this.dialogTableVisible = true
412
+        this.getActivityList()
413
+      },
414
+      getExtendContentById() {
415
+        this.$store.dispatch('carouselFigure/getByIdExtendContent', this.form).then((res) => {
416
+          console.log('carouselFigure/getByIdExtendContent', res)
417
+          this.form = res
418
+          this.imageUrl = res.image
419
+          this.showPlace = res.targetName
420
+        }).catch(() => {
421
+          console.log('carouselFigure/getByIdExtendContent err')
422
+        })
423
+      },
424
+      getBuildList() {
425
+        this.$store.dispatch('building/getBuildings', this.buildingForm).then((res) => {
426
+          this.buildingList = res.records
427
+        }).catch(() => {
428
+          console.log('building/getBuildings err')
429
+        })
430
+      },
431
+      getActivityList() { // 活动列表
432
+        this.$store.dispatch('activity/getActivityList',this.activityForm).then(res => {
433
+          this.activityList = res.list;
434
+          this.activityForm.pageSize = res.pageSize
435
+          this.activityForm.pageNum = res.pageNum
436
+          this.activityTotal = res.total
437
+        }).catch(err => {
438
+          this.$notify.error(err.msg || err.message);
439
+        });
440
+      },
441
+      dialogHandleSizeChange(value) {
442
+        this.activityForm.pageSize = value
443
+        this.getActivityList()
444
+      },
445
+      dialogHandleCurrentChange(value) {
446
+        this.activityForm.pageNum = value
447
+        this.getActivityList()
448
+      },
449
+      submitAddOrUpdate() { // 添加或者修改
450
+
451
+        // 添加
452
+        if (this.form.contentId === undefined || this.form.contentId === '') {
453
+          this.$store.dispatch('carouselFigure/addExtendContent', this.form).then((res) => {
454
+            this.$message.success('操作成功')
455
+            this.$router.go(-1)
456
+          }).catch(() => {
457
+
458
+          })
459
+          return
460
+        }
461
+
462
+        // 修改
463
+        this.$store.dispatch('carouselFigure/updateExtendContent', this.form).then((res) => {
464
+          this.$message.success('操作成功')
465
+          this.$router.go(-1)
466
+        }).catch(() => {
467
+          console.log('carouselFigure/updateExtendContent err')
468
+        })
469
+      },
470
+
471
+    },
472
+    created() {
473
+      this.form.contentId = this.$route.query.id
474
+      if (this.$route.query.id !== undefined) {
475
+        this.getExtendContentById()
476
+      }
477
+      this.getBuildList()
385 478
     }
386
-  }
387
-};
479
+  };
388 480
 </script>
389 481
 
390 482
 <style lang="scss">
391
-.header {
392
-  width: 50px;
393
-  height: 50px;
394
-  img {
395
-    width: 100%;
396
-    height: 100%;
483
+  .header {
484
+    width: 50px;
485
+    height: 50px;
486
+    img {
487
+      width: 100%;
488
+      height: 100%;
489
+    }
397 490
   }
398
-}
399
-.avatar-uploader .el-upload {
400
-  border: 1px dashed #d9d9d9;
401
-  border-radius: 6px;
402
-  cursor: pointer;
403
-  position: relative;
404
-  overflow: hidden;
405
-}
406
-.avatar-uploader .el-upload:hover {
407
-  border-color: #409eff;
408
-}
409
-.avatar-uploader-icon {
410
-  font-size: 28px;
411
-  color: #8c939d;
412
-  width: 178px;
413
-  height: 178px;
414
-  line-height: 178px;
415
-  text-align: center;
416
-}
417
-.avatar {
418
-  width: 178px;
419
-  height: 178px;
420
-  display: block;
421
-}
422
-.edit-carousel {
423
-  .el-select {
424
-    max-width: 300px !important;
491
+  .avatar-uploader .el-upload {
492
+    border: 1px dashed #d9d9d9;
493
+    border-radius: 6px;
494
+    cursor: pointer;
495
+    position: relative;
496
+    overflow: hidden;
425 497
   }
426
-  .el-input {
427
-    max-width: 400px;
498
+  .avatar-uploader .el-upload:hover {
499
+    border-color: #409eff;
428 500
   }
429
-  .publish {
430
-    p {
431
-      margin: 0;
432
-      font-size: 15.4px;
433
-      .choose {
434
-        color: blue;
435
-        margin-left: 15px;
501
+  .avatar-uploader-icon {
502
+    font-size: 28px;
503
+    color: #8c939d;
504
+    width: 178px;
505
+    height: 178px;
506
+    line-height: 178px;
507
+    text-align: center;
508
+  }
509
+  .avatar {
510
+    width: 178px;
511
+    height: 178px;
512
+    display: block;
513
+  }
514
+  .edit-carousel {
515
+    .el-select {
516
+      max-width: 300px !important;
517
+    }
518
+    .el-input {
519
+      max-width: 400px;
520
+    }
521
+    .publish {
522
+      p {
523
+        margin: 0;
524
+        font-size: 15.4px;
525
+        .choose {
526
+          color: blue;
527
+          margin-left: 15px;
528
+        }
436 529
       }
437 530
     }
438 531
   }
439
-}
440
-.el-popover {
441
-  z-index: 10004 !important;
442
-  .el-table .cell{
443
-    text-align: center;
532
+  .el-popover {
533
+    z-index: 10004 !important;
534
+    .el-table .cell{
535
+      text-align: center;
536
+    }
444 537
   }
445
-}
446 538
 
447
-.el-select-dropdown {
448
-  z-index: 10003 !important;
449
-}
539
+  .el-select-dropdown {
540
+    z-index: 10003 !important;
541
+  }
450 542
 
451
-.el-date-picker {
452
-  z-index: 10002 !important;
453
-}
543
+  .el-date-picker {
544
+    z-index: 10002 !important;
545
+  }
454 546
 </style>

+ 189
- 102
src/views/carouselFigure/edit.vue Parādīt failu

@@ -1,66 +1,74 @@
1 1
 <template>
2 2
     <div class="edit-carousel">
3
-      <el-form ref="form" :model="building" label-width="180px">
3
+      <el-form ref="form" :model="form" label-width="180px">
4 4
         <el-form-item label="所属项目:">
5
-          <el-select v-model="buildingProperty" multiple placeholder="请选择">
6
-            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
5
+          <el-select v-model="form.buildingId" placeholder="请选择">
6
+            <el-option
7
+                    v-for="item in buildingList"
8
+                    :key="item.buildingId"
9
+                    :label="item.buildingName"
10
+                    :value="item.buildingId">
11
+            </el-option>
7 12
           </el-select>
8 13
         </el-form-item>
9 14
         <el-form-item label="主图:">
10 15
           <el-upload
11
-            :action="upFileUrl"
12
-            name='file'
13
-            list-type="picture-card"
14
-            :headers="uploadHeaders"
15
-            :file-list="imgList"
16
-            :show-file-list="true"
17
-            :before-upload="beforeImgUpload"
18
-            :on-success="handleAvatarSuccess"
19
-            :on-remove="handleRemove">
20
-            <i class="el-icon-plus"></i>
16
+                  :headers="uploadHeaders"
17
+                  :action="upFileUrl"
18
+                  :show-file-list="false"
19
+                  :on-success="handleAvatarSuccess">
20
+            <img v-if="imageUrl" :src="imageUrl" class="avatar">
21
+            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
21 22
           </el-upload>
22
-          <el-dialog :visible.sync="dialogVisible">
23
-            <img width="100%" :src="dialogImageUrl" alt="">
24
-          </el-dialog>
25 23
         </el-form-item>
26 24
         <el-form-item label="标题:">
27
-          <el-input v-model="building.tel"></el-input>
25
+          <el-input v-model="form.title"></el-input>
28 26
         </el-form-item>
29 27
         <el-form-item label="发布位置:">
30
-          <el-select v-model="buildingProperty" multiple placeholder="请选择">
31
-            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
28
+          <el-select v-model="form.showPosition" placeholder="请选择">
29
+            <el-option v-for="(item,i) in showPositionList" :key="i" :label="item.name" :value="item.value"></el-option>
32 30
           </el-select>
33 31
         </el-form-item>
34 32
         <el-form-item label="类型:">
35
-          <el-select v-model="buildingProperty" multiple placeholder="请选择">
36
-            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
33
+          <el-select v-model="form.contentType" placeholder="请选择">
34
+            <el-option v-for="(t,i) in contentTypeList" :key="i" :label="t.name" :value="t.value"></el-option>
37 35
           </el-select>
38 36
         </el-form-item>
39
-        <el-form-item label="发布内容:">
40
-          <div id="websiteEditorElem" style="height: 400px"></div>
37
+        <el-form-item label="发布内容:" v-if=" form.contentType === 'other'">
38
+          <rich-editor v-model="form.content" style="height: 400px; width: 1000px;" />
41 39
         </el-form-item>
42
-        <el-form-item label="发布内容:" class="publish">
43
-          <p>活动名称展示处<span class="choose" v-popover:popover4>{{showPlace?showPlace:'请选择'}}</span></p>
44
-          <el-popover ref="popover4"  placement="right"  width="560" v-model="popover4"  trigger="click">
45
-            <el-table :data="gridData">
46
-            <el-table-column width="360" property="name" label="标题"></el-table-column>
47
-            <el-table-column width="200" label="操作">
48
-              <template slot-scope="scope">
49
-                <el-button type="text" @click="handleEdit(scope.row)" size="small">选择</el-button>
50
-        </template>
51
-            </el-table-column>
52
-            </el-table>
53
-          </el-popover>
40
+        <el-form-item label="发布活动:" class="publish" v-if=" form.contentType === 'activity'">
41
+          <p>{{ showPlace }}<span class="choose" @click="showDial">请选择</span></p>
54 42
         </el-form-item>
55 43
         <el-form-item label="状态:">
56
-          <el-select v-model="buildingProperty" multiple placeholder="请选择">
57
-            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
44
+          <el-select v-model="form.status" placeholder="请选择">
45
+            <el-option v-for="(t,i) in extendContentStatus" :key="i" :label="t.name" :value="t.value"></el-option>
58 46
           </el-select>
59 47
         </el-form-item>
60 48
         <el-form-item>
61
-          <el-button type="primary" @click="onSubmit">保存</el-button>
49
+          <el-button type="primary" @click="submitAddOrUpdate">保存</el-button>
62 50
           <el-button @click="onCancel">取消</el-button>
63 51
         </el-form-item>
52
+
53
+
54
+        <el-dialog title="选择活动" :visible.sync="dialogTableVisible">
55
+          <el-table :data="activityList">
56
+            <el-table-column property="title" label="活动名称"></el-table-column>
57
+            <el-table-column fixed="right" label="操作">
58
+              <template slot-scope="scope">
59
+                <el-button type="text" @click="handleDel(scope.row)" size="small">选择</el-button>
60
+              </template>
61
+            </el-table-column>
62
+          </el-table>
63
+          <el-pagination
64
+                  @size-change="dialogHandleSizeChange"
65
+                  @current-change="dialogHandleCurrentChange"
66
+                  :current-page.sync="activityForm.pageNum"
67
+                  :page-size="activityForm.pageSize"
68
+                  layout="total, prev, pager, next"
69
+                  :total="activityTotal">
70
+          </el-pagination>
71
+        </el-dialog>
64 72
       </el-form>
65 73
     </div>    
66 74
 </template>
@@ -87,6 +95,76 @@ export default {
87 95
   data() {
88 96
     var _self = this;
89 97
     return {
98
+      form: {
99
+        contentId: '',
100
+        buildingId: '',
101
+        image: '',
102
+        title: '',
103
+        showPosition: '',
104
+        contentType: '',
105
+        content: '',
106
+        status: 0,
107
+        targetId: '',
108
+        showType: 'banner'
109
+      },
110
+      imageUrl: '',
111
+      buildingList: [], // 所属项目
112
+      buildingForm: { // 所属项目条件
113
+        pageNum: 1,
114
+        pageSize: 100
115
+      },
116
+      showPositionList: [
117
+        {
118
+          name: '首页',
119
+          value: 'index'
120
+        },
121
+        {
122
+          name: '商城',
123
+          value: 'mall'
124
+        }
125
+      ],
126
+      contentTypeList: [
127
+        {
128
+          name: '活动',
129
+          value: 'activity'
130
+        },
131
+        {
132
+          name: '项目',
133
+          value: 'project'
134
+        },
135
+        {
136
+          name: '资讯',
137
+          value: 'news'
138
+        },
139
+        {
140
+          name: '其他',
141
+          value: 'other'
142
+        }
143
+      ],
144
+      extendContentStatus: [ // 状态
145
+        {
146
+          name: "启用",
147
+          value: 1
148
+        },
149
+        {
150
+          name: "停用",
151
+          value: 0
152
+        },
153
+      ],
154
+      activityForm: { // 活动查询条件
155
+        pageNum: 1,
156
+        pageSize: 10
157
+      },
158
+      activityTotal: 0, // 活动总数
159
+      dialogTableVisible: false, //选择活动弹框
160
+      activityList: [], // 活动列表
161
+
162
+
163
+
164
+
165
+
166
+
167
+      // 下面的不敢删除
90 168
       popover4:false,//弹框
91 169
       showPlace:'',//活动名称展示处
92 170
       gridData: [
@@ -203,13 +281,8 @@ export default {
203 281
       return true;
204 282
     },
205 283
     handleAvatarSuccess(res) {
206
-      this.imgList = [
207
-        ...this.imgList,
208
-        {
209
-          url: res.data
210
-        }
211
-      ];
212
-      this.loading.close();
284
+      this.imageUrl = res.data
285
+      this.form.image = res.data
213 286
     },
214 287
     handleMapImgSuccess(res) {
215 288
       this.building = { ...this.building, mapImg: res.data };
@@ -328,66 +401,80 @@ export default {
328 401
     //     this.showHx = true;
329 402
     //   });
330 403
     // },
331
-    handleDel(row) {
332
-      this.$confirm("确认删除此数据?", "提示", {
333
-        confirmButtonText: "确定",
334
-        cancelButtonText: "取消",
335
-        type: "warning"
336
-      }).then(() => {
337
-        if (this.building.status === 1) {
338
-          this.$message.error("当前楼盘处于发布状态,不允许删除!");
339
-          return false;
340
-        }
341
-        this.deleteApartment({
342
-          id: row.apartmentId
343
-        }).then(() => {
344
-          this.getAparmentList();
345
-        });
404
+    handleDel(row) { // 选择
405
+      this.form.targetId = row.dynamicId
406
+      this.showPlace = row.title
407
+      this.dialogTableVisible = false
408
+    },
409
+
410
+    showDial() { // 显示活动弹窗
411
+      this.dialogTableVisible = true
412
+      this.getActivityList()
413
+    },
414
+    getExtendContentById() {
415
+      this.$store.dispatch('carouselFigure/getByIdExtendContent', this.form).then((res) => {
416
+        console.log('carouselFigure/getByIdExtendContent', res)
417
+        this.form = res
418
+        this.imageUrl = res.image
419
+        this.showPlace = res.targetName
420
+      }).catch(() => {
421
+        console.log('carouselFigure/getByIdExtendContent err')
422
+      })
423
+    },
424
+    getBuildList() {
425
+      this.$store.dispatch('building/getBuildings', this.buildingForm).then((res) => {
426
+        this.buildingList = res.records
427
+      }).catch(() => {
428
+        console.log('building/getBuildings err')
429
+      })
430
+    },
431
+    getActivityList() { // 活动列表
432
+      this.$store.dispatch('activity/getActivityList',this.activityForm).then(res => {
433
+        this.activityList = res.list;
434
+        this.activityForm.pageSize = res.pageSize
435
+        this.activityForm.pageNum = res.pageNum
436
+        this.activityTotal = res.total
437
+      }).catch(err => {
438
+        this.$notify.error(err.msg || err.message);
346 439
       });
347
-    }
440
+    },
441
+    dialogHandleSizeChange(value) {
442
+      this.activityForm.pageSize = value
443
+      this.getActivityList()
444
+    },
445
+    dialogHandleCurrentChange(value) {
446
+      this.activityForm.pageNum = value
447
+      this.getActivityList()
448
+    },
449
+    submitAddOrUpdate() { // 添加或者修改
450
+
451
+      // 添加
452
+      if (this.form.contentId === undefined || this.form.contentId === '') {
453
+        this.$store.dispatch('carouselFigure/addExtendContent', this.form).then((res) => {
454
+          this.$message.success('操作成功')
455
+          this.$router.go(-1)
456
+        }).catch(() => {
457
+
458
+        })
459
+        return
460
+      }
461
+
462
+      // 修改
463
+      this.$store.dispatch('carouselFigure/updateExtendContent', this.form).then((res) => {
464
+        this.$message.success('操作成功')
465
+        this.$router.go(-1)
466
+      }).catch(() => {
467
+        console.log('carouselFigure/updateExtendContent err')
468
+      })
469
+    },
470
+
348 471
   },
349
-  mounted() {
350
-    const _that = this;
351
-    const phoneEditor = new E("#websiteEditorElem");
352
-    phoneEditor.customConfig.onchange = function(html) {
353
-      _that.building = { ..._that.building, remark: html };
354
-    };
355
-    phoneEditor.customConfig.customUploadImg = function(files, insert) {
356
-      _that.uploadImg(files[0]).then(data => {
357
-        insert(data[0]);
358
-      });
359
-    };
360
-    phoneEditor.customConfig.menus = [
361
-      "head", // 标题
362
-      "bold", // 粗体
363
-      "fontSize", // 字号
364
-      "fontName", // 字体
365
-      "italic", // 斜体
366
-      "underline", // 下划线
367
-      "strikeThrough", // 删除线
368
-      "foreColor", // 文字颜色
369
-      "backColor", // 背景颜色
370
-      "justify", // 对齐方式
371
-      "image" // 插入图片
372
-    ];
373
-    phoneEditor.create();
374
-    if ((this.$route.query.id || "") !== "") {
375
-      this.getAparmentList();
376
-      window.console.log(this.getDetail);
377
-      this.getDetail({ id: this.$route.query.id }).then(data => {
378
-        this.buildingProperty = data.propertyType.split(",");
379
-        phoneEditor.txt.html(data.remark);
380
-        this.imgList = data.buildingImg.map(x => {
381
-          return {
382
-            name: x.imgId,
383
-            url: x.url
384
-          };
385
-        });
386
-        this.tags = data.buildingTag.map(x => x.tagName);
387
-      });
388
-    } else {
389
-      phoneEditor.txt.html("");
472
+  created() {
473
+    this.form.contentId = this.$route.query.id
474
+    if (this.$route.query.id !== undefined) {
475
+      this.getExtendContentById()
390 476
     }
477
+    this.getBuildList()
391 478
   }
392 479
 };
393 480
 </script>

+ 115
- 102
src/views/carouselFigure/list.vue Parādīt failu

@@ -5,12 +5,18 @@
5 5
         <div class="flex-item flex-h">
6 6
           <el-button size="mini" type="success" @click='addDynamic'>新增</el-button>
7 7
         </div>
8
+        <el-select v-model="buildingId" placeholder="请选择" @change="getList">
9
+          <el-option
10
+                  v-for="item in buildingList"
11
+                  :key="item.buildingId"
12
+                  :label="item.buildingName"
13
+                  :value="item.buildingId">
14
+          </el-option>
15
+        </el-select>
8 16
       </div>
9 17
       <div class="moreFilter"></div>
10 18
     </div>
11
-    <el-table
12
-      :data="dynamics.list || []"
13
-      >
19
+    <el-table :data="carouselList.records || []">
14 20
       <el-table-column
15 21
         type="index">
16 22
         <template slot-scope="scope">
@@ -21,21 +27,26 @@
21 27
         label="主图">
22 28
         <template slot-scope="scope">
23 29
           <div class="header">
24
-            <img :src="scope.row.imgUrl" alt="" />
30
+            <img :src="scope.row.image" alt="" />
25 31
           </div>
26 32
         </template>
27 33
       </el-table-column>
28 34
       <el-table-column
29
-        prop="title"
35
+        prop="showType"
30 36
         label="类型">
37
+        <template slot-scope="scope">{{ scope.row.showType === 'banner' ? '轮播图' : scope.row.showType === 'screen' ? '开屏' : '' }}</template>
31 38
       </el-table-column>
32 39
       <el-table-column
33
-        prop="desc"
40
+        prop="showPosition"
34 41
         label="发布位置">
42
+        <template slot-scope="scope">{{ scope.row.showPosition === 'index' ? '首页' : scope.row.showPosition === 'mall' ? '商城' : '' }}</template>
35 43
       </el-table-column>
36 44
       <el-table-column
37
-        prop="createDate"
38
-        label="发布时间">
45
+        label="发布时间"
46
+        width="180">
47
+        <template slot-scope="scope">
48
+          <span>{{FormatDate(scope.row.createDate)}}</span>
49
+        </template>
39 50
       </el-table-column>
40 51
       <el-table-column
41 52
         label="状态"
@@ -50,9 +61,8 @@
50 61
         width="180">
51 62
         <template slot-scope="scope">
52 63
           <el-button type="text" @click="handleEdit(scope.row)" v-if="scope.row.status === 0" size="small">编辑</el-button>
53
-          <el-button type="text" @click="handlePulic(scope.row)" size="small" v-if="scope.row.status === 0">启用</el-button>
54
-          <el-button type="text" @click="handleUnPulic(scope.row)" size="small" v-if="scope.row.status === 1">禁用</el-button>
55
-
64
+          <el-button type="text" @click="handlePulic(scope.row.contentId, 1)" size="small" v-if="scope.row.status === 0">启用</el-button>
65
+          <el-button type="text" @click="Prohibit(scope.row.contentId, 0)" size="small" v-if="scope.row.status === 1">禁用</el-button>
56 66
         </template>
57 67
       </el-table-column>
58 68
     </el-table>
@@ -62,7 +72,7 @@
62 72
       layout="prev, pager, next"
63 73
       :current-page.sync="currentPage"
64 74
       :pageSize="pageSize"
65
-      :total="dynamics.total || 0"
75
+      :total="carouselList.total || 0"
66 76
       @current-change="getList"
67 77
     >
68 78
     </el-pagination>
@@ -70,151 +80,154 @@
70 80
 </template>
71 81
 
72 82
 <script>
73
-import { createNamespacedHelpers } from 'vuex';
83
+import { createNamespacedHelpers } from "vuex";
84
+import dayjs from 'dayjs'
74 85
 
75
-const {mapState: mapDynamicState, mapActions: mapDynamicActions} = createNamespacedHelpers('dynamic')
76
-const {mapState: mapBuildingState, mapActions: mapBuildingActions} = createNamespacedHelpers('building')
86
+const {
87
+  mapState: mapCarouselFigureState,
88
+  mapActions: mapCarouselFigureActions
89
+} = createNamespacedHelpers("carouselFigure");
90
+
91
+const {
92
+  mapState: mapBuildingState,
93
+  mapActions: mapBuildingActions
94
+} = createNamespacedHelpers("building");
77 95
 
78 96
 export default {
79 97
   data() {
80 98
     return {
81 99
       pageSize: 20,
82 100
       currentPage: 1,
83
-      name: '',
84
-      buildingId: '',
85
-    }
101
+      name: "",
102
+      buildingId: "",
103
+      buildingList: [], // 所属项目
104
+      buildingForm: { // 所属项目条件
105
+        pageNum: 1,
106
+        pageSize: 100
107
+      },
108
+    };
86 109
   },
87 110
   computed: {
88
-    ...mapDynamicState({
89
-      dynamics: x => x.dynamics
111
+    ...mapCarouselFigureState({
112
+      carouselList: x => x.carouselList
90 113
     }),
91 114
     ...mapBuildingState({
92 115
       buildings: x => x.buildings
93 116
     })
94 117
   },
95 118
   methods: {
96
-    ...mapDynamicActions([
97
-      'getDynamics',
98
-      'setDetailNull',
99
-      'deleteDynamics',
100
-      'publicDynamic',
101
-      'cancelDynamic'
102
-    ]),
103
-    ...mapBuildingActions([
104
-      'getBuildings',
105
-    ]),
106
-    GetIndex (inx) {
107
-      return (this.currentPage - 1) * this.pageSize + inx + 1
119
+    ...mapCarouselFigureActions(["getExtendContent","handleExtendContent"]),
120
+    ...mapBuildingActions(["getBuildings"]),
121
+    GetIndex(inx) {
122
+      return (this.currentPage - 1) * this.pageSize + inx + 1;
108 123
     },
109
-    FormatDate (date) {
110
-      if (date) {
111
-        return dayjs(date).formate('yyyy-MM-DD HH:mm:ss')
112
-      } else {
113
-        return ''
114
-      }
124
+    FormatDate(date) {
125
+      if (!date || date.indexOf('0001-') > -1) return ''
126
+
127
+      return dayjs(date).format('YYYY-MM-DD HH:mm:ss')
115 128
     },
116
-    getList () {
117
-      this.getDynamics({
129
+
130
+    getList() {
131
+      this.getExtendContent({
118 132
         pageNum: this.currentPage,
119 133
         pageSize: this.pageSize,
120
-        name: this.name,
121
-        buildingId: this.buildingId
122
-      })
134
+        buildingId: this.buildingId,
135
+        showType: 'banner'
136
+      });
123 137
     },
124
-    getBuildingName (id) {
125
-      return ((this.buildings.list || []).filter(x => x.buildingId === id)[0] || {}).buildingName || ''
138
+    getBuildingName(id) {
139
+      return (
140
+        ((this.buildings.list || []).filter(x => x.buildingId === id)[0] || {})
141
+          .buildingName || ""
142
+      );
126 143
     },
127
-    search () {
128
-      this.currentPage = 1
129
-      this.getList()
144
+    search() {
145
+      this.currentPage = 1;
146
+      this.getList();
130 147
     },
131
-    handleEdit (row) {
132
-      this.setDetailNull()
133
-      this.$router.push({name: 'editCarousel', query: {id: row.dynamicId}})
148
+    handleEdit(row) {
149
+      this.$router.push({ name: "editCarousel", query: { id: row.contentId } });
134 150
     },
135
-    handlePulic (row) {
136
-      this.$confirm('确认发布此数据?', '提示', {
137
-        confirmButtonText: '确定',
138
-        cancelButtonText: '取消',
139
-        type: 'warning'
151
+    handlePulic(contentId, status) {
152
+      this.$confirm("确认发布此数据?", "提示", {
153
+        confirmButtonText: "确定",
154
+        cancelButtonText: "取消",
155
+        type: "warning"
140 156
       }).then(() => {
141
-        this.publicDynamic({
142
-          id: row.dynamicId
143
-        }).then(() => {
144
-          this.getList()
145
-        })
146
-      })
157
+        this.updateExtendContent(contentId, status)
158
+      });
147 159
     },
148
-    handleUnPulic (row) {
149
-      this.$confirm('确认取消发布此数据?', '提示', {
150
-        confirmButtonText: '确定',
151
-        cancelButtonText: '取消',
152
-        type: 'warning'
160
+    Prohibit(contentId, status) {
161
+      this.$confirm("确认停用此轮播图?", "提示", {
162
+        confirmButtonText: "确定",
163
+        cancelButtonText: "取消",
164
+        type: "warning"
153 165
       }).then(() => {
154
-        this.cancelDynamic({
155
-          id: row.dynamicId}).then(() => {
156
-          this.getList()
157
-        })
158
-      })
166
+        this.updateExtendContent(contentId, status)
167
+      });
159 168
     },
160
-    handleDel (row) {
161
-      this.$confirm('确认删除此数据?', '提示', {
162
-        confirmButtonText: '确定',
163
-        cancelButtonText: '取消',
164
-        type: 'warning'
169
+    handleDel(contentId, status) {
170
+      this.$confirm("确认删除此数据?", "提示", {
171
+        confirmButtonText: "确定",
172
+        cancelButtonText: "取消",
173
+        type: "warning"
165 174
       }).then(() => {
166 175
         if (row.status === 1) {
167
-          this.$message.error('当前活动处于发布状态,不允许删除!')
168
-          return false
176
+          this.$message.error("当前活动处于发布状态,不允许删除!");
177
+          return false;
169 178
         }
170
-        this.deleteDynamics({
171
-          id: row.dynamicId
172
-        }).then(() => {
173
-          this.getList()
174
-        })
179
+      });
180
+    },
181
+    updateExtendContent(contentId, status) { // 修改轮播状态
182
+      this.$store.dispatch('carouselFigure/updateExtendContent', { contentId: contentId, status: status }).then((res) => {
183
+        this.getList();
184
+      }).catch(() =>{
185
+        console.log('carouselFigure/updateExtendContent err')
186
+      })
187
+    },
188
+    addDynamic() {
189
+      this.$router.push({ name: "editCarousel" });
190
+    },
191
+    getBuildList() {
192
+      this.$store.dispatch('building/getBuildings', this.buildingForm).then((res) => {
193
+        this.buildingList = res.records
194
+      }).catch(() => {
195
+        console.log('building/getBuildings err')
175 196
       })
176 197
     },
177
-    addDynamic () {
178
-      this.setDetailNull()
179
-      this.$router.push({name: 'editCarousel'})
180
-    }
181 198
   },
182
-  created () {
183
-    this.getBuildings({
184
-      pageNum: 1,
185
-      pageSize: 100,
186
-    }).then(() => {
187
-      this.getList()
188
-    })
199
+  created() {
200
+    this.getBuildList()
201
+    this.getList();
189 202
   }
190
-}
203
+};
191 204
 </script>
192 205
 
193 206
 <style lang="scss" scoped>
194
-.header{
207
+.header {
195 208
   width: 50px;
196 209
   height: 50px;
197
-  img{
210
+  img {
198 211
     width: 100%;
199 212
     height: 100%;
200 213
   }
201 214
 }
202 215
 
203
-.system-table-search{
216
+.system-table-search {
204 217
   width: calc(100% - 40px);
205 218
   margin: 20px auto 0;
206 219
 }
207 220
 
208
-.system-table-search li{
221
+.system-table-search li {
209 222
   margin-right: 20px;
210 223
 }
211 224
 
212
-.system-table-search ul{
225
+.system-table-search ul {
213 226
   font-size: 0;
214 227
   white-space: nowrap;
215 228
 }
216 229
 
217
-.system-table-search ul>li{
230
+.system-table-search ul > li {
218 231
   display: inline-block;
219 232
 }
220 233
 

+ 1
- 1
src/views/consultant/list.vue Parādīt failu

@@ -108,7 +108,7 @@ export default {
108 108
         });
109 109
     },
110 110
     addDynamic() {
111
-      this.$router.push({ name: "consultant.list" });
111
+      this.$router.push({ name: "consultant.edit" });
112 112
     },
113 113
     toDetail(row) {
114 114
       this.$router.push({

+ 223
- 0
src/views/customer/customerDetails.vue Parādīt failu

@@ -0,0 +1,223 @@
1
+<template>
2
+  <div class="detail-box">
3
+    <el-row :gutter="24">
4
+      <el-col :span="9">
5
+        <div class="grid-content">
6
+          <p class="title">置业顾问信息</p>
7
+          <img class="touxiang" src="http://img1.imgtn.bdimg.com/it/u=1022041283,4133755956&fm=26&gp=0.jpg" alt="">
8
+          <p class="name">{{  customerDetail.consultant === null ? '' :  customerDetail.consultant.name }}</p>
9
+          <p class="phone">{{ customerDetail.consultant === null ? '' :  customerDetail.consultant.phone }}</p>
10
+          <div class="info">
11
+            <p>部门:{{ customerDetail.consultant === null ? '' :  customerDetail.consultant.department }}</p>
12
+            <p>岗位:{{ customerDetail.consultant === null ? '' :  customerDetail.consultant.post }}</p>
13
+            <p>公司:{{ customerDetail.consultant === null ? '' :  customerDetail.consultant.company }}</p>
14
+          </div>
15
+          <p class="project">所属项目:
16
+            <span v-if="customerDetail.consultant === null"></span>
17
+            <span v-else v-for="(item, index) in customerDetail.consultant.projects" :key="index">{{ item }}</span>
18
+          </p>
19
+        </div>
20
+      </el-col>
21
+      <el-col :span="15">
22
+        <div class="grid-content">
23
+          <p class="title">客户信息</p>
24
+          <div style="display:flex">
25
+            <img class="touxiang" src="http://img1.imgtn.bdimg.com/it/u=1022041283,4133755956&fm=26&gp=0.jpg" alt="">
26
+            <div style="width:100%">
27
+              <p class="info-box">用户名称:<span>{{ customerDetail.name }}</span></p>
28
+              <p class="info-box">国家:<span>{{ customerDetail.country }}</span></p>
29
+              <p class="info-box">手机号:<span>{{ customerDetail.phone }}</span></p>
30
+              <p class="info-box">省份:<span>{{ customerDetail.province }}</span></p>
31
+            </div>       
32
+          </div>
33
+          <div class="other-info">
34
+              <p class="info-box">访问时长:<span>{{ customerDetail.duration / 60 }} 分钟</span></p>
35
+              <p class="info-box">城市:<span>{{ customerDetail.city }}</span></p>
36
+              <p class="info-box">访问次数:<span>{{ customerDetail.visitTimes }}</span></p>
37
+              <p class="info-box">来访渠道:<span>活动分享</span></p>
38
+              <p class="info-box">首次访问时间:<span>{{ formateDate(customerDetail.visitTime) }}</span></p>
39
+          </div>
40
+          <p style="line-height:1.8">详细信息:</p>
41
+          <div class="flex-box" style="display:flex;justify-content: space-between;">
42
+            <p>意向项目:<span>{{ customerDetail.intention }}</span></p>
43
+            <p>需求类型:<span>{{ customerDetail.demandType }}</span></p>
44
+            <p>物业类型:<span>{{ customerDetail.realtyManageType }}</span></p>
45
+          </div>
46
+          <div class="flex-box" style="display:flex;justify-content: space-between;">
47
+            <p>价格区间:<span>{{ customerDetail.priceRange }}</span></p>
48
+            <p>预约到访时间:<span>{{ formateDate(customerDetail.appointmentTime) }}</span></p>
49
+            <p>预约人数:<span>{{ customerDetail.visiteNum }}</span></p>
50
+          </div>
51
+          <p class="flex-box">客户说明:<span>{{ customerDetail.verifyRemark }}</span></p>
52
+          <p class="flex-box">客户描述:<span>{{ customerDetail.describe }}</span></p>
53
+          
54
+        </div>
55
+      </el-col>
56
+    </el-row>
57
+    <div class="access-records">
58
+      <p class="title">访问记录</p>
59
+      <el-table
60
+      :data="customerDetail.visitRecords || []"
61
+      class="table-box"
62
+      style="width: 100%;">
63
+      <el-table-column
64
+        prop="event"
65
+        label="访问事件">
66
+      </el-table-column>
67
+      <el-table-column
68
+        prop="visitTime"
69
+        label="访问时间">
70
+        <template slot-scope="scope">{{ formateDate(scope.row.visitTime) }}</template>
71
+      </el-table-column>
72
+      <el-table-column
73
+        prop="visitDuration"
74
+        label="停留时间">
75
+        <template slot-scope="scope">{{ scope.row.visitDuration / 60 }}分钟</template>
76
+      </el-table-column>
77
+    </el-table>
78
+    </div>
79
+  
80
+  </div>
81
+</template>
82
+
83
+<script>
84
+import { createNamespacedHelpers } from "vuex"
85
+import dayjs from 'dayjs'
86
+
87
+export default {
88
+  data() {
89
+    return {
90
+      customerId: '',
91
+      customerDetail: '',
92
+      tableData: [
93
+        {
94
+          date: "2016-05-02",
95
+          name: "王小虎",
96
+          time: "10分30秒"
97
+        },
98
+        {
99
+          date: "2016-05-04",
100
+          name: "王小虎",
101
+          time: "17分43秒"
102
+        },
103
+        {
104
+          date: "2016-05-01",
105
+          name: "王小虎",
106
+          time: "05分26秒"
107
+        },
108
+        {
109
+          date: "2016-05-03",
110
+          name: "王小虎",
111
+          time: "1时24分27秒"
112
+        }
113
+      ]
114
+    };
115
+  },
116
+  computed: {},
117
+  methods: {
118
+    formateDate(dt) {
119
+      return !dt ? '' : dayjs(dt).format('YYYY-MM-DD HH:mm')
120
+    },
121
+    getCustomerDetail() {
122
+      let data = { customerId: this.customerId }
123
+      this.$store.dispatch('customer/getCustomerDetail',data).then((res) => {
124
+        this.customerDetail = res
125
+        console.log('customer/getCustomerDetail: ', this.customerDetail)
126
+      }).catch(() => {
127
+        console.log('customer/getCustomerDetail err')
128
+      })
129
+    }
130
+  },
131
+  created() {
132
+    this.customerId = this.$route.query.id
133
+    this.getCustomerDetail()
134
+  }
135
+};
136
+</script>
137
+<style lang="scss">
138
+.detail-box {
139
+  .el-table th.is-leaf,
140
+  .el-table td {
141
+    border-bottom: 0px !important;
142
+    text-align: center;
143
+  }
144
+  .el-table::before {
145
+    background-color: #fff;
146
+  }
147
+}
148
+</style>
149
+
150
+
151
+<style lang="scss" scoped>
152
+.detail-box {
153
+  .access-records{
154
+    border: 1px solid #dcdcdc;
155
+    border-radius: 5px;
156
+    padding: 12px 15px;
157
+    margin-bottom: 26px;
158
+  }
159
+  .grid-content {
160
+    border: 1px solid #dcdcdc;
161
+    border-radius: 5px;
162
+    height: 400px;
163
+    overflow: hidden;
164
+    padding: 12px 15px;
165
+    position: relative;
166
+    margin-bottom: 26px;
167
+    p {
168
+      margin: 0;
169
+      font-size: 15px;
170
+    }
171
+    .title {
172
+      font-size: 18px;
173
+      font-weight: 600;
174
+      margin-bottom: 30px;
175
+    }
176
+    .touxiang {
177
+      width: 90px;
178
+      height: 80px;
179
+      display: inline-block;
180
+      margin-right: 26px;
181
+    }
182
+    .name {
183
+      position: absolute;
184
+      top: 80px;
185
+      left: 130px;
186
+      font-weight: 600;
187
+    }
188
+    .phone {
189
+      position: absolute;
190
+      top: 116px;
191
+      left: 130px;
192
+    }
193
+    .info {
194
+      margin: 20px 0;
195
+      p {
196
+        color: #666;
197
+        line-height: 1.8;
198
+      }
199
+    }
200
+    .info-box {
201
+      display: inline-block;
202
+      width: 50%;
203
+      line-height: 2.4;
204
+      span {
205
+        color: #555;
206
+      }
207
+    }
208
+    .other-info {
209
+      margin-left: 96px;
210
+      width: 100%;
211
+      span {
212
+        color: #555;
213
+      }
214
+    }
215
+    .flex-box {
216
+      line-height: 2.2;
217
+      span {
218
+        color: #555;
219
+      }
220
+    }
221
+  }
222
+}
223
+</style>

+ 235
- 176
src/views/customer/editCustomer.vue Parādīt failu

@@ -3,63 +3,67 @@
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
-      </el-form-item>
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>
42
-        </el-form-item>
43
-        <el-form-item label="客户描述:">
44
-            <el-input type="textarea" :rows="5"  v-model="detail.introduction"></el-input>
38
+          <el-input v-model="detail.visiteNum"></el-input>
45 39
         </el-form-item>
46 40
         <el-form-item label="物业类型:">
47
-          <el-input v-model="detail.department"></el-input>
41
+          <el-input v-model="detail.realtyManageType"></el-input>
48 42
         </el-form-item>
49 43
         <el-form-item label="需求类型:">
50
-          <el-input v-model="detail.department"></el-input>
44
+          <el-input v-model="detail.demandType"></el-input>
51 45
         </el-form-item>
52 46
         <el-form-item label="价格区间:">
53
-          <el-input v-model="detail.department"></el-input>
47
+          <el-input v-model="detail.priceRange"></el-input>
48
+        </el-form-item>
49
+        <el-form-item label="报备日期:">
50
+          <el-date-picker
51
+                  v-model="detail.reportDate"
52
+                  type="datetime"
53
+                  placeholder="选择日期时间">
54
+          </el-date-picker>
54 55
         </el-form-item>
55 56
         <el-form-item label="状态:">
56
-          <el-select v-model="detail.buildings" placeholder="请选择">
57
-            <el-option v-for="(build,i) in buildings.list || []" :key="i" :label="build.buildingName" :value="build.buildingId"></el-option>
57
+          <el-select v-model="detail.status" placeholder="请选择">
58
+            <el-option v-for="(item,i) in gridData || []" :key="i" :label="item.name" :value="item.value"></el-option>
58 59
           </el-select>
59 60
         </el-form-item>
61
+        <el-form-item label="客户描述:">
62
+          <el-input type="textarea" :rows="5"  v-model="detail.describe"></el-input>
63
+        </el-form-item>
60 64
         <el-form-item>
61 65
           <el-button type="primary" @click="submitForm">保存</el-button>
62
-          <el-button @click="$router.go(-1)">返回</el-button>
66
+          <el-button @click="$router.go(-1)">回</el-button>
63 67
         </el-form-item>
64 68
       </el-form>
65 69
     </div>
@@ -67,169 +71,224 @@
67 71
 </template>
68 72
 
69 73
 <script>
70
-import { createNamespacedHelpers } from "vuex";
71
-import apis from "../../config/api";
72
-import E from "wangeditor";
74
+  import { createNamespacedHelpers } from "vuex";
75
+  import apis from "../../config/api";
76
+  import E from "wangeditor";
73 77
 
74
-const { mapActions: mapPersonActions } = createNamespacedHelpers("persons");
75
-const {
76
-  mapState: mapBuildingState,
77
-  mapActions: mapBuildingActions
78
-} = createNamespacedHelpers("building");
79
-export default {
80
-  name: "consultantEdit",
81
-  data() {
82
-    return {
83
-      upFileUrl: apis.file.upload.url,
84
-      detail: {
85
-        name: undefined,
86
-        company: undefined,
87
-        department: undefined,
88
-        post: undefined,
89
-        tel: undefined,
90
-        photo: undefined,
91
-        status: 1,
92
-        buildings: []
93
-      },
94
-      imgList: [],
95
-      dialogVisible: false,
96
-      dialogImageUrl: "",
97
-      
98
-    };
99
-  },
100
-  created() {
101
-    this.init();
102
-  },
103
-  computed: {
104
-    ...mapBuildingState({
105
-      buildings: x => x.buildings
106
-    }),
107
-    uploadHeaders() {
108
-      const token = localStorage.getItem("x-token") || "";
78
+  const { mapActions: mapPersonActions } = createNamespacedHelpers("persons");
79
+  const {
80
+    mapState: mapBuildingState,
81
+    mapActions: mapBuildingActions
82
+  } = createNamespacedHelpers("building");
83
+  export default {
84
+    name: "consultantEdit",
85
+    data() {
109 86
       return {
110
-        Authorization: `Bearer ${token}`
87
+        upFileUrl: apis.file.upload.url,
88
+        detail: {
89
+          customerId: '',
90
+          consultantName: '',
91
+          name: undefined,
92
+          company: undefined,
93
+          department: undefined,
94
+          post: undefined,
95
+          tel: undefined,
96
+          photo: undefined,
97
+          status: '1',
98
+          buildings: [],
99
+        },
100
+        dialogForm: {
101
+          pageNumber: 1,
102
+          pageSize: 100
103
+        },
104
+        dialogTotal: 0,
105
+        consultantList: [],
106
+        imageUrl: '',
107
+        dialogVisible: false,
108
+        dialogImageUrl: "",
109
+        dialogTableVisible: false, //选择置业顾问弹框
110
+        consultant:"",
111
+        gridData: [
112
+          {
113
+            name: "报备",
114
+            value: '1'
115
+          },
116
+          {
117
+            name: "到访",
118
+            value: '2'
119
+          },
120
+          {
121
+            name: "认购",
122
+            value: '3'
123
+          },
124
+          {
125
+            name: "签约",
126
+            value: '4'
127
+          }
128
+        ]
111 129
       };
112
-    }
113
-  },
114
-  methods: {
115
-    ...mapBuildingActions(["getBuildings"]),
116
-    ...mapPersonActions(["getConsultant", "editConsultant"]),
117
-
118
-    init() {
119
-      if (this.$route.params.id) {
120
-        this.getConsultant({ id: this.$route.params.id }).then(data => {
121
-          this.detail = data;
122
-        });
123
-      }
124
-    },
125
-
126
-    beforeImgUpload(file) {
127
-      if (file.type !== "image/jpeg" && file.type !== "image/png") {
128
-        this.$message.error("上传图片只能是 JPG 或 PNG 格式!");
129
-        return false;
130
-      }
131
-      // if (file.size / 1024 > 300) {
132
-      //   this.$message.error('图片大小不允许超过300k!')
133
-      //   return false
134
-      // }
135
-      this.loading = this.$loading({
136
-        lock: true,
137
-        text: "上传中...",
138
-        spinner: "el-icon-loading",
139
-        background: "rgba(0, 0, 0, 0.7)"
140
-      });
141
-
142
-      return true;
143 130
     },
144
-    handleAvatarSuccess(res) {
145
-      this.imgList = [
146
-        ...this.imgList,
147
-        {
148
-          url: res.data
149
-        }
150
-      ];
151
-      this.hideLoadding();
131
+    created() {
132
+      this.init();
133
+      this.getConsultantsList()
152 134
     },
153
-    handleRemove(file, fileList) {
154
-      this.imgList = fileList;
135
+    computed: {
136
+      ...mapBuildingState({
137
+        buildings: x => x.buildings
138
+      }),
139
+      uploadHeaders() {
140
+        const token = localStorage.getItem("x-token") || "";
141
+        return {
142
+          Authorization: `Bearer ${token}`
143
+        };
144
+      }
155 145
     },
156
-    submitForm() {
157
-      this.showLoadding("保存中...");
158
-      this.editConsultant(this.detail)
159
-        .then(res => {
160
-          if (res.personId) {
161
-            this.detail = res;
162
-          }
146
+    methods: {
147
+      ...mapBuildingActions(["getBuildings"]),
148
+      ...mapPersonActions(["getConsultant", "editConsultant"]),
163 149
 
164
-          this.hideLoadding();
165
-          this.$notify.info("保存成功");
150
+      init() {
151
+        this.detail.customerId = this.$route.query.id
152
+        if (this.detail.customerId !== undefined) {
153
+          this.$store.dispatch('customer/getRecommendCustomersGetById',this.detail).then(data => {
154
+            this.detail = data;
155
+            this.dialogImageUrl = data.picture
156
+            this.imageUrl = data.picture
157
+          });
158
+        }
159
+      },
160
+      handleDel(row) {
161
+        this.$confirm("确定选择此置业顾问?", "提示", {
162
+          confirmButtonText: "确定",
163
+          cancelButtonText: "取消",
164
+          type: "warning"
166 165
         })
167
-        .catch(err => {
168
-          this.hideLoadding();
169
-          this.$notify.error(err.message);
166
+                .then(() => {
167
+                  this.$message({
168
+                    type: "success",
169
+                    message: "选择成功!"
170
+                  });
171
+                  this.detail.realtyConsultant = row.personId
172
+                  this.detail.consultantName = row.name
173
+                  this.dialogTableVisible = false;
174
+                })
175
+                .catch(() => {
176
+                  this.$message({
177
+                    type: "info",
178
+                    message: "已取消选择"
179
+                  });
180
+                });
181
+      },
182
+      beforeImgUpload(file) {
183
+        if (file.type !== "image/jpeg" && file.type !== "image/png") {
184
+          this.$message.error("上传图片只能是 JPG 或 PNG 格式!");
185
+          return false;
186
+        }
187
+        // if (file.size / 1024 > 300) {
188
+        //   this.$message.error('图片大小不允许超过300k!')
189
+        //   return false
190
+        // }
191
+        this.loading = this.$loading({
192
+          lock: true,
193
+          text: "上传中...",
194
+          spinner: "el-icon-loading",
195
+          background: "rgba(0, 0, 0, 0.7)"
170 196
         });
171
-    },
172 197
 
173
-    showLoadding(text) {
174
-      this.loading = this.$loading({
175
-        text,
176
-        lock: true,
177
-        spinner: "el-icon-loading",
178
-        background: "rgba(255, 255, 255, 0.7)"
179
-      });
180
-    },
198
+        return true;
199
+      },
200
+      handleAvatarSuccess(res) {
201
+        this.imageUrl = res.data
202
+        this.detail.picture = res.data
203
+        this.hideLoadding();
204
+      },
205
+      handleRemove(file, fileList) {
206
+        this.imgList = fileList;
207
+      },
208
+      submitForm() {
209
+        this.showLoadding("保存中...");
210
+        this.$store.dispatch('customer/getRecommendCustomersUpdate',this.detail)
211
+                .then(res => {
212
+                  if (res.personId) {
213
+                    this.detail = res;
214
+                  }
181 215
 
182
-    hideLoadding() {
183
-      if (this.loading) this.loading.close();
184
-    }
185
-  },
186
-  mounted() {
187
-    const _that = this;
216
+                  this.hideLoadding();
217
+                  this.$notify.success("保存成功");
218
+                  this.$router.go(-1)
219
+                })
220
+                .catch(err => {
221
+                  this.hideLoadding();
222
+                  this.$notify.error(err.message);
223
+                });
224
+      },
188 225
 
189
-    this.getBuildings({
190
-      pageNum: 1,
191
-      pageSize: 100
192
-    }).then(() => {
193
-      if ((this.$route.query.id || "") !== "") {
194
-        this.getDetail({ id: this.$route.query.id }).then(data => {});
226
+      showLoadding(text) {
227
+        this.loading = this.$loading({
228
+          text,
229
+          lock: true,
230
+          spinner: "el-icon-loading",
231
+          background: "rgba(255, 255, 255, 0.7)"
232
+        });
233
+      },
234
+
235
+      hideLoadding() {
236
+        if (this.loading) this.loading.close();
237
+      },
238
+      getConsultantsList() {
239
+        this.$store.dispatch('persons/getConsultants', this.dialogForm).then((res) => {
240
+          this.consultantList = res.records
241
+          this.dialogForm.pageNumber = res.current
242
+          this.dialogForm.pageSize = res.size
243
+          this.dialogTotal = res.total
244
+        }).catch(()=> {
245
+          console.log('persons/getConsultants err')
246
+        })
247
+      },
248
+      dialogHandleSizeChange(value) {
249
+        this.dialogForm.pageSize = value
250
+        this.getConsultantsList()
251
+      },
252
+      dialogHandleCurrentChange(value) {
253
+        this.dialogForm.pageNumber = value
254
+        this.getConsultantsList()
195 255
       }
196
-    });
197
-  }
198
-};
256
+    },
257
+  };
199 258
 </script>
200 259
 
201 260
 <style lang="scss" scoped>
202
-.form-wrapper {
203
-  width: 60%;
204
-}
261
+  .form-wrapper {
262
+    width: 60%;
263
+  }
205 264
 </style>
206 265
 
207 266
 <style lang="scss">
208
-.avatar-uploader .el-upload {
209
-  border: 1px dashed #d9d9d9;
210
-  border-radius: 6px;
211
-  cursor: pointer;
212
-  position: relative;
213
-  overflow: hidden;
214
-}
215
-.avatar-uploader .el-upload:hover {
216
-  border-color: #409eff;
217
-}
218
-.avatar-uploader-icon {
219
-  font-size: 28px;
220
-  color: #8c939d;
221
-  width: 178px;
222
-  height: 178px;
223
-  line-height: 178px;
224
-  text-align: center;
225
-}
226
-.avatar {
227
-  width: 178px;
228
-  height: 178px;
229
-  display: block;
230
-}
231
-.choose {
232
-  color: blue;
233
-  margin-left: 15px;
234
-}
267
+  .avatar-uploader .el-upload {
268
+    border: 1px dashed #d9d9d9;
269
+    border-radius: 6px;
270
+    cursor: pointer;
271
+    position: relative;
272
+    overflow: hidden;
273
+  }
274
+  .avatar-uploader .el-upload:hover {
275
+    border-color: #409eff;
276
+  }
277
+  .avatar-uploader-icon {
278
+    font-size: 28px;
279
+    color: #8c939d;
280
+    width: 178px;
281
+    height: 178px;
282
+    line-height: 178px;
283
+    text-align: center;
284
+  }
285
+  .avatar {
286
+    width: 178px;
287
+    height: 178px;
288
+    display: block;
289
+  }
290
+  .choose {
291
+    color: blue;
292
+    margin-left: 15px;
293
+  }
235 294
 </style>

+ 9
- 14
src/views/customer/editRecommend.vue Parādīt failu

@@ -57,7 +57,7 @@
57 57
           </el-date-picker>
58 58
         </el-form-item>
59 59
         <el-form-item label="状态:">
60
-          <el-select v-model="detail.status" placeholder="请选择">
60
+          <el-select v-model="detail.verifyStatus" placeholder="请选择">
61 61
             <el-option v-for="(item,i) in gridData || []" :key="i" :label="item.name" :value="item.value"></el-option>
62 62
           </el-select>
63 63
         </el-form-item>
@@ -118,7 +118,7 @@ export default {
118 118
         post: undefined,
119 119
         tel: undefined,
120 120
         photo: undefined,
121
-        status: '1',
121
+        verifyStatus: '0',
122 122
         buildings: [],
123 123
         realtyConsultant: ''
124 124
       },
@@ -135,20 +135,16 @@ export default {
135 135
       consultant:"",
136 136
       gridData: [
137 137
         {
138
-          name: "报备",
139
-          value: '1'
140
-        },
141
-        {
142
-          name: "到访",
143
-          value: '2'
138
+          name: "未通过",
139
+          value: '0'
144 140
         },
145 141
         {
146
-          name: "认购",
147
-          value: '3'
142
+          name: "已通过",
143
+          value: '1'
148 144
         },
149 145
         {
150
-          name: "签约",
151
-          value: '4'
146
+          name: "已驳回",
147
+          value: '2'
152 148
         }
153 149
       ]
154 150
     };
@@ -275,8 +271,7 @@ export default {
275 271
       this.getConsultantsList()
276 272
     },
277 273
     dialogHandleCurrentChange(value) {
278
-      this.dialogForm.pageNumber = 1
279
-      this.dialogForm.pageSize = value
274
+      this.dialogForm.pageNumber = value
280 275
       this.getConsultantsList()
281 276
     }
282 277
   },

+ 63
- 28
src/views/customer/integralRecord.vue Parādīt failu

@@ -1,35 +1,41 @@
1 1
 <template>
2 2
   <div>
3
-    <h5>当前可用积分:200</h5>
3
+    <h5>当前可用积分:{{ totalPoints || 0 }}</h5>
4 4
     <el-table
5
-      :data="dynamics.list || []"
5
+       border
6
+      :data="list || []"
6 7
       >
7 8
       <el-table-column
9
+        label="序号"
10
+        width="50"
8 11
         type="index">
9
-        <template slot-scope="scope">
10
-          <span>{{ GetIndex(scope.$index) }}</span>
11
-        </template>
12 12
       </el-table-column>
13 13
       <el-table-column
14
-        prop="title"
14
+        prop="changeType"
15 15
         label="积分类型">
16
+        <template slot-scope="scope">{{ showChangeType(scope.row.changeType) }}</template>
16 17
       </el-table-column>
17 18
       <el-table-column
18
-        prop="title"
19
+        prop="pointsAmount"
19 20
         label="积分变化">
21
+        <template slot-scope="scope">
22
+          <span v-if="subPoints(scope.row.pointsAmount)" style="color: red;">{{ scope.row.pointsAmount }}</span>
23
+          <span v-else>{{ scope.row.pointsAmount }}</span>
24
+        </template>
20 25
       </el-table-column>
21 26
       <el-table-column
22 27
         prop="createDate"
23 28
         label="发生时间">
29
+        <template slot-scope="scope">{{ formateDate(scope.row.createDate) }}</template>
24 30
       </el-table-column>
25 31
     </el-table>
26 32
     <el-pagination
27 33
       small
28 34
       style="margin-top:10px;"
29 35
       layout="prev, pager, next"
30
-      :current-page.sync="currentPage"
31
-      :pageSize="pageSize"
32
-      :total="dynamics.total || 0"
36
+      :current-page.sync="form.pageNum"
37
+      :pageSize="form.pageSize"
38
+      :total="total || 0"
33 39
       @current-change="getList"
34 40
     >
35 41
     </el-pagination>
@@ -38,7 +44,7 @@
38 44
 
39 45
 <script>
40 46
 import { createNamespacedHelpers } from "vuex";
41
-
47
+import dayjs from 'dayjs'
42 48
 const {
43 49
   mapState: mapDynamicState,
44 50
   mapActions: mapDynamicActions
@@ -51,10 +57,14 @@ const {
51 57
 export default {
52 58
   data() {
53 59
     return {
54
-      pageSize: 20,
55
-      currentPage: 1,
56
-      name: "",
57
-      buildingId: "",
60
+      form: {
61
+        customerId: '',
62
+        pageSize: 20,
63
+        pageNum: 1,
64
+      },
65
+      totalPoints: '', // 当前可用积分
66
+      total: '',
67
+      list: []
58 68
     };
59 69
   },
60 70
   computed: {
@@ -85,12 +95,17 @@ export default {
85 95
       }
86 96
     },
87 97
     getList() {
88
-      this.getDynamics({
89
-        pageNum: this.currentPage,
90
-        pageSize: this.pageSize,
91
-        name: this.name,
92
-        buildingId: this.buildingId
93
-      });
98
+      this.$store.dispatch('customer/taPointsRecords', this.form).then((res) => {
99
+        console.log('customer/taPointsRecords: ', res)
100
+        this.total = res.result.total
101
+        this.form.pageNum = res.result.current
102
+        this.form.pageSize = res.result.size
103
+        this.list = res.result.records
104
+        this.totalPoints = res.totalPoints
105
+
106
+      }).catch(() => {
107
+        console.log('customer/taPointsRecords err')
108
+      })
94 109
     },
95 110
     getBuildingName(id) {
96 111
       return (
@@ -98,15 +113,35 @@ export default {
98 113
           .buildingName || ""
99 114
       );
100 115
     },
101
-  
116
+    formateDate(dt) {
117
+      return !dt ? '' : dayjs(dt).format('YYYY-MM-DD HH:mm')
118
+    },
119
+    showChangeType(str) { // 积分类型
120
+      switch (str) {
121
+        case 'goods':
122
+          return '兑换商品'
123
+        case 'checkin':
124
+          return '签到'
125
+        case 'share':
126
+          return '分享'
127
+        case 'authorize':
128
+          return '授权'
129
+        default:
130
+          return '未知类型'
131
+      }
132
+    },
133
+    subPoints(points) { // 判断是否是 - 开头
134
+      let subStr = points.toString().substring(0, 1)
135
+      if (subStr === '-') {
136
+        return true
137
+      }
138
+
139
+      return false
140
+    }
102 141
   },
103 142
   created() {
104
-    this.getBuildings({
105
-      pageNum: 1,
106
-      pageSize: 100
107
-    }).then(() => {
108
-      this.getList();
109
-    });
143
+    this.form.customerId = this.$route.query.id
144
+    this.getList()
110 145
   }
111 146
 };
112 147
 </script>

+ 333
- 244
src/views/customer/list.vue Parādīt failu

@@ -5,314 +5,403 @@
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
-            <span>置业顾问</span>
16
-            <el-input v-model="name" ></el-input>
15
+            <span>推荐人</span>
16
+            <el-input v-model="form.consultName" ></el-input>
17 17
           </li>
18 18
           <li>
19
-            <span>置业顾问电话</span>
20
-            <el-input v-model="name" ></el-input>
19
+            <span>推荐人电话</span>
20
+            <el-input v-model="form.consultTel" ></el-input>
21 21
           </li>
22 22
         </ul>
23 23
         <el-button
24
-          size="mini"
25
-          type="primary" @click="search">查询</el-button>
24
+                size="mini"
25
+                type="primary" @click="search">查询</el-button>
26 26
       </div>
27 27
     </div>
28
-    <el-table :data="dynamics.list || []" style="width: 100%">
28
+    <el-table :data="list || []"
29
+              border
30
+              style="width: 100%">
29 31
       <el-table-column
30
-        type="index"
31
-        width="50">
32
-        <template slot-scope="scope">
33
-          <span>{{ GetIndex(scope.$index) }}</span>
34
-        </template>
32
+              type="index"
33
+              width="50">
35 34
       </el-table-column>
36 35
       <el-table-column
37
-        label="头像">
36
+              label="头像">
38 37
         <template slot-scope="scope">
39 38
           <div class="header">
40
-            <img :src="scope.row.imgUrl" alt="" />
39
+            <img :src="scope.row.picture" alt="" />
41 40
           </div>
42 41
         </template>
43 42
       </el-table-column>
44 43
       <el-table-column
45
-        prop="title"
46
-        label="姓名">
44
+              prop="name"
45
+              label="姓名">
47 46
       </el-table-column>
48 47
       <el-table-column
49
-        prop="phone"
50
-        label="电话">
48
+              prop="phone"
49
+              label="电话">
51 50
       </el-table-column>
52 51
       <el-table-column
53
-        prop="sex"
54
-        label="性别">
52
+              prop="sex"
53
+              label="性别">
54
+        <template slot-scope="scope">{{ scope.row.sex === 1 ? '男' : '女' }}</template>
55 55
       </el-table-column>
56
-      <el-table-column   label="置业顾问">
56
+      <el-table-column  label="置业顾问">
57 57
         <template slot-scope="scope">
58
-          <span>{{scope.row.desc}}</span>
59
-          <p>{{scope.row.tel}}</p>
58
+          <span>{{scope.row.name}}</span>
59
+          <p>{{scope.row.phone}}</p>
60 60
         </template>
61 61
       </el-table-column>
62
-      <el-table-column fixed="right" width="300" label="操作">
62
+      <el-table-column fixed="right"  width="200" label="操作">
63 63
         <template slot-scope="scope">
64
-          <el-button type="text" @click="toEditCustomer(scope.row)"   size="small">编辑</el-button>
65
-          <el-button type="text" @click="adjustment(scope.row)" size="small">调整归属</el-button>
66
-          <el-button type="text" @click="toIntegralRecord(scope.row)" size="small">积分记录</el-button>
67
-          <el-button type="text" @click="recommend(scope.row)" size="small">推荐客户</el-button>
68
-          <el-button type="text" size="small" @click="toDetail(scope.row)">查看详情</el-button>
64
+          <router-link :to="{ name:'editCustomer', query: { id: scope.row.customerId } }" v-if="scope.row.phone !== '' && scope.row.phone !== undefined && scope.row.phone !== null">编辑</router-link>
65
+          &nbsp;
66
+          <a href="javascript: void(0);" @click="showDialogConsultants(scope.row)" v-if="scope.row.phone !== '' && scope.row.phone !== undefined && scope.row.phone !== null">调整归属</a>
67
+          &nbsp;
68
+          <router-link :to="{ name:'integralRecord', query: { id: scope.row.customerId } }" v-if="scope.row.phone !== '' && scope.row.phone !== undefined && scope.row.phone !== null">积分记录</router-link>
69
+          &nbsp;
70
+          <a href="javascript: void(0);" @click="showRecommendCustomerList(scope.row)" v-if="scope.row.phone !== '' && scope.row.phone !== undefined && scope.row.phone !== null">推荐客户</a>
71
+          &nbsp;
72
+          <router-link :to="{ name:'customerDetails', query: { id: scope.row.customerId } }">查看详情</router-link>
69 73
         </template>
70 74
       </el-table-column>
71 75
     </el-table>
76
+    <el-pagination
77
+            small
78
+            style="margin-top:10px;"
79
+            layout="prev, pager, next"
80
+            :current-page.sync="form.pageNumber"
81
+            :pageSize="form.pageSize"
82
+            @current-change="getList"
83
+    >
84
+    </el-pagination>
85
+
86
+
72 87
     <el-dialog title="选择置业顾问" :visible.sync="dialogTableVisible">
73
-      <el-table :data="gridData">
74
-        <el-table-column property="date" label="姓名"></el-table-column>
75
-        <el-table-column property="name" label="电话"></el-table-column>
76
-        <el-table-column property="name" label="部门"></el-table-column>
77
-        <el-table-column property="name" label="岗位"></el-table-column>
88
+      <el-table :data="consultantList">
89
+        <el-table-column property="name" label="姓名"></el-table-column>
90
+        <el-table-column property="phone" label="电话"></el-table-column>
91
+        <el-table-column property="department" label="部门"></el-table-column>
92
+        <el-table-column property="post" label="岗位"></el-table-column>
78 93
         <el-table-column fixed="right" label="操作">
79 94
           <template slot-scope="scope">
80
-            <el-button type="text" @click="handleDel(scope.row)" size="small">选择</el-button>
95
+            <!--            <el-button type="text" @click="handleDel(scope.row)" size="small">选择</el-button>-->
96
+            <el-radio v-model="dialogConsultantForm.realtyConsultant" :label="scope.row.personId"></el-radio>
81 97
           </template>
82 98
         </el-table-column>
83 99
       </el-table>
100
+      <el-pagination
101
+              @size-change="dialogHandleSizeChange"
102
+              @current-change="dialogHandleCurrentChange"
103
+              :current-page.sync="dialogForm.pageNumber"
104
+              :page-size="dialogForm.pageSize"
105
+              layout="total, prev, pager, next"
106
+              :total="dialogTotal">
107
+      </el-pagination>
108
+      <el-button type="primary" @click="handleDel" size="small">确定</el-button>
84 109
     </el-dialog>
85
-    <el-dialog title="推荐客户" :visible.sync="dialogRecommendVisible">
86
-      <el-table :data="gridData">
87
-        <el-table-column property="date" label="姓名"></el-table-column>
88
-        <el-table-column property="name" label="电话"></el-table-column>
89
-        <el-table-column property="name" label="性别"></el-table-column>
90
-        <el-table-column property="name" label="意向项目"></el-table-column>
91
-        <el-table-column property="name" label="推荐时间"></el-table-column>
92
-        <el-table-column property="name" label="状态"></el-table-column>
110
+
111
+
112
+    <el-dialog title="推荐客户" :visible.sync="dialogRecommendedTableVisible">
113
+      <el-table :data="recommendedConsultantList">
114
+        <el-table-column property="name" label="姓名"></el-table-column>
115
+        <el-table-column property="phone" label="电话"></el-table-column>
116
+        <el-table-column property="sex" label="性别">
117
+          <template slot-scope="scope"> {{ scope.row.sex === 1 ? '男' : '女' }}</template>
118
+        </el-table-column>
119
+        <el-table-column property="intention" label="意向项目"></el-table-column>
120
+        <el-table-column property="post" label="推荐时间"></el-table-column>
121
+        <el-table-column fixed="right" label="状态">
122
+          <template slot-scope="scope">
123
+            {{ scope.row.status == 1 ? '报备': scope.row.status == 2 ? '到访' : scope.row.status == 3 ? '认购' : scope.row.status == 4 ? '签约' : '无效' }}
124
+          </template>
125
+        </el-table-column>
93 126
       </el-table>
94
-       <el-button type="primary" class="close-btn"  @click="dialogRecommendVisible=false" >关闭</el-button>
127
+      <el-pagination
128
+              @size-change="recommendedDialogHandleSizeChange"
129
+              @current-change="recommendedDialogHandleCurrentChange"
130
+              :current-page.sync="recommendedDialogConsultantForm.pageNumber"
131
+              :page-size="recommendedDialogConsultantForm.pageSize"
132
+              layout="total, prev, pager, next"
133
+              :total="recommendedDialogTotal">
134
+      </el-pagination>
95 135
     </el-dialog>
96
-    <el-pagination
97
-      small
98
-      style="margin-top:10px;"
99
-      layout="prev, pager, next"
100
-      :current-page.sync="currentPage"
101
-      :pageSize="pageSize"
102
-      @current-change="getList"
103
-    >
104
-    </el-pagination>
105 136
   </div>
106 137
 </template>
107 138
 <script>
108
-import { createNamespacedHelpers } from "vuex";
109
-const {
110
-  mapState: mapDynamicState,
111
-  mapActions: mapDynamicActions
112
-} = createNamespacedHelpers("dynamic");
113
-const {
114
-  mapState: mapCustomerState,
115
-  mapActions: mapCustomerActions
116
-} = createNamespacedHelpers("customer");
117
-export default {
118
-  data() {
119
-    return {
120
-      pageSize: 20,
121
-      currentPage: 1,
122
-      name: "",
123
-      sex: "",
124
-      phone: "",
125
-      picture: "",
126
-      describe: "",
127
-      appointmentTime: "",
128
-      visiteNum: "",
129
-      intention: "",
130
-      buildingId: "",
131
-      realtyManageType: "",
132
-      demandType: "",
133
-      priceRange: "",
134
-      reportDate: "",
135
-      status: "",
136
-      personId: "",
137
-      dialogTableVisible: false, //调整归属弹框
138
-      dialogRecommendVisible: false, //推荐客户弹框
139
-      gridData: [
140
-        {
141
-          date: "2016-05-02",
142
-          name: "王小虎"
139
+  import { createNamespacedHelpers } from "vuex";
140
+  import dayjs from 'dayjs'
141
+  const {
142
+    mapState: mapDynamicState,
143
+    mapActions: mapDynamicActions
144
+  } = createNamespacedHelpers("dynamic");
145
+  const {
146
+    mapState: mapCustomerState,
147
+    mapActions: mapCustomerActions
148
+  } = createNamespacedHelpers("customer");
149
+  export default {
150
+    data() {
151
+      return {
152
+        form: {
153
+          pageSize: 10,
154
+          pageNumber: 1,
155
+          name: "",
156
+          consultName: '',
157
+          consultTel: '',
158
+          verifyStatus: '1' // 0未通过 1已通过 2已驳
143 159
         },
144
-        {
145
-          date: "2016-05-04",
146
-          name: "王小虎"
160
+        list: [],
161
+        total: 0,
162
+        sex: "",
163
+        phone: "",
164
+        picture: "",
165
+        describe: "",
166
+        appointmentTime: "",
167
+        visiteNum: "",
168
+        intention: "",
169
+        buildingId: "",
170
+        realtyManageType: "",
171
+        demandType: "",
172
+        priceRange: "",
173
+        reportDate: "",
174
+        status: "",
175
+        personId: "",
176
+        gridData: [
177
+          {
178
+            name: "报备",
179
+            value: 1
180
+          },
181
+          {
182
+            name: "到访",
183
+            value: 2
184
+          },
185
+          {
186
+            name: "认购",
187
+            value: 3
188
+          },
189
+          {
190
+            name: "签约",
191
+            value: 4
192
+          }
193
+        ],
194
+        dialogTableVisible: false, //选择置业顾问弹框
195
+        consultantList: [],
196
+        dialogForm: {
197
+          pageNumber: 1,
198
+          pageSize: 10
147 199
         },
148
-        {
149
-          date: "2016-05-01",
150
-          name: "王小虎"
200
+        dialogTotal: 0,
201
+        dialogConsultantForm: {
202
+          customerId: '', // 客户Id
203
+          realtyConsultant: '' // 置业顾问
151 204
         },
152
-        {
153
-          date: "2016-05-03",
154
-          name: "王小虎"
155
-        }
156
-      ]
157
-    };
158
-  },
159
-  computed: {
160
-    ...mapCustomerState({
161
-      customers: x => x.customers
162
-    }),
163
-    ...mapDynamicState({
164
-      dynamics: x => x.dynamics
165
-    })
166
-  },
167
-  created() {
168
-    this.getList();
169
-  },
170
-  methods: {
171
-    ...mapCustomerActions(["getCustomers", "getDetail"]),
172
-    ...mapDynamicActions([
173
-      "getDynamics",
174
-      "setDetailNull",
175
-      "deleteDynamics",
176
-      "publicDynamic",
177
-      "cancelDynamic"
178
-    ]),
179
-    GetIndex(inx) {
180
-      return (this.currentPage - 1) * this.pageSize + inx + 1;
181
-    },
182
-    getList() {
183
-      this.getDynamics({
184
-        pageNum: this.currentPage,
185
-        pageSize: this.pageSize,
186
-        name: this.name,
187
-        buildingId: this.buildingId
188
-      });
189
-    },
190
-    // 进入编辑页
191
-    toEditCustomer(row) {
192
-      this.$router.push({
193
-        name: "editCustomer",
194
-        params: { id: row.personId }
195
-      });
196
-    },
197
-    // 进入积分记录页
198
-    toIntegralRecord(row) {
199
-      this.$router.push({
200
-        name: "integralRecord",
201
-        params: { id: row.personId }
202
-      });
203
-    },
204
-    // 调整归属
205
-    adjustment(row) {
206
-      this.dialogTableVisible = true;
207
-    },
208
-    // 推荐客户
209
-    recommend(row) {
210
-      this.dialogRecommendVisible = true;
205
+        // 推荐客户
206
+        dialogRecommendedTableVisible: false,
207
+        recommendedConsultantList: [],
208
+        recommendedDialogTotal: 0,
209
+        recommendedDialogConsultantForm: {
210
+          customerId: '', // 客户Id
211
+          pageNumber: 1,
212
+          pageSize: 10
213
+        },
214
+      };
211 215
     },
212
-    handleDel(row) {
213
-      this.$confirm("确定选择此置业顾问?", "提示", {
214
-        confirmButtonText: "确定",
215
-        cancelButtonText: "取消",
216
-        type: "warning"
216
+    computed: {
217
+      ...mapCustomerState({
218
+        customers: x => x.customers
219
+      }),
220
+      ...mapDynamicState({
221
+        dynamics: x => x.dynamics
217 222
       })
218
-        .then(() => {
219
-          this.$message({
220
-            type: "success",
221
-            message: "选择成功!"
222
-          });
223
-          this.dialogTableVisible = false;
224
-        })
225
-        .catch(() => {
226
-          this.$message({
227
-            type: "info",
228
-            message: "已取消选择"
229
-          });
230
-        });
231 223
     },
232
-    // getList() {
233
-    // this.getCustomers({
234
-    // pageNum: this.currentPage,
235
-    // pageSize: this.pageSize,
236
-    // name: this.name,
237
-    // sex: this.sex,
238
-    // phone: this.phone,
239
-    // picture: this.picture,
240
-    // describe: this.describe,
241
-    // appointmentTime: this.appointmentTime,
242
-    // visiteNum: this.visiteNum,
243
-    // intention: this.intention,
244
-    // buildingId: this.buildingId,
245
-    // realtyManageType: this.realtyManageType,
246
-    // demandType: this.demandType,
247
-    // priceRange: this.priceRange,
248
-    // reportDate: this.reportDate,
249
-    // status: this.status,
250
-    // personId: this.personId
251
-    // });
252
-    // },
253
-    search() {
254
-      this.currentPage = 1;
224
+    created() {
255 225
       this.getList();
256 226
     },
257
-    toDetail(row) {
258
-      this.$router.push({
259
-        name: "consultant.edit",
260
-        params: { id: row.personId }
261
-      });
227
+    methods: {
228
+      ...mapCustomerActions(["getCustomers", "getDetail", "getRecommendCustomers"]),
229
+      ...mapDynamicActions([
230
+        "getDynamics",
231
+        "setDetailNull",
232
+        "deleteDynamics",
233
+        "publicDynamic",
234
+        "cancelDynamic"
235
+      ]),
236
+      GetIndex(inx) {
237
+        return (this.currentPage - 1) * this.pageSize + inx + 1;
238
+      },
239
+      formateDate(dt) {
240
+        return !dt ? '' : dayjs(dt).format('YYYY-MM-DD HH:mm')
241
+      },
242
+      getList() {
243
+        this.getRecommendCustomers(this.form).then((res) => {
244
+          this.list = res.records
245
+          this.form.pageSize = res.size
246
+          this.form.pageNumber = res.current
247
+          this.total = res.total
248
+        }).catch(() => {
249
+          console.log('getRecommendCustomers err')
250
+        });
251
+      },
252
+
253
+      // 进入积分记录页
254
+      toEditRecommend(row) {
255
+        this.$router.push({
256
+          name: "editRecommend",
257
+          params: { id: row.personId }
258
+        });
259
+      },
260
+
261
+      // getList() {
262
+      // this.getCustomers({
263
+      // pageNum: this.currentPage,
264
+      // pageSize: this.pageSize,
265
+      // name: this.name,
266
+      // sex: this.sex,
267
+      // phone: this.phone,
268
+      // picture: this.picture,
269
+      // describe: this.describe,
270
+      // appointmentTime: this.appointmentTime,
271
+      // visiteNum: this.visiteNum,
272
+      // intention: this.intention,
273
+      // buildingId: this.buildingId,
274
+      // realtyManageType: this.realtyManageType,
275
+      // demandType: this.demandType,
276
+      // priceRange: this.priceRange,
277
+      // reportDate: this.reportDate,
278
+      // status: this.status,
279
+      // personId: this.personId
280
+      // });
281
+      // },
282
+      search() {
283
+        this.currentPage = 1;
284
+        this.getList();
285
+      },
286
+      handleDel() {
287
+        this.dialogSubmitForm(this.dialogConsultantForm.customerId, this.dialogConsultantForm.realtyConsultant)
288
+        this.dialogTableVisible = false
289
+      },
290
+      dialogHandleSizeChange(value) {
291
+        this.dialogForm.pageSize = value
292
+        this.getConsultantsList()
293
+      },
294
+      dialogHandleCurrentChange(value) {
295
+        this.dialogForm.pageNumber = value
296
+        this.getConsultantsList()
297
+      },
298
+      getConsultantsList() {
299
+        this.$store.dispatch('persons/getConsultants', this.dialogForm).then((res) => {
300
+          this.consultantList = res.records
301
+          this.dialogForm.pageNumber = res.current
302
+          this.dialogForm.pageSize = res.size
303
+          this.dialogTotal = res.total
304
+        }).catch(()=> {
305
+          console.log('persons/getConsultants err')
306
+        })
307
+      },
308
+      dialogSubmitForm(customerId, realtyConsultant) {
309
+        console.log('提交', this.dialogConsultantForm)
310
+        this.$store.dispatch('customer/getRecommendCustomersUpdate',{customerId:  customerId, realtyConsultant:  realtyConsultant})
311
+                .then(res => {
312
+                  if (res.personId) {
313
+                    this.detail = res;
314
+                  }
315
+
316
+                  this.$notify.info("保存成功");
317
+                })
318
+                .catch(err => {
319
+                  this.$notify.error(err.message);
320
+                });
321
+      },
322
+      showDialogConsultants(row) {
323
+        this.dialogTableVisible = true
324
+        this.dialogConsultantForm.customerId = row.customerId
325
+        this.dialogConsultantForm.realtyConsultant = row.realtyConsultant
326
+        this.getConsultantsList()
327
+      },
328
+      getRecommendCustomerList() {
329
+        this.$store.dispatch('customer/recommendCustomerList', this.recommendedDialogConsultantForm).then((res) => {
330
+          this.recommendedConsultantList = res.records
331
+          this.recommendedDialogConsultantForm.pageNumber = res.current
332
+          this.recommendedDialogConsultantForm.pageSize = res.size
333
+          this.recommendedDialogTotal = res.total
334
+        }).catch(()=> {
335
+          console.log('persons/getConsultants err')
336
+        })
337
+      },
338
+      showRecommendCustomerList(row) {
339
+        this.dialogRecommendedTableVisible = true
340
+        this.recommendedDialogConsultantForm.customerId = row.customerId
341
+        this.getRecommendCustomerList()
342
+      },
343
+      recommendedDialogHandleSizeChange(value) {
344
+        this.recommendedDialogConsultantForm.pageSize = value
345
+        this.getRecommendCustomerList()
346
+      },
347
+      recommendedDialogHandleCurrentChange(value) {
348
+        this.recommendedDialogConsultantForm.pageNumber = value
349
+        this.getConsultantsList()
350
+      },
262 351
     }
263
-  }
264
-};
352
+  };
265 353
 </script>
266 354
 <style lang="scss" scoped>
267
-.list {
268
-  .header {
269
-    width: 50px;
270
-    height: 50px;
271
-    img {
272
-      width: 100%;
273
-      height: 100%;
355
+  .list {
356
+    .header {
357
+      width: 50px;
358
+      height: 50px;
359
+      img {
360
+        width: 100%;
361
+        height: 100%;
362
+      }
274 363
     }
275 364
   }
276
-}
277 365
 
278
-.system-table-search {
279
-  width: calc(100% - 40px);
280
-  margin: 16px auto 0;
281
-}
366
+  .system-table-search {
367
+    width: calc(100% - 40px);
368
+    margin: 16px auto 0;
369
+  }
282 370
 
283
-.system-table-search ul > li {
284
-  margin-right: 20px;
285
-  display: flex;
286
-  float: left;
287
-  align-items: center;
288
-  span {
289
-    margin-right: 10px;
371
+  .system-table-search ul > li {
372
+    margin-right: 20px;
373
+    display: flex;
374
+    float: left;
375
+    align-items: center;
376
+    margin-bottom: 10px;
377
+    span {
378
+      margin-right: 10px;
379
+    }
290 380
   }
291
-}
292 381
 
293
-.system-table-search ul {
294
-  font-size: 15px;
295
-  white-space: nowrap;
296
-  padding: 0;
297
-}
382
+  .system-table-search ul {
383
+    font-size: 15px;
384
+    white-space: nowrap;
385
+    padding: 0;
386
+  }
298 387
 
299
-.flex-h {
300
-  display: flex;
301
-  align-items: center;
302
-}
303
-.el-dialog__body{
304
-  text-align: center;
305
-  .close-btn{
306
-  margin:  20px auto 0 auto;
307
-}
308
-}
388
+  .flex-h {
389
+    display: flex;
390
+    align-items: center;
391
+  }
392
+  .el-dialog__body {
393
+    text-align: center;
394
+    .close-btn {
395
+      margin: 20px auto 0 auto;
396
+    }
397
+  }
309 398
 
310
-.flex-item {
311
-  flex: 1;
312
-  -webkit-flex: 1;
313
-  position: relative;
314
-  overflow: hidden;
315
-}
399
+  .flex-item {
400
+    flex: 1;
401
+    -webkit-flex: 1;
402
+    position: relative;
403
+    overflow: hidden;
404
+  }
316 405
 </style>
317 406
 
318 407
 

+ 16
- 27
src/views/customer/recommendCustomer.vue Parādīt failu

@@ -19,12 +19,12 @@
19 19
             <span>推荐人电话</span>
20 20
             <el-input v-model="form.consultTel" ></el-input>
21 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>-->
22
+          <li>
23
+            <span>状态</span>
24
+            <el-select v-model="form.verifyStatus" 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"
@@ -77,20 +77,12 @@
77 77
       </el-table-column>
78 78
       <el-table-column  label="状态">
79 79
         <template slot-scope="scope">
80
-          <span>{{scope.row.status == 1 ? '报备': scope.row.status == 2 ? '到访' : scope.row.status == 3 ? '认购' : '签约' }}</span>
80
+          <span>{{scope.row.verifyStatus == '0' ? '未通过': scope.row.verifyStatus == '1' ? '已通过' : scope.row.verifyStatus == '2' ? '已驳回' : '' }}</span>
81 81
         </template>
82 82
       </el-table-column>
83 83
       <el-table-column fixed="right" width="200" label="操作">
84 84
         <template slot-scope="scope">
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
+          <router-link :to="{ name:'editRecommend', query: { id: scope.row.customerId } }">审核</router-link>
94 86
         </template>
95 87
       </el-table-column>
96 88
     </el-table>
@@ -176,7 +168,8 @@ export default {
176 168
         name: "",
177 169
         consultName: '',
178 170
         consultTel: '',
179
-        status: ''
171
+        verifyStatus: '', // 0未通过 1已通过 2已驳
172
+        entryType: 'input'
180 173
       },
181 174
       list: [],
182 175
       total: 0,
@@ -196,20 +189,16 @@ export default {
196 189
       personId: "",
197 190
       gridData: [
198 191
         {
199
-          name: "报备",
200
-          value: 1
201
-        },
202
-        {
203
-          name: "到访",
204
-          value: 2
192
+          name: "未通过",
193
+          value: '0'
205 194
         },
206 195
         {
207
-          name: "认购",
208
-          value: 3
196
+          name: "已通过",
197
+          value: '1'
209 198
         },
210 199
         {
211
-          name: "签约",
212
-          value: 4
200
+          name: "已驳回",
201
+          value: '2'
213 202
         }
214 203
       ],
215 204
       dialogTableVisible: false, //选择置业顾问弹框

+ 27
- 3
src/views/exchange/verify.vue Parādīt failu

@@ -27,8 +27,14 @@
27 27
         </div>
28 28
       </el-col>
29 29
     </el-row>
30
-    <el-button type="danger" style="margin:20px auto 0 auto;display:block" round>立即核销</el-button>
31
-    
30
+    <el-button type="danger" @click="showVerifyDialog = true" style="margin:20px auto 0 auto;display:block" round>立即核销</el-button>
31
+    <el-dialog title="核销数据" :visible.sync="showVerifyDialog">
32
+      <el-form>
33
+        <el-form-item label="扫描二维码数据">
34
+          <el-input v-model="verifyId" @keyup.enter.native="verifyEnter" placeholder="请用扫码枪扫描二维码"></el-input>
35
+        </el-form-item>
36
+      </el-form>
37
+    </el-dialog>
32 38
   </el-tab-pane>
33 39
   <el-tab-pane label="手机号核销">
34 40
     <el-row>
@@ -81,6 +87,8 @@ export default {
81 87
         status: ""
82 88
       },
83 89
       verifyPhone: "",
90
+      verifyId: "",
91
+      showVerifyDialog: false,
84 92
       list: [],
85 93
       pageNavi: {
86 94
         current: 1,
@@ -91,7 +99,7 @@ export default {
91 99
   },
92 100
   computed: {},
93 101
   methods: {
94
-    ...mapExchangeActions(["getExchanges"]),
102
+    ...mapExchangeActions(["getExchanges", "verifyById"]),
95 103
     getList() {
96 104
       const pageNumber = this.pageNavi.current || 1;
97 105
       const pageSize = this.pageNavi.size;
@@ -114,7 +122,23 @@ export default {
114 122
     addGoods() {
115 123
       this.$router.push({ name: "goods.edit" });
116 124
     },
125
+    verifyEnter() {
126
+      this.verifyById({
127
+        id: this.verifyId
128
+      })
129
+        .then(res => {
130
+         this.$notify.info("核销成功");
131
+         this.showVerifyDialog = false;
132
+        })
133
+        .catch(err => {
134
+          this.$notify.error(err.msg || err.message);
135
+        });
136
+    },
117 137
     verifyTel() {
138
+      if(this.verifyPhone === ""){
139
+        this.$notify.error("请输入手机号");
140
+        return;
141
+      }
118 142
       this.$router.push({
119 143
         name: "verify.list",
120 144
         params: { tel: this.verifyPhone }

+ 22
- 4
src/views/index.js Parādīt failu

@@ -33,7 +33,7 @@ const pages = [
33 33
         name: 'consultant.edit',
34 34
         component: () => import('./consultant/edit.vue'),
35 35
         meta: {
36
-          menuShow: true,
36
+          menuShow: false,
37 37
           title: '置业管理',
38 38
         },
39 39
       },
@@ -173,7 +173,7 @@ const pages = [
173 173
       {
174 174
         path: 'customerlist',
175 175
         name: 'customerlist',
176
-        component: () => import('./customer/recommendCustomer.vue'),
176
+        component: () => import('./customer/list.vue'),
177 177
         meta: {
178 178
           menuShow: true,
179 179
           title: '客户列表',
@@ -194,7 +194,16 @@ const pages = [
194 194
         component: () => import('./customer/editRecommend.vue'),
195 195
         meta: {
196 196
           menuShow: false,
197
-          title: '编辑',
197
+          title: '审核',
198
+        },
199
+      },
200
+      {
201
+        path: 'customerDetails',
202
+        name: 'customerDetails',
203
+        component: () => import('./customer/customerDetails.vue'),
204
+        meta: {
205
+          menuShow: false,
206
+          title: '客户详情',
198 207
         },
199 208
       },
200 209
       {
@@ -212,7 +221,7 @@ const pages = [
212 221
         component: () => import('./customer/editCustomer.vue'),
213 222
         meta: {
214 223
           menuShow: false,
215
-          title: '编辑',
224
+          title: '编辑客户',
216 225
         },
217 226
       },
218 227
     ]
@@ -295,6 +304,15 @@ const pages = [
295 304
           title: '关键字维护',
296 305
         },
297 306
       },
307
+      {
308
+        path: 'message',
309
+        name: 'message',
310
+        component: () => import('./systemManagement/message.vue'),
311
+        meta: {
312
+          menuShow: true,
313
+          title: '客户留言',
314
+        },
315
+      },
298 316
     ]
299 317
   },
300 318
   {

+ 3
- 3
src/views/news/type/index.vue Parādīt failu

@@ -90,13 +90,13 @@
90 90
             },
91 91
             handleSizeChange(val) {
92 92
                 console.log(`每页 ${val} 条`);
93
-                this.form.pageSize = val
94
-                this.form.pageNum = 1
93
+                this.pageSize = val
94
+                this.pageNum = 1
95 95
                 this.getList()
96 96
             },
97 97
             handleCurrentChange(val) {
98 98
                 console.log(`当前页: ${val}`);
99
-                this.form.pageNum = val
99
+                this.pageNum = val
100 100
                 this.getList()
101 101
             },
102 102
             getList() {

+ 187
- 0
src/views/systemManagement/message.vue Parādīt failu

@@ -0,0 +1,187 @@
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='addGoods'>新增</el-button>
7
+        </div>
8
+        <ul>
9
+          <li>
10
+            <el-input v-model="filterData.goodsName" placeholder="商品名称"></el-input>
11
+          </li>
12
+
13
+        </ul>
14
+        <el-button
15
+          size="mini"
16
+          type="primary" @click="search">查询</el-button>
17
+      </div> -->
18
+      <div class="moreFilter"></div>
19
+    </div>
20
+  <el-table
21
+    :data="list || []"
22
+    style="width: 100%">
23
+    <el-table-column
24
+      prop="phone"
25
+      label="电话号码">
26
+    </el-table-column>
27
+    <el-table-column
28
+      prop="message"
29
+      label="留言内容">
30
+    </el-table-column>
31
+    <el-table-column
32
+      label="创建时间">
33
+      <template slot-scope="scope">
34
+          <span>{{formateDate(scope.row.createDate)}}</span>
35
+      </template>
36
+    </el-table-column>
37
+  </el-table>
38
+  <el-pagination
39
+    small
40
+    style="margin-top:10px;"
41
+    layout="prev, pager, next"
42
+    :current-page.sync="pageNavi.current"
43
+    :pageSize="pageNavi.size"
44
+    :total="pageNavi.total || 0"
45
+    @current-change="getList"
46
+  >
47
+  </el-pagination>
48
+</div>
49
+</template>
50
+
51
+<script>
52
+import { createNamespacedHelpers } from "vuex";
53
+import dayjs from 'dayjs'
54
+
55
+const { mapActions: mapMessageActions } = createNamespacedHelpers("message");
56
+
57
+export default {
58
+  name: "goods-list",
59
+  data() {
60
+    return {
61
+      filterData: {
62
+        goodsName: ""
63
+      },
64
+      list: [],
65
+      pageNavi: {
66
+        current: 1,
67
+        size: 20,
68
+        total: 0
69
+      }
70
+    };
71
+  },
72
+  computed: {},
73
+  methods: {
74
+    ...mapMessageActions(["getMessage"]),
75
+    getList() {
76
+      const pageNumber = this.pageNavi.current || 1;
77
+      const pageSize = this.pageNavi.size;
78
+
79
+      this.getMessage({
80
+        ...this.filterData,
81
+        pageNumber,
82
+        pageSize
83
+      })
84
+        .then(res => {
85
+          const { records, ...pageNavi } = res;
86
+
87
+          this.list = records;
88
+          this.pageNavi = pageNavi;
89
+        })
90
+        .catch(err => {
91
+          this.$notify.error(err.msg || err.message);
92
+        });
93
+    },
94
+    addGoods() {
95
+      this.$router.push({ name: "goods.edit" });
96
+    },
97
+    toDetail(row) {
98
+      this.$router.push({
99
+        name: "goods.edit",
100
+        params: { id: row.goodsId }
101
+      });
102
+    },
103
+    changeStatus(row) {
104
+      this.showLoadding("保存中...");
105
+      this.changeGoodsStatus(row)
106
+        .then(res => {
107
+          this.hideLoadding();
108
+          this.$notify.info("保存成功");
109
+          this.search();
110
+        })
111
+        .catch(err => {
112
+          this.hideLoadding();
113
+          this.$notify.error(err.message);
114
+        });
115
+    },
116
+    showLoadding(text) {
117
+      this.loading = this.$loading({
118
+        text,
119
+        lock: true,
120
+        spinner: "el-icon-loading",
121
+        background: "rgba(255, 255, 255, 0.7)"
122
+      });
123
+    },
124
+    hideLoadding() {
125
+      if (this.loading) this.loading.close();
126
+    },
127
+    search() {
128
+      this.pageNavi.current = 1;
129
+      this.getList();
130
+    },
131
+    newPage(page) {
132
+      this.$router.replace({ name: "goods.list", query: { page } });
133
+    },
134
+    formateDate(dt) {
135
+      return !dt ? '' : dayjs(dt).format('YYYY-MM-DD HH:mm')
136
+    },
137
+  },
138
+  created() {
139
+    this.pageNavi.current = this.$route.query.page || 1;
140
+
141
+    this.getList();
142
+  }
143
+};
144
+</script>
145
+
146
+<style lang="scss" scoped>
147
+.list {
148
+  .header {
149
+    width: 50px;
150
+    height: 50px;
151
+    border-radius: 50%;
152
+  }
153
+  img {
154
+      width: 100%;
155
+      height: 100%;
156
+    }
157
+}
158
+.system-table-search {
159
+  width: calc(100% - 40px);
160
+  margin: 20px auto 0;
161
+}
162
+
163
+.system-table-search li {
164
+  margin-right: 20px;
165
+}
166
+
167
+.system-table-search ul {
168
+  font-size: 0;
169
+  white-space: nowrap;
170
+}
171
+
172
+.system-table-search ul > li {
173
+  display: inline-block;
174
+}
175
+
176
+.flex-h {
177
+  display: flex;
178
+  align-items: center;
179
+}
180
+
181
+.flex-item {
182
+  flex: 1;
183
+  -webkit-flex: 1;
184
+  position: relative;
185
+  overflow: hidden;
186
+}
187
+</style>

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

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