wangfukang 2 years ago
parent
commit
1a73f4bf69
  1. BIN
      package1/.DS_Store
  2. 11
      package1/AI/AiChat.vue
  3. 1135
      package1/AI/addAiList.vue
  4. 4614
      package1/AI/voiceInventory.vue
  5. 376
      package1/index/orderDetail.vue
  6. 2
      package1/index/peopleList.vue
  7. 141
      package1/inventory/addGoods.vue
  8. 13
      package1/inventory/batchPrint.vue
  9. 10
      package1/inventory/gategory.vue

BIN
package1/.DS_Store

Binary file not shown.

11
package1/AI/AiChat.vue

@ -154,9 +154,9 @@
'四': 4, '五': 5, '六': 6, '七': 7, '八': 8, '四': 4, '五': 5, '六': 6, '七': 7, '八': 8,
'九': 9,'杠':'-','刚':'-','军色':'均色','叉':'X','金色':'均色','井':'#', '九': 9,'杠':'-','刚':'-','军色':'均色','叉':'X','金色':'均色','井':'#',
'时间':'10件','事件':'10件','世间':'10件','实践':'10件','实件':'10件', '时间':'10件','事件':'10件','世间':'10件','实践':'10件','实件':'10件',
'景':'#','警':'#','颈':'#', '景':'#','警':'#','颈':'#','括号':'货号'
}; };
const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|金色|井|时间|事件|世间|实践|实件|景|警|颈)/g; const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|金色|井|时间|事件|世间|实践|实件|景|警|颈|括号)/g;
return str.replace(regex, match => chineseNumToArabic[match]); return str.replace(regex, match => chineseNumToArabic[match]);
}, },
inputSaveText(){ inputSaveText(){
@ -184,6 +184,9 @@
if(convertedStr.indexOf(',') == 0){ if(convertedStr.indexOf(',') == 0){
convertedStr = convertedStr.substr(1) convertedStr = convertedStr.substr(1)
} }
if (convertedStr.startsWith("号")) {
convertedStr = "货号" + convertedStr.substr(1);
}
let getMsg = convertedStr let getMsg = convertedStr
if(this.editText == ''){ if(this.editText == ''){
return; return;
@ -250,6 +253,10 @@
console.log('位置',convertedStr.indexOf(',')) console.log('位置',convertedStr.indexOf(','))
convertedStr = convertedStr.substr(1) convertedStr = convertedStr.substr(1)
} }
console.log(convertedStr.indexOf('号'))
if (convertedStr.indexOf('号') == 0) {
convertedStr = "货号" + convertedStr.substr(1);
}
let data = { let data = {
text:convertedStr text:convertedStr
} }

1135
package1/AI/addAiList.vue

File diff suppressed because it is too large

4614
package1/AI/voiceInventory.vue

File diff suppressed because it is too large

376
package1/index/orderDetail.vue

@ -426,7 +426,10 @@
if (res.code == 200 && res.result != null && res.result != undefined) { if (res.code == 200 && res.result != null && res.result != undefined) {
this.sales = res.result.sale this.sales = res.result.sale
this.list = res.result.saleDetailDTOList this.list = res.result.saleDetailDTOList
for (var i = 0; i < this.list.length; i++) { for (var i = 0; i < this.list.length; i++) {
if(this.list[i].realPrice != '' && this.list[i].discountAmount == null){
this.list[i].discountAmount = this.list[i].realPrice
}
for (var m = 0; m < this.list[i].stockLogList1.length; m++) { for (var m = 0; m < this.list[i].stockLogList1.length; m++) {
if (this.list[i].productCount == null) { if (this.list[i].productCount == null) {
this.list[i].productCount = this.list[i].stockLogList1[m].productCount this.list[i].productCount = this.list[i].stockLogList1[m].productCount
@ -549,301 +552,178 @@
}, },
//打印小票 //打印小票
onPrintSmall() { onPrintSmall() {
let that = this; let that = this;
let strCmd = '' let printHeight = 800
that.yNum = 150 for(let i=0;i<this.list.length;i++){
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); printHeight += 30
strCmd += blesdk.addCPCLSETMAG(2, 2) for(let m=0;m<this.list[i].stockLogList1.length;m++){
blesdk.addCPCLSETBOLD('bold') printHeight += 30
strCmd += blesdk.addCPCLLocation(2); }
strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, uni.getStorageSync('shopName')) }
let strCmd = ''
strCmd += blesdk.addCPCLSETMAG(1, 1) that.yNum = 300
strCmd += blesdk.addCPCLLocation(0); strCmd = blesdk.CreatCPCLPage(1000, printHeight, 1, 0);
strCmd += blesdk.addCPCLText('0', '100', '24', '0', 0, '客户:' + this.order.name) strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLText('280', '100', '24', '0', 0, this.sales.id) blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '销售:' + this.sales.createByName) strCmd += blesdk.addCPCLLocation(2);
strCmd += blesdk.addCPCLText('280', '130', '24', '0', 0, '日期:' + this.sales.createTime) strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, '')
strCmd += blesdk.addCPCLText('0', '150', '24', '0', 0, strCmd += blesdk.addCPCLSETMAG(2, 2)
'=========================================================') blesdk.addCPCLSETBOLD('bold')
for (var i = 0; i < this.list.length; i++) { strCmd += blesdk.addCPCLLocation(2);
if (that.countPrint() < that.printTotal) { strCmd += blesdk.addCPCLText('0', '110', '24', '0', 0, uni.getStorageSync('shopName'))
strCmd += blesdk.addCPCLText('0', that.yNum, '24', '0', 0, this.list[i].productName + '(' +
this.list[i].productSn + ')') strCmd += blesdk.addCPCLSETMAG(1, 1)
} else { strCmd += blesdk.addCPCLLocation(0);
that.yNum = 0 blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLText('0', '190', '24', '0', 0, '客户:' + this.order.name)
that.bufferData.push(strCmd); strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLText('500', '190', '24', '0', 0,'单号:' + this.sales.id)
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, this.list[i].productName + '(' + strCmd += blesdk.addCPCLText('0', '240', '24', '0', 0, '销售员:' + this.sales.createByName)
this.list[i].productSn + ')') strCmd += blesdk.addCPCLText('500', '240', '24', '0', 0, '日期:' + this.sales.createTime)
strCmd += blesdk.addCPCLText('0', '300', '24', '0', 0,
} '=================================================================================')
for (var m = 0; m < this.list[i].stockLogList1.length; m++) { for (var i = 0; i < this.list.length; i++) {
if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', that.yNum, '24', '0', 0, '□ '+(that.slicePrint(
this.list[i].stockLogList1[m].attributeList)) + '*' + this.list[i].stockLogList1[m]
.productCount)
strCmd += blesdk.addCPCLText('240', that.yNum, '24', '0', 0, '单价:' + this.list[i]
.discountAmount)
strCmd += blesdk.addCPCLText('400', that.yNum, '24', '0', 0, '总价:' + (this.list[i]
.discountAmount * this.list[i].stockLogList1[m].productCount))
} else {
that.yNum = 0
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '□ '+(that.slicePrint(
this.list[i].stockLogList1[m].attributeList)) + '*' + this.list[i].stockLogList1[m]
.productCount)
strCmd += blesdk.addCPCLText('240', that.yNum, '24', '0', 0, '单价:' + this.list[i]
.discountAmount)
strCmd += blesdk.addCPCLText('400', that.yNum, '24', '0', 0, '总价:' + (this.list[i]
.discountAmount * this.list[i].stockLogList1[m].productCount))
}
}
}
if (that.countPrint() < this.printTotal) {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0,
'===============================================================')
} else {
this.yNum = 0
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0,
'===============================================================')
}
if (that.countPrint() < this.printTotal) {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '总数量:' + this.sales.productCount)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额:' + this.sales.totalAmount)
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.sales.realAmount)
} else {
this.yNum = 0
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', (this.yNum += 30), '24', '0', 0, '总数量:' + this.sales.productCount)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额' + this.sales.totalAmount)
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.sales.realAmount)
}
if (that.countPrint() < this.printTotal) {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '实收:' + this.sales.alreadyEarn)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + (this.sales.noEarn))
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + (this.sales.otherExpense))
} else {
this.yNum = 0
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', (this.yNum += 30), '24', '0', 0, '实收:' + this.sales.alreadyEarn)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + (this.sales.noEarn))
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + (this.sales.otherExpense))
}
if (this.sales.remark) {
// if (Math.ceil(Number(this.sales.remark.length) / 20) * 30 + this.yNum < this.printTotal) {
// if (this.sales.remark.length > 20) {
// let position = 20;
// let part1 = this.sales.remark.substring(0, position);
// let part2 = this.sales.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.sales.remark)
// }
// strCmd += blesdk.addCPCLLocation(0);
// strCmd += blesdk.addCPCLPrint();
// this.bufferData.push(strCmd);
// } else {
// this.yNum = 0
// strCmd += blesdk.addCPCLLocation(0);
// strCmd += blesdk.addCPCLPrint();
// this.bufferData.push(strCmd);
// strCmd = ''
// if (this.sales.remark.length > 20) {
// let position = 20;
// let part1 = this.sales.remark.substring(0, position);
// let part2 = this.sales.remark.substring(position);
// strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
// strCmd += blesdk.addCPCLLocation(0);
// strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1)
// strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2)
// } else {
// strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
// strCmd += blesdk.addCPCLLocation(0);
// strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark)
// }
// strCmd += blesdk.addCPCLLocation(0);
// strCmd += blesdk.addCPCLPrint();
// this.bufferData.push(strCmd);
// }
if (Math.ceil(Number(this.sales.remark.length) / 20) * 30 + this.yNum < that.printTotal) {
if (this.sales.remark.length > 20) {
let position = 20;
let part1 = this.sales.remark.substring(0, position);
let part2 = this.sales.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.sales.remark)
}
} else { strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, this.list[i].productName + '(' +
this.yNum = 0 this.list[i].productSn + ')')
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint(); for (var m = 0; m < this.list[i].stockLogList1.length; m++) {
this.bufferData.push(strCmd);
strCmd = '' strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '□ '+that.slicePrint(
this.list[i].stockLogList1[m].attributeList))
strCmd += blesdk.addCPCLText('220', that.yNum, '24', '0', 0, '数量:'+ this.list[i].stockLogList1[m].productCount)
strCmd += blesdk.addCPCLText('400', that.yNum, '24', '0', 0, '单价:' + this.list[i]
.discountAmount)
strCmd += blesdk.addCPCLText('650', that.yNum, '24', '0', 0, '总价:' + (this.list[i]
.discountAmount * this.list[i].stockLogList1[m].productCount))
}
}
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0,
'=======================================================================================')
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '总数量:' + this.sales.productCount)
strCmd += blesdk.addCPCLText('300', this.yNum, '24', '0', 0, '总金额:' + this.sales.totalAmount)
strCmd += blesdk.addCPCLText('630', this.yNum, '24', '0', 0, '应收:' + this.sales.realAmount)
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '实收:' + this.sales.alreadyEarn)
strCmd += blesdk.addCPCLText('300', this.yNum, '24', '0', 0, '欠款:' + (this.sales.noEarn))
strCmd += blesdk.addCPCLText('630', this.yNum, '24', '0', 0, '其他费用:' + (this.sales.otherExpense))
if (this.sales.remark) {
if (this.sales.remark.length > 20) { if (this.sales.remark.length > 20) {
let position = 20; let position = 20;
let part1 = this.sales.remark.substring(0, position); let part1 = this.sales.remark.substring(0, position);
let part2 = this.sales.remark.substring(position); let part2 = this.sales.remark.substring(position);
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1) strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1)
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2)
} else { } else {
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark) strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark)
} }
}
} }
if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0,
'===============================================================')
} else {
this.yNum = 0
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0,
'===============================================================') '===============================================================================================')
}
//店铺地址 //店铺地址
if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '店铺地址:' + uni.getStorageSync( strCmd += blesdk.addCPCLSETMAG(1, 1)
'shopAddress'))
} else {
this.yNum = 0
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '店铺地址:' + uni.getStorageSync( strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '店铺地址:' + uni.getStorageSync(
'shopAddress')) 'shopAddress'))
}
//店铺电话 //店铺电话
if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + uni.getStorageSync( strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + uni.getStorageSync(
'username')) 'username'))
} else {
that.yNum = 0
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '店铺电话:' + uni.getStorageSync(
'username'))
}
if(this.qrArr.length != 0){ if(this.qrArr.length != 0){
//店铺微信/微信收款/支付宝收款/收款码收款(店铺,微信,支付,收款) //店铺微信/微信收款/支付宝收款/收款码收款(店铺,微信,支付,收款)
for (let i = 0; i < this.qrArr.length; i++) { for (let i = 0; i < this.qrArr.length; i++) {
//店铺二维码 //店铺二维码
if ((that.yNum + 200) < that.printTotal) { strCmd += blesdk.addCPCLQRCode(that.countWidth(i,1000/that.qrArr.length), (that.yNum + 80), that.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码
console.log('11111') strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLQRCode(that.countWidth(i,600/that.qrArr.length), (that.yNum + 50), that.qrArr[i].level, '2', 3, that.qrArr[i].path) //二维码 strCmd += blesdk.addCPCLText(that.countWidth(i,1000/that.qrArr.length), (that.yNum + 240), '24', '0', 0, that.qrArr[i].name)
strCmd += blesdk.addCPCLText(that.countWidth(i,600/that.qrArr.length), (that.yNum + 180), '24', '0', 0, that.qrArr[i].name)
strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLLocation(0);
if(this.qrArr.length == (i+1)){ if(this.qrArr.length == (i+1)){
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd); that.bufferData.push(strCmd);
} }
} else {
console.log('2222')
// that.yNum = 0
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLQRCode(that.countWidth(i,600/that.qrArr.length) , 30, that.qrArr[i].level, '2', 3, that.qrArr[i].path) //二维码
strCmd += blesdk.addCPCLText(that.countWidth(i,600/that.qrArr.length), 180, '24', '0', 0, that.qrArr[i].name)
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
}
} }
}else{ }else{
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd); that.bufferData.push(strCmd);
} }
this.$nextTick(() => { this.$nextTick(() => {
that.bufferData = [] that.bufferData = []
uni.hideLoading(); uni.hideLoading();
}) })
setTimeout(res=>{
uni.closeBLEConnection({
deviceId:uni.getStorageSync('deviceId'),
success(res) {
console.log(res)
},fail(err){
console.log(err)
}
})
},5000)
}, },
countWidth(num,len){ countWidth(num,len){
return num*len + 20 return num*len + 20
}, },
goPrint(type){ goPrint(type){
let strCmd = '' let strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 1); strCmd = blesdk.CreatCPCLPage(1000, 1040, 1, 1);
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('40', '30', '24', '0', 0, '沧州明珠商贸城--快衣店')
strCmd += blesdk.addCPCLSETMAG(3, 3) strCmd += blesdk.addCPCLSETMAG(3, 3)
blesdk.addCPCLSETBOLD('bold') blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('50', '120', '24', '0', 0, '收:' + maskShopName(this.sales.userName)) strCmd += blesdk.addCPCLLocation(2);
strCmd += blesdk.addCPCLSETMAG(1, 1) strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, '沧州明珠商贸城--快衣店')
strCmd += blesdk.addCPCLText('50', '250', '24', '0', 0, maskPhone(this.order.phone)) strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLText('250', '250', '24', '0', 0, '编号:' + this.sales.id) strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLSETMAG(1, 1)
blesdk.addCPCLSETBOLD('bold') blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('50', '330', '24', '0', 0, this.sales.province + '/' + this.sales.city + '/' + strCmd += blesdk.addCPCLText('50', '150', '24', '0', 0, '收货人:' + maskShopName(this.sales.userName))
strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('50', '230', '24', '0', 0, '电话:' + maskPhone(this.order.phone))
strCmd += blesdk.addCPCLText('50', '310', '24', '0', 0, '编号:' + this.sales.id)
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('50', '390', '24', '0', 0, this.sales.province + '/' + this.sales.city + '/' +
this.sales.area) this.sales.area)
strCmd += blesdk.addCPCLSETMAG(1, 1) strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLLocation(0);
if(type == 'confirm'){ if(type == 'confirm'){
strCmd += blesdk.addCPCLText('50', '410', '24', '0', 0, "*****") strCmd += blesdk.addCPCLText('50', '470', '24', '0', 0, "*****")
}else{ }else{
if (this.sales.receiveAddress.length > 20) { if (this.sales.receiveAddress.length > 20) {
let position = 20; let position = 20;
let part1 = this.sales.receiveAddress.substring(0, position); let part1 = this.sales.receiveAddress.substring(0, position);
let part2 = this.sales.receiveAddress.substring(position); let part2 = this.sales.receiveAddress.substring(position);
strCmd += blesdk.addCPCLText('50', '410', '24', '0', 0, part1) strCmd += blesdk.addCPCLText('50', '470', '24', '0', 0, part1)
strCmd += blesdk.addCPCLText('50', '440', '24', '0', 0, part2) strCmd += blesdk.addCPCLText('50', '550', '24', '0', 0, part2)
} else { } else {
strCmd += blesdk.addCPCLText('50', '410', '24', '0', 0, this.sales.receiveAddress) strCmd += blesdk.addCPCLText('50', '410', '24', '0', 0, this.sales.receiveAddress)
} }
} }
strCmd += blesdk.addCPCLSETMAG(2, 2) strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLLocation(0);
blesdk.addCPCLSETBOLD('bold') blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('0', '490', '24', '0', 0, '——————————————————————————————') strCmd += blesdk.addCPCLText('0', '600', '24', '0', 0, '——————————————————————————————')
strCmd += blesdk.addCPCLText('50', '570', '24', '0', 0, '发货方式:' + (this.sales.companyName ? this.sales strCmd += blesdk.addCPCLText('50', '680', '24', '0', 0, '发货方式:' + (this.sales.companyName ? this.sales
.companyName : '暂无')) .companyName : '暂无'))
strCmd += blesdk.addCPCLSETMAG(2, 2) strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLText('0', '650', '24', '0', 0, '——————————————————————————————') strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('50', '730', '24', '0', 0, '店铺:' + this.sales.shopName) strCmd += blesdk.addCPCLText('0', '760', '24', '0', 0, '——————————————————————————————')
strCmd += blesdk.addCPCLText('50', '810', '24', '0', 0, this.sales.createByPhone) strCmd += blesdk.addCPCLText('50', '840', '24', '0', 0, '店铺:' + this.sales.shopName)
strCmd += blesdk.addCPCLText('50', '890', '24', '0', 0, '地址:' + this.shopData.shopAddress) strCmd += blesdk.addCPCLText('50', '920', '24', '0', 0, this.sales.createByPhone)
strCmd += blesdk.addCPCLText('50', '1000', '24', '0', 0, '地址:' + this.shopData.shopAddress)
strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd); this.bufferData.push(strCmd);
@ -852,6 +732,16 @@
this.bufferData = [] this.bufferData = []
uni.hideLoading(); uni.hideLoading();
}) })
setTimeout(res=>{
uni.closeBLEConnection({
deviceId:uni.getStorageSync('deviceId'),
success(res) {
console.log(res)
},fail(err){
console.log(err)
}
})
},5000)
}, },
xierushuju() { xierushuju() {
let that = this; let that = this;
@ -933,11 +823,11 @@
}, },
//计算打印机当前行高度 //计算打印机当前行高度
countPrint() { countPrint() {
if ((this.yNum + 50) >= 1040) { // if ((this.yNum + 50) >= 1040) {
return this.yNum += 50 // return this.yNum += 50
} else { // } else {
return this.yNum += 30 return this.yNum += 30
} // }
}, },
//截取 //截取
slicePrint(val) { slicePrint(val) {

2
package1/index/peopleList.vue

@ -23,7 +23,7 @@
<text>{{item.consigneeMobile}}</text> <text>{{item.consigneeMobile}}</text>
</view> </view>
<view class="name-tel" style="width: 100%;" v-else> <view class="name-tel" style="width: 100%;" v-else>
<text style="line-height: 75rpx;">{{item.name}}</text> <text style="line-height: 75rpx;">{{item.name}}<text v-if="item.notBuyDays!=null">({{item.notBuyDays+'天未拿货'}})</text> </text>
<text v-if="item.name != '散客'">{{item.phone}}</text> <text v-if="item.name != '散客'">{{item.phone}}</text>
</view> </view>
<view class="name-tel" style="width: 100%;display: flex;flex-direction: column;height:auto;font-size: 30rpx;"> <view class="name-tel" style="width: 100%;display: flex;flex-direction: column;height:auto;font-size: 30rpx;">

141
package1/inventory/addGoods.vue

@ -6,7 +6,7 @@
<uni-forms-item label="商品名称" name="productName" required> <uni-forms-item label="商品名称" name="productName" required>
<uni-easyinput type="text" v-model="formData.productName" placeholder="请输入商品名称" trim="all" /> <uni-easyinput type="text" v-model="formData.productName" placeholder="请输入商品名称" trim="all" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="商品图片" name="productPicture"> <uni-forms-item label="商品主图" name="productPicture">
<view v-if="formData.productPicture !=''"> <view v-if="formData.productPicture !=''">
<img :src="formData.productPicture" alt="" class="upload-img"> <img :src="formData.productPicture" alt="" class="upload-img">
</view> </view>
@ -34,23 +34,40 @@
</view> </view>
</view> </view>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="添加规格" name="categoryId" v-if="dataList == ''"> <uni-forms-item label="添加规格" name="categoryId">
<!-- <uni-data-select class="uni-data-select" :localdata="categoryList" v-model="formData.categoryId"
placeholder="请选择分类" @change="categoryChange(formData.categoryId)"></uni-data-select> -->
<view class="content-list"> <view class="content-list">
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="点击选择规格" disabled <input type="text" placeholder="点击选择规格" disabled
style="border-bottom: 1px solid #fff;text-align: center;" style="border-bottom: 1px solid #fff;text-align: center;"
@tap="ejectRuleSelect"> @tap="ejectRuleSelect">
<!-- <uni-icons type="right" size="16"
style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons> -->
</view> </view>
</view> </view>
</uni-forms-item> </uni-forms-item>
<view v-for="(item,index) in multipleList" :key="index" style="display: flex;">
<view class="" style="width: 28%;">
{{item.attributeName}}
</view>
<view class="" style="width: 72%;min-height: 80rpx;padding: 0 10px 20rpx 0;">
<view v-for="(item1,index1) in item.productAttributeValueVoList" :key="index1" style="float: left;padding-right: 20rpx;">
{{item1.value}}
</view>
</view>
</view>
<uni-forms-item label="商品条码" name="barcode"> <uni-forms-item label="商品条码" name="barcode">
<uni-easyinput type="text" v-model="formData.barcode" placeholder="可以扫码商品条码添加" trim="all" /> <uni-easyinput type="text" v-model="formData.barcode" placeholder="可以扫码商品条码添加" trim="all" />
<u-icon name="camera" size="36" @tap.stop='scanCodeAdd'></u-icon> <u-icon name="camera" size="36" @tap.stop='scanCodeAdd'></u-icon>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="多图上传" name="productPicture">
<view class="upload-img" @tap="pictureAdd" style="background: #eee;text-align: center;line-height: 160rpx;">
<uni-icons type="camera" size="28" color="#777"></uni-icons>
</view>
<view style="overflow-x: scroll;display: flex;width: 350rpx;">
<view v-if="formData.productPictures !=''" v-for="(item,index) in formData.productPictures" :key="index" style="width: 160rpx;height: 160rpx;margin-left: 20rpx;">
<img :src="item.productPicture" alt="" class="upload-img">
</view>
</view>
</uni-forms-item>
<uni-forms-item label="市场价" name="price"> <uni-forms-item label="市场价" name="price">
<!-- <uni-easyinput type="digit" v-model="formData.price" placeholder="请输入零售价" trim="all" /> --> <!-- <uni-easyinput type="digit" v-model="formData.price" placeholder="请输入零售价" trim="all" /> -->
<input type="digit" class="content-input" v-model="formData.price" @focus="obtainPrice($event,'price')" @blur="changessPrice($event,'price')" placeholder="请输入零售价"> <input type="digit" class="content-input" v-model="formData.price" @focus="obtainPrice($event,'price')" @blur="changessPrice($event,'price')" placeholder="请输入零售价">
@ -66,19 +83,16 @@
<uni-easyinput type="textarea" autoHeight v-model="formData.productIntro" placeholder="请输入货品简介" <uni-easyinput type="textarea" autoHeight v-model="formData.productIntro" placeholder="请输入货品简介"
trim="all" /> trim="all" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<view v-if="type == 'edit'" style="display: flex;"> <view>
<button @tap.stop="submit()" style="width: 95%;">保存</button>
</view>
<view v-else>
<button @tap.stop="submit()">保存</button> <button @tap.stop="submit()">保存</button>
</view> </view>
</view> </view>
<!-- 添加分类弹出层 --> <!-- 添加分类弹出层 -->
<uni-popup ref="addTypeDialog" background-color="#fff"> <uni-popup ref="addTypeDialog" background-color="#fff" @change="changeAddType">
<view class="add-popup-content"> <view class="add-popup-content">
<view class="add-popup-title"> <view class="add-popup-title">
<text>添加规格</text> <text>颜色尺码库</text>
<uni-icons @tap='close' type="closeempty" color='red' size="16" <uni-icons @tap='close' type="closeempty" color='red' size="16"
style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons> style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons>
</view> </view>
@ -115,7 +129,8 @@
export default { export default {
data() { data() {
return { return {
fileList1: [], fileList1: [],
oldMultipleList:[],
formData: { formData: {
productName: '', productName: '',
price: 0, price: 0,
@ -126,7 +141,12 @@
categoryId: '', categoryId: '',
salesWeek: '', salesWeek: '',
tailWarn: '', tailWarn: '',
barcode:'' barcode:'',
productPictures:[],
// let data = {
// productPicture:pathData.result
// }
productCategoryVo:{}
}, },
defaultList:[{ defaultList:[{
name:'颜色', name:'颜色',
@ -321,6 +341,7 @@
if(option.dataList){ if(option.dataList){
this.type = 'edit' this.type = 'edit'
this.dataList = JSON.parse(option.dataList) this.dataList = JSON.parse(option.dataList)
this.formData.attrId = this.dataList.attrId
this.formData.productName = this.dataList.productName this.formData.productName = this.dataList.productName
this.formData.barcode = this.dataList.barcode this.formData.barcode = this.dataList.barcode
this.formData.price = this.dataList.price this.formData.price = this.dataList.price
@ -331,10 +352,28 @@
this.formData.categoryId = this.dataList.categoryId this.formData.categoryId = this.dataList.categoryId
this.formData.salesWeek = this.dataList.salesWeek this.formData.salesWeek = this.dataList.salesWeek
this.formData.tailWarn = this.dataList.tailWarn this.formData.tailWarn = this.dataList.tailWarn
this.getChildrenPic()
} }
this.getGategoryList() this.getGategoryList()
}, },
methods: { methods: {
//获取子图
getChildrenPic(){
this.tui.request("/app/productPicture/getProductPictureByProductId", "POST", {
productId: this.dataList.id,
}, false, true).then((res) => {
if (res.code == 200) {
for(let i=0;i<res.result.length;i++){
let data = {
productPicture:res.result[i].productPicture
}
this.formData.productPictures.push(data)
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//初始化获取分类列表 //初始化获取分类列表
getGategoryList() { getGategoryList() {
this.tui.request("/app/productCategory/list", "get", { this.tui.request("/app/productCategory/list", "get", {
@ -390,6 +429,11 @@
this.formData.wholesalePrice = '' this.formData.wholesalePrice = ''
} }
}, },
changeAddType(e){
if(e.show ==false && this.multipleList == ''){
this.multipleList = this.oldMultipleList
}
},
dialogInputConfirm(e) { dialogInputConfirm(e) {
let that = this; let that = this;
if(that.multipleList == ''){ if(that.multipleList == ''){
@ -480,10 +524,9 @@
}, },
uploadFilePromise(url) { uploadFilePromise(url) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let a = uni.uploadFile({ let a = uni.uploadFile({
url: 'https://dev.xenjoyou.com/hiver/upload/file', url: 'https://storage.xenjoyou.com/hiver/upload/file',
filePath: url, filePath: url,
name: 'file', name: 'file',
header: { header: {
@ -518,6 +561,8 @@
}) })
}, },
ejectRuleSelect(){ ejectRuleSelect(){
this.oldMultipleList = this.multipleList
this.multipleList = []
this.$refs.addTypeDialog.open('bottom') this.$refs.addTypeDialog.open('bottom')
}, },
// 触发提交表单 // 触发提交表单
@ -534,6 +579,9 @@
} }
if(res.productPicture == ''){ if(res.productPicture == ''){
res.productPicture = '' res.productPicture = ''
}
this.formData.productCategoryVo = {
productAttributeOfAddVos:this.multipleList
} }
that.tui.request(url, "post", this.formData, false, false).then((res1) => { that.tui.request(url, "post", this.formData, false, false).then((res1) => {
if (res1.code == 200) { if (res1.code == 200) {
@ -557,6 +605,56 @@
url: '/package1/inventory/gategory' url: '/package1/inventory/gategory'
}) })
}, },
pictureAdd(id,huan) {
let that = this
uni.chooseMedia({
count: 9,
mediaType: ['image'],
sourceType: ['album'],
success(res) {
uni.showLoading({
title: '加载中...',
mask:true
})
for(let i=0;i<res.tempFiles.length;i++){
that.upLoadFile(res.tempFiles[i].tempFilePath)
}
}
})
},
async upLoadFile(path){
let that = this;
let hiver_token = uni.getStorageSync("hiver_token")
await uni.uploadFile({
url: 'https://storage.xenjoyou.com/hiver/upload/file',
filePath: path,
name: 'file',
header: {
"content-type": "multipart/form-data",
'accessToken': hiver_token
},
formData: {},
success: (uploadFileRes) => {
let pathData = JSON.parse(uploadFileRes.data)
let data = {
productPicture:pathData.result
}
this.formData.productPictures.push(data)
that.$forceUpdate()
},
fail: (err) => {
uni.hideLoading();
uni.showToast({
title: JSON.stringify(err),
icon: 'none'
})
}
});
await setTimeout(res=>{
uni.hideLoading();
},1000)
},
scanCodeAdd() { scanCodeAdd() {
let that = this; let that = this;
uni.scanCode({ uni.scanCode({
@ -584,6 +682,7 @@
}, },
//选择多个规格保存 //选择多个规格保存
addMultipleType(item,item1,index){ addMultipleType(item,item1,index){
// this.multipleList = []
item.list[index].checked = !item.list[index].checked item.list[index].checked = !item.list[index].checked
var list = [] var list = []
if(this.multipleList == ''){ if(this.multipleList == ''){
@ -596,19 +695,13 @@
}else{ }else{
for(var i=0;i<this.multipleList.length;i++){ for(var i=0;i<this.multipleList.length;i++){
if(this.multipleList[i].attributeName == item.name){ //同种分类 if(this.multipleList[i].attributeName == item.name){ //同种分类
for(var m=0;m<this.multipleList[i].productAttributeValueVoList.length;m++){ for(var m=0;m<this.multipleList[i].productAttributeValueVoList.length;m++){
if(this.multipleList[i].productAttributeValueVoList[m].value == item.list[index].value){ //规格相同 if(this.multipleList[i].productAttributeValueVoList[m].value == item.list[index].value){ //规格相同
this.multipleList[i].productAttributeValueVoList.splice(m,1) this.multipleList[i].productAttributeValueVoList.splice(m,1)
return; return;
}else{ //规格不同 }else{ //规格不同
if(m+1 == this.multipleList[i].productAttributeValueVoList.length){ if(m+1 == this.multipleList[i].productAttributeValueVoList.length){
this.multipleList[i].productAttributeValueVoList.push(item.list[index]) this.multipleList[i].productAttributeValueVoList.push(item.list[index])
return; return;
} }
} }
@ -629,8 +722,6 @@
} }
} }
} }
}, },
} }
} }

13
package1/inventory/batchPrint.vue

@ -141,6 +141,19 @@
}, },
components: { components: {
kkPrinter kkPrinter
},
onHide(){
setTimeout(res=>{
uni.closeBLEConnection({
deviceId:uni.getStorageSync('deviceId'),
success(res) {
console.log(res)
},fail(err){
console.log(err)
}
})
},5000)
}, },
onLoad(options) { onLoad(options) {
wx.openBluetoothAdapter({mode: 'central'}) wx.openBluetoothAdapter({mode: 'central'})

10
package1/inventory/gategory.vue

@ -27,17 +27,17 @@
<uni-popup ref="delDialog" type="dialog"> <uni-popup ref="delDialog" type="dialog">
<view class="type-popup" style="width:100%;margin-bottom: 0;border-radius: 0;height: 450rpx;border-radius: 10px;"> <view class="type-popup" style="width:100%;margin-bottom: 0;border-radius: 0;height: 450rpx;border-radius: 10px;">
<view style="height: 120rpx;font-size: 36rpx;font-weight: bold;line-height: 120rpx;text-align: center;"> <view style="height: 120rpx;font-size: 36rpx;font-weight: bold;line-height: 120rpx;text-align: center;">
修改规格值 编辑分类
</view> </view>
<view style="height: 80rpx;font-size: 28rpx;line-height: 80rpx;text-align: center;"> <view style="height: 80rpx;font-size: 28rpx;line-height: 80rpx;text-align: center;">
请在下方输入框中输入新规格 请在下方输入框中输入分类名
</view> </view>
<view style="width: 90%;margin: 20px auto 0;"> <view style="width: 90%;margin: 20px auto 0;">
<uni-easyinput type="text" v-model="inputVal" @blur="handleBlur" placeholder="请输入规格值" /> <uni-easyinput type="text" v-model="inputVal" @blur="handleBlur" placeholder="请输入规格值" />
</view> </view>
<view style="width: 100%;height: 90rpx;line-height: 90rpx;text-align: center;border-radius: 0;background: linear-gradient(90deg, #60F3FF, #088FEB);color: #fff;display: flex;position: absolute;bottom: 0;"> <view style="width: 100%;height: 90rpx;line-height: 90rpx;text-align: center;border-radius: 0;color: #fff;display: flex;position: absolute;bottom: 0;">
<view style="width:50%;" @tap="dialogDel">删除</view> <view style="flex: 1;" v-if="inputVal != '默认分类'" @tap="dialogDel">删除</view>
<view style="width:50%;background: linear-gradient(90deg, #FF9797, #FFC1E0);" @tap="dialogInputConfirm">确认</view> <view style="flex: 1;background: linear-gradient(90deg, #FF9797, #FFC1E0);" @tap="dialogInputConfirm">确认</view>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>

Loading…
Cancel
Save