|
@@ -33,6 +33,13 @@ function calculateGoodsPrice(r){
|
|
|
}
|
|
|
}
|
|
|
if(rMap.mysy){
|
|
|
+ // 买的条码, 买的数量,送的条码,送的数量
|
|
|
+ var mysy = {
|
|
|
+ buyNum:rMap.mysy.buyNum,
|
|
|
+ giftBarcode:rMap.mysy.giftBarcode,
|
|
|
+ sendNum:rMap.mysy.sendNum
|
|
|
+ };
|
|
|
+ vm.newMysy.set(rMap.mysy.barcode , mysy);
|
|
|
vm.mysy.push(rMap.mysy[barCode]);
|
|
|
}
|
|
|
|
|
@@ -145,10 +152,47 @@ function fullGift(goodsDetails,key){
|
|
|
|
|
|
// 买一送一
|
|
|
function calculateGoodsByMysy(goodsDetails){
|
|
|
+ console.log(vm.newMysy);
|
|
|
+ var mysy = vm.newMysy.get(goodsDetails.prodBarcode);
|
|
|
+ if(mysy){
|
|
|
+ var buyNum = mysy.buyNum;
|
|
|
+ // 证明是买一送一,并且达到买一送一的条件
|
|
|
+ if(buyNum == 1 && vm.boughtNum.get(goodsDetails.prodBarcode)){
|
|
|
+ // 设置赠品的单价
|
|
|
+ goodsDetails.discountedPrice = goodsDetails.retailPrice;
|
|
|
+ goodsDetails.actualPaymentAmount = 0;
|
|
|
+ goodsDetails.activity = "买1送1";
|
|
|
+
|
|
|
+ // 清除该商品买一送一条件
|
|
|
+ vm.boughtNum.delete(goodsDetails.proBarcode);
|
|
|
+ }
|
|
|
+ // 如果不是买一送一,而是买n送n,先获取购物车已有该类型商品数量
|
|
|
+ var boughtNum = vm.boughtNum.get(goodsDetails.prodBarcode);
|
|
|
+ // 如果没有,置为1
|
|
|
+ if(!boughtNum){
|
|
|
+ vm.boughtNum.set(goodsDetails.prodBarcode , 1);
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ // 走到这里,证明购买过该类型商品,且数量不是买一送一的
|
|
|
+ // 如果相等,证明达到送的条件
|
|
|
+ if(buyNum === boughtNum){
|
|
|
+ goodsDetails.discountedPrice = goodsDetails.retailPrice;
|
|
|
+ goodsDetails.actualPaymentAmount = 0;
|
|
|
+ goodsDetails.activity = "买"+buyNum+"送1";
|
|
|
+ // 清除该商品买一送一条件
|
|
|
+ vm.boughtNum.delete(goodsDetails.proBarcode);
|
|
|
+ }else{
|
|
|
+ // 如果不相等,已经购买数量+1
|
|
|
+ vm.boughtNum.set(goodsDetails.prodBarcode , boughtNum+1);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
// 判断当前商品是否为赠品
|
|
|
- isSend(vm.mysy,goodsDetails,"买一送一");
|
|
|
+ // isSend(vm.mysy,goodsDetails,"买一送一");
|
|
|
// 判断购物车里面是否有商品为赠品
|
|
|
- shopCartContain(vm.mysy,goodsDetails,"买一送一");
|
|
|
+ // shopCartContain(vm.mysy,goodsDetails,"买一送一");
|
|
|
|
|
|
}
|
|
|
|
|
@@ -332,6 +376,8 @@ let vm = new Vue({
|
|
|
},
|
|
|
// 买一送一
|
|
|
mysy: [],
|
|
|
+ newMysy: new Map(),
|
|
|
+ boughtNum: new Map(),
|
|
|
// 组合价
|
|
|
zhjsp: new Map(),
|
|
|
combinationPrice: new Map(), // 组合价商品的组合价
|
|
@@ -546,6 +592,8 @@ let vm = new Vue({
|
|
|
vm.actualPrice = 0;
|
|
|
// 买一送一
|
|
|
vm.mysy = [];
|
|
|
+ vm.newMysy = new Map();
|
|
|
+ vm.boughtNum = new Map();
|
|
|
// 组合价
|
|
|
vm.zhjsp = new Map();
|
|
|
vm.combinationPrice = new Map(); // 组合价商品的组合价
|
|
@@ -734,7 +782,7 @@ let vm = new Vue({
|
|
|
type: "POST",
|
|
|
url: "../order/orderRefund",
|
|
|
contentType: "application/json",
|
|
|
- data: JSON.stringify({'id':vm.currentOrderNo,'sessionId':vm.sessionId}),
|
|
|
+ data: JSON.stringify({'orderId':vm.currentOrderNo,'sessionId':vm.sessionId}),
|
|
|
success: function (r) {
|
|
|
if (r.code == 0) {
|
|
|
alert("退款成功")
|
|
@@ -1003,16 +1051,16 @@ function getPrintContentOrder(ticket) {
|
|
|
content += "<tr>";
|
|
|
content += "<td style=\"width: 40%;text-align: left;font-size: 10px;font-weight: bold;\">商品名称</td>";
|
|
|
content += "<td style=\"width: 17%;text-align: right;font-size: 10px;font-weight: bold;\">单价</td>";
|
|
|
- content += "<td style=\"width: 16%;text-align: right;font-size: 10px;font-weight: bold;\">税费</td>";
|
|
|
- content += "<td style=\"width: 10%;text-align: right;font-size: 10px;font-weight: bold;\">数量</td>";
|
|
|
- content += "<td style=\"width: 17%;text-align: right;font-size: 10px;font-weight: bold;\">小计</td>";
|
|
|
+ // content += "<td style=\"width: 16%;text-align: right;font-size: 10px;font-weight: bold;\">税费</td>";
|
|
|
+ content += "<td style=\"width: 15%;text-align: right;font-size: 10px;font-weight: bold;\">数量</td>";
|
|
|
+ content += "<td style=\"width: 18%;text-align: right;font-size: 10px;font-weight: bold;\">小计</td>";
|
|
|
content += "</tr>";
|
|
|
content += "</table>";
|
|
|
content += "<div style=\"width: 100%;overflow:hidden;white-space: nowrap;\">--------------------------------------------------</div>";
|
|
|
content += "<table style=\"width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
|
|
|
for (var i=0;i< ticket.goods.length;i++){
|
|
|
content += "<tr>";
|
|
|
- content += "<td style=\"width: 50%;text-align: left;font-size: 8px;padding-top: 8px;\">";
|
|
|
+ content += "<td style=\"width: 40%;text-align: left;font-size: 8px;padding-top: 8px;\">";
|
|
|
content += "<table style=\"width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
|
|
|
content += "<tr>";
|
|
|
content += "<td style=\"text-align: left;font-size: 8px;vertical-align:top;\">#</td>";
|
|
@@ -1021,9 +1069,9 @@ function getPrintContentOrder(ticket) {
|
|
|
content += "</table>";
|
|
|
content += "</td>";
|
|
|
content += "<td style=\"width: 17%;text-align: right;font-size: 8px;vertical-align:bottom;padding-top: 8px;\">" + ticket.goods[i].uprice + "</td>";
|
|
|
- content += "<td style=\"width: 17%;text-align: right;font-size: 8px;vertical-align:bottom;padding-top: 8px;\">" + ticket.goods[i].taxation + "</td>";
|
|
|
+ // content += "<td style=\"width: 17%;text-align: right;font-size: 8px;vertical-align:bottom;padding-top: 8px;\">" + ticket.goods[i].taxation + "</td>";
|
|
|
content += "<td style=\"width: 15%;text-align: right;font-size: 8px;vertical-align:bottom;padding-top: 8px;\">" + ticket.goods[i].num + "</td>";
|
|
|
- content += "<td style=\"width: 18%;text-align: right;font-size: 8px;vertical-align:bottom;padding-top: 8px;\">" + ticket.goods[i].subtotal + "元</td>";
|
|
|
+ content += "<td style=\"width: 18%;text-align: right;font-size: 8px;vertical-align:bottom;padding-top: 8px;\">" + ticket.goods[i].subtotal + "</td>";
|
|
|
content += "</tr>";
|
|
|
|
|
|
}
|
|
@@ -1058,7 +1106,8 @@ function getPrintContentOrder(ticket) {
|
|
|
content += "</div>";
|
|
|
content += "<div style=\"width: 100%;\">";
|
|
|
content += "<span style=\"float: left;width: 50%;text-align: left;\">支付渠道:</span>";
|
|
|
- content += "<span style=\"float: right;width: 50%;text-align: right;\">" + ticket.cashInfo.paymentMode + "</span>";
|
|
|
+ // 后期改成从系统中取
|
|
|
+ content += "<span style=\"float: right;width: 50%;text-align: right;\">" + "支付宝支付" + "</span>";
|
|
|
content += "</div>";
|
|
|
content += "<div style=\"width: 100%;overflow:hidden;white-space: nowrap;\">--------------------------------------------------</div>";
|
|
|
//海关清单信息
|
|
@@ -1078,20 +1127,20 @@ function getPrintContentOrder(ticket) {
|
|
|
content += "收货人电话:" + ticket.cusListing.consigneeTel;
|
|
|
content += "</div>";
|
|
|
content += "<div style=\"width: 100%;\">";
|
|
|
- content += "始发地:" + ticket.cusListing.deliveryAddress;
|
|
|
+ content += "始发地: 仓库地址 : 广东省深圳市南山区前海保税港区W104" ;
|
|
|
content += "</div>";
|
|
|
content += "<div style=\"width: 100%;\">";
|
|
|
content += "交货地:" + ticket.cusListing.deliveryAddress;
|
|
|
content += "</div>";
|
|
|
content += "<div style=\"width: 100%;overflow:hidden;white-space: nowrap;\">--------------------------------------------------</div>";
|
|
|
content += "<div style=\"width: 100%;\">";
|
|
|
- content += ticket.ticketFoot.summary;
|
|
|
+ // content += ticket.ticketFoot.summary;
|
|
|
content += "</div>";
|
|
|
content += "<div style=\"width: 100%;\">";
|
|
|
- content += "客服电话:" + ticket.ticketFoot.serviceTel;
|
|
|
+ // content += "客服电话:" + ticket.ticketFoot.serviceTel;
|
|
|
content += "</div>";
|
|
|
content += "<div style=\"width: 100%;\">";
|
|
|
- content += "网址:" + ticket.ticketFoot.url1;
|
|
|
+ // content += "网址:" + ticket.ticketFoot.url1;
|
|
|
content += "</div>";
|
|
|
content += "<div style=\"width: 100%;\">";
|
|
|
content += ticket.ticketFoot.welcome;
|