Browse Source

first commit

张延森 6 years ago
parent
commit
c41a9bd424

+ 1
- 1
public/index.html View File

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

+ 3
- 169
src/views/Dashboard.vue View File

1
 <template>
1
 <template>
2
   <div class="dash-main">
2
   <div class="dash-main">
3
-    <el-row :gutter="24" class="sta-row">
4
-      <el-col :span="8"><stat-card icon="el-icon-time" theme="success" tip="总到访" :val="personDt.total"></stat-card></el-col>
5
-      <el-col :span="8"><stat-card icon="el-icon-date" tip="今日到访" theme="danger" :val="personDt.today"></stat-card></el-col>
6
-      <el-col :span="8"><stat-card icon="el-icon-news" tip="今日老客户" theme="warn" :val="personDt.regular"></stat-card></el-col>
7
-    </el-row>
8
-    <div class="sta-row">
9
-      <el-card shadow="never">
10
-        <div slot="header" class="short-filters">
11
-          <div class="flex-item">&nbsp;</div>
12
-          <div class="static-item item-space">
13
-            <el-radio-group
14
-              size="small"
15
-              v-model="filterData.dateShortcut"
16
-              @change="handeShortDateChange"
17
-            >
18
-              <el-radio-button label="本年"></el-radio-button>
19
-              <el-radio-button label="本季"></el-radio-button>
20
-              <el-radio-button label="本月"></el-radio-button>
21
-            </el-radio-group>
22
-          </div>
23
-          <div class="static-item item-space">
24
-            <el-date-picker
25
-              size="small"
26
-              v-model="filterData.dateRange"
27
-              type="daterange"
28
-              range-separator="至"
29
-              start-placeholder="开始日期"
30
-              end-placeholder="结束日期"
31
-              @change="handleDateChange">
32
-            </el-date-picker>
33
-          </div>
34
-        </div>
35
-        <el-row :gutter="12" type="flex">
36
-          <el-col :span="12">
37
-            <table-chart :page="visitingPage" :source="visitingList" @page-change="nextVistingLogPage"></table-chart>
38
-          </el-col>
39
-          <el-col :span="12">
40
-            <line-chart :source="dailyVisiting" :style="{minHeight: '400px'}"></line-chart>
41
-          </el-col>
42
-        </el-row>
43
-      </el-card>
44
-    </div>
3
+    <h3>欢迎使用经纪人系统</h3>
45
   </div>
4
   </div>
46
 </template>
5
 </template>
47
 
6
 
48
 <script>
7
 <script>
49
-import dayjs from 'dayjs'
50
-import { createNamespacedHelpers } from 'vuex'
51
-
52
-const {mapState: mapStatsState, mapActions: mapStatsActions} = createNamespacedHelpers('stats')
53
 
8
 
54
 export default {
9
 export default {
55
   name: 'dashboard',
10
   name: 'dashboard',
56
   components: {
11
   components: {
57
-    lineChart: () => import('@/components/charts/VisitingDayLine.vue'),
58
-    tableChart: () => import('@/components/charts/VisitingDayTable.vue'),
59
-    statCard: () => import('@/components/charts/StatCard.vue'),
60
   },
12
   },
61
   data () {
13
   data () {
62
     return {
14
     return {
63
-      filterData: {
64
-        dateRange: [],
65
-        dateShortcut: '',
66
-      },
67
-      visitingLogCurrentPage: 1,
68
     }
15
     }
69
   },
16
   },
70
   computed: {
17
   computed: {
71
-    ...mapStatsState({
72
-      personDts: x => x.person,
73
-      dailyVisiting: x => x.visitingDaily,
74
-      visitingLog: x => x.visitingLog,
75
-    }),
76
-    personDt () {
77
-      return (this.personDts || [])[0] || {}
78
-    },
79
-    visitingPage () {
80
-      return {
81
-        total: (this.visitingLog || {}).total || 0,
82
-        size: (this.visitingLog || {}).size || 10,
83
-        current: this.visitingLogCurrentPage,
84
-      }
85
-    },
86
-    visitingList () {
87
-      return (this.visitingLog || {}).records || []
88
-    }
89
   },
18
   },
90
   created () {
19
   created () {
91
-    this.changeDate('week')
92
-    this.getPersonStats()
93
   },
20
   },
94
   methods: {
21
   methods: {
95
-    ...mapStatsActions([
96
-      'getPersonStats',
97
-      'getVisitingDaily',
98
-      'getVisitingLog',
99
-    ]),
100
-    handleDateChange (dts) {
101
-      this.filterData.dateRange = dts
102
-      this.filterData.dateShortcut = ''
103
-      this.search()
104
-    },
105
-    search (rg) {
106
-      if (!rg || rg === 'visiting-daily') {
107
-        this.getVisitingDaily({
108
-          startDate: dayjs(this.filterData.dateRange[0]).format('YYYY-MM-DDT00:00:00'),
109
-          endDate: dayjs(this.filterData.dateRange[1]).format('YYYY-MM-DDT23:59:59'),
110
-        })
111
-      }
112
-
113
-      if (!rg || rg === 'visiting-log') {
114
-        this.getVisitingLog({
115
-          pageNum: this.visitingLogCurrentPage,
116
-          pageSize: this.visitingPage.size,
117
-          beginDate: dayjs(this.filterData.dateRange[0]).format('YYYY-MM-DDT00:00:00'),
118
-          endDate: dayjs(this.filterData.dateRange[1]).format('YYYY-MM-DDT23:59:59'),
119
-        })
120
-      }
121
-    },
122
-    changeDate (typ) {
123
-      this.filterData.dateRange = this.getDateRange(typ)
124
-      this.search()
125
-    },
126
-    nextVistingLogPage (page) {
127
-      this.visitingLogCurrentPage = page
128
-      this.search('visiting-log')
129
-    },
130
-    handeShortDateChange (val) {
131
-      switch (val) {
132
-        case '本年':
133
-          this.changeDate('year')
134
-          break
135
-        case '本季':
136
-          this.changeDate('quarter')
137
-          break
138
-        case '本月':
139
-          this.changeDate('month')
140
-          break
141
-      }
142
-    },
143
-    getDateRange(typ) {
144
-      // typ: https://github.com/iamkun/dayjs/blob/dev/src/constant.js#L13
145
-      const now = new Date();
146
-
147
-      const start = typ === 'quarter' ? this.getQuarterStart(now) : dayjs(now).startOf(typ).toDate()
148
-
149
-      return [ start, now ]
150
-    },
151
-    getQuarterStart(dt) {
152
-      const mon = dt.getMonth()
153
-      const year = dt.getFullYear()
154
-
155
-      if (mon < 3) return dayjs(`${year}-01-01`).toDate()
156
-      if (mon < 6) return dayjs(`${year}-03-01`).toDate()
157
-      if (mon < 9) return dayjs(`${year}-06-01`).toDate()
158
-
159
-      return dayjs(`${year}-09-01`).toDate()
160
-    }
161
   }
22
   }
162
 }
23
 }
