diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue index 0c03424..48a961b 100644 --- a/pages/billing/changeGoods1.vue +++ b/pages/billing/changeGoods1.vue @@ -89,7 +89,14 @@ - + + + + 规格 + 库存 + + + @@ -174,10 +181,12 @@ searchName: '', //搜索框输入值 shopId: '', //店铺id, checkbox: [], //需要分享的商品id - temporaryNum: 0, + temporaryNum: 0, + allChangeNum:0, goodsDetail: [], attrNameList: [], - temporaryList: [], + temporaryList: [], + isPlusAndMinus:false, carList: [], columns: [], keyList: [], @@ -270,6 +279,36 @@ this.goodsDetail.attributeList[i].value[m].isChecked = false } } + }, + allChange(e){ + //监听到输入框改变,给所有的都赋值 + if(this.isPlusAndMinus == false){ + for(var i=0;i - - + + + 规格 + 库存 + + diff --git a/pages/index/order.vue b/pages/index/order.vue index 20bfb02..355c2a1 100644 --- a/pages/index/order.vue +++ b/pages/index/order.vue @@ -26,7 +26,7 @@ {{'     欠款: '}} {{item.noEarn == null ?'暂无':item.noEarn}} - 订单状态:{{item.status == 0 ?'待抢单' :item.status == 1 ?'待取货':item.status == 2 ?'作废' :item.status == 3 ?'待送达' :item.status == 4 ?'已完成' :item.status == 5 ?'下游客户待退货' :item.status == 00 ?'退货待抢单' :item.status == 01 ?'退货待取货' :item.status == 03 ?'退货待送达' :item.status == 04 ?'待确认退货' :item.status == 6 ?'待配货' :'挂单'}} + 订单状态:{{item.status == '0' ?'待抢单' :item.status == '1' ?'待取货':item.status == '2' ?'作废' :item.status == '3' ?'待送达' :item.status == '4' ?'已完成' :item.status == '5' ?'下游客户待退货' :item.status == '00' ?'退货待抢单' :item.status == '01' ?'退货待取货' :item.status == '03' ?'退货待送达' :item.status == '04' ?'待确认退货' :item.status == '6' ?'待配货' :'挂单'}} 去开单 删除订单 @@ -39,10 +39,7 @@ - - + diff --git a/pages/index/orderDetail.vue b/pages/index/orderDetail.vue index c843b15..6e47bab 100644 --- a/pages/index/orderDetail.vue +++ b/pages/index/orderDetail.vue @@ -230,7 +230,7 @@ 配送状态: - {{ sales.status == 0 ?'待抢单' :sales.status == 1 ?'待取货' :sales.status == 2 ?'作废':sales.status == 3 ?'待送达' :sales.status == 4 ?'已完成' :sales.status == 5 ?'下游客户待退货' :sales.status == 00 ?'退货待抢单' :sales.status == 01 ?'退货待取货' :sales.status == 03 ?'退货待送达' :sales.status == 04 ?'待确认退货' :sales.status == 6 ?'待配货' :'挂单'}} + {{ sales.status == '0' ?'待抢单' :sales.status == '1' ?'待取货' :sales.status == '2' ?'作废':sales.status == '3' ?'待送达' :sales.status == '4' ?'已完成' :sales.status == '5' ?'下游客户待退货' :sales.status == '00' ?'退货待抢单' :sales.status == '01' ?'退货待取货' :sales.status == '03' ?'退货待送达' :sales.status == '04' ?'待确认退货' :sales.status == '6' ?'待配货' :'挂单'}} @@ -246,7 +246,8 @@ - 取消订单 + 取消订单 + 取消配送 {{ !isReturn ? '退货' : '确认退货'}} 回款 @@ -356,7 +357,12 @@ }, onShow() { this.lbgName = JSON.parse(JSON.stringify(this.lbgName)) - this.type = uni.getStorageSync('type') + this.type = uni.getStorageSync('type') + // 初始化蓝牙模块 + wx.openBluetoothAdapter({ //111 + mode: 'central', + success: (res2) => {} + }) }, onLoad(option) { if (option.id != null && option.id != undefined && option.id != "") { @@ -428,6 +434,7 @@ strCmd += blesdk.addCPCLSETMAG(1, 1) strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLText('0', '100', '24', '0', 0, '客户:' + this.order.name) + strCmd += blesdk.addCPCLText('280', '100', '24', '0', 0, this.sales.id) strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '销售:' + this.sales.createByName) strCmd += blesdk.addCPCLText('280', '130', '24', '0', 0, '日期:' + this.sales.createTime) strCmd += blesdk.addCPCLText('0', '150', '24', '0', 0, @@ -513,51 +520,58 @@ strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + (this.sales.otherExpense)) } - if(Math.ceil(Number(this.sales.remark.length) / 20 ) *30 + this.yNum < this.printTotal){ - if(this.sales.remark.length >20){ - let position = 20; - let part1 = this.sales.remark.substring(0, position); - let part2 = this.sales.remark.substring(position); - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1) - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) - }else{ - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark) - } - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLPrint(); - this.bufferData.push(strCmd); - }else{ - this.yNum = 0 - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLPrint(); - this.bufferData.push(strCmd); - strCmd = '' - if(this.sales.remark.length >20){ - let position = 20; - let part1 = this.sales.remark.substring(0, position); - let part2 = this.sales.remark.substring(position); - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); + if(this.sales.remark){ + if(Math.ceil(Number(this.sales.remark.length) / 20 ) *30 + this.yNum < this.printTotal){ + if(this.sales.remark.length >20){ + let position = 20; + let part1 = this.sales.remark.substring(0, position); + let part2 = this.sales.remark.substring(position); + strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1) + strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) + }else{ + strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark) + } strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1) - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) + strCmd += blesdk.addCPCLPrint(); + this.bufferData.push(strCmd); }else{ - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); + this.yNum = 0 + strCmd += blesdk.addCPCLLocation(0); + strCmd += blesdk.addCPCLPrint(); + this.bufferData.push(strCmd); + strCmd = '' + if(this.sales.remark.length >20){ + let position = 20; + let part1 = this.sales.remark.substring(0, position); + let part2 = this.sales.remark.substring(position); + strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); + strCmd += blesdk.addCPCLLocation(0); + strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1) + strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) + }else{ + strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); + strCmd += blesdk.addCPCLLocation(0); + strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark) + } strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark) + strCmd += blesdk.addCPCLPrint(); + + this.bufferData.push(strCmd); + } + }else{ strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLPrint(); - this.bufferData.push(strCmd); - } - console.log("传值之前",this.bufferData) - - this.$nextTick(()=>{ - uni.redirectTo({ - url: "/pages/index/order" + uni.hideLoading(); + that.$nextTick(()=>{ + uni.navigateBack({ + delta: 1 }) }) + console.log("传值之前",this.bufferData) + }, //打印贴包单 onPrint(opt) { @@ -596,7 +610,8 @@ strCmd += blesdk.addCPCLText('50', '890', '24', '0', 0, '地址:' + this.shopData.shopAddress) strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLPrint(); - this.bufferData.push(strCmd); + this.bufferData.push(strCmd); + uni.hideLoading(); }, //计算打印机当前行高度 countPrint(){ @@ -774,7 +789,8 @@ }, close() { this.popupShow = false - }, + }, + //调用退货接口 sureReturn() { if (this.radio1 == 0 && this.changeA == '') { this.tui.toast("请输入取货地址") @@ -795,7 +811,11 @@ } } } - for (var i = 0; i < this.list.length; i++) { + for (var i = 0; i < this.list.length; i++) { + if(this.list[i].stockLogList.length == 0){ + this.tui.toast("请选择退货商品") + return; + } for (var m = 0; m < this.list[i].stockLogList.length; m++) { if(this.list[i].stockLogList[m].returnCount <= 0){ this.tui.toast("退货数量不能为零") @@ -873,23 +893,39 @@ }, logistics() { this.tui.href("/pages/my/logistics/logistics") - }, - cancelOrder() { - // 撤销订单 + }, + // 取消订单 + cancelOrder(type) { this.tui.modal("提示", "您确定要取消该订单吗?", true, (res) => { if (res) { - var status; - if (this.sales.status == 0 || this.sales.status == 1) { - status = 2 - } else if (this.sales.status == '00' || this.sales.status == '01') { - status = '02' + var data={},url + + + if (type == 'qxdd') { + data = { + status: 2, + orderId: this.sales.id + } + url = '/app/sale/status' + }else{ + if(this.sales.status == '0' || this.sales.status == '1'){ + //开单取消配送 + data = { + status: 4, + orderId: this.sales.id + } + url = '/app/sale/status' + }else{ + data = { + orderId: this.inventoryList[0].id + } + url = '/app/return/cancelOrder' + } + } - this.tui.request("/app/sale/status", "POST", { - orderId: this.sales.id, - status: status - }, true, true).then((res1) => { + this.tui.request(url, "POST", data, true, true).then((res1) => { if (res1.code == 200) { - this.tui.toast("取消订单成功") + this.tui.toast("取消成功") uni.navigateBack() } else { this.tui.toast(res.message) diff --git a/pages/index/shareStyle.vue b/pages/index/shareStyle.vue index 2d17918..bc6ea63 100644 --- a/pages/index/shareStyle.vue +++ b/pages/index/shareStyle.vue @@ -448,7 +448,8 @@ .content-left { width: 170rpx; background: #eee; - height: 100%; + height: 100%; + overflow: scroll; } .left-box { diff --git a/pages/inventory/addinventory.vue b/pages/inventory/addinventory.vue index 5de32da..27e5005 100644 --- a/pages/inventory/addinventory.vue +++ b/pages/inventory/addinventory.vue @@ -47,7 +47,7 @@ 数量: + @change="GoodsNumChange($event,value,values[0])" /> - - + + + 规格 + 库存 + + @@ -148,7 +152,7 @@ {{item.name}} 库存:{{item.productNum}} + style="color:#777;font-size: 12px;">{{item.productNum}} @@ -561,7 +565,8 @@ }, //弹出商品规格选择 toggle(type, id) { - if (type == 'bottom') { + if (type == 'bottom') { + this.allChangeNum = 0 this.getById(id); } }, @@ -612,7 +617,7 @@ that.zNum = 0 that.$nextTick(() => { that.carList.forEach(function(value, key) { - if (that.carList.has(id) == true) { + if (value.productId == id) { that.zNum = value.productCount that.temporaryList = value.stockLogList1 that.pageOldTemList = value.stockLogList1 @@ -967,40 +972,15 @@ return; } let obj = { - productCount: values, + productCount: values.productCount, attributeList: keys } value.stockLogList1.push(obj) }) purchaseDetails.push(value) }) - uni.showModal({ - title: "提示", - content: "请再次确认供应商、商品库存、规格是否正确,入库后不可修改。确认入库吗?", - success: function(res) { - if (res.confirm) { - that.tui.request("/app/stock/putInOfProduct", "post", { - purchase: purchase, - purchaseDetails: purchaseDetails - }, false, false).then((res) => { - if (res.code == 200) { - uni.showToast({ - title: "入库成功", - icon: 'none' - }) - uni.navigateBack({ - delta: 2 - }) - } else { - uni.showToast({ - title: "入库失败", - icon: 'none' - }) - } - }) - } - that.$forceUpdate() - } + uni.navigateTo({ + url: '/pages/inventory/inventoryConfirm?purchase=' + JSON.stringify(purchase) + '&purchaseDetails=' + JSON.stringify(purchaseDetails) }) }, //编辑每一个的单价 @@ -1032,13 +1012,13 @@ //修改已选规格的数量 GoodsNumChange(e, index, index1) { let that = this; - this.carList.get(index).stockLogList.set(index1, e) - this.carList.get(index).productCount = 0 - this.carList.get(index).stockLogList.forEach(function(value, key) { - that.carList.get(index).productCount = that.carList.get(index).productCount + value - that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(index).purchasePrice - }) - this.getAllPrice(); + this.carList.get(index[0]).stockLogList.get(index1).productCount = e + this.carList.get(index[0]).productCount = 0 + this.carList.get(index[0]).stockLogList.forEach(function(value, key) { + that.carList.get(index[0]).productCount = that.carList.get(index[0]).productCount + value.productCount + that.carList.get(index[0]).price = that.carList.get(index[0]).productCount * that.carList.get(index[0]).purchasePrice + }) + that.getAllPrice() } } } diff --git a/pages/inventory/changeGoods1.vue b/pages/inventory/changeGoods1.vue index a78e232..6ee6de5 100644 --- a/pages/inventory/changeGoods1.vue +++ b/pages/inventory/changeGoods1.vue @@ -99,14 +99,21 @@ - + + + + 规格 + 库存 + + + {{item.name}} 库存:{{item.productNum}} + style="color:#777;font-size: 12px;">{{item.productNum}} @@ -187,7 +194,8 @@ searchName: '', //搜索框输入值 shopId: '', //店铺id, checkbox: [], //需要分享的商品id - temporaryNum: 0, + temporaryNum: 0, + allChangeNum:0, goodsDetail: [], attrNameList: [], temporaryList: [], @@ -203,7 +211,8 @@ carNum: 0, carType: 0, productId: '', - productNum: 0, + productNum: 0, + isPlusAndMinus:false, height: 0, oldTemList:[], pageOldTemList:[], @@ -286,6 +295,36 @@ this.goodsDetail.attributeList[i].value[m].isChecked = false } } + }, + allChange(e){ + //监听到输入框改变,给所有的都赋值 + if(this.isPlusAndMinus == false){ + for(var i=0;i { - this.columns[index] = item.value; - this.keyList[index] = item.name; - }) + this.goodsDetail.attributeList = newArr; console.log('看看看看',this.goodsDetail.attributeList) for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { let oldCheck = false diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue index ef27016..7f7bfec 100644 --- a/pages/inventory/goodsList1.vue +++ b/pages/inventory/goodsList1.vue @@ -88,7 +88,7 @@ {{values[0] | sliceMsg}} 数量: + @change="GoodsNumChange($event,value,values[0])" /> @@ -313,8 +313,12 @@ - - + + + 规格 + 库存 + + @@ -322,7 +326,7 @@ {{item.name}} 库存:{{item.productNum}} + style="color:#777;font-size: 12px;">{{item.productNum}} @@ -499,7 +503,8 @@ customPrice: 0, //选择自定义金额 remark: '', pbAddress: '', - carList1: [], + carList1: [], + isPlusAndMinus:false, radioType1: 0, saleId: '', saleDetailList: [], @@ -1004,7 +1009,8 @@ //弹出商品规格选择 toggle(type, id) { this.type = type - if (type == 'bottom') { + if (type == 'bottom') { + this.allChangeNum = 0 this.getById(id); } }, @@ -1115,7 +1121,9 @@ that.zNum = 0 that.$nextTick(() => { that.carList.forEach(function(value, key) { - if (that.carList.has(id) == true) { + console.log('是否相同',value) + console.log(id) + if (value.productId == id) { that.zNum = value.productCount that.temporaryList = value.stockLogList1 that.pageOldTemList = value.stockLogList1 @@ -1286,7 +1294,6 @@ this.wlName = '' this.kdyName = '' this.lbgName = '' - //快递0 物流1 发车2 拼包3 自送4 this.radioType = e.detail.value; for (let i = 0; i < this.logisticsType.length; i++) { if (this.logisticsType[i].value === e.detail.value) { @@ -1555,7 +1562,7 @@ return; } let obj = { - productCount: values, + productCount: values.productCount, attributeList: keys } value.stockLogList1.push(obj) @@ -1638,11 +1645,11 @@ value.stockLogList.forEach(function(value1, key1) { if (that.countPrint() < that.printTotal) { strCmd += blesdk.addCPCLText('0', that.yNum, '24', '0', 0, (that.slicePrint( - key1)) + '*' + value1) + key1)) + '*' + value1.productCount) strCmd += blesdk.addCPCLText('280', that.yNum, '24', '0', 0, '单价:' + value .discountAmount) strCmd += blesdk.addCPCLText('440', that.yNum, '24', '0', 0, '总价:' + (value - .discountAmount * value1)) + .discountAmount * value1.productCount)) } else { that.yNum = 0 strCmd += blesdk.addCPCLPrint(); @@ -1652,11 +1659,11 @@ strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, (that .slicePrint( - key1)) + '*' + value1) + key1)) + '*' + value1.productCount) strCmd += blesdk.addCPCLText('280', that.yNum, '24', '0', 0, '单价:' + value .discountAmount) strCmd += blesdk.addCPCLText('440', that.yNum, '24', '0', 0, '总价:' + (value - .discountAmount * value1)) + .discountAmount * value1.productCount)) } }) }) @@ -1746,7 +1753,7 @@ this.bufferData.push(strCmd); } - + uni.hideLoading(); this.$nextTick(() => { this.$refs.showPopup.close() that.clearAll1() @@ -1902,18 +1909,21 @@ }, //修改已选规格的数量 GoodsNumChange(e, index, index1) { - let that = this; - this.carList.get(index).stockLogList.set(index1, e) - this.carList.get(index).productCount = 0 - this.carList.get(index).stockLogList.forEach(function(value, key) { - that.carList.get(index).productCount = that.carList.get(index).productCount + value + let that = this; + console.log(index[0]) + console.log(index1) + console.log(this.carList) + this.carList.get(index[0]).stockLogList.get(index1).productCount = e + this.carList.get(index[0]).productCount = 0 + this.carList.get(index[0]).stockLogList.forEach(function(value, key) { + that.carList.get(index[0]).productCount = that.carList.get(index[0]).productCount + value.productCount if (that.discountType == 0) { //单品折扣 - that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get( - index) - .discountAmount * that.carList.get(index).discount / 10 + that.carList.get(index[0]).price = that.carList.get(index[0]).productCount * that.carList.get( + index[0]) + .discountAmount * that.carList.get(index[0]).discount / 10 } else { - that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get( - index) + that.carList.get(index[0]).price = that.carList.get(index[0]).productCount * that.carList.get( + index[0]) .unitPrice } }) diff --git a/pages/inventory/inventoryConfirm.vue b/pages/inventory/inventoryConfirm.vue new file mode 100644 index 0000000..7c83803 --- /dev/null +++ b/pages/inventory/inventoryConfirm.vue @@ -0,0 +1,271 @@ + + + + + \ No newline at end of file