ソースを参照

修改智能投放

朱鑫波 4 年 前
コミット
b38bc56a3a

+ 112 - 48
src/views/modules/account-config/account-config.vue

@@ -45,6 +45,9 @@
                 <span slot="acountRelax" slot-scope="text, record">
                     <a-switch :checked="text === 0" @change="handleSwitchChang($event, record)"/>
                 </span>
+                <span solt="accountBudget" slot-scope="text, record">
+                    {{ record.accountBudgetMode === '1' ? '不限' : text }}
+                </span>
                 <span slot="action" slot-scope="text, record">
                     <a @click="handleEdit(record)">编辑</a>
                     <a-divider type="vertical"/>
@@ -52,23 +55,7 @@
                     <a-divider type="vertical"/>
                     <a @click="handleUpdateMod(record)">修改出价</a>
                     <a-divider type="vertical"/>
-                    <a-popover v-model="record.show" trigger="click">
-                        <template slot="content">
-                            <div><a-input v-model="budgetContent" placeholder="请输入" style="width: 140px;"/></div>
-                            <div style="margin-top: 10px;">
-                                <a-button
-                                    size="small"
-                                    type="primary"
-                                    style="margin-left: 15px;margin-right: 15px;"
-                                    @click="handlePopoverSure(record, 'budget')"
-                                >
-                                    确定
-                                </a-button>
-                                <a-button size="small" @click="handleBudgetPopover(record)">取消</a-button>
-                            </div>
-                        </template>
-                        <a>修改预算</a>
-                    </a-popover>
+                    <a @click="handleUpdateBudget(record)">修改预算</a>
                 </span>
             </a-table>
             <a-pagination
@@ -83,6 +70,45 @@
             />
         </div>
         <a-modal
+            title="修改预算"
+            v-if="budgetVisible"
+            :visible="budgetVisible"
+            dialog-class="mode-modal-class"
+            @ok="handleBudgetSure"
+            @cancel="handleBudgetCancel"
+        >
+            <div>
+                <a-form-model
+                    ref="budgetForm"
+                    :model="budgetForm"
+                    :rules="budgetRules"
+                    :label-col="labelCol"
+                    :wrapper-col="wrapperCol"
+                >
+                    <a-form-model-item label="预算方式">
+                        <a-radio-group
+                            v-model="budgetForm.budgetType"
+                            button-style="solid"
+                            @change="handleAccountMode"
+                        >
+                            <a-radio-button value="1">不限预算</a-radio-button>
+                            <a-radio-button value="2">指定预算</a-radio-button>
+                        </a-radio-group>
+                    </a-form-model-item>
+                    <a-form-model-item v-if="budgetForm.budgetType === '2'" label="账户日预算" prop="budget">
+                        <a-input-number
+                            v-model="budgetForm.budget"
+                            :min="1000"
+                            :max="9999999.99"
+                            :step="0.01"
+                            @blur="handleAccountBudget"
+                        /> 元
+                    </a-form-model-item>
+                    <div v-if="adBudgetShowTitle" style="width: 500px;color: #f00;margin-left: 140px;">单次修改预算幅度, 不能低于100.0元</div>
+                </a-form-model>
+            </div>
+        </a-modal>
+        <a-modal
             title="修改出价"
             v-if="modeVisible"
             :visible="modeVisible"
