diff --git a/src/views/invoicing/consumable/specifications.vue b/src/views/invoicing/consumable/specifications.vue index cb6bb09..bd40946 100644 --- a/src/views/invoicing/consumable/specifications.vue +++ b/src/views/invoicing/consumable/specifications.vue @@ -616,7 +616,8 @@ export default { this.informationdialogshow = false; }, haocaiConfirm() { - if(JSON.stringify(haocaiSelectedMap)!=='{}' ){ + let hasEmpty=JSON.stringify(haocaiSelectedMap)=='{}' + if(!hasEmpty){ this.commodityArr.forEach((ele) => { if (ele.skuId == this.ALLisDistribute.skuId) { ele.haocais = []; @@ -634,6 +635,13 @@ export default { } } }); + }else{ + //当选中耗材为空,重置耗材 + this.commodityArr.forEach((ele) => { + if (ele.skuId == this.ALLisDistribute.skuId) { + ele.haocais = [{...haocaisBasic}]; + } + }); } this.informationdialogshow = false; diff --git a/src/views/product/index.vue b/src/views/product/index.vue index f393d78..35a9037 100644 --- a/src/views/product/index.vue +++ b/src/views/product/index.vue @@ -110,6 +110,7 @@ export default { return { dayjs, query: { + productId:'', name: '', categoryId: '', typeEnum: '' @@ -126,6 +127,11 @@ export default { } }, async mounted() { + if (this.$route.query.productId) { + this.query.productId = this.$route.query.productId + } + console.log(this.query) + await this.tbShopCategoryGet() await this.getTableData() if (this.isPcBowser) { @@ -183,6 +189,7 @@ export default { this.query.name = '' this.query.categoryId = '' this.query.typeEnum = '' + this.query.productId = '' this.tableData.page = 0 localStorage.setItem('shopIndexQuery', JSON.stringify(this.query)) this.getTableData() @@ -196,16 +203,18 @@ export default { async getTableData() { try { let localQuery = JSON.parse(localStorage.getItem('shopIndexQuery')) - if (localQuery != null) { + if (localQuery != null&&localQuery.hasOwnProperty('productId')) { this.query = localQuery } this.tableData.loading = true + console.log(this.query) const res = await tbProduct({ page: this.tableData.page, size: this.tableData.size, name: this.query.name, categoryId: this.query.categoryId, + id:this.query.productId, typeEnum: this.query.typeEnum, shopId: localStorage.getItem('shopId') })