소스 검색

账户配置 merge master

jiayufei 4 년 전
부모
커밋
27d80131a7

+ 29 - 4
src/views/modules/account-config/account-config.vue

@@ -104,6 +104,7 @@
                             @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>
@@ -211,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 {
@@ -228,6 +237,7 @@ export default {
             }
         };
         return {
+            adBudgetShowTitle: false,
             budgetVisible: false,
             budgetForm: {
                 budgetType: '1',
@@ -337,7 +347,19 @@ export default {
             this.budgetForm.budget = 0;
         },
         handleAccountBudget(e) {
-            this.budgetForm.budget = Number(Number(e.target.value).toFixed(2));
+            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();
@@ -393,6 +415,9 @@ export default {
             paramsData.append('budgetType', this.budgetForm.budgetType);
             paramsData.append('id', this.updateModTxt.id);
             paramsData.append('cost', this.updateModTxt.cost);
+            if (this.adBudgetShowTitle) {
+                return;
+            }
             this.$refs.budgetForm.validate(valid => {
                 if (valid) {
                     this.handlePopoverChange(paramsData);

+ 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%;
                         }
                     }
                 }

+ 61 - 40
src/views/modules/account-config/components/configuration-modal.vue

@@ -74,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>
@@ -428,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"
@@ -461,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">
@@ -518,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">
@@ -599,6 +598,7 @@
                             @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">
@@ -624,6 +624,7 @@
                             @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"
@@ -918,7 +919,7 @@ export default {
                 {
                     value: '4G',
                     label: '4G'
-                },
+                }
             ],
             adHideIfConvertedDataOption: [ // 过滤已转化用户option
                 {
@@ -1268,28 +1269,33 @@ export default {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
         moment,
         handleSelectPackageTabs(e) {
-            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 = '';
-                this.configForm.adPlatform = 'NONE';
-                this.configForm.adDeviceSelectType = ['NONE'];
-                this.configForm.adAndroidVersion = 'NONE';
-                this.configForm.adSelectAc = ['NONE'];
-                this.configForm.adHideIfExists = '0';
-                this.configForm.adAutoExtendEnabled = '0';
+            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) {
@@ -1335,7 +1341,15 @@ export default {
             this.configForm.adMinBid = Number(Number(e.target.value).toFixed(2));
         },
         handleAdMaxBidBlur(e) {
-            this.configForm.adMaxBid = Number(Number(e.target.value).toFixed(2));
+            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 = {
@@ -1441,6 +1455,7 @@ 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']);
         },
@@ -1513,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;
@@ -1525,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;
@@ -1686,13 +1702,17 @@ export default {
                         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(',');
@@ -1743,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;
@@ -1751,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;
@@ -1775,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;
@@ -2103,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('请选择省市');

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

@@ -1548,11 +1548,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>
@@ -1643,6 +1644,11 @@ export default {
     data() {
         return {
             adNameTags: [],
+            materTitltStatus: false,
+            accountMaster: {
+                height: '35px',
+                overflow: 'hidden'
+            },
             batchVisible: false,
             showTabsTitle: '',
             taobaoSpecialOfferTitle: 'taobao',
@@ -2014,6 +2020,20 @@ export default {
             node.focus();
             node.blur();
         },
+        handleMaterTitleClick() {
+            this.materTitltStatus = !this.materTitltStatus;
+            if (this.materTitltStatus) {
+                this.accountMaster = {
+                    height: 'auto'
+                };
+            }
+            else {
+                this.accountMaster = {
+                    height: '35px',
+                    overflow: 'hidden'
+                };
+            }
+        },
         handleApprovedClick() {
             const batchList = [];
             this.defaultFormList = [];

+ 7 - 8
src/views/modules/headline-view/headline-view.vue

@@ -18,7 +18,7 @@
                         <div class="costInfo">
                             <div class="yesterdayInfo">
                                 <div style="margin-bottom:8px">上阶段花费</div>
-                                <div style="font-size:14px;font-weight:600">{{ yearCostReportList.lastCost }}</div>
+                                <div style="font-size:14px;font-weight:600">{{ yearCostReportList.lastCost || 0 }}</div>
                             </div>
                             <a-divider type="vertical"/>
                             <div class="tongbi">
@@ -31,10 +31,10 @@
                                         <a-icon type="question-circle" />
                                     </a-tooltip>
                                 </div>
-                                <div style="font-size:14px;font-weight:600">{{ yearCostReportList.compare }}</div>
+                                <div style="font-size:14px;font-weight:600">{{ yearCostReportList.compare || 0 }}</div>
                             </div>
                         </div>
-                        <div class="costNum">{{ yearCostReportList.nowCost }}</div>
+                        <div class="costNum">{{ yearCostReportList.nowCost || 0 }}</div>
                     </div>
                     <div class="accountBodyLeftCostRight">
                         <div
@@ -122,9 +122,7 @@
                     </div>
                     <div class="accountBodyRightInfoItem">
                         <span class="name">投放状态:</span>
-                        <span>
-                            {{ topAccountMsg.accountMap && topAccountMsg.accountMap.accountStatus === '0' ? '投放中' : '未投放' }}
-                        </span>
+                        <span>{ topAccountMsg.accountMap && topAccountMsg.accountMap.accountStatus === '0' ? '投放中' : '未投放' }}</span>
                     </div>
                     <div class="accountBodyRightInfoItem createNum" @click="gorejectCreativePage">
                         <span class="name">被拒创意数:</span>
@@ -150,7 +148,7 @@
                         />
                     </div>
                 </div>
-                <div class="table" style="height:400px">
+                <div class="table">
                     <a-table
                         :columns="planColumns"
                         :data-source="planData"
@@ -1348,6 +1346,7 @@ export default {
             display: flex;
             justify-content: flex-end;
             margin-top: 20px;
+            margin-bottom: 20px;
         }
         p {
             margin-bottom: 0px;
@@ -1530,7 +1529,7 @@ export default {
         .planBody{
             display: flex;
             justify-content: space-between;
-            height: 760px;
+            height: auto;
         }
         .planBodyLeft {
             width: 40%;