@@ -186,16 +212,24 @@ export default {
         };
         let adMaxBidValidator = (rule, value, callback) => {
             const finallyResult = Number(this.configForm.adMinBid);
-            if (finallyResult !== undefined && value && Number(value) > finallyResult) {
+            if (finallyResult && value && Number(value) < finallyResult) {
+                callback('最高出价不能低于最低出价');
+            }
+            else if (Number(this.updateModTxt.accountBudget) < Number(value)) {
+                callback('出价不能大于预算');
+            }
+            else if (Number(this.configForm.adMaxBid) > Number(this.configForm.adMinBid) + Number(this.configForm.adStepBid)) {
+                this.$refs['ruleForm'].clearValidate(['adStepBid']);
                 callback();
             }
             else {
-                callback('最高出价不能低于最低出价');
+                this.$refs['ruleForm'].clearValidate(['adMinBid']);
+                callback();
             }
         };
         let floatingIntervalValidator = (rule, value, callback) => {
             const finallyResult = Number(this.configForm.adMinBid) + Number(value);
-            if (finallyResult !== undefined < Number(this.configForm.adMaxBid)) {
+            if (finallyResult < Number(this.configForm.adMaxBid)) {
                 callback();
             }
             else {
@@ -203,6 +237,17 @@ export default {
             }
         };
         return {
+            adBudgetShowTitle: false,
+            budgetVisible: false,
+            budgetForm: {
+                budgetType: '1',
+                budget: 0
+            },
+            budgetRules: {
+                budget: [
+                    {required: true, message: '请输入', trigger: 'blur'}
+                ]
+            },
             labelCol: {span: 4},
             wrapperCol: {span: 14},
             configForm: {
@@ -268,7 +313,7 @@ export default {
                 },
                 {
                     title: '账户日预算量(元)',
-                    dataIndex: 'adBudget',
+                    dataIndex: 'accountBudget',
                     align: 'center'
                 },
                 {
@@ -298,6 +343,24 @@ export default {
     },
     methods: {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
+        handleAccountMode(e) {
+            this.budgetForm.budget = 0;
+        },
+        handleAccountBudget(e) {
+            const adBudgetInput = e.target.value;
+            console.log(this.updateModTxt, 'this.updateModTxt-this.updateModTxt');
+            const changeBudget = this.updateModTxt.accountBudget;
+            this.configForm.budget = Number(Number(adBudgetInput).toFixed(2));
+            if (Number(adBudgetInput) >= Number(changeBudget) && Number(adBudgetInput) < (Number(changeBudget) + 100)) {
+                this.adBudgetShowTitle = true;
+            }
+            else if (Number(adBudgetInput) <= Number(changeBudget) && Number(adBudgetInput) > (Number(changeBudget) - 100)) {
+                this.adBudgetShowTitle = true;
+            }
+            else {
+                this.adBudgetShowTitle = false;
+            }
+        },
         handleModeSure() {
             let paramsData = new FormData();
             if (this.updateModTxt.adBidCreateType === 'FIX') {
@@ -339,37 +402,34 @@ export default {
             this.updateModTxt = record;
             this.modeVisible = true;
         },
-        handlePopoverSure(record, type) {
-            const defaultList = {
-                accountId: record.accountId,
-                bid: this.modContent,
-                budget: this.budgetContent,
-                adId: record.adId ? record.adId : '',
-                id: record.id,
-                cost: record.cost
-            };
+        handleUpdateBudget(record) {
+            this.updateModTxt = record;
+            this.budgetVisible = true;
+        },
+        handleBudgetSure() {
             let paramsData = new FormData();
-            if (type === 'mod') {
+            paramsData.append('accountId', this.updateModTxt.accountId);
+            paramsData.append('adId', this.updateModTxt.adId);
+            paramsData.append('type', 2);
+            paramsData.append('budget', this.budgetForm.budget);
+            paramsData.append('budgetType', this.budgetForm.budgetType);
+            paramsData.append('id', this.updateModTxt.id);
+            paramsData.append('cost', this.updateModTxt.cost);
+            if (this.adBudgetShowTitle) {
+                return;
             }
-            else if (type === 'budget') {
-                if (Number(defaultList.budget) >= record.adBudget && Number(defaultList.budget) < (record.adBudget + 100)) {
-                    this.$message.error('单次修改预算幅度, 不能低于100.0元');
-                    return;
+            this.$refs.budgetForm.validate(valid => {
+                if (valid) {
+                    this.handlePopoverChange(paramsData);
                 }
-                if (Number(defaultList.budget) <= record.adBudget && Number(defaultList.budget) > (record.adBudget - 100)) {
-                    this.$message.error('单次修改预算幅度, 不能低于100.0元');
-                    return;
+                else {
+                    console.log('error submit!!');
+                    return false;
                 }
-                record.show = false;
-                this.budgetContent = '';
-                paramsData.append('accountId', defaultList.accountId);
-                paramsData.append('adId', defaultList.adId);
-                paramsData.append('type', 2);
-                paramsData.append('budget', defaultList.budget);
-                paramsData.append('id', defaultList.id);
-                paramsData.append('cost', defaultList.cost);
-            }
-            this.handlePopoverChange(paramsData);
+            });
+        },
+        handleBudgetCancel() {
+            this.budgetVisible = false;
         },
         handlePopoverChange(data) {
             putAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/updStaOrCpaOrBudgetById', data).then(result => {
@@ -380,6 +440,7 @@ export default {
                     this.adStepBid = undefined;
                     this.adCpaBid = undefined;
                     this.modeVisible = false;
+                    this.budgetVisible = false;
                     this.handleInitTable();
                 }
                 else {
@@ -405,6 +466,9 @@ export default {
                     result.result.records.forEach(item => {
                         item.show = false;
                         item.visible = false;
+                        if (item.accountBudgetMode === '1') {
+                            item.accountBudget = '不限';
+                        }
                     });
                     this.dataSource = result.result.records;
                     this.totalAll = result.result.total;

+ 11 - 3
src/views/modules/account-config/components/configuration-modal.less

@@ -54,12 +54,20 @@
                 }
                 .orientation-content-substance {
                     height: 310px;
-                    margin: 12px;
+                    overflow-y: auto;
+                    margin: 10px;
                     .content-substance-singal {
-                        height: 28px;
-                        line-height: 28px;
+                        display: flex;
+                        margin-top: 10px;
                         .singal-spn {
                             margin-right: 10px;
+                            display: inline-block;
+                            width: 80px;
+                            text-align: right;
+                        }
+                        .singal-content {
+                            display: inline-block;
+                            width: 80%;
                         }
                     }
                 }

+ 161 - 31
src/views/modules/account-config/components/configuration-modal.vue

@@ -23,6 +23,7 @@
                 </a-form-model-item>
                 <a-form-model-item label="dp链接">
                     <a-radio-group
+                        :disabled="modalTitle === 'edit'"
                         v-model="configForm.dpLinkIndexUsed"
                         button-style="solid"
                         @change="handleDpLinkIndexUsed"
@@ -73,6 +74,7 @@
                         @blur="handleAccountBudget"
                     /> 元
                 </a-form-model-item>
+                <div v-if="adBudgetShowTitle" style="width: 500px;color: #f00;margin-left: 140px;">单次修改预算幅度, 不能低于100.0元</div>
             </div>
             <div class="separate-module-con">
                 <p class="rock-title">广告组信息</p>
@@ -266,7 +268,7 @@
                 </div>
             </div>
             <div class="separate-module-con">
-                <a-tabs v-model="selectPackageTabs">
+                <a-tabs v-model="selectPackageTabs" @change="handleSelectPackageTabs">
                     <a-tab-pane key="1" tab="新建定向">
                         <p class="rock-title">用户定向</p>
                         <a-form-model-item label="地域">
@@ -304,13 +306,12 @@
                             <radio-check v-model="configForm.adSelectAge" :options="ageArr" @change="getAgeSelect"></radio-check>
                         </a-form-model-item>
                         <a-form-model-item label="自定义人群">
-                            <a-radio-group v-model="configForm.customPerson" button-style="solid">
+                            <a-radio-group v-model="configForm.customPerson" button-style="solid" @change="handleCustomPerson">
                                 <a-radio-button value="NONE">不限</a-radio-button>
                                 <a-radio-button value="a">自定义人群</a-radio-button>
                             </a-radio-group>
                         </a-form-model-item>
                         <a-form-model-item v-if="configForm.customPerson === 'a'" label="定向逻辑">
-                            <!-- adRetargetingTagsType -->
                             <a-radio-group v-model="configForm.adRetargetingTagsType" button-style="solid" @change="handleDirectionalLogic">
                                 <a-radio-button value="1">定向</a-radio-button>
                                 <a-radio-button value="2">排除</a-radio-button>
@@ -319,17 +320,46 @@
                         </a-form-model-item>
                         <div v-if="configForm.customPerson === 'a' && configForm.adRetargetingTagsType === '1'" class="adver-position-radio">
                             <div style="width: 60%;">
-                                <directional-logic ref="direct" packtype="directional" multitype="alone" :defaultlist="directionalData" :valueids="configForm.adRetargetingTagsType" :updatelistinclude="configForm.updateGetingInclude" @selection-alone-event="handleSelectionAloneEvent"></directional-logic>
+                                <directional-logic
+                                    ref="direct"
+                                    packtype="directional"
+                                    multitype="alone"
+                                    :defaultlist="directionalData"
+                                    :valueids="configForm.adRetargetingTagsType"
+                                    :updatelistinclude="configForm.updateGetingInclude" @selection-alone-event="handleSelectionAloneEvent"
+                                    @clearlist="handleClearlist"
+                                >
+                                </directional-logic>
                             </div>
                         </div>
                         <div v-if="configForm.customPerson === 'a' && configForm.adRetargetingTagsType === '2'" class="adver-position-radio">
                             <div style="width: 60%;">
-                                <directional-logic ref="exclude" packtype="exclude" multitype="alone" :defaultlist="directionalData" :valueids="configForm.adRetargetingTagsType" :updatelistexclude="configForm.updateGetingExclude" @selection-alone-event="handleSelectionAloneEvent"></directional-logic>
+                                <directional-logic
+                                    ref="exclude"
+                                    packtype="exclude"
+                                    multitype="alone"
+                                    :defaultlist="directionalData"
+                                    :valueids="configForm.adRetargetingTagsType"
+                                    :updatelistexclude="configForm.updateGetingExclude" @selection-alone-event="handleSelectionAloneEvent"
+                                    @clearlist="handleClearlist"
+                                >
+                                </directional-logic>
                             </div>
                         </div>
                         <div v-if="configForm.customPerson === 'a' && configForm.adRetargetingTagsType === '3'" class="adver-position-radio">
                             <div style="width: 60%;">
-                                <directional-logic ref="twoway" packtype="twoway" multitype="all" :defaultlist="directionalData" :valueids="configForm.adRetargetingTagsType" :updatelistinclude="configForm.updateGetingInclude" :updatelistexclude="configForm.updateGetingExclude" @selection-direct-event="handleDirectEvent" @selection-exclude-event="handleExcludeEvent"></directional-logic>
+                                <directional-logic
+                                    ref="twoway"
+                                    packtype="twoway"
+                                    multitype="all"
+                                    :defaultlist="directionalData"
+                                    :valueids="configForm.adRetargetingTagsType"
+                                    :updatelistinclude="configForm.updateGetingInclude"
+                                    :updatelistexclude="configForm.updateGetingExclude" @selection-direct-event="handleDirectEvent"
+                                    @selection-exclude-event="handleExcludeEvent"
+                                    @clearlist="handleClearlist"
+                                >
+                                </directional-logic>
                             </div>
                         </div>
                         <a-form-model-item label="媒体定向">
@@ -399,7 +429,7 @@
                         </a-form-model-item>
                     </a-tab-pane>
                     <a-tab-pane key="2" tab="选择定向包">
-                        <a-form-model-item class="select-orientation-class" label="选择已有定向包" prop="adAudiencePackageId">
+                        <a-form-model-item class="select-orientation-class" label="选择已有定向包" :prop="selectPackageTabs === '2' ? 'adAudiencePackageId' : ''">
                             <a-select
                                 class="common-input-long"
                                 v-model="configForm.adAudiencePackageId"
@@ -432,27 +462,27 @@
                             <div v-if="packageMessageDetail.length" class="orientation-content-substance">
                                 <div class="content-substance-singal">
                                     <span class="singal-spn">定向人群包:</span>
-                                    <span>{{ packageMessageDetail[0].description }}</span>
+                                    <span class="singal-content">{{ packageMessageDetail[0].description }}</span>
                                 </div>
                                 <div class="content-substance-singal">
                                     <span class="singal-spn">地域:</span>
-                                    <span>{{ packageMessageDetail[0].replaceCitys }}</span>
+                                    <span class="singal-content">{{ packageMessageDetail[0].replaceCitys }}</span>
                                 </div>
                                 <div class="content-substance-singal">
                                     <span class="singal-spn">性别:</span>
-                                    <span>{{ packageMessageDetail[0].replaceSex }}</span>
+                                    <span class="singal-content">{{ packageMessageDetail[0].replaceSex }}</span>
                                 </div>
                                 <div class="content-substance-singal">
                                     <span class="singal-spn">年龄:</span>
-                                    <span>{{ packageMessageDetail[0].replaceAge }}</span>
+                                    <span class="singal-content">{{ packageMessageDetail[0].replaceAge }}</span>
                                 </div>
                                 <div class="content-substance-singal">
                                     <span class="singal-spn">平台:</span>
-                                    <span>{{ packageMessageDetail[0].replacePlate }}</span>
+                                    <span class="singal-content">{{ packageMessageDetail[0].replacePlate }}</span>
                                 </div>
                                 <div class="content-substance-singal">
                                     <span class="singal-spn">智能放量:</span>
-                                    <span>{{ packageMessageDetail[0].replaceEnabled }}</span>
+                                    <span class="singal-content">{{ packageMessageDetail[0].replaceEnabled }}</span>
                                 </div>
                             </div>
                             <div v-else class="orientation-content-msg">
@@ -489,8 +519,6 @@
                             @blur="handleAdBudgetBlur"
                         />
                     </a-input-group>
-                    <div v-if="adBudgetShowTitle" style="width: 500px;color: #f00;">单次修改预算幅度, 不能低于100.0元</div>
-                    <span class="especial-label budget-mode-label">*</span>
                 </a-form-model-item>
                 <a-form-model-item label="投放时间">
                     <a-radio-group :disabled="modalTitle === 'edit'" v-model="configForm.adScheduleType" button-style="solid" @change="handleAdScheduleType">
@@ -553,7 +581,9 @@
                             v-model="configForm.adMinBid"
                             :min="0.1"
                             :max="10000"
+                            :step="0.01"
                             placeholder="请输入"
+                            @blur="handleAdMinBidBlur"
                         />
                         <span>~</span>
                     </a-form-model-item>
@@ -563,9 +593,12 @@
                             v-model="configForm.adMaxBid"
                             :min="0.1"
                             :max="10000"
+                            :step="0.01"
                             placeholder="请输入"
+                            @blur="handleAdMaxBidBlur"
                         /> 元
                     </a-form-model-item>
+                    <div v-if="isAdCpaBidBlur" style="width: 500px;color: #f00;margin-left: 140px;">{{ adCpaBidBlurTxt }}</div>
                 </div>
                 <div v-if="configForm.adBidCreateType === 'STEP'">
                     <a-form-model-item label="目标转化出价" class="dp-link-start" prop="adMinBid">
@@ -574,7 +607,9 @@
                             v-model="configForm.adMinBid"
                             :min="0.1"
                             :max="10000"
+                            :step="0.01"
                             placeholder="请输入"
+                            @blur="handleAdMinBidBlur"
                         />
                         <span>~</span>
                     </a-form-model-item>
@@ -584,13 +619,17 @@
                             v-model="configForm.adMaxBid"
                             :min="0.1"
                             :max="10000"
+                            :step="0.01"
                             placeholder="请输入"
+                            @blur="handleAdMaxBidBlur"
                         /> 元
                     </a-form-model-item>
+                    <div v-if="isAdCpaBidBlur" style="width: 500px;color: #f00;margin-left: 140px">{{ adCpaBidBlurTxt }}</div>
                     <a-form-model-item label="浮动间隔" prop="adStepBid">
                         <a-input-number
                             class="common-input"
                             v-model="configForm.adStepBid"
+                            :step="0.01"
                             placeholder="请输入"
                             @blur="handleFloatingInterval"
                         /> 元
@@ -880,7 +919,7 @@ export default {
                 {
                     value: '4G',
                     label: '4G'
-                },
+                }
             ],
             adHideIfConvertedDataOption: [ // 过滤已转化用户option
                 {
@@ -1039,7 +1078,7 @@ export default {
             },
             configForm: {
                 dpLinkIndexUsed: 0,
-                adRetargetingTagsType: '1',
+                adRetargetingTagsType: '',
                 adAudiencePackageId: undefined,
                 adStepBid: 0,
                 ladderOne: '',
@@ -1056,7 +1095,7 @@ export default {
                 productSellingPoints: [], // 商品买点
                 adBudgetMode: 'BUDGET_MODE_DAY', // 预算类型
                 adDownloadUrl: '', // 下载链接
-                accountBudget: 0, // 账户日预算
+                accountBudget: 1000, // 账户日预算
                 accountId: undefined, // 账户
                 dpLinkStartIndex: 1,
                 dpLinkEndIndex: 2,
@@ -1229,6 +1268,49 @@ export default {
     methods: {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
         moment,
+        handleSelectPackageTabs(e) {
+            if (this.modalTitle === 'add') {
+                if (e === '1') {
+                    this.configForm.adAudiencePackageId = undefined;
+                    this.packageMessageDetail = [];
+                }
+                else if (e === '2') {
+                    this.configForm.adDistrict = 'NONE';
+                    this.listArr = [];
+                    this.configForm.adLocationType = 'HOME';
+                    this.configForm.adGender = 'NONE';
+                    this.configForm.adSelectAge = ['NONE'];
+                    this.configForm.customPerson = 'NONE';
+                    this.configForm.updateGetingInclude = [];
+                    this.configForm.adRetargetingTagsInclude = '';
+                    this.configForm.adRetargetingTagsExclude = '';
+                    this.configForm.updateGetingExclude = [];
+                    this.configForm.adRetargetingTagsType = '';
+                    if (!this.platformLoadingType) {
+                        this.configForm.adPlatform = 'NONE';
+                        this.platformLoadingType = '';
+                    }
+                    this.configForm.adDeviceSelectType = ['NONE'];
+                    this.configForm.adAndroidVersion = 'NONE';
+                    this.configForm.adSelectAc = ['NONE'];
+                    this.configForm.adHideIfExists = '0';
+                    this.configForm.adAutoExtendEnabled = '0';
+                }
+            }
+        },
+        handleCustomPerson(e) {
+            const defaultValue = e.target.value;
+            if (defaultValue === 'NONE') {
+                this.configForm.updateGetingInclude = [];
+                this.configForm.adRetargetingTagsInclude = '';
+                this.configForm.adRetargetingTagsExclude = '';
+                this.configForm.updateGetingExclude = [];
+                this.configForm.adRetargetingTagsType = '';
+            }
+            else if (defaultValue === 'a') {
+                this.configForm.adRetargetingTagsType = '1';
+            }
+        },
         handleAsyncPackage() {
             this.handleGetAdAudiencePackage();
             this.configForm.adAudiencePackageId = undefined;
@@ -1255,6 +1337,20 @@ export default {
         handleFloatingInterval(e) {
             this.configForm.adStepBid = Number(Number(e.target.value).toFixed(2));
         },
+        handleAdMinBidBlur(e) {
+            this.configForm.adMinBid = Number(Number(e.target.value).toFixed(2));
+        },
+        handleAdMaxBidBlur(e) {
+            const defaultValue = e.target.value;
+            this.configForm.adMaxBid = Number(Number(defaultValue).toFixed(2));
+            if (this.configForm.adBudget > 0 && defaultValue > this.configForm.adBudget) {
+                this.isAdCpaBidBlur = true;
+                this.adCpaBidBlurTxt = '出价不能大于预算';
+            }
+            else {
+                this.isAdCpaBidBlur = false;
+            }
+        },
         handleDirectionalList() {
             const paramsData = {
                 accountId: this.configForm.accountId
@@ -1287,13 +1383,17 @@ export default {
                 this.configForm.adRetargetingTagsInclude = '';
             }
         },
+        handleClearlist() {
+            this.configForm.updateGetingInclude = [];
+            this.configForm.adRetargetingTagsInclude = '';
+            this.configForm.adRetargetingTagsExclude = '';
+            this.configForm.updateGetingExclude = [];
+        },
         handleDirectEvent(list) {
-            console.log(list, 'list--list--Include');
             this.configForm.updateGetingInclude = list;
             this.configForm.adRetargetingTagsInclude = list && list.join(',');
         },
         handleExcludeEvent(list) {
-            console.log(list, 'list--list--Exclude');
             this.configForm.updateGetingExclude = list;
             this.configForm.adRetargetingTagsExclude = list && list.join(',');
         },
@@ -1339,14 +1439,14 @@ export default {
             defaultData.forEach(item => {
                 item.replaceSex = item.audience.gender === 'NONE' ? '不限' : item.audience.gender === 'GENDER_FEMALE' ? '女' : '男';
                 item.replaceEnabled = item.audience.auto_extend_enabled === 1 ? '开启' : '不开启';
-                item.replacePlate = item.audience.platform && item.audience.platform.length ? item.audience.platform.join(',') : '暂无';
-                item.replaceCitys = item.audience.cityNames && item.audience.cityNames.length ? item.audience.cityNames.join(',') : '暂无';
+                item.replacePlate = item.audience.platform && item.audience.platform.length ? item.audience.platform.join(',') : '不限';
+                item.replaceCitys = item.audience.cityNames && item.audience.cityNames.length ? item.audience.cityNames.join(',') : '不限';
                 this.ageArr.forEach(val => {
                     if (item.audience.age && item.audience.age.length && item.audience.age.includes(val.value)) {
                         ageUpdateList.push(val.label);
                     }
                 });
-                item.replaceAge = ageUpdateList.length ? ageUpdateList.join(',') : '暂无';
+                item.replaceAge = ageUpdateList.length ? ageUpdateList.join(',') : '不限';
             });
             this.packageMessageDetail = defaultData;
         },
@@ -1355,11 +1455,13 @@ export default {
             this.configForm.adMinBid = '';
             this.configForm.adMaxBid = '';
             this.configForm.adStepBid = 0;
+            this.isAdCpaBidBlur = false;
             this.$refs['ruleForm'].clearValidate(['adMinBid']);
             this.$refs['ruleForm'].clearValidate(['adMaxBid']);
         },
         handleAdCpaBidBlur(e) {
             const defaultValue = e.target.value;
+            this.configForm.adCpaBid = Number(Number(defaultValue).toFixed(2));
             if (this.configForm.adBudget > 0 && defaultValue > this.configForm.adBudget) {
                 this.isAdCpaBidBlur = true;
                 this.adCpaBidBlurTxt = '出价不能大于预算';
@@ -1426,6 +1528,10 @@ export default {
             else {
                 this.isAdCpaBidBlur = false;
             }
+        },
+        handleAccountBudget(e) {
+            const adBudgetInput = e.target.value;
+            this.configForm.accountBudget = Number(Number(adBudgetInput).toFixed(2));
             if (this.modalTitle === 'edit') {
                 if (Number(adBudgetInput) >= Number(this.defaultAdBudget) && Number(adBudgetInput) < (Number(this.defaultAdBudget) + 100)) {
                     this.adBudgetShowTitle = true;
@@ -1438,9 +1544,6 @@ export default {
                 }
             }
         },
-        handleAccountBudget(e) {
-            this.configForm.accountBudget = Number(Number(e.target.value).toFixed(2));
-        },
         handleExportRules(value, min, max, callback) {
             let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
             let length = 0;
@@ -1512,7 +1615,12 @@ export default {
             }
         },
         handleAccountMode(e) {
-            this.configForm.accountBudget = '';
+            if (e.target.value === '1') {
+                this.configForm.accountBudget = 0;
+            }
+            else if (e.target.value === '2') {
+                this.configForm.accountBudget = 1000;
+            }
         },
         handleAdDownLoadType(e) {
             this.optimizationOption = [];
@@ -1587,17 +1695,24 @@ export default {
                         this.configForm.advertisingType = detailData.advertisingType || '1';
                         this.configForm.campaignName = detailData.campaignName || '';
                         this.configForm.dpLinkIndexUsed = detailData.dpLinkIndexUsed;
+                        if (detailData.dpLinkIndexUsed === 1) {
+                            this.adNameTags.push('dp链接标识');
+                        }
                         this.configForm.adName = detailData.adName || '';
                         this.configForm.campaignCnt = detailData.campaignCnt || '';
                         this.configForm.campaignAdCnt = detailData.campaignAdCnt || '';
                         this.configForm.launchTarget = detailData.launchTarget || 'OCPM';
-                        this.configForm.adDownloadType = detailData.adDownloadType || 'DOWNLOAD_URL';
+                        this.configForm.adDownloadType = detailData.adDownloadType;
+                        this.configForm.adPlatform = detailData.adPlatform;
                         this.configForm.adExternalUrl = detailData.adExternalUrl || '';
                         this.configForm.adOpenUrl = detailData.adOpenUrl || '';
                         this.configForm.adDownloadUrl = detailData.adDownloadUrl || '';
                         this.configForm.adPackage = detailData.adPackage || '';
                         this.configForm.adConvertType = detailData.adConvertType || '';
                         this.configForm.adDistrict = detailData.adDistrict || 'NONE';
+                        if (detailData.adDownloadType === 'DOWNLOAD_URL') {
+                            this.handleGetPackage();
+                        }
                         setTimeout(() => {
                             this.listArr = detailData.adCity.split(',');
                             this.configForm.adSelectCity = detailData.adCity.split(',');
@@ -1648,7 +1763,6 @@ export default {
                         this.configForm.adSelectAc = detailData.adAc.split(',');
                         this.configForm.adDeviceSelectType = detailData.adDeviceType.split(',');
                         this.configForm.adSuperiorPopularityType = detailData.adSuperiorPopularityType;
-                        this.configForm.adPlatform = detailData.adPlatform;
                         this.configForm.adAc = detailData.adAc;
                         this.configForm.adHideIfExists = String(detailData.adHideIfExists);
                         this.configForm.adHideIfConverted = detailData.adHideIfConverted;
@@ -1656,7 +1770,7 @@ export default {
                         this.configForm.adSmartBidType = detailData.adSmartBidType;
                         this.configForm.adBudgetMode = detailData.adBudgetMode;
                         this.configForm.adBudget = detailData.adBudget;
-                        this.defaultAdBudget = detailData.adBudget;
+                        this.defaultAdBudget = detailData.accountBudget;
                         this.configForm.adScheduleType = detailData.adScheduleType;
                         this.configForm.launchDateRange[0] = detailData.adStartTime;
                         this.configForm.launchDateRange[1] = detailData.adEndTime;
@@ -1680,7 +1794,6 @@ export default {
                         this.imageUrl = detailData.imageUrl;
                         this.urlResult = detailData.imageUrl;
                         this.md5Result = detailData.creativeProductImageCode;
-                        this.handleGetPackage();
                         if (detailData.adAndroidOsv !== 'NONE') {
                             this.configForm.adAndroidVersion = 'a';
                             this.configForm.androidChangeValue = detailData.adAndroidOsv;
@@ -2008,6 +2121,9 @@ export default {
         },
         handleRelaxSure() {
             let paramsFormData = this.configForm;
+            if (this.adBudgetShowTitle) {
+                return;
+            }
             if (this.configForm.adDistrict === 'CITY') {
                 if (!this.configForm.adSelectCity.length) {
                     this.$message.error('请选择省市');
@@ -2018,6 +2134,20 @@ export default {
                 this.$message.error('请选择已有定向包');
                 return;
             }
+            if (paramsFormData.customPerson === 'a') {  
+                if (paramsFormData.adRetargetingTagsType === '1' && !paramsFormData.adRetargetingTagsInclude) {
+                    this.$message.error('请选择人群');
+                    return;
+                }
+                else if (paramsFormData.adRetargetingTagsType === '2' && !paramsFormData.adRetargetingTagsExclude) {
+                    this.$message.error('请选择人群');
+                    return;
+                }
+                else if (paramsFormData.adRetargetingTagsType === '3' && (!paramsFormData.adRetargetingTagsExclude || !paramsFormData.adRetargetingTagsInclude)) {
+                    this.$message.error('请选择人群');
+                    return;
+                }
+            }
             if (this.configForm.adScheduleType === 'SCHEDULE_START_END' && !this.configForm.launchDateRange.length) {
                 this.$message.error('请选择投放时间');
                 return;

+ 25 - 13
src/views/modules/account-config/components/directional-logic/directional-logic.vue

@@ -38,7 +38,7 @@
                     已选<span class="clear-all-tab"><a @click="handleDelAloneAll('all')">清空</a></span>
                 </div>
                 <div class="class-left-content">
-                    <a-tabs v-model="selectAllRightTabs">
+                    <a-tabs v-model="selectAllRightTabs" @change="handleSelectAllTabs">
                         <a-tab-pane key="3">
                             <span slot="tab">
                                 定向({{ tableSelectDirectIds.length || 0 }})
@@ -304,7 +304,6 @@ export default {
         // },
         defaultlist(newVal) {
             if (newVal) {
-                console.log(newVal, '----newVal--val');
                 this.tableDataAllDirect = newVal;
                 this.updateTableAllDirect = newVal;
                 this.tableDataAllExclude = newVal;
@@ -314,7 +313,6 @@ export default {
             }
         },
         packtype(newVal, oldVal) {
-            console.log(newVal, 'new--new');
             if (newVal === 'directional') {
                 this.tableSelectIds = [];
                 this.selectRightData = [];
@@ -411,7 +409,21 @@ export default {
         }
     },
     methods: {
+        handleSelectAllTabs(e) {
+            if (e === '3') {
+                this.selectPackageTabs = '1';
+            }
+            else if (e === '4') {
+                this.selectPackageTabs = '2';
+            }
+        },
         handleTabsChange(e) {
+            if (e === '1') {
+                this.selectAllRightTabs = '3';
+            }
+            else if (e === '2') {
+                this.selectAllRightTabs = '4';
+            }
             this.tableDataAllDirect = [];
             this.tableDataAllExclude = [];
             this.directInput = '';
@@ -458,16 +470,6 @@ export default {
             this.selectRightData = selectedRows;
             this.$emit('selection-alone-event', selectedRowKeys);
         },
-        handleSelectionDirect(selectedRowKeys, selectedRows) {
-            this.tableSelectDirectIds = selectedRowKeys;
-            this.tableSelectDirectData = selectedRows;
-            this.$emit('selection-direct-event', selectedRowKeys);
-        },
-        handleSelectionExclude(selectedRowKeys, selectedRows) {
-            this.tableSelectExcludeIds = selectedRowKeys;
-            this.tableSelectExcludeData = selectedRows;
-            this.$emit('selection-exclude-event', selectedRowKeys);
-        },
         handleDelTree(list, type, style) {
             if (type === 'alone') {
                 let formData = this.selectRightData;
@@ -491,12 +493,22 @@ export default {
             if (type === 'alone') {
                 this.selectRightData = [];
                 this.tableSelectIds = [];
+                this.$emit('clearlist');
             }
             else if (type === 'all') {
                 this.tableSelectDirectIds = [];
                 this.tableSelectDirectData = [];
                 this.tableSelectExcludeIds = [];
                 this.tableSelectExcludeData = [];
+                this.tableDataAllDirect = [];
+                this.tableDataAllExclude = [];
+                this.directInput = '';
+                this.excludeInput = '';
+                this.$nextTick(() => {
+                    this.tableDataAllDirect = this.updateTableAllDirect;
+                    this.tableDataAllExclude = this.updateTableAllExclude;
+                });
+                this.$emit('clearlist');
             }
         }
     }

+ 21 - 1
src/views/modules/creative-copywrit/creative-copywrit.vue

@@ -1523,11 +1523,12 @@
             <div>
                 <div class="acount-title">
                     <div class="acount-title-left">素材名称</div>
-                    <div class="acount-title-right">
+                    <div class="acount-title-right" :style="accountMaster">
                         <div class="only-title-mater" v-for="item in modalShowBatchList" :key="item.id">
                             {{ item.materialName }}
                         </div>
                     </div>
+                    <a-icon :type="materTitltStatus ? 'up' : 'down'" style="margin-top: 5px;margin-left: 15px;" @click="handleMaterTitleClick"/>
                 </div>
                 <div class="acount-title push-plate">
                     <div class="acount-title-left">创意标题</div>
@@ -1603,6 +1604,11 @@ export default {
     },
     data() {
         return {
+            materTitltStatus: false,
+            accountMaster: {
+                height: '35px',
+                overflow: 'hidden'
+            },
             batchVisible: false,
             showTabsTitle: '',
             taobaoSpecialOfferTitle: 'taobao',
@@ -1927,6 +1933,20 @@ export default {
     },
     methods: {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
+        handleMaterTitleClick() {
+            this.materTitltStatus = !this.materTitltStatus;
+            if (this.materTitltStatus) {
+                this.accountMaster = {
+                    height: 'auto'
+                };
+            }
+            else {
+                this.accountMaster = {
+                    height: '35px',
+                    overflow: 'hidden'
+                };
+            }
+        },
         handleApprovedClick() {
             const batchList = [];
             this.defaultFormList = [];

+ 1 - 1
vue.config.js

@@ -80,7 +80,7 @@ module.exports = {
         // target: 'http://192.168.1.219:8081', //请求本地 需要jeecg-boot后台项目  赵西安
         // target: 'http://192.168.1.193:8080', //请求本地 需要jeecg-boot后台项目  李煜一
         // target: 'http://192.168.1.193:31012', //请求本地 需要jeecg-boot后台项目  李煜一
-         target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
+        //  target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'http://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目
         //  target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目