wangfei пре 6 година
родитељ
комит
ac42a947c3
1 измењених фајлова са 40 додато и 40 уклоњено
  1. 40
    40
      src/pages/user/placeOrder/index.vue

+ 40
- 40
src/pages/user/placeOrder/index.vue Прегледај датотеку

@@ -215,49 +215,49 @@ export default {
215 215
     ]),
216 216
     toPlaceOrder () { // 下单 
217 217
       if (this.selGoods.length) {
218
-        if (this.userInfo.customer.MapUser === '' || (this.userInfo.customer.MapUser !== '' && sessionStorage.getItem('from') !== 'sales')) {
219
-          if (this.ajaxOff) {
220
-            this.ajaxOff = false
221
-            this.postData.info.OrgId = this.orgId
222
-            this.postData.info.UserId = this.userInfo.CustomerId
223
-            this.postData.info.UserName = this.userInfo.customer.CustomerName
224
-            this.postData.info.PayType = 'sys user'
225
-            this.postData.info.Remark = ''
226
-            this.postData.from = sessionStorage.getItem('from') ? sessionStorage.getItem('from') : ''
227
-            var orderInfo = this.selGoods
228
-            this.postData.detail = []
229
-            var amount = 0
230
-            var num = 0
231
-            for (var n = 0; n < orderInfo.length; n++) {
232
-              this.postData.detail.push({
233
-                GoodsId: orderInfo[n].id,
234
-                GoodsName: orderInfo[n].name,
235
-                SpecId: orderInfo[n].spec,
236
-                SpecName: orderInfo[n].specname,
237
-                Number: orderInfo[n].num - 0,
238
-                Price: String(orderInfo[n].price - 0),
239
-              })
240
-              amount += (orderInfo[n].price - 0) * orderInfo[n].num
241
-              num += orderInfo[n].num - 0
242
-            }
243
-            this.postData.info.Amount = String(amount)
244
-            this.postData.info.OrdersNum = num
245
-            // console.log(JSON.stringify(this.postData))
246
-            this.toPayBefore({
247
-              info: JSON.stringify(this.postData.info),
248
-              detail: JSON.stringify(this.postData.detail),
249
-              customercouponid: '',
250
-              from: this.postData.from
251
-            }).then((res) => {
218
+        if (this.ajaxOff) {
219
+          this.ajaxOff = false
220
+          this.postData.info.OrgId = this.orgId
221
+          this.postData.info.UserId = this.userInfo.CustomerId
222
+          this.postData.info.UserName = this.userInfo.customer.CustomerName
223
+          this.postData.info.PayType = 'sys user'
224
+          this.postData.info.Remark = ''
225
+          this.postData.from = sessionStorage.getItem('from') ? sessionStorage.getItem('from') : ''
226
+          var orderInfo = this.selGoods
227
+          this.postData.detail = []
228
+          var amount = 0
229
+          var num = 0
230
+          for (var n = 0; n < orderInfo.length; n++) {
231
+            this.postData.detail.push({
232
+              GoodsId: orderInfo[n].id,
233
+              GoodsName: orderInfo[n].name,
234
+              SpecId: orderInfo[n].spec,
235
+              SpecName: orderInfo[n].specname,
236
+              Number: orderInfo[n].num - 0,
237
+              Price: String(orderInfo[n].price - 0),
238
+            })
239
+            amount += (orderInfo[n].price - 0) * orderInfo[n].num
240
+            num += orderInfo[n].num - 0
241
+          }
242
+          this.postData.info.Amount = String(amount)
243
+          this.postData.info.OrdersNum = num
244
+          // console.log(JSON.stringify(this.postData))
245
+          this.toPayBefore({
246
+            info: JSON.stringify(this.postData.info),
247
+            detail: JSON.stringify(this.postData.detail),
248
+            customercouponid: '',
249
+            from: this.postData.from
250
+          }).then((res) => {
251
+            if (this.userInfo.customer.MapUser === '' || (this.userInfo.customer.MapUser !== '' && sessionStorage.getItem('from') !== 'sales')) {
252 252
               // console.log(JSON.stringify(res))
253 253
               this.ajaxOff = true
254 254
               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), ordersid: res.OrdersId } })
255
-            }).catch(() => {
256
-              this.ajaxOff = true
257
-            })
258
-          }
259
-        } else {
260
-          this.showCalcMenu = true
255
+            } else {
256
+              this.showCalcMenu = true
257
+            }
258
+          }).catch(() => {
259
+            this.ajaxOff = true
260
+          })
261 261
         }
262 262
       } else {
263 263
         this.$toast('您还没有选择商品哦~')