163
 </script>
24
 </script>
166
 <style lang="scss" scoped>
27
 <style lang="scss" scoped>
167
 .dash-main {
28
 .dash-main {
168
   background-color: transparent !important;
29
   background-color: transparent !important;
169
-  padding: 20px 0;
170
-}
171
-
172
-.sta-row {
173
-  & + .sta-row {
174
-    margin-top: 24px;
175
-  }
176
-}
177
-
178
-.short-filters {
179
-  display: flex;
180
-
181
-  .item-space {
182
-    margin-left: 24px;
183
-  }
184
-
185
-  .flex-item {
186
-    flex: auto;
187
-  }
188
-
189
-  .static-item {
190
-    flex: none;
191
-  }
192
-}
193
-</style>
194
-
195
-<style lang="scss">
196
-.dash-main .el-card__header {
197
-  padding: 12px;
30
+  padding: 200px 0;
31
+  text-align: center;
198
 }
32
 }
199
 </style>
33
 </style>

+ 46
- 3
src/views/building/edit.vue View File

50
             :action="upFileUrl"
50
             :action="upFileUrl"
51
             name='file'
51
             name='file'
52
             list-type="picture-card"
52
             list-type="picture-card"
53
+            :headers="uploadHeaders"
53
             :file-list="imgList"
54
             :file-list="imgList"
54
             :show-file-list="true"
55
             :show-file-list="true"
55
             :before-upload="beforeImgUpload"
56
             :before-upload="beforeImgUpload"
65
           <el-upload
66
           <el-upload
66
             class="avatar-uploader"
67
             class="avatar-uploader"
67
             :action="upFileUrl"
68
             :action="upFileUrl"
69
+            :headers="uploadHeaders"
68
             name='file'
70
             name='file'
69
             :show-file-list="false"
71
             :show-file-list="false"
70
             :before-upload="beforeImgUpload"
72
             :before-upload="beforeImgUpload"
73
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
75
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
74
           </el-upload>
76
           </el-upload>
75
         </el-form-item>
77
         </el-form-item>
78
+        <el-form-item label="海报底图">
79
+          <el-upload
80
+            class="avatar-uploader"
81
+            :action="upFileUrl"
82
+            :headers="uploadHeaders"
83
+            name='file'
84
+            :show-file-list="false"
85
+            :before-upload="beforeImgUpload"
86
+            :on-success="handlePosterSuccess">
87
+            <img v-if="building.poster" :src="building.poster" class="avatar">
88
+            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
89
+          </el-upload>
90
+        </el-form-item>
76
         <el-form-item label="排序">
91
         <el-form-item label="排序">
77
           <el-input v-model="building.orderNo"></el-input>
92
           <el-input v-model="building.orderNo"></el-input>
78
         </el-form-item>
93
         </el-form-item>
