From f1a599881c10120c48fd1cc72ef24c8ccbca6ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Mon, 14 Oct 2024 14:48:51 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=80=97=E6=9D=90=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/invoicing/consumable/information.vue | 1 + src/views/product/category.vue | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/views/invoicing/consumable/information.vue b/src/views/invoicing/consumable/information.vue index 79cb332..57d9a23 100644 --- a/src/views/invoicing/consumable/information.vue +++ b/src/views/invoicing/consumable/information.vue @@ -963,6 +963,7 @@ export default { shopId: localStorage.getItem("shopId"), productId: '',//预留耗材id column: this.stockData.column,//列名 + conName:this.query.conName, createdAt: arr//耗材id }) this.stockData.loading = false; diff --git a/src/views/product/category.vue b/src/views/product/category.vue index 9c49823..50f658e 100644 --- a/src/views/product/category.vue +++ b/src/views/product/category.vue @@ -50,7 +50,12 @@
+ @current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper" @size-change="(e) => { + tableData.size = e; + tableData.page = 0; + getTableData(); + } + ">
From ef533327267c14c71541216ea191393a1647611a Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Tue, 15 Oct 2024 09:02:39 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E8=80=97=E6=9D=90=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/product/components/bindCons.vue | 195 +++++++++++++++++++++- 1 file changed, 189 insertions(+), 6 deletions(-) diff --git a/src/views/product/components/bindCons.vue b/src/views/product/components/bindCons.vue index 0df6bfb..aca9035 100644 --- a/src/views/product/components/bindCons.vue +++ b/src/views/product/components/bindCons.vue @@ -16,7 +16,8 @@
商品名:{{ goodsDetail.name }}
- + + @@ -54,6 +55,91 @@ + + + + + + + + + + + + + + + + + + + + 取 消 确 定 @@ -98,8 +184,33 @@ export default { // this.$message.error('请完善信息') // return // } + + let res = null this.formLoading = true - const res = await tbProskuConV2(this.tableData) + if (this.type == 1) { + res = await tbProskuConV2(this.tableData) + } else if (this.type == 2) { + let data = { ...this.tableData } + + let arr = [] + + data.cons.map(item => { + item.consList.map(val => { + if (val.name) { + let obj = { ...item } + obj.id = val.id + obj.name = val.name + obj.productSkuId = item.productSkuId + obj.conInfoId = val.conInfoId + obj.surplusStock = val.surplusStock + arr.push(obj) + } + }) + }) + + data.cons = arr + res = await tbProskuConV2(data) + } this.formLoading = false this.$message.success('编辑成功') this.dialogVisible = false @@ -109,12 +220,18 @@ export default { this.formLoading = false } }, - // 选择耗材 + // 商品选择耗材 selectionChange(e, row) { let item = this.options.find(item => item.consId == e) row.name = item.conName row.conUnit = item.conUnit }, + // 规格选择耗材 + skuSelectionChange(e, row) { + let item = this.options.find(item => item.consId == e) + row.name = item.conName + row.conUnit = item.conUnit + }, // 远程搜索耗材 remoteMethod(query) { if (query !== '') { @@ -202,9 +319,6 @@ export default { } } else { // 添加至规格 - if (this.goodsDetail.conInfos.length) { - this.tableData.cons = [...this.goodsDetail.conInfos] - } this.goodsDetail.skuList.map(val => { let item = {} @@ -219,8 +333,35 @@ export default { item.status = 1 item.specSnap = val.name + item.consList = [ + { + surplusStock: 0, + conInfoId: '', + name: '', + conUnit: '' + } + ] + this.tableData.cons.push(item) }) + + + + if (this.goodsDetail.conInfos.length) { + this.tableData.cons.map(val => { + this.goodsDetail.conInfos.map(item => { + if (item.productSkuId == val.productSkuId) { + val.consList.unshift({ + id: item.id, + surplusStock: item.surplusStock, + conInfoId: item.conInfoId, + name: item.conName, + conUnit: item.conUnit + }) + } + }) + }) + } } }, // 生成新关系项 @@ -253,10 +394,27 @@ export default { item.surplusStock = 0 item.status = 1 item.specSnap = val.specSnap + item.consList = [ + { + conInfoId: '', + name: '', + conUnit: '', + surplusStock: 0 + } + ] this.tableData.cons.push(item) } }, + // 规格生成新关系项 + skuCreateItem($index) { + this.tableData.cons[$index].consList.push({ + conInfoId: '', + name: '', + conUnit: '', + surplusStock: 0 + }) + }, reset() { this.goodsDetail = '' this.tableData.productId = '' @@ -321,4 +479,29 @@ export default { } } } + +.cons_list_wrap { + .row { + display: flex; + padding: 10px 0; + align-items: center; + gap: 10px; + + .item { + flex: 1; + display: flex; + align-items: center; + } + } +} + +.sku_table_item { + padding: 10px 0; + + .t { + height: 32px; + display: flex; + align-items: center; + } +} \ No newline at end of file From b391a7da805894951457efaafd6180642cce0dc9 Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Tue, 15 Oct 2024 09:16:07 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E6=B1=A1=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/invoicing/goods_stoks.vue | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/views/invoicing/goods_stoks.vue b/src/views/invoicing/goods_stoks.vue index 471e058..ba16dbb 100644 --- a/src/views/invoicing/goods_stoks.vue +++ b/src/views/invoicing/goods_stoks.vue @@ -18,7 +18,7 @@
- + @@ -68,14 +68,16 @@ -