diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue index 700c55d..13f5bfb 100644 --- a/pages/billing/changeGoods1.vue +++ b/pages/billing/changeGoods1.vue @@ -274,13 +274,13 @@ this.temporaryList.push(this.attributeList); } else { for (var i = 0; i < this.temporaryList.length; i++) { - if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) { - return - } else { - if (this.temporaryList.length == (i + 1)) { - this.temporaryList.push(this.attributeList); - return + if (this.temporaryList[i].name.indexOf(this.attributeList.name) == -1 || this.temporaryList[i].name.indexOf(this.attributeList.name) == 1) { + if (this.temporaryList.length == (i + 1)) { + this.temporaryList.push(this.attributeList); + return } + } else { + return } } diff --git a/pages/index/addHangOrder.vue b/pages/index/addHangOrder.vue index 8283990..051565c 100644 --- a/pages/index/addHangOrder.vue +++ b/pages/index/addHangOrder.vue @@ -370,14 +370,15 @@ this.temporaryList.push(this.attributeList); } else { for (var i = 0; i < this.temporaryList.length; i++) { - if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) { - this.temporaryList[i] = this.attributeList - return - } else { - if (this.temporaryList.length == (i + 1)) { - this.temporaryList.push(this.attributeList); - return + if (this.temporaryList[i].name.indexOf(this.attributeList.name) == -1 || this.temporaryList[i].name.indexOf(this.attributeList.name) == 1) { + if (this.temporaryList.length == (i + 1)) { + this.temporaryList.push(this.attributeList); + return } + } else { + this.temporaryList[i] = this.attributeList + return + } } @@ -630,31 +631,43 @@ }, //带参数跳转到开单页 goSaleGoods(item) { - if(item){ + + console.log(item) let dataList = [] - for (let i = 0; i < item.saleDetailDTOList.length; i++) { + 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 = 0 + 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.saleDetailDTOList[i].saleId + obj.remark = item.remark + obj.xsyId = item.createBy + obj.createByName = item.createByName + dataList.push(obj) + } + }else{ let obj = {} - obj.saleDetailQueryDTO = item.saleDetailDTOList[i].stockLogList1 obj.num = 0 - obj.id = item.saleDetailDTOList[i].productId obj.price = 0 - obj.lsprice = item.saleDetailDTOList[i].price - obj.zPrice = item.saleDetailDTOList[i].discountAmount - obj.unitPrice = item.saleDetailDTOList[i].realPrice / item.saleDetailDTOList[i].num - 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.saleDetailDTOList[i].saleId obj.remark = item.remark obj.xsyId = item.createBy obj.createByName = item.createByName dataList.push(obj) } + console.log(dataList); uni.setStorageSync('carList1', JSON.stringify(dataList)) uni.setStorageSync('khName', '') - } + uni.switchTab({ url: '/pages/inventory/goodsList1' }) diff --git a/pages/index/downStearmList.vue b/pages/index/downStearmList.vue index 6494462..73656cb 100644 --- a/pages/index/downStearmList.vue +++ b/pages/index/downStearmList.vue @@ -297,13 +297,14 @@ this.temporaryList.push(this.attributeList); } else { for (var i = 0; i < this.temporaryList.length; i++) { - if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) { - return - }else{ + if (this.temporaryList[i].name.indexOf(this.attributeList.name) == -1 || this.temporaryList[i].name.indexOf(this.attributeList.name) == 1) { if (this.temporaryList.length == (i + 1)) { this.temporaryList.push(this.attributeList); return } + + }else{ + return } } } diff --git a/pages/index/index.vue b/pages/index/index.vue index 7a634ef..a08bf2b 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -75,7 +75,7 @@ {{ item.createTime }} - 订单状态:{{item.status == 0 ?'待抢单' :item.status == 1 ?'待取货' :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 == 2 ?'作废' :item.status == 1 ?'待取货' :item.status == 3 ?'待送达' :item.status == 4 ?'已完成' :item.status == 5 ?'下游客户待退货' :item.status == 00 ?'退货待抢单' :item.status == 01 ?'退货待取货' :item.status == 03 ?'退货待送达' :item.status == 04 ?'待确认退货' :item.status == 6 ?'待配货' :'挂单'}} diff --git a/pages/index/order.vue b/pages/index/order.vue index b9b5a9d..9bc1ac6 100644 --- a/pages/index/order.vue +++ b/pages/index/order.vue @@ -16,7 +16,7 @@ {{'     欠款: '}} {{item.noEarn == null ?'暂无':item.noEarn}} - 订单状态:{{item.status == 0 ?'待抢单' :item.status == 1 ?'待取货' :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 ?'待配货' :'挂单'}} 去开单 diff --git a/pages/index/orderDetail.vue b/pages/index/orderDetail.vue index 07954c2..bde52e2 100644 --- a/pages/index/orderDetail.vue +++ b/pages/index/orderDetail.vue @@ -196,7 +196,7 @@ 配送状态: - {{ sales.status == 0 ?'待抢单' :sales.status == 1 ?'待取货' :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 ?'待配货' :'挂单'}} @@ -522,10 +522,16 @@ cancelOrder() { // 撤销订单 this.tui.modal("提示", "您确定要取消该订单吗?", true, (res) => { - if (res) { - this.tui.request("/app/sales/status", "POST", { + 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' + } + this.tui.request("/app/sale/status", "POST", { orderId: this.sales.id, - status: 3 + status: status }, true, true).then((res1) => { if (res1.code == 200) { this.tui.toast("取消订单成功") diff --git a/pages/index/peopleList.vue b/pages/index/peopleList.vue index abdd828..8faaf51 100644 --- a/pages/index/peopleList.vue +++ b/pages/index/peopleList.vue @@ -7,7 +7,7 @@ + style="display: flex;flex-direction: column;height: auto;padding-bottom: 20rpx;"> {{item.consigneeName}} {{item.consigneeMobile}} @@ -16,8 +16,9 @@ {{item.name}} {{item.phone}} - - {{item.province + item.city + item.area + item.address}} + + {{item.province + item.city + item.area}} + {{item.address}} @@ -40,7 +41,7 @@ 拨打电话 - 本单返佣{{item.rebateAmount}}元 + 本单返佣{{item.rebateAmount}}元 diff --git a/pages/index/shareStyle.vue b/pages/index/shareStyle.vue index 5e3ac3f..4e62072 100644 --- a/pages/index/shareStyle.vue +++ b/pages/index/shareStyle.vue @@ -21,7 +21,7 @@ {{item.productName}} {{item.productSn}} - + {{item.purchasePrice}} 采购价 @@ -40,7 +40,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -138,6 +138,20 @@ }, created() { uni.hideHomeButton() //左上角HOME按钮 + }, + onShareTimeline() { + return { + title: '查看我的推荐', + imageUrl:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/abdc5c897c4f4fe198b74091a708030b.jpg', + query: 'khid=' + this.khid + } + }, + onShareAppMessage() { + return { + title: '查看我的推荐', + imageUrl:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/abdc5c897c4f4fe198b74091a708030b.jpg', + path: '/pages/index/shareStyle?khid=' + this.khid + } }, onLoad(options) { @@ -152,9 +166,7 @@ methods: { //初始化获取分类列表 getGategoryList() { - this.tui.request("/app/productCategory/list", "get", { - // shopId: 1, - }, false, true).then((res) => { + 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++) { @@ -163,10 +175,14 @@ } else { this.indexList[i].parentId = false } - this.categoryId = this.indexList[i].id - this.getShareList(this.indexList[i].id); + 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) } @@ -175,14 +191,23 @@ //点击分类获取商品列表 getShareList(id) { this.tui.request("/app/product/getShareList", "POST", { - categoryId: this.categoryId, + categoryId: id, searchStr: this.searchName, pageNum: this.pageNum, pageSize: '100' }, false, false).then((res) => { - if (res.code == 200) { - - this.shopList.push(res.result.records) + 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] = [] + } + + } + console.log(this.shopList) this.goodsList = this.shopList[0] } else { this.tui.toast(res.message) @@ -269,26 +294,14 @@ } }).catch((res) => {}) }, - //点击的是转发朋友圈还是微信好友 - select(index) { - if (index == 0) { - this.onShareAppMessage() - } else { - this.onShareTimeline() - } - }, - onShareTimeline() { - return { - title: '查看我的推荐', - query: 'khid=' + this.khid - } - }, - onShareAppMessage() { - return { - title: '查看我的推荐', - path: '/pages/index/shareStyle?khid=' + this.khid - } - }, + // //点击的是转发朋友圈还是微信好友 + // select(index) { + // if (index == 0) { + // this.onShareAppMessage() + // } else { + // this.onShareTimeline() + // } + // }, //弹出购物车或者商品规格选择弹窗 toggle(type, item) { // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 diff --git a/pages/inventory/addinventory.vue b/pages/inventory/addinventory.vue index 3d5b9bf..e043197 100644 --- a/pages/inventory/addinventory.vue +++ b/pages/inventory/addinventory.vue @@ -348,14 +348,15 @@ this.temporaryList.push(this.attributeList); } else { for (var i = 0; i < this.temporaryList.length; i++) { - if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) { - this.temporaryList[i] = this.attributeList - return - } else { - if (this.temporaryList.length == (i + 1)) { - this.temporaryList.push(this.attributeList); - return + if (this.temporaryList[i].name.indexOf(this.attributeList.name) == -1 || this.temporaryList[i].name.indexOf(this.attributeList.name) == 1) { + if (this.temporaryList.length == (i + 1)) { + this.temporaryList.push(this.attributeList); + return } + } else { + this.temporaryList[i] = this.attributeList + return + } } diff --git a/pages/inventory/changeGoods1.vue b/pages/inventory/changeGoods1.vue index 0e0a73f..6b9817f 100644 --- a/pages/inventory/changeGoods1.vue +++ b/pages/inventory/changeGoods1.vue @@ -277,14 +277,15 @@ this.temporaryList.push(this.attributeList); } else { for (var i = 0; i < this.temporaryList.length; i++) { - if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) { + if (this.temporaryList[i].name.indexOf(this.attributeList.name) == -1 || this.temporaryList[i].name.indexOf(this.attributeList.name) == 1) { - return - } else { - if (this.temporaryList.length == (i+1)) { + if (this.temporaryList.length == (i+1)) { this.temporaryList.push(this.attributeList); - return + return } + } else { + return + } } diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue index 6f912bd..438e384 100644 --- a/pages/inventory/goodsList1.vue +++ b/pages/inventory/goodsList1.vue @@ -470,7 +470,6 @@ this.khName = [] this.saleId = '' } - for (let i = 0; i < this.carList1.length; i++) { if (this.carList.size == 0) { //当前页没有数据 @@ -478,8 +477,8 @@ purchasePrice: this.carList1[i].price, //采购价 price: 0, //总价 discount: 10, //折扣 - unitPrice: 0, //单价 - discountAmount: 0, //折后价 + unitPrice: this.carList1[i].unitPrice || 0, //单价 + discountAmount: this.carList1[i].unitPrice || 0, //折后价 wholesalePrice: this.carList1[i].wholesalePrice, //批发价 lsprice: this.carList1[i].lsprice, //零售价 productCount: 0, //总数量 @@ -497,9 +496,7 @@ obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount } this.carList.set(this.carList1[i].id, obj) - } else { //当前页有数据 - if (this.carList.has(this.carList1[i].id) == true) { //商品相同 for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) { if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i].saleDetailQueryDTO[ @@ -522,8 +519,8 @@ purchasePrice: this.carList1[i].price, //采购价 price: 0, discount: 10, - discountAmount: 0, - unitPrice: 0, //单价 + discountAmount: this.carList1[i].unitPrice || 0, + unitPrice: this.carList1[i].unitPrice || 0, //单价 wholesalePrice: this.carList1[i].wholesalePrice, //批发价 lsprice: this.carList1[i].lsprice, //零售价 productCount: 0, @@ -549,7 +546,9 @@ uni.removeStorageSync('saoma') this.carList1 = [] this.carList.forEach(function(value, key) { - if (that.priceType == 0) { //零售 + if(that.priceType == ''){ + // value.unitPrice = value.unitPrice + }else if (that.priceType == 0) { //零售 value.unitPrice = value.lsprice } else if (that.priceType == 1) { //批发 value.unitPrice = value.wholesalePrice @@ -641,14 +640,15 @@ this.temporaryList.push(this.attributeList); } else { for (var i = 0; i < this.temporaryList.length; i++) { - if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) { - this.temporaryList[i] = this.attributeList - return - } else { - if (this.temporaryList.length == (i + 1)) { - this.temporaryList.push(this.attributeList); - return + if (this.temporaryList[i].name.indexOf(this.attributeList.name) == -1 || this.temporaryList[i].name.indexOf(this.attributeList.name) == 1) { + if (this.temporaryList.length == (i + 1)) { + this.temporaryList.push(this.attributeList); + return } + } else { + this.temporaryList[i] = this.attributeList + return + } } @@ -732,7 +732,10 @@ let that = this; let price = 0 this.carList.forEach(function(value, key) { - if(that.priceType == 0){ //零售 + console.log(value.unitPrice) + if(that.priceType == ''){ + price = value.unitPrice + }else if(that.priceType == 0){ //零售 price = value.lsprice }else if(that.priceType == 1){ //批发 price = value.wholesalePrice