yuantianjiao 6 jaren geleden
bovenliggende
commit
af4464402e

+ 1
- 1
src/components/customerCard/customerCard.vue Bestand weergeven

@@ -17,7 +17,7 @@
17 17
       </div>
18 18
     </div>
19 19
     <div class="card-bottom">
20
-      <span>备注:{{data.remark}}</span>
20
+      <span>备注:{{data.Remark}}</span>
21 21
       <span @click="remark">+ 添加备注</span>
22 22
     </div>
23 23
   </div>

+ 2
- 1
src/components/myCard/myCard.vue Bestand weergeven

@@ -9,7 +9,8 @@
9 9
       <div>
10 10
         <h2>{{data.title}}</h2>
11 11
         <span class="descs">{{data.desc}}</span>
12
-        <span>{{data.startDate}}-{{data.endDate}}</span>
12
+        <span v-if="data.ValidDays">领取后{{data.ValidDays}}天内有效</span>
13
+        <span v-else>{{data.startDate}}-{{data.endDate}}</span>
13 14
       </div>
14 15
     </div>
15 16
     <div class="card-main flex-h" @click="detail">

+ 16
- 3
src/pages/sales/customerSearch/index.vue Bestand weergeven

@@ -50,6 +50,7 @@ const { mapActions: actions } = createNamespacedHelpers('app')
50 50
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
51 51
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
52 52
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
53
+const { mapState: mpRemarkState, mapActions: mapRemarkActions } = createNamespacedHelpers('remark')
53 54
 
54 55
 export default {
55 56
   name: '',
@@ -70,7 +71,8 @@ export default {
70 71
       mask: true,
71 72
       checked: true,
72 73
       cardList: [],
73
-      showDialog: false
74
+      showDialog: false,
75
+      remarkCustomerId: ''
74 76
     }
75 77
   },
76 78
   computed: {
@@ -111,6 +113,7 @@ export default {
111 113
     ...mapCaseActions([
112 114
       'getCaseTotal',
113 115
     ]),
116
+    ...mapRemarkActions(['setRemark']),
114 117
     record (item) {
115 118
       // console.log(item)
116 119
       this.$router.push({ name: 'getRecord', query: { name: item.Name, phone: item.Phone, id: item.CustomerId } })
@@ -118,10 +121,11 @@ export default {
118 121
     remark (item) {
119 122
       // console.log(item)
120 123
       this.showDialog = true
124
+      this.remarkCustomerId = item.CustomerId
121 125
     },
122 126
     history (item) {
123 127
       // console.log(item)
124
-      window.location.href = this.getUrl('history')
128
+      this.$router.push({ name: 'history', query: { customerId: item.CustomerId } })
125 129
     },
126 130
     searchMask () {
127 131
       this.getCustomerList({
@@ -160,7 +164,16 @@ export default {
160 164
         caseid: this.topCaseInfoData.caseId
161 165
       })
162 166
       this.showSelect = false
163
-    }
167
+    },
168
+    beforeClose (action, done) {
169
+      if (action === 'confirm') {
170
+        this.setRemark({ salesId: this.userInfo.customer.MapUser, customerId: this.remarkCustomerId, remark: this.message }).then(() => {
171
+          done()
172
+        })
173
+      } else {
174
+        done()
175
+      }
176
+    },
164 177
   }
165 178
 }
166 179
 </script>

+ 10
- 1
src/pages/sales/history/index.vue Bestand weergeven

@@ -23,11 +23,12 @@
23 23
 import topCaseInfo from '../../../components/topCaseInfo/index'
24 24
 import { mapState, createNamespacedHelpers } from 'vuex'
25 25
 const { mapActions: actions } = createNamespacedHelpers('app')
26
+const { mapState: mpRemarkState, mapActions: mapRemarkActions } = createNamespacedHelpers('remark')
26 27
 export default {
27 28
   name: '',
28 29
   data () {
29 30
     return {
30
-      list: [1,1,1,1,1],
31
+      // list: [1,1,1,1,1],
31 32
       topCaseInfoData: {
32 33
         caseName: '',
33 34
         caseId: '',
@@ -43,6 +44,9 @@ export default {
43 44
       userInfo: x => x.userCenter.userInfo,
44 45
       CaseList: x => x.app.CaseList,
45 46
     }),
47
+    ...mapRemarkActions({
48
+      list: x => x.remarkList
49
+    }),
46 50
   },
47 51
   created () {
48 52
     this.getCaseList().then((res) => {
@@ -52,11 +56,16 @@ export default {
52 56
           this.topCaseInfoData.caseName = this.CaseList[i].CaseName
53 57
         }
54 58
       }
59
+      console.log(this.userInfo)
60
+      this.getRemark({ salesId: this.userInfo.MappingId, customerId: this.$route.query.customerId })
55 61
     })
56 62
   },
57 63
   methods: {
58 64
     ...actions([
59 65
       'getCaseList',
66
+    ]),
67
+    ...mapRemarkActions([
68
+      'getRemark',
60 69
     ])
61 70
   }
62 71
 }

+ 9
- 3
src/pages/user/mainPage/coffeeIndex/index.vue Bestand weergeven

@@ -138,6 +138,7 @@ import { mapState, createNamespacedHelpers } from 'vuex'
138 138
 const { mapActions: actions } = createNamespacedHelpers('app')
139 139
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
140 140
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
141
+const { mapState: mpRemarkState, mapActions: mapRemarkActions } = createNamespacedHelpers('remark')
141 142
 const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('myCard')
142 143
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
143 144
 const wx = require('weixin-js-sdk')
@@ -238,7 +239,8 @@ export default {
238 239
           pagesize: 1,
239 240
           list: []
240 241
         }
241
-      ]
242
+      ],
243
+      remarkCustomerId: ''
242 244
     }
