张延森 hace 6 años
padre
commit
c41a9bd424

+ 1
- 1
public/index.html Ver fichero

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

+ 3
- 169
src/views/Dashboard.vue Ver fichero

@@ -1,163 +1,24 @@
1 1
 <template>
2 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 4
   </div>
46 5
 </template>
47 6
 
48 7
 <script>
49
-import dayjs from 'dayjs'
50
-import { createNamespacedHelpers } from 'vuex'
51
-
52
-const {mapState: mapStatsState, mapActions: mapStatsActions} = createNamespacedHelpers('stats')
53 8
 
54 9
 export default {
55 10
   name: 'dashboard',
56 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 13
   data () {
62 14
     return {
63
-      filterData: {
64
-        dateRange: [],
65
-        dateShortcut: '',
66
-      },
67
-      visitingLogCurrentPage: 1,
68 15
     }
69 16
   },
70 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 19
   created () {
91
-    this.changeDate('week')
92
-    this.getPersonStats()
93 20
   },
94 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 24
 </script>
@@ -166,34 +27,7 @@ export default {
166 27
 <style lang="scss" scoped>
167 28
 .dash-main {
168 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 33
 </style>

+ 46
- 3
src/views/building/edit.vue Ver fichero

@@ -50,6 +50,7 @@
50 50
             :action="upFileUrl"
51 51
             name='file'
52 52
             list-type="picture-card"
53
+            :headers="uploadHeaders"
53 54
             :file-list="imgList"
54 55
             :show-file-list="true"
55 56
             :before-upload="beforeImgUpload"
@@ -65,6 +66,7 @@
65 66
           <el-upload
66 67
             class="avatar-uploader"
67 68
             :action="upFileUrl"
69
+            :headers="uploadHeaders"
68 70
             name='file'
69 71
             :show-file-list="false"
70 72
             :before-upload="beforeImgUpload"
@@ -73,6 +75,19 @@
73 75
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
74 76
           </el-upload>
75 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 91
         <el-form-item label="排序">
77 92
           <el-input v-model="building.orderNo"></el-input>
78 93
         </el-form-item>
@@ -187,6 +202,7 @@
187 202
             <el-upload
188 203
               :action="upFileUrl"
189 204
               name='file'
205
+              :headers="uploadHeaders"
190 206
               list-type="picture-card"
191 207
               :file-list="aparmentImg"
192 208
               :show-file-list="true"
@@ -199,6 +215,12 @@
199 215
               <img width="100%" :src="dialogApartImageUrl" alt="">
200 216
             </el-dialog>
201 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 224
           <el-form-item label="备注">
203 225
             <el-input type="textarea" v-model="aparmentInfo.remark"></el-input>
204 226
           </el-form-item>
@@ -249,6 +271,20 @@ export default {
249 271
         city: '南京',
250 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 288
       mapCenter: [118.789509, 32.019989],
253 289
       events: {
254 290
         click: (e) => {
@@ -275,8 +311,11 @@ export default {
275 311
     propertyType () {
276 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 321
   methods: {
@@ -299,7 +338,7 @@ export default {
299 338
       'uploadImg'
300 339
     ]),
301 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 343
     onCancel () {
305 344
       this.$router.push({name: 'buildinglist'})
@@ -355,6 +394,10 @@ export default {
355 394
       this.building = {...this.building, mapImg: res.data }
356 395
       this.loading.close()
357 396
     },
397
+    handlePosterSuccess(res) {
398
+      this.building = {...this.building, poster: res.data }
399
+      this.loading.close()
400
+    },
358 401
     handleAparmentSuccess (res) {
359 402
       this.aparmentImg = [...this.aparmentImg, {
360 403
         url: res.data

+ 3
- 0
src/views/consultant/edit.vue Ver fichero

@@ -17,6 +17,9 @@
17 17
         <el-form-item label="电话">
18 18
           <el-input v-model="detail.tel"></el-input>
19 19
         </el-form-item>
20
+        <el-form-item label="地址">
21
+          <el-input v-model="detail.address"></el-input>
22
+        </el-form-item>
20 23
         <el-form-item label="授权项目">
21 24
           <el-select v-model="detail.buildings" placeholder="请选择">
22 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 Ver fichero

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