From 5018955b905c6e96decb86d28fa9d593d4ef439b Mon Sep 17 00:00:00 2001
From: wxy <14293288+zysysys@user.noreply.gitee.com>
Date: Mon, 13 May 2024 20:40:18 +0800
Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E4=BF=A1=E6=81=AF=E5=9B=9E?=
=?UTF-8?q?=E6=98=BE=E7=AC=AC=E4=B8=80=E7=89=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/product/info/index.vue | 47 +++++++++++++++++++++++++++++---
1 file changed, 43 insertions(+), 4 deletions(-)
diff --git a/src/views/product/info/index.vue b/src/views/product/info/index.vue
index ab3d04f..a864c42 100644
--- a/src/views/product/info/index.vue
+++ b/src/views/product/info/index.vue
@@ -96,8 +96,6 @@
-
-
@@ -117,7 +115,6 @@
-
@@ -323,6 +320,8 @@ import ImageUpload from "@/components/ImageUpload"
import {listBrand} from "@/api/product/brand"
import { listRule } from "@/api/product/rule"
import {listAll7 } from "@/api/product/type"
+import data from "@/views/system/dict/data.vue";
+import item from "@/layout/components/Sidebar/Item.vue";
export default {
@@ -486,6 +485,17 @@ export default {
cartesian(ruleAttrJson, 0, {});
+ this.tableBodyTemplate.forEach(item=>{
+ let sku = [];
+ for (let itemKey in item) {
+ if(itemKey.indexOf("xxx") > -1){
+ sku.push(item[itemKey])
+ }
+ }
+ sku = sku.join(',');
+ item['sku'] = sku;
+ })
+
this.tableColumnHeaderTemplate.push(
{prop:'stock',label:'商品库存'},
{prop:'price',label:'商品价格'},
@@ -628,7 +638,30 @@ export default {
this.reset();
const id = row.id || this.ids
getInfo(id).then(response => {
- this.form = response.data;
+ let typeList = [];
+ let data = response.data;
+ this.active = Number(data.step);
+ let ruleId = data.ruleId;
+ this.changeRuleInfoListByRuleId(ruleId);
+ if(data.skuInfoList !=null && data.skuInfoList.size > 0){
+ data.skuInfoList.forEach(item => {
+ if (item.sku !== null) {
+ let skuArray = item.sku.split(',');
+ for (let i = 0; i < skuArray.length; i++) {
+ item[`xxx${i}`] = skuArray[i];
+ }
+ }
+ });
+ }
+
+ this.tableBodyTemplate=data.skuInfoList;
+
+ this.form = data;
+ let typeAttr = data.typeIds.split(",")
+ typeAttr.forEach(item => {
+ typeList.push(item * 1)
+ });
+ this.form.type = typeList
this.open = true;
this.title = "修改商品信息";
});
@@ -637,6 +670,12 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
+ let typeIds = this.form.type.join(',');
+ let type = this.form.type[this.form.type - 1];
+ this.form.typeIds = typeIds;
+ this.form.type = type;
+
+ this.form["skuInfoList"] = this.tableBodyTemplate;
if (this.form.id != null) {
this.updateInfoById(this.form)
} else {