调整
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
@close="handleClose">
|
||||
<el-form class="ai-form" :model="form" label-width="160px" ref="form">
|
||||
<el-form-item label="店铺" style="width: 100%;" prop="targetMallId" :rules="[{ required: true, message: '请选择店铺', trigger: 'blur' }]">
|
||||
<el-select style="width: 380px" v-model="form.targetMallId" placeholder="请选择">
|
||||
<el-select style="width: 380px" v-model="form.targetMallId" @change="onMallChange" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in $store.state.mallList"
|
||||
:key="item.mallId"
|
||||
@@ -125,6 +125,16 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.isSemi" label="经营站点" style="width: 100%;" prop="siteId" :rules="[{ required: true, message: '请选择经营站点', trigger: 'blur' }]">
|
||||
<el-select style="width: 380px" multiple v-model="form.siteId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in siteList"
|
||||
:key="item.siteId"
|
||||
:label="item.siteName"
|
||||
:value="item.siteId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
prop="isSameCategory"
|
||||
label="是否保持相同类目:"
|
||||
@@ -246,13 +256,17 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue"
|
||||
form: {
|
||||
targetMallId: '',
|
||||
targetCatId: [],
|
||||
isSameCategory: true
|
||||
}
|
||||
isSemi: false,
|
||||
isSameCategory: true,
|
||||
siteId: []
|
||||
},
|
||||
siteList: []
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
this.getList()
|
||||
this.getSiteList()
|
||||
if (this.$store.state.mallList.length > 0) {
|
||||
this.productPage.mallId = this.$store.state.mallList[0].mallId
|
||||
}
|
||||
@@ -269,6 +283,34 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue"
|
||||
this.total = res.data.total
|
||||
})
|
||||
},
|
||||
getSiteList() {
|
||||
sendChromeAPIMessage({
|
||||
url: 'bg-visage-mms/config/common/site/query',
|
||||
needMallId: true,
|
||||
mallId: this.productPage.mallId,
|
||||
data: {}}).then((res) => {
|
||||
if (res.success) {
|
||||
this.siteList = res.result.siteBaseList.filter(item => {
|
||||
return item.matchSemiManaged
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onMallChange() {
|
||||
if (!this.form.targetMallId) {
|
||||
Message.error("请先选择店铺")
|
||||
return
|
||||
}
|
||||
let tempMall = this.$store.state.mallList.filter(item => {
|
||||
return item.mallId == this.form.targetMallId
|
||||
})
|
||||
if (null == tempMall || tempMall.length == 0) {
|
||||
Message.error("请先选择店铺")
|
||||
return
|
||||
} else {
|
||||
this.form.isSemi = tempMall[0].isSemiManagedMall
|
||||
}
|
||||
},
|
||||
remove () {
|
||||
if (this.ids.length <= 0) {
|
||||
alert('请选择要删除的商品');
|
||||
@@ -495,14 +537,18 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue"
|
||||
} else {
|
||||
category = this.form.targetCatId[this.form.targetCatId.length - 1]
|
||||
}
|
||||
let data = {catId: category}
|
||||
if (this.form.isSemi) {
|
||||
data.productSemiManagedReq = {
|
||||
bindSiteIds: this.form.siteId
|
||||
}
|
||||
}
|
||||
setTimeout(() => {
|
||||
sendChromeAPIMessage({
|
||||
url: 'bg-visage-mms/product/draft/add',
|
||||
needMallId: true,
|
||||
mallId: this.form.targetMallId,
|
||||
data: {
|
||||
catId: category
|
||||
}}).then((res) => {
|
||||
data: data}).then((res) => {
|
||||
if (res.errorCode == 1000000) {
|
||||
let draftId = res.result.productDraftId
|
||||
if (!this.form.isSameCategory) {
|
||||
@@ -515,6 +561,11 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue"
|
||||
}
|
||||
}
|
||||
content.productDraftId = draftId
|
||||
if (this.form.isSemi) {
|
||||
content.productSemiManagedReq = {
|
||||
bindSiteIds: this.form.siteId
|
||||
}
|
||||
}
|
||||
sendChromeAPIMessage({
|
||||
url: 'bg-visage-mms/product/draft/save',
|
||||
needMallId: true,
|
||||
|
||||
@@ -715,7 +715,7 @@
|
||||
sn: res.result.errorInfoList[0].id,
|
||||
errorMsg: res.result.errorInfoList[0].errorMsg,
|
||||
mallName: mallName,
|
||||
url: res.result.errorInfoList[0].extraInfoMap?.url
|
||||
url: 'https://agentseller.temu.com' + res.result.errorInfoList[0].extraInfoMap?.url
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user