yuantianjiao 6 years ago
parent
commit
af4464402e

+ 1
- 1
src/components/customerCard/customerCard.vue View File

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

+ 2
- 1
src/components/myCard/myCard.vue View File

9
       <div>
9
       <div>
10
         <h2>{{data.title}}</h2>
10
         <h2>{{data.title}}</h2>
11
         <span class="descs">{{data.desc}}</span>
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
       </div>
14
       </div>
14
     </div>
15
     </div>
15
     <div class="card-main flex-h" @click="detail">
16
     <div class="card-main flex-h" @click="detail">

+ 16
- 3
src/pages/sales/customerSearch/index.vue View File

50
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
50
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
51
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
51
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
52
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
52
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
53
+const { mapState: mpRemarkState, mapActions: mapRemarkActions } = createNamespacedHelpers('remark')
53
 
54
 
54
 export default {
55
 export default {
55
   name: '',
56
   name: '',
70
       mask: true,
71
       mask: true,
71
       checked: true,
72
       checked: true,
72
       cardList: [],
73
       cardList: [],
73
-      showDialog: false
74
+      showDialog: false,
75
+      remarkCustomerId: ''
74
     }
76
     }
75
   },
77
   },
76
   computed: {
78
   computed: {
111
     ...mapCaseActions([
113
     ...mapCaseActions([
112
       'getCaseTotal',
114
       'getCaseTotal',
113
     ]),
115
     ]),
116
+    ...mapRemarkActions(['setRemark']),
114
     record (item) {
117
     record (item) {
115
       // console.log(item)
118
       // console.log(item)
116
       this.$router.push({ name: 'getRecord', query: { name: item.Name, phone: item.Phone, id: item.CustomerId } })
119
       this.$router.push({ name: 'getRecord', query: { name: item.Name, phone: item.Phone, id: item.CustomerId } })
118
     remark (item) {
121
     remark (item) {
119
       // console.log(item)
122
       // console.log(item)
120
       this.showDialog = true
123
       this.showDialog = true
124
+      this.remarkCustomerId = item.CustomerId
121
     },
125
     },
122
     history (item) {
126
     history (item) {
123
       // console.log(item)
127
       // console.log(item)
124
-      window.location.href = this.getUrl('history')
128
+      this.$router.push({ name: 'history', query: { customerId: item.CustomerId } })
125
     },
129
     },
126
     searchMask () {
130
     searchMask () {
127
       this.getCustomerList({
131
       this.getCustomerList({
160
         caseid: this.topCaseInfoData.caseId
164
         caseid: this.topCaseInfoData.caseId
161
       })
165
       })
162
       this.showSelect = false
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
 </script>
179
 </script>

+ 10
- 1
src/pages/sales/history/index.vue View File

23
 import topCaseInfo from '../../../components/topCaseInfo/index'
23
 import topCaseInfo from '../../../components/topCaseInfo/index'
24
 import { mapState, createNamespacedHelpers } from 'vuex'
24
 import { mapState, createNamespacedHelpers } from 'vuex'
25
 const { mapActions: actions } = createNamespacedHelpers('app')
25
 const { mapActions: actions } = createNamespacedHelpers('app')
26
+const { mapState: mpRemarkState, mapActions: mapRemarkActions } = createNamespacedHelpers('remark')
26
 export default {
27
 export default {
27
   name: '',
28
   name: '',
28
   data () {
29
   data () {
29
     return {
30
     return {
30
-      list: [1,1,1,1,1],
31
+      // list: [1,1,1,1,1],
31
       topCaseInfoData: {
32
       topCaseInfoData: {
32
         caseName: '',
33
         caseName: '',
33
         caseId: '',
34
         caseId: '',
43
       userInfo: x => x.userCenter.userInfo,
44
       userInfo: x => x.userCenter.userInfo,
44
       CaseList: x => x.app.CaseList,
45
       CaseList: x => x.app.CaseList,
45
     }),
46
     }),
47
+    ...mapRemarkActions({
48
+      list: x => x.remarkList
49
+    }),
46
   },
50
   },
47
   created () {
51
   created () {
48
     this.getCaseList().then((res) => {
52
     this.getCaseList().then((res) => {
52
           this.topCaseInfoData.caseName = this.CaseList[i].CaseName
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
   methods: {
63
   methods: {
58
     ...actions([
64
     ...actions([
59
       'getCaseList',
65
       'getCaseList',
66
+    ]),
67
+    ...mapRemarkActions([
68
+      'getRemark',
60
     ])
69
     ])
61
   }
70
   }
62
 }
71
 }

+ 9
- 3
src/pages/user/mainPage/coffeeIndex/index.vue View File

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

+ 14
- 2
src/pages/user/rush/index.vue View File

31
       </div>
31
       </div>
32
     </div>
32
     </div>
33
     <div class="submit">
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
     </div>
35
     </div>
36
   </div>
36
   </div>
37
 </template>
37
 </template>
38
 
38
 
39
 <script>
39
 <script>
40
+import { mapState, createNamespacedHelpers } from 'vuex'
41
+const { mapActions: actions } = createNamespacedHelpers('app')
42
+const { mapState: mapRushState, mapActions: mapRushActions } = createNamespacedHelpers('rush')
40
 export default {
43
 export default {
41
   data () {
44
   data () {
42
     return {
45
     return {
57
     this.timing(start, end)
60
     this.timing(start, end)
58
   },
61
   },
59
   computed: {
62
   computed: {
60
-
63
+    ...mapRushState({
64
+      detail: item => item.rushDetail
65
+    })
61
   },
66
   },
62
   methods: {
67
   methods: {
68
+    ...mapRushActions(['setRush']),
63
     timing (startTime, endTime) {
69
     timing (startTime, endTime) {
64
       this.Interval = setInterval(() => {
70
       this.Interval = setInterval(() => {
65
         let nowTime = new Date().getTime()
71
         let nowTime = new Date().getTime()
87
       this.minute = minute < 10 ? '0' + minute : minute
93
       this.minute = minute < 10 ? '0' + minute : minute
88
       this.hour = hour < 10 ? '0' + hour : hour
94
       this.hour = hour < 10 ? '0' + hour : hour
89
       this.day = day < 10 ? '0' + day : day
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 View File

14
             <div class="title">账单明细</div>
14
             <div class="title">账单明细</div>
15
             <div class="list-box">
15
             <div class="list-box">
16
               <div class="list" v-for="(items,indexs) in item.Changes" :key="indexs">
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
                 <span>{{items.FloatType}}{{items.Amount}}</span>
18
                 <span>{{items.FloatType}}{{items.Amount}}</span>
19
                 <span class="date">{{toolClass.dateFormat(items.CreateDate)}}</span>
19
                 <span class="date">{{toolClass.dateFormat(items.CreateDate)}}</span>
20
               </div>
20
               </div>

+ 2
- 0
src/store/index.js View File

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

+ 46
- 0
src/store/remark/index.js View File

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 View File

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 View File

256
       url: `${baseUrl}${wechat}/GetCheckByUser`
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
 export default $api
280
 export default $api