17 changed files with 3020 additions and 38 deletions
Binary file not shown.
Binary file not shown.
@ -0,0 +1,323 @@ |
|||
<template> |
|||
<view class="page1"> |
|||
<view class="top" ref="top"> |
|||
<view @tap="backPage" style="width: 80rpx;height: 80rpx;margin: 98rpx 0 0 30rpx;"> |
|||
<uni-icons type="left" color="#fff" size="27"></uni-icons> |
|||
</view> |
|||
<view class="top1"> |
|||
<view class="hello-box"> |
|||
<view class="hello-left"> |
|||
<text |
|||
style="font-size: 40rpx;font-weight: 800;line-height: 56rpx;color: rgba(86, 132, 255, 1);">Hi</text> |
|||
</view> |
|||
<view class="hello-name"> |
|||
你好,田一的店 |
|||
</view> |
|||
<view class="hello-right"></view> |
|||
|
|||
</view> |
|||
<view class="hello-text"> |
|||
欢迎使用快衣店AI助手~ |
|||
</view> |
|||
<view class="ai-bot"></view> |
|||
</view> |
|||
</view> |
|||
<view class="banner"> |
|||
<view class="banner-left" @tap='AiOpenOrder'> |
|||
<view class="bottom"> |
|||
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/b71062f023c54bb7bab5e55869dcd581.jpg" |
|||
alt="" style="width: 100%;height: 100%;"> |
|||
</view> |
|||
<view class="banner-text"> |
|||
<view style='font-weight: 800;'>AI</view> |
|||
<view style='font-size:22rpx;'>语音或输入文字开单</view> |
|||
</view> |
|||
</view> |
|||
<view class="banner-right"> |
|||
<view class="bottom"> |
|||
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/da77271d34b14b13827543389948802d.jpg" |
|||
alt="" style="width: 100%;height: 100%;"> |
|||
</view> |
|||
<view class="banner-text"> |
|||
<view style='font-weight: 800;'>扫码</view> |
|||
<view style='font-size:22rpx;'>扫描二维码或条形码</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="content"> |
|||
<view style="height: 80rpx;line-height: 80rpx;font-size: 32rpx;font-weight: bold;padding-left: 30rpx;">入库列表 |
|||
</view> |
|||
<view class="content-list"> |
|||
<view class="image-box"> |
|||
<view class="image">AI</view> |
|||
</view> |
|||
<view class="content-text"> |
|||
<view class="text" style="font-weight: bold;font-size: 32rpx;color: #000;margin-top:36rpx;"> |
|||
2024-10-15 12:12:00</view> |
|||
<view class="text">识别成功:120</view> |
|||
</view> |
|||
<view class="content-btn"> |
|||
<text class="blink">识别中...</text> |
|||
<view class="btn">去入库</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
components: {}, |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
onShow() { |
|||
|
|||
}, |
|||
onLoad() { |
|||
|
|||
}, |
|||
methods: { |
|||
AiOpenOrder(){ |
|||
uni.navigateTo({ |
|||
url: '/package1/AI/AiChat' |
|||
}) |
|||
}, |
|||
backPage(){ |
|||
uni.navigateBack({ |
|||
delta: 1 |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
page, |
|||
.page1 { |
|||
background: #FAF7F7; |
|||
} |
|||
|
|||
.top { |
|||
width: 780rpx; |
|||
height: 390rpx; |
|||
opacity: 1; |
|||
background: linear-gradient(90deg, #6484fa 0%, #66e8ff 100%); |
|||
overflow: hidden; |
|||
} |
|||
|
|||
.top1 { |
|||
width: 780rpx; |
|||
height: 390rpx; |
|||
opacity: 1; |
|||
background: linear-gradient(360deg, #FAF7F7 0%, rgba(255, 255, 255, 0) 100%); |
|||
} |
|||
|
|||
.ai-bot { |
|||
position: absolute; |
|||
top: 200rpx; |
|||
right: 40rpx; |
|||
width: 90rpx; |
|||
height: 110rpx; |
|||
background-size: 100% !important; |
|||
background: url(https://jewel-shop.oss-cn-beijing.aliyuncs.com/66dc640d9e8f4749a234d9ef2af1b257.png) no-repeat; |
|||
} |
|||
|
|||
.hello-box { |
|||
position: absolute; |
|||
left: 42rpx; |
|||
top: 205rpx; |
|||
width: 220rpx; |
|||
height: 56rpx; |
|||
|
|||
.hello-left { |
|||
width: 102rpx; |
|||
height: 56rpx; |
|||
opacity: 1; |
|||
background: #fff; |
|||
border-radius: 3px; |
|||
text-align: center; |
|||
transform: skewX(8deg); |
|||
} |
|||
|
|||
.hello-right { |
|||
position: absolute; |
|||
left: 5px; |
|||
bottom: 0rpx; |
|||
width: 220rpx; |
|||
height: 2px; |
|||
opacity: 1; |
|||
background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%); |
|||
} |
|||
|
|||
.hello-name { |
|||
position: absolute; |
|||
left: 118rpx; |
|||
top: 0; |
|||
width: 400rpx; |
|||
height: 55rpx; |
|||
font-size: 32rpx; |
|||
line-height: 55rpx; |
|||
color: white; |
|||
overflow: hidden; |
|||
} |
|||
} |
|||
|
|||
.hello-text { |
|||
position: absolute; |
|||
top: 275rpx; |
|||
left: 50rpx; |
|||
color: #fff; |
|||
font-size: 28rpx; |
|||
} |
|||
|
|||
.content-list { |
|||
width: 95%; |
|||
height: 170rpx; |
|||
background: #fff; |
|||
border-radius: 10px; |
|||
margin: 0 auto 20rpx; |
|||
overflow: hidden; |
|||
display: block; |
|||
} |
|||
|
|||
.image-box { |
|||
width: 120rpx; |
|||
height: 170rpx; |
|||
display: block; |
|||
overflow: hidden; |
|||
float: left; |
|||
} |
|||
|
|||
.image { |
|||
width: 100rpx; |
|||
height: 100rpx; |
|||
margin: 35rpx 0 0 20rpx; |
|||
font-size: 36rpx; |
|||
background: #8470FF; |
|||
border-radius: 50%; |
|||
text-align: center; |
|||
line-height: 100rpx; |
|||
color: #fff; |
|||
} |
|||
|
|||
.content-text { |
|||
width: 400rpx; |
|||
height: 200rpx; |
|||
float: left; |
|||
line-height: 50rpx; |
|||
padding-left: 30rpx; |
|||
} |
|||
|
|||
.text { |
|||
color: #747474; |
|||
font-size: 28rpx; |
|||
} |
|||
|
|||
.content-btn { |
|||
position: relative; |
|||
width: 190rpx; |
|||
height: 170rpx; |
|||
float: left; |
|||
} |
|||
|
|||
.btn { |
|||
position: absolute; |
|||
width: 120rpx; |
|||
height: 60rpx; |
|||
background: linear-gradient(90deg, #6691fb 0%, #6ad3fe 100%); |
|||
color: #fff; |
|||
border-radius: 6px; |
|||
text-align: center; |
|||
line-height: 60rpx; |
|||
bottom: 20rpx; |
|||
right: 20rpx; |
|||
} |
|||
|
|||
@keyframes blinking { |
|||
0% { |
|||
opacity: 1; |
|||
} |
|||
|
|||
50% { |
|||
opacity: 0; |
|||
} |
|||
|
|||
100% { |
|||
opacity: 1; |
|||
} |
|||
} |
|||
|
|||
.blink { |
|||
position: absolute; |
|||
top: 40rpx; |
|||
right: 20rpx; |
|||
animation: blinking 1s infinite; |
|||
} |
|||
|
|||
.bottom { |
|||
background: rgba(255, 255, 255, 0.3); |
|||
width: 100rpx; |
|||
height: 100rpx; |
|||
border-radius: 10px; |
|||
margin: 25rpx; |
|||
position: relative; |
|||
font-size: 60rpx; |
|||
color: #fff; |
|||
font-weight: 800; |
|||
text-align: center; |
|||
line-height: 100rpx; |
|||
background: #fff; |
|||
overflow: hidden; |
|||
float: left; |
|||
|
|||
img { |
|||
width: 100%; |
|||
height: 100%; |
|||
border-radius: 10px; |
|||
/* background: #fff; */ |
|||
// margin-top: -16rpx; |
|||
animation: jump 1.5s infinite; |
|||
} |
|||
|
|||
@keyframes jump { |
|||
0% { |
|||
margin-top: 0; |
|||
} |
|||
|
|||
50% { |
|||
margin-top: -25rpx; |
|||
} |
|||
|
|||
100% { |
|||
margin-top: 0; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.banner { |
|||
height: 150rpx; |
|||
display: flex; |
|||
} |
|||
|
|||
.banner-left, |
|||
.banner-right { |
|||
width: 49%; |
|||
margin-left: 1%; |
|||
margin-right: 2%; |
|||
background: linear-gradient(126.07deg, rgba(100, 132, 250, 1) 0%, rgba(102, 232, 255, 1) 100%); |
|||
border-radius: 10px; |
|||
} |
|||
|
|||
.banner-text { |
|||
margin-top: 20rpx; |
|||
line-height: 60rpx; |
|||
font-size: 36rpx; |
|||
color: #fff; |
|||
} |
|||
.content{ |
|||
margin-top: 20rpx; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,345 @@ |
|||
<template> |
|||
<view class="page1"> |
|||
<view class="top" ref="top"> |
|||
<view @tap="backPage" style="width: 80rpx;height: 80rpx;margin: 98rpx 0 0 30rpx;"> |
|||
<uni-icons type="left" color="#fff" size="27"></uni-icons> |
|||
</view> |
|||
<view class="top1"> |
|||
<view class="hello-box"> |
|||
<view class="hello-left"> |
|||
<text |
|||
style="font-size: 40rpx;font-weight: 800;line-height: 56rpx;color: rgba(86, 132, 255, 1);">Hi</text> |
|||
</view> |
|||
<view class="hello-name"> |
|||
你好,田一的店 |
|||
</view> |
|||
<view class="hello-right"></view> |
|||
|
|||
</view> |
|||
<view class="hello-text"> |
|||
欢迎使用快衣店AI助手~ |
|||
</view> |
|||
<view class="ai-bot"></view> |
|||
</view> |
|||
</view> |
|||
<view class="content"> |
|||
<view style="height: 80rpx;line-height: 80rpx;font-size: 32rpx;font-weight: bold;padding-left: 30rpx;">入库列表 |
|||
</view> |
|||
<view class="content-list" v-for="(item,index) in aiList" :key="index"> |
|||
<view class="image-box"> |
|||
<view class="image">AI</view> |
|||
</view> |
|||
<view class="content-text"> |
|||
<view class="text" style="font-weight: bold;font-size: 32rpx;color: #000;margin-top:36rpx;"> |
|||
{{item.createTime}} |
|||
</view> |
|||
<view class="text">总数:{{item.count}} (成功:{{item.ocrCount}})</view> |
|||
</view> |
|||
<view class="content-btn"> |
|||
<text class="blink" v-if="item.inStorageStatus==2">识别中...</text> |
|||
<text style="position: absolute;top: 40rpx;right: 20rpx;" v-else>识别完成</text> |
|||
<view class="btn" @tap="montageData(item.id)" v-if="item.inStorageStatus==3">去入库</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="bottom" @tap="goAiPicture"> |
|||
<view class="btn-x bottom-btn"></view> |
|||
<view class="btn-y bottom-btn"></view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
components: {}, |
|||
data() { |
|||
return { |
|||
aiList:[], |
|||
carList1:[], |
|||
purchaseDetails:[] |
|||
} |
|||
}, |
|||
onShow() { |
|||
this.carList1 = [] |
|||
this.getList() |
|||
}, |
|||
onLoad() { |
|||
|
|||
}, |
|||
methods: { |
|||
getList(){ |
|||
this.tui.request("/app/purchase/getPurchaseList", "POST", { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
isAiList: 1 |
|||
}, false, false).then((res) => { |
|||
this.aiList = res.result.records |
|||
}).catch((res) => {}) |
|||
|
|||
// this.tui.request("/app/sale/buyAi", "POST", { |
|||
// aiMsg:'货号WhwBjn00001,x码黑色30件,s码儿,白色10件儿,双XL,x白色50件儿。 ' |
|||
// }, false, true).then((res) => { |
|||
// this.aiList = res.result.records |
|||
// }).catch((res) => {}) |
|||
}, |
|||
backPage(){ |
|||
uni.navigateBack({ |
|||
delta: 1 |
|||
}) |
|||
}, |
|||
sliceMsg(val) { |
|||
var name = '' |
|||
if (typeof(val) == 'string') { |
|||
let newObj = JSON.parse(val) |
|||
for (let as in newObj) { |
|||
name += newObj[as] + '/' |
|||
} |
|||
} |
|||
return name; |
|||
}, |
|||
async montageData(id){ |
|||
this.tui.request("/app/purchase/getPurchaseAllDataOfAi?id=" + id, "POST", {}, false, false) |
|||
.then((res) => { |
|||
this.purchaseDetails = res.result.purchaseDetails |
|||
for(let i=0;i<this.purchaseDetails.length;i++){ |
|||
let data = { |
|||
id: this.purchaseDetails[i].id, |
|||
price: this.purchaseDetails[i].price, |
|||
num: this.purchaseDetails[i].productCount, |
|||
wholesalePrice: 0, |
|||
isNew:true, |
|||
productName: this.purchaseDetails[i].productName, |
|||
productSn: this.purchaseDetails[i].productSn, |
|||
productPicture: '', |
|||
supplierName: '', |
|||
saleDetailQueryDTO: [] |
|||
} |
|||
for(let m=0;m<this.purchaseDetails[i].stockLogList1.length;m++){ |
|||
let list = { |
|||
attributeList: this.purchaseDetails[i].stockLogList1[m].attributeList, |
|||
productCount:this.purchaseDetails[i].stockLogList1[m].productCount, |
|||
productNum:'', |
|||
name: this.sliceMsg(this.purchaseDetails[i].stockLogList1[m].attributeList), |
|||
price: this.purchaseDetails[i].stockLogList1[m].purchasePrice |
|||
} |
|||
data.saleDetailQueryDTO.push(list) |
|||
} |
|||
this.carList1.push(data) |
|||
|
|||
} |
|||
}).catch((res) => {}) |
|||
|
|||
setTimeout(res => { |
|||
this.goInventory() |
|||
}, 300) |
|||
|
|||
}, |
|||
goInventory(){ |
|||
console.log('来来',this.carList1) |
|||
uni.setStorageSync('carList1', this.carList1) |
|||
uni.navigateTo({ |
|||
url: '/pages/inventory/AIInventory' |
|||
}) |
|||
}, |
|||
goAiPicture(){ |
|||
uni.navigateTo({ |
|||
url: '/package1/AI/AIPicture' |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
page, |
|||
.page1 { |
|||
background: #FAF7F7; |
|||
} |
|||
|
|||
.top { |
|||
width: 780rpx; |
|||
height: 390rpx; |
|||
opacity: 1; |
|||
background: linear-gradient(90deg, #6484fa 0%, #66e8ff 100%); |
|||
overflow: hidden; |
|||
} |
|||
|
|||
.top1 { |
|||
width: 780rpx; |
|||
height: 390rpx; |
|||
opacity: 1; |
|||
background: linear-gradient(360deg, #FAF7F7 0%, rgba(255, 255, 255, 0) 100%); |
|||
} |
|||
|
|||
.ai-bot { |
|||
position: absolute; |
|||
top: 200rpx; |
|||
right: 40rpx; |
|||
width: 90rpx; |
|||
height: 110rpx; |
|||
background-size: 100% !important; |
|||
background: url(https://jewel-shop.oss-cn-beijing.aliyuncs.com/66dc640d9e8f4749a234d9ef2af1b257.png) no-repeat; |
|||
} |
|||
|
|||
.hello-box { |
|||
position: absolute; |
|||
left: 42rpx; |
|||
top: 205rpx; |
|||
width: 220rpx; |
|||
height: 56rpx; |
|||
|
|||
.hello-left { |
|||
width: 102rpx; |
|||
height: 56rpx; |
|||
opacity: 1; |
|||
background: #fff; |
|||
border-radius: 3px; |
|||
text-align: center; |
|||
transform: skewX(8deg); |
|||
} |
|||
|
|||
.hello-right { |
|||
position: absolute; |
|||
left: 5px; |
|||
bottom: 0rpx; |
|||
width: 220rpx; |
|||
height: 2px; |
|||
opacity: 1; |
|||
background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%); |
|||
} |
|||
|
|||
.hello-name { |
|||
position: absolute; |
|||
left: 118rpx; |
|||
top: 0; |
|||
width: 400rpx; |
|||
height: 55rpx; |
|||
font-size: 32rpx; |
|||
line-height: 55rpx; |
|||
color: white; |
|||
overflow: hidden; |
|||
} |
|||
} |
|||
|
|||
.hello-text { |
|||
position: absolute; |
|||
top: 275rpx; |
|||
left: 50rpx; |
|||
color: #fff; |
|||
font-size: 28rpx; |
|||
} |
|||
|
|||
.content-list { |
|||
width: 95%; |
|||
height: 170rpx; |
|||
background: #fff; |
|||
border-radius: 10px; |
|||
margin: 0 auto 20rpx; |
|||
overflow: hidden; |
|||
display: block; |
|||
} |
|||
|
|||
.image-box { |
|||
width: 120rpx; |
|||
height: 170rpx; |
|||
display: block; |
|||
overflow: hidden; |
|||
float: left; |
|||
} |
|||
|
|||
.image { |
|||
width: 100rpx; |
|||
height: 100rpx; |
|||
margin: 35rpx 0 0 20rpx; |
|||
font-size: 36rpx; |
|||
background: #8470FF; |
|||
border-radius: 50%; |
|||
text-align: center; |
|||
line-height: 100rpx; |
|||
color: #fff; |
|||
} |
|||
|
|||
.content-text { |
|||
width: 400rpx; |
|||
height: 200rpx; |
|||
float: left; |
|||
line-height: 50rpx; |
|||
padding-left: 30rpx; |
|||
} |
|||
|
|||
.text { |
|||
color: #747474; |
|||
font-size: 28rpx; |
|||
} |
|||
|
|||
.content-btn { |
|||
position: relative; |
|||
width: 190rpx; |
|||
height: 170rpx; |
|||
float: left; |
|||
} |
|||
|
|||
.btn { |
|||
position: absolute; |
|||
width: 120rpx; |
|||
height: 60rpx; |
|||
background: linear-gradient(90deg, #6691fb 0%, #6ad3fe 100%); |
|||
color: #fff; |
|||
border-radius: 6px; |
|||
text-align: center; |
|||
line-height: 60rpx; |
|||
bottom: 20rpx; |
|||
right: 20rpx; |
|||
} |
|||
|
|||
@keyframes blinking { |
|||
0% { |
|||
opacity: 1; |
|||
} |
|||
|
|||
50% { |
|||
opacity: 0; |
|||
} |
|||
|
|||
100% { |
|||
opacity: 1; |
|||
} |
|||
} |
|||
|
|||
.blink { |
|||
position: absolute; |
|||
top: 40rpx; |
|||
right: 20rpx; |
|||
animation: blinking 1s infinite; |
|||
} |
|||
|
|||
.bottom { |
|||
position: fixed; |
|||
bottom: 100rpx; |
|||
right: 50rpx; |
|||
background: linear-gradient(90deg, #6691fb 0%, #6ad3fe 100%); |
|||
width: 120rpx; |
|||
height: 120rpx; |
|||
border-radius: 50%; |
|||
} |
|||
|
|||
.btn-x { |
|||
width: 2px; |
|||
height: 40rpx; |
|||
background: #fff; |
|||
border-radius: 2rpx; |
|||
position: absolute; |
|||
top: 40rpx; |
|||
left: 59rpx; |
|||
} |
|||
|
|||
.btn-y { |
|||
width: 40rpx; |
|||
height: 2px; |
|||
background: #fff; |
|||
border-radius: 2rpx; |
|||
position: absolute; |
|||
top: 59rpx; |
|||
left: 40rpx; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,485 @@ |
|||
<template> |
|||
<view class="page1"> |
|||
<view class="top" ref="top"> |
|||
<view @tap="backPage" style="width: 80rpx;height: 80rpx;margin: 98rpx 0 0 30rpx;"> |
|||
<uni-icons type="left" color="#fff" size="27"></uni-icons> |
|||
</view> |
|||
<view class="top1"> |
|||
<text style="display: block;margin-top: 107rpx;color: #fff;">Ai入库</text> |
|||
</view> |
|||
</view> |
|||
<view class="content"> |
|||
<view class="prompt"> |
|||
<view class="prompt-title"> |
|||
<view class="hello-right"></view> |
|||
<view class="ai-bot"></view> |
|||
<view class="hello-left"> |
|||
<text style="font-size: 40rpx;font-weight: 800;line-height: 56rpx;color: #fff;">Hi</text> |
|||
</view> |
|||
</view> |
|||
<view class="prompt-title-text"> |
|||
<text>欢迎使用Ai助手,为了提高图片识别准确率,建议您按照以下要求上传图片:</text> |
|||
<text>1.每张图片建议您裁剪到20个规格或以下</text> |
|||
<text>2.确保最后一款商品规格截取完整</text> |
|||
<text>3.每张图片输入对应的规格数量</text> |
|||
</view> |
|||
<view class="prompt-title-img"> |
|||
<view class="img" v-for="(item,index) in imgList" :key="index"> |
|||
<image show-menu-by-longpress :src="item" @tap="showImage(item)"></image> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view @tap="upLoadImg()" |
|||
style="height: 98rpx;line-height: 98rpx;font-size: 34rpx;font-weight: bold;padding-left: 30rpx;position: relative;"> |
|||
上传图片 |
|||
<view class="title-line"></view> |
|||
<view class="icon-upload"> |
|||
<uni-icons type="cloud-upload" color="#00BFFF" size="30"></uni-icons> |
|||
</view> |
|||
</view> |
|||
<view class="content-list"> |
|||
<view class="content-list-img" v-for="(item,index) in purchaseOcrPictureList" :key="index"> |
|||
<view class="del-icon"> |
|||
<uni-icons type="trash" color="#00BFFF" size="20"></uni-icons> |
|||
</view> |
|||
<image show-menu-by-longpress :src="item.ocrPicture" @tap="showImage(item.ocrPicture)"></image> |
|||
<uni-easyinput type='number' prefixIcon="compose" v-model='item.count' placeholder="请输入规格数量"></uni-easyinput> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="bottom" @tap="identify"> |
|||
<view class="run-line"></view> |
|||
<img class="bottom-img" |
|||
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/0db7dd480e4644af871ce7bf97f4f775.jpg" alt="" /> |
|||
<view class="bottom-btn">Ai识别</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
components: {}, |
|||
data() { |
|||
return { |
|||
imgList: [ |
|||
'https://jewel-shop.oss-cn-beijing.aliyuncs.com/f51c446ef147437c9a8200ed2b43ec7f.jpg', |
|||
'https://jewel-shop.oss-cn-beijing.aliyuncs.com/5444bab7df8d47e09c831c054b6e447b.jpg', |
|||
'https://jewel-shop.oss-cn-beijing.aliyuncs.com/44e7ccc2fae74db593bd1a10f538e2de.jpg', |
|||
'https://jewel-shop.oss-cn-beijing.aliyuncs.com/2a55142e562b4ea480ce553c8b84d092.jpg' |
|||
], |
|||
purchaseOcrPictureList:[] |
|||
} |
|||
}, |
|||
onShow() { |
|||
if(this.uploadUrl && this.uploadNum == 1){ |
|||
let data = { |
|||
ocrPicture:this.uploadUrl, |
|||
count:'' |
|||
} |
|||
this.purchaseOcrPictureList.push(data) |
|||
} |
|||
}, |
|||
onLoad() { |
|||
|
|||
}, |
|||
methods: { |
|||
identify(){ |
|||
this.tui.request("/purchaseOcrPicture/batchSave", "POST", { |
|||
orderId:"", |
|||
purchaseOcrPictureList:this.purchaseOcrPictureList |
|||
|
|||
}, false, false).then((res) => { |
|||
if (res.code == 200) { |
|||
this.tui.toast("识别中,请等待...") |
|||
setTimeout(res => { |
|||
uni.navigateBack({ |
|||
delta: 1 |
|||
}) |
|||
}, 2000) |
|||
|
|||
} else { |
|||
this.tui.toast(res.message) |
|||
} |
|||
}).catch((res) => {}) |
|||
}, |
|||
backPage(){ |
|||
uni.navigateBack({ |
|||
delta: 1 |
|||
}) |
|||
}, |
|||
//点击图片放大 |
|||
showImage(img) { |
|||
uni.previewImage({ |
|||
urls: [img], |
|||
current: img |
|||
}) |
|||
}, |
|||
upLoadImg() { |
|||
let that = this; |
|||
uni.chooseMedia({ |
|||
count: 1, |
|||
mediaType: ['image'], |
|||
sourceType: ['album', 'camera'], |
|||
camera: 'back', |
|||
success(res) { |
|||
console.log(res.tempFiles[0].tempFilePath) |
|||
uni.navigateTo({ |
|||
url: '/package1/cropper/cropper?imgSrc='+res.tempFiles[0].tempFilePath |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
page, |
|||
.page1 { |
|||
background: #F1F5FB; |
|||
} |
|||
|
|||
.top { |
|||
width: 780rpx; |
|||
height: 390rpx; |
|||
opacity: 1; |
|||
background: linear-gradient(90deg, #6484fa 0%, #66e8ff 100%); |
|||
overflow: hidden; |
|||
} |
|||
|
|||
.top1 { |
|||
width: 780rpx; |
|||
height: 390rpx; |
|||
opacity: 1; |
|||
text-align: center; |
|||
font-weight: bold; |
|||
font-size: 38rpx; |
|||
display: block; |
|||
background: linear-gradient(360deg, #FAF7F7 0%, rgba(255, 255, 255, 0) 100%); |
|||
overflow: hidden; |
|||
} |
|||
|
|||
.ai-bot { |
|||
position: absolute; |
|||
top: -8rpx; |
|||
left: 10rpx; |
|||
width: 70rpx; |
|||
height: 60rpx; |
|||
background-size: 100% !important; |
|||
background: url(https://jewel-shop.oss-cn-beijing.aliyuncs.com/66dc640d9e8f4749a234d9ef2af1b257.png) no-repeat; |
|||
} |
|||
|
|||
|
|||
.hello-left { |
|||
width: 102rpx; |
|||
height: 56rpx; |
|||
opacity: 1; |
|||
margin-left: 100rpx; |
|||
background: linear-gradient(127.96deg, #6585fa 0%, #6ad5fe 100%); |
|||
border-radius: 3px; |
|||
text-align: center; |
|||
-webkit-transform: skewX(8deg); |
|||
transform: skewX(-6deg); |
|||
} |
|||
|
|||
.hello-right { |
|||
position: absolute; |
|||
left: 5px; |
|||
bottom: 0rpx; |
|||
width: 120rpx; |
|||
height: 2px; |
|||
opacity: 1; |
|||
background: linear-gradient(180deg, #6585fa 0%, #6ad5fe 100%); |
|||
} |
|||
|
|||
.hello-name { |
|||
position: absolute; |
|||
left: 118rpx; |
|||
top: 0; |
|||
width: 400rpx; |
|||
height: 55rpx; |
|||
font-size: 32rpx; |
|||
line-height: 55rpx; |
|||
color: white; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
.hello-text { |
|||
position: absolute; |
|||
top: 275rpx; |
|||
left: 50rpx; |
|||
color: #fff; |
|||
font-size: 28rpx; |
|||
} |
|||
|
|||
.content-list { |
|||
width: 95%; |
|||
height: auto; |
|||
border-radius: 10px; |
|||
margin: 0 auto 20rpx; |
|||
overflow: hidden; |
|||
display: block; |
|||
} |
|||
|
|||
.image-box { |
|||
width: 120rpx; |
|||
height: 170rpx; |
|||
display: block; |
|||
overflow: hidden; |
|||
float: left; |
|||
} |
|||
|
|||
.image { |
|||
width: 100rpx; |
|||
height: 100rpx; |
|||
margin: 35rpx 0 0 20rpx; |
|||
font-size: 36rpx; |
|||
background: #8470FF; |
|||
border-radius: 50%; |
|||
text-align: center; |
|||
line-height: 100rpx; |
|||
color: #fff; |
|||
} |
|||
|
|||
.content-text { |
|||
width: 400rpx; |
|||
height: 200rpx; |
|||
float: left; |
|||
line-height: 50rpx; |
|||
padding-left: 30rpx; |
|||
} |
|||
|
|||
.text { |
|||
color: #747474; |
|||
font-size: 28rpx; |
|||
} |
|||
|
|||
.content-btn { |
|||
position: relative; |
|||
width: 190rpx; |
|||
height: 170rpx; |
|||
float: left; |
|||
} |
|||
|
|||
.btn { |
|||
position: absolute; |
|||
width: 120rpx; |
|||
height: 60rpx; |
|||
background: linear-gradient(90deg, #6691fb 0%, #6ad3fe 100%); |
|||
color: #fff; |
|||
border-radius: 6px; |
|||
text-align: center; |
|||
line-height: 60rpx; |
|||
bottom: 20rpx; |
|||
right: 20rpx; |
|||
} |
|||
|
|||
@keyframes blinking { |
|||
0% { |
|||
opacity: 1; |
|||
} |
|||
|
|||
50% { |
|||
opacity: 0; |
|||
} |
|||
|
|||
100% { |
|||
opacity: 1; |
|||
} |
|||
} |
|||
|
|||
.blink { |
|||
position: absolute; |
|||
top: 40rpx; |
|||
right: 20rpx; |
|||
animation: blinking 1s infinite; |
|||
} |
|||
|
|||
.bottom { |
|||
position: fixed; |
|||
bottom: 100rpx; |
|||
right: 0; |
|||
left: 0; |
|||
margin: auto; |
|||
background: #fff; |
|||
width: 255rpx; |
|||
height: 85rpx; |
|||
padding: 5rpx; |
|||
z-index: 99; |
|||
background: linear-gradient(90deg, #FFF0F5 0%, #BCD2EE 100%); |
|||
border-radius: 80rpx; |
|||
overflow: hidden; |
|||
|
|||
.bottom-img { |
|||
width: 60rpx; |
|||
height: 60rpx; |
|||
background-size: 100%; |
|||
margin: 10rpx; |
|||
float: left; |
|||
position: absolute; |
|||
top: 0; |
|||
bottom: 0; |
|||
} |
|||
} |
|||
|
|||
.btn-x { |
|||
width: 2px; |
|||
height: 40rpx; |
|||
background: #fff; |
|||
border-radius: 2rpx; |
|||
position: absolute; |
|||
top: 40rpx; |
|||
left: 59rpx; |
|||
} |
|||
|
|||
.btn-y { |
|||
width: 40rpx; |
|||
height: 2px; |
|||
background: #fff; |
|||
border-radius: 2rpx; |
|||
position: absolute; |
|||
top: 59rpx; |
|||
left: 40rpx; |
|||
} |
|||
|
|||
.prompt { |
|||
background: #fff; |
|||
width: 95%; |
|||
height: auto; |
|||
border-radius: 10px; |
|||
margin: -150rpx auto 0; |
|||
display: block; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
.prompt-title { |
|||
position: relative; |
|||
width: 300rpx; |
|||
margin: 40rpx 40rpx 20rpx 40rpx; |
|||
} |
|||
|
|||
.prompt-title-text { |
|||
display: flex; |
|||
flex-direction: column; |
|||
color: #777; |
|||
font-size: 26rpx; |
|||
width: 90%; |
|||
margin: 0 auto; |
|||
line-height: 40rpx; |
|||
} |
|||
|
|||
.img { |
|||
width: 23%; |
|||
margin-left: 1.5%; |
|||
height: 178rpx; |
|||
border: 1px solid #eee; |
|||
padding: 5px; |
|||
float: left; |
|||
border-radius: 10px; |
|||
|
|||
image { |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
} |
|||
|
|||
.prompt-title-img { |
|||
width: 93%; |
|||
height: 185rpx; |
|||
margin: 20rpx auto; |
|||
} |
|||
|
|||
.content-list-img { |
|||
position: relative; |
|||
width: 48%; |
|||
margin-left: 1.5%; |
|||
height: 400rpx; |
|||
border: 1px solid #eee; |
|||
float: left; |
|||
background: #fff; |
|||
border-top-left-radius: 10px; |
|||
border-top-right-radius: 10px; |
|||
margin-bottom: 40rpx; |
|||
|
|||
image { |
|||
width: 100%; |
|||
height: 80%; |
|||
padding: 10px; |
|||
} |
|||
|
|||
.uni-easyinput { |
|||
width: 100%; |
|||
height: 20%; |
|||
font-size: 36rpx; |
|||
line-height: 40rpx; |
|||
background: #F8FAFF; |
|||
text-align: center; |
|||
display: block; |
|||
border-bottom-left-radius: 10px; |
|||
border-bottom-right-radius: 10px; |
|||
} |
|||
|
|||
.is-input-border { |
|||
border: none; |
|||
background: #F8FAFF !important; |
|||
} |
|||
|
|||
.del-icon { |
|||
width: 50rpx; |
|||
height: 50rpx; |
|||
position: absolute; |
|||
top: 0; |
|||
right: 0; |
|||
} |
|||
} |
|||
|
|||
.icon-upload { |
|||
position: absolute; |
|||
top: 0; |
|||
left: 190rpx; |
|||
height: 100%; |
|||
} |
|||
|
|||
.title-line { |
|||
width: 70px; |
|||
height: 7px; |
|||
position: absolute; |
|||
bottom: 30rpx; |
|||
left: 30rpx; |
|||
background: rgba(0, 191, 255, 0.5); |
|||
} |
|||
|
|||
.bottom-btn { |
|||
width: 100%; |
|||
height: 80rpx; |
|||
padding-left: 100rpx; |
|||
color: #777; |
|||
line-height: 80rpx; |
|||
font-weight: bold; |
|||
position: absolute; |
|||
top: 0; |
|||
bottom: 40rpx; |
|||
font-size: 34rpx; |
|||
} |
|||
|
|||
.run-line { |
|||
width: 200px; |
|||
height: 200px; |
|||
-webkit-animation: rotate2 2s linear infinite; |
|||
animation: rotate2 3s linear infinite; |
|||
-webkit-transform-origin: 50% 50%; |
|||
z-index: -2; |
|||
margin: -50% 0 0 -50%; |
|||
background: linear-gradient(90deg, #FFF0F5 0%, #BCD2EE 100%); |
|||
} |
|||
|
|||
@keyframes rotate2 { |
|||
0% { |
|||
transform: rotate(0deg); |
|||
} |
|||
|
|||
100% { |
|||
transform: rotate(360deg); |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,8 @@ |
|||
<template> |
|||
</template> |
|||
|
|||
<script> |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
|||
@ -0,0 +1,44 @@ |
|||
<template> |
|||
<view> |
|||
<view @tap='goList("1")'>页面1</view> |
|||
<view @tap='goList("2")'>页面2</view> |
|||
<view @tap='goList("3")'>页面3</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
components: {}, |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
onShow() { |
|||
|
|||
}, |
|||
onLoad() { |
|||
|
|||
}, |
|||
methods: { |
|||
goList(type){ |
|||
if(type == 1){ |
|||
uni.navigateTo({ |
|||
url: '/package1/AI/AIPicture' |
|||
}) |
|||
}else if(type == 2){ |
|||
uni.navigateTo({ |
|||
url: '/package1/AI/AIInventoryList' |
|||
}) |
|||
}else{ |
|||
uni.navigateTo({ |
|||
url: '/package1/AI/AIHangOrderList' |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
|||
Binary file not shown.
@ -0,0 +1,302 @@ |
|||
<template> |
|||
<view> |
|||
<view style="width:100%;height:500rpx;"> |
|||
<image-cropper id="image-cropper" @load="cropperload" @imageload="loadimage" @tapcut="clickcut" limit_move="{{limit_move}}" disable_rotate="{{disable_rotate}}" width="{{width}}" height="{{height}}" imgSrc="{{src}}" angle="{{angle}}" disable_width="{{disable_width}}" max_width="{{max_width}}" max_height="{{max_height}}" disable_height="{{disable_height}}" disable_ratio="{{disable_ratio}}"> |
|||
</image-cropper> |
|||
</view> |
|||
<text class="hint">点击中间裁剪框可查看裁剪后的图片</text> |
|||
<view class='bottom'> |
|||
<button @tap='submit'>确定</button> |
|||
<button class="button" @touchstart='rotate' @touchend='end' data-type="rotate">旋转</button> |
|||
<button class="button" @tap='upload'>上传</button> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
src: '', |
|||
width: 250, //宽度 |
|||
height: 250, //高度 |
|||
max_width: 1920, |
|||
max_height: 1080, |
|||
disable_rotate: true, //是否禁用旋转 |
|||
disable_ratio: false, //锁定比例 |
|||
limit_move: true, //是否限制移动 |
|||
} |
|||
}, |
|||
onLoad(options) { |
|||
this.cropper = this.selectComponent("#image-cropper"); |
|||
this.src= options.imgSrc |
|||
if(!options.imgSrc){ |
|||
this.cropper.upload(); //上传图片 |
|||
} |
|||
}, |
|||
methods: { |
|||
cropperload(e) { |
|||
console.log('cropper加载完成'); |
|||
}, |
|||
loadimage(e) { |
|||
wx.hideLoading(); |
|||
console.log('图片'); |
|||
this.cropper.imgReset(); |
|||
}, |
|||
clickcut(e) { |
|||
console.log(e.detail); |
|||
//图片预览 |
|||
wx.previewImage({ |
|||
current: e.detail.url, // 当前显示图片的http链接 |
|||
urls: [e.detail.url] // 需要预览的图片http链接列表 |
|||
}) |
|||
}, |
|||
upload() { |
|||
let that = this; |
|||
wx.chooseImage({ |
|||
count: 1, |
|||
sizeType: ['original', 'compressed'], |
|||
sourceType: ['album', 'camera'], |
|||
success(res) { |
|||
wx.showLoading({ |
|||
title: '加载中', |
|||
}) |
|||
const tempFilePaths = res.tempFilePaths[0]; |
|||
//重置图片角度、缩放、位置 |
|||
that.cropper.imgReset(); |
|||
that.src= tempFilePaths |
|||
} |
|||
}) |
|||
}, |
|||
setWidth(e) { |
|||
|
|||
this.width= e.detail.value < 10 ? 10 : e.detail.value |
|||
|
|||
|
|||
this.cut_left= this.cropper.data.cut_left |
|||
|
|||
}, |
|||
setHeight(e) { |
|||
|
|||
this.height= e.detail.value < 10 ? 10 : e.detail.value |
|||
|
|||
|
|||
this.cut_top= this.cropper.data.cut_top |
|||
|
|||
}, |
|||
switchChangeDisableRatio(e) { |
|||
//设置宽度之后使剪裁框居中 |
|||
|
|||
this.disable_ratio= e.detail.value |
|||
|
|||
}, |
|||
setCutTop(e) { |
|||
|
|||
this.cut_top= e.detail.value |
|||
|
|||
|
|||
this.cut_top= this.cropper.data.cut_top |
|||
|
|||
}, |
|||
setCutLeft(e) { |
|||
|
|||
this.cut_left= e.detail.value |
|||
|
|||
|
|||
this.cut_left= this.cropper.data.cut_left |
|||
|
|||
}, |
|||
switchChangeDisableRotate(e) { |
|||
//开启旋转的同时不限制移动 |
|||
if (!e.detail.value) { |
|||
|
|||
this.limit_move= false, |
|||
this.disable_rotate= e.detail.value |
|||
|
|||
} else { |
|||
|
|||
this.disable_rotate= e.detail.value |
|||
|
|||
} |
|||
}, |
|||
switchChangeLimitMove(e) { |
|||
//限制移动的同时锁定旋转 |
|||
if (e.detail.value) { |
|||
|
|||
this.disable_rotate= true |
|||
|
|||
} |
|||
this.cropper.setLimitMove(e.detail.value); |
|||
}, |
|||
switchChangeDisableWidth(e) { |
|||
|
|||
this.disable_width= e.detail.value |
|||
|
|||
}, |
|||
switchChangeDisableHeight(e) { |
|||
|
|||
this.disable_height= e.detail.value |
|||
|
|||
}, |
|||
submit() { |
|||
let that = this; |
|||
this.cropper.getImg((obj) => { |
|||
console.log(obj.url) |
|||
uni.uploadFile({ |
|||
url: 'https://dev.xenjoyou.com/hiver/upload/file', |
|||
filePath: obj.url, |
|||
name: 'file', |
|||
header: { |
|||
"content-type": "multipart/form-data", |
|||
'accessToken': that.tui.getToken() |
|||
}, |
|||
formData: {}, |
|||
success: (uploadFileRes) => { |
|||
|
|||
let path = JSON.parse(uploadFileRes.data) |
|||
console.log(path) |
|||
// let data = { |
|||
// url:path.result, |
|||
// specNum:'' |
|||
// } |
|||
// that.productPicture.push(data) |
|||
let pages = getCurrentPages(); |
|||
let prevPage = pages[pages.length - 2]; |
|||
prevPage.$vm.uploadUrl = path.result |
|||
prevPage.$vm.uploadNum = 1 |
|||
//后端返回的地址,存入图片地址 |
|||
wx.navigateBack({ |
|||
delta: 1 |
|||
}) |
|||
} |
|||
}); |
|||
}); |
|||
}, |
|||
rotate() { |
|||
//在用户旋转的基础上旋转90° |
|||
this.cropper.setAngle(this.cropper.data.angle += 90); |
|||
}, |
|||
top() { |
|||
this.data.top = setInterval(() => { |
|||
this.cropper.setTransform({ |
|||
y: -3 |
|||
}); |
|||
}, 1000 / 60) |
|||
}, |
|||
bottom() { |
|||
this.data.bottom = setInterval(() => { |
|||
this.cropper.setTransform({ |
|||
y: 3 |
|||
}); |
|||
}, 1000 / 60) |
|||
}, |
|||
left() { |
|||
this.data.left = setInterval(() => { |
|||
this.cropper.setTransform({ |
|||
x: -3 |
|||
}); |
|||
}, 1000 / 60) |
|||
}, |
|||
right() { |
|||
this.data.right = setInterval(() => { |
|||
this.cropper.setTransform({ |
|||
x: 3 |
|||
}); |
|||
}, 1000 / 60) |
|||
}, |
|||
narrow() { |
|||
this.data.narrow = setInterval(() => { |
|||
this.cropper.setTransform({ |
|||
scale: -0.02 |
|||
}); |
|||
}, 1000 / 60) |
|||
}, |
|||
enlarge() { |
|||
this.data.enlarge = setInterval(() => { |
|||
this.cropper.setTransform({ |
|||
scale: 0.02 |
|||
}); |
|||
}, 1000 / 60) |
|||
}, |
|||
end(e) { |
|||
clearInterval(this.data[e.currentTarget.dataset.type]); |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.top { |
|||
position: absolute; |
|||
width: 100%; |
|||
top: 10rpx; |
|||
display: flex; |
|||
flex-flow: wrap; |
|||
z-index: 10; |
|||
color: white; |
|||
justify-content: space-around; |
|||
} |
|||
|
|||
.hint { |
|||
position: absolute; |
|||
top: 10rpx; |
|||
width: 100%; |
|||
font-size: 33rpx; |
|||
text-align: center; |
|||
color: white; |
|||
z-index: 10; |
|||
} |
|||
|
|||
page { |
|||
background: white; |
|||
} |
|||
|
|||
view { |
|||
font-size: 30rpx; |
|||
} |
|||
|
|||
.bottom { |
|||
position: absolute; |
|||
width: 100%; |
|||
bottom: 50rpx; |
|||
display: flex; |
|||
z-index: 10; |
|||
justify-content: center; |
|||
align-items: center; |
|||
flex-wrap: wrap; |
|||
height: 210rpx; |
|||
} |
|||
|
|||
button { |
|||
font-size: 27rpx; |
|||
z-index: 2; |
|||
padding: 0 20rpx; |
|||
height: 60rpx; |
|||
min-width: 70rpx; |
|||
margin: 0 4rpx; |
|||
} |
|||
|
|||
.input { |
|||
display: flex; |
|||
height: 50rpx; |
|||
width: 50%; |
|||
} |
|||
|
|||
.input>.label { |
|||
min-width: 150rpx; |
|||
font-size: 30rpx; |
|||
height: 50rpx; |
|||
line-height: 50rpx; |
|||
} |
|||
|
|||
.input>input { |
|||
margin-left: 10rpx; |
|||
text-align: center; |
|||
max-width: 160rpx; |
|||
border: 1px solid rgb(255, 255, 255); |
|||
height: 50rpx; |
|||
line-height: 50rpx; |
|||
min-height: 50rpx; |
|||
box-sizing: border-box; |
|||
} |
|||
</style> |
|||
Binary file not shown.
@ -0,0 +1,355 @@ |
|||
<!-- 底部菜单--库存--新增商品 --> |
|||
<template> |
|||
<view> |
|||
<view class="formBox"> |
|||
<uni-forms ref="form" :modelValue="formData" :rules="rules" labelWidth="85px"> |
|||
<uni-forms-item label="商品名称" name="productName" required> |
|||
<uni-easyinput type="text" v-model="formData.productName" placeholder="请输入商品名称" trim="all" /> |
|||
</uni-forms-item> |
|||
<uni-forms-item label="商品图片" name="productPicture"> |
|||
<view v-if="formData.productPicture !=''"> |
|||
<img :src="formData.productPicture" alt="" class="upload-img"> |
|||
</view> |
|||
<u-upload :fileList="formData.productPicture" @afterRead="afterRead" @delete="deletePic" name="1" multiple |
|||
:maxCount="1"></u-upload> |
|||
</uni-forms-item> |
|||
<uni-forms-item label="货号" name="productSn" required> |
|||
<uni-easyinput type="text" v-model="formData.productSn" @blur="getSnIsRepeat" placeholder="请输入货号" trim="all" /> |
|||
</uni-forms-item> |
|||
<uni-forms-item label="商品条码" name="barcode"> |
|||
<uni-easyinput type="text" v-model="formData.barcode" placeholder="可以扫码商品条码添加" trim="all" /> |
|||
<u-icon name="camera" size="36" @tap.stop='scanCodeAdd'></u-icon> |
|||
</uni-forms-item> |
|||
<uni-forms-item label="批发价" name="wholesalePrice" required> |
|||
<uni-easyinput type="digit" v-model="formData.wholesalePrice" placeholder="请输入批发价" trim="all" /> |
|||
</uni-forms-item> |
|||
<uni-forms-item label="市场价" name="price" required> |
|||
<uni-easyinput type="digit" v-model="formData.price" placeholder="请输入零售价" trim="all" /> |
|||
</uni-forms-item> |
|||
<uni-forms-item label="分类" name="categoryId" required v-if="dataList == ''"> |
|||
<!-- <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="list-val"> |
|||
<input type="text" placeholder="请选择分类" disabled :value="typeItem.categoryName" |
|||
style="border-bottom: 1px solid #fff;text-align: center;" |
|||
@tap="goGategoryLow"> |
|||
<uni-icons type="right" size="16" |
|||
style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons> |
|||
</view> |
|||
</view> |
|||
</uni-forms-item> |
|||
<uni-forms-item label="尾货预警" name="salesWeek"> |
|||
<!-- <uni-easyinput type="digit" v-model="formData.salesWeek" placeholder="请输入零售价" trim="all" /> --> |
|||
<uni-datetime-picker type="date" :clear-icon="false" v-model="formData.salesWeek" /> |
|||
</uni-forms-item> |
|||
<uni-forms-item label="库存预警" name="tailWarn"> |
|||
<uni-easyinput type="digit" v-model="formData.tailWarn" placeholder="请设置库存预警最低件数" trim="all" /> |
|||
</uni-forms-item> |
|||
<uni-forms-item label="货品简介" name="productIntro"> |
|||
<uni-easyinput type="textarea" autoHeight v-model="formData.productIntro" placeholder="请输入货品简介" |
|||
trim="all" /> |
|||
</uni-forms-item> |
|||
</uni-forms> |
|||
<view v-if="type == 'edit'" style="display: flex;"> |
|||
<button @tap.stop="submit()" style="width: 95%;">保存</button> |
|||
</view> |
|||
<view v-else> |
|||
<button @tap.stop="submit()">保存</button> |
|||
</view> |
|||
</view> |
|||
<!-- <u-modal v-model="show" :content="content"></u-modal> --> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
fileList1: [], |
|||
formData: { |
|||
productName: '', |
|||
price: '', |
|||
productSn: '', |
|||
wholesalePrice: '', |
|||
productPicture: [], |
|||
productIntro: '', |
|||
categoryId: '', |
|||
salesWeek: '', |
|||
tailWarn: '', |
|||
barcode:'' |
|||
}, |
|||
categoryList: [], |
|||
productId:'', |
|||
arrtList: [], |
|||
typeItem:{}, |
|||
arrtChange: [], |
|||
categoryId:'', |
|||
dataList:[], |
|||
type:'add', |
|||
rules: { |
|||
categoryId: { |
|||
rules: [{ |
|||
required: true, |
|||
errorMessage: '请选择商品分类', |
|||
}, ], |
|||
}, |
|||
price: { |
|||
rules: [{ |
|||
required: true, |
|||
errorMessage: '请填写市场价', |
|||
}, ], |
|||
}, |
|||
wholesalePrice: { |
|||
rules: [{ |
|||
required: true, |
|||
errorMessage: '请填写批发价', |
|||
}, ], |
|||
}, |
|||
productSn: { |
|||
rules: [{ |
|||
required: true, |
|||
errorMessage: '请填写货号', |
|||
}, ], |
|||
}, |
|||
productName: { |
|||
rules: [{ |
|||
required: true, |
|||
errorMessage: '请填写商品名称', |
|||
}, ], |
|||
} |
|||
// tailWarn: { |
|||
// rules: [{ |
|||
// required: true, |
|||
// errorMessage: '请填写库存预警天数', |
|||
// }, ], |
|||
// }, |
|||
// salesWeek: { |
|||
// rules: [{ |
|||
// required: true, |
|||
// errorMessage: '请选择尾货预警天数', |
|||
// }, ], |
|||
// } |
|||
} |
|||
} |
|||
}, |
|||
onShow(){ |
|||
let that = this; |
|||
this.typeItem = JSON.parse(JSON.stringify(this.typeItem)) || '' |
|||
if(this.typeItem){ |
|||
this.formData.categoryId = this.typeItem.id |
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
if(option.dataList){ |
|||
this.type = 'edit' |
|||
this.dataList = JSON.parse(option.dataList) |
|||
this.formData.productName = this.dataList.productName |
|||
this.formData.barcode = this.dataList.barcode |
|||
this.formData.price = this.dataList.price |
|||
this.formData.productSn = this.dataList.productSn |
|||
this.formData.wholesalePrice = this.dataList.wholesalePrice |
|||
this.formData.productPicture = this.dataList.productPicture |
|||
this.formData.productIntro = this.dataList.productIntro |
|||
this.formData.categoryId = this.dataList.categoryId |
|||
this.formData.salesWeek = this.dataList.salesWeek |
|||
this.formData.tailWarn = this.dataList.tailWarn |
|||
} |
|||
}, |
|||
methods: { |
|||
// 删除图片 |
|||
deletePic(event) { |
|||
this[`fileList${event.name}`].splice(event.index, 1) |
|||
}, |
|||
// 新增图片 |
|||
async afterRead(event) { |
|||
|
|||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式 |
|||
let lists = [].concat(event.file) |
|||
if (this.formData.productPicture == undefined) this.formData.productPicture = []; |
|||
let fileListLen = this[`fileList${event.name}`].length |
|||
|
|||
lists.map((item) => { |
|||
this[`fileList${event.name}`].push({ |
|||
...item, |
|||
status: 'uploading', |
|||
message: '上传中' |
|||
}) |
|||
}) |
|||
|
|||
for (let i = 0; i < lists.length; i++) { |
|||
const result = await this.uploadFilePromise(lists[i].url) |
|||
let item = this[`fileList${event.name}`][fileListLen] |
|||
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, { |
|||
status: 'success', |
|||
message: '', |
|||
url: result |
|||
})) |
|||
fileListLen++ |
|||
} |
|||
}, |
|||
uploadFilePromise(url) { |
|||
|
|||
return new Promise((resolve, reject) => { |
|||
let a = uni.uploadFile({ |
|||
url: 'https://storage.xenjoyou.com/hiver/upload/file', |
|||
filePath: url, |
|||
name: 'file', |
|||
header: { |
|||
"content-type": "multipart/form-data", |
|||
'accessToken': this.tui.getToken() |
|||
}, |
|||
formData: {}, |
|||
success: (uploadFileRes) => { |
|||
|
|||
let path = JSON.parse(uploadFileRes.data) |
|||
//后端返回的地址,存入图片地址 |
|||
this.formData.productPicture = path.result |
|||
} |
|||
}); |
|||
}) |
|||
}, |
|||
categoryChange(e) { |
|||
this.categoryId = e |
|||
}, |
|||
//货号是否重复 |
|||
getSnIsRepeat(){ |
|||
this.tui.request('/app/product/getByProductSn', "post", { |
|||
productSn:this.formData.productSn |
|||
}, false, true).then((res1) => { |
|||
if (res1.code == 200) { |
|||
if(res1.result != ''){ |
|||
this.tui.toast('当前货号已被商品:“'+res1.result[0].productName+'”占用,请重新输入') |
|||
this.formData.productSn = '' |
|||
} |
|||
|
|||
} |
|||
}) |
|||
}, |
|||
// 触发提交表单 |
|||
submit() { |
|||
let that = this; |
|||
let url = '' |
|||
this.$refs.form.validate().then(res => { |
|||
if(that.dataList !=''){ |
|||
url = '/app/product/edit' |
|||
res.id = that.dataList.id |
|||
}else{ |
|||
url = '/app/product/save' |
|||
} |
|||
if(res.productPicture == ''){ |
|||
res.productPicture = '' |
|||
} |
|||
that.tui.request(url, "post", res, false, false).then((res1) => { |
|||
if (res1.code == 200) { |
|||
uni.navigateBack({ |
|||
delta: 1 |
|||
}) |
|||
} else { |
|||
uni.showToast({ |
|||
title: "添加失败", |
|||
icon: 'none' |
|||
}) |
|||
} |
|||
}) |
|||
}).catch(err => { |
|||
|
|||
}) |
|||
}, |
|||
//跳转分类页 |
|||
goGategoryLow() { |
|||
uni.navigateTo({ |
|||
url: '/pages/inventory/gategory' |
|||
}) |
|||
}, |
|||
scanCodeAdd() { |
|||
let that = this; |
|||
uni.scanCode({ |
|||
scanType: ['barCode'], |
|||
success: (res) => { |
|||
console.log(res) |
|||
that.tui.request('/app/product/getByBarcode', "post", { |
|||
barcode:res.result |
|||
}, false, true).then((res1) => { |
|||
if (res1.code == 200) { |
|||
if(res1.result != ''){ |
|||
that.tui.toast('当前条码已被商品:“'+res1.result[0].productName+'”占用,请重新输入') |
|||
}else{ |
|||
that.formData.barcode = res.result; |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
fail: (res) => { |
|||
uni.showToast({ |
|||
title: '扫描失败', |
|||
icon: 'none' |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.list-val { |
|||
width: 486rpx; |
|||
height: 70rpx; |
|||
line-height: 70rpx; |
|||
} |
|||
|
|||
.list-val input { |
|||
width: 400rpx; |
|||
height: 70rpx; |
|||
display: inline-block; |
|||
line-height: 70rpx; |
|||
text-align: left !important; |
|||
padding-left: 20rpx; |
|||
float: left; |
|||
font-size: 25rpx; |
|||
} |
|||
.formBox { |
|||
margin: 20rpx; |
|||
padding: 20rpx 26rpx; |
|||
border-radius: 14rpx; |
|||
box-shadow: 0px 1px 10px 2px #e2e2e2; |
|||
background-color: #fff; |
|||
|
|||
.uni-data-select { |
|||
width: 100%; |
|||
} |
|||
|
|||
.attrs { |
|||
text { |
|||
display: inline-block; |
|||
border: 1px solid $u-primary; |
|||
padding: 7px 20rpx; |
|||
margin: 20rpx; |
|||
background-color: #fff; |
|||
color: $u-primary; |
|||
} |
|||
|
|||
.checkedText { |
|||
background-color: $u-primary; |
|||
color: #fff; |
|||
} |
|||
} |
|||
} |
|||
.upload-img{ |
|||
width: 160rpx; |
|||
height: 160rpx; |
|||
} |
|||
.content-list { |
|||
height: 70rpx; |
|||
border: 1px solid #eee; |
|||
} |
|||
button{ |
|||
height: 90rpx; |
|||
line-height: 90rpx; |
|||
font-size: 36rpx; |
|||
color: #fff; |
|||
background: #5fd9ee; |
|||
border-radius: 10px; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,675 @@ |
|||
<template> |
|||
<view class="page1"> |
|||
<!-- <view class="title-box"> |
|||
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入商品名称" cancelButton="none" @confirm="search" /> |
|||
</view> --> |
|||
<view class="content-box" :style="{height:height - 120 + 'rpx'}" v-if="purchase != ''"> |
|||
<view class="content-right"> |
|||
<view class="right-box" v-for="(item,index) in goodsList" :key="index"> |
|||
<view class="box-left"> |
|||
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture"> |
|||
<view class="noPic" v-else>暂无图片</view> |
|||
</view> |
|||
<view class="box-right"> |
|||
<view class="box-right-name">{{item.productName}}</view> |
|||
<view class="box-right-num">{{item.productSn}}</view> |
|||
<view class="box-right-price" v-if="item.wholesalePrice"> |
|||
<view class="price-box"> |
|||
<text>{{item.wholesalePrice}}</text> |
|||
<text>批发价</text> |
|||
</view> |
|||
<view class="price-box"> |
|||
<text>{{item.lsprice}}</text> |
|||
<tclass售价</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<checkbox-group @tap="goInvPrint(item)" v-if="item.wholesalePrice"> |
|||
<label> |
|||
<checkbox :checked="item.checked" class="checkbox" /> |
|||
</label> |
|||
</checkbox-group> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="content-box" :style="{height:height - 120 + 'rpx'}" v-else> |
|||
<view class="content-left"> |
|||
<view class="left-box" v-for="(item, index) in indexList" :key="index" |
|||
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)"> |
|||
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;" |
|||
:class="item.parentId ? 'red' :''">{{item.categoryName}}</text> |
|||
</view> |
|||
</view> |
|||
<view class="content-right"> |
|||
<view class="right-box" v-for="(item,index) in goodsList" :key="index" v-if="item.delFlag"> |
|||
<view class="box-left"> |
|||
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture"> |
|||
<view class="noPic" v-else>暂无图片</view> |
|||
</view> |
|||
<view class="box-right"> |
|||
<view class="box-right-name">{{item.productName}}</view> |
|||
<view class="box-right-num">{{item.productSn}}</view> |
|||
<view class="box-right-price" v-if="item.wholesalePrice"> |
|||
<view class="price-box"> |
|||
<text>{{item.wholesalePrice}}</text> |
|||
<text>批发价</text> |
|||
</view> |
|||
<view class="price-box"> |
|||
<text>{{item.price}}</text> |
|||
<text>零售价</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<checkbox-group @tap="checkboxChange(item)" v-if="item.wholesalePrice"> |
|||
<label> |
|||
<checkbox :checked="item.checked" class="checkbox" /> |
|||
</label> |
|||
</checkbox-group> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="bottom-box"> |
|||
<view class="bottom-right"> |
|||
<button class="bottom-btn" @tap="clickPrint">批量打印</button> |
|||
</view> |
|||
</view> |
|||
<!-- 弹出输入框 --> |
|||
<uni-popup ref="payDialog" background-color="#fff"> |
|||
<view class="popup-pay-content"> |
|||
<view class="popup-pay-title"> |
|||
<text>已选商品</text> |
|||
</view> |
|||
<view v-for="(item,index) in carList"> |
|||
<view class="box-right"> |
|||
<text class="box-right-name" style="font-size: 24rpx;">{{item.productName}}</text> |
|||
<text class="box-right-num">({{item.productSn}})</text> |
|||
</view> |
|||
</view> |
|||
<view class="popup-pay-title" style="margin-top: 50rpx;"> |
|||
<text>请选择需要打印的字段</text> |
|||
</view> |
|||
<view class="content-fur"> |
|||
<view class="content-low" v-for="(item1,index1) in list" :key="index1" |
|||
@tap.stop="addMultipleType(item1)" :class="item1.checked?'checked':''">{{item1.type}}</view> |
|||
</view> |
|||
<view class="popup-pay-container" > |
|||
<kk-printer ref="kkprinter" :bufferData="bufferData" @goPrint="goPrint" :defaultText="'确认打印'"></kk-printer> |
|||
</view> |
|||
</view> |
|||
</uni-popup> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/components/kk-printer/utils/util.js'; |
|||
import * as blesdk from '@/components/kk-printer/utils/bluetoolth.js'; |
|||
import kkPrinter from '@/components/kk-printer/index.vue'; |
|||
export default { |
|||
data() { |
|||
return { |
|||
indexList: [], |
|||
pageNum: 1, //分页的页码 |
|||
shopList: [], |
|||
goodsList: [], |
|||
categoryId: '', //分类id |
|||
searchName: '', //搜索框输入值 |
|||
id: '', |
|||
carList: [], |
|||
type: '', |
|||
bufferData:[], |
|||
checkPayData:'', |
|||
data:{}, |
|||
height:0, |
|||
list:[{ |
|||
type:'供应商', |
|||
checked:false, |
|||
},{ |
|||
type:'货号', |
|||
checked:false, |
|||
},{ |
|||
type:'零售价', |
|||
checked:false, |
|||
},{ |
|||
type:'批发价', |
|||
checked:false, |
|||
}], |
|||
multipleList:[], |
|||
purchase:'' |
|||
} |
|||
}, |
|||
components: { |
|||
kkPrinter |
|||
}, |
|||
onLoad(options) { |
|||
this.height = wx.getSystemInfoSync().windowHeight |
|||
if (options.khid != undefined) { |
|||
uni.redirectTo({ |
|||
url: "/pages/index/downStearmList?khid=" + options.khid |
|||
}) |
|||
}else{ |
|||
if(options.purchase){ |
|||
this.purchase = JSON.parse(options.purchase) |
|||
this.goodsList = JSON.parse(options.purchaseDetails) |
|||
|
|||
console.log("新增入库打印"); |
|||
console.log(this.goodsList); |
|||
}else{ |
|||
console.log("普通批量打印"); |
|||
this.type = uni.getStorageSync('type') |
|||
this.getGategoryList() |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
//初始化获取分类列表 |
|||
getGategoryList() { |
|||
this.shopList = [] |
|||
this.indexList = [] |
|||
this.goodsList = [] |
|||
this.tui.request("/app/productCategory/list", "get", {}, false, true).then((res) => { |
|||
if (res.code == 200) { |
|||
this.indexList = res.result; |
|||
for (var i = 0; i < this.indexList.length; i++) { |
|||
if (i == 0) { |
|||
this.indexList[i].parentId = true |
|||
} else { |
|||
this.indexList[i].parentId = false |
|||
} |
|||
let data = { |
|||
categoryId: this.indexList[i].id |
|||
} |
|||
this.shopList.push(data) |
|||
this.categoryId = this.indexList[i].id |
|||
this.getShareList(this.indexList[i].id) |
|||
|
|||
} |
|||
} else { |
|||
this.tui.toast(res.message) |
|||
} |
|||
}).catch((res) => {}) |
|||
}, |
|||
//点击分类获取商品列表 |
|||
getShareList(id) { |
|||
this.tui.request("/app/product/getShareList", "POST", { |
|||
categoryId: id, |
|||
searchStr: this.searchName, |
|||
pageNum: this.pageNum, |
|||
pageSize: '100' |
|||
}, false, false).then((res) => { |
|||
if (res.code == 200) { |
|||
for (var i = 0; i < this.shopList.length; i++) { |
|||
if(res.result.records != []){ |
|||
if(this.shopList[i].categoryId == res.result.records[0].categoryId){ |
|||
this.shopList[i] = res.result.records |
|||
} |
|||
}else{ |
|||
this.shopList[i] = [] |
|||
} |
|||
|
|||
} |
|||
this.goodsList = this.shopList[0] |
|||
} else { |
|||
this.tui.toast(res.message) |
|||
} |
|||
}).catch((res) => {}) |
|||
}, |
|||
//顶部搜索框 |
|||
search(res) { |
|||
this.searchName = res.value |
|||
this.getGategoryList() |
|||
}, |
|||
//未入库遮罩 |
|||
clickMask() { |
|||
uni.showToast({ |
|||
title: '请将商品上架或入库后再操作!', |
|||
icon: 'none' |
|||
}) |
|||
}, |
|||
//点击左侧菜单切换 |
|||
clickLeftBtn(index) { |
|||
for (var i = 0; i < this.indexList.length; i++) { |
|||
if (i == index) { |
|||
this.indexList[i].parentId = true |
|||
} else { |
|||
this.indexList[i].parentId = false |
|||
} |
|||
} |
|||
this.categoryId = this.shopList[index].id |
|||
this.goodsList = this.shopList[index] |
|||
}, |
|||
goInvPrint(item){ |
|||
item.checked = !item.checked |
|||
if(this.carList == ''){ |
|||
this.carList.push(item) |
|||
}else{ |
|||
for(let i=0;i<this.carList.length;i++){ |
|||
if(this.carList[i].productId == item.productId){ |
|||
this.carList.splice(i, 1) |
|||
return; |
|||
}else{ |
|||
if(i+1 == this.carList.length){ |
|||
this.carList.push(item) |
|||
return; |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
|||
console.log(this.carList) |
|||
}, |
|||
//选中商品 |
|||
checkboxChange(item) { |
|||
item.checked = !item.checked |
|||
if(this.carList == ''){ |
|||
this.carList.push(item) |
|||
}else{ |
|||
for(let i=0;i<this.carList.length;i++){ |
|||
if(this.carList[i].id == item.id){ |
|||
this.carList.splice(i, 1) |
|||
return; |
|||
}else{ |
|||
if(i+1 == this.carList.length){ |
|||
this.carList.push(item) |
|||
return; |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
|||
console.log(this.carList) |
|||
}, |
|||
//点击批量打印按钮 |
|||
clickPrint() { |
|||
this.$refs.payDialog.open('center') |
|||
}, |
|||
checkPay(type){ |
|||
this.data.priceType = type |
|||
this.tui.request("/app/productShare/save", "POST", this.data, false, true).then((res) => { |
|||
if (res.code == 200) { |
|||
this.khid = res.result.id |
|||
|
|||
} else { |
|||
this.tui.toast(res.message) |
|||
} |
|||
}).catch((res) => {}) |
|||
this.checkPayData = type |
|||
this.$refs.payDialog.close() |
|||
this.$refs.share.open() |
|||
}, |
|||
//选择多个规格保存 |
|||
addMultipleType(item1){ |
|||
|
|||
item1.checked = !item1.checked |
|||
if(this.multipleList == ''){ |
|||
this.multipleList.push(item1.type) |
|||
}else{ |
|||
for(var i=0;i<this.multipleList.length;i++){ |
|||
if(this.multipleList[i] == item1.type){ //相同 |
|||
this.multipleList.splice(i,1) |
|||
return; |
|||
}else{ //不同 |
|||
if(i+1 == this.multipleList.length){ |
|||
this.multipleList.push(item1.type) |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
console.log(this.multipleList); |
|||
}, |
|||
//点击打印按钮 |
|||
goPrint(){ |
|||
uni.setStorageSync('small',true) |
|||
let that = this; |
|||
for(var i=0;i<that.carList.length;i++){ |
|||
let item = that.carList[i] |
|||
let strCmd = blesdk.CreatCPCLPage(440, 320, 1, 0); |
|||
strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, '商品名:'+item.productName) |
|||
if(this.multipleList.indexOf('货号') != -1){ |
|||
console.log(this.multipleList.indexOf('货号')) |
|||
strCmd += blesdk.addCPCLText('0', '80', '24', '0', 0, '货 号:'+item.productSn) |
|||
} |
|||
if(this.multipleList.indexOf('供应商') != -1){ |
|||
console.log(this.multipleList.indexOf('供应商')) |
|||
strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '供应商:'+(this.purchase !=''?this.purchase.supplierName:item.supplierName)) |
|||
} |
|||
if(this.multipleList.indexOf('批发价') != -1){ |
|||
console.log(this.multipleList.indexOf('批发价')) |
|||
strCmd += blesdk.addCPCLText('0', '180', '24', '0', 0, '批发价:'+item.wholesalePrice) |
|||
} |
|||
if(this.multipleList.indexOf('零售价') != -1){ |
|||
console.log(this.multipleList.indexOf('零售价')) |
|||
strCmd += blesdk.addCPCLText('0', '230', '24', '0', 0, '零售价:'+(this.purchase !=''?item.lsprice:item.price)) |
|||
} |
|||
strCmd += blesdk.addCPCLQRCode(200, 140, 'H', '1', 6, [item.id,item.shopId]) //二维码 |
|||
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 |
|||
strCmd += blesdk.addCPCLPrint(); |
|||
this.bufferData.push(strCmd); |
|||
this.$refs.payDialog.close(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
page { |
|||
height: 100%; |
|||
} |
|||
|
|||
.page1 { |
|||
display: flex; |
|||
flex-direction: column; |
|||
height: 92%; |
|||
} |
|||
|
|||
.uni-tab__dot { |
|||
padding: 0 4px; |
|||
line-height: 15px; |
|||
color: #ffffff; |
|||
text-align: center; |
|||
font-size: 12px; |
|||
background-color: #ff0000; |
|||
border-radius: 15px; |
|||
} |
|||
|
|||
.uni-tab__text { |
|||
font-size: 12px; |
|||
color: #646566; |
|||
} |
|||
|
|||
.title-box { |
|||
background: #fff; |
|||
position: fixed; |
|||
z-index: 99; |
|||
width: 100%; |
|||
top: 0; |
|||
} |
|||
|
|||
.bottom-box { |
|||
width: 100%; |
|||
height: 120rpx; |
|||
position: fixed; |
|||
bottom: 0; |
|||
display: flex; |
|||
background: #fff; |
|||
z-index: 98; |
|||
} |
|||
|
|||
.bottom-left { |
|||
width: 15%; |
|||
position: relative; |
|||
} |
|||
|
|||
.bottom-right { |
|||
width: 100%; |
|||
display: flex; |
|||
|
|||
.bottom-btn { |
|||
margin: 0 auto; |
|||
padding: 0; |
|||
width: 90%; |
|||
line-height: 80rpx; |
|||
height: 80rpx; |
|||
text-align: center; |
|||
margin-top: 10rpx; |
|||
color: #fff; |
|||
font-size: 28rpx; |
|||
background: linear-gradient(90deg, #60F3FF, #088FEB); |
|||
border-radius: 5px; |
|||
} |
|||
} |
|||
|
|||
.bottom-left-box { |
|||
display: flex; |
|||
flex-direction: column; |
|||
text-align: center; |
|||
} |
|||
|
|||
.content-box { |
|||
background: #fff; |
|||
flex: 1; |
|||
display: flex; |
|||
overflow: scroll; |
|||
} |
|||
|
|||
.content-left { |
|||
width: 170rpx; |
|||
background: #eee; |
|||
height: 100%; |
|||
overflow: scroll; |
|||
} |
|||
|
|||
.left-box { |
|||
width: 100%; |
|||
height: 90rpx; |
|||
font-size: 30rpx; |
|||
text-align: center; |
|||
line-height: 90rpx; |
|||
border-bottom: 1px solid #fff; |
|||
} |
|||
|
|||
.left-box-hover { |
|||
width: 100%; |
|||
height: 90rpx; |
|||
font-size: 30rpx; |
|||
text-align: center; |
|||
line-height: 90rpx; |
|||
border-bottom: 1px solid #fff; |
|||
background-color: #fff; |
|||
} |
|||
|
|||
.red { |
|||
border-right: 3px solid red; |
|||
} |
|||
|
|||
.content-right { |
|||
flex: 1; |
|||
overflow-y: scroll; |
|||
} |
|||
|
|||
.right-box { |
|||
width: 100%; |
|||
height: 190rpx; |
|||
display: flex; |
|||
border-bottom: 1px solid #eee; |
|||
position: relative; |
|||
} |
|||
|
|||
.box-left { |
|||
width: 130rpx; |
|||
height: 131rpx; |
|||
background-size: 100%; |
|||
margin: 25rpx 30rpx 35rpx 10rpx; |
|||
border-radius: 20rpx; |
|||
} |
|||
|
|||
.box-left img { |
|||
width: 100%; |
|||
height: 100%; |
|||
|
|||
} |
|||
|
|||
.box-right { |
|||
margin-top: 17rpx; |
|||
} |
|||
|
|||
.box-right-name { |
|||
font-size: 30rpx; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.box-right-num { |
|||
padding: 5rpx 0; |
|||
color: #777; |
|||
} |
|||
|
|||
.box-right-price { |
|||
display: flex; |
|||
font-size: 25rpx; |
|||
} |
|||
|
|||
.checkbox { |
|||
width: 40rpx; |
|||
height: 40rpx; |
|||
position: absolute; |
|||
top: 20rpx; |
|||
right: 30rpx; |
|||
} |
|||
|
|||
.price-box { |
|||
display: flex; |
|||
flex-direction: column; |
|||
margin-right: 20rpx; |
|||
} |
|||
|
|||
.price-box text:first-child { |
|||
color: #ffa200 |
|||
} |
|||
|
|||
.uni-tab__cart-button-right, |
|||
.uni-tab__cart-sub-right { |
|||
display: none; |
|||
flex: none; |
|||
} |
|||
|
|||
.popup-content { |
|||
align-items: center; |
|||
justify-content: center; |
|||
padding: 15px; |
|||
height: 1200rpx; |
|||
background-color: #fff; |
|||
margin-bottom: 30rpx; |
|||
overflow: scroll; |
|||
} |
|||
|
|||
.popup-title-right-box { |
|||
height: 50rpx; |
|||
line-height: 50rpx; |
|||
} |
|||
|
|||
.popup-title-right { |
|||
width: 400rpx; |
|||
margin-left: 30rpx; |
|||
} |
|||
|
|||
.popup-title-left { |
|||
width: 150rpx; |
|||
height: 150rpx; |
|||
} |
|||
|
|||
.popup-title-left image { |
|||
width: 150rpx; |
|||
height: 150rpx; |
|||
|
|||
} |
|||
|
|||
.popup-title { |
|||
display: flex; |
|||
height: 180rpx; |
|||
border-bottom: 1px solid #eee; |
|||
margin-top: 20rpx; |
|||
} |
|||
|
|||
.popup-bottom { |
|||
width: 95%; |
|||
height: 100rpx; |
|||
position: fixed; |
|||
bottom: 0; |
|||
left: 2.5%; |
|||
display: flex; |
|||
z-index: 99; |
|||
background: #fff; |
|||
} |
|||
|
|||
.popup-bottom-left { |
|||
width: 50%; |
|||
line-height: 80rpx; |
|||
} |
|||
|
|||
.popup-bottom-right { |
|||
width: 50%; |
|||
line-height: 100rpx; |
|||
|
|||
.bottom-btn { |
|||
width: 70%; |
|||
line-height: 35px; |
|||
height: 70rpx; |
|||
text-align: center; |
|||
/* margin-top: 10rpx; */ |
|||
color: #fff; |
|||
font-size: 28rpx; |
|||
margin: 0 auto; |
|||
background: linear-gradient(90deg, #60F3FF, #088FEB); |
|||
border-radius: 70rpx; |
|||
} |
|||
} |
|||
|
|||
.shop-mask { |
|||
width: 100%; |
|||
height: 190rpx; |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
background: rgba(0, 0, 0, 0.1); |
|||
z-index: 99; |
|||
} |
|||
.popup-pay-content { |
|||
align-items: center; |
|||
justify-content: center; |
|||
padding: 15px; |
|||
width: 500rpx; |
|||
height: auto; |
|||
max-height: 1000rpx; |
|||
overflow: scroll; |
|||
background-color: #fff; |
|||
} |
|||
.popup-pay-title { |
|||
font-size: 30rpx; |
|||
font-weight: bold; |
|||
text-align: center; |
|||
position: relative; |
|||
border-bottom: 1px solid #eee; |
|||
padding-bottom: 20rpx; |
|||
} |
|||
.popup-pay-container { |
|||
margin-top: 20rpx; |
|||
height: 100rpx; |
|||
border-radius: 10px; |
|||
background: #088FEB; |
|||
line-height: 100rpx; |
|||
text-align: center; |
|||
border-bottom: 1px solid #eee; |
|||
border-top: 1px solid #eee; |
|||
color: #fff; |
|||
} |
|||
.noPic{ |
|||
border-radius: 10px; |
|||
width: 150rpx; |
|||
height: 150rpx; |
|||
text-align: center; |
|||
line-height: 140rpx; |
|||
color: #777; |
|||
background: #eee; |
|||
} |
|||
.checked{ |
|||
background: #60F3FF; |
|||
color: #fff !important; |
|||
} |
|||
.content-fur { |
|||
padding-bottom: 25rpx; |
|||
} |
|||
|
|||
.content-low { |
|||
width: auto; |
|||
border: 1px solid #eee; |
|||
display: inline-block; |
|||
min-width: 90rpx; |
|||
padding: 5rpx; |
|||
font-size: 35rpx; |
|||
text-align: center; |
|||
color: #777; |
|||
margin: 20rpx 0 0 20rpx; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,313 @@ |
|||
<template> |
|||
<view class="container"> |
|||
<view class="tui-order-item boxbg"> |
|||
<view class="shop-box" v-for="(item,index) in list" :key="index" v-if="type==0"> |
|||
<uni-card :title="'时间:'+ item.createTime" :sub-title="item.userName == null ?'暂无':item.userName"> |
|||
<view class="uni-body" style="text-align: center;">单价:{{item.saleDetailDTOList[0].discountAmount}} 数量:{{item.productCount}}</view> |
|||
<view style="margin: 5px 0;height: 1px;background: #eee;"></view> |
|||
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;"> |
|||
<view style="width: 49%;text-align: center;border-right: 1px solid #eee;">商品规格</view> |
|||
<view style="width: 50%;text-align: center;">总数量</view> |
|||
</view> |
|||
<view v-for="(items,index1) in item.saleDetailDTOList"> |
|||
<view v-for="(data,index2) in items.stockLogList1" style='height: 50rpx;line-height: 50rpx;'> |
|||
<view style="width: 49%;text-align: center;border-right: 1px solid #eee;float: left;"> |
|||
{{data.attributeList | sliceMsg}} |
|||
</view> |
|||
<view style="width: 50%;text-align: center;float: left;"> |
|||
{{data.productCount}} |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</uni-card> |
|||
</view> |
|||
<view class="shop-box" v-for="(item,index3) in list" :key="index3" v-else> |
|||
<uni-card :title="'供应商:'+ (item.purchase.supplierName?item.purchase.supplierName:'暂无')" |
|||
:sub-title="item.purchase.createTime?item.purchase.createTime:'暂无'" > |
|||
<view class="uni-body" style="text-align: center;"><text v-if="userType==0">采购价:{{item.purchaseDetails[0].purchasePrice?item.purchaseDetails[0].purchasePrice:'暂无'}}</text> 总数量:{{item.purchase.totalAmount?item.purchase.totalAmount:'暂无'}}</view> |
|||
<view style="margin: 5px 0;height: 1px;background: #eee;"></view> |
|||
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;"> |
|||
<view style="width: 49%;text-align: center;border-right: 1px solid #eee;">商品规格</view> |
|||
<view style="width: 50%;text-align: center;">总数量</view> |
|||
</view> |
|||
<view v-for="(items,index1) in item.purchaseDetails"> |
|||
<view v-for="(data,index2) in items.stockLogList1" style='height: 50rpx;line-height: 50rpx;'> |
|||
<view style="width: 49%;text-align: center;border-right: 1px solid #eee;float: left;"> |
|||
{{data.attributeList | sliceMsg}} |
|||
</view> |
|||
<view style="width: 50%;text-align: center;float: left;"> |
|||
{{data.productCount}} |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</uni-card> |
|||
</view> |
|||
</view> |
|||
<u-loadmore :status="status" /> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
list:[], |
|||
status: 'loadmore', |
|||
pages: 1, |
|||
pageNum: 1, |
|||
productId:'', |
|||
type:'', |
|||
userType:'' |
|||
} |
|||
}, |
|||
filters: { |
|||
sliceMsg(val) { |
|||
var name = '' |
|||
if (typeof(val) == 'string') { |
|||
let newObj = JSON.parse(val) |
|||
for (let as in newObj) { |
|||
name += newObj[as] + '/' |
|||
} |
|||
} |
|||
return name; |
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
this.productId = option.id |
|||
this.userType = uni.getStorageSync('type') |
|||
this.type = option.type |
|||
this.getWaitStorage() |
|||
}, |
|||
onReachBottom() { |
|||
if (this.pages >= this.pageNum) return; |
|||
this.status = 'loading'; |
|||
this.pages = ++this.pages; |
|||
this.getWaitStorage(); |
|||
}, |
|||
methods: { |
|||
getWaitStorage(id) { |
|||
this.status = 'loading'; |
|||
var url; |
|||
if(this.type==0){ //销售 |
|||
url = "/app/sale/getSaleListByProductId" |
|||
}else{ //入库 |
|||
url = "/app/purchase/getPurchaseListByProductId" |
|||
} |
|||
this.tui.request(url, "post", { |
|||
productId: this.productId, |
|||
pageSize: 10, |
|||
pageNum: this.pageNum |
|||
}, false, false).then((res) => { |
|||
this.status = 'nomore'; |
|||
if (res.code == 200) { |
|||
// this.list = res.result.records |
|||
if (this.pages == 1) { |
|||
this.list = res.result.records |
|||
} else { |
|||
this.list = [...this.list, ...res.result.records] |
|||
|
|||
} |
|||
this.pageNum = res.result.pages |
|||
} else { |
|||
this.tui.toast(res.message) |
|||
} |
|||
}).catch((res) => {}) |
|||
} |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.uni-card__header-box{ |
|||
text-align: center !important; |
|||
} |
|||
.uni-card__header-content-title{ |
|||
font-weight: bold; |
|||
} |
|||
.container { |
|||
padding-bottom: 118rpx; |
|||
|
|||
.boxbg { |
|||
padding-top: 10rpx; |
|||
background-color: #fff; |
|||
margin: 30upx; |
|||
border-radius: 10upx; |
|||
box-shadow: 0px 1px 10px 2px #e2e2e2; |
|||
} |
|||
|
|||
.tui-order-item { |
|||
.u-collapse-content { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
line-height: 30px; |
|||
} |
|||
|
|||
|
|||
.tui-goods-info { |
|||
width: 100%; |
|||
box-sizing: border-box; |
|||
background: #fff; |
|||
line-height: 26px; |
|||
border-top: 10px solid #eee; |
|||
|
|||
.tui-price-flex { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
} |
|||
|
|||
.tui-size32 { |
|||
font-size: 32rpx; |
|||
font-weight: 500; |
|||
} |
|||
|
|||
.tui-size-24 { |
|||
font-size: 24rpx; |
|||
} |
|||
|
|||
.tui-price-large { |
|||
font-size: 32rpx; |
|||
.lineText { |
|||
text-decoration: line-through; |
|||
font-size: 12px; |
|||
color: #888; |
|||
} |
|||
} |
|||
|
|||
.tui-flex-shrink { |
|||
flex-shrink: 0; |
|||
} |
|||
|
|||
.tui-goods-price { |
|||
width: 100%; |
|||
display: flex; |
|||
align-items: flex-end; |
|||
justify-content: flex-end; |
|||
font-size: 24rpx; |
|||
} |
|||
|
|||
.tui-primary-color { |
|||
color: #EB0909; |
|||
} |
|||
|
|||
.tui-pbtm20 { |
|||
padding-bottom: 20rpx; |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
|||
|
|||
.tui-tabbar { |
|||
width: 100%; |
|||
height: 98rpx; |
|||
background: #fff; |
|||
position: fixed; |
|||
left: 0; |
|||
bottom: 0; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: flex-end; |
|||
font-size: 26rpx; |
|||
box-shadow: 0 0 1px rgba(0, 0, 0, .3); |
|||
padding-bottom: env(safe-area-inset-bottom); |
|||
z-index: 996; |
|||
} |
|||
|
|||
.tui-btn-mr { |
|||
width:130rpx; |
|||
height: 60rpx; |
|||
background: #088FEB; |
|||
color: #fff; |
|||
border-radius: 10px; |
|||
line-height: 60rpx; |
|||
text-align: center; |
|||
margin-right: 30rpx; |
|||
} |
|||
.shop-box { |
|||
width: 95%; |
|||
margin: 0 auto; |
|||
position: relative; |
|||
} |
|||
.shop-name { |
|||
width: 100%; |
|||
height: 200rpx; |
|||
line-height: 80rpx; |
|||
border-top: 1px solid #eee; |
|||
border-bottom: 1px solid #eee; |
|||
font-size: 28rpx; |
|||
font-weight: bold; |
|||
display: flex; |
|||
.uni-icons { |
|||
color: #088FEB !important; |
|||
} |
|||
} |
|||
|
|||
.shop-productName { |
|||
flex: 1; |
|||
display: flex; |
|||
flex-direction: column; |
|||
padding-left: 20rpx; |
|||
} |
|||
|
|||
.shop-productName view { |
|||
height: 55rpx; |
|||
} |
|||
|
|||
.shop-collapse { |
|||
display: flex; |
|||
height: 80rpx; |
|||
font-size: 26rpx; |
|||
line-height: 80rpx; |
|||
} |
|||
|
|||
.shop-collapse text { |
|||
flex: 1; |
|||
text-align: center; |
|||
padding-right: 40rpx; |
|||
border-right: 1px solid #eee; |
|||
} |
|||
.content-list { |
|||
width: 95%; |
|||
margin: 0 auto; |
|||
display: flex; |
|||
height: 80rpx; |
|||
border-bottom: 1px solid #eee; |
|||
} |
|||
|
|||
.content-list:last-child { |
|||
border-bottom: none; |
|||
height: auto; |
|||
} |
|||
|
|||
.list-name { |
|||
width: 200rpx; |
|||
text-align: left; |
|||
line-height: 40px; |
|||
height: 80rpx; |
|||
padding-left: 20rpx; |
|||
} |
|||
|
|||
.list-val { |
|||
width: 560rpx; |
|||
height: 80rpx; |
|||
line-height: 80rpx; |
|||
} |
|||
|
|||
.list-val input { |
|||
width: 400rpx; |
|||
height: 60rpx; |
|||
display: inline-block; |
|||
line-height: 60rpx; |
|||
float: left; |
|||
margin-top: 10rpx; |
|||
padding-left: 20rpx; |
|||
border-bottom: 1px solid #088FEB; |
|||
} |
|||
textarea { |
|||
margin: 20rpx; |
|||
border: 1px solid #eee; |
|||
height: 150rpx; |
|||
width: 500rpx; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,112 @@ |
|||
<template> |
|||
<view class="container"> |
|||
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(item,index) in shopList" :key="index"> |
|||
<view class="shop-name" style="position: relative;"> |
|||
<img class="img-radius" :src="item.productPicture" alt="" |
|||
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;" v-if="item.productPicture"> |
|||
<view class="noPic" v-else>暂无图片</view> |
|||
<view class="shop-productName"> |
|||
<view style="color:#FF5809;">{{item.productName}} |
|||
({{item.productSn == null ? '暂无':item.productSn}}) |
|||
</view> |
|||
<view>库存总数:{{item.stockCount == null ? '暂无':item.stockCount}}</view> |
|||
<view> |
|||
预警值:{{item.tailWarn == null ? '暂无':item.tailWarn}} |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="shop-type"> |
|||
<view class="shop-collapse" |
|||
v-for="(item1,index1) in item.stockAttributeVoList" :key='index1'> |
|||
<text>{{item1.attributeList | sliceMsg}}</text> |
|||
<text>数量:{{item1.stockCount}}</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
shopList: [] |
|||
} |
|||
}, |
|||
filters: { |
|||
sliceMsg(val) { |
|||
var name = '' |
|||
if (typeof(val) == 'string') { |
|||
let newObj = JSON.parse(val) |
|||
for (let as in newObj) { |
|||
name += newObj[as] + '/' |
|||
} |
|||
} |
|||
return name; |
|||
} |
|||
}, |
|||
onLoad() { |
|||
this.warnList() |
|||
}, |
|||
methods: { |
|||
warnList(){ |
|||
this.tui.request('/app/stock/getTailWarnProduct', 'post', {}, false, false).then(res => { |
|||
if(res.code == 200){ |
|||
this.shopList = res.result |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.container { |
|||
padding-bottom: 118rpx; |
|||
background: #fff; |
|||
} |
|||
.shop-box { |
|||
width: 95%; |
|||
margin: 0 auto; |
|||
} |
|||
.shop-name { |
|||
width: 100%; |
|||
height: 200rpx; |
|||
line-height: 80rpx; |
|||
border-top: 1px solid #eee; |
|||
border-bottom: 1px solid #eee; |
|||
font-size: 28rpx; |
|||
font-weight: bold; |
|||
display: flex; |
|||
} |
|||
.shop-productName { |
|||
flex: 1; |
|||
display: flex; |
|||
flex-direction: column; |
|||
padding-left: 20rpx; |
|||
} |
|||
.shop-productName view { |
|||
height: 55rpx; |
|||
} |
|||
.shop-collapse { |
|||
display: flex; |
|||
height: 80rpx; |
|||
font-size: 26rpx; |
|||
line-height: 80rpx; |
|||
} |
|||
.shop-collapse text { |
|||
flex: 1; |
|||
text-align: center; |
|||
border-right: 1px solid #eee; |
|||
} |
|||
.noPic { |
|||
border-radius: 10px; |
|||
width: 140rpx; |
|||
height: 140rpx; |
|||
margin: 30rpx 0 0 30rpx; |
|||
text-align: center; |
|||
line-height: 140rpx; |
|||
color: #777; |
|||
background: #eee; |
|||
} |
|||
</style> |
|||
Loading…
Reference in new issue