提交 3dc3f17b authored 作者: 刘旭's avatar 刘旭

优化

上级 0d18fd71
<template>
<div class="app-container">
<el-drawer v-model="editDrawer" size="100%" @before-close="handleCancel">
<el-drawer v-model="editDrawer" size="100%" :before-close="handleCancel">
<el-card class="box-card">
<h3>商品介绍</h3>
<el-form ref="goodsRef" :rules="rules" :model="goods" label-width="150px">
......@@ -319,12 +319,15 @@ initList()
let init = (id: number) => {
detailGoods(id).then((res: any) => {
if (res.code === 200) {
if (!res.data.goods.gallery) res.data.goods.gallery = []
res.data.goods.gallery.map((item: any) => {
fileList.value.push({
url: item,
name: item.split('/')[item.split('/').length - 1]
})
})
goods.value = res.data.goods;
for (let s in res.data.parts) {
goodsParts.value.push(res.data.parts[s].partGoodsId)
......@@ -548,6 +551,11 @@ let handleSpecificationAdd = () => {
} else {
specForm.value.value = specForm.value.value[0]
specifications.value[dictTableIndex.value] = specForm.value
specifications.value?.forEach((item: any) => {
if (specifications.value[dictTableIndex.value].specification === item.specification) {
item.customSpec = specifications.value[dictTableIndex.value].customSpec
}
})
specVisiable.value = false;
}
}
......
......@@ -96,8 +96,6 @@ let radioChange = (e: any, item: any) => {
}
})
if (specList.value.indexOf(e) == -1) specList.value.push(e)
console.log(specList.value, 'specList');
}
let clickAdd = () => {
......@@ -112,7 +110,7 @@ let clickAdd = () => {
specList.value = []
specData.value = poty.value
emits('productsData', attributes.value)
console.log(attributes.value, '规格属性数据');
// console.log(attributes.value, '规格属性数据');
}
let handleAttributeDelete = (row: any) => {
let index = attributes.value.indexOf(row);
......
<template>
<div class="app-container">
<el-drawer v-model="shelvesDrawer" size="100%" @before-close="handleCancel">
<el-drawer v-model="shelvesDrawer" size="100%" :before-close="handleCancel">
<el-card class="box-card">
<h3>商品介绍</h3>
<el-form ref="goodsRef" :rules="rules" :model="goods" label-width="150px">
......@@ -468,6 +468,7 @@ let handleSpecificationAdd = () => {
customSpec: dictSwitch.value
})
}
specForm.value.customSpec = false
specVisiable.value = false;
specToProduct();
} else {
......@@ -479,6 +480,11 @@ let handleSpecificationAdd = () => {
} else {
specForm.value.value = specForm.value.value[0]
specifications.value[dictTableIndex.value] = specForm.value
specifications.value?.forEach((item: any) => {
if (specifications.value[dictTableIndex.value].specification === item.specification) {
item.customSpec = specifications.value[dictTableIndex.value].customSpec
}
})
specVisiable.value = false;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论