187
             <el-upload
202
             <el-upload
188
               :action="upFileUrl"
203
               :action="upFileUrl"
189
               name='file'
204
               name='file'
205
+              :headers="uploadHeaders"
190
               list-type="picture-card"
206
               list-type="picture-card"
191
               :file-list="aparmentImg"
207
               :file-list="aparmentImg"
192
               :show-file-list="true"
208
               :show-file-list="true"
199
               <img width="100%" :src="dialogApartImageUrl" alt="">
215
               <img width="100%" :src="dialogApartImageUrl" alt="">
200
             </el-dialog>
216
             </el-dialog>
201
           </el-form-item>
217
           </el-form-item>
218
+          <el-form-item label="面积">
219
+            <el-input v-model="aparmentInfo.buildingArea"></el-input>
220
+          </el-form-item>
221
+          <el-form-item label="套内面积">
222
+            <el-input v-model="aparmentInfo.insideArea"></el-input>
223
+          </el-form-item>
202
           <el-form-item label="备注">
224
           <el-form-item label="备注">
203
             <el-input type="textarea" v-model="aparmentInfo.remark"></el-input>
225
             <el-input type="textarea" v-model="aparmentInfo.remark"></el-input>
204
           </el-form-item>
226
           </el-form-item>
249
         city: '南京',
271
         city: '南京',
250
         citylimit: false
272
         citylimit: false
251
       },
273
       },
274
+      saleType: [
275
+        {
276
+          id: 1,
277
+          name: '待定',
278
+        },
279
+        {
280
+          id: 2,
281
+          name: '售罄',
282
+        },
283
+        {
284
+          id: 3,
285
+          name: '在售',
286
+        },
287
+      ],
252
       mapCenter: [118.789509, 32.019989],
288
       mapCenter: [118.789509, 32.019989],
253
       events: {
289
       events: {
254
         click: (e) => {
290
         click: (e) => {
275
     propertyType () {
311
     propertyType () {
276
       return (this.dicts || []).filter(x => x.type === 'propertyType')
312
       return (this.dicts || []).filter(x => x.type === 'propertyType')
277
     },
313
     },
278
-    saleType () {
279
-      return (this.dicts || []).filter(x => x.type === 'saleType')
314
+    uploadHeaders () {
315
+      const token = localStorage.getItem('x-token') || ''
316
+      return {
317
+        Authorization: `Bearer ${token}`
318
+      }
280
     }
319
     }
281
   },
320
   },
282
   methods: {
321
   methods: {
299
       'uploadImg'
338
       'uploadImg'
300
     ]),
339
     ]),
301
     getSaleTypeName (id) {
340
     getSaleTypeName (id) {
302
-      return ((this.dicts || []).filter(x => x.type === 'saleType' && x.id == id) [0] || {}).name
341
+      return (this.saleType.filter(x => x.id == id) [0] || {}).name
303
     },
342
     },
304
     onCancel () {
343
     onCancel () {
305
       this.$router.push({name: 'buildinglist'})
344
       this.$router.push({name: 'buildinglist'})
355
       this.building = {...this.building, mapImg: res.data }
394
       this.building = {...this.building, mapImg: res.data }
356
       this.loading.close()
395
       this.loading.close()
357
     },
396
     },
397
+    handlePosterSuccess(res) {
398
+      this.building = {...this.building, poster: res.data }
399
+      this.loading.close()
400
+    },
358
     handleAparmentSuccess (res) {
401
     handleAparmentSuccess (res) {
359
       this.aparmentImg = [...this.aparmentImg, {
402
       this.aparmentImg = [...this.aparmentImg, {
360
         url: res.data
403
         url: res.data

+ 3
- 0
src/views/consultant/edit.vue View File

17
         <el-form-item label="电话">
17
         <el-form-item label="电话">
18
           <el-input v-model="detail.tel"></el-input>
18
           <el-input v-model="detail.tel"></el-input>
19
         </el-form-item>
19
         </el-form-item>
20
+        <el-form-item label="地址">
21
+          <el-input v-model="detail.address"></el-input>
22
+        </el-form-item>
20
         <el-form-item label="授权项目">
23
         <el-form-item label="授权项目">
21
           <el-select v-model="detail.buildings" placeholder="请选择">
24
           <el-select v-model="detail.buildings" placeholder="请选择">
22
             <el-option v-for="(build,i) in buildings.list || []" :key="i" :label="build.buildingName" :value="build.buildingId"></el-option>
25
             <el-option v-for="(build,i) in buildings.list || []" :key="i" :label="build.buildingName" :value="build.buildingId"></el-option>

+ 1
- 1
src/views/consultant/list.vue View File

60
       list: [],
60
       list: [],
61
       pageNavi: {
61
       pageNavi: {
62
         current: 1,
62
         current: 1,
63
-        size: 1,
63
+        size: 20,
64
         total: 0,
64
         total: 0,
65
       },
65
       },
66
     }
66
     }