|
|
|
@ -49,9 +49,9 @@ |
|
|
|
挂单列表 |
|
|
|
</view> |
|
|
|
<view class="content-list" v-for="(item,index) in regList" :key="index"> |
|
|
|
<view class="image-box"> |
|
|
|
<view class="image" v-if="item.aiFlag == 1">AI</view> |
|
|
|
<view class="image" v-else>扫</view> |
|
|
|
<view class="image-box"> |
|
|
|
<view class="image" v-if="item.aiFlag == 0">扫</view> |
|
|
|
<view class="image" v-else>AI</view> |
|
|
|
</view> |
|
|
|
<view class="content-text"> |
|
|
|
<view class="text" style="font-weight: bold;font-size: 32rpx;color: #000;margin-top:36rpx;"> |
|
|
|
@ -62,13 +62,18 @@ |
|
|
|
<view class="content-btn" v-if="item.aiFlag == 1"> |
|
|
|
<text class="blink">识别中...</text> |
|
|
|
</view> |
|
|
|
<view class="content-btn" v-if="item.aiFlag != 1"> |
|
|
|
<text style="position: absolute;top: 40rpx;right: 20rpx;"> |
|
|
|
{{item.aiFlag == 2?'识别成功':item.aiFlag == 3?'识别失败':''}} |
|
|
|
</text> |
|
|
|
</view> |
|
|
|
<view style="width: 100%;height: 100rpx;float: left;border-top: 1px solid #eee;"> |
|
|
|
<view class="btn" @tap="clickCollapse(item)" style="width: 70rpx;"> |
|
|
|
<uni-icons type="down" size="11" color="#fff"></uni-icons> |
|
|
|
</view> |
|
|
|
<view class="btn" @tap.stop="toggle('center',item)" v-if="item.aiFlag == 0">语音备注</view> |
|
|
|
<view class="btn" @tap.stop="scanCodeAdd(item)" v-if="item.aiFlag == 0">扫码选货</view> |
|
|
|
<view class="btn" @tap.stop="goSaleGoods(item)">去开单</view> |
|
|
|
<view class="btn" v-if="item.aiFlag != 1" @tap.stop="goGoods(item)">去开单</view> |
|
|
|
<view class="btn" @tap.stop="delItem(item.id)" style="background: linear-gradient(90deg, #FF9797, #FFC1E0);"> |
|
|
|
删除 |
|
|
|
</view> |
|
|
|
@ -280,7 +285,12 @@ |
|
|
|
onShow() { |
|
|
|
this.khName = JSON.parse(JSON.stringify(this.khName)) || '' |
|
|
|
if(uni.getStorageSync('hangOrderType') == 'scanCode'){ |
|
|
|
this.addReg() |
|
|
|
if(this.khName != ''){ |
|
|
|
this.addReg() |
|
|
|
} |
|
|
|
uni.removeStorageSync('hangOrderType') |
|
|
|
return; |
|
|
|
}else if(uni.getStorageSync('hangOrderType') == 'changeGoods'){ |
|
|
|
uni.removeStorageSync('hangOrderType') |
|
|
|
return; |
|
|
|
} |
|
|
|
@ -318,6 +328,7 @@ |
|
|
|
}).catch((res) => { |
|
|
|
this.tui.toast(res) |
|
|
|
}) |
|
|
|
uni.stopPullDownRefresh() |
|
|
|
}, |
|
|
|
addReg() { |
|
|
|
this.tui.request("/app/sale/saveOrder", "POST", { |
|
|
|
@ -378,7 +389,7 @@ |
|
|
|
}else if(that.voiceText == null){ |
|
|
|
that.voiceText = res.result |
|
|
|
}else{ |
|
|
|
res.result = '\n' + res.result |
|
|
|
res.result = ' ' + res.result |
|
|
|
that.voiceText += res.result |
|
|
|
} |
|
|
|
} |
|
|
|
@ -396,6 +407,7 @@ |
|
|
|
//扫一扫功能 |
|
|
|
scanCodeAdd(item) { |
|
|
|
let that = this; |
|
|
|
uni.setStorageSync('hangOrderType','changeGoods') |
|
|
|
uni.scanCode({ |
|
|
|
success: (res) => { |
|
|
|
that.hangId = item.id |
|
|
|
@ -604,6 +616,7 @@ |
|
|
|
productCount: this.zNum, |
|
|
|
discountAmount: this.purchasePrice, |
|
|
|
unitPrice:this.purchasePrice, |
|
|
|
categoryId:this.goodsDetail.categoryId, |
|
|
|
productName: this.goodsDetail.productName, |
|
|
|
productSn: this.goodsDetail.productSn, |
|
|
|
productPicture: this.goodsDetail.productPicture, |
|
|
|
@ -698,58 +711,95 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
goGoods(item){ |
|
|
|
var that = this; |
|
|
|
if(item.aiNotRecognition != '' && item.aiNotRecognition != null){ |
|
|
|
uni.showModal({ |
|
|
|
title: "提示", |
|
|
|
content: item.aiNotRecognition + '确认去开单吗?', |
|
|
|
success: function(res) { |
|
|
|
if (res.confirm) { |
|
|
|
that.goSaleGoods(item) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}else if(item.aiNotRecognition == '' && item.saleDetailDTOList == null){ |
|
|
|
uni.showModal({ |
|
|
|
title: "提示", |
|
|
|
content: '未识别到商品,确认去开单吗?', |
|
|
|
success: function(res) { |
|
|
|
if (res.confirm) { |
|
|
|
that.goSaleGoods(item) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
that.goSaleGoods(item) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
//带参数跳转到开单页 |
|
|
|
goSaleGoods(item) { |
|
|
|
let dataList = [] |
|
|
|
if(item.aiNotRecognition != ''){ |
|
|
|
this.tui.toast(item.aiNotRecognition) |
|
|
|
} |
|
|
|
setTimeout(res => { |
|
|
|
if(item.saleDetailDTOList){ |
|
|
|
for (let i = 0; i < item.saleDetailDTOList.length; i++) { |
|
|
|
let obj = {} |
|
|
|
obj.saleDetailQueryDTO = item.saleDetailDTOList[i].stockLogList1 |
|
|
|
obj.num = 0 |
|
|
|
obj.id = item.saleDetailDTOList[i].productId |
|
|
|
obj.price = item.saleDetailDTOList[i].price |
|
|
|
obj.lsprice = item.saleDetailDTOList[i].price |
|
|
|
obj.zPrice = item.saleDetailDTOList[i].discountAmount |
|
|
|
obj.unitPrice = item.saleDetailDTOList[i].discountAmount |
|
|
|
obj.productName = item.saleDetailDTOList[i].productName |
|
|
|
obj.productPicture = item.saleDetailDTOList[i].productPicture+'?time='+new Date().getTime() |
|
|
|
obj.productSn = item.saleDetailDTOList[i].productSn |
|
|
|
obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice |
|
|
|
obj.saleId = item.id |
|
|
|
obj.remark = item.remark |
|
|
|
obj.xsyId = item.createBy |
|
|
|
obj.createByName = item.createByName |
|
|
|
dataList.push(obj) |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if(item.saleDetailDTOList){ |
|
|
|
for (let i = 0; i < item.saleDetailDTOList.length; i++) { |
|
|
|
|
|
|
|
let obj = {} |
|
|
|
let attrMap = new Map() |
|
|
|
let newSaleDetailDTOList = [] |
|
|
|
for(let m = 0; m < item.saleDetailDTOList[i].stockLogList1.length; m++){ |
|
|
|
if(attrMap.has(item.saleDetailDTOList[i].stockLogList1[m].attributeList) == true){ |
|
|
|
let hasCount = attrMap.get(item.saleDetailDTOList[i].stockLogList1[m].attributeList) |
|
|
|
let trueCount = hasCount.split('-')[0] |
|
|
|
let lastConut = Number(trueCount) + Number(item.saleDetailDTOList[i].stockLogList1[m].productCount) |
|
|
|
newSaleDetailDTOList[hasCount.split('-')[1]].productCount = lastConut |
|
|
|
}else{ |
|
|
|
newSaleDetailDTOList.push(item.saleDetailDTOList[i].stockLogList1[m]) |
|
|
|
attrMap.set(item.saleDetailDTOList[i].stockLogList1[m].attributeList,item.saleDetailDTOList[i].stockLogList1[m].productCount+'-'+m) |
|
|
|
} |
|
|
|
} |
|
|
|
obj.saleDetailQueryDTO = newSaleDetailDTOList |
|
|
|
obj.num = 0 |
|
|
|
obj.price = 0 |
|
|
|
obj.id = item.saleDetailDTOList[i].productId |
|
|
|
obj.price = item.saleDetailDTOList[i].price |
|
|
|
obj.lsprice = item.saleDetailDTOList[i].price |
|
|
|
obj.categoryId=item.saleDetailDTOList[i].categoryId |
|
|
|
obj.zPrice = item.saleDetailDTOList[i].discountAmount |
|
|
|
obj.unitPrice = item.saleDetailDTOList[i].discountAmount || item.saleDetailDTOList[i].wholesalePrice |
|
|
|
obj.productName = item.saleDetailDTOList[i].productName |
|
|
|
obj.productPicture = item.saleDetailDTOList[i].productPicture+'?time='+new Date().getTime() |
|
|
|
obj.productSn = item.saleDetailDTOList[i].productSn |
|
|
|
obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice |
|
|
|
obj.saleId = item.id |
|
|
|
obj.remark = item.remark |
|
|
|
obj.xsyId = item.createBy |
|
|
|
obj.createByName = item.createByName |
|
|
|
dataList.push(obj) |
|
|
|
} |
|
|
|
let khName = { |
|
|
|
name:item.userName, |
|
|
|
id:item.userId, |
|
|
|
area:item.area, |
|
|
|
city:item.city, |
|
|
|
address:item.receiveAddress, |
|
|
|
province:item.province, |
|
|
|
} |
|
|
|
uni.setStorageSync('carList1', JSON.stringify(dataList)) |
|
|
|
uni.setStorageSync('khName', JSON.stringify(khName)) |
|
|
|
uni.setStorageSync('hangOrder', true) |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/inventory/goodsList1' |
|
|
|
}) |
|
|
|
}, 1000) |
|
|
|
}else{ |
|
|
|
let obj = {} |
|
|
|
obj.num = 0 |
|
|
|
obj.price = 0 |
|
|
|
obj.saleId = item.id |
|
|
|
obj.remark = item.remark |
|
|
|
obj.xsyId = item.createBy |
|
|
|
obj.createByName = item.createByName |
|
|
|
dataList.push(obj) |
|
|
|
} |
|
|
|
let khName = { |
|
|
|
name:item.userName, |
|
|
|
id:item.userId, |
|
|
|
area:item.area, |
|
|
|
city:item.city, |
|
|
|
address:item.receiveAddress, |
|
|
|
province:item.province, |
|
|
|
} |
|
|
|
uni.setStorageSync('carList1', JSON.stringify(dataList)) |
|
|
|
uni.setStorageSync('khName', JSON.stringify(khName)) |
|
|
|
uni.setStorageSync('hangOrder', true) |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/inventory/goodsList1' |
|
|
|
}) |
|
|
|
}, |
|
|
|
//点击切换折叠状态 |
|
|
|
clickCollapse(item) { |
|
|
|
@ -970,7 +1020,7 @@ |
|
|
|
|
|
|
|
.top { |
|
|
|
width: 780rpx; |
|
|
|
height: 390rpx; |
|
|
|
height: 330rpx; |
|
|
|
opacity: 1; |
|
|
|
background: linear-gradient(90deg, #6484fa 0%, #66e8ff 100%); |
|
|
|
overflow: hidden; |
|
|
|
@ -1167,7 +1217,8 @@ |
|
|
|
|
|
|
|
.banner { |
|
|
|
height: 150rpx; |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
margin-top: 20rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.banner-left, |
|
|
|
|