From 37f020c08e22613550c39c5102b8551a5fd1b21b Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Mon, 15 Apr 2024 22:07:49 +0800 Subject: [PATCH] 11 --- package1/AI/AIHangOrderList.vue | 149 +++++++++++++++++++--------- package1/AI/AIInventoryList.vue | 7 +- package1/AI/AiChangeGoods.vue | 109 +++++++++++++++----- package1/AI/AiChat.vue | 20 +++- package1/AI/addAiList.vue | 26 +++-- package1/inventory/batchPrint.vue | 4 +- package1/inventory/gategory.vue | 5 +- package1/other/custom.vue | 24 +++-- package1/other/customDetail.vue | 87 ++++++++++++++-- package1/other/logistics.vue | 115 ++++++++++++++++++++- package1/other/logisticsAddress.vue | 50 ++++++++-- package1/stock/addStock.vue | 109 +++++++++++++++----- package1/stock/goodsStock.vue | 37 +------ 13 files changed, 551 insertions(+), 191 deletions(-) diff --git a/package1/AI/AIHangOrderList.vue b/package1/AI/AIHangOrderList.vue index 383ef53..59b3c43 100644 --- a/package1/AI/AIHangOrderList.vue +++ b/package1/AI/AIHangOrderList.vue @@ -49,9 +49,9 @@ 挂单列表 - - AI - 扫 + + 扫 + AI @@ -62,13 +62,18 @@ 识别中... + + + {{item.aiFlag == 2?'识别成功':item.aiFlag == 3?'识别失败':''}} + + 语音备注 扫码选货 - 去开单 + 去开单 删除 @@ -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, diff --git a/package1/AI/AIInventoryList.vue b/package1/AI/AIInventoryList.vue index cdf6634..4c162b2 100644 --- a/package1/AI/AIInventoryList.vue +++ b/package1/AI/AIInventoryList.vue @@ -82,12 +82,7 @@ uni.stopPullDownRefresh(); }, 500); }).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) => {}) + uni.stopPullDownRefresh() }, backPage(){ uni.navigateBack({ diff --git a/package1/AI/AiChangeGoods.vue b/package1/AI/AiChangeGoods.vue index 90c985b..fbedd57 100644 --- a/package1/AI/AiChangeGoods.vue +++ b/package1/AI/AiChangeGoods.vue @@ -6,12 +6,12 @@ + @confirm="search" @blur="search" @clear="clearSearch" /> - {{item.categoryName}} @@ -48,6 +48,37 @@ + + + + + + + 暂无图片 + + + {{item.productName}} + {{item.productSn}} + + + {{item.inStorageStatus==0?'待入库':item.purchasePrice == null ?'新商品':item.purchasePrice}} + 采购价 + + + {{item.wholesalePrice}} + 批发价 + + + {{item.price}} + 零售价 + + + {{item.stockCount}} + 库存 + + + @@ -61,10 +92,12 @@ return { indexList: [], pageNum: 1, //分页的页码 - shopList: [], + shopList: [], + shopList1: [], categoryId: '', //分类id searchName: '', //搜索框输入值 - height: 0 + height: 0, + gateType:'' } }, onLoad() { @@ -89,7 +122,7 @@ } } this.categoryId = this.indexList[0].id - this.getShareList(this.indexList[0].id); + this.getShareList(); } else { this.tui.toast(res.message) } @@ -107,19 +140,38 @@ }) }, //点击分类获取商品列表 - getShareList(id) { - this.tui.request("/app/product/getShareList", "POST", { - categoryId: this.categoryId, - searchStr: this.searchName, - pageNum: this.pageNum, - pageSize: '10' - }, false, false).then((res) => { - if (res.code == 200) { - this.shopList = res.result.records - } else { - this.tui.toast(res.message) - } - }).catch((res) => {}) + getShareList(type) { + let data = {} + if(type=='search'){ + this.gateType = 'search' + data = { + categoryId: "", + searchStr: this.searchName, + pageNum: this.pageNum, + pageSize: '100' + } + }else{ + this.gateType = '' + data = { + categoryId: this.categoryId, + searchStr: this.searchName, + pageNum: this.pageNum, + pageSize: '100' + } + } + this.tui.request("/app/product/getShareList", "POST", data, false, false).then((res) => { + if (res.code == 200) { + if(type=='search'){ + this.shopList = [] + this.shopList1 = res.result.records + }else{ + this.shopList1 = [] + this.shopList = res.result.records + } + } else { + this.tui.toast(res.message) + } + }).catch((res) => {}) }, //跳转新增商品 goAddGoods() { @@ -127,10 +179,21 @@ url: "/package1/inventory/addGoods" }) }, - //顶部搜索框 - search(res) { - this.searchName = res.value - this.getShareList() + //顶部搜索框 + search(e) { + if(e.value == ''){ + this.searchName = "" + this.getShareList() + }else{ + this.searchName = e.value + this.getShareList('search') + + } + }, + //清空搜索条件 + clearSearch(){ + this.searchName = '' + this.getShareList() }, //未入库遮罩 clickMask(item) { @@ -155,7 +218,7 @@ } } this.categoryId = this.indexList[index].id - this.getShareList(this.indexList[index].id) + this.getShareList() } } } diff --git a/package1/AI/AiChat.vue b/package1/AI/AiChat.vue index 263781c..4c6141c 100644 --- a/package1/AI/AiChat.vue +++ b/package1/AI/AiChat.vue @@ -125,12 +125,26 @@ close(){ this.$refs.popup.close() }, + spliceMsg(res){ + let regex = /嗯|啊|儿|各|阿|恩/g; + return res.replace(regex, '') + }, + convertChineseToArabic(str) { + const chineseNumToArabic = { + '零': 0, '一': 1, '二': 2, '两': 2, '三': 3, + '四': 4, '五': 5, '六': 6, '七': 7, '八': 8, '九': 9 + }; + const regex = /(零|一|二|两|三|四|五|六|七|八|九)/g; + return str.replace(regex, match => chineseNumToArabic[match]); + }, inputSaveText(){ + let convertedStr = this.convertChineseToArabic(this.editText); + let getMsg = this.spliceMsg(convertedStr) if(this.editText == ''){ return; } let data = { - text:this.editText + text:getMsg } this.msgList.push(data) this.editText = '' @@ -164,7 +178,7 @@ } console.log('语音',res) let data = { - text:res.result + text:this.spliceMsg(res.result) } that.msgList.push(data) that.$forceUpdate() @@ -209,7 +223,7 @@ let text = ' ' for(let i=0;i { - if (res.code == 200) { - this.res = JSON.stringify(res.result) - } else { - this.res = JSON.stringify(res.result) - this.tui.toast(res.message) - } + this.tui.request("/app/problemFeedback/getProblemFeedbackList", "POST", { + problemContent:'', + pageNum:1, + pageSize:10 + }, false, false).then((res1) => { + }).catch((res) => { - this.res = JSON.stringify(res.result) + this.tui.toast(res) }) }, + convertChineseToArabic(str) { + const chineseNumToArabic = { + '零': 0, '一': 1, '二': 2, '两': 2, '三': 3, + '四': 4, '五': 5, '六': 6, '七': 7, '八': 8, '九': 9 + }; + const regex = /(零|一|二|两|三|四|五|六|七|八|九)/g; + return str.replace(regex, match => chineseNumToArabic[match]); + }, goList(type){ if(type == 1){ uni.navigateTo({ diff --git a/package1/inventory/batchPrint.vue b/package1/inventory/batchPrint.vue index e8a29ce..fa6f04d 100644 --- a/package1/inventory/batchPrint.vue +++ b/package1/inventory/batchPrint.vue @@ -20,7 +20,7 @@ {{item.lsprice}} - + 零售价 @@ -340,7 +340,7 @@ } 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.addCPCLText('0', '230', '24', '0', 0, '零售价:'+(item.lsprice || item.price)) } strCmd += blesdk.addCPCLQRCode(200, 140, 'H', '1', 6, [item.id,item.shopId]) //二维码 strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 diff --git a/package1/inventory/gategory.vue b/package1/inventory/gategory.vue index 26a80cf..b255eb4 100644 --- a/package1/inventory/gategory.vue +++ b/package1/inventory/gategory.vue @@ -38,9 +38,8 @@ *您可以点击默认项快捷添加分类,如没有想要的快捷项,可以手动输入 - - +