From 5786ce6a3c6bbae7e9c5bdd7de54c630c838531e Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Tue, 6 Feb 2024 16:13:24 +0800 Subject: [PATCH] 11 --- pages/billing/changeGoods1.vue | 81 +++++++++++++++++------------ pages/index/addHangOrder.vue | 2 +- pages/index/orderDetail.vue | 2 +- pages/inventory/addinventory.vue | 88 +++++++++++++++++--------------- pages/inventory/changeGoods1.vue | 88 +++++++++++++++++--------------- pages/inventory/goodsList1.vue | 81 +++++++++++++++++------------ pages/other/custom.vue | 61 ++++++++++------------ 7 files changed, 220 insertions(+), 183 deletions(-) diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue index 13f5bfb..5c91160 100644 --- a/pages/billing/changeGoods1.vue +++ b/pages/billing/changeGoods1.vue @@ -89,7 +89,7 @@ - {{item.name}} + {{item.name}} 库存:{{item.productNum}} @@ -183,7 +183,9 @@ storageType: '', carNum: 0, carType: 0, - type: '' + type: '', + productId:'', + productNum:0, } }, filters: { @@ -255,37 +257,47 @@ jishuqi++ } } - if (this.goodsDetail.attributeList.length == jishuqi) { - let data = {} - this.attributeList = { - attributeList: JSON.stringify(obj), - productCount: this.temporaryNum, - name: name, - price: this.purchasePrice - } - - for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { - this.goodsDetail.attributeList[i].isChecked = false; - for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) { - this.goodsDetail.attributeList[i].value[m].isChecked = false - } - } - 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].name.indexOf(this.attributeList.name) == 1) { - if (this.temporaryList.length == (i + 1)) { - this.temporaryList.push(this.attributeList); - return - } - } else { - return - } - } - - } - + if (this.goodsDetail.attributeList.length == jishuqi) { + this.tui.request("/app/stock/productCount", "post", { + productId: this.productId, + // productId: "1718617874370793472", + attributeList: JSON.stringify(obj) + // attributeList: '{\"颜色\":\"黑色\",\"尺码\":\"S码\",\"类别\":\"童装\"}' + }, false, true).then((res) => { + if (res.code == 200) { + this.productNum = res.result + this.attributeList = { + attributeList: JSON.stringify(obj), + productCount: this.temporaryNum, + productNum:this.productNum, + name: name, + price: this.purchasePrice + } + for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { + this.goodsDetail.attributeList[i].isChecked = false; + for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) { + this.goodsDetail.attributeList[i].value[m].isChecked = false + } + } + 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].name.indexOf(this.attributeList.name) == 1) { + if (this.temporaryList.length == (i + 1)) { + this.temporaryList.push(this.attributeList); + return + } + } else { + return + } + } + + } + } else { + this.tui.toast(res.message) + } + }).catch((res) => {}) } }, @@ -346,7 +358,8 @@ } this.$refs.carPopup.open('bottom') this.carType = this.carList.length - } else { + } else { + this.productId = item.id this.checkGoods(item); this.$refs.popup.open('bottom') } diff --git a/pages/index/addHangOrder.vue b/pages/index/addHangOrder.vue index 2f360c3..7456381 100644 --- a/pages/index/addHangOrder.vue +++ b/pages/index/addHangOrder.vue @@ -117,7 +117,7 @@ - {{item.name}} 库存数:{{item.productNum}} + {{item.name}} 库存:{{item.productNum}} diff --git a/pages/index/orderDetail.vue b/pages/index/orderDetail.vue index 29e6ff0..91b5264 100644 --- a/pages/index/orderDetail.vue +++ b/pages/index/orderDetail.vue @@ -17,7 +17,7 @@ - + {{item1.attributeList | sliceMsg}} 数量:{{item1.productCount}} diff --git a/pages/inventory/addinventory.vue b/pages/inventory/addinventory.vue index e043197..3777c36 100644 --- a/pages/inventory/addinventory.vue +++ b/pages/inventory/addinventory.vue @@ -115,17 +115,9 @@ {{goodsDetail.productName}} {{goodsDetail.productSn}} - - - {{item.name}} + {{item.name}} 库存:{{item.productNum}} @@ -196,7 +188,9 @@ keyList: [], temporaryList: [], zNum: 0, - storageType:'' + storageType:'', + productNum:0, + productId:'' } }, filters: { @@ -288,7 +282,8 @@ methods: { scanCodeAdd() { uni.scanCode({ - success: (res) => { + success: (res) => { + this.productId = res.result this.toggle('bottom', res.result); }, fail: (res) => { @@ -330,37 +325,48 @@ jishuqi++ } } - if (this.goodsDetail.attributeList.length == jishuqi) { - this.attributeList = { - attributeList: JSON.stringify(obj), - productCount: this.temporaryNum, - name: name, - price: this.purchasePrice - } - - for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { - this.goodsDetail.attributeList[i].isChecked = false; - for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) { - this.goodsDetail.attributeList[i].value[m].isChecked = false - } - } - 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].name.indexOf(this.attributeList.name) == 1) { - if (this.temporaryList.length == (i + 1)) { - this.temporaryList.push(this.attributeList); - return - } + if (this.goodsDetail.attributeList.length == jishuqi) { + this.tui.request("/app/stock/productCount", "post", { + productId: this.productId, + attributeList: JSON.stringify(obj) + }, false, true).then((res) => { + if (res.code == 200) { + this.productNum = res.result + this.attributeList = { + attributeList: JSON.stringify(obj), + productCount: this.temporaryNum, + productNum:this.productNum, + name: name, + price: this.purchasePrice + } + + for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { + this.goodsDetail.attributeList[i].isChecked = false; + for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) { + this.goodsDetail.attributeList[i].value[m].isChecked = false + } + } + if (this.temporaryList.length == 0) { + this.temporaryList.push(this.attributeList); } else { - this.temporaryList[i] = this.attributeList - return - - } - } - - } + for (var i = 0; i < this.temporaryList.length; i++) { + 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 + + } + } + + } + } else { + this.tui.toast(res.message) + } + }).catch((res) => {}) } diff --git a/pages/inventory/changeGoods1.vue b/pages/inventory/changeGoods1.vue index 6b9817f..b8b79f5 100644 --- a/pages/inventory/changeGoods1.vue +++ b/pages/inventory/changeGoods1.vue @@ -74,10 +74,6 @@ - - {{item.name}} + {{item.name}} 库存:{{item.productNum}} @@ -184,7 +180,9 @@ zNum:0, storageType:0, carNum:0, - carType:0 + carType:0, + productId:'', + productNum:0, } }, filters: { @@ -258,41 +256,50 @@ jishuqi++ } } - if (this.goodsDetail.attributeList.length == jishuqi) { - let data = {} - this.attributeList = { - attributeList: JSON.stringify(obj), - productCount: this.temporaryNum, - name:name, - price:this.purchasePrice - } - - for(let i=0;i { + if (res.code == 200) { + this.productNum = res.result + this.attributeList = { + attributeList: JSON.stringify(obj), + productCount: this.temporaryNum, + productNum:this.productNum, + name: name, + price: this.purchasePrice + } + for(let i=0;i {}) } - }, temporaryChange(val) { this.zNum = 0 @@ -352,7 +359,8 @@ } this.carType = this.carList.length this.$refs.carPopup.open('bottom') - } else { + } else { + this.productId = item.id this.checkGoods(item); this.$refs.popup.open('bottom') } diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue index e1b6d6e..0f9babe 100644 --- a/pages/inventory/goodsList1.vue +++ b/pages/inventory/goodsList1.vue @@ -304,7 +304,7 @@ - {{item.name}} + {{item.name}} 库存:{{item.productNum}} @@ -447,7 +447,9 @@ yNum: 150, clearMsg:'', priceType:'', - multiple:1 + multiple:1, + productId:'', + productNum:0, } }, components: { @@ -636,37 +638,50 @@ jishuqi++ } } - if (this.goodsDetail.attributeList.length == jishuqi) { - this.attributeList = { - attributeList: JSON.stringify(obj), - productCount: 0, - name: name, - price: this.purchasePrice - } - - for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { - this.goodsDetail.attributeList[i].isChecked = false; - for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) { - this.goodsDetail.attributeList[i].value[m].isChecked = false - } - } - 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].name.indexOf(this.attributeList.name) == 1) { - if (this.temporaryList.length == (i + 1)) { - this.temporaryList.push(this.attributeList); - return - } + if (this.goodsDetail.attributeList.length == jishuqi) { + this.tui.request("/app/stock/productCount", "post", { + productId: this.productId, + // productId: "1718617874370793472", + attributeList: JSON.stringify(obj) + // attributeList: '{\"颜色\":\"黑色\",\"尺码\":\"S码\",\"类别\":\"童装\"}' + }, false, true).then((res) => { + if (res.code == 200) { + this.productNum = res.result + this.attributeList = { + attributeList: JSON.stringify(obj), + productCount: 0, + productNum:this.productNum, + name: name, + price: this.purchasePrice + } + + for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { + this.goodsDetail.attributeList[i].isChecked = false; + for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) { + this.goodsDetail.attributeList[i].value[m].isChecked = false + } + } + if (this.temporaryList.length == 0) { + this.temporaryList.push(this.attributeList); } else { - this.temporaryList[i] = this.attributeList - return - - } - } - - } + for (var i = 0; i < this.temporaryList.length; i++) { + 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 + + } + } + + } + } else { + this.tui.toast(res.message) + } + }).catch((res) => {}) } @@ -697,7 +712,7 @@ uni.setStorageSync('saoma','1') uni.scanCode({ success: (res) => { - + this.productId = res.result this.toggle('bottom', res.result); }, fail: (res) => { diff --git a/pages/other/custom.vue b/pages/other/custom.vue index 4be6520..d4535ab 100644 --- a/pages/other/custom.vue +++ b/pages/other/custom.vue @@ -2,7 +2,7 @@ - + @@ -23,14 +23,14 @@ 营业额: - {{ item.realAmount }} + {{ item.realAmount== null ?'暂无': item.realAmount}} {{ '     欠款: ' }} - {{ item.noEarn }} + {{ item.noEarn== null ?'暂无': item.noEarn}} 订单状态: {{ - item.status == 1 ? '拣货中' : item.status == 2 ? '已预定' : item.status == 3 ? '已作废' : item.status == 4 ? '已取货' : '已送达' + item.status == 1 ? '拣货中' : item.status == 2 ? '已预定' : item.status == 3 ? '已作废' : item.status == 4 ? '已取货' :item.status == 6 ? '待配货': '已送达' }} 采购退货 @@ -52,12 +52,12 @@ computed: mapState(['userId', 'mobile']), data() { return { - range: ['2023-10-1', '2023-10-2'], + range: [], name: '', shopList: [], list: ['采购单', '退货单'], - current: 0, - userId:'', + current: 0, + userId: '', shopId: '', bList: [], query: { @@ -66,12 +66,12 @@ } } }, - created() { - uni.hideHomeButton() //左上角HOME按钮 - const date = this.formatDate(new Date(), 'YYYY-MM-DD') - this.query.startDate = date - this.query.endDate = date - this.range = [date, date] + created() { + uni.hideHomeButton() //左上角HOME按钮 + // const date = this.formatDate(new Date(), 'YYYY-MM-DD') + // this.query.startDate = date + // this.query.endDate = date + // this.range = [date, date] this.getShopList() this.getAllList() }, @@ -83,9 +83,6 @@ this.getAllList() } if (index == 1) { - this.getList() - } - if (index == 2) { this.getReturnList() } }, @@ -100,19 +97,9 @@ }) }) }, - getList() { - this.tui.request('/app/sale/listAll', 'post', { - remarkSR:2, - shopId: this.shopId, - searchDateVo: this.query - }, false, false, false).then(res => { - if (res.code !== 200) return - this.bList = res.result - }) - }, getAllList() { - this.tui.request('/app/sale/listAll', 'post', { - remarkSR:2, + this.tui.request('/app/sale/listAll', 'post', { + remarkSR: 2, shopId: this.shopId, searchDateVo: this.query }, false, false, false).then(res => { @@ -121,8 +108,8 @@ }) }, getReturnList() { - this.tui.request('/app/sale/listAll', 'post', { - remarkSR:3, + this.tui.request('/app/sale/listAll', 'post', { + remarkSR: 3, shopId: this.shopId, searchDateVo: this.query }, false, false, false).then(res => { @@ -130,9 +117,17 @@ this.bList = res.result.returnSaleList }) }, - dateChange() { - this.query.startDate = this.range[0] - this.query.endDate = this.range[1] + dateChange(e) { + console.log(e) + if(e.length == 0){ + console.log("11111") + this.query.startDate = '' + this.query.endDate = '' + }else{ + this.query.startDate = this.range[0] + this.query.endDate = this.range[1] + } + this.sectionChange(this.current) }, formatDate(date, fmt) {