no message

master
mabo 2021-07-07 17:45:38 +08:00
parent c835616ad2
commit 9ff4197ec4
3 changed files with 25 additions and 43 deletions

View File

@ -26,7 +26,7 @@
<script> <script>
import * as API_GOODS from "@/api/goods";
import firstStep from './goodsOperationFirst' import firstStep from './goodsOperationFirst'
import secondStep from './goodsOperationSec' import secondStep from './goodsOperationSec'

View File

@ -28,21 +28,21 @@
<div class="content-goods-publish"> <div class="content-goods-publish">
<div class="goods-category"> <div class="goods-category">
<ul v-if="categoryListLevel1.length > 0"> <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"> @click="handleSelectCategory(item, index, 1)" :key="index">
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<span>&gt;</span> <span>&gt;</span>
</li> </li>
</ul> </ul>
<ul v-if="categoryListLevel2.length > 0"> <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"> @click="handleSelectCategory(item, index, 2)" :key="index">
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<span>&gt;</span> <span>&gt;</span>
</li> </li>
</ul> </ul>
<ul v-if="categoryListLevel3.length > 0"> <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"> @click="handleSelectCategory(item, index, 3)" :key="index">
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
</li> </li>
@ -105,9 +105,8 @@ export default {
{name: '', id: ''}, {name: '', id: ''},
{name: '', id: ''} {name: '', id: ''}
], ],
//
/** 当前商品分类名称3*/ goodsType: '',
activeCategoryName3: "",
/** 1级分类列表*/ /** 1级分类列表*/
categoryListLevel1: [], categoryListLevel1: [],
@ -138,7 +137,7 @@ export default {
this.showGoodsTemplates = true; this.showGoodsTemplates = true;
this.GET_GoodsTemplate() this.GET_GoodsTemplate()
} else { } else {
// this.baseInfoForm.goodsType = val.type; this.goodsType = val.type;
} }
}, },
// //
@ -196,35 +195,21 @@ export default {
// //
next() { next() {
window.scrollTo(0, 0); window.scrollTo(0, 0);
if (this.$route.query.draftId) {
this.activestep = 1;
this.GET_GoodData();
return;
}
/** 1级校验 */ /** 1级校验 */
this.loading = true; this.loading = true;
if (!this.baseInfoForm.goodsType) { if (!this.goodsType) {
this.$Message.error('请选择商品类型') this.$Message.error('请选择商品类型')
this.loading = false; this.loading = false;
return return
} }
if (!this.activeCategoryName1) { if (!this.category[0].name) {
this.$Message.error("请选择商品分类"); this.$Message.error("请选择商品分类");
return; return;
} else if (this.activeCategoryIndex3 === -1) { } else if (!this.category[2].name) {
this.$Message.error("必须选择到三级分类"); this.$Message.error("必须选择到三级分类");
return; return;
} else if (this.activeCategoryName3) { } else if (this.category[2].name) {
/** 获取该商城分类下 商品参数信息 */ this.$parent.activestep = 1;
this.GET_GoodsParams();
/** 查询品牌列表 */
this.getGoodsBrandList();
/** 查询分类绑定的规格信息 */
this.Get_SkuInfoByCategory(this.baseInfoForm.categoryId);
//
this.GET_GoodsUnit();
//
this.GET_ShopGoodsLabel();
} }
}, },
}, },

View File

@ -210,6 +210,7 @@
> >
<Tree <Tree
ref="tree" ref="tree"
style="text-align:left;"
:data="shopCategory" :data="shopCategory"
show-checkbox show-checkbox
@on-select-change="selectTree" @on-select-change="selectTree"
@ -310,6 +311,7 @@
</div> </div>
</template> </template>
<script> <script>
import * as API_GOODS from "@/api/goods";
import * as API_Shop from "@/api/shops"; import * as API_Shop from "@/api/shops";
import cloneObj from "@/utils/index"; import cloneObj from "@/utils/index";
import bus from '@/libs/eventBus' import bus from '@/libs/eventBus'
@ -768,9 +770,6 @@ export default {
skus.push(sku); skus.push(sku);
}); });
this.skuInfo = skusInfo; this.skuInfo = skusInfo;
/**
* 渲染规格详细表格
*/
this.renderTableData(); this.renderTableData();
this.skuTableData = skus; this.skuTableData = skus;
}, },
@ -815,7 +814,6 @@ export default {
} }
); );
}, },
/** 添加规格项 */ /** 添加规格项 */
addSkuItem() { addSkuItem() {
if (this.skuInfo.length >= 5) { if (this.skuInfo.length >= 5) {
@ -826,9 +824,6 @@ export default {
this.$set(this.skuInfo, this.skuInfo.length, { this.$set(this.skuInfo, this.skuInfo.length, {
spec_values: [], spec_values: [],
}); });
/**
* 渲染规格详细表格
*/
this.renderTableData(); this.renderTableData();
}, },
// //
@ -837,10 +832,6 @@ export default {
}, },
// //
async skuValueChange(val, index, item) { async skuValueChange(val, index, item) {
/**
* 渲染规格详细表格
*/
this.renderTableData(); this.renderTableData();
}, },
// //
@ -1027,10 +1018,6 @@ export default {
filterMethod(value, option) { filterMethod(value, option) {
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1; return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
}, },
//
handleSpan({row, column, rowIndex, columnIndex}) {
},
/** 数据改变之后 抛出数据 */ /** 数据改变之后 抛出数据 */
updateSkuTable(row, item) { updateSkuTable(row, item) {
let index = row._index; let index = row._index;
@ -1222,7 +1209,17 @@ export default {
this.logisticsTemplate = res.result; this.logisticsTemplate = res.result;
} }
}) })
} /** 获取该商城分类下 商品参数信息 */
this.GET_GoodsParams();
/** 查询品牌列表 */
this.getGoodsBrandList();
/** 查询分类绑定的规格信息 */
this.Get_SkuInfoByCategory(this.baseInfoForm.categoryId);
//
this.GET_GoodsUnit();
//
this.GET_ShopGoodsLabel();
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>