wangfukang 3 years ago
parent
commit
9fb09704e4
  1. BIN
      package1/.DS_Store
  2. 1154
      package1/AI/AIHangOrderList.vue
  3. 12
      package1/AI/AIInventoryList.vue
  4. 179
      package1/AI/AIPicture.vue
  5. 3
      package1/AI/AiChangeGoods.vue
  6. 27
      package1/AI/AiChat.vue
  7. 26
      package1/cropper/cropper.vue
  8. BIN
      package1/inventory/.DS_Store
  9. 2
      package1/inventory/addGoods.vue
  10. 10
      package1/inventory/batchPrint.vue
  11. 9
      package1/inventory/getProductIdToList.vue
  12. 4
      package1/other/logistics.vue

BIN
package1/.DS_Store

Binary file not shown.

1154
package1/AI/AIHangOrderList.vue

File diff suppressed because it is too large

12
package1/AI/AIInventoryList.vue

@ -11,7 +11,7 @@
style="font-size: 40rpx;font-weight: 800;line-height: 56rpx;color: rgba(86, 132, 255, 1);">Hi</text> style="font-size: 40rpx;font-weight: 800;line-height: 56rpx;color: rgba(86, 132, 255, 1);">Hi</text>
</view> </view>
<view class="hello-name"> <view class="hello-name">
你好,田一的店 你好,{{shopName}}
</view> </view>
<view class="hello-right"></view> <view class="hello-right"></view>
@ -56,7 +56,8 @@
return { return {
aiList:[], aiList:[],
carList1:[], carList1:[],
purchaseDetails:[] purchaseDetails:[],
shopName:''
} }
}, },
onPullDownRefresh(){ onPullDownRefresh(){
@ -67,7 +68,7 @@
this.getList() this.getList()
}, },
onLoad() { onLoad() {
this.shopName = uni.getStorageSync('shopName')
}, },
methods: { methods: {
getList(){ getList(){
@ -111,10 +112,11 @@
for(let i=0;i<this.purchaseDetails.length;i++){ for(let i=0;i<this.purchaseDetails.length;i++){
let data = { let data = {
id: this.purchaseDetails[i].id, id: this.purchaseDetails[i].id,
price: this.purchaseDetails[i].price, // price: ,
num: this.purchaseDetails[i].productCount, num: this.purchaseDetails[i].productCount,
wholesalePrice: 0, wholesalePrice: 0,
isNew:true, purchasePrice:this.purchaseDetails[i].price,
isNew: this.purchaseDetails[i].productId==null?true:false,
productId:this.purchaseDetails[i].productId, productId:this.purchaseDetails[i].productId,
productName: this.purchaseDetails[i].productName, productName: this.purchaseDetails[i].productName,
productSn: this.purchaseDetails[i].productSn, productSn: this.purchaseDetails[i].productSn,

179
package1/AI/AIPicture.vue

@ -37,21 +37,32 @@
<uni-icons type="cloud-upload" color="#00BFFF" size="30"></uni-icons> <uni-icons type="cloud-upload" color="#00BFFF" size="30"></uni-icons>
</view> </view>
</view> </view>
<view class="content-list"> <view v-for="(item,index) in purchaseOcrPictureList" :key="index" style="display: flex;width: 100%;overflow: scroll;">
<view class="content-list-img" v-for="(item,index) in purchaseOcrPictureList" :key="index"> <view class="content-list-img">
<view class="del-icon" @tap="delImage(index)"> <view class="del-icon" @tap="delImage(index)">
<uni-icons type="trash" color="#00BFFF" size="20"></uni-icons> <uni-icons type="trash" color="#00BFFF" size="20"></uni-icons>
</view> </view>
<image show-menu-by-longpress :src="item.ocrPicture" @tap="showImage(item.ocrPicture)"></image> <image show-menu-by-longpress :src="item.ocrPicture" @tap="showImage(item.ocrPicture)"></image>
<uni-easyinput type='number' prefixIcon="compose" v-model='item.count' <uni-easyinput type='number' prefixIcon="compose" v-model='item.count'
placeholder="请输入规格数量"></uni-easyinput> placeholder="请输入规格数量"></uni-easyinput>
</view>
<view v-for="(items,indexs) in item.children" :key="indexs" style="width: 200rpx;height: 280rpx;position: relative;background: #fff;margin-left: 20rpx;border-radius: 10px;">
<view class="del-icon" @tap="delImage(index)">
<uni-icons type="trash" color="#00BFFF" size="20"></uni-icons>
</view>
<image show-menu-by-longpress :src="items.ocrPicture" @tap="showImage(items.ocrPicture)" style="width: 200rpx;height: 200rpx;padding: 5px;"></image>
<uni-easyinput type='number' v-model='items.count' placeholder="子图规格数量"></uni-easyinput>
</view>
<view @tap="addSonImg(item.id)" style="width: 200rpx;height: 219rpx;background: rgba(255,255,255,0.4);margin: 0 20rpx;border-radius: 10px;font-size: 24rpx;color: #777;text-align: center;">
<uni-icons type="plusempty" color="#777" size="80"></uni-icons>
<view style="height: 30rpx;line-height: 30rpx;">点击添加子图</view>
</view> </view>
</view> </view>
</view> </view>
<view class="bottom" @tap="identify"> <view class="bottom" @tap="identify">
<view class="run-line"></view> <view class="run-line"></view>
<img class="bottom-img" <img class="bottom-img"
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/0db7dd480e4644af871ce7bf97f4f775.jpg" alt="" /> src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/27e2655fe19f454d93970f968d91fbef.png" alt="" />
<view class="bottom-btn">Ai识别</view> <view class="bottom-btn">Ai识别</view>
</view> </view>
</view> </view>
@ -68,25 +79,54 @@
'https://jewel-shop.oss-cn-beijing.aliyuncs.com/44e7ccc2fae74db593bd1a10f538e2de.jpg', 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/44e7ccc2fae74db593bd1a10f538e2de.jpg',
'https://jewel-shop.oss-cn-beijing.aliyuncs.com/2a55142e562b4ea480ce553c8b84d092.jpg' 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/2a55142e562b4ea480ce553c8b84d092.jpg'
], ],
purchaseOcrPictureList: [] purchaseOcrPictureList: [],
parentPicturePath:'',
parentId:'',
newSubmit:[]
} }
}, },
onShow() { onShow() {
if (this.uploadUrl && this.uploadNum == 1) { if (this.uploadUrl && this.uploadNum == 1) {
let data = { if(this.parentId !=''){
ocrPicture: this.uploadUrl, for(let i=0;i<this.purchaseOcrPictureList.length;i++){
count: '' if(this.purchaseOcrPictureList[i].id == this.parentId){
let data = {
ocrPicture: this.uploadUrl,
count: '',
}
this.purchaseOcrPictureList[i].children.push(data)
}
}
this.parentId = ''
}else{
let data = {
ocrPicture: this.uploadUrl,
count: '',
id:this.splitData(this.uploadUrl),
children:[]
}
this.purchaseOcrPictureList.push(data)
} }
this.purchaseOcrPictureList.push(data)
console.log('查看图片',this.purchaseOcrPictureList)
this.uploadUrl = '' this.uploadUrl = ''
this.uploadNum = '' this.uploadNum = ''
this.parentPicturePath = ''
} }
}, },
onLoad() { onLoad() {
}, },
methods: { methods: {
addSonImg(id){
this.parentId = id
this.upLoadImg()
},
splitData(str){
return str.split('/')[3].split('.')[0]
},
identify() { identify() {
this.newSubmit = []
if(this.purchaseOcrPictureList.length == 0){ if(this.purchaseOcrPictureList.length == 0){
this.tui.toast("请选择要上传的图片") this.tui.toast("请选择要上传的图片")
return return
@ -96,29 +136,47 @@
this.tui.toast("请输入数量") this.tui.toast("请输入数量")
return return
}else{ }else{
if(i+1 == this.purchaseOcrPictureList.length){ let data = {
this.tui.request("/purchaseOcrPicture/batchSave", "POST", { ocrPicture: this.purchaseOcrPictureList[i].ocrPicture,
orderId: "", count: this.purchaseOcrPictureList[i].count,
purchaseOcrPictureList: this.purchaseOcrPictureList parentPicturePath:''
}
}, false, false).then((res) => { this.newSubmit.push(data)
if (res.code == 200) { if(this.purchaseOcrPictureList[i].children.length > 0){
this.tui.toast("识别中,请等待...") for(let m=0;m<this.purchaseOcrPictureList[i].children.length;m++){
setTimeout(res => { if(this.purchaseOcrPictureList[i].children[m].count == 0 || this.purchaseOcrPictureList[i].children[m].count == ''){
uni.navigateBack({ this.tui.toast("请输入子图片的规格数量")
delta: 1 return
}) }else{
}, 2000) let data = {
ocrPicture: this.purchaseOcrPictureList[i].children[m].ocrPicture,
} else { count: this.purchaseOcrPictureList[i].children[m].count,
this.tui.toast(res.message) parentPicturePath:this.purchaseOcrPictureList[i].ocrPicture
}
this.newSubmit.push(data)
} }
}).catch((res) => {}) }
} }
} }
} }
console.log(this.newSubmit)
this.tui.request("/purchaseOcrPicture/batchSave", "POST", {
orderId: "",
purchaseOcrPictureList: this.newSubmit
}, 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() { backPage() {
uni.navigateBack({ uni.navigateBack({
@ -221,15 +279,6 @@
background: linear-gradient(180deg, #6585fa 0%, #6ad5fe 100%); background: linear-gradient(180deg, #6585fa 0%, #6ad5fe 100%);
} }
.content-list {
width: 95%;
height: auto;
border-radius: 10px;
margin: 0 auto 20rpx;
overflow: hidden;
display: block;
}
.image-box { .image-box {
width: 120rpx; width: 120rpx;
height: 170rpx; height: 170rpx;
@ -400,48 +449,40 @@
.content-list-img { .content-list-img {
position: relative; position: relative;
width: 48%; width: 360rpx;
margin-left: 1.5%; margin-left: 1.5%;
height: 400rpx; height: 400rpx;
border: 1px solid #eee; border: 1px solid #eee;
float: left;
background: #fff; background: #fff;
border-top-left-radius: 10px; border-top-left-radius: 10px;
border-top-right-radius: 10px; border-top-right-radius: 10px;
margin-bottom: 40rpx; margin-bottom: 40rpx;
image { image {
width: 100%; width: 360rpx;
height: 80%; height: 80%;
padding: 10px; padding: 10px;
} }
}
.uni-easyinput { .uni-easyinput {
width: 100%; width: 100%;
height: 20%; height: 20%;
font-size: 36rpx; font-size: 36rpx;
line-height: 40rpx; line-height: 40rpx;
background: #F8FAFF; background: #F8FAFF;
text-align: center; text-align: center;
display: block; display: block;
border-bottom-left-radius: 10px; border:none;
border-bottom-right-radius: 10px; border-bottom-left-radius: 10px;
} border-bottom-right-radius: 10px;
}
.is-input-border { .del-icon {
border: none; width: 50rpx;
background: #F8FAFF !important; height: 50rpx;
} position: absolute;
top: 0;
.del-icon { right: 0;
width: 50rpx;
height: 50rpx;
position: absolute;
top: 0;
right: 0;
}
} }
.icon-upload { .icon-upload {
position: absolute; position: absolute;
top: 0; top: 0;

3
package1/AI/AiChangeGoods.vue

@ -96,7 +96,8 @@
}).catch((res) => {}) }).catch((res) => {})
}, },
//点击商品,返回上一页 //点击商品,返回上一页
backPrevPage(item) { backPrevPage(item) {
item.productId = item.id
let pages = getCurrentPages(); let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; let prevPage = pages[pages.length - 2];
prevPage.$vm.carList1 = item prevPage.$vm.carList1 = item

27
package1/AI/AiChat.vue

@ -32,14 +32,14 @@
<view style="width: 100%;height: 100rpx;text-align: center;font-size: 11px;color: #777;line-height: 100rpx;"> <view style="width: 100%;height: 100rpx;text-align: center;font-size: 11px;color: #777;line-height: 100rpx;">
点击可编辑语音输入的内容~ 点击可编辑语音输入的内容~
</view> </view>
<view style="width: 70%;text-align: right;float: right;margin-right:20rpx;"> <view style="width: 526rpx;text-align: right;float: right;margin-right:20rpx;">
<view @tap="editTextBtn(item,index)" v-for="(item,index) in msgList" :key="index" style="display: inline-block;width: auto;height: auto;min-height: 80rpx;line-height: 80rpx;background: linear-gradient(127.96deg, #6585fa 0%, #6ad5fe 100%);color: #fff;padding:0 20rpx;border-radius: 10px;border-bottom-right-radius: 0;margin-bottom: 40rpx;"> <view @tap="editTextBtn(item,index)" v-for="(item,index) in msgList" :key="index" style="display: inline-block;width: auto;height: auto;min-height: 80rpx;min-width:270rpx;line-height: 80rpx;background: linear-gradient(127.96deg, #6585fa 0%, #6ad5fe 100%);color: #fff;padding:0 20rpx;border-radius: 10px;border-bottom-right-radius: 0;margin-bottom: 40rpx;">
{{item.text}} {{item.text}}
</view> </view>
</view> </view>
</view> </view>
<view @tap="addReg" style="width: 150rpx;position: absolute;bottom: 86px;z-index: 99;right: 10px;height: 60rpx;text-align: center;line-height: 60rpx;color: #fff;border-radius: 5px;background: linear-gradient(90deg, #FF9797, #FFC1E0);"> <view @tap="addReg" style="width: 150rpx;position: absolute;bottom: 86px;z-index: 99;right: 10px;height: 60rpx;text-align: center;line-height: 60rpx;color: #fff;border-radius: 5px;background: linear-gradient(90deg, #FF9797, #FFC1E0);">
确认挂单 开始识别
</view> </view>
<view class="bottom"> <view class="bottom">
<view style="width:10%;height:90rpx;line-height:90rpx;margin-top:20rpx;text-align: center;"> <view style="width:10%;height:90rpx;line-height:90rpx;margin-top:20rpx;text-align: center;">
@ -147,13 +147,6 @@
this.recordState = false this.recordState = false
manager.stop() manager.stop()
}, },
//语音内容为空
showRecordEmptyTip() {
uni.showToast({
title: "请重新说一遍",
icon: 'error'
})
},
//语音识别功能初始化 //语音识别功能初始化
initRecord() { initRecord() {
let that = this; let that = this;
@ -161,13 +154,19 @@
// 识别结束事件 // 识别结束事件
manager.onStop = (res) => { manager.onStop = (res) => {
if (res.result == '') { if (res.result == '') {
that.showRecordEmptyTip() uni.showToast({
title: "请重新说一遍",
icon: 'error'
})
return return
} }
console.log('语音',res)
let data = { let data = {
text:res.result text:res.result
} }
that.msgList.push(data) that.msgList.push(data)
that.$forceUpdate()
console.log('语音',that.msgList)
} }
// 识别错误事件 // 识别错误事件
@ -185,7 +184,11 @@
userId:this.khName.id, userId:this.khName.id,
userName:this.khName.name, userName:this.khName.name,
aiFlag:1, aiFlag:1,
status: 7 status: 7,
area:this.khName.area,
city:this.khName.city,
province:this.khName.province,
receiveAddress:this.khName.address
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.goHangOrder(res.result.id) this.goHangOrder(res.result.id)

26
package1/cropper/cropper.vue

@ -7,7 +7,7 @@
<text class="hint">点击中间裁剪框可查看裁剪后的图片</text> <text class="hint">点击中间裁剪框可查看裁剪后的图片</text>
<view class='bottom'> <view class='bottom'>
<button @tap='submit'>确定</button> <button @tap='submit'>确定</button>
<button class="button" @touchstart='rotate' @touchend='end' data-type="rotate">旋转</button> <!-- <button class="button" @touchstart='rotate' @touchend='end' data-type="rotate">旋转</button> -->
<button class="button" @tap='upload'>上传</button> <button class="button" @tap='upload'>上传</button>
</view> </view>
</view> </view>
@ -20,10 +20,10 @@
src: '', src: '',
width: 250, //宽度 width: 250, //宽度
height: 250, //高度 height: 250, //高度
max_width: 1920, max_width: 1080,
max_height: 1080, max_height: 1920,
disable_rotate: true, //是否禁用旋转 disable_rotate: true, //是否禁用旋转
disable_ratio: true, //锁定比例 disable_ratio: false, //锁定比例
limit_move: true, //是否限制移动 limit_move: true, //是否限制移动
} }
}, },
@ -31,20 +31,6 @@
let that = this; let that = this;
this.cropper = this.selectComponent("#image-cropper"); this.cropper = this.selectComponent("#image-cropper");
this.src= options.imgSrc this.src= options.imgSrc
// uni.getImageInfo({
// src: options.imgSrc,
// success(res) {
// that.height = res.height
// that.width = res.width
// that.max_width = res.width
// that.max_height = res.height
// },
// fail(err) {
// console.error('获取图片信息失败:', err);
// }
// });
// console.log('宽',this.width)
// console.log('高',this.height)
if(!options.imgSrc){ if(!options.imgSrc){
this.cropper.upload(); //上传图片 this.cropper.upload(); //上传图片
} }
@ -56,7 +42,9 @@
loadimage(e) { loadimage(e) {
wx.hideLoading(); wx.hideLoading();
console.log('图片'); console.log('图片');
this.cropper.imgReset(); // this.cropper.imgReset();
this.cropper.setCutSize()
this.cropper.setCutCenter()
}, },
clickcut(e) { clickcut(e) {
console.log(e.detail); console.log(e.detail);

BIN
package1/inventory/.DS_Store

Binary file not shown.

2
package1/inventory/addGoods.vue

@ -259,7 +259,7 @@
//跳转分类页 //跳转分类页
goGategoryLow() { goGategoryLow() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/inventory/gategory' url: '/package1/inventory/gategory'
}) })
}, },
scanCodeAdd() { scanCodeAdd() {

10
package1/inventory/batchPrint.vue

@ -13,7 +13,7 @@
<view class="box-right"> <view class="box-right">
<view class="box-right-name">{{item.productName}}</view> <view class="box-right-name">{{item.productName}}</view>
<view class="box-right-num">{{item.productSn}}</view> <view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price" v-if="item.wholesalePrice"> <view class="box-right-price" v-if="item.wholesalePrice !=''">
<view class="price-box"> <view class="price-box">
<text>{{item.wholesalePrice}}</text> <text>{{item.wholesalePrice}}</text>
<text>批发价</text> <text>批发价</text>
@ -24,7 +24,7 @@
</view> </view>
</view> </view>
</view> </view>
<checkbox-group @tap="goInvPrint(item)" v-if="item.wholesalePrice"> <checkbox-group @tap="goInvPrint(item)">
<label> <label>
<checkbox :checked="item.checked" class="checkbox" /> <checkbox :checked="item.checked" class="checkbox" />
</label> </label>
@ -49,7 +49,7 @@
<view class="box-right"> <view class="box-right">
<view class="box-right-name">{{item.productName}}</view> <view class="box-right-name">{{item.productName}}</view>
<view class="box-right-num">{{item.productSn}}</view> <view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price" v-if="item.wholesalePrice"> <view class="box-right-price" v-if="item.wholesalePrice !=''">
<view class="price-box"> <view class="price-box">
<text>{{item.wholesalePrice}}</text> <text>{{item.wholesalePrice}}</text>
<text>批发价</text> <text>批发价</text>
@ -60,7 +60,7 @@
</view> </view>
</view> </view>
</view> </view>
<checkbox-group @tap="checkboxChange(item)" v-if="item.wholesalePrice"> <checkbox-group @tap="checkboxChange(item)">
<label> <label>
<checkbox :checked="item.checked" class="checkbox" /> <checkbox :checked="item.checked" class="checkbox" />
</label> </label>
@ -243,7 +243,7 @@
this.carList.push(item) this.carList.push(item)
}else{ }else{
for(let i=0;i<this.carList.length;i++){ for(let i=0;i<this.carList.length;i++){
if(this.carList[i].productId == item.productId){ if(this.carList[i].productName == item.productName){
this.carList.splice(i, 1) this.carList.splice(i, 1)
return; return;
}else{ }else{

9
package1/inventory/getProductIdToList.vue

@ -96,7 +96,7 @@
this.tui.request(url, "post", { this.tui.request(url, "post", {
productId: this.productId, productId: this.productId,
pageSize: 10, pageSize: 10,
pageNum: this.pageNum pageNum: this.pages
}, false, false).then((res) => { }, false, false).then((res) => {
this.status = 'nomore'; this.status = 'nomore';
if (res.code == 200) { if (res.code == 200) {
@ -107,6 +107,13 @@
this.list = [...this.list, ...res.result.records] this.list = [...this.list, ...res.result.records]
} }
for(let i=0;i<this.list.length;i++){
this.list[i].productCount = 0
for(let m=0;m<this.list[i].saleDetailDTOList.length;m++){
this.list[i].productCount += this.list[i].saleDetailDTOList[m].stockLogList1[0].productCount
}
}
console.log(this.list)
this.pageNum = res.result.pages this.pageNum = res.result.pages
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)

4
package1/other/logistics.vue

@ -27,7 +27,7 @@
<text class="cardText"> 下单时间:</text> <text class="cardText"> 下单时间:</text>
<text class="priceText"> {{item.createTime}}</text> <text class="priceText"> {{item.createTime}}</text>
</view> </view>
<view class="uni-body"> <view class="uni-body" v-if="current != 3">
<text class="cardText"> 订单编号:</text> <text class="cardText"> 订单编号:</text>
<text class="priceText"> {{item.orderId}}</text> <text class="priceText"> {{item.orderId}}</text>
</view> </view>
@ -140,7 +140,7 @@
dataType: 'json', dataType: 'json',
success: (res) => { success: (res) => {
if (res.data.code == 200){ if (res.data.code == 200){
this.waitUpDoorNum = res.result.orders.length this.waitUpDoorNum = res.data.result.total
} }
}, },
fail: (res) => { fail: (res) => {

Loading…
Cancel
Save