From 63762af8aefab0ccd1e7031bd9f4c21f486fc782 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Wed, 3 Jan 2024 18:01:20 +0800 Subject: [PATCH] 11 --- pages/billing/addUser.vue | 208 ++++++++++++++++++++---------- pages/index/addHangOrder.vue | 52 ++++++-- pages/index/order.vue | 2 +- pages/index/peopleList.vue | 1 + pages/index/waitStorageDetail.vue | 2 +- pages/inventory/goodsList1.vue | 147 +++++++++++---------- pages/rebate/rebateShare.vue | 2 +- 7 files changed, 263 insertions(+), 151 deletions(-) diff --git a/pages/billing/addUser.vue b/pages/billing/addUser.vue index 1702e7e..e0355f0 100644 --- a/pages/billing/addUser.vue +++ b/pages/billing/addUser.vue @@ -104,7 +104,8 @@ }, onLoad(option) { this.popleType = option.popleType - this.type=option.type + this.type=option.type + let data = JSON.parse(option.data) if (option.type = "edit") { this.formData.address1 = data.province + data.city + data.area this.formData.address = data.address @@ -112,8 +113,8 @@ this.formData.city = data.city this.formData.province = data.province this.formData.id = data.id - this.formData.consigneeMobile = data.consigneeMobile - this.formData.consigneeName = data.consigneeName + this.formData.consigneeMobile = data.consigneeMobile || data.phone + this.formData.consigneeName = data.consigneeName || data.name } }, methods: { @@ -121,23 +122,43 @@ this.delShow = true; }, delItemModal() { - this.delShow = false; - this.tui.request("/app/supplier/delByIds", "post", { - ids: this.formData.id, - }, false, true).then((res) => { - if (res.code == 200) { - uni.showToast({ - title: "删除成功", - icon: 'none' - }) - uni.navigateBack() - } else { - uni.showToast({ - title: "删除失败", - icon: 'none' - }) - } - }) + this.delShow = false; + if(this.popleType=="khName"){ + this.tui.request("/app/customer/delById", "post", { + id: this.formData.id, + }, false, true).then((res) => { + if (res.code == 200) { + uni.showToast({ + title: "删除成功", + icon: 'none' + }) + uni.navigateBack() + } else { + uni.showToast({ + title: "删除失败", + icon: 'none' + }) + } + }) + }else{ + this.tui.request("/app/supplier/delByIds", "post", { + ids: this.formData.id, + }, false, true).then((res) => { + if (res.code == 200) { + uni.showToast({ + title: "删除成功", + icon: 'none' + }) + uni.navigateBack() + } else { + uni.showToast({ + title: "删除失败", + icon: 'none' + }) + } + }) + } + }, nameBlur() { this.formData.username = this.formData.phone; @@ -166,57 +187,106 @@ let that = this; this.$refs.form.validate().then(res => { if(this.popleType == 'khName'){ - that.tui.request("/app/customer/save", "post", { - name:this.formData.consigneeName, - phone:this.formData.consigneeMobile, - address:this.formData.address, - province:this.addressObj.province, - city:this.addressObj.city, - area:this.addressObj.area, - userName:this.formData.consigneeMobile - }, false,true).then((res) => { - if (res.code == 200) { - uni.showToast({ - title: "添加成功", - icon: 'none' - }) - let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。 - let prevPage = pages[pages.length - 2]; //上一页页面实例 - prevPage.$vm.popleType = 'khName' - uni.navigateBack({ - delta: 1 - }) - } else { - uni.showToast({ - title: "添加失败", - icon: 'none' - }) - } - }) + if(that.type=='edit'){ + that.tui.request("/app/customer/edit", "post", { + name:this.formData.consigneeName, + phone:this.formData.consigneeMobile, + address:this.formData.address, + province:this.addressObj.province, + city:this.addressObj.city, + area:this.addressObj.area, + id:this.formData.id, + userName:this.formData.consigneeMobile + }, false,true).then((res) => { + if (res.code == 200) { + uni.showToast({ + title: "添加成功", + icon: 'none' + }) + let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。 + let prevPage = pages[pages.length - 2]; //上一页页面实例 + prevPage.$vm.popleType = 'khName' + uni.navigateBack({ + delta: 1 + }) + } else { + uni.showToast({ + title: "添加失败", + icon: 'none' + }) + } + }) + }else{ + that.tui.request("/app/customer/save", "post", { + name:this.formData.consigneeName, + phone:this.formData.consigneeMobile, + address:this.formData.address, + province:this.formData.province, + city:this.formData.city, + area:this.formData.area, + userName:this.formData.consigneeMobile + }, false,true).then((res) => { + if (res.code == 200) { + uni.showToast({ + title: "添加成功", + icon: 'none' + }) + let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。 + let prevPage = pages[pages.length - 2]; //上一页页面实例 + prevPage.$vm.popleType = 'khName' + uni.navigateBack({ + delta: 1 + }) + } else { + uni.showToast({ + title: "添加失败", + icon: 'none' + }) + } + }) + } + }else{ - that.tui.request("/app/supplier/save", "post", Object.assign(that.addressObj, res), false, - true).then((res) => { - if (res.code == 200) { - uni.showToast({ - title: "添加成功", - icon: 'none' - }) - let pages = - getCurrentPages(); - let prevPage = pages[pages.length - 2]; //上一页页面实例 - prevPage.$vm.popleType = 'gysName' - uni.navigateBack({ - delta: 1 - }) - } else { - uni.showToast({ - title: "添加失败", - icon: 'none' - }) - } - }) + if(that.type=='edit'){ + that.tui.request("/app/supplier/edit", "post", this.formData, false, + true).then((res) => { + if (res.code == 200) { + uni.showToast({ + title: "修改成功", + icon: 'none' + }) + uni.navigateBack() + } else { + uni.showToast({ + title: "修改失败", + icon: 'none' + }) + } + }) + }else{ + that.tui.request("/app/supplier/save", "post", Object.assign(that.addressObj, res), false, + true).then((res) => { + if (res.code == 200) { + uni.showToast({ + title: "添加成功", + icon: 'none' + }) + let pages = + getCurrentPages(); + let prevPage = pages[pages.length - 2]; //上一页页面实例 + prevPage.$vm.popleType = 'gysName' + uni.navigateBack({ + delta: 1 + }) + } else { + uni.showToast({ + title: "添加失败", + icon: 'none' + }) + } + }) + } } - }).catch(err => { }) } diff --git a/pages/index/addHangOrder.vue b/pages/index/addHangOrder.vue index 051565c..3c6be40 100644 --- a/pages/index/addHangOrder.vue +++ b/pages/index/addHangOrder.vue @@ -153,11 +153,13 @@ - - - - + + + + + + @@ -176,13 +178,15 @@ voiceText: '', recordState: false, pageNumber: 1, - regList: [], + regList: [], + show: false, list: [], value: '', indexList: [], pageNum: 1, //分页的页码 shopList: [], - info: 0, + info: 0, + dialogTit:'挂单名称', categoryId: '', //分类id searchName: '', //搜索框输入值 shopId: '', //店铺id, @@ -407,7 +411,8 @@ productId: this.goodsDetail.id, realPrice: this.zPrice, productCount: this.zNum, - discountAmount: this.zPrice, + discountAmount: this.purchasePrice, + unitPrice:this.purchasePrice, productName: this.goodsDetail.productName, productSn: this.goodsDetail.productSn, productPicture: this.goodsDetail.productPicture, @@ -542,6 +547,37 @@ }).catch((res) => { this.tui.toast(res) }) + }, + //带删除按钮的弹窗 + dialogDel(){ + this.delItem(this.list, 'del') + }, + delItem(item, type) { + this.delType = type; + this.delItems = item; + this.show = true; + }, + delItemModal() { + this.show = false; + console.log(this.delItems) + if(this.delType == 'del') { + this.tui.request("/app/sale/delById", "post", { + id: this.delItems.id, + }, false, true).then((res) => { + if (res.code == 200) { + this.getRegList() + uni.showToast({ + title:"删除成功", + icon: 'none' + }) + } else { + uni.showToast({ + title:"删除失败", + icon: 'none' + }) + } + }).catch((res) => {}) + } }, //删除整条挂单 delHangOrder() { diff --git a/pages/index/order.vue b/pages/index/order.vue index 9bc1ac6..2b0ca86 100644 --- a/pages/index/order.vue +++ b/pages/index/order.vue @@ -1,7 +1,7 @@