no message
parent
c835616ad2
commit
9ff4197ec4
|
@ -26,7 +26,7 @@
|
|||
|
||||
<script>
|
||||
|
||||
import * as API_GOODS from "@/api/goods";
|
||||
|
||||
|
||||
import firstStep from './goodsOperationFirst'
|
||||
import secondStep from './goodsOperationSec'
|
||||
|
|
|
@ -28,21 +28,21 @@
|
|||
<div class="content-goods-publish">
|
||||
<div class="goods-category">
|
||||
<ul v-if="categoryListLevel1.length > 0">
|
||||
<li v-for="(item, index) in categoryListLevel1" :class="{ activeClass: category[0].name }"
|
||||
<li v-for="(item, index) in categoryListLevel1" :class="{ activeClass: category[0].name === item.name }"
|
||||
@click="handleSelectCategory(item, index, 1)" :key="index">
|
||||
<span>{{ item.name }}</span>
|
||||
<span>></span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul v-if="categoryListLevel2.length > 0">
|
||||
<li v-for="(item, index) in categoryListLevel2" :class="{ activeClass: category[1].name }"
|
||||
<li v-for="(item, index) in categoryListLevel2" :class="{ activeClass: category[1].name === item.name }"
|
||||
@click="handleSelectCategory(item, index, 2)" :key="index">
|
||||
<span>{{ item.name }}</span>
|
||||
<span>></span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul v-if="categoryListLevel3.length > 0">
|
||||
<li v-for="(item, index) in categoryListLevel3" :class="{ activeClass: category[2].name }"
|
||||
<li v-for="(item, index) in categoryListLevel3" :class="{ activeClass: category[2].name === item.name }"
|
||||
@click="handleSelectCategory(item, index, 3)" :key="index">
|
||||
<span>{{ item.name }}</span>
|
||||
</li>
|
||||
|
@ -105,9 +105,8 @@ export default {
|
|||
{name: '', id: ''},
|
||||
{name: '', id: ''}
|
||||
],
|
||||
|
||||
/** 当前商品分类名称3*/
|
||||
activeCategoryName3: "",
|
||||
// 商品类型
|
||||
goodsType: '',
|
||||
/** 1级分类列表*/
|
||||
categoryListLevel1: [],
|
||||
|
||||
|
@ -138,7 +137,7 @@ export default {
|
|||
this.showGoodsTemplates = true;
|
||||
this.GET_GoodsTemplate()
|
||||
} else {
|
||||
// this.baseInfoForm.goodsType = val.type;
|
||||
this.goodsType = val.type;
|
||||
}
|
||||
},
|
||||
// 获取商品模板
|
||||
|
@ -196,35 +195,21 @@ export default {
|
|||
// 下一步
|
||||
next() {
|
||||
window.scrollTo(0, 0);
|
||||
if (this.$route.query.draftId) {
|
||||
this.activestep = 1;
|
||||
this.GET_GoodData();
|
||||
return;
|
||||
}
|
||||
/** 1级校验 */
|
||||
this.loading = true;
|
||||
if (!this.baseInfoForm.goodsType) {
|
||||
if (!this.goodsType) {
|
||||
this.$Message.error('请选择商品类型')
|
||||
this.loading = false;
|
||||
return
|
||||
}
|
||||
if (!this.activeCategoryName1) {
|
||||
if (!this.category[0].name) {
|
||||
this.$Message.error("请选择商品分类");
|
||||
return;
|
||||
} else if (this.activeCategoryIndex3 === -1) {
|
||||
} else if (!this.category[2].name) {
|
||||
this.$Message.error("必须选择到三级分类");
|
||||
return;
|
||||
} else if (this.activeCategoryName3) {
|
||||
/** 获取该商城分类下 商品参数信息 */
|
||||
this.GET_GoodsParams();
|
||||
/** 查询品牌列表 */
|
||||
this.getGoodsBrandList();
|
||||
/** 查询分类绑定的规格信息 */
|
||||
this.Get_SkuInfoByCategory(this.baseInfoForm.categoryId);
|
||||
// 获取商品单位
|
||||
this.GET_GoodsUnit();
|
||||
// 获取当前店铺分类
|
||||
this.GET_ShopGoodsLabel();
|
||||
} else if (this.category[2].name) {
|
||||
this.$parent.activestep = 1;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -210,6 +210,7 @@
|
|||
>
|
||||
<Tree
|
||||
ref="tree"
|
||||
style="text-align:left;"
|
||||
:data="shopCategory"
|
||||
show-checkbox
|
||||
@on-select-change="selectTree"
|
||||
|
@ -310,6 +311,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import * as API_GOODS from "@/api/goods";
|
||||
import * as API_Shop from "@/api/shops";
|
||||
import cloneObj from "@/utils/index";
|
||||
import bus from '@/libs/eventBus'
|
||||
|
@ -768,9 +770,6 @@ export default {
|
|||
skus.push(sku);
|
||||
});
|
||||
this.skuInfo = skusInfo;
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
this.skuTableData = skus;
|
||||
},
|
||||
|
@ -815,7 +814,6 @@ export default {
|
|||
}
|
||||
);
|
||||
},
|
||||
|
||||
/** 添加规格项 */
|
||||
addSkuItem() {
|
||||
if (this.skuInfo.length >= 5) {
|
||||
|
@ -826,9 +824,6 @@ export default {
|
|||
this.$set(this.skuInfo, this.skuInfo.length, {
|
||||
spec_values: [],
|
||||
});
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
// 编辑规格名
|
||||
|
@ -837,10 +832,6 @@ export default {
|
|||
},
|
||||
// 编辑规格值
|
||||
async skuValueChange(val, index, item) {
|
||||
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
// 获取焦点时,取得规格名对应的规格值
|
||||
|
@ -1027,10 +1018,6 @@ export default {
|
|||
filterMethod(value, option) {
|
||||
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
|
||||
},
|
||||
|
||||
// 规格表格操作
|
||||
handleSpan({row, column, rowIndex, columnIndex}) {
|
||||
},
|
||||
/** 数据改变之后 抛出数据 */
|
||||
updateSkuTable(row, item) {
|
||||
let index = row._index;
|
||||
|
@ -1222,7 +1209,17 @@ export default {
|
|||
this.logisticsTemplate = res.result;
|
||||
}
|
||||
})
|
||||
}
|
||||
/** 获取该商城分类下 商品参数信息 */
|
||||
this.GET_GoodsParams();
|
||||
/** 查询品牌列表 */
|
||||
this.getGoodsBrandList();
|
||||
/** 查询分类绑定的规格信息 */
|
||||
this.Get_SkuInfoByCategory(this.baseInfoForm.categoryId);
|
||||
// 获取商品单位
|
||||
this.GET_GoodsUnit();
|
||||
// 获取当前店铺分类
|
||||
this.GET_ShopGoodsLabel();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
Loading…
Reference in New Issue