diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue index 9b62c9f..a4c713a 100644 --- a/pages/billing/changeGoods1.vue +++ b/pages/billing/changeGoods1.vue @@ -2,11 +2,11 @@ + @confirm="search" @blur="search" @clear="clearSearch" /> - {{item.categoryName}} @@ -42,6 +42,36 @@ + + + + + + + 暂无图片 + + + {{item.productName}} + {{item.productSn}} + + + {{item.inStorageStatus==0?'待入库':item.purchasePrice == null ?'新商品':item.purchasePrice}} + 采购价 + + + {{item.wholesalePrice}} + 批发价 + + + {{item.price}} + 零售价 + + + {{item.stockCount}} + 库存 + + + @@ -104,7 +134,7 @@ - {{item.name}} 库存:{{item.productNum}} + {{item.name}} {{item.productNum}} @@ -177,7 +207,8 @@ return { indexList: [], pageNum: 1, //分页的页码 - shopList: [], + shopList: [], + shopList1:[], info: 0, categoryId: '', //分类id searchName: '', //搜索框输入值 @@ -207,7 +238,8 @@ oldTemList:[], goodsList:[], newTemList:[], - dataObj :new Map() + dataObj :new Map(), + gateType:'' } }, filters: { @@ -249,7 +281,7 @@ } } this.categoryId = this.indexList[0].id - this.getShareList(this.indexList[0].id); + this.getShareList(); } else { this.tui.toast(res.message) } @@ -330,7 +362,6 @@ } var resultList = [] if(jishuqi == this.goodsList.length){ - resultList = this.combination(this.goodsList); } var evalue = [] @@ -457,27 +488,60 @@ uni.navigateBack({ delta: 1 }) + }, + //顶部搜索框 + search(e) { + if(e.value == ''){ + this.searchName = "" + this.getShareList() + }else{ + this.searchName = e.value + this.getShareList('search') + + } + }, + //清空搜索条件 + clearSearch(){ + this.searchName = '' + this.getShareList() }, //点击分类获取商品列表 - 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) - } + 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) => {}) }, change() { - + this.oldTemList = [] }, - // carChange(e, index, index1) { this.carNum = 0 for (let i = 0; i < this.carList.length; i++) { @@ -569,9 +633,7 @@ value: valueObj }) } - console.log(that.dataObj) this.goodsDetail.attributeList = newArr; - console.log('看看看看',this.goodsDetail.attributeList) for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { let oldCheck = false let oldValue = [] @@ -597,7 +659,6 @@ oldCheck = false oldValue = [] } - console.log(this.goodsList) } } else { @@ -621,11 +682,7 @@ uni.hideLoading(); }, 200) }, - //顶部搜索框 - search(res) { - this.searchName = res.value - this.getShareList() - }, + //未入库遮罩 clickMask() { uni.showToast({ @@ -643,7 +700,7 @@ } } this.categoryId = this.indexList[index].id - this.getShareList(this.indexList[index].id) + this.getShareList() }, //临时改价 changePrice(val) { @@ -658,7 +715,8 @@ let data = { id: this.goodsDetail.id, price: this.zPrice, - num: this.zNum, + num: this.zNum, + categoryId:this.goodsDetail.categoryId, productName: this.goodsDetail.productName, productSn: this.goodsDetail.productSn, productPicture: this.goodsDetail.productPicture, @@ -691,7 +749,8 @@ } } - this.temporaryList = [] + this.temporaryList = [] + this.oldTemList = [] this.purchasePrice = '' this.zPrice = '' this.zNum = '' diff --git a/pages/index/addHangOrder.vue b/pages/index/addHangOrder.vue index 86f9a43..02fd2dd 100644 --- a/pages/index/addHangOrder.vue +++ b/pages/index/addHangOrder.vue @@ -319,7 +319,7 @@ }else if(that.voiceText == null){ that.voiceText = res.result }else{ - res.result = '\n' + res.result + res.result = ' ' + res.result that.voiceText += res.result } } diff --git a/pages/index/downStearmList.vue b/pages/index/downStearmList.vue index 0072909..7dc4f7f 100644 --- a/pages/index/downStearmList.vue +++ b/pages/index/downStearmList.vue @@ -2,7 +2,7 @@ + @confirm="search" @blur="search" @clear="clearSearch" /> @@ -146,10 +146,9 @@ - + - + @@ -407,9 +406,16 @@ }).catch((res) => {}) }, //顶部搜索框 - search(res) { + search(res) { + this.pages = 1 this.searchName = res.value this.getShareList() + }, + //清空搜索条件 + clearSearch(){ + this.pages = 1 + this.searchName = '' + this.getShareList() }, inputDialogToggle() { this.$refs.inputDialog.open() @@ -505,24 +511,6 @@ delCarData(index) { this.temporaryList.splice(index, 1); this.temporaryChange() - // uni.showModal({ - // title: "提示", - // content: "确定删除此条商品吗?", - // success: function(res) { - // if(res.confirm){ - // that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name); - // that.carList.get(id).stockLogList.delete(name) - // that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(id).purchasePrice - // if(that.carList.get(id).stockLogList.size == 0){ - // that.carList.delete(id) - // } - - // that.getAllPrice() - // } - // that.$forceUpdate() - // } - // }) - }, //删除商品下的某一个规格 delShopSpec(index, index1) { @@ -611,7 +599,8 @@ }, //点击分类获取商品列表 getShareList(id) { - this.status = 'loading'; + this.status = 'loading'; + // this.shopList = [] this.tui.request("/app/productShare/getShareList", "POST", { searchStr: this.searchName, id: this.khid, diff --git a/pages/index/downstream.vue b/pages/index/downstream.vue index 925d437..6ddf307 100644 --- a/pages/index/downstream.vue +++ b/pages/index/downstream.vue @@ -1,7 +1,7 @@ @@ -81,23 +115,29 @@ return { pageNum: 1, //分页的页码 dataList: [], + isPrint:false, bufferData: [], horizontal: 'right', pecsList:[], defaultText:'', type:'', + printNum:1, list:[{ type:'供应商', checked:false, + text:'' },{ type:'货号', checked:false, + text:'' },{ type:'零售价', checked:false, + text:'' },{ type:'批发价', checked:false, + text:'' }], multipleList:[], content: [{ @@ -115,7 +155,10 @@ selectedIconPath: '/static/images/tabbar/home-sel.png', text: '删除商品', active: false - }] + }], + printList:new Map(), + yNum: 10, + isShow:true } }, filters: { @@ -140,7 +183,9 @@ components: { kkPrinter }, - onLoad(option) { + onLoad(option) { + // 初始化蓝牙模块 + wx.openBluetoothAdapter({mode: 'central'}) this.dataList = JSON.parse(option.item); this.type = uni.getStorageSync('type') }, @@ -161,13 +206,42 @@ }).catch((res) => {}) }, + changeText(){ + console.log(this.dataList) + }, + clickShow(){ + this.isShow = false + }, + changeNumBtn(item){ + if(this.printList.has(item.attributeList) == true){ // map中已经有当前值 + if(item.productCount == 0){ + this.printList.delete(item.attributeList) + }else{ + this.printList.get(item.attributeList).productCount = item.productCount + } + }else{ + this.printList.set(item.attributeList,item) + } + console.log('打印的数组',this.printList) + }, + printBtn(){ + this.isPrint = !this.isPrint + }, //点击打印按钮 clickPrint() { this.$refs.payDialog.open('center') }, //选择多个规格保存 addMultipleType(item1){ - + if(item1.type== '供应商'){ + item1.text = this.dataList.supplierName + }else if(item1.type== '货号'){ + item1.text = this.dataList.productSn + }else if(item1.type== '零售价'){ + item1.text = this.dataList.price + }else if(item1.type== '批发价'){ + item1.text = this.dataList.wholesalePrice + } item1.checked = !item1.checked if(this.multipleList == ''){ this.multipleList.push(item1.type) @@ -184,7 +258,7 @@ } } } - console.log(this.multipleList); + console.log(this.multipleList) }, //去新增商品页编辑 goToAddGoods(){ @@ -192,30 +266,52 @@ url: "/package1/inventory/addGoods?dataList="+JSON.stringify(this.dataList) }) }, - onPrint(opt) { - let strCmd = blesdk.CreatCPCLPage(440, 320, 1, 0); - strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, '商品名:'+this.dataList.productName) - if(this.multipleList.indexOf('货号') != -1){ - console.log(this.multipleList.indexOf('货号')) - strCmd += blesdk.addCPCLText('0', '80', '24', '0', 0, '货 号:'+this.dataList.productSn) - } - if(this.multipleList.indexOf('供应商') != -1){ - console.log(this.multipleList.indexOf('供应商')) - strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '供应商:'+this.dataList.supplierName) - } - if(this.multipleList.indexOf('批发价') != -1){ - console.log(this.multipleList.indexOf('批发价')) - strCmd += blesdk.addCPCLText('0', '180', '24', '0', 0, '批发价:'+this.dataList.wholesalePrice) - } - if(this.multipleList.indexOf('零售价') != -1){ - console.log(this.multipleList.indexOf('零售价')) - strCmd += blesdk.addCPCLText('0', '230', '24', '0', 0, '零售价:'+this.dataList.price) + sliceMsg(val) { + var name = '' + if (typeof(val) == 'string') { + let newObj = JSON.parse(val) + for (let as in newObj) { + name += newObj[as] + ' ' + } } - strCmd += blesdk.addCPCLQRCode(200, 140, 'H', '1', 6, [this.dataList.id,uni.getStorageSync('shopId')]) //二维码 - strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 - strCmd += blesdk.addCPCLPrint(); - this.bufferData.push(strCmd); - this.$refs.payDialog.close(); + return name; + }, + //计算打印机当前行高度 + countPrint(){ + return this.yNum += 50 + }, + onPrint(opt) { + let that = this + this.printList.forEach((item, index) => { + + for(let i=0;i{ + uni.navigateBack({ + delta: 1 + }) + }) }, //悬浮按钮 trigger(e) { @@ -399,7 +495,7 @@ padding-bottom: 20rpx; } .popup-pay-container { - margin-top: 20rpx; + margin-top: 40rpx; height: 100rpx; border-radius: 10px; background: #088FEB; @@ -415,6 +511,7 @@ } .content-fur { padding-bottom: 25rpx; + border-bottom: 1px solid #eee; } .content-low { @@ -427,5 +524,31 @@ text-align: center; color: #777; margin: 20rpx 0 0 20rpx; + } + .print-btn{ + width: 100rpx; + height: 60rpx; + line-height: 60rpx; + color: #fff !important; + background: #0072E3; + position: absolute; + top: 30rpx; + right: 40rpx; + border-radius: 10px; + text-align: center; + } + .bottom-btn{ + width: 200rpx; + height: 80rpx; + line-height: 80rpx; + color: #fff; + background: #0072E3; + border-radius: 80rpx; + text-align: center; + position: fixed; + bottom: 75rpx; + right: 0; + left: 0; + margin: auto; } \ No newline at end of file diff --git a/pages/login/login.vue b/pages/login/login.vue index 045634c..2cb5ef5 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -103,16 +103,25 @@ choose: false, isChoose: false, clock: 60, // 倒计时 - shopList: [] + shopList: [], + saleId:'' } }, computed: mapState(['type']), - onLoad() { + onLoad(option) { + this.saleId = option.saleId + this.userId = option.userId + if(uni.getStorageSync('hiver_token') != '' && uni.getStorageSync('wayValue') == 2){ + uni.reLaunch({ + url: '/package1/other/custom?saleId=' + this.saleId + '&userId=' + this.userId + }) + } this.getCaptchaImg(); this.username = uni.getStorageSync('username') this.password = uni.getStorageSync('password') }, - methods: { + methods: { + ...mapMutations(['login']), ...mapActions(['getUserInfo']), getCaptchaImg() { @@ -183,7 +192,7 @@ if(this.wayValue == 2){ //下游客户登录 setTimeout(() => { uni.reLaunch({ - url: '/package1/other/custom' + url: '/package1/other/custom?saleId=' + this.saleId }) }, 200) this.tui.toast('登录成功', 2000, true)