许成详 6 年之前
父節點
當前提交
78c1d1588d

+ 2
- 2
src/pages/sales/login/index.vue 查看文件

86
         if (this.seconds < 60 && this.seconds >= 1) {
86
         if (this.seconds < 60 && this.seconds >= 1) {
87
           this.runTime()
87
           this.runTime()
88
         } else if (this.seconds < 1) {
88
         } else if (this.seconds < 1) {
89
-          this.seconds = 60
89
+          this.seconds = 59
90
         }
90
         }
91
       }, 1000)
91
       }, 1000)
92
     },
92
     },
101
       }
101
       }
102
       // console.log(this.postData)
102
       // console.log(this.postData)
103
       this.submitData(this.postData).then((res) => {
103
       this.submitData(this.postData).then((res) => {
104
-        this.$toast(res)
104
+        // this.$toast(res)
105
         window.location.href = this.getUrl('mainPage/coffeeIndex')
105
         window.location.href = this.getUrl('mainPage/coffeeIndex')
106
       })
106
       })
107
     }
107
     }

+ 8
- 4
src/pages/user/mainPage/coffeeIndex/index.vue 查看文件

4
       <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.CustomerName : ''" @selectCase="showVanPicker"></topCaseInfo>
4
       <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.CustomerName : ''" @selectCase="showVanPicker"></topCaseInfo>
5
     </div>
5
     </div>
6
     <nav class="flex-h" v-if="userInfo.customer.MapUser !== ''">
6
     <nav class="flex-h" v-if="userInfo.customer.MapUser !== ''">
7
-      <a class="flex-item" v-for="(item,index) in cutNavList" :key="index" :class="{'active': navActive === index}" @click="cutNav(index)">{{item.value}}</a>
7
+      <a class="flex-item" v-for="(item,index) in cutNavList" :key="index" v-if="userInfo.customer.UserTypeId !== 'manager' || item.id !== '3'" :class="{'active': navActive === index}" @click="cutNav(index)">{{item.value}}</a>
8
     </nav>
8
     </nav>
9
     <div class="content flex-item">
9
     <div class="content flex-item">
10
       <div>
10
       <div>
21
                   <span>本月已用:{{caseTotal.monthtotal}}杯</span>
21
                   <span>本月已用:{{caseTotal.monthtotal}}杯</span>
22
                 </div>
22
                 </div>
23
               </div>
23
               </div>
24
-              <a>点单记录</a>
24
+              <router-link :to="{name: 'orderList'}">点单记录</router-link>
25
             </div>
25
             </div>
26
             <div class="areaListParent flex-h">
26
             <div class="areaListParent flex-h">
27
               <div class="flex-item">
27
               <div class="flex-item">
54
                     <span>万</span>
54
                     <span>万</span>
55
                   </div>
55
                   </div>
56
                 </div>
56
                 </div>
57
-                <a :href="getUrl('salesRecord')">销售记录</a>
57
+                <a @click="toSalesHistory">销售记录</a>
58
                 <!-- <router-link :to="{name: 'salesRecord',query: {}}">销售记录</router-link> -->
58
                 <!-- <router-link :to="{name: 'salesRecord',query: {}}">销售记录</router-link> -->
59
               </div>
59
               </div>
60
               <myCard v-for="(item,index) in cardList" :key="index" :data='item' @share='share'></myCard>
60
               <myCard v-for="(item,index) in cardList" :key="index" :data='item' @share='share'></myCard>
173
     ...mapCaseActions([
173
     ...mapCaseActions([
174
       'getCaseTotal',
174
       'getCaseTotal',
175
     ]),
175
     ]),
176
+    toSalesHistory () {
177
+      console.log(this.getUrl('salesRecord'))
178
+      window.location.href = this.getUrl('salesRecord')
179
+    },
176
     getUrl (val) {
180
     getUrl (val) {
177
       var url = window.location.pathname
181
       var url = window.location.pathname
178
-      return url.replace('user.html', 'sales.html') + '' + val
182
+      return url.replace('user.html', 'sales.html') + '#/' + val
179
     },
183
     },
