'优化商品分类属性'
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
</div>
|
||||
<!-- 底部指示器 -->
|
||||
<ul class="el-carousel__indicators el-carousel__indicators--horizontal">
|
||||
<li v-for="item in imgList.length" class="el-carousel__indicator el-carousel__indicator--horizontal" @click="clickIndex(item -1)">
|
||||
<li v-for="(item,index) in imgList.length" :key="index" class="el-carousel__indicator el-carousel__indicator--horizontal" @click="clickIndex(item -1)">
|
||||
<div class="el-carousel__button" :class="{ 'isActive':isActive === item }"></div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -651,7 +651,7 @@ export default {
|
||||
},
|
||||
// 文件格式
|
||||
getFileType(file){
|
||||
return file.raw.type === 'image/png' ? 'png' : (file.raw.type === "application/vnd.android.package-archive" ? 'apk': file.raw.type === 'application/pdf'? 'pdf' :'jpg' ) || "" // 后缀
|
||||
return file.raw.type === 'image/png' ? '.png' : (file.raw.type === "application/vnd.android.package-archive" ? '.apk': file.raw.type === 'application/pdf'? '.pdf' :'.jpg' ) || "" // 后缀
|
||||
}
|
||||
// // 注册
|
||||
// async registerSrc (hashCode, url, mimeType, name) {
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
<template>
|
||||
<div class="create-good">
|
||||
<jx-goos-set
|
||||
:catLevel1="$props.catLevel1"
|
||||
:catLevel2="$props.catLevel2"
|
||||
:currentPage="'createGood'"
|
||||
@btnPrev="btnPrev"
|
||||
@getClass="getClass">
|
||||
</jx-goos-set>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "CMPCreateGood",
|
||||
props: [
|
||||
"catLevel1",
|
||||
"catLevel2",
|
||||
],
|
||||
components: {
|
||||
jxGoosSet: () => import("./goodSet/goodSet.vue")
|
||||
},
|
||||
methods: {
|
||||
getClass(type) { this.$emit('getClass',type)},
|
||||
// 返回上一个页面
|
||||
btnPrev() {
|
||||
this.$emit("closeCreateGood");
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.create-good {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
@@ -1,56 +0,0 @@
|
||||
<template>
|
||||
<div class="update-good">
|
||||
<jx-goos-set
|
||||
:catLevel1="$props.catLevel1"
|
||||
:catLevel2="$props.catLevel2"
|
||||
:skuCatLevel1="$props.skuCatLevel1"
|
||||
:skuCatLevel2="$props.skuCatLevel2"
|
||||
:item="$props.item"
|
||||
:exdCatL1="$props.exdCatL1"
|
||||
:exdCatL2="$props.exdCatL2"
|
||||
:currentPage="'updateGood'"
|
||||
@btnPrev="btnPrev"
|
||||
@getClass="getClass">
|
||||
</jx-goos-set>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "CMPUpdateGood",
|
||||
props: [
|
||||
"item",
|
||||
"catLevel1",
|
||||
"catLevel2",
|
||||
"skuCatLevel1",
|
||||
"skuCatLevel2",
|
||||
"exdCatL1",
|
||||
"exdCatL2"
|
||||
],
|
||||
components: {
|
||||
jxGoosSet: () => import("./goodSet/goodSet.vue")
|
||||
},
|
||||
computed: {
|
||||
// 计算属性的 getter
|
||||
skuNameString: function () {
|
||||
return JSON.stringify(this.skuName);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 获取分类
|
||||
getClass(type) {this.$parent.getClass(type)},
|
||||
// 返回上一个页面
|
||||
btnPrev() {
|
||||
this.$emit("closeUpdateGood");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.update-good {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -1,5 +1,5 @@
|
||||
.separator {
|
||||
border-top: 1px dashed #dcdfe6;
|
||||
// border-top: 1px dashed #dcdfe6;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
margin:20px 0;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.limitBorder{
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<!-- upc数据 -->
|
||||
</el-form-item>
|
||||
|
||||
<!-- 添加规格 prop="goodSku" -->
|
||||
<!-- 添加规格 -->
|
||||
<el-form-item prop="goodSku">
|
||||
<template slot="label">
|
||||
<div class="labelPrefix">商品sku</div>
|
||||
@@ -309,156 +309,159 @@
|
||||
</el-form-item>
|
||||
|
||||
<!-- 分类属性列表 -->
|
||||
<!-- **************************** 美团 ********************* -->
|
||||
<div class="separator"
|
||||
v-show="mtwmCategoryData && mtwmCategoryData.length>0" >
|
||||
<div class="attributeList-title">美团属性列表</div>
|
||||
<el-form-item
|
||||
label="关键词"
|
||||
style="margin-bottom:20px;"
|
||||
v-show="mtwmCategoryData && mtwmCategoryData.length>0">
|
||||
<el-input
|
||||
v-model="mtKeyword"
|
||||
style="width: 180px;"
|
||||
placeholder="请输入关键词"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<div class="limitBorder">
|
||||
<el-form-item
|
||||
v-for="(mtItem,mtIndex) in mtwmCategoryData"
|
||||
:key="mtIndex"
|
||||
:prop="'MT' + mtItem.attr_name + skuName.mtwmCategoryID" >
|
||||
<template slot="label">
|
||||
<div :class="mtItem.need === '1' ? 'labelPrefix' : ''">{{ mtItem.attr_name }}</div>
|
||||
</template>
|
||||
<el-input type="text" v-if="mtItem.attr_value_type === '3'" v-model="mtItem.selectedValue" style="width: 300px;" :placeholder="'请填写'+ mtItem.attr_name"></el-input>
|
||||
<!-- mtItem.attr_value_type 1单选 2 多选 -->
|
||||
<el-select
|
||||
v-else
|
||||
v-model="mtItem.selectedValue"
|
||||
:multiple="mtItem.attr_value_type === '1' ? false : true"
|
||||
:collapse-tags ="mtItem.attr_value_type === '1' ? false : true"
|
||||
:placeholder="'请选择' + mtItem.attr_name"
|
||||
filterable
|
||||
clearable
|
||||
@focus="getMtAttr(mtItem,mtIndex,'MT')"
|
||||
@change="formPartValidate(mtItem,'MT')"
|
||||
style="width: 300px;">
|
||||
<el-option
|
||||
v-for="i in mtItem.value_list"
|
||||
:key="i.value_id"
|
||||
:label="i.value"
|
||||
:value="mtItem.attr_value_type === '1' ? i.value_id : {
|
||||
value_id:i.value_id,
|
||||
value:i.value
|
||||
}">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- **************************** 抖音 ********************* -->
|
||||
<div class="separator "
|
||||
v-show="ddCategoryData && ddCategoryData.length>0">
|
||||
<div class="attributeList-title">抖店属性列表</div>
|
||||
<div class="limitBorder">
|
||||
<el-form-item
|
||||
v-for="(ddItem,ddIndex) in ddCategoryData"
|
||||
:key="'l' + ddIndex"
|
||||
:prop="'DD' + ddItem.property_name ">
|
||||
<template slot="label">
|
||||
<div :class="ddItem.required ? 'labelPrefix' : ''">{{ ddItem.property_name }}</div>
|
||||
</template>
|
||||
<el-input type="text"
|
||||
v-model="ddItem.selectedValue"
|
||||
v-if="ddItem.type==='text'"
|
||||
style="width: 300px;"
|
||||
@change="formPartValidate(ddItem,'DD')"
|
||||
:placeholder="'请填写'+ ddItem.property_name">
|
||||
</el-input>
|
||||
<el-cascader
|
||||
v-else
|
||||
placeholder='试试搜索'
|
||||
:props="propsCmpDD"
|
||||
:options="ddItem.options"
|
||||
:value="ddItem.selectedValue"
|
||||
clearable
|
||||
@change="changeDDCategoryData($event,ddItem,ddIndex,'DD')"
|
||||
filterable
|
||||
style="width: 300px;"
|
||||
></el-cascader>
|
||||
<!-- 时间戳timestamp、时间段timerange 未完成 -->
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- **************************** 饿百 ********************* -->
|
||||
<div class="separator "
|
||||
v-show="ebCategoryData && ebCategoryData.length>0">
|
||||
<div class="attributeList-title">饿百属性列表</div>
|
||||
<div class="limitBorder">
|
||||
<el-form-item
|
||||
v-for="(ebItem,ebIndex) in ebCategoryData"
|
||||
:key="'eb' + ebIndex"
|
||||
>
|
||||
<template slot="label">
|
||||
<div :class="ebItem.required ? 'labelPrefix' : ''">{{ ebItem.propertyName}}</div>
|
||||
</template>
|
||||
<el-input type="text"
|
||||
v-model="ebItem.selectedValue"
|
||||
v-if="ebItem.inputProp && !(ebItem.propertyValues && ebItem.propertyValues.length>0)"
|
||||
style="width: 300px;"
|
||||
@change="formPartValidate(ebItem,'EB')"
|
||||
:placeholder="'请填写'+ ebItem.propertyName">
|
||||
</el-input>
|
||||
<!-- @focus="getMtAttr(ebItem,ebIndex,'EB')" -->
|
||||
<el-select
|
||||
v-else-if="ebItem.propertyValues && ebItem.propertyValues.length>0"
|
||||
v-model="ebItem.selectedValue"
|
||||
:multiple="ebItem.multiSelect"
|
||||
:collapse-tags ="true"
|
||||
:value-key="'ValueId'"
|
||||
:placeholder="'请选择' + ebItem.propertyName"
|
||||
filterable
|
||||
clearable
|
||||
@change="formPartValidate(ebItem,'EB')"
|
||||
style="width: 300px;">
|
||||
<el-option
|
||||
v-for="i in ebItem.propertyValues"
|
||||
:key="i.ValueId"
|
||||
:label="i.valueData"
|
||||
:value=" {
|
||||
ValueId:i.ValueId,
|
||||
valueData:i.valueData
|
||||
}">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!-- <el-cascader
|
||||
v-else-if="ebItem.propertyValues && ebItem.propertyValues.length>0"
|
||||
placeholder='试试搜索'
|
||||
:props="propsCmpEB"
|
||||
:options="ebItem.propertyValues"
|
||||
:value="ebItem.selectedValue"
|
||||
@change="changeDDCategoryData($event,ebItem,ebIndex,'EB')"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 300px;"
|
||||
></el-cascader> -->
|
||||
<el-input type="text"
|
||||
v-model="ebItem.selectedValue"
|
||||
v-else
|
||||
style="width: 300px;"
|
||||
@change="formPartValidate(ebItem,'EB')"
|
||||
:placeholder="'请填写'+ ebItem.propertyName">
|
||||
</el-input>
|
||||
<!-- 时间戳timestamp、时间段timerange 未完成 -->
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 分类属性列表 -->
|
||||
<el-collapse v-model="activeNames" v-show="(mtwmCategoryData && mtwmCategoryData.length>0) || (ddCategoryData && ddCategoryData.length>0) || (ebCategoryData && ebCategoryData.length>0)">
|
||||
<el-collapse-item name="1" v-show="(mtwmCategoryData && mtwmCategoryData.length>0)">
|
||||
<template slot="title">
|
||||
<div class="attributeList-title">美团属性列表</div>
|
||||
</template>
|
||||
<div class="separator" >
|
||||
<el-form-item
|
||||
label="关键词"
|
||||
style="margin-bottom:20px;"
|
||||
v-show="mtwmCategoryData && mtwmCategoryData.length>0">
|
||||
<el-input
|
||||
v-model="mtKeyword"
|
||||
style="width: 180px;"
|
||||
placeholder="请输入关键词"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<div class="limitBorder">
|
||||
<el-form-item
|
||||
v-for="(mtItem,mtIndex) in mtwmCategoryData"
|
||||
:key="mtIndex"
|
||||
:prop="'MT' + mtItem.attr_name + skuName.mtwmCategoryID" >
|
||||
<template slot="label">
|
||||
<div :class="mtItem.need === '1' ? 'labelPrefix' : ''">{{ mtItem.attr_name }}</div>
|
||||
</template>
|
||||
<el-input type="text" v-if="mtItem.attr_value_type === '3'" v-model="mtItem.selectedValue" style="width: 300px;" :placeholder="'请填写'+ mtItem.attr_name"></el-input>
|
||||
<!-- mtItem.attr_value_type 1单选 2 多选 -->
|
||||
<el-select
|
||||
v-else
|
||||
v-model="mtItem.selectedValue"
|
||||
:multiple="mtItem.attr_value_type === '1' ? false : true"
|
||||
:collapse-tags ="mtItem.attr_value_type === '1' ? false : true"
|
||||
:placeholder="'请选择' + mtItem.attr_name"
|
||||
filterable
|
||||
clearable
|
||||
@focus="getMtAttr(mtItem,mtIndex,'MT')"
|
||||
@change="formPartValidate(mtItem,'MT')"
|
||||
style="width: 300px;">
|
||||
<el-option
|
||||
v-for="i in mtItem.value_list"
|
||||
:key="i.value_id"
|
||||
:label="i.value"
|
||||
:value="mtItem.attr_value_type === '1' ? i.value_id : {
|
||||
value_id:i.value_id,
|
||||
value:i.value
|
||||
}">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item name="2" v-show="(ddCategoryData && ddCategoryData.length>0)">
|
||||
<template slot="title">
|
||||
<div class="attributeList-title">抖店属性列表</div>
|
||||
</template>
|
||||
<div class="separator " >
|
||||
<div class="limitBorder">
|
||||
<el-form-item
|
||||
v-for="(ddItem,ddIndex) in ddCategoryData"
|
||||
:key="'l' + ddIndex"
|
||||
:prop="'DD' + ddItem.property_name ">
|
||||
<template slot="label">
|
||||
<div :class="ddItem.required ? 'labelPrefix' : ''">{{ ddItem.property_name }}</div>
|
||||
</template>
|
||||
<el-input type="text"
|
||||
v-model="ddItem.selectedValue"
|
||||
v-if="ddItem.type==='text'"
|
||||
style="width: 300px;"
|
||||
@change="formPartValidate(ddItem,'DD')"
|
||||
:placeholder="'请填写'+ ddItem.property_name">
|
||||
</el-input>
|
||||
<el-cascader
|
||||
v-else
|
||||
placeholder='试试搜索'
|
||||
:props="propsCmpDD"
|
||||
:options="ddItem.options"
|
||||
:value="ddItem.selectedValue"
|
||||
clearable
|
||||
@change="changeDDCategoryData($event,ddItem,ddIndex,'DD')"
|
||||
filterable
|
||||
style="width: 300px;"
|
||||
></el-cascader>
|
||||
<!-- 时间戳timestamp、时间段timerange 未完成 -->
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="饿百属性列表" name="3" v-show="(ebCategoryData && ebCategoryData.length>0)">
|
||||
<template slot="title">
|
||||
<div class="attributeList-title">饿百属性列表</div>
|
||||
</template>
|
||||
<div class="separator " >
|
||||
<div class="limitBorder">
|
||||
<el-form-item
|
||||
v-for="(ebItem,ebIndex) in ebCategoryData"
|
||||
:key="'eb' + ebIndex"
|
||||
>
|
||||
<template slot="label">
|
||||
<div :class="ebItem.required ? 'labelPrefix' : ''">{{ ebItem.propertyName}}</div>
|
||||
</template>
|
||||
<el-input type="text"
|
||||
v-model="ebItem.selectedValue"
|
||||
v-if="ebItem.inputProp && !(ebItem.propertyValues && ebItem.propertyValues.length>0)"
|
||||
style="width: 300px;"
|
||||
@change="formPartValidate(ebItem,'EB')"
|
||||
:placeholder="'请填写'+ ebItem.propertyName">
|
||||
</el-input>
|
||||
<!-- @focus="getMtAttr(ebItem,ebIndex,'EB')" -->
|
||||
<el-select
|
||||
v-else-if="ebItem.propertyValues && ebItem.propertyValues.length>0"
|
||||
v-model="ebItem.selectedValue"
|
||||
:multiple="ebItem.multiSelect"
|
||||
:collapse-tags ="true"
|
||||
:value-key="'ValueId'"
|
||||
:placeholder="'请选择' + ebItem.propertyName"
|
||||
filterable
|
||||
clearable
|
||||
@change="formPartValidate(ebItem,'EB')"
|
||||
style="width: 300px;">
|
||||
<el-option
|
||||
v-for="i in ebItem.propertyValues"
|
||||
:key="i.ValueId"
|
||||
:label="i.valueData"
|
||||
:value=" {
|
||||
ValueId:i.ValueId,
|
||||
valueData:i.valueData
|
||||
}">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!-- <el-cascader
|
||||
v-else-if="ebItem.propertyValues && ebItem.propertyValues.length>0"
|
||||
placeholder='试试搜索'
|
||||
:props="propsCmpEB"
|
||||
:options="ebItem.propertyValues"
|
||||
:value="ebItem.selectedValue"
|
||||
@change="changeDDCategoryData($event,ebItem,ebIndex,'EB')"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 300px;"
|
||||
></el-cascader> -->
|
||||
<el-input type="text"
|
||||
v-model="ebItem.selectedValue"
|
||||
v-else
|
||||
style="width: 300px;"
|
||||
@change="formPartValidate(ebItem,'EB')"
|
||||
:placeholder="'请填写'+ ebItem.propertyName">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
|
||||
<div class="separator" ></div> <!-- 划线 -->
|
||||
<!-- 所在城市 -->
|
||||
@@ -498,13 +501,14 @@
|
||||
</el-select>
|
||||
<el-select v-model="skuName.categoryID2" filterable style="width: 197px;">
|
||||
<el-option label="全部" value="" select v-if="!skuName.categoryID2">全部</el-option>
|
||||
<el-option
|
||||
v-for="item in exdCatL2"
|
||||
v-if="item.parentID === skuName.categoryID"
|
||||
:key="item.id"
|
||||
:label="item.exdName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
<template v-for="item in exdCatL2">
|
||||
<el-option
|
||||
v-if="item.parentID === skuName.categoryID"
|
||||
:key="item.id"
|
||||
:label="item.exdName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="京西分类" prop="categoryID" v-else>
|
||||
@@ -529,14 +533,15 @@
|
||||
style="width: 197px;"
|
||||
>
|
||||
<el-option label="全部" value="" select v-if="!skuName.categoryID2">全部</el-option>
|
||||
<el-option
|
||||
v-for="item in catLevel2"
|
||||
v-if="item.parentID === skuName.categoryID"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
<template v-for="item in catLevel2">
|
||||
<el-option
|
||||
v-if="item.parentID === skuName.categoryID"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
@@ -546,7 +551,6 @@
|
||||
prop="img">
|
||||
尺寸800*800,图片不得大于1M(<span style="color:#f56c6c;">1、至少上传一张,最多五张;2、拖拽即可改变图片顺序</span>)
|
||||
<div style="display: flex;" v-if="reShowImg">
|
||||
<!-- @onChange="imgChange" :isUrl="[skuName.img,skuName.img2,skuName.img3,skuName.img4,skuName.img5]" -->
|
||||
<jx-upload-file
|
||||
:listType="'picture-card'"
|
||||
:imgType="['image/jpeg','image/png','image/gif']"
|
||||
@@ -562,8 +566,7 @@
|
||||
</jx-upload-file>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<!-- productRule.unstruct_rules.special_pictures_rules[0].special_picture_title v-if="productRule && skuName.mtwmCategoryID" -->
|
||||
<!-- 特殊图片:prop="'specialPic' + index" -->
|
||||
<!-- 特殊图片 -->
|
||||
<div v-if="productRule" style="border: none;">
|
||||
<el-form-item
|
||||
v-for="(item,index) in productRule.unstruct_rules.special_pictures_rules"
|
||||
@@ -591,7 +594,6 @@
|
||||
</div>
|
||||
<el-button slot="reference" type="text">查看示例图</el-button>
|
||||
</el-popover>
|
||||
<!-- @onChange="imgChangeSpecial" -->
|
||||
<jx-upload-file
|
||||
:listType="'picture-card'"
|
||||
:imgType="['image/jpeg','image/png']"
|
||||
@@ -615,7 +617,6 @@
|
||||
prop="quaPicture">
|
||||
尺寸800*800(<span style="color:#f56c6c;"> 1、医疗器械必传,保健食品、特殊医学配方食品建议传 2、最多三张;</span>)
|
||||
<div style="display: flex;" v-if="reShowImg">
|
||||
<!-- @onChange="imgChangeQua" -->
|
||||
<jx-upload-file
|
||||
:listType="'picture-card'"
|
||||
:imgType="['image/jpeg','image/png','image/jpg']"
|
||||
@@ -841,8 +842,7 @@ export default {
|
||||
skuNameString2:"",
|
||||
productRule:"",
|
||||
specialPictures:"", // 特殊图片,美团
|
||||
// 折叠面板---------------------activeNames
|
||||
// activeNames:['1']
|
||||
activeNames:[] // 折叠面板索引
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
@@ -1160,15 +1160,6 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// imgChangeSpecial(e,index){
|
||||
// // console.log(e,'imgChangeSpecial',index)
|
||||
// // let str = 'specialPic' + index
|
||||
// // console.log('str',str)
|
||||
// // console.log(this.productRule,'校验了特殊图片没有',this.skuName)
|
||||
// // console.log('this.rules',this.rules)
|
||||
// // this.$refs['goodManager'].validateField(str)
|
||||
// // this.formPartValidate()
|
||||
// },
|
||||
// 修改商品************************
|
||||
// 分类属性列表赋值
|
||||
categoryDataGet(e,type){
|
||||
@@ -1215,7 +1206,6 @@ export default {
|
||||
JSON.parse(e).forEach(item => {
|
||||
let findIndex = this.ebCategoryData.findIndex(i => i.propertyId === item.propertyId)
|
||||
if(findIndex !== -1){
|
||||
console.log(item,'this.ebCategoryData[findIndex]',this.ebCategoryData[findIndex])
|
||||
if(item.propertyValues.length === 1 && !item.propertyValues[0].valueId) this.ebCategoryData[findIndex].selectedValue = item.propertyValues[0].valueData
|
||||
else if(item.propertyValues.length === 1 && item.propertyValues[0].valueId){
|
||||
this.ebCategoryData[findIndex].selectedValue= {
|
||||
@@ -1234,13 +1224,6 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
// for(let i in JSON.parse(e)){
|
||||
// this.ebCategoryData.map((item,index)=>{
|
||||
// if(+i === item.propertyId){
|
||||
// this.ebCategoryData[index].selectedValue = JSON.parse(e)[i][0].value
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
}
|
||||
},
|
||||
// 修改商品************************
|
||||
@@ -1418,19 +1401,6 @@ export default {
|
||||
let item = this.catLevel2.filter(item => item.parentID === this.skuName.categoryID);
|
||||
this.skuName.categoryID2 = item.length > 0 ? item[0].id : ""
|
||||
},
|
||||
// // 商品图片赋值
|
||||
// imgChange(e) {
|
||||
// // this.skuName.img = e[0] ? e[0].url : ''
|
||||
// // this.skuName.img2 = e[1] ? e[1].url : ''
|
||||
// // this.skuName.img3 = e[2] ? e[2].url : ''
|
||||
// // this.skuName.img4 = e[3] ? e[3].url : ''
|
||||
// // this.skuName.img5 = e[4] ? e[4].url : ''
|
||||
// // console.log(this.skuName,'商品图片赋值',this.imgArr,'eeeee',e)
|
||||
// },
|
||||
// imgChangeQua(e){
|
||||
// let arr = e.map(item => { return item.url})
|
||||
// this.skuName.quaPictures = arr.length > 0 ? arr.join(',') : ''
|
||||
// },
|
||||
// 分类改变 美团 / 抖店
|
||||
async changeCategory(type,e){
|
||||
let categoryID = e[e.length - 1]
|
||||
@@ -1466,8 +1436,6 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
// console.log(productRuleRes.unstruct_rules.special_pictures_rules,'productRuleRes,,productRuleRes,,productRuleRes',this.productRule.unstruct_rules.special_pictures_rules)
|
||||
|
||||
// 资质图片
|
||||
if(this.productRule.unstruct_rules.qualification_pictures_rule.is_qualification_pictures_need === 1) this.rules['quaPicture'] = [{ required: true, message: '请上传资质图片', trigger: 'change'}]
|
||||
|
||||
@@ -1480,8 +1448,6 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
let res = await api(`v2/sku/GetMTCategoryAttrList?categoryId=${categoryID}&appOrgCode=589`);
|
||||
if (res && res.length > 0) {
|
||||
res.map((item,index) => {
|
||||
@@ -1507,6 +1473,7 @@ export default {
|
||||
})
|
||||
}
|
||||
this.mtKeyword = this.skuName.name
|
||||
if(this.activeNames.indexOf('1') === -1) this.activeNames.push('1')
|
||||
}else if(type === 'DD'){
|
||||
this.ddCategoryData = []
|
||||
if(!categoryID) return
|
||||
@@ -1535,6 +1502,7 @@ export default {
|
||||
}, trigger: 'blur'}]
|
||||
}
|
||||
})
|
||||
if(this.activeNames.indexOf('2') === -1) this.activeNames.push('2')
|
||||
}else{
|
||||
let newDesc = res.desc.includes('调整升级') ? '抖店类目' + res.desc.substring(3) : res.desc
|
||||
msgWarning(newDesc);
|
||||
@@ -1559,6 +1527,7 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
if(this.activeNames.indexOf('3') === -1) this.activeNames.push('3')
|
||||
}
|
||||
hideLoad()
|
||||
},
|
||||
@@ -1572,14 +1541,6 @@ export default {
|
||||
if(!this.validGoodName()) return // 校验商品名
|
||||
|
||||
let data = {} // 参数
|
||||
// // 创建商品
|
||||
|
||||
// // 分类绑定
|
||||
// this.skuName['jdCategoryID'] = this.classBindValue('JD')
|
||||
// this.skuName['jdsCategoryID'] = this.classBindValue('JG')
|
||||
// this.skuName['ebaiCategoryID'] = this.classBindValue('EB')
|
||||
// this.skuName['mtwmCategoryID'] = this.classBindValue('MT')
|
||||
// this.skuName['ddCategoryID'] = this.classBindValue('DD')
|
||||
|
||||
this.handleWeight() // 处理单位
|
||||
|
||||
@@ -1630,7 +1591,7 @@ export default {
|
||||
})
|
||||
data['specialPictures'] = JSON.stringify(specialPictures)
|
||||
}
|
||||
console.log('保存商品时的参数信息',data)
|
||||
// console.log('保存商品时的参数信息',data)
|
||||
// return
|
||||
if(this.currentPage === 'createGood'){
|
||||
AddSkuName(data, (res) => {
|
||||
@@ -1655,6 +1616,7 @@ export default {
|
||||
this.validNum = 0 // 重置校验次数
|
||||
}else{
|
||||
// console.log('未通过校验')
|
||||
this.activeNames = ['1','2','3'] // 把属性列表打开
|
||||
// 未通过校验
|
||||
this.$message({
|
||||
message: "未通过校验,请检查填写",
|
||||
@@ -1774,10 +1736,6 @@ export default {
|
||||
|
||||
return JSON.stringify(result)
|
||||
},
|
||||
// // 处理分类绑定的值
|
||||
// classBindValue(type){
|
||||
// return this.$refs[type].currentValue[this.$refs[type].currentValue.length - 1] || "";
|
||||
// },
|
||||
// 处理单位
|
||||
handleWeight(){
|
||||
this.skuName.skus.forEach(item => {
|
||||
|
||||
@@ -2,30 +2,33 @@
|
||||
<div class="jx-goods-manager baselayout">
|
||||
<!-- 创建商品模块 -->
|
||||
<div v-if="createGoodCMPShow">
|
||||
<CMPCreateGood
|
||||
@closeCreateGood="closeCreateGood"
|
||||
@getClass="getClass"
|
||||
:catLevel1="catLevel1"
|
||||
:catLevel2="catLevel2"
|
||||
:skuCatLevel1="skuCatLevel1"
|
||||
:skuCatLevel2="skuCatLevel2"
|
||||
></CMPCreateGood>
|
||||
<div style="max-width: 1000px;margin: 0 auto;">
|
||||
<jx-goos-set
|
||||
:catLevel1="catLevel1"
|
||||
:catLevel2="catLevel2"
|
||||
:currentPage="'createGood'"
|
||||
@btnPrev="closeCreateGood"
|
||||
@getClass="getClass">
|
||||
</jx-goos-set>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 创建商品模块 -->
|
||||
<!-- 修改商品模块 -->
|
||||
<div v-if="updateGoodCMPShow">
|
||||
<CMPUpdateGood
|
||||
@closeUpdateGood="closeUpdateGood"
|
||||
@getClassZSW="getClassZSW"
|
||||
:item="skuName"
|
||||
:catLevel1="catLevel1"
|
||||
:catLevel2="catLevel2"
|
||||
:skuCatLevel1="skuCatLevel1"
|
||||
:skuCatLevel2="skuCatLevel2"
|
||||
:exdCatL1="exdCatL1"
|
||||
:exdCatL2="exdCatL2"
|
||||
ref="updateGood"
|
||||
></CMPUpdateGood>
|
||||
<div style="max-width: 1000px;margin: 0 auto;">
|
||||
<jx-goos-set
|
||||
:catLevel1="catLevel1"
|
||||
:catLevel2="catLevel2"
|
||||
:skuCatLevel1="skuCatLevel1"
|
||||
:skuCatLevel2="skuCatLevel2"
|
||||
:item="skuName"
|
||||
:exdCatL1="exdCatL1"
|
||||
:exdCatL2="exdCatL2"
|
||||
:currentPage="'updateGood'"
|
||||
@btnPrev="closeUpdateGood"
|
||||
@getClass="getClass">
|
||||
</jx-goos-set>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 修改商品模块 -->
|
||||
<div
|
||||
@@ -49,7 +52,6 @@
|
||||
|
||||
<script>
|
||||
import api from '@/utils/api'
|
||||
// import { showLoad, hideLoad } from "@/tools/loading.js";
|
||||
import {mapGetters} from 'vuex'
|
||||
import store from '@/store'
|
||||
export default {
|
||||
@@ -57,10 +59,8 @@ export default {
|
||||
components: {
|
||||
// 三级的四个菜单本来是tab的 石老板叫改成3级菜单做权限的
|
||||
CMPGoodsManager: () => import('./cmp-goods-manager.vue'),
|
||||
CMPCreateGood: () => import('./cmp-create-good.vue'),
|
||||
CMPUpdateGood: () => import('./cmp-update-good.vue'),
|
||||
DiaResetSkus: () => import('../dialog/dia-reset-skus.vue'),
|
||||
//GoodsSort
|
||||
jxGoosSet: () => import("./goodSet/goodSet.vue")
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -82,10 +82,8 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
userInfo: 'userInfo',
|
||||
yunyingMap: 'yunyingMap',
|
||||
jDCategoryData:'jDCategoryData',
|
||||
jGCategoryData:'jGCategoryData',
|
||||
// jGCategoryData:'jGCategoryData',
|
||||
mTCategoryData:'mTCategoryData',
|
||||
dYCategoryData:'dYCategoryData',
|
||||
eBCategoryData:'eBCategoryData'
|
||||
@@ -161,18 +159,18 @@ export default {
|
||||
this.updateGoodCMPShow = false
|
||||
this.$refs.goodsManager.getGoods()
|
||||
},
|
||||
// 找出数组对象中最大属性
|
||||
biggerID (arr, attr) {
|
||||
// 先拷贝
|
||||
let temArr = []
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
temArr.push(arr[i])
|
||||
}
|
||||
temArr.sort((n1, n2) => {
|
||||
return n2[attr] - n1[attr]
|
||||
})
|
||||
return temArr[0][attr]
|
||||
},
|
||||
// // 找出数组对象中最大属性
|
||||
// biggerID (arr, attr) {
|
||||
// // 先拷贝
|
||||
// let temArr = []
|
||||
// for (let i = 0; i < arr.length; i++) {
|
||||
// temArr.push(arr[i])
|
||||
// }
|
||||
// temArr.sort((n1, n2) => {
|
||||
// return n2[attr] - n1[attr]
|
||||
// })
|
||||
// return temArr[0][attr]
|
||||
// },
|
||||
|
||||
/**
|
||||
* 二次封装信息提示
|
||||
|
||||
Reference in New Issue
Block a user