From cfa9474d1d28c198b616bc1971e49c8d171f5168 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Mon, 5 Feb 2024 19:55:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/addHangOrder.vue | 83 ++++++++++++++++++++++-------------- pages/index/index.vue | 8 ++-- pages/index/orderDetail.vue | 6 +-- pages/index/returnList.vue | 2 +- pages/inventory/addGoods.vue | 3 ++ 5 files changed, 62 insertions(+), 40 deletions(-) diff --git a/pages/index/addHangOrder.vue b/pages/index/addHangOrder.vue index 3c6be40..2f360c3 100644 --- a/pages/index/addHangOrder.vue +++ b/pages/index/addHangOrder.vue @@ -117,7 +117,7 @@ - {{item.name}} + {{item.name}} 库存数:{{item.productNum}} @@ -159,7 +159,7 @@ placeholder="请输入挂单名称" cancelText="删除" @confirm="setDetail" @close="dialogDel"> - + @@ -206,7 +206,9 @@ zNum: 0, storageType: 0, hangId: '', - bigImg: '' + bigImg: '', + productId:'', + productNum:0, } }, filters: { @@ -312,7 +314,8 @@ //扫一扫功能 scanCodeAdd(item) { uni.scanCode({ - success: (res) => { + success: (res) => { + this.productId = res.result this.hangId = item.id if (item.saleDetailDTOList) { for (let i = 0; i < item.saleDetailDTOList.length; i++) { @@ -329,7 +332,8 @@ }) } }) - }, + }, + //点击规格选择后,下方出现所选规格和库存数 attrNameChange(index, index1) { this.goodsDetail.attributeList[index].value.forEach(item => { item.isChecked = false; @@ -357,36 +361,49 @@ } } 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 - } + 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 { - 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/index/index.vue b/pages/index/index.vue index e282f8e..1898a11 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -243,11 +243,13 @@ }] }; this.chartData = JSON.parse(JSON.stringify(dataList)); - for (var i = 0; i <= res.result.salePage.records.length; i++) { + + this.waitCount = res.result.countMap + console.log('头上',this.waitCount.waitPurchaseCount) + for (var i = 0; i < res.result.salePage.records.length; i++) { res.result.salePage.records[i].img = '/static/images/dingdan/dd' + i + '.png' this.inventoryList = res.result.salePage.records - } - this.waitCount = res.result.countMap + } } else { this.tui.toast(res.message) } diff --git a/pages/index/orderDetail.vue b/pages/index/orderDetail.vue index 3d7b3e7..29e6ff0 100644 --- a/pages/index/orderDetail.vue +++ b/pages/index/orderDetail.vue @@ -190,7 +190,7 @@ 配送人员: - {{ sales.transCompany == null ?'暂无':sales.transCompany}} + {{orderXd.worker.workerName == null ?'暂无':orderXd.worker.workerName}} @@ -228,13 +228,13 @@ export default { data() { return { - radio1: 1, + radio1: 0, sex: [{ text: '是', value: 0 }, { text: '否', - value: 1 + value: 2 }], orderByWorkerCandidates: [], orderByWorker: '', diff --git a/pages/index/returnList.vue b/pages/index/returnList.vue index 785a8a4..da18c8f 100644 --- a/pages/index/returnList.vue +++ b/pages/index/returnList.vue @@ -5,7 +5,7 @@
  • - 配送人员: {{item.createByName == null ?'暂无':item.createByName}} + 配送人员: {{item.workerName == null ?'暂无':item.workerName}} 退款金额: {{item.alreadyEarn == null ?'暂无':item.alreadyEarn}} {{'     数量: '}} {{item.productCount == null ?'暂无':item.productCount}} diff --git a/pages/inventory/addGoods.vue b/pages/inventory/addGoods.vue index d54b53f..e1bf4b5 100644 --- a/pages/inventory/addGoods.vue +++ b/pages/inventory/addGoods.vue @@ -208,6 +208,9 @@ res.id = that.dataList.id }else{ url = '/app/product/save' + } + if(res.productPicture == ''){ + res.productPicture = '' } that.tui.request(url, "post", res, false, false).then((res1) => { if (res1.code == 200) {