wangfukang 2 years ago
parent
commit
8f7725c18e
  1. 2
      package1/AI/AIHangOrderList.vue
  2. 143
      package1/AI/addAiList.vue
  3. 11
      package1/AI/voiceInventory.vue
  4. 284
      package1/index/orderDetail.vue
  5. 71
      package1/other/custom.vue
  6. 16
      package1/stock/addStockList.vue
  7. 27
      package1/stock/stockDetail.vue

2
package1/AI/AIHangOrderList.vue

@ -513,7 +513,7 @@
that.hangId = item.id that.hangId = item.id
if(res.scanType == "QR_CODE"){ //二维码 if(res.scanType == "QR_CODE"){ //二维码
let shopId = base.decode(res.result.split(',')[1]) let shopId = base.decode(res.result.split(',')[1])
if(shopId == uni.getStorageSync('shopId')){ if(shopId == uni.getStorageSync('shopId').substring('10','12')){
that.productId = base.decode(res.result.split(',')[0]) that.productId = base.decode(res.result.split(',')[0])
that.toggle('bottom', base.decode(res.result.split(',')[0])); that.toggle('bottom', base.decode(res.result.split(',')[0]));
if (item.saleDetailDTOList) { if (item.saleDetailDTOList) {

143
package1/AI/addAiList.vue

@ -1,24 +1,31 @@
<!-- 管理员登录页 --> <!-- 管理员登录页 -->
<template> <template>
<view class="page1" style="overflow: scroll;"> <view class="page1" style="overflow: scroll;">
<view @tap="addList" style="width: 90%;height:80rpx;margin:20rpx auto;background: #088FEB;color: #fff;border-radius: 20rpx;text-align: center;line-height: 80rpx;font-size: 32rpx;"> <view @tap="addList"
style="width: 90%;height:80rpx;margin:20rpx auto;background: #088FEB;color: #fff;border-radius: 20rpx;text-align: center;line-height: 80rpx;font-size: 32rpx;">
新增 新增
</view> </view>
<button @tap="getQRCode">生成</button> <button @tap="getQRCode">生成</button>
<uqrcode ref="uqrcode" canvas-id="qrcode" hide="true" start="false" auto="true" queue="true" :value="QrUrl"></uqrcode> <uqrcode ref="uqrcode" canvas-id="qrcode" hide="true" start="false" auto="true" queue="true" :value="QrUrl">
</uqrcode>
<img v-for="(item,index) in newQRList" :src="item" alt="" /> <img v-for="(item,index) in newQRList" :src="item" alt="" />
<view> <!-- --> <view> <!-- -->
<view v-for="(item,index) in QrList1" :key="index" style="background: #fff;height: 100rpx;display: flex;line-height: 100rpx;"> <view v-for="(item,index) in QrList1" :key="index"
<input type="text" :value="item.name" @blur="addItemName($event,index)" placeholder="输入名称" style="width: 30%;display: block;height: 100rpx;text-align: center;font-size: 32rpx;" /> style="background: #fff;height: 100rpx;display: flex;line-height: 100rpx;">
<input type="text" disabled @tap="scanCodeAdd(index)" :value="item.path" placeholder="点击扫描二维码" style="width: 58%;display: block;height: 80rpx;border: 1px solid #eee;padding-left: 20rpx;margin-top: 10rpx;" /> <input type="text" :value="item.name" @blur="addItemName($event,index)" placeholder="输入名称"
style="width: 30%;display: block;height: 100rpx;text-align: center;font-size: 32rpx;" />
<input type="text" disabled @tap="scanCodeAdd(index)" :value="item.path" placeholder="点击扫描二维码"
style="width: 58%;display: block;height: 80rpx;border: 1px solid #eee;padding-left: 20rpx;margin-top: 10rpx;" />
<view @tap="delItem(index)" style="width:12%;margin-left: 20rpx;"> <view @tap="delItem(index)" style="width:12%;margin-left: 20rpx;">
<uni-icons color="red" type="minus" size="26"></uni-icons> <uni-icons color="red" type="minus" size="26"></uni-icons>
</view> </view>
</view> </view>
</view> </view>
<view style="width: 90%;height:80rpx;position: fixed;bottom: 40rpx;left:5%;background: #088FEB;color: #fff;border-radius: 20rpx;text-align: center;line-height: 80rpx;font-size: 32rpx;"> <view
style="width: 90%;height:80rpx;position: fixed;bottom: 40rpx;left:5%;background: #088FEB;color: #fff;border-radius: 20rpx;text-align: center;line-height: 80rpx;font-size: 32rpx;">
提交 提交
</view> </view>
<canvas canvas-id="aaaa" style="width: 200px;height: 200px;"></canvas>
</view> </view>
</template> </template>
@ -27,26 +34,98 @@
data() { data() {
return { return {
//旧的二维码路径 //旧的二维码路径
QRList:[ QRList: [
'wxp://f2f0egWTC-6-dnZPjtxrXAnLQemXglhjQB92wtNu01tRoeE', 'wxp://f2f0egWTC-6-dnZPjtxrXAnLQemXglhjQB92wtNu01tRoeE',
'https://u.wechat.com/MINRIYDQnbErEZEUAAhuOL0', 'https://u.wechat.com/MINRIYDQnbErEZEUAAhuOL0',
'https://u.wechat.com/ELXU0g00OAM8huehO8nDQMQ', 'https://u.wechat.com/ELXU0g00OAM8huehO8nDQMQ',
'https://qr.alipay.com/fkx11051559cgeldh61dyf6' 'https://qr.alipay.com/fkx11051559cgeldh61dyf6'
], ],
QrUrl:'', //二维码临时存放 QrUrl: 'https://qr.95516.com/01020001/wcqr?f=ICBCqr&X=1&T=3&P=13&I=e03d925776684b4d&N=b4cbb142eeafe2bddce7a7878c57f5ca&L=3f7aafc9dbc03de742513fbb73a3380023c77748dbca0813d7a49f63159d542ed2f1e45fac242c519fb6c9a3a51a8caaa3b79f53b538a276', //二维码临时存放
newQRList:[], // 生成的二维码临时路径的数组 newQRList: [], // 生成的二维码临时路径的数组
QrList1:[] // 点击新增按钮,新增一条数据 QrList1: [], // 点击新增按钮,新增一条数据
aaa: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/67fd6f17a7634400afac9b6694ed9234.png'
} }
}, },
onShow() { onShow() {
}, },
onLoad(option) { onLoad(option) {
let that = this
let ctx = uni.createCanvasContext('aaaa', this)
uni.getImageInfo({
src: this.aaa,
success: (res) => {
// 绘制图片
ctx.drawImage(res.path, 0, 0, 200, 200);
ctx.draw(true);
},
fail: (err) => {
console.log(err)
}
});
setTimeout(res => {
// 返回canvas的位图数据
uni.canvasGetImageData({
canvasId: 'aaaa',
x: 0,
y: 0,
width: 100,
height: 100,
success(res) {
console.log('宽高:' + res.width + ' * ' + res.height) // 100
let data = {
width:res.width,
height:res.height,
imageData:res.data,
threshold:180
}
console.log(that.overwriteImageData(data))
}
})
}, 2000)
}, },
methods: { methods: {
addList(){ grayPixle(pix) {
if(this.QrList1.length>=4){ return pix[0] * 0.299 + pix[1] * 0.587 + pix[2] * 0.114;
},
overwriteImageData(data) {
let sendWidth = data.width,
sendHeight = data.height;
const threshold = data.threshold || 180;
let sendImageData = new ArrayBuffer((sendWidth * sendHeight) / 8);
sendImageData = new Uint8Array(sendImageData);
let pix = data.imageData;
const part = [];
let index = 0;
for (let i = 0; i < pix.length; i += 32) {
//横向每8个像素点组成一个字节(8位二进制数)。
for (let k = 0; k < 8; k++) {
const grayPixle1 = this.grayPixle(pix.slice(i + k * 4, i + k * 4 + (4 - 1)));
//阈值调整
if (grayPixle1 > threshold) {
//灰度值大于threshold位 白色 为第k位0不打印
part[k] = 0;
} else {
part[k] = 1;
}
}
let temp = 0;
for (let a = 0; a < part.length; a++) {
temp += part[a] * Math.pow(2, part.length - 1 - a);
}
sendImageData[index++] = temp;
}
return {
array: Array.from(sendImageData),
width: sendWidth / 8,
height: sendHeight,
};
console.log(sendImageData)
},
addList() {
if (this.QrList1.length >= 4) {
uni.showToast({ uni.showToast({
title: '最多只能添加4个二维码', title: '最多只能添加4个二维码',
icon: 'none' icon: 'none'
@ -54,25 +133,25 @@
return return
} }
let data = { let data = {
name:'', name: '',
path:'' path: ''
} }
this.QrList1.push(data) this.QrList1.push(data)
}, },
getQRCode(){ getQRCode() {
for(let i=0;i<=this.QRList.length;i++){ // for (let i = 0; i <= this.QRList.length; i++) {
setTimeout(res=>{ // setTimeout(res => {
this.QrUrl = this.QRList[i] // this.QrUrl = this.QRList[i]
this.$refs.uqrcode.toTempFilePath({ this.$refs.uqrcode.toTempFilePath({
success: res => { success: res => {
this.newQRList.push(res.tempFilePath) this.newQRList.push(res.tempFilePath)
} }
}); });
},1000*(i+1)) // }, 1000 * (i + 1))
} // }
}, },
addItemName(e,index){ addItemName(e, index) {
this.QrList1[index].name = e.detail.value this.QrList1[index].name = e.detail.value
console.log(this.QrList1) console.log(this.QrList1)
}, },
@ -80,10 +159,10 @@
let that = this; let that = this;
uni.scanCode({ uni.scanCode({
success: (res) => { success: (res) => {
if(res.result != ''){ if (res.result != '') {
console.log(res.result) console.log(res.result)
this.QrList1[index].path = res.result this.QrList1[index].path = res.result
}else{ } else {
uni.showToast({ uni.showToast({
title: '扫描失败', title: '扫描失败',
icon: 'none' icon: 'none'
@ -98,7 +177,7 @@
} }
}) })
}, },
delItem(index){ delItem(index) {
let that = this; let that = this;
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
@ -109,7 +188,7 @@
} }
} }
}) })
} }
} }
} }

11
package1/AI/voiceInventory.vue

@ -6145,7 +6145,7 @@
if (res.scanType == "QR_CODE") { //二维码 if (res.scanType == "QR_CODE") { //二维码
let shopId = base.decode(res.result.split(',')[1]) let shopId = base.decode(res.result.split(',')[1])
if (shopId == uni.getStorageSync('shopId')) { if (shopId == uni.getStorageSync('shopId').substring('10','12')) {
that.productId = base.decode(res.result.split(',')[0]) that.productId = base.decode(res.result.split(',')[0])
that.toggle('bottom', base.decode(res.result.split(',')[0])); that.toggle('bottom', base.decode(res.result.split(',')[0]));
// if (item.saleDetailDTOList) { // if (item.saleDetailDTOList) {
@ -6350,8 +6350,7 @@
await this.$nextTick(() => { await this.$nextTick(() => {
// if (that.discountType != 0) { //单品折扣 // if (that.discountType != 0) { //单品折扣
that.carList.get(index).price1 = Number(that.carList.get(index).productCount) * that that.carList.get(index).price1 = Number(that.carList.get(index).productCount) * that
.carList .carList.get(index).purchasePrice
.get(index).purchasePrice
// } // }
}) })
this.$forceUpdate() this.$forceUpdate()
@ -8048,7 +8047,11 @@
let purchaseDetails = []; let purchaseDetails = [];
await this.carList.forEach(function(value, key) { await this.carList.forEach(function(value, key) {
value.customerCategoryRule = JSON.stringify(value.customerCategoryList) value.customerCategoryRule = JSON.stringify(value.customerCategoryList)
if (that.userType == 1) { let shopId = uni.getStorageSync('shopId')
// 提钱和沐港,员工入库采购价为零
if (that.userType == 1 && (shopId == '1853332569559535619' || shopId == '1810179818189361152')) {
value.purchasePrice = 0
}else if(that.userType == 1){
value.purchasePrice = '' value.purchasePrice = ''
} }
if (value.productSn == '') { if (value.productSn == '') {

284
package1/index/orderDetail.vue

@ -17,7 +17,7 @@
style="font-size: 22rpx;position: absolute;top: 50rpx;right: 70rpx;background: blue;color: #fff;border-radius: 7px;"> style="font-size: 22rpx;position: absolute;top: 50rpx;right: 70rpx;background: blue;color: #fff;border-radius: 7px;">
分享 分享
</button> </button>
<button v-if="false" @tap="getData()" <button v-if="shopId == '1848242501496999936' || shopId == '1843114735801864192' || shopId == '1818888277105709056' || shopId == '1811579958284390400'" @tap="getData()"
style="font-size: 22rpx;position: absolute;top: 50rpx;right: 200rpx;background: blue;color: #fff;border-radius: 7px;"> style="font-size: 22rpx;position: absolute;top: 50rpx;right: 200rpx;background: blue;color: #fff;border-radius: 7px;">
分享图片 分享图片
</button> </button>
@ -573,15 +573,10 @@
</view> </view>
</uni-popup> </uni-popup>
<view style="width: 93%;margin: 0 auto;display: flex;"> <view style="width: 93%;margin: 0 auto;display: flex;">
<view style="width: 160rpx;height: 260rpx;display: flex;flex-direction: column;"> <uqrcode v-if="qrArr.length > 0" :hide='true' ref="uqrcode" size="160" sizeUnit="rpx" canvas-id="qrcode" :value="QrUrl">
<uqrcode v-if="qrArr.length > 0" ref="uqrcode" size="160" sizeUnit="rpx" canvas-id="qrcode" :value="QrUrl">
</uqrcode> </uqrcode>
<view style="text-align: center;font-size: 24rpx;margin-top:10rpx;" v-if="qrArr.length > 0">
{{qrArr[qrArr.length-1].name}}
</view>
</view>
<view v-for="(item,index) in newQRList" v-if="newQRList.length > 0"> <view v-for="(item,index) in newQRList" :key="index" v-if="newQRList.length > 0">
<image show-menu-by-longpress :src="item.path" alt="" style="margin: 0 0 0 16rpx;width: 160rpx;height: 160rpx;" /></image> <image show-menu-by-longpress :src="item.path" alt="" style="margin: 0 0 0 16rpx;width: 160rpx;height: 160rpx;" /></image>
<view style="text-align: center;font-size: 24rpx;">{{qrArr[index].name}}</view> <view style="text-align: center;font-size: 24rpx;">{{qrArr[index].name}}</view>
</view> </view>
@ -698,7 +693,7 @@
addressArr: [], addressArr: [],
jinjuPhone: '', //金桔家单独改成这个电话 jinjuPhone: '', //金桔家单独改成这个电话
modal_qr: false, modal_qr: false,
qrCodeUrl: 'https://u.wechat.com/EOzom56XQ_1MKeVPPqgwMlI', // 要生成的二维码值 qrCodeUrl: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/8e305338798c4152a89e3351eaf6c84e.png', // 要生成的二维码值
} }
}, },
components: { components: {
@ -759,7 +754,6 @@
// success () { }, // success () { },
// fail () {} // fail () {}
// }) // })
console.log(this.sales)
let titleText = this.shopName +' '+ this.sales.createTime.split(' ')[0]+'\n销售单' let titleText = this.shopName +' '+ this.sales.createTime.split(' ')[0]+'\n销售单'
const imageUrl = await this.senrPath() const imageUrl = await this.senrPath()
return { return {
@ -1099,16 +1093,7 @@
}) })
}, },
returnRealSize(size){ returnRealSize(size){
return Number((size / this.smailDcl).toFixed(2)) return Number((size / this.smailDcl).toFixed(0))
},
returnRealFontSize(size){
if(Number((size - this.fontsmailDcl).toFixed(2)) < 0){
return (18 - (this.smailSize * 1.2).toFixed(2)).toFixed(2)
}else if(Number((size - this.fontsmailDcl).toFixed(2)) < 12){
return 12
}else{
return Number((size - this.fontsmailDcl).toFixed(2))
}
}, },
getData() { getData() {
let that = this let that = this
@ -1129,7 +1114,7 @@
//店铺名 //店铺名
// 设置字体样式 // 设置字体样式
ctx.font = 'bold '+ that.returnRealFontSize(120) +'px SimSun'; ctx.font = 'bold '+ that.returnRealSize(150) +'px SimSun';
// 设置文字颜色 // 设置文字颜色
ctx.fillStyle = 'black'; ctx.fillStyle = 'black';
var text = this.shopName+' 销售单'; var text = this.shopName+' 销售单';
@ -1142,10 +1127,10 @@
// 设置字体样式 // 设置字体样式
ctx.font = 'bold '+ that.returnRealFontSize(60) +'px SimSun'; ctx.font = 'bold '+ that.returnRealSize(60) +'px SimSun';
// 设置文字颜色 // 设置文字颜色
ctx.fillStyle = 'black'; ctx.fillStyle = 'black';
// 客户 // 客户
ctx.fillText('客户:' + (that.order.name ? that.order.name : '散客'), that.returnRealSize(20), that.returnRealSize(500)) ctx.fillText('客户:' + (that.order.name ? that.order.name : '散客'), that.returnRealSize(20), that.returnRealSize(500))
ctx.fillText('单号:' + that.sales.id, that.returnRealSize(1450), that.returnRealSize(500)) ctx.fillText('单号:' + that.sales.id, that.returnRealSize(1450), that.returnRealSize(500))
@ -1155,8 +1140,7 @@
// 横线 // 横线
ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), that.returnRealSize(700)) ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), that.returnRealSize(700))
// 数据 // 数据
let printingMethod = '0' if (this.printingMethod == '0') {
if (printingMethod == '0') {
ctx.fillText('货号(名称)', that.returnRealSize(20), that.returnRealSize(800)) ctx.fillText('货号(名称)', that.returnRealSize(20), that.returnRealSize(800))
ctx.fillText('规格', that.returnRealSize(1040), that.returnRealSize(800)) ctx.fillText('规格', that.returnRealSize(1040), that.returnRealSize(800))
ctx.fillText('数量', that.returnRealSize(1590), that.returnRealSize(800)) ctx.fillText('数量', that.returnRealSize(1590), that.returnRealSize(800))
@ -1170,7 +1154,7 @@
let moretime = 0 let moretime = 0
let Xindex = 0 let Xindex = 0
for (var i = 0; i < that.newData.length; i++){ for (var i = 0; i < that.newData.length; i++){
if (printingMethod == '1') { if (this.printingMethod == '1') {
moretime+=140 moretime+=140
dataheigth += that.returnRealSize(100) dataheigth += that.returnRealSize(100)
//货号 //货号
@ -1273,7 +1257,7 @@
} }
} }
let lastHeight = 0 let lastHeight = 0
if (printingMethod == '1') { if (this.printingMethod == '1') {
lastHeight = dataheigth lastHeight = dataheigth
}else{ }else{
lastHeight = dataheigth1 lastHeight = dataheigth1
@ -1285,7 +1269,7 @@
ctx.draw(true) ctx.draw(true)
// 设置字体样式 // 设置字体样式
ctx.font = 'bold '+that.returnRealFontSize(70)+'px SimSun'; ctx.font = 'bold '+that.returnRealSize(70)+'px SimSun';
// 设置文字颜色 // 设置文字颜色
ctx.fillStyle = 'black'; ctx.fillStyle = 'black';
ctx.fillText('本单应收:' + that.sales.realAmount + '(' + this.convertToChineseNumeral(that.sales.realAmount) + ')', that.returnRealSize(20) , lastHeight+=that.returnRealSize(100)) ctx.fillText('本单应收:' + that.sales.realAmount + '(' + this.convertToChineseNumeral(that.sales.realAmount) + ')', that.returnRealSize(20) , lastHeight+=that.returnRealSize(100))
@ -1310,7 +1294,7 @@
ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), lastHeight+=that.returnRealSize(100)) ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), lastHeight+=that.returnRealSize(100))
ctx.draw(true) ctx.draw(true)
// 设置字体样式 // 设置字体样式
ctx.font = 'bold '+that.returnRealFontSize(60)+'px SimSun'; ctx.font = 'bold '+that.returnRealSize(60)+'px SimSun';
// 设置文字颜色 // 设置文字颜色
ctx.fillStyle = 'black'; ctx.fillStyle = 'black';
@ -1348,23 +1332,41 @@
ctx.draw(true) ctx.draw(true)
let begineidth = that.returnRealSize(20) let begineidth = that.returnRealSize(20)
let wenheight = lastHeight + that.returnRealSize(150) let wenheight = lastHeight + that.returnRealSize(150)
lastHeight+=that.returnRealSize(150) lastHeight+=that.returnRealSize(200)
let qrarr = [] let qrarr = []
let data = { if(that.shopId == '1848242501496999936' || that.shopId == '1811579958284390400'){
name : '店铺微信', let data = {
path : 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/8e305338798c4152a89e3351eaf6c84e.png', name : '店铺微信',
path : 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/8e305338798c4152a89e3351eaf6c84e.png',
}
qrarr.push(data)
}else{
let data = {
name : '店铺微信',
path : 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/4280d25c885847ca9fc0cccbc936ad1a.png',
}
qrarr.push(data)
} }
qrarr.push(data) if(that.shopId == '1848242501496999936' || that.shopId == '1811579958284390400'){
let data1 = { let data1 = {
name : '微信收款码', name : '微信收款码',
path : 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/3456337911cd4c759e4237da6aefaa01.png', path : 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/3456337911cd4c759e4237da6aefaa01.png',
}
qrarr.push(data1)
} }
qrarr.push(data1) if(that.shopId == '1848242501496999936' || that.shopId == '1811579958284390400'){
let data2 = { let data2 = {
name : '银行收款码', name : '银行收款码',
path : 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/d3f594face1e432fb9b4a0e4fd8ed685.png', path : 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/d3f594face1e432fb9b4a0e4fd8ed685.png',
}
qrarr.push(data2)
}else{
let data2 = {
name : '银行收款码',
path : 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/f34a7c8e2ba44f5dbc8d199d12b1d841.png',
}
qrarr.push(data2)
} }
qrarr.push(data2)
for(let a = 0;a < qrarr.length; a++){ for(let a = 0;a < qrarr.length; a++){
setTimeout(ress=>{ setTimeout(ress=>{
uni.downloadFile({ uni.downloadFile({
@ -1372,7 +1374,7 @@
success: (res2) => { success: (res2) => {
if (res2.statusCode === 200) { if (res2.statusCode === 200) {
ctx.fillText(qrarr[a].name, begineidth , wenheight) ctx.fillText(qrarr[a].name, begineidth , wenheight)
ctx.drawImage(res2.tempFilePath, begineidth,lastHeight , that.returnRealSize(500), that.returnRealSize(500)); ctx.drawImage(res2.tempFilePath, begineidth,lastHeight , that.returnRealSize(400), that.returnRealSize(400));
ctx.draw(true) ctx.draw(true)
begineidth += that.returnRealSize(640) begineidth += that.returnRealSize(640)
} }
@ -1444,7 +1446,6 @@
}, },
largeImg(img) { largeImg(img) {
console.log('largeImg',img)
if (img.productPicture == null && img.productPictures == null) { if (img.productPicture == null && img.productPictures == null) {
this.tui.toast("暂无可展示的图片", 1000) this.tui.toast("暂无可展示的图片", 1000)
return return
@ -1635,7 +1636,7 @@
if (that.qrArr.length > 0) { if (that.qrArr.length > 0) {
this.printHeight += 360 this.printHeight += 360
this.printHeight1 += 800 this.printHeight1 += 1000
} }
if (that.shopRemark.length > 0) { if (that.shopRemark.length > 0) {
this.printHeight += that.shopRemark.length * 40 this.printHeight += that.shopRemark.length * 40
@ -1645,15 +1646,16 @@
this.printHeight += 100 this.printHeight += 100
this.printHeight1 += 100 this.printHeight1 += 100
} }
if(this.printHeight1 > 11600){ let smailBegin = 4000
this.smailSize = ((this.printHeight1 - 11600) / 505).toFixed(2) if(that.deviceType == 'ios'){
smailBegin = 2500
} }
this.smailDcl = (this.printHeight1 / 2500).toFixed(2) this.smailDcl = Number(Number(this.printHeight1 / smailBegin).toFixed(2))
this.fontsmailDcl = ((this.printHeight1 - 2500) / 100).toFixed(2) this.printHeight1 = smailBegin
this.printHeight1 = 2500
this.myCanvasHeight = this.printHeight1+'px' this.myCanvasHeight = this.printHeight1+'px'
if(this.smailDcl >= 1){
this.printWidth1 = (this.printWidth1 / this.smailDcl).toFixed(2) this.printWidth1 = Number(Number(this.printWidth1 / this.smailDcl).toFixed(0))
}
this.myCanvasWidth = this.printWidth1+'px' this.myCanvasWidth = this.printWidth1+'px'
setTimeout(res => { setTimeout(res => {
that.picOk = true that.picOk = true
@ -1669,16 +1671,21 @@
name:that.qrArr[i].name, name:that.qrArr[i].name,
path:"" path:""
} }
this.$refs.uqrcode.toTempFilePath({ setTimeout(res1 => {
success: res => { this.$refs.uqrcode.toTempFilePath({
data.path = res.tempFilePath success: res => {
that.newQRList1.push(data) console.log('res.tempFilePath',res.tempFilePath)
that.newQRList.push(data) data.path = res.tempFilePath
}, that.newQRList1.push(data)
fail: err => { that.newQRList.push(data)
console.log('err', err);
} },
}); fail: err => {
console.log('err', err);
}
});
}, 500 * i)
}, 1000 * i) }, 1000 * i)
} }
}, },
@ -1701,7 +1708,6 @@
let strCmd = '' let strCmd = ''
let pageNum = 1 let pageNum = 1
let Xindex = 0 let Xindex = 0
console.log('newQRList',that.newQRList)
if (this.printingMethod == '0') { if (this.printingMethod == '0') {
that.yNum = 405 that.yNum = 405
} else { } else {
@ -2545,7 +2551,7 @@
} }
} }
} else if (this.shopId == '1810179818189361152' || this.shopId == '1843114735801864192') { } else if (this.shopId == '1810179818189361152' || this.shopId == '1843114735801864192' || this.shopId == '1818888277105709056') {
//华秀 //华秀
if (that.yNum + 64 >= 1990 * pageNum) { if (that.yNum + 64 >= 1990 * pageNum) {
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
@ -2574,32 +2580,64 @@
that.yNum = 0 that.yNum = 0
pageNum++ pageNum++
strCmd += blesdk.addCPCLSETMAG(1, 2) strCmd += blesdk.addCPCLSETMAG(1, 2)
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单应收:' + that.sales.realAmount + if(this.shopId == '1810179818189361152'){
'(' + this.convertToChineseNumeral(that.sales.realAmount) + ')') strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单应收:' + that.sales.realAmount +
'(' + this.convertToChineseNumeral(that.sales.realAmount) + ')')
if (that.dealingsRecord.lastDebtAmount >= 0) {
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '之前欠款:' + that.dealingsRecord if (that.dealingsRecord.lastDebtAmount >= 0) {
.lastDebtAmount) strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '之前欠款:' + that.dealingsRecord
} else if (that.dealingsRecord.lastDebtAmount < 0) { .lastDebtAmount)
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '之前余额:' + Math.abs(that } else if (that.dealingsRecord.lastDebtAmount < 0) {
.dealingsRecord strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '之前余额:' + Math.abs(that
.lastDebtAmount)) .dealingsRecord
} else { .lastDebtAmount))
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '之前欠款:0') } else {
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '之前欠款:0')
}
}else{
if (that.dealingsRecord.lastDebtAmount >= 0) {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '之前欠款:' + that.dealingsRecord
.lastDebtAmount)
} else if (that.dealingsRecord.lastDebtAmount < 0) {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '之前余额:' + Math.abs(that
.dealingsRecord
.lastDebtAmount))
} else {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '之前欠款:0')
}
strCmd += blesdk.addCPCLText('248', that.yNum, '24', '0', 0, '本单应收:' + that.sales.realAmount +
'(' + this.convertToChineseNumeral(that.sales.realAmount) + ')')
} }
} else { } else {
strCmd += blesdk.addCPCLSETMAG(1, 2) strCmd += blesdk.addCPCLSETMAG(1, 2)
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单应收:' + that.sales.realAmount + if(this.shopId == '1810179818189361152'){
'(' + this.convertToChineseNumeral(that.sales.realAmount) + ')') strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单应收:' + that.sales.realAmount +
if (that.dealingsRecord.lastDebtAmount >= 0) { '(' + this.convertToChineseNumeral(that.sales.realAmount) + ')')
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '之前欠款:' + that.dealingsRecord if (that.dealingsRecord.lastDebtAmount >= 0) {
.lastDebtAmount) strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '之前欠款:' + that.dealingsRecord
} else if (that.dealingsRecord.lastDebtAmount < 0) { .lastDebtAmount)
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '之前余额:' + Math.abs(that } else if (that.dealingsRecord.lastDebtAmount < 0) {
.dealingsRecord strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '之前余额:' + Math.abs(that
.lastDebtAmount)) .dealingsRecord
} else { .lastDebtAmount))
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '之前欠款:0') } else {
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '之前欠款:0')
}
}else{
if (that.dealingsRecord.lastDebtAmount >= 0) {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '之前欠款:' + that.dealingsRecord
.lastDebtAmount)
} else if (that.dealingsRecord.lastDebtAmount < 0) {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '之前余额:' + Math.abs(that
.dealingsRecord
.lastDebtAmount))
} else {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '之前欠款:0')
}
strCmd += blesdk.addCPCLText('248', that.yNum, '24', '0', 0, '本单应收:' + that.sales.realAmount +
'(' + this.convertToChineseNumeral(that.sales.realAmount) + ')')
} }
} }
if (that.yNum + 60 >= 1990) { if (that.yNum + 60 >= 1990) {
@ -2612,31 +2650,58 @@
pageNum++ pageNum++
strCmd += blesdk.addCPCLSETMAG(1, 2) strCmd += blesdk.addCPCLSETMAG(1, 2)
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales if(this.shopId == '1810179818189361152'){
.alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn) + ')') strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales
.alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn) + ')')
if (that.dealingsRecord.balanceDue >= 0) {
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord if (that.dealingsRecord.balanceDue >= 0) {
.balanceDue) strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord
} else if (that.dealingsRecord.balanceDue < 0) { .balanceDue)
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '累计余额:' + Math.abs(that } else if (that.dealingsRecord.balanceDue < 0) {
.dealingsRecord.balanceDue)) strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '累计余额:' + Math.abs(that
} else { .dealingsRecord.balanceDue))
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '累计欠款:0') } else {
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '累计欠款:0')
}
}else{
if (that.dealingsRecord.balanceDue >= 0) {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '累计欠款:' + that.dealingsRecord
.balanceDue)
} else if (that.dealingsRecord.balanceDue < 0) {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '累计余额:' + Math.abs(that
.dealingsRecord.balanceDue))
} else {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '累计欠款:0')
}
strCmd += blesdk.addCPCLText('248', that.yNum, '24', '0', 0, '本单实收:' + that.sales
.alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn) + ')')
} }
} else { } else {
strCmd += blesdk.addCPCLSETMAG(1, 2) strCmd += blesdk.addCPCLSETMAG(1, 2)
if(this.shopId == '1810179818189361152'){
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales
.alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn) + ')') .alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn) + ')')
if (that.dealingsRecord.balanceDue >= 0) { if (that.dealingsRecord.balanceDue >= 0) {
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord
.balanceDue) .balanceDue)
} else if (that.dealingsRecord.balanceDue < 0) { } else if (that.dealingsRecord.balanceDue < 0) {
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '累计余额:' + Math.abs(that strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '累计余额:' + Math.abs(that
.dealingsRecord.balanceDue)) .dealingsRecord.balanceDue))
} else { } else {
strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '累计欠款:0') strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '累计欠款:0')
}
}else{
if (that.dealingsRecord.balanceDue >= 0) {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '累计欠款:' + that.dealingsRecord
.balanceDue)
} else if (that.dealingsRecord.balanceDue < 0) {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '累计余额:' + Math.abs(that
.dealingsRecord.balanceDue))
} else {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '累计欠款:0')
}
strCmd += blesdk.addCPCLText('248', that.yNum, '24', '0', 0, '本单实收:' + that.sales
.alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn) + ')')
} }
} }
if (that.yNum + 60 >= 1990) { if (that.yNum + 60 >= 1990) {
@ -3536,7 +3601,6 @@
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }
console.log('1111')
}) })
setTimeout(res => { setTimeout(res => {
let that = this let that = this

71
package1/other/custom.vue

@ -11,7 +11,10 @@
<uni-data-select style="width: 100%" v-model="shopId" :localdata="shopList" @change="change"></uni-data-select> <uni-data-select style="width: 100%" v-model="shopId" :localdata="shopList" @change="change"></uni-data-select>
</view> </view>
</uni-section> </uni-section>
<!-- <u-subsection :list="list" :current="current" @change="sectionChange"></u-subsection> --> <view style="background: #fff;border: 1px solid #eee;">
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text"
activeColor="#007aff"></uni-segmented-control>
</view>
<view class="ulList" v-if="bList.length > 0"> <view class="ulList" v-if="bList.length > 0">
<ul> <ul>
<li v-for="(item,index ) in bList" :key="index"> <li v-for="(item,index ) in bList" :key="index">
@ -27,12 +30,18 @@
<text decode class="cardText"> {{ '&nbsp;&nbsp;&nbsp;&nbsp; 欠款: ' }}</text> <text decode class="cardText"> {{ '&nbsp;&nbsp;&nbsp;&nbsp; 欠款: ' }}</text>
<text class="priceText">{{ item.noEarn== null ?'暂无': item.noEarn}}</text> <text class="priceText">{{ item.noEarn== null ?'暂无': item.noEarn}}</text>
</view> </view>
<view class="uni-body" v-if="item.returnSaleProductCount > 0">
<text class="cardText">退货额:</text>
<text class="priceText">{{item.returnSaleTotalAmount == null ?'暂无':item.returnSaleTotalAmount}}</text>
<text decode class="cardText">{{'&nbsp;&nbsp;&nbsp;&nbsp; 退货数: '}}</text>
<text class="priceText">{{item.returnSaleProductCount == null ?'暂无':item.returnSaleProductCount}}</text>
</view>
<view class="uni-body"> <view class="uni-body">
<text class="cardText"> 订单状态:</text> <text class="cardText"> 订单状态:</text>
{{item.status == '0' ?'待抢单' :item.status == '2' ?'作废' :item.status == '1' ?'待取货' :item.status == '3' ?'待送达' :item.status == '4' ?'已完成' :item.status == '5' ?'下游客户待退货' :item.status == '00' ?'退货待抢单' :item.status == '01' ?'退货待取货' :item.status == '03' ?'退货待送达' :item.status == '04' ?'待确认退货' :item.status == '6' ?'待配货':item.status == '8' ?'待物流上门':item.status == '9' ?'已完成' :'挂单'}} {{item.status == '0' ?'待抢单' :item.status == '2' ?'作废' :item.status == '1' ?'待取货' :item.status == '3' ?'待送达' :item.status == '4' ?'已完成' :item.status == '5' ?'下游客户待退货' :item.status == '00' ?'退货待抢单' :item.status == '01' ?'退货待取货' :item.status == '03' ?'退货待送达' :item.status == '04' ?'待确认退货' :item.status == '6' ?'待配货':item.status == '8' ?'待物流上门':item.status == '9' ?'已完成' :'挂单'}}
</view> </view>
<!-- <view class="floatRight"> 采购退货</view> --> <!-- <view class="floatRight"> 采购退货</view> -->
<view class="floatRight" @tap="kehuList(item.id)">查看详情</view> <view class="floatRight" @tap="kehuList(item.id,item.shopId)">查看详情</view>
</uni-card> </uni-card>
</li> </li>
</ul> </ul>
@ -56,6 +65,7 @@
shopList: [], shopList: [],
list: ['采购单', '退货单'], list: ['采购单', '退货单'],
current: 0, current: 0,
items: ['拿货记录','对账单'],
userId: '', userId: '',
shopId: '', shopId: '',
bList: [], bList: [],
@ -89,7 +99,10 @@
this.getShopList() this.getShopList()
this.getAllList() this.getAllList()
}, },
onLoad(option){ onLoad(option){
if(option.q){
uni.setStorageSync('codePage',true)
}
if(option.saleId !='' && option.userId == uni.getStorageSync('userId')){ if(option.saleId !='' && option.userId == uni.getStorageSync('userId')){
this.kehuList(option.saleId) this.kehuList(option.saleId)
} }
@ -115,6 +128,46 @@
} }
}) })
}) })
},
onClickItem(e) {
if (this.current !== e.currentIndex) {
this.current = e.currentIndex
}
if (e.currentIndex == 0) {
this.bList = []
this.getAllList()
} else if (e.currentIndex == 1) {
this.duizhangList = []
this.bList = []
this.pageNum = 1
this.pages = 1
this.duizhangdan()
}
},
duizhangdan() {
this.tui.request("/app/bill/getCustomerBill", "post", {
customerId: uni.getStorageSync('id'),
pageNum: this.pageNum,
pageSize: '10',
startDate: this.range[0],
endDate: this.range[1],
shopId: this.shopId
}, false, false).then((res) => {
if (res.code == 200) {
this.status = 'nomore';
if (this.pages == 1) {
this.duizhangList = res.result
this.duizhangRecords = res.result.customerBillSaleVos.records
} else {
for (let i = 0; i < res.result.customerBillSaleVos.records.length; i++) {
this.duizhangRecords.push(res.result.customerBillSaleVos.records[i])
}
}
this.pages = res.result.customerBillSaleVos.pages
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}, },
trigger(e) { trigger(e) {
let that = this; let that = this;
@ -177,14 +230,18 @@
this.sectionChange(this.current) this.sectionChange(this.current)
}, },
kehuList(id){ kehuList(id,shopId){
uni.navigateTo({ uni.navigateTo({
url: '/package1/other/customDetail?id='+id url: '/package1/index/orderDetail?id='+id + '&shopId='+shopId
}) })
}, },
//门店下拉选择 //门店下拉选择
change(e){ change(e){
this.getAllList() if(this.current == 0){
this.getAllList()
}else{
this.duizhangdan()
}
}, },
formatDate(date, fmt) { formatDate(date, fmt) {
var o = { var o = {

16
package1/stock/addStockList.vue

@ -41,7 +41,7 @@
<view style="width: 20%;text-align: center;">盘点数</view> <view style="width: 20%;text-align: center;">盘点数</view>
</view> </view>
<view v-for="(item1,index1) in item.checkStockAttributeVos" :key="index1"> <view v-for="(item1,index1) in item.checkStockAttributeVos" :key="index1">
<view style='height: 50rpx;line-height: 50rpx;'> <view style='height: 50rpx;line-height: 50rpx;' :style="{color:item1.color}">
<view <view
style="width: 60%;text-align: center;border-right: 1px solid #eee;float: left;"> style="width: 60%;text-align: center;border-right: 1px solid #eee;float: left;">
{{item1.attributeList | sliceMsg}} {{item1.attributeList | sliceMsg}}
@ -142,13 +142,23 @@
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.stock = res.result this.stock = res.result
this.znum=res.result.checkStockDetailVoList.total this.znum = res.result.checkStockDetailVoList.total
this.status = 'nomore'; this.status = 'nomore';
if (this.pages == 1) { if (this.pages == 1) {
this.stockList = res.result.checkStockDetailVoList.records this.stockList = res.result.checkStockDetailVoList.records
} else { } else {
this.stockList = [...this.stockList, ...res.result.checkStockDetailVoList.records] this.stockList = [...this.stockList, ...res.result.checkStockDetailVoList.records]
} }
for(let i=0;i<res.result.checkStockDetailVoList.records.length;i++){
for(let m=0;m<res.result.checkStockDetailVoList.records[i].checkStockAttributeVos.length;m++){
res.result.checkStockDetailVoList.records[i].checkStockAttributeVos[m].color = '#000'
if(res.result.checkStockDetailVoList.records[i].checkStockAttributeVos[m].pdNum - res.result.checkStockDetailVoList.records[i].checkStockAttributeVos[m].stockCount > 0){
res.result.checkStockDetailVoList.records[i].checkStockAttributeVos[m].color = 'red'
}else if(res.result.checkStockDetailVoList.records[i].checkStockAttributeVos[m].pdNum - res.result.checkStockDetailVoList.records[i].checkStockAttributeVos[m].stockCount < 0){
res.result.checkStockDetailVoList.records[i].checkStockAttributeVos[m].color = 'blue'
}
}
}
this.totalPages = res.result.checkStockDetailVoList.pages this.totalPages = res.result.checkStockDetailVoList.pages
this.carType = this.stockList.length this.carType = this.stockList.length
} else { } else {
@ -183,7 +193,7 @@
if (res.scanType == "QR_CODE") { //二维码 if (res.scanType == "QR_CODE") { //二维码
let shopId = base.decode(res.result.split(',')[1]) let shopId = base.decode(res.result.split(',')[1])
if (shopId == uni.getStorageSync('shopId')) { if (shopId == uni.getStorageSync('shopId').substring('10','12')) {
that.productId = base.decode(res.result.split(',')[0]) that.productId = base.decode(res.result.split(',')[0])
that.getById(base.decode(res.result.split(',')[0])); that.getById(base.decode(res.result.split(',')[0]));
if (item.saleDetailDTOList) { if (item.saleDetailDTOList) {

27
package1/stock/stockDetail.vue

@ -95,15 +95,26 @@
//点击选择列表,带参数 返回上一页 //点击选择列表,带参数 返回上一页
clickList() { clickList() {
var data = [] var data = []
for(let i=0;i<this.pecsList.length;i++){ for(let i=0;i<this.pecsList.length;i++){
if(this.pecsList[i].stockCount != this.pecsList[i].pdNum){ //炘旺和提钱,盘点整款商品全传过去
var item = { if(uni.getStorageSync('shopId') == '1842761269212483585' || uni.getStorageSync('shopId') == '1810179818189361152'){
attributeList:this.pecsList[i].attributeList, var item = {
stockCount:this.pecsList[i].stockCount, attributeList:this.pecsList[i].attributeList,
pdNum:this.pecsList[i].pdNum stockCount:this.pecsList[i].stockCount,
} pdNum:this.pecsList[i].pdNum
data.push(item) }
data.push(item)
}else{
if(this.pecsList[i].stockCount != this.pecsList[i].pdNum){
var item = {
attributeList:this.pecsList[i].attributeList,
stockCount:this.pecsList[i].stockCount,
pdNum:this.pecsList[i].pdNum
}
data.push(item)
}
} }
} }
this.dataList.checkStockAttributeVos = data this.dataList.checkStockAttributeVos = data
let dataList = [] let dataList = []

Loading…
Cancel
Save