|
|
|
@ -195,7 +195,7 @@ |
|
|
|
<view class="content-list" v-if="radioType == '4'"> |
|
|
|
<view class="list-name" style="width:150rpx;padding-left:0;">选择车号</view> |
|
|
|
<view class="list-val"> |
|
|
|
<input type="text" placeholder="请选择" disabled |
|
|
|
<input type="text" placeholder="请选择" disabled :value="wlName.companyName" |
|
|
|
style="border-bottom: 1px solid #fff;text-align: center;" |
|
|
|
@tap.stop="goPopleList('fcName')"> |
|
|
|
<uni-icons type="right" size="16" |
|
|
|
@ -427,7 +427,8 @@ |
|
|
|
saleDetailList: [], |
|
|
|
yNum: 150, |
|
|
|
clearMsg:'', |
|
|
|
priceType:'' |
|
|
|
priceType:'', |
|
|
|
multiple:1 |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
@ -550,7 +551,7 @@ |
|
|
|
}) |
|
|
|
this.getAllPrice() |
|
|
|
this.getAmountAndWho() |
|
|
|
this.noPay = this.shouldPay |
|
|
|
// this.noPay = this.shouldPay |
|
|
|
}, |
|
|
|
filters: { |
|
|
|
sliceMsg(val) { |
|
|
|
@ -657,10 +658,7 @@ |
|
|
|
this.noPay = this.relPrice - e.target.value; |
|
|
|
}, |
|
|
|
getImg(key) { |
|
|
|
|
|
|
|
|
|
|
|
return this.carList.get(key).productPicture |
|
|
|
// value[1].productPicture |
|
|
|
}, |
|
|
|
//切换销售员 |
|
|
|
categoryChange(e) { |
|
|
|
@ -673,15 +671,13 @@ |
|
|
|
}, |
|
|
|
//扫一扫功能 |
|
|
|
scanCodeAdd() { |
|
|
|
// this.clearMsg = '1' |
|
|
|
uni.setStorageSync('saoma','1') |
|
|
|
uni.scanCode({ |
|
|
|
success: (res) => { |
|
|
|
|
|
|
|
this.toggle('bottom', res.result); |
|
|
|
}, |
|
|
|
fail: (res) => { |
|
|
|
// this.clearMsg = '1' |
|
|
|
fail: (res) => { |
|
|
|
uni.showToast({ |
|
|
|
title: '扫描失败', |
|
|
|
icon: 'none' |
|
|
|
@ -795,8 +791,7 @@ |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
temporaryChange(val) { |
|
|
|
console.log('扫一扫',this.temporaryList) |
|
|
|
temporaryChange(val) { |
|
|
|
this.zNum = 0 |
|
|
|
for (var i = 0; i < this.temporaryList.length; i++) { |
|
|
|
this.zNum += this.temporaryList[i].productCount |
|
|
|
@ -805,10 +800,6 @@ |
|
|
|
//折扣种类选择 |
|
|
|
discountChange(e) { |
|
|
|
let that = this; |
|
|
|
// if(this.carList.size == 0){ |
|
|
|
// this.tui.toast("请先选择商品") |
|
|
|
// return |
|
|
|
// } |
|
|
|
that.shouldPay = 0 |
|
|
|
this.discountType = e.detail.value; |
|
|
|
this.carList.forEach(function(value, key) { |
|
|
|
@ -819,7 +810,6 @@ |
|
|
|
}) |
|
|
|
this.price = this.shouldPay //永远不变的总金额/实际折扣后的总金额 |
|
|
|
this.discountNum = 10 |
|
|
|
// shouldPay |
|
|
|
for (let i = 0; i < this.items.length; i++) { |
|
|
|
if (this.items[i].value === e.detail.value) { |
|
|
|
this.discountCurrent = i; |
|
|
|
@ -1121,14 +1111,14 @@ |
|
|
|
onPrint(opt) { |
|
|
|
let that = this; |
|
|
|
that.yNum = 150 |
|
|
|
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); |
|
|
|
let strCmd = blesdk.CreatCPCLPage(600, 2080, 1, 0); |
|
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
|
blesdk.addCPCLSETBOLD('bold') |
|
|
|
strCmd += blesdk.addCPCLLocation(2); //对齐指令 0-左对齐 1-右对齐 2-居中 |
|
|
|
strCmd += blesdk.addCPCLLocation(2); |
|
|
|
strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, uni.getStorageSync('shopName')) |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 |
|
|
|
strCmd += blesdk.addCPCLLocation(0); |
|
|
|
strCmd += blesdk.addCPCLText('0', '100', '24', '0', 0, '客户:' + this.khName.name) |
|
|
|
strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '销售:' + this.createByName) |
|
|
|
strCmd += blesdk.addCPCLText('280', '130', '24', '0', 0, '日期:' + this.formatDate(new Date(), |
|
|
|
@ -1137,33 +1127,53 @@ |
|
|
|
'=========================================================') |
|
|
|
|
|
|
|
this.carList.forEach(function(value, key) { |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, value.productName + '(' + |
|
|
|
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, value.productName + '(' + |
|
|
|
value.productSn + ')' + '折扣:' + (value.discount < 10 ? value.discount : '无折扣')) |
|
|
|
value.stockLogList.forEach(function(value1, key1) { |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, (that.slicePrint( |
|
|
|
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, (that.slicePrint( |
|
|
|
key1)) + '*' + value1) |
|
|
|
strCmd += blesdk.addCPCLText('200', that.yNum, '24', '0', 0, '单价:' + value.lsprice) |
|
|
|
strCmd += blesdk.addCPCLText('360', that.yNum, '24', '0', 0, '总价:' + (value |
|
|
|
.lsprice * value1)) |
|
|
|
}) |
|
|
|
}) |
|
|
|
strCmd += blesdk.addCPCLText('0', this.yNum += 20, '24', '0', 0, |
|
|
|
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, |
|
|
|
'===============================================================') |
|
|
|
strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '总数量:' + this.totalAmount) |
|
|
|
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '总数量:' + this.totalAmount) |
|
|
|
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('0', this.yNum += 30, '24', '0', 0, '实收:' + this.priceOk) |
|
|
|
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '实收:' + this.priceOk) |
|
|
|
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + (this.relPrice - this.priceOk)) |
|
|
|
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 == '' ? '无' : this.remark)) |
|
|
|
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 |
|
|
|
if(this.remark.length >20){ |
|
|
|
let position = 20; |
|
|
|
let part1 = this.remark.substring(0, position); |
|
|
|
let part2 = this.remark.substring(position); |
|
|
|
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1) |
|
|
|
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) |
|
|
|
}else{ |
|
|
|
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.remark) |
|
|
|
} |
|
|
|
strCmd += blesdk.addCPCLLocation(0); |
|
|
|
strCmd += blesdk.addCPCLPrint(); |
|
|
|
|
|
|
|
this.bufferData = strCmd; |
|
|
|
console.log(strCmd); |
|
|
|
this.$nextTick(()=>{ |
|
|
|
uni.redirectTo({ |
|
|
|
url: "/pages/index/order" |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
//计算打印机当前行高度 |
|
|
|
countPrint(){ |
|
|
|
if((this.yNum + 30) >= (1040 * this.multiple)){ |
|
|
|
this.yNum = this.yNum + (1040 * this.multiple - this.yNum) + 50 |
|
|
|
this.multiple ++ |
|
|
|
return this.yNum |
|
|
|
}else{ |
|
|
|
return this.yNum += 30 |
|
|
|
} |
|
|
|
}, |
|
|
|
//截取 |
|
|
|
slicePrint(val) { |
|
|
|
@ -1214,8 +1224,7 @@ |
|
|
|
carlist.discount = 0; |
|
|
|
}else{ |
|
|
|
carlist.discount = e.detail.value; |
|
|
|
} |
|
|
|
console.log(carlist.discount) |
|
|
|
} |
|
|
|
|
|
|
|
carlist.discountAmount = carlist.unitPrice * carlist.discount / 10 |
|
|
|
carlist.price = carlist.unitPrice * carlist.discount / 10 * carlist.productCount |
|
|
|
@ -1248,7 +1257,6 @@ |
|
|
|
content: "确定删除此条商品吗?", |
|
|
|
success: function(res) { |
|
|
|
if (res.confirm) { |
|
|
|
console.log(that.carList.get(id)) |
|
|
|
that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name); |
|
|
|
that.carList.get(id).stockLogList.delete(name); |
|
|
|
that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(id).unitPrice |
|
|
|
|