243 245
   },
244 246
   computed: {
@@ -372,6 +374,7 @@ export default {
372 374
       'changeChoosedCase'
373 375
     ]),
374 376
     ...mapCardActions(['getCardList']),
377
+    ...mapRemarkActions(['setRemark']),
375 378
     checkCanDo () {
376 379
       const _that = this
377 380
       return this.forbidList.filter(x => x.UserId === _that.userInfo.customer.MapUser && x.ForbidType === 'coupon').length > 0
@@ -466,10 +469,11 @@ export default {
466 469
     remark (item) {
467 470
       // console.log(item)
468 471
       this.showDialog = true
472
+      this.remarkCustomerId = item.CustomerId
469 473
     },
470 474
     history (item) {
471 475
       // console.log(item)
472
-      window.location.href = this.getUrl('history')
476
+      window.location.href = this.getUrl(`history?customerId=${item.CustomerId}`)
473 477
     },
474 478
     record (item) {
475 479
       // console.log(item)
@@ -557,7 +561,9 @@ export default {
557 561
     },
558 562
     beforeClose (action, done) {
559 563
       if (action === 'confirm') {
560
-        setTimeout(done, 1000)
564
+        this.setRemark({ salesId: this.userInfo.customer.MapUser, customerId: this.remarkCustomerId, remark: this.message }).then(() => {
565
+          done()
566
+        })
561 567
       } else {
562 568
         done()
563 569
       }

+ 14
- 2
src/pages/user/rush/index.vue Bestand weergeven

@@ -31,12 +31,15 @@
31 31
       </div>
32 32
     </div>
33 33
     <div class="submit">
34
-      <div :class="{light:timeStatus === 1}">{{btnText[timeStatus]}}</div>
34
+      <div :class="{light:timeStatus === 1}" @click="submit()">{{btnText[timeStatus]}}</div>
35 35
     </div>
36 36
   </div>
37 37
 </template>
38 38
 
39 39
 <script>
40
+import { mapState, createNamespacedHelpers } from 'vuex'
41
+const { mapActions: actions } = createNamespacedHelpers('app')
42
+const { mapState: mapRushState, mapActions: mapRushActions } = createNamespacedHelpers('rush')
40 43
 export default {
41 44
   data () {
42 45
     return {
@@ -57,9 +60,12 @@ export default {
57 60
     this.timing(start, end)
58 61
   },
59 62
   computed: {
60
-
63
+    ...mapRushState({
64
+      detail: item => item.rushDetail
65
+    })
61 66
   },
62 67
   methods: {
68
+    ...mapRushActions(['setRush']),
63 69
     timing (startTime, endTime) {
64 70
       this.Interval = setInterval(() => {
65 71
         let nowTime = new Date().getTime()
@@ -87,6 +93,12 @@ export default {
87 93
       this.minute = minute < 10 ? '0' + minute : minute
88 94
       this.hour = hour < 10 ? '0' + hour : hour
89 95
       this.day = day < 10 ? '0' + day : day
96
+    },
97
+    submit () {
98
+      if (this.timeStatus !== 1) {
99
+        return
100
+      }
101
+      this.setRush()
90 102
     }
91 103
   }
92 104
 }

+ 1
- 1
src/pages/user/vipDetail/index.vue Bestand weergeven

@@ -14,7 +14,7 @@
14 14
             <div class="title">账单明细</div>
15 15
             <div class="list-box">
16 16
               <div class="list" v-for="(items,indexs) in item.Changes" :key="indexs">
17
-                <span>{{items.ChangeSource === 'recharge' ? '充值' : items.SourceName}}</span>
17
+                <span>{{items.SourceName}}</span>
18 18
                 <span>{{items.FloatType}}{{items.Amount}}</span>
19 19
                 <span class="date">{{toolClass.dateFormat(items.CreateDate)}}</span>
20 20
               </div>

+ 2
- 0
src/store/index.js Bestand weergeven

@@ -26,6 +26,8 @@ export const modules = {
26 26
   share: () => require('./share/index').default,
27 27
   bodyCheck: () => require('./bodyCheck/index').default,
28 28
   vip: () => require('./vip/index').default,
29
+  remark: () => require('./remark/index').default,
30
+  rush: () => require('./rush/index').default,
29 31
 }
30 32
 
31 33
 Object.keys(modules).forEach((modKey) => {

+ 46
- 0
src/store/remark/index.js Bestand weergeven

@@ -0,0 +1,46 @@
1
+import Ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+// 请求数据
5
+export default {
6
+  namespaced: true,
7
+  state: {
8
+    remakrList: []
9
+  },
10
+  mutations: {
11
+    setRemark (state, data) {
12
+      state.remakrList = data || []
13
+    }
14
+  },
15
+  actions: {
16
+    getRemark (context, data) {
17
+      return new Promise((resolve, reject) => {
18
+        Ajax({
19
+          ...api.remark.getRemark,
20
+          urlData: { ...data }
21
+        }).then(res => {
22
+          context.commit('setRemark', res)
23
+          resolve(res)
24
+        }).catch((err) => {
25
+          reject(err)
26
+        })
27
+      })
28
+    },
29
+    setRemark (context, data) {
30
+      return new Promise((resolve, reject) => {
31
+        Ajax({
32
+          ...api.remark.setRemark,
33
+          data: {
34
+            SalesId: data.salesId,
35
+            CustomerId: data.customerId,
36
+            Remark: data.remark
37
+          }
38
+        }).then(res => {
39
+          resolve(res)
40
+        }).catch((err) => {
41
+          reject(err)
42
+        })
43
+      })
44
+    }
45
+  }
46
+}

+ 40
- 0
src/store/rush/index.js Bestand weergeven

@@ -0,0 +1,40 @@
1
+import Ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+// 请求数据
5
+export default {
6
+  namespaced: true,
7
+  state: {
8
+    rushDetail: {}
9
+  },
10
+  mutations: {
11
+    setDetail (state, data) {
12
+      state.rushDetail = data || []
13
+    }
14
+  },
15
+  actions: {
16
+    getRush (context) {
17
+      return new Promise((resolve, reject) => {
18
+        Ajax({
19
+          ...api.user.getRush
20
+        }).then(res => {
21
+          context.commit('setDetail', res)
22
+          resolve(res)
23
+        }).catch((err) => {
24
+          reject(err)
25
+        })
26
+      })
27
+    },
28
+    setRush (context, data) {
29
+      return new Promise((resolve, reject) => {
30
+        Ajax({
31
+          ...api.user.setRush
32
+        }).then(res => {
33
+          resolve(res)
34
+        }).catch((err) => {
35
+          reject(err)
36
+        })
37
+      })
38
+    }
39
+  }
40
+}

+ 20
- 0
src/util/api.js Bestand weergeven

@@ -256,5 +256,25 @@ const $api = {
256 256
       url: `${baseUrl}${wechat}/GetCheckByUser`
257 257
     }
258 258
   },
259
+  remark:{
260
+    setRemark: {
261
+      method: 'post',
262
+      url: `${baseUrl}${wechat}/customerremark`
263
+    },
264
+    getRemark: {
265
+      method: 'get',
266
+      url: `${baseUrl}${wechat}/customerremark/:salesId/:customerId`
267
+    }
268
+  },
269
+  rush:{
270
+    setRush: {
271
+      method: 'post',
272
+      url: `${baseUrl}${wechat}/customerremark`
273
+    },
274
+    getRush: {
275
+      method: 'get',
276
+      url: `${baseUrl}${wechat}/customerremark`
277
+    }
278
+  }
259 279
 }
260 280
 export default $api