|
@@ -92,10 +92,9 @@
|
|
</el-form>
|
|
</el-form>
|
|
<template #footer>
|
|
<template #footer>
|
|
<div style="display: flex; justify-content: space-between">
|
|
<div style="display: flex; justify-content: space-between">
|
|
- <span v-loading="countLoadig"
|
|
|
|
- >定位到的商品数量:
|
|
|
|
- <span v-if="dialogForm.isCount == true">{{ commodityCount[0]?.min }} - {{ commodityCount[0]?.max }}</span></span
|
|
|
|
- >
|
|
|
|
|
|
+ <span v-loading="countLoadig">定位到的商品数量:
|
|
|
|
+ <span v-if="dialogForm.isCount == true">{{ commodityCount[0]?.min }} - {{ commodityCount[0]?.max }}</span>
|
|
|
|
+ </span>
|
|
<span class="dialog-footer">
|
|
<span class="dialog-footer">
|
|
<el-button @click="visible = false">取消</el-button>
|
|
<el-button @click="visible = false">取消</el-button>
|
|
<el-button type="primary" @click="dialogFormSubmit">确定</el-button>
|
|
<el-button type="primary" @click="dialogFormSubmit">确定</el-button>
|
|
@@ -227,7 +226,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import { CSSProperties, Ref, inject, reactive, ref } from 'vue'
|
|
|
|
|
|
+import { CSSProperties, Ref, inject, onMounted, reactive, ref } from 'vue'
|
|
import { useShopInfo } from '/@/stores/shopInfo'
|
|
import { useShopInfo } from '/@/stores/shopInfo'
|
|
import { storeToRefs } from 'pinia'
|
|
import { storeToRefs } from 'pinia'
|
|
import { ElMessage } from 'element-plus'
|
|
import { ElMessage } from 'element-plus'
|
|
@@ -255,6 +254,7 @@ const categoryBiddingTypeOptions = [
|
|
label: '自定义竞价',
|
|
label: '自定义竞价',
|
|
},
|
|
},
|
|
]
|
|
]
|
|
|
|
+const categoryBidInput = ref('0.75')
|
|
const singleGoodsBidSelect = ref('customBid')
|
|
const singleGoodsBidSelect = ref('customBid')
|
|
const singleGoodsBidTypeOptions = [
|
|
const singleGoodsBidTypeOptions = [
|
|
{
|
|
{
|
|
@@ -281,7 +281,8 @@ const countLoadig = ref(false)
|
|
const visible = ref(false)
|
|
const visible = ref(false)
|
|
let dialogTitle = ref('')
|
|
let dialogTitle = ref('')
|
|
let categoryId = ref('')
|
|
let categoryId = ref('')
|
|
-
|
|
|
|
|
|
+const dialogselectValue = ref('')
|
|
|
|
+let dialogOptions: any = ref([])
|
|
const dialogForm: any = reactive({
|
|
const dialogForm: any = reactive({
|
|
prices: {
|
|
prices: {
|
|
lowest: undefined,
|
|
lowest: undefined,
|
|
@@ -322,6 +323,7 @@ async function validatePrices(rule, value) {
|
|
}
|
|
}
|
|
|
|
|
|
async function setProductOrientationData() {
|
|
async function setProductOrientationData() {
|
|
|
|
+ productOrientationLoading.value = true
|
|
try {
|
|
try {
|
|
const resp = await request({
|
|
const resp = await request({
|
|
url: '/api/ad_manage/targetable/categories/',
|
|
url: '/api/ad_manage/targetable/categories/',
|
|
@@ -450,22 +452,22 @@ function singleGoodsSearchChaneged() {
|
|
setSearchTableData()
|
|
setSearchTableData()
|
|
}
|
|
}
|
|
function addSingleSearch(scope) {
|
|
function addSingleSearch(scope) {
|
|
- console.log('🚀 ~ addSingleSearch ~ scope-->>', scope)
|
|
|
|
|
|
+ console.log('🚀 ~ addSingleSearch ~ scope-->>', scope);
|
|
|
|
|
|
- const typesToAdd = []
|
|
|
|
|
|
+ const typesToAdd = [];
|
|
if (expand.value) {
|
|
if (expand.value) {
|
|
- typesToAdd.push('ASIN_EXPANDED_FROM')
|
|
|
|
|
|
+ typesToAdd.push('ASIN_EXPANDED_FROM');
|
|
}
|
|
}
|
|
if (accurate.value) {
|
|
if (accurate.value) {
|
|
- typesToAdd.push('ASIN_SAME_AS')
|
|
|
|
|
|
+ typesToAdd.push('ASIN_SAME_AS');
|
|
}
|
|
}
|
|
const productTypeMap = {
|
|
const productTypeMap = {
|
|
ASIN_EXPANDED_FROM: '扩展',
|
|
ASIN_EXPANDED_FROM: '扩展',
|
|
ASIN_SAME_AS: '精确',
|
|
ASIN_SAME_AS: '精确',
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
typesToAdd.forEach((productType) => {
|
|
typesToAdd.forEach((productType) => {
|
|
- const isAlreadyAdded = productOrientationTableData.value.some((item) => item.sku === scope.row.sku && item.productType === productType)
|
|
|
|
|
|
+ const isAlreadyAdded = productOrientationTableData.value.some(item => item.sku === scope.row.sku && item.productType === productType);
|
|
|
|
|
|
if (!isAlreadyAdded) {
|
|
if (!isAlreadyAdded) {
|
|
const newData = {
|
|
const newData = {
|
|
@@ -474,14 +476,15 @@ function addSingleSearch(scope) {
|
|
sku: scope.row.sku,
|
|
sku: scope.row.sku,
|
|
productType: productType,
|
|
productType: productType,
|
|
productTypeText: productTypeMap[productType],
|
|
productTypeText: productTypeMap[productType],
|
|
- }
|
|
|
|
- productOrientationTableData.value.push(newData)
|
|
|
|
|
|
+ };
|
|
|
|
+ productOrientationTableData.value.push(newData);
|
|
} else {
|
|
} else {
|
|
- console.log(`${productType} item is already added.`)
|
|
|
|
|
|
+ console.log(`${productType} item is already added.`);
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
let selectedLabels = ref([]) // 选中的label数组
|
|
let selectedLabels = ref([]) // 选中的label数组
|
|
function dialogSelectChange(event) {
|
|
function dialogSelectChange(event) {
|
|
console.log('🚀 ~ dialogSelectChange ~ event-->>', event)
|
|
console.log('🚀 ~ dialogSelectChange ~ event-->>', event)
|
|
@@ -556,24 +559,26 @@ function dialogFormSubmit() {
|
|
|
|
|
|
// 定向按钮功能
|
|
// 定向按钮功能
|
|
function orientate(node, data) {
|
|
function orientate(node, data) {
|
|
- console.log('🚀 ~ orientate ~ data-->>', data)
|
|
|
|
- const exists = productOrientationTableData.value.some((item) => item.cid === data.cid)
|
|
|
|
|
|
+ console.log('🚀 ~ orientate ~ data-->>', data);
|
|
|
|
+ const exists = productOrientationTableData.value.some(item => item.cid === data.cid);
|
|
|
|
|
|
if (!exists) {
|
|
if (!exists) {
|
|
const newData = {
|
|
const newData = {
|
|
type: 'c',
|
|
type: 'c',
|
|
classification: data.cna,
|
|
classification: data.cna,
|
|
classificationId: data.cid,
|
|
classificationId: data.cid,
|
|
- }
|
|
|
|
- productOrientationTableData.value.push(newData)
|
|
|
|
|
|
+ };
|
|
|
|
+ productOrientationTableData.value.push(newData);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
let productTargetBidList = ref([])
|
|
let productTargetBidList = ref([])
|
|
async function productTagetSave() {
|
|
async function productTagetSave() {
|
|
console.log('tableData', productOrientationTableData.value)
|
|
console.log('tableData', productOrientationTableData.value)
|
|
// 检查是否存在 bid 为空的行
|
|
// 检查是否存在 bid 为空的行
|
|
- const hasEmptyBid = productOrientationTableData.value.some((row) => row.bid == null || row.bid === '')
|
|
|
|
|
|
+ const hasEmptyBid = productOrientationTableData.value.some(row => row.bid == null || row.bid === '')
|
|
// 直接返回,不继续执行
|
|
// 直接返回,不继续执行
|
|
if (hasEmptyBid) {
|
|
if (hasEmptyBid) {
|
|
console.log('存在空的 bid,不发送请求')
|
|
console.log('存在空的 bid,不发送请求')
|
|
@@ -591,7 +596,7 @@ async function productTagetSave() {
|
|
adGroupId: respAdGroupId.value,
|
|
adGroupId: respAdGroupId.value,
|
|
campaignId: respCampaignId.value,
|
|
campaignId: respCampaignId.value,
|
|
expressionList: productOrientationTableData.value,
|
|
expressionList: productOrientationTableData.value,
|
|
- state: 'PAUSED',
|
|
|
|
|
|
+ state: "PAUSED"
|
|
}
|
|
}
|
|
const filteredRequestData = Object.fromEntries(Object.entries(requestData).filter(([_, v]) => v != null))
|
|
const filteredRequestData = Object.fromEntries(Object.entries(requestData).filter(([_, v]) => v != null))
|
|
const resp = await request({
|
|
const resp = await request({
|
|
@@ -619,15 +624,7 @@ async function productTagetSave() {
|
|
productOrientationTableData.value = []
|
|
productOrientationTableData.value = []
|
|
productTargetBidList.value = []
|
|
productTargetBidList.value = []
|
|
}
|
|
}
|
|
-// 点击表格选项触发事件
|
|
|
|
-function handleSelectionChange(selection) {
|
|
|
|
- selections = selection
|
|
|
|
-}
|
|
|
|
-// 获取addedTable中已选中的项
|
|
|
|
-function handleAddedGoodsChange(selection) {
|
|
|
|
- addedSels = selection
|
|
|
|
-}
|
|
|
|
-// 添加已选中的项
|
|
|
|
|
|
+
|
|
function handleGoodsAdd() {
|
|
function handleGoodsAdd() {
|
|
// 过滤掉已经存在于addedData.value中的项
|
|
// 过滤掉已经存在于addedData.value中的项
|
|
const newSelections = selections.filter(
|
|
const newSelections = selections.filter(
|
|
@@ -665,6 +662,11 @@ function changeKeyWordsTableHeader(args) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ setProductOrientationData()
|
|
|
|
+})
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|