|
|
|
@ -18,23 +18,25 @@ |
|
|
|
:value="item.shopId" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item :label="$t('product.productname')" v-if="langType == 'zh'" prop="productName_ZH"> |
|
|
|
<el-input v-model="form.productName_ZH" maxlength="50" class="form-content-item-input" :placeholder="$t('product.productnamehint')" show-word-limit /> |
|
|
|
<el-input v-model="form.productName_ZH" class="form-content-item-input" :placeholder="$t('product.productnamehint')" show-word-limit /> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item :label="$t('product.productname_en')" prop="productName_EN" v-if="langType == 'en'"> |
|
|
|
<el-input v-model="form.productName_EN" maxlength="50" class="form-content-item-input" :placeholder="$t('product.productnamehint_en')" show-word-limit /> |
|
|
|
<el-input v-model="form.productName_EN" class="form-content-item-input" :placeholder="$t('product.productnamehint_en')" show-word-limit /> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item :label="$t('product.productbrief')" prop="productBrief_ZH" v-if="langType == 'zh'"> |
|
|
|
<el-input v-model="form.productBrief_ZH" maxlength="50" class="form-content-item-input" :placeholder="$t('product.productbriefhint')" show-word-limit /> |
|
|
|
<el-input type="textarea" :rows="2" |
|
|
|
v-model="form.productBrief_ZH" class="form-content-item-input" :placeholder="$t('product.productbriefhint')" show-word-limit /> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item :label="$t('product.productbrief_en')" prop="productBrief_EN" v-if="langType == 'en'"> |
|
|
|
<el-input v-model="form.productBrief_EN" maxlength="50" class="form-content-item-input" :placeholder="$t('product.productbriefhint_en')" show-word-limit /> |
|
|
|
<el-input type="textarea" :rows="2" |
|
|
|
v-model="form.productBrief_EN" class="form-content-item-input" :placeholder="$t('product.productbriefhint_en')" show-word-limit /> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item :label="$t('product.platformproductclassify')" prop="classifyId"> |
|
|
|
@ -75,7 +77,7 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="form-item-long" :label="$t('product.supplier')"> |
|
|
|
<el-input v-model="form.supplierName" maxlength="20" class="form-content-item-input" show-word-limit :placeholder="$t('product.supplierhint')" /> |
|
|
|
<el-input v-model="form.supplierName" maxlength="100" class="form-content-item-input" show-word-limit :placeholder="$t('product.supplierhint')" /> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item :label="$t('product.productimg')"> |
|
|
|
@ -263,7 +265,7 @@ |
|
|
|
<img width="100%" :src="dialogImageUrl" alt> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog :visible.sync="editSkuAttrDialogVisible" |
|
|
|
<el-dialog :visible.sync="editSkuAttrDialogVisible" |
|
|
|
title="编辑规格" center append-to-body> |
|
|
|
<EditSkuAttr |
|
|
|
ref="EditSkuAttr" |
|
|
|
@ -372,7 +374,7 @@ export default { |
|
|
|
names: [ |
|
|
|
{ |
|
|
|
code: '', // 级别 |
|
|
|
skuName_ZH: '', |
|
|
|
skuName_ZH: '', |
|
|
|
skuName_EN: '', // 规格名 |
|
|
|
needImg: false, |
|
|
|
langInfoMap:[], |
|
|
|
@ -387,7 +389,7 @@ export default { |
|
|
|
] |
|
|
|
} |
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
skus: [ |
|
|
|
{ |
|
|
|
// 规格值 |
|
|
|
@ -488,7 +490,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
|
|
|
|
handleChangeCascader() { |
|
|
|
console.log(this.form.classifyId) |
|
|
|
}, |
|
|
|
@ -527,7 +529,7 @@ export default { |
|
|
|
}, |
|
|
|
// 点击新增商品时表单数据重置 |
|
|
|
reset() { |
|
|
|
|
|
|
|
|
|
|
|
this.form = { |
|
|
|
shopId : '', |
|
|
|
productId: null, //商品Id |
|
|
|
@ -682,7 +684,7 @@ export default { |
|
|
|
//防出错处理 |
|
|
|
this.form.classifyId = Array.isArray(this.form.classifyId) ? this.form.classifyId[this.form.classifyId.length - 1] : this.form.classifyId |
|
|
|
this.form.classifyBusinessId = Array.isArray(this.form.classifyBusinessId) ? this.form.classifyBusinessId[this.form.classifyBusinessId.length - 1] : this.form.classifyBusinessId |
|
|
|
|
|
|
|
|
|
|
|
//多语言转换 |
|
|
|
this.form.langInfoMap = {} |
|
|
|
this.form.langInfoMap["zh"] = {}; |
|
|
|
@ -720,7 +722,7 @@ export default { |
|
|
|
if (this.productId) { |
|
|
|
this.form.productId = this.productId |
|
|
|
const res = await getClassifyUpdate(this.form) |
|
|
|
|
|
|
|
|
|
|
|
if (res.code === '') { |
|
|
|
this.$message({ |
|
|
|
type: 'success', |
|
|
|
@ -735,7 +737,7 @@ export default { |
|
|
|
type: 'success', |
|
|
|
message: this.$t('common.addsuccessful') |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.reset() |
|
|
|
this.back() |
|
|
|
} |
|
|
|
@ -762,7 +764,7 @@ export default { |
|
|
|
// 获取详情--这个接口放在外部调用了,这里先不做修改 |
|
|
|
async details() { |
|
|
|
const res = await getClassifyGetById({ productId: this.productId }) |
|
|
|
|
|
|
|
|
|
|
|
let itemData = res.data; |
|
|
|
this.initLangInfo(itemData) |
|
|
|
this.initSkuLangInfo(itemData) |
|
|
|
@ -796,7 +798,7 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
initLangInfo(itemData){ |
|
|
|
if(itemData && itemData.langInfoMap && itemData.langInfoMap['zh']){ |
|
|
|
@ -817,7 +819,7 @@ export default { |
|
|
|
itemData.productBrief_EN = ""; |
|
|
|
itemData.productText_EN = ""; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async selectList() { |
|
|
|
@ -903,14 +905,14 @@ export default { |
|
|
|
values.push(attrList) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 相互组合 |
|
|
|
if (values.length) { |
|
|
|
doExchange(values, 0) |
|
|
|
} |
|
|
|
this.form.skus = skuListArray.map(sku1 => { |
|
|
|
const findSku = this.form.skus.find(sku2 => { |
|
|
|
|
|
|
|
|
|
|
|
if (!sku2.skuAttrCodeDTOList) { |
|
|
|
return false |
|
|
|
} |
|
|
|
@ -919,7 +921,7 @@ export default { |
|
|
|
} |
|
|
|
const valueCodeList = sku2.skuAttrCodeDTOList.map(item => item.valueCode) |
|
|
|
var result = sku1.skuAttrCodeDTOList.every(item => valueCodeList.indexOf(item.valueCode) !== -1) |
|
|
|
|
|
|
|
|
|
|
|
return result |
|
|
|
}) |
|
|
|
if (findSku) { |
|
|
|
@ -1287,7 +1289,7 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
.form-content-item-input{ |
|
|
|
width:400px |
|
|
|
width:615px |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |