From cb137cbf88be33496416ed969b2fac3ef76d552e Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Mon, 27 Nov 2023 22:26:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=80=E5=8D=95=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=95=86=E5=93=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/.DS_Store | Bin 10244 -> 10244 bytes pages/billing/addUser.vue | 74 +------ pages/billing/billing.vue | 8 - pages/billing/changeGoods1.vue | 294 ++++++++++++---------------- pages/billing/goodsOutInfo.vue | 1 - pages/billing/outOrder.vue | 4 +- pages/billing/saveOrder.vue | 26 +-- pages/index/addHangOrder.vue | 16 +- pages/index/checkShop.vue | 1 - pages/index/downStearmList.vue | 267 +++++++++++++++---------- pages/index/downstream.vue | 1 - pages/index/index.vue | 15 +- pages/index/order.vue | 7 - pages/index/orderDetail.vue | 47 +---- pages/index/peopleList.vue | 11 +- pages/index/shareStyle.vue | 14 +- pages/index/shopInfo.vue | 1 - pages/index/uparrears.vue | 1 - pages/index/upstream.vue | 1 - pages/index/waitStorageDetail.vue | 2 - pages/info/editStore.vue | 133 ------------- pages/info/index.vue | 48 ----- pages/info/info.vue | 19 -- pages/inventory/addGoods.vue | 49 ++--- pages/inventory/changeGoods1.vue | 284 +++++++++++++-------------- pages/inventory/gategoryLow.vue | 20 +- pages/inventory/goodsList1.vue | 74 +++---- pages/inventory/inventoryDetail.vue | 2 +- 28 files changed, 522 insertions(+), 898 deletions(-) delete mode 100644 pages/info/editStore.vue delete mode 100644 pages/info/index.vue delete mode 100644 pages/info/info.vue diff --git a/pages/.DS_Store b/pages/.DS_Store index f59548819beb8f64f4882c746481a30f45db8f98..d73a6a30bc3b4764075700ce9b08084348043c10 100644 GIT binary patch delta 557 zcmZn(XbG6$&uF$WU^hRb*=8OA6-K6)Yd0GSRxt7;l@}Kz<>V(ZFfi<#EFeV{ zWMF8jqhMq*xm!eLa+;Xh%<>cq314S7pzY`YQd`Vb}k;(VohA!M7WG8JbJjT44UEvqYpF delta 493 zcmZn(XbG6$&uF|cU^hRb@n#+Y6-K6~d7F&{D;Ou&3iC19KAzkwEXDRbVc9IB#>s1i zWnj$n!gBQ+7=VC$bz}O9>_5OnaNEt$1PP$=ma(-?B zSd>A~9a%0n-^B%L21i76mglDWqmHQZDF}IGED8!TkPSCrnA|Tawpm_8ijj%s3y3X* zY=il7_X`gjC-;g { - // if (res.code == 200) { - // uni.showToast({ - // title: "删除成功", - // icon: 'none' - // }) - // uni.navigateBack() - // } else { - // uni.showToast({ - // title: "删除失败", - // icon: 'none' - // }) - // } - // }) }, nameBlur() { this.formData.username = this.formData.phone; }, openPicker() { - console.log('执行打开地址选择器') this.show = true }, onhideShow() { this.show = false - console.log('执行了关闭地址选择器') }, //选中省市区 onsetCity(e) { @@ -184,8 +160,6 @@ city: data.city, area: data.area, } - - console.log(this.formData, this.addressObj); }, // 触发提交表单 submit() { @@ -242,50 +216,8 @@ } }) } - // if (that.type == 'edit') { - - // res.id = that.userInfo.id - // 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 => { - console.log('表单错误信息:', err); }) } } diff --git a/pages/billing/billing.vue b/pages/billing/billing.vue index fd4a33d..fb6f8ee 100644 --- a/pages/billing/billing.vue +++ b/pages/billing/billing.vue @@ -26,13 +26,6 @@ totalPages: 1, } }, - onShow() { - // this.tui.request("/app/sale/list", "post", { - // pageNumber: this.pageIndex, - // pageSize: this.pageSize, - // }, false, false).then((res) => { - // }) - }, methods: { scanCodeAdd() { @@ -52,7 +45,6 @@ }) }, goodsAdd() { - // &purchaseDetails=" + encodeURIComponent(JSON.stringify(this.saleDetailList)) uni.navigateTo({ url: "/pages/inventory/goodsList?type=billing" }) diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue index dba1f0a..0d87baa 100644 --- a/pages/billing/changeGoods1.vue +++ b/pages/billing/changeGoods1.vue @@ -63,23 +63,16 @@ - {{goodsDetail.productName}} {{goodsDetail.productSn}} - -
  • @@ -104,7 +97,7 @@ {{zNum}} 件 - ¥{{zPrice}} + 选好了 @@ -113,51 +106,36 @@ - - - - - 选择商品价格 - - - 零售价:¥{{goodsDetail.price}} - - - 批发价:¥{{goodsDetail.wholesalePrice}} - - - - + - - {{value[1].productName}} - {{value[1].productSn}} - - ¥{{value[1].price}} - - + {{item.productName}} + {{item.productSn}} + + 供应商:{{item.supplierName}} + - + - + - {{values[0] | sliceMsg}} + {{item1.attributeList | sliceMsg}} - + @@ -204,9 +182,7 @@ storageType: '', carNum: 0, carType: 0, - type: '', - oldList: [], - newList: new Map() + type: '' } }, filters: { @@ -235,9 +211,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++) { @@ -298,15 +272,15 @@ if (this.temporaryList.length == 0) { this.temporaryList.push(this.attributeList); } else { - for (var i = 0; i < this.temporaryList.length; i++) { + for (var i = 0; i < this.temporaryList.length; i++) { + console.log(this.temporaryList[i].name.indexOf(this.attributeList.name)) 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 - } + }else{ + if (this.temporaryList.length == (i + 1)) { + this.temporaryList.push(this.attributeList); + return + } } } @@ -316,9 +290,7 @@ }, temporaryChange(val) { - console.log(val) this.zNum = 0 - console.log(this.temporaryList) for (var i = 0; i < this.temporaryList.length; i++) { this.zNum += this.temporaryList[i].productCount } @@ -343,24 +315,36 @@ pageSize: '10' }, false, false).then((res) => { if (res.code == 200) { - console.log(res.result.records) + this.shopList = res.result.records } else { this.tui.toast(res.message) } }).catch((res) => {}) + }, + change(){ + }, - //获取弹出层状态 - change(e) { - console.log('当前模式:' + e.type + ',状态:' + e.show); + // + carChange(e,index,index1) { + console.log(this.carList) + this.carNum = 0 + for (let i = 0; i < this.carList.length; i++) { + this.carList[i].num = 0 + for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) { + this.carList[i].num += this.carList[i].saleDetailQueryDTO[m].productCount + } + this.carNum += this.carList[i].num + } }, //弹出购物车或者商品规格选择弹窗 toggle(type, item) { // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 if (type == 'carPopup') { + + this.oldList = this.carList console.log(this.carList) - this.oldList = this.carList - this.newFun() + // this.newFun() this.carNum = 0 for (let i = 0; i < this.carList.length; i++) { this.carNum += this.carList[i].num @@ -373,114 +357,55 @@ } }, - newFun() { - //newList 已经是map格式了 新数组 初始为空 - //carList 旧数组 - for (let i = 0; i < this.carList.length; i++) { - if (this.newList.size == 0) { //首次放值,直接放就行 - let obj = { - purchasePrice: this.carList[i].price, //采购价 - price: 0, //总价 - discount: 10, //折扣 - unitPrice: 0, //单价 - discountAmount: 0, //折后价 - wholesalePrice: this.carList[i].wholesalePrice, //批发价 - lsprice: this.carList[i].lsprice, //零售价 - productCount: 0, //总数量 - productId: this.carList[i].id, - productName: this.carList[i].productName, - productPicture: this.carList[i].productPicture, - productSn: this.carList[i].productSn, - stockLogList: new Map(), - stockLogList1: [], - supplierName: this.carList[i].supplierName //供应商 - } - for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) { - obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i] - .saleDetailQueryDTO[m].productCount) - } - this.newList.set(this.carList[i].id, obj) - } else { //不是首次,里面有值 - - if (this.newList.has(this.carList[i].id) == true) { //商品相同 ,给循环,判断规格是不是相同 - for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) { - if (this.newList.get(this.carList[i].id).stockLogList.has(this.carList[i] - .saleDetailQueryDTO[m].attributeList) == true) { //规格相同 - this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.newList.get(this.carList[i].id).stockLogList.get(this.carList[i].saleDetailQueryDTO[m].attributeList) + this.carList[i].saleDetailQueryDTO[m].productCount) - } else { //规格不同 - this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i] - .saleDetailQueryDTO[m]) - } - } - } else { //商品不同,可以直接给map.set - let obj = { - purchasePrice: this.carList[i].price, //采购价 - price: 0, - discount: 10, - discountAmount: 0, - unitPrice: 0, //单价 - wholesalePrice: this.carList[i].wholesalePrice, //批发价 - lsprice: this.carList[i].lsprice, //零售价 - productCount: 0, - productId: this.carList[i].id, - productName: this.carList[i].productName, - productPicture: this.carList[i].productPicture, - stockLogList: new Map(), - stockLogList1: [], - productSn: this.carList[i].productSn, - supplierName: this.carList[i].supplierName - } - for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) { - obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i] - .saleDetailQueryDTO[m].productCount) - obj.productCount += this.carList[i].saleDetailQueryDTO[m].productCount - } - this.newList.set(this.carList[i].id, obj) - } - } - } - }, //选择商品查询商品规格 checkGoods(item) { - this.tui.request("/app/product/getById/" + item.id, "POST", {}, false, true).then((res) => { - if (res.code == 200) { - this.goodsDetail = res.result; - this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", { - categoryId: this.goodsDetail.categoryId - }, false, true).then((res1) => { - if (res1.code == 200) { - if (typeof(res1.result) == 'string') { - let newObj = JSON.parse(res1.result) - let newArr = [] - for (let val in newObj) { - let valueObj = []; - for (var i = 0; i < newObj[val].length; i++) { - valueObj.push({ - value: newObj[val][i], - isChecked: false - }) - } - newArr.push({ - name: val, - value: valueObj - }) - } - this.goodsDetail.attributeList = newArr; - this.goodsDetail.attributeList.forEach((item, index) => { - this.columns[index] = item.value; - this.keyList[index] = item.name; + this.goodsDetail = item; + this.temporaryList = [] + this.columns = [] + this.keyList = [] + console.log(this.temporaryList) + console.log(this.carList) + if(this.carList != ''){ + this.zNum = 0 + for(let i=0;i { + if (res1.code == 200) { + if (typeof(res1.result) == 'string') { + let newObj = JSON.parse(res1.result) + let newArr = [] + for (let val in newObj) { + let valueObj = []; + for (var i = 0; i < newObj[val].length; i++) { + valueObj.push({ + value: newObj[val][i], + isChecked: false }) } - - } else { - this.tui.toast(res.message) + newArr.push({ + name: val, + value: valueObj + }) } - }).catch((res) => {}) + this.goodsDetail.attributeList = newArr; + this.goodsDetail.attributeList.forEach((item, index) => { + this.columns[index] = item.value; + this.keyList[index] = item.name; + }) + } + } else { this.tui.toast(res.message) } }).catch((res) => {}) - }, //顶部搜索框 search(res) { @@ -513,9 +438,9 @@ this.categoryId = this.indexList[index].id this.getShareList(this.indexList[index].id) }, - inputDialogToggle() { - this.$refs.inputDialog.open() - }, + // inputDialogToggle() { + // this.$refs.inputDialog.open() + // }, //临时改价 changePrice(val) { this.goodsDetail.price = this.temporaryList[0].price = val @@ -534,16 +459,30 @@ saleDetailQueryDTO1: [], wholesalePrice: this.goodsDetail.wholesalePrice, lsprice: this.goodsDetail.price + } + if(this.carList.length == 0){ + this.carList.push(data) + }else{ + let aa = true; + for(let i = 0; i < this.carList.length; i++){ + if(this.carList[i].id == data.id){ + this.carList[i] = data + aa = false + } + } + if(aa){ + this.carList.push(data) + } } - - this.carList.push(data) + + for (let i = 0; i < this.carList.length; i++) { this.carList[i].num = 0 for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) { this.carList[i].num += this.carList[i].saleDetailQueryDTO[m].productCount } } - console.log(this.carList) + this.temporaryList = [] this.purchasePrice = '' this.zPrice = '' @@ -558,33 +497,50 @@ }, //删除整条商品 - delShop(id) { + delShop(item) { var that = this; uni.showModal({ title: "提示", content: "确定删除此条商品吗?", success: function(res) { - if (res.confirm) { - if (that.newList.has(id) == true) { - that.newList.delete(id) + if (res.confirm) { + for(let i=0;i { - console.log('表单数据信息:', res); + }).catch(err => { - console.log('表单错误信息:', err); + }) } } diff --git a/pages/billing/saveOrder.vue b/pages/billing/saveOrder.vue index 7c70d68..b26a87e 100644 --- a/pages/billing/saveOrder.vue +++ b/pages/billing/saveOrder.vue @@ -86,7 +86,6 @@ if (res.code == 200) { this.categoryList = res.result; this.candidates = res.result.map(item =>{ return item.name}) - // this.formData.name = ""; this.formData.address1 = ""; this.formData.address = ""; @@ -98,18 +97,13 @@ if (res.code !== 200) return this.staffList = res.result; this.createCandidates = res.result.map(item =>{ return item.nickname}) - console.log(this.createCandidates,'this.createCandidates'); + }) }, onLoad(options) { this.purchase = JSON.parse(decodeURIComponent(options.purchase)) this.saleDetailList = JSON.parse(decodeURIComponent(options.saleDetailList)) }, - // computed:{ - // payStatus() { - - // } - // } methods:{ addUser( type ) { if(type == 'add') { @@ -133,7 +127,6 @@ if(obj.length > 0) { this.userObj = obj[0] this.userObj.address1 = obj[0].province + obj[0].city + obj[0].area; - // this.formData = Object.assign(this.formData, this.userObj) this.formData.address1 = this.userObj.address1 this.formData.address = this.userObj.address this.formData.area = this.userObj.area @@ -196,15 +189,6 @@ } }) }, - /** - * 复写 binddata 方法,如果只是为了校验,无复杂自定义操作,可忽略此方法 - * @param {String} name 字段名称 - * @param {String} value 表单域的值 - */ - // binddata(name,value){ - // 通过 input 事件设置表单指定 name 的值 - // this.$refs.form.setValue(name, value) - // }, // 触发提交表单 submit() { let companyId @@ -235,7 +219,7 @@ } else { payStatus = 0 } - console.log(this.purchase,'this.purchase'); + let obj = { orderByWorker: workerId, sale: { @@ -257,9 +241,9 @@ saleDetailList: this.saleDetailList, transCompany: companyId, } - console.log(this.formData,this.saleDetailList, workerId, companyId ,this.company,this.orderByWorkerList, obj); + this.$refs.form.validate().then(res => { - console.log('表单数据信息:', res); + this.tui.request("/app/sale/buyNew", "post", obj, false, false).then((res) => { if (res.code == 200) { uni.showToast({ @@ -277,7 +261,7 @@ } }) }).catch(err => { - console.log('表单错误信息:', err); + }) } } diff --git a/pages/index/addHangOrder.vue b/pages/index/addHangOrder.vue index b56f367..fcd7e8c 100644 --- a/pages/index/addHangOrder.vue +++ b/pages/index/addHangOrder.vue @@ -50,7 +50,7 @@ - + 语音录入 @@ -77,7 +77,7 @@ - + @@ -105,7 +105,7 @@ + > {{itemTag.value}} @@ -132,7 +132,7 @@ - + 选择商品价格 @@ -156,7 +156,7 @@ @confirm="setDetail"> - + @@ -244,9 +244,6 @@ clickCollapse(item) { item.isCollapse = !item.isCollapse }, - change(e) { - console.log('当前模式:' + e.type + ',状态:' + e.show); - }, //关闭弹出层 close() { this.$refs.popup.close() @@ -561,7 +558,6 @@ delGoods(item, productId) { let that = this; this.hangId = item.id; - console.log(item.saleDetailDTOList) uni.showModal({ title: "提示", content: "确定删除此条商品吗?", @@ -582,7 +578,6 @@ delGoodsPrecs(item, index, index1) { let that = this; this.hangId = item.id; - console.log(item.saleDetailDTOList) uni.showModal({ title: "提示", content: "确定删除此条规格吗?", @@ -643,7 +638,6 @@ obj.createByName = item.createByName dataList.push(obj) } - console.log(dataList) uni.setStorageSync('carList1', JSON.stringify(dataList)) uni.setStorageSync('khName', '') } diff --git a/pages/index/checkShop.vue b/pages/index/checkShop.vue index 4f09de4..ee93411 100644 --- a/pages/index/checkShop.vue +++ b/pages/index/checkShop.vue @@ -145,7 +145,6 @@ export default { }else{ this.tui.toast(res.message) } - console.log(res) }) } } diff --git a/pages/index/downStearmList.vue b/pages/index/downStearmList.vue index b990e4b..c0f1e7e 100644 --- a/pages/index/downStearmList.vue +++ b/pages/index/downStearmList.vue @@ -54,7 +54,7 @@ - + {{goodsDetail.productName}} @@ -129,10 +129,10 @@ - + - + {{item.productName}} @@ -140,22 +140,22 @@ ¥{{item.price}} - + - + - + - {{items.name}} + {{item1.name}} - + @@ -165,7 +165,7 @@ {{carType}} 款 {{carNum}} 件 - 选好了 + 关闭 @@ -271,7 +271,8 @@ } this.keyList.map((item, index) => { obj[item] = evalue[index] - }) + }) + let jishuqi = 0; for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { if (this.goodsDetail.attributeList[i].isChecked == true) { @@ -296,18 +297,21 @@ if (this.temporaryList.length == 0) { 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 - } - } + for (var i = 0; i < this.temporaryList.length; i++) { + console.log(this.temporaryList[i].name.indexOf(this.attributeList.name)) + if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) { + console.log(this.temporaryList) + return + }else{ + if (this.temporaryList.length == (i + 1)) { + this.temporaryList.push(this.attributeList); + console.log(this.temporaryList) + return + } + } } - } + } + } }, temporaryChange(val) { @@ -323,18 +327,19 @@ }, //获取弹出层状态 change(e) { - console.log('当前模式:' + e.type + ',状态:' + e.show); + }, //弹出购物车或者商品规格选择弹窗 toggle(type, item) { this.type = type // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 - if (type == 'carPopup') { - this.$refs.carPopup.open('bottom') - for (let i = 0; i < this.carList.length; i++) { - this.carNum += this.carList[i].num - } + if (type == 'carPopup') { + this.carNum = 0 + for (let i = 0; i < this.carList.length; i++) { + this.carNum += this.carList[i].num + } + this.$refs.carPopup.open('bottom') this.carType = this.carList.length } else { this.checkGoods(item); @@ -344,46 +349,54 @@ }, //选择商品查询商品规格 checkGoods(item) { - this.purchasePrice = item.price; - this.tui.request("/app/product/getById/" + item.id, "POST", {}, false, true).then((res) => { - if (res.code == 200) { - this.goodsDetail = res.result; - this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", { - categoryId: this.goodsDetail.categoryId - }, false, true).then((res1) => { - if (res1.code == 200) { - if (typeof(res1.result) == 'string') { - let newObj = JSON.parse(res1.result) - let newArr = [] - for (let val in newObj) { - let valueObj = []; - for (var i = 0; i < newObj[val].length; i++) { - valueObj.push({ - value: newObj[val][i], - isChecked: false - }) - } - newArr.push({ - name: val, - value: valueObj - }) - } - this.goodsDetail.attributeList = newArr; - this.goodsDetail.attributeList.forEach((item, index) => { - this.columns[index] = item.value; - this.keyList[index] = item.name; + this.purchasePrice = item.price; + this.goodsDetail = item; + this.temporaryList = [] + this.columns = [] + this.keyList = [] + console.log(this.temporaryList) + console.log(this.carList) + if(this.carList != ''){ + this.zNum = 0 + for(let i=0;i { + if (res1.code == 200) { + if (typeof(res1.result) == 'string') { + let newObj = JSON.parse(res1.result) + let newArr = [] + for (let val in newObj) { + let valueObj = []; + for (var i = 0; i < newObj[val].length; i++) { + valueObj.push({ + value: newObj[val][i], + isChecked: false }) } - - } else { - this.tui.toast(res.message) + newArr.push({ + name: val, + value: valueObj + }) } - }).catch((res) => {}) + this.goodsDetail.attributeList = newArr; + this.goodsDetail.attributeList.forEach((item, index) => { + this.columns[index] = item.value; + this.keyList[index] = item.name; + }) + } + } else { this.tui.toast(res.message) } }).catch((res) => {}) - }, //顶部搜索框 search(res) { @@ -392,6 +405,17 @@ }, inputDialogToggle() { this.$refs.inputDialog.open() + }, + carChange(e,index,index1) { + console.log(this.carList) + this.carNum = 0 + for (let i = 0; i < this.carList.length; i++) { + this.carList[i].num = 0 + for (let m = 0; m < this.carList[i].stockLogList1.length; m++) { + this.carList[i].num += this.carList[i].stockLogList1[m].productCount + } + this.carNum += this.carList[i].num + } }, //弹窗选择规格后,点击弹窗中选好了按钮 temporaryCheck() { @@ -406,8 +430,30 @@ stockLogList1: this.temporaryList, wholesalePrice: this.goodsDetail.wholesalePrice, lsprice: this.goodsDetail.price - } - this.carList.push(data) + } + + if(this.carList.length == 0){ + this.carList.push(data) + }else{ + let aa = true; + for(let i = 0; i < this.carList.length; i++){ + if(this.carList[i].productId == data.productId){ + this.carList[i] = data + aa = false + } + } + if(aa){ + this.carList.push(data) + } + } + + for (let i = 0; i < this.carList.length; i++) { + this.carList[i].num = 0 + for (let m = 0; m < this.carList[i].stockLogList1.length; m++) { + this.carList[i].num += this.carList[i].stockLogList1[m].productCount + } + } + this.temporaryList = [] this.purchasePrice = '' this.zPrice = '' @@ -421,46 +467,57 @@ this.$refs.popup.close() }, - //删除整条商品 - delShop(id) { - var that = this; - console.log(this.carList) - for (let i = 0; i < this.carList.length; i++) { - if (this.carList[i].id == id) { - uni.showModal({ - title: "提示", - content: "确定删除此条商品吗?", - success: function(res) { - if (res.confirm) { - that.carList.splice(i, 1) - } - } - }) - } - } - }, - //删除商品下的某一个规格 - delShopSpec(name) { - var that = this; - console.log(this.carList) - for (let i = 0; i < this.carList.length; i++) { - for (let m = 0; m < this.carList[i].stockLogList1.length; m++) { - if (this.carList[i].stockLogList1[m].name == name) { - uni.showModal({ - title: "提示", - content: "确定删除此条商品吗?", - success: function(res) { - if (res.confirm) { - that.carList[i].stockLogList1.splice(m, 1) - if (that.carList[i].stockLogList1.length == 0) { - that.carList.splice(i, 1) + //删除整条商品 + delShop(item) { + var that = this; + uni.showModal({ + title: "提示", + content: "确定删除此条商品吗?", + success: function(res) { + if (res.confirm) { + for(let i=0;i { - console.log('表单错误信息:', err); + }) }, openPicker() { - console.log('执行打开地址选择器') + this.show = true }, onhideShow() { this.show = false - console.log('执行了关闭地址选择器') + }, //选中省市区 onsetCity(e) { @@ -517,7 +574,7 @@ area: data.area, } - console.log(this.formData, this.addressObj); + }, //点击分类获取商品列表 getShareList(id) { diff --git a/pages/index/downstream.vue b/pages/index/downstream.vue index 4562bcd..43e829a 100644 --- a/pages/index/downstream.vue +++ b/pages/index/downstream.vue @@ -48,7 +48,6 @@ export default { }, false, true).then((res) => { if(res.code == 200){ this.list = res.result - console.log(res) }else{ this.tui.toast(res.message) } diff --git a/pages/index/index.vue b/pages/index/index.vue index 533e5f3..416bc02 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -140,7 +140,6 @@ settingShow: false, chartData: {}, shopName:'', - //您可以通过修改 config-ucharts.js 文件中下标为 ['line'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。 opts: { // color: ["#1890FF", "#73C0DE"], padding: [15, 10, 0, 15], @@ -208,7 +207,6 @@ }, false, false).then((res) => { if(res.code == 200){ this.shopInfo = res.result - console.log(res) }else{ this.tui.toast(res.message) } @@ -217,9 +215,6 @@ }, goToInfo() { this.settingShow = true - // uni.navigateTo({ - // url: '/pages/info/index' - // }) }, gotoSearchData() { uni.navigateTo({ @@ -259,7 +254,7 @@ let dataList = { categories: this.getWeek(), series: [{ - name: "周销售额", + name: "七天营收统计", linearColor: [ [0,"#1890FF"], [0.33,"#00B5FF"], @@ -278,10 +273,6 @@ }) }, getWeek() { - // var date = new Date(); - // var day = date.getDay(); - // var names = ["周日","周一","周二","周三","周四","周五","周六"]; - // return names[day]; let days = 7 let week = ["周日","周一","周二","周三","周四","周五","周六"]; let dateList = Array.from({length:days},(v,i)=> i).map(day =>{ @@ -320,12 +311,8 @@ top: var(--status-bar-height); .contentPadding { - // margin: 24upx; padding: 28upx 20upx; - // text-align: center; background-color: #fff; - // border-radius: 14rpx; - // box-shadow: 0px 1px 10px 2px #e2e2e2; color: #909399; .title { diff --git a/pages/index/order.vue b/pages/index/order.vue index 80f986c..5e8e133 100644 --- a/pages/index/order.vue +++ b/pages/index/order.vue @@ -43,7 +43,6 @@ }; }, onLoad(options) { - console.log('options', options); this.type = options.type; this.listStatus = options.listStatus @@ -59,15 +58,9 @@ }, methods: { gotoDetail(id) { - // if(this.type =='order') { uni.navigateTo({ url: '/pages/index/orderDetail?id=' + id }) - // } else { - // uni.navigateTo({ - // url: '/pages/index/returnList?id=' + id - // }) - // } }, searchList() { this.page = 1; diff --git a/pages/index/orderDetail.vue b/pages/index/orderDetail.vue index 7b9a9c1..dbc00db 100644 --- a/pages/index/orderDetail.vue +++ b/pages/index/orderDetail.vue @@ -4,19 +4,7 @@ {{sales.province + sales.area + sales.city + sales.receiveAddress}} - - + @@ -267,10 +255,8 @@ computed: { returnAmount() { if (this.changeAmount) { - console.log(this.changeAmount, 'this.changeAmount'); if (this.sales.noEarn >= this.changeAmount) { this.sales.newNoEarn = (this.sales.noEarn - this.changeAmount).toFixed(2); - console.log(this.sales.newNoEarn); return 0 } else { this.sales.newNoEarn = 0 @@ -282,9 +268,7 @@ if (this.isReturn) { let sum = 0 this.list.forEach(item1 => { - console.log(item1); item1.stockLogList1.forEach(v => { - console.log(v); if (v.returnCount) { sum = v.returnCount * item1.wholesalePrice + sum } @@ -342,10 +326,6 @@ this.tui.toast(res.message) } }).catch((res) => {}) - // this.tui.request("/app/return/get/" + option.id, "GET", null, false, false).then((res) => { - // if (res.code == 200 && res.result != null && res.result != undefined) { - // } - // }).catch((res) => {}) this.getReturnOrder(option.id) this.collectionList(option.id) } @@ -385,17 +365,7 @@ strCmd += blesdk.addCPCLText('50', '730', '24', '0', 0, '店铺:'+this.sales.shopName) strCmd += blesdk.addCPCLText('50', '810', '24', '0', 0, '13521030702') strCmd += blesdk.addCPCLText('50', '890', '24', '0', 0, '地址:早市10059') - // strCmd += blesdk.addCPCLText(200,0,'24','5',0,'收件联');// 文字 - // for (let item in this.list) { - // console.log(item, this.list,this.list[item] ); - // strCmd += blesdk.addCPCLText('50', '', this.list[item].productName + ' ¥' + this.list[item].wholesalePrice + ' * ' + (this.sales.discount < 10 ? this.sales.discount : this.list[item].discount),'', '', '') - // this.list[item].saleDetailQueryDTO.forEach(val => { - // strCmd += blesdk.addCPCLText('', '', val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") + '*'+ val.productCount, '', '', '') - // }) - // } - // strCmd += blesdk.addCPCLText('', '', '已付款:',this.sales.alreadyEarn,'', '') - // strCmd += blesdk.addCPCLQRCode(400,0,'H','1',5,'2348902384932843290') //二维码 - strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 + strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLPrint(); this.bufferData = strCmd; }, @@ -441,7 +411,6 @@ this.editNoPrice = true; }, getNoPay(en) { - console.log(en, 'en'); if (en != undefined) { if (0 < en && en <= this.sales.noEarn) { this.sales.noEarn = this.sales.newEarn - en; @@ -467,7 +436,6 @@ if (res.code == 200 && res.result != null && res.result != undefined) { this.shopList.push(...res.result.saleDetailDTOList); - console.log(this.shopList); } }).catch((res) => {}) }) @@ -493,19 +461,13 @@ } }) }, - valChange() { - console.log(this.list); - }, open() { this.popupShow = true - // console.log('open'); }, close() { this.popupShow = false - // console.log('close'); }, sureReturn() { - console.log(this.list); this.list.forEach(item1 => { item1.stockLogList1.forEach(item2 => { if (item2.returnCount) { @@ -518,10 +480,7 @@ }) let worderId = '' if (this.orderByWorker) { - console.log(this.orderByWorker); for (let key in this.orderByWorkerList) { - console.log(this.orderByWorker, this.orderByWorkerList[key].workerName, this.orderByWorker == this - .orderByWorkerList[key].workerName); if (this.orderByWorker == this.orderByWorkerList[key].workerName) { worderId = this.orderByWorkerList[key].workerId } @@ -530,7 +489,6 @@ this.sales.noEarn = this.sales.newNoEarn; this.sales.saleId = this.sales.id; this.sales.totalAomount = this.returnAmount; - console.log(this.sales, this.list, this.orderByWorker); this.tui.request("/app/return/rtg", "post", { returnSale: this.sales, returnSaleDetailList: this.list, @@ -571,7 +529,6 @@ status: 3 }, true, true).then((res1) => { if (res1.code == 200) { - console.log(res1) this.tui.toast("取消订单成功") uni.navigateBack() } else { diff --git a/pages/index/peopleList.vue b/pages/index/peopleList.vue index 6137fd7..a296f24 100644 --- a/pages/index/peopleList.vue +++ b/pages/index/peopleList.vue @@ -40,7 +40,7 @@ - + 收费标准 @@ -77,8 +77,7 @@ }, onLoad(options) { this.popleType = options.popleType - this.companyType = options.companyType || '' - console.log(options.companyType) + this.companyType = options.companyType || '' // this.radioType = options.radioType if (options.popleType == 'khName' || options.popleType == 'gysName') { //供应商或者客户 this.khOrGysList(); @@ -151,8 +150,7 @@ }) }, //拨打电话 - clickPhone(phone) { - console.log(phone); + clickPhone(phone) { uni.makePhoneCall({ phoneNumber: phone }); @@ -182,9 +180,6 @@ this.type = type this.$refs.popup.open(type) }, - change(e) { - console.log('当前模式:' + e.type + ',状态:' + e.show); - }, //关闭弹出层 close() { this.$refs.popup.close() diff --git a/pages/index/shareStyle.vue b/pages/index/shareStyle.vue index 6169423..312b5bb 100644 --- a/pages/index/shareStyle.vue +++ b/pages/index/shareStyle.vue @@ -126,7 +126,7 @@ uni.hideHomeButton() //左上角HOME按钮 }, onLoad(options) { - console.log(options.khid) + if (options.khid != undefined) { uni.redirectTo({ url: "/pages/index/downStearmList?khid=" + options.khid @@ -167,7 +167,7 @@ pageSize: '100' }, false, false).then((res) => { if (res.code == 200) { - console.log(res.result.records) + this.shopList.push(res.result.records) this.goodsList = this.shopList[0] } else { @@ -209,7 +209,7 @@ }, //选中商品 checkboxChange(item) { - console.log(item) + item.checked = !item.checked if (this.carList.indexOf(item.id) != -1) { this.carList.splice(this.carList.indexOf(item.id), 1) @@ -221,11 +221,11 @@ } else { for (let i = 0; i < this.gwcList.length; i++) { if (this.gwcList[i].id == item.id) { - console.log('这里') + this.gwcList.splice(i, 1) } else { if (this.gwcList.length == (i + 1)) { - console.log('是不是那里') + this.gwcList.push(item) return } @@ -234,7 +234,7 @@ } } - console.log('gwcList', this.gwcList) + }, //点击分享按钮 clickShareBtn(e) { @@ -302,7 +302,7 @@ success: function(res) { if (res.confirm) { for (let i = 0; i < that.gwcList.length; i++) { - console.log('匹配吗?',that.goodsList) + if (that.gwcList[i].id == id) { that.carList.splice(that.carList.indexOf(id), 1) that.carType = that.carList.length diff --git a/pages/index/shopInfo.vue b/pages/index/shopInfo.vue index edbf444..51db61d 100644 --- a/pages/index/shopInfo.vue +++ b/pages/index/shopInfo.vue @@ -52,7 +52,6 @@ export default { } }, onLoad(options) { - console.log(this.mobile) this.addForm.mobile = this.mobile }, methods:{ diff --git a/pages/index/uparrears.vue b/pages/index/uparrears.vue index 022dab3..3820b0f 100644 --- a/pages/index/uparrears.vue +++ b/pages/index/uparrears.vue @@ -63,7 +63,6 @@ }, false, true).then((res) => { if (res.code == 200) { this.list = res.result - console.log(res) } else { this.tui.toast(res.message) } diff --git a/pages/index/upstream.vue b/pages/index/upstream.vue index 7c39377..0d3ea89 100644 --- a/pages/index/upstream.vue +++ b/pages/index/upstream.vue @@ -51,7 +51,6 @@ }, false, true).then((res) => { if (res.code == 200) { this.list = res.result - console.log(res) } else { this.tui.toast(res.message) } diff --git a/pages/index/waitStorageDetail.vue b/pages/index/waitStorageDetail.vue index 30974c9..a1516f9 100644 --- a/pages/index/waitStorageDetail.vue +++ b/pages/index/waitStorageDetail.vue @@ -249,8 +249,6 @@ changePrice(val) { let that = this; that.shouldPay = 0 - console.log(that.goodsList) - console.log(this.index) that.goodsList[that.index].purchasePrice = val that.goodsList[that.index].price = val * that.goodsList[that.index].productCount; that.goodsList.forEach(function(value, key) { diff --git a/pages/info/editStore.vue b/pages/info/editStore.vue deleted file mode 100644 index 1404c39..0000000 --- a/pages/info/editStore.vue +++ /dev/null @@ -1,133 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/info/index.vue b/pages/info/index.vue deleted file mode 100644 index 96d0e8b..0000000 --- a/pages/info/index.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/info/info.vue b/pages/info/info.vue deleted file mode 100644 index 6c37880..0000000 --- a/pages/info/info.vue +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/pages/inventory/addGoods.vue b/pages/inventory/addGoods.vue index 7f9a83f..15d52e2 100644 --- a/pages/inventory/addGoods.vue +++ b/pages/inventory/addGoods.vue @@ -67,7 +67,8 @@ categoryList: [], productId:'', arrtList: [], - arrtChange: [], + arrtChange: [], + dataList:[], rules: { categoryId: { rules: [{ @@ -121,18 +122,19 @@ // }) }, onLoad(option) { - console.log(JSON.parse(option.dataList)) - this.dataList = JSON.parse(option.dataList) - this.formData.productName = this.dataList.productName - this.formData.price = this.dataList.price - this.formData.productSn = this.dataList.productSn - this.formData.wholesalePrice = this.dataList.wholesalePrice - this.formData.productPicture = this.dataList.productPicture - this.formData.productIntro = this.dataList.productIntro - this.formData.categoryId = this.dataList.categoryId - this.formData.salesWeek = this.dataList.salesWeek - this.formData.tailWarn = this.dataList.tailWarn - + console.log('option',option) + if(option.dataList){ + this.dataList = JSON.parse(option.dataList) + this.formData.productName = this.dataList.productName + this.formData.price = this.dataList.price + this.formData.productSn = this.dataList.productSn + this.formData.wholesalePrice = this.dataList.wholesalePrice + this.formData.productPicture = this.dataList.productPicture + this.formData.productIntro = this.dataList.productIntro + this.formData.categoryId = this.dataList.categoryId + this.formData.salesWeek = this.dataList.salesWeek + this.formData.tailWarn = this.dataList.tailWarn + } this.tui.request("/app/productCategory/list", "get", { // shopId: 1, }, false, true).then((res) => { @@ -155,12 +157,12 @@ }, // 新增图片 async afterRead(event) { - console.log(event); + // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式 let lists = [].concat(event.file) if (this.formData.productPicture == undefined) this.formData.productPicture = []; let fileListLen = this[`fileList${event.name}`].length - console.log(lists, 'lists'); + lists.map((item) => { this[`fileList${event.name}`].push({ ...item, @@ -168,7 +170,7 @@ message: '上传中' }) }) - console.log(this.formData.productPicture); + for (let i = 0; i < lists.length; i++) { const result = await this.uploadFilePromise(lists[i].url) let item = this[`fileList${event.name}`][fileListLen] @@ -181,7 +183,7 @@ } }, uploadFilePromise(url) { - console.log(url); + return new Promise((resolve, reject) => { let a = uni.uploadFile({ url: 'https://storage.xenjoyou.com/hiver/upload/file', @@ -193,7 +195,7 @@ }, formData: {}, success: (uploadFileRes) => { - console.log("这里", uploadFileRes) + let path = JSON.parse(uploadFileRes.data) //后端返回的地址,存入图片地址 this.formData.productPicture = path.result @@ -206,18 +208,19 @@ }, // 触发提交表单 submit() { + let that = this; let url = '' this.$refs.form.validate().then(res => { - if(this.dataList.id !=''){ + if(that.dataList !=''){ url = '/app/product/edit' - res.id = this.dataList.id + res.id = that.dataList.id }else{ url = '/app/product/save' } - this.tui.request(url, "post", res, false, false).then((res1) => { + that.tui.request(url, "post", res, false, false).then((res1) => { if (res1.code == 200) { uni.navigateBack({ - delta: 2 + delta: 2 }) } else { uni.showToast({ @@ -227,7 +230,7 @@ } }) }).catch(err => { - console.log('表单错误信息:', err); + }) } } diff --git a/pages/inventory/changeGoods1.vue b/pages/inventory/changeGoods1.vue index 1e7466a..b7beb50 100644 --- a/pages/inventory/changeGoods1.vue +++ b/pages/inventory/changeGoods1.vue @@ -62,7 +62,7 @@ - + {{goodsDetail.productName}} @@ -114,32 +114,32 @@ - + - + - {{value[1].productName}} - {{value[1].productSn}} + {{item.productName}} + {{item.productSn}} - ¥{{value[1].price}} + ¥{{item.price}} - + - + - + - {{values[0] | sliceMsg}} + {{item1.attributeList | sliceMsg}} - + @@ -149,7 +149,7 @@ {{carType}} 款 {{carNum}} 件 - 选好了 + 关闭 @@ -184,9 +184,7 @@ zNum:0, storageType:0, carNum:0, - carType:0, - oldList: [], - newList: new Map() + carType:0 } }, filters: { @@ -280,7 +278,7 @@ } 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)) { @@ -329,16 +327,24 @@ //获取弹出层状态 change(e) { console.log('当前模式:' + e.type + ',状态:' + e.show); + }, + carChange(e,index,index1) { + console.log(this.carList) + this.carNum = 0 + for (let i = 0; i < this.carList.length; i++) { + this.carList[i].num = 0 + for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) { + this.carList[i].num += this.carList[i].saleDetailQueryDTO[m].productCount + } + this.carNum += this.carList[i].num + } }, //弹出购物车或者商品规格选择弹窗 toggle(type, item) { this.type = type // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 - if (type == 'carPopup') { - - this.oldList = this.carList - this.newFun() + if (type == 'carPopup') { this.carNum = 0 for (let i=0;i { - if (res.code == 200) { - this.goodsDetail = res.result; - this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", { - categoryId: this.goodsDetail.categoryId - }, false, true).then((res1) => { - if (res1.code == 200) { - if (typeof(res1.result) == 'string') { - let newObj = JSON.parse(res1.result) - let newArr = [] - for (let val in newObj) { - let valueObj = []; - for (var i = 0; i < newObj[val].length; i++) { - valueObj.push({ - value: newObj[val][i], - isChecked: false - }) - } - newArr.push({ - name: val, - value: valueObj - }) - } - this.goodsDetail.attributeList = newArr; - this.goodsDetail.attributeList.forEach((item, index) => { - this.columns[index] = item.value; - this.keyList[index] = item.name; + this.goodsDetail = item; + this.temporaryList = [] + this.columns = [] + this.keyList = [] + console.log(this.temporaryList) + console.log(this.carList) + if(this.carList != ''){ + this.zNum = 0 + for(let i=0;i { + if (res1.code == 200) { + if (typeof(res1.result) == 'string') { + let newObj = JSON.parse(res1.result) + let newArr = [] + for (let val in newObj) { + let valueObj = []; + for (var i = 0; i < newObj[val].length; i++) { + valueObj.push({ + value: newObj[val][i], + isChecked: false }) } - - } else { - this.tui.toast(res.message) + newArr.push({ + name: val, + value: valueObj + }) } - }).catch((res) => {}) + this.goodsDetail.attributeList = newArr; + this.goodsDetail.attributeList.forEach((item, index) => { + this.columns[index] = item.value; + this.keyList[index] = item.name; + }) + } + } else { this.tui.toast(res.message) } @@ -501,67 +449,97 @@ }, //弹窗选择规格后,点击弹窗中选好了按钮 temporaryCheck() { - // if(this.storageType == 0 && this.purchasePrice == 0){ - // uni.showToast({ - // title: "请输入采购价!", - // icon: 'none' - // }) - // }else{ - let data = { - id: this.goodsDetail.id, - price: this.zPrice, - num: this.zNum, - productName: this.goodsDetail.productName, - productSn: this.goodsDetail.productSn, - productPicture: this.goodsDetail.productPicture, - supplierName: this.goodsDetail.supplierName, - saleDetailQueryDTO:this.temporaryList - } + let data = { + id: this.goodsDetail.id, + price: this.zPrice, + num: this.zNum, + productName: this.goodsDetail.productName, + productSn: this.goodsDetail.productSn, + productPicture: this.goodsDetail.productPicture, + supplierName: this.goodsDetail.supplierName, + saleDetailQueryDTO:this.temporaryList + } + if(this.carList.length == 0){ this.carList.push(data) - console.log(this.carList) - this.temporaryList = [] - this.purchasePrice = "" - this.zPrice = '' - this.zNum = '' - for(let i=0;i 0) { this.attrList.forEach((items) => { - console.log(items.id) + this.tui.request( "/app/productAttributeValue/selectByAttributeId", "get", { @@ -81,11 +81,11 @@ }, false, true).then((res2) => { if (res2.code == 200) { items.attributeValue = res2.result; - // console.log(items.attributeValue); + // }else{ this.tui.toast(res.message) } - console.log(this.attrList) + }).catch((res) => {}) }) } @@ -129,7 +129,7 @@ }, // 获取属性值 getProductAttributeValue(index) { - console.log(index, this.indexList, this.indexList[index].attrName); + this.attrList.forEach((item) => { this.tui.request("/app/productAttributeValue/selectByAttributeId", "get", { id: item.id @@ -143,7 +143,7 @@ }).catch((res) => {}) }) this.showList = JSON.parse(JSON.stringify(this.attrList)) - console.log(this.showList, 'shoeList', index); + }, inputDialogToggle(type, item, parent) { this.typeModel = type; @@ -172,7 +172,7 @@ this.tui.request("/app/productCategory/save", "post", { categoryName: e }, false, true).then((res) => { - console.log(res, 'res'); + if (res.code == 200) { this.getGategoryList() uni.showToast({ @@ -251,7 +251,7 @@ categoryId: this.editItem.categoryId, id: this.editItem.id }, false, true).then((res) => { - console.log(res, 'res'); + if (res.code == 200) { this.getGategoryList() uni.showToast({ @@ -283,7 +283,7 @@ this.tui.request("/app/productCategory/delById", "post", { id: this.delItems.id, }, false, true).then((res) => { - console.log(res, 'res'); + if (res.code == 200) { this.getGategoryList() uni.showToast({ @@ -303,7 +303,7 @@ attributeName: this.delItems.attributeName, id: this.delItems.id, }, false, true).then((res) => { - console.log(res, 'res'); + if (res.code == 200) { this.getGategoryList() uni.showToast({ @@ -323,7 +323,7 @@ value: this.delItems.value, id: this.delItems.id, }, false, true).then((res) => { - console.log(res, 'res'); + if (res.code == 200) { this.getGategoryList() uni.showToast({ diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue index 64c3d28..908bafe 100644 --- a/pages/inventory/goodsList1.vue +++ b/pages/inventory/goodsList1.vue @@ -61,9 +61,8 @@ {{item.name}} - - + + @@ -96,7 +95,7 @@ 折扣(0-10) - @@ -105,7 +104,7 @@ 数量 - + 合计:{{totalAmount}} - ¥{{shouldPay}} + ¥{{shouldPay == null ?0:shouldPay}} @@ -300,7 +299,7 @@ {{zNum}} 件 - ¥{{zPrice}} + 选好了 @@ -426,7 +425,8 @@ radioType1: 0, saleId: '', saleDetailList: [], - yNum: 150 + yNum: 150, + clearMsg:'' } }, components: { @@ -489,9 +489,6 @@ } this.carList.set(this.carList1[i].id, obj) - uni.removeStorageSync('carList1') - uni.removeStorageSync('khName') - this.carList1 = [] } else { //当前页有数据 if (this.carList.has(this.carList1[i].id) == true) { //商品相同 @@ -536,12 +533,11 @@ } this.carList.set(this.carList1[i].id, obj) } - - uni.removeStorageSync('carList1') - this.carList1 = [] - } - } + } + uni.removeStorageSync('carList1') + uni.removeStorageSync('khName') + this.carList1 = [] this.carList.forEach(function(value, key) { if (that.priceType == 0) { //零售 value.unitPrice = value.lsprice @@ -627,7 +623,7 @@ if (this.goodsDetail.attributeList.length == jishuqi) { this.attributeList = { attributeList: JSON.stringify(obj), - productCount: this.temporaryNum, + productCount: 0, name: name, price: this.purchasePrice } @@ -659,7 +655,7 @@ }, changessPrice(e) { - console.log(e.target.value) + this.relPrice = e.target.value }, changePrice(e) { @@ -667,8 +663,8 @@ this.noPay = this.relPrice - e.target.value; }, getImg(key) { - console.log(key) - console.log('图片看这里', this.carList.get(key)) + + return this.carList.get(key).productPicture // value[1].productPicture }, @@ -682,12 +678,14 @@ } }, //扫一扫功能 - scanCodeAdd() { + scanCodeAdd() { + // this.clearMsg = '1' uni.scanCode({ success: (res) => { this.toggle('bottom', res.result); }, - fail: (res) => { + fail: (res) => { + // this.clearMsg = '1' uni.showToast({ title: '扫描失败', icon: 'none' @@ -748,12 +746,12 @@ } }).catch((res) => {}) }, - temporaryChange(val) { + temporaryChange(val) { + console.log('扫一扫',this.temporaryList) this.zNum = 0 for (var i = 0; i < this.temporaryList.length; i++) { this.zNum += this.temporaryList[i].productCount } - this.zPrice = this.zNum * this.purchasePrice }, //折扣种类选择 discountChange(e) { @@ -787,9 +785,15 @@ this.pbAddress = e.detail.value }, //整体折扣数字框改变 - change(e) { - console.log(e) - this.discountNum = e + change(e) { + if(e.detail.value > 10){ + this.discountNum = 10 + }else if(e.detail.value < 0){ + this.discountNum = 0 + }else{ + this.discountNum = e.detail.value + } + this.shouldPay = this.price * 10000 * e / 10 / 10000 }, //点击发货方式按钮 @@ -817,7 +821,7 @@ return } let companyType = this.radioType == 1 ? this.wlName.id : '' - console.log(companyType) + uni.navigateTo({ url: '/pages/index/peopleList?popleType=' + popleType + '&companyType=' + companyType }) @@ -1004,9 +1008,9 @@ } let obj = { orderByWorker: this.lbgName.workerId, - saleId: this.saleId, sale: { - // relPrice:, + // relPrice:, + saleId: this.saleId, alreadyEarn: this.priceOk, //已付金额 realAmount: this.relPrice, //实收金额 noEarn: this.relPrice - this.priceOk, //欠款 @@ -1032,7 +1036,7 @@ } let purchaseDetails = []; this.carList.forEach(function(value, key) { - console.log(value.stockLogList) + value.stockLogList.forEach(function(values, keys) { let obj = { productCount: values, @@ -1040,7 +1044,7 @@ } value.stockLogList1.push(obj) }) - console.log(value) + purchaseDetails.push(value) }) this.saleDetailList = purchaseDetails; @@ -1148,7 +1152,7 @@ }, //编辑每一个的单价 clickPrice(index) { - console.log(index) + this.index = index this.wholesalePrice = this.carList.get(this.index).wholesalePrice this.lsprice = this.carList.get(this.index).lsprice @@ -1236,14 +1240,14 @@ }, //修改已选规格的数量 GoodsNumChange(e, index, index1) { - console.log(this.carList) + let that = this; this.carList.get(index).stockLogList.set(index1, e) this.carList.get(index).productCount = 0 this.shouldPay = 0 this.totalAmount = 0 this.carList.get(index).stockLogList.forEach(function(value, key) { - console.log(that.carList.get(index)) + 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) .unitPrice diff --git a/pages/inventory/inventoryDetail.vue b/pages/inventory/inventoryDetail.vue index 03b93cb..23f9406 100644 --- a/pages/inventory/inventoryDetail.vue +++ b/pages/inventory/inventoryDetail.vue @@ -3,7 +3,7 @@ - + {{dataList.productName == null ? '暂无':dataList.productName}} ({{dataList.productSn == null ? '暂无':dataList.productSn}})