|
|
@ -737,6 +737,9 @@ |
|
|
if (that.discountType == 1) { //整体折扣 |
|
|
if (that.discountType == 1) { //整体折扣 |
|
|
value.discountAmount = value.unitPrice * 10000 * that.discountNum / 10 / 10000 |
|
|
value.discountAmount = value.unitPrice * 10000 * that.discountNum / 10 / 10000 |
|
|
value.price = value.discountAmount * value.productCount |
|
|
value.price = value.discountAmount * value.productCount |
|
|
|
|
|
}else if(that.discountType == 0){//单品折扣 |
|
|
|
|
|
value.discountAmount = value.unitPrice * value.discount / 10 |
|
|
|
|
|
value.price = value.unitPrice * value.discount / 10 * value.productCount |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
this.getAllPrice(); |
|
|
this.getAllPrice(); |
|
|
@ -1125,6 +1128,7 @@ |
|
|
//打印小票 |
|
|
//打印小票 |
|
|
onPrint(opt) { |
|
|
onPrint(opt) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
|
|
|
that.yNum = 150 |
|
|
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); |
|
|
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); |
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
blesdk.addCPCLSETBOLD('bold') |
|
|
blesdk.addCPCLSETBOLD('bold') |
|
|
@ -1151,23 +1155,22 @@ |
|
|
.lsprice * value1)) |
|
|
.lsprice * value1)) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLText('0', this.yNum += 20, '24', '0', 0, |
|
|
strCmd += blesdk.addCPCLText('0', this.yNum += 20, '24', '0', 0, |
|
|
'===============================================================') |
|
|
'===============================================================') |
|
|
strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '总数量:' + this.totalAmount) |
|
|
strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '总数量:' + this.totalAmount) |
|
|
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额' + this.shouldPay) |
|
|
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额' + this.shouldPay) |
|
|
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice) |
|
|
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice) |
|
|
strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '实收:' + this.priceOk) |
|
|
strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '实收:' + this.priceOk) |
|
|
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + this.noPay) |
|
|
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + (this.relPrice - this.priceOk)) |
|
|
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + this.otherExpense) |
|
|
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + (this.otherExpense == '' ? 0 : this.otherExpense)) |
|
|
strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '备注:' + this.remark) |
|
|
strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '备注:' + (this.remark == '' ? '无' : this.remark)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 |
|
|
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 |
|
|
strCmd += blesdk.addCPCLPrint(); |
|
|
strCmd += blesdk.addCPCLPrint(); |
|
|
this.bufferData = strCmd; |
|
|
this.bufferData = strCmd; |
|
|
uni.redirectTo({ |
|
|
this.$nextTick(()=>{ |
|
|
url: "/pages/index/order" |
|
|
uni.redirectTo({ |
|
|
|
|
|
url: "/pages/index/order" |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
//截取 |
|
|
//截取 |
|
|
|