180
     showVanPicker () {
184
     showVanPicker () {
181
       this.showSelect = true
185
       this.showSelect = true

+ 7
- 0
src/pages/user/orderList/index.vue 查看文件

17
                 <orderListItem :data="item"></orderListItem>
17
                 <orderListItem :data="item"></orderListItem>
18
               </li>
18
               </li>
19
             </ul>
19
             </ul>
20
+            <span v-if="noData" style="width:100%;display:block;text-align:center;font-size:.11rem;color:#ccc;">暂无数据</span>
20
           </scroll>
21
           </scroll>
21
         </div>
22
         </div>
22
       </div>
23
       </div>
38
   name: '',
39
   name: '',
39
   data () {
40
   data () {
40
     return {
41
     return {
42
+      noData: false,
41
       pullUpLoad: true,
43
       pullUpLoad: true,
42
       pullUpLoadThreshold: 40,
44
       pullUpLoadThreshold: 40,
43
       startY: 0,
45
       startY: 0,
76
     this.getCustomerGoodsOrder({
78
     this.getCustomerGoodsOrder({
77
       page: this.page,
79
       page: this.page,
78
       pagesize: this.pagesize,
80
       pagesize: this.pagesize,
81
+    }).then((res) => {
82
+      // console.log(JSON.stringify(res))
83
+      if(res.list === null){
84
+        this.noData = true
85
+      }
79
     })
86
     })
80
   },
87
   },
81
   methods: {
88
   methods: {

+ 60
- 45
src/pages/user/placeOrder/index.vue 查看文件

89
   data () {
89
   data () {
90
     const _self = this
90
     const _self = this
91
     return {
91
     return {
92
+      postData: {
93
+        info: {
94
+          CaseId: decodeURI(_self.$route.query.caseid),
95
+          AreaId: decodeURI(_self.$route.query.areaid),
96
+          AreaName: decodeURI(_self.$route.query.areaname),
97
+          TableId: decodeURI(_self.$route.query.tableid),
98
+          TableNo: decodeURI(_self.$route.query.tableno),
99
+          Amount: 0, // 订单金额
100
+          OrdersNum: 0,
101
+          Remark: '',
102
+        },
103
+        detail: [],
104
+        coupon: [],
105
+      },
92
       tableNo: decodeURI(this.$route.query.tableno),
106
       tableNo: decodeURI(this.$route.query.tableno),
93
       tableId: decodeURI(this.$route.query.tableid),
107
       tableId: decodeURI(this.$route.query.tableid),
94
       areaId: decodeURI(this.$route.query.areaid),
108
       areaId: decodeURI(this.$route.query.areaid),
147
     sumPrice () {
161
     sumPrice () {
148
       let price = 0
162
       let price = 0
149
       this.selGoods.map(x => {
163
       this.selGoods.map(x => {
150
-        price += x.price*x.num - 0
164
+        price += x.price * x.num - 0
151
       })
165
       })
152
       return price
166
       return price
153
     }
167
     }
176
     ...caseTableActions([
190
     ...caseTableActions([
177
       'getGoodsTypeList',
191
       'getGoodsTypeList',
178
       'getGoodsList',
192
       'getGoodsList',
193
+      'toPay',
179
     ]),
194
     ]),
180
     toPlaceOrder () { // 下单 
195
     toPlaceOrder () { // 下单 
181
-      if(this.selGoods.length){
182
-        this.$router.push({name: 'placeOrderDetail', query: {info: JSON.stringify(this.selGoods), caseid: encodeURI(this.caseId), areaid: encodeURI(this.areaId), areaname: encodeURI(this.areaName), areaid: encodeURI(this.areaId), tableid: encodeURI(this.tableId), tableno: encodeURI(this.tableNo)}})
183
-      }else{
196
+      if (this.selGoods.length) {
197
+        if (this.userInfo.customer.MapUser === '') {
198
+          this.$router.push({ name: 'placeOrderDetail', query: { info: JSON.stringify(this.selGoods), caseid: encodeURI(this.caseId), areaid: encodeURI(this.areaId), areaname: encodeURI(this.areaName), areaid: encodeURI(this.areaId), tableid: encodeURI(this.tableId), tableno: encodeURI(this.tableNo) } })
199
+        } else {
200
+          this.showCalcMenu = true
201
+        } 
202
+      } else {
184
         this.$toast('您还没有选择商品哦~')
203
         this.$toast('您还没有选择商品哦~')
185
       }
204
       }
186
     },
205
     },
236
       })
255
       })
237
     },
256
     },
238
     placeOrder () { // 下单
257
     placeOrder () { // 下单
239
-      this.$router.push({ name: 'orderList', query: {} })
258
+      // this.$router.push({ name: 'orderList', query: {} })
259
+      this.postData.info.OrgId = this.orgId
260
+      this.postData.info.UserId = this.userInfo.CustomerId
261
+      this.postData.info.UserName = this.userInfo.customer.CustomerName
262
+      this.postData.info.PayType = 'sys user'
263
+      var orderInfo = this.selGoods
264
+      this.postData.detail = []
265
+      var amount = 0
266
+      var num = 0
267
+      for (var n = 0; n < orderInfo.length; n++) {
268
+        this.postData.detail.push({
269
+          GoodsId: orderInfo[n].id,
270
+          GoodsName: orderInfo[n].name,
271
+          SpecId: orderInfo[n].spec,
272
+          SpecName: orderInfo[n].specname,
273
+          Number: orderInfo[n].num - 0,
274
+          Price: String(orderInfo[n].price-0),
275
+        })
276
+        amount += (orderInfo[n].price-0) * orderInfo[n].num
277
+        num += orderInfo[n].num-0
278
+      }
279
+      this.postData.info.Amount = String(amount)
280
+      this.postData.info.OrdersNum = num
281
+      // console.log(JSON.stringify(this.postData))
282
+      this.toPay({
283
+        info: JSON.stringify(this.postData.info),
284
+        detail: JSON.stringify(this.postData.detail),
285
+        coupon: JSON.stringify(this.postData.coupon)
286
+      }).then((res) => {
287
+        this.$dialog.alert({
288
+          message: '下单成功!'
289
+        }).then(() => {
290
+          this.$router.push({name: 'orderList'})
291
+        })
292
+      })
240
     },
293
     },
241
     closeCalcMenu () { // 关闭已选菜单
294
     closeCalcMenu () { // 关闭已选菜单
242
       this.showCalcMenu = false
295
       this.showCalcMenu = false
249
       this.currentSpec = null
302
       this.currentSpec = null
250
     },
303
     },
251
     selectSpec (val) { // 选规格
304
     selectSpec (val) { // 选规格
252
-      console.log(val)
253
       this.currentSpec = val
305
       this.currentSpec = val
254
       this.showPopup = true
306
       this.showPopup = true
255
     },
307
     },
259
     calcMenus (val) { // 计算清单
311
     calcMenus (val) { // 计算清单
260
       var ishas = false
312
       var ishas = false
261
       const _that = this
313
       const _that = this
262
-      this.selGoods.map((goods,inx) => {
263
-        if(goods.id === val.id && goods.spec === (val.spec || '')){
314
+      this.selGoods.map((goods, inx) => {
315
+        if (goods.id === val.id && goods.spec === (val.spec || '')) {
264
           ishas = true
316
           ishas = true
265
           _that.selGoods[inx].num = val.defaultNum
317
           _that.selGoods[inx].num = val.defaultNum
266
         }
318
         }
275
           specname: (val.specname || ''),
327
           specname: (val.specname || ''),
276
         })
328
         })
277
       }
329
       }
278
-      console.log(this.selGoods)
279
-      // var settlementList = this.settlementList
280
-      // val.spec.map(spec => {
281
-      //   settlementList.filter
282
-      // })
283
-
284
-
285
-      // var bool = true, arr = this.settlementList.slice()
286
-      // if (val.specId === null) {
287
-      //   for (var n = 0; n < arr.length; n++) {
288
-      //     if (arr[n].id === val.id && arr[n].specId === null) {
289
-      //       bool = false
290
-      //       arr[n] = val
291
-      //     }
292
-      //   }
293
-      //   if (bool) {
294
-      //     arr.push(val)
295
-      //   }
296
-      // } else {
297
-      //   for (var n = 0; n < arr.length; n++) {
298
-      //     if (arr[n].specId === val.specId) {
299
-      //       bool = false
300
-      //       arr[n] = val
301
-      //     }
302
-      //   }
303
-      //   if (bool) {
304
-      //     arr.push(val)
305
-      //   }
306
-      // }
307
-      // for (var n = 0; n < arr.length; n++) {
308
-      //   if (arr[n].num === 0 || arr[n].defaultNum === 0) {
309
-      //     arr.splice(n, 1)
310
-      //   }
311
-      // }
312
-      // this.settlementList = arr
313
-      // console.log(JSON.stringify(this.settlementList))
314
-      // this.calcTotalNum()
315
     },
330
     },
316
     calcTotalNum () { // 计算总数量、价格
331
     calcTotalNum () { // 计算总数量、价格
317
       var num = 0, price = 0
332
       var num = 0, price = 0