Commit 0ddc5d15 authored by hzl's avatar hzl

feat: 任务页字段处理

parent 7a200f4e
......@@ -315,7 +315,7 @@
<el-input-number v-model="form.daily_budget" :min="0"></el-input-number>
</el-form-item>
<el-form-item label="转化目标" prop="bidding_type">
<el-form-item label="转化目标" prop="bidding_type" v-if="form.platform !== 2">
<el-select v-model="form.bidding_type" placeholder="请选择">
<el-option label="安装量" :value="2" :disabled="true"></el-option>
<el-option label="应用内操作次数" :value="3" :disabled="true"></el-option>
......@@ -323,7 +323,7 @@
</el-select>
</el-form-item>
<el-form-item label="目标考核ROAS(%)" prop="target_roas">
<el-form-item label="目标考核ROAS(%)" prop="target_roas" v-if="form.platform !== 2">
<el-input-number v-model="form.target_roas" :min="0"></el-input-number>
</el-form-item>
......@@ -413,7 +413,7 @@
<el-input-number v-model="form.daily_budget" :min="0"></el-input-number>
</el-form-item>
<el-form-item label="转化目标" prop="bidding_type">
<el-form-item label="转化目标" prop="bidding_type" v-if="form.platform !== 2">
<el-select v-model="form.bidding_type" placeholder="请选择">
<el-option label="安装量" :value="2" :disabled="true"></el-option>
<el-option label="应用内操作次数" :value="3" :disabled="true"></el-option>
......@@ -421,7 +421,7 @@
</el-select>
</el-form-item>
<el-form-item label="目标考核ROAS" prop="target_roas">
<el-form-item label="目标考核ROAS" prop="target_roas" v-if="form.platform !== 2">
<el-input-number v-model="form.target_roas" :min="0"></el-input-number>
</el-form-item>
......@@ -759,7 +759,17 @@ export default {
{ required: true, message: '请选择移动应用平台', trigger: 'change' }
],
daily_budget: [
{ required: true, message: '请输入日预算', trigger: 'blur' }
{ required: true, message: '请输入日预算', trigger: 'blur' },
{
validator: (rule, value, callback) => {
if (this.form.platform === 2 && value < 20) {
callback(new Error('TikTok平台日预算必须大于等于20'))
} else {
callback()
}
},
trigger: 'blur'
}
],
bidding_type: [
{ required: true, message: '请选择转化目标', trigger: 'change' }
......@@ -1492,6 +1502,11 @@ export default {
// 处理平台变化
async handlePlatformChange(value) {
// 当平台改变时,重新验证日预算字段
this.$nextTick(() => {
this.$refs.form.validateField('daily_budget');
});
if (value === 2) {
// 如果选择了TikTok平台,重置相关字段
this.form.tiktok_json.isNewCampaign = true;
......
......@@ -200,17 +200,17 @@
<el-input-number v-model="form.daily_budget" :min="0"></el-input-number>
</el-form-item>
<el-form-item label="转化目标" prop="bidding_type">
<el-select v-model="form.bidding_type" placeholder="请选择">
<el-option label="安装量" :value="2" :disabled="true"></el-option>
<el-option label="应用内操作次数" :value="3" :disabled="true"></el-option>
<el-option label="应用内操作价值" :value="5"></el-option>
</el-select>
</el-form-item>
<el-form-item label="目标考核ROAS" prop="target_roas">
<el-input-number v-model="form.target_roas" :min="0"></el-input-number>
</el-form-item>
<el-form-item label="转化目标" prop="bidding_type" v-if="form.platform !== 2">
<el-select v-model="form.bidding_type" placeholder="请选择">
<el-option label="安装量" :value="2" :disabled="true"></el-option>
<el-option label="应用内操作次数" :value="3" :disabled="true"></el-option>
<el-option label="应用内操作价值" :value="5"></el-option>
</el-select>
</el-form-item>
<el-form-item label="目标考核ROAS" prop="target_roas" v-if="form.platform !== 2">
<el-input-number v-model="form.target_roas" :min="0"></el-input-number>
</el-form-item>
<!-- TikTok特定字段 -->
<template v-if="form.platform === 2">
......@@ -455,19 +455,19 @@ export default {
appStore: [
{ required: true, message: '请选择移动应用平台', trigger: 'change' }
],
daily_budget: [
{ required: true, message: '请输入日预算', trigger: 'blur' },
{
validator: (rule, value, callback) => {
if (this.form.platform === 2 && value < 50) {
callback(new Error('TikTok平台日预算必须大于等于50'))
} else {
callback()
}
},
trigger: 'blur'
}
],
daily_budget: [
{ required: true, message: '请输入日预算', trigger: 'blur' },
{
validator: (rule, value, callback) => {
if (this.form.platform === 2 && value < 20) {
callback(new Error('TikTok平台日预算必须大于等于20'))
} else {
callback()
}
},
trigger: 'blur'
}
],
bidding_type: [
{ required: true, message: '请选择转化目标', trigger: 'change' }
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment