Quellcode durchsuchen

无码商品保存

cr vor 4 Jahren
Ursprung
Commit
cc930526c4
1 geänderte Dateien mit 25 neuen und 9 gelöschten Zeilen
  1. 25 9
      src/pages/manage/cashier/settlement.vue

+ 25 - 9
src/pages/manage/cashier/settlement.vue

@@ -427,15 +427,31 @@ export default {
427 427
                 orderItems: [],
428 428
             };
429 429
             for (let item of this.goods) {
430
-                sendData.orderItems.push({
431
-                    productId: item.id,
432
-                    // skuId:item.id,
433
-                    skuId: item._sku ? item._sku.skuId : "",
434
-                    count: item.isWeightGood
435
-                        ? parseInt(item.select_num * 1000)
436
-                        : item.select_num,
437
-                    remark: "",
438
-                });
430
+                if (item._type === "-1") {
431
+                    // 无码商品
432
+                    sendData.orderItems.push({
433
+                        count: item.isWeightGood
434
+                            ? parseInt(item.select_num * 1000)
435
+                            : item.select_num,
436
+                        price: item.price,
437
+                        weighingGoods: item.isWeightGood ? true : false,
438
+                        weight: item.isWeightGood
439
+                            ? parseInt(item.select_num * 1000)
440
+                            : item.select_num,
441
+                    });
442
+                } else {
443
+                    sendData.orderItems.push({
444
+                        productId: item.id,
445
+                        skuId: item._sku ? item._sku.skuId : "",
446
+                        count: item.isWeightGood
447
+                            ? parseInt(item.select_num * 1000)
448
+                            : item.select_num,
449
+                        weighingGoods: item.isWeightGood ? true : false,
450
+                        weight: item.isWeightGood
451
+                            ? parseInt(item.select_num * 1000)
452
+                            : item.select_num,
453
+                    });
454
+                }
439 455
             }
440 456
             console.log(sendData);
441 457
             this.submitLoading = true;