Prechádzať zdrojové kódy

账户配置线上BUG 修复

jiayufei 4 rokov pred
rodič
commit
16cd172c00

+ 2 - 2
src/views/modules/account-config/account-config-server.js

@@ -1,3 +1,3 @@
-export const urlAcount = 'http://118.24.244.213:8080'; // 线上
-// export const urlAcount = 'http://192.168.1.43:8080'; // 子安
+// export const urlAcount = 'http://118.24.244.213:8080'; // 线上
+export const urlAcount = 'http://192.168.1.43:8080'; // 子安
 // export const urlAcount = 'http://139.186.165.84:8080'; // 测试

+ 85 - 46
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,44 @@
             />
         </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>
+                </a-form-model>
+            </div>
+        </a-modal>
+        <a-modal
             title="修改出价"
             v-if="modeVisible"
             :visible="modeVisible"
@@ -203,6 +228,16 @@ export default {
             }
         };
         return {
+            budgetVisible: false,
+            budgetForm: {
+                budgetType: '1',
+                budget: 0
+            },
+            budgetRules: {
+                budget: [
+                    {required: true, message: '请输入', trigger: 'blur'}
+                ]
+            },
             labelCol: {span: 4},
             wrapperCol: {span: 14},
             configForm: {
@@ -268,7 +303,7 @@ export default {
                 },
                 {
                     title: '账户日预算量(元)',
-                    dataIndex: 'adBudget',
+                    dataIndex: 'accountBudget',
                     align: 'center'
                 },
                 {
@@ -298,6 +333,12 @@ export default {
     },
     methods: {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
+        handleAccountMode(e) {
+            this.budgetForm.budget = 0;
+        },
+        handleAccountBudget(e) {
+            this.budgetForm.budget = Number(Number(e.target.value).toFixed(2));
+        },
         handleModeSure() {
             let paramsData = new FormData();
             if (this.updateModTxt.adBidCreateType === 'FIX') {
@@ -339,37 +380,31 @@ 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') {
-            }
-            else if (type === 'budget') {
-                if (Number(defaultList.budget) >= record.adBudget && Number(defaultList.budget) < (record.adBudget + 100)) {
-                    this.$message.error('单次修改预算幅度, 不能低于100.0元');
-                    return;
+            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);
+            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 +415,7 @@ export default {
                     this.adStepBid = undefined;
                     this.adCpaBid = undefined;
                     this.modeVisible = false;
+                    this.budgetVisible = false;
                     this.handleInitTable();
                 }
                 else {
@@ -405,6 +441,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;

+ 28 - 9
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"
@@ -304,13 +305,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>
@@ -553,6 +553,7 @@
                             v-model="configForm.adMinBid"
                             :min="0.1"
                             :max="10000"
+                            :step="0.01"
                             placeholder="请输入"
                         />
                         <span>~</span>
@@ -563,6 +564,7 @@
                             v-model="configForm.adMaxBid"
                             :min="0.1"
                             :max="10000"
+                            :step="0.01"
                             placeholder="请输入"
                         /> 元
                     </a-form-model-item>
@@ -574,6 +576,7 @@
                             v-model="configForm.adMinBid"
                             :min="0.1"
                             :max="10000"
+                            :step="0.01"
                             placeholder="请输入"
                         />
                         <span>~</span>
@@ -584,6 +587,7 @@
                             v-model="configForm.adMaxBid"
                             :min="0.1"
                             :max="10000"
+                            :step="0.01"
                             placeholder="请输入"
                         /> 元
                     </a-form-model-item>
@@ -591,6 +595,7 @@
                         <a-input-number
                             class="common-input"
                             v-model="configForm.adStepBid"
+                            :step="0.01"
                             placeholder="请输入"
                             @blur="handleFloatingInterval"
                         /> 元
@@ -1039,7 +1044,7 @@ export default {
             },
             configForm: {
                 dpLinkIndexUsed: 0,
-                adRetargetingTagsType: '1',
+                adRetargetingTagsType: '',
                 adAudiencePackageId: undefined,
                 adStepBid: 0,
                 ladderOne: '',
@@ -1229,6 +1234,19 @@ export default {
     methods: {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
         moment,
+        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;
@@ -1288,12 +1306,10 @@ export default {
             }
         },
         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 +1355,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;
         },
@@ -1512,7 +1528,7 @@ export default {
             }
         },
         handleAccountMode(e) {
-            this.configForm.accountBudget = '';
+            this.configForm.accountBudget = 0;
         },
         handleAdDownLoadType(e) {
             this.optimizationOption = [];
@@ -1587,6 +1603,9 @@ 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 || '';

+ 15 - 1
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 }})
@@ -411,7 +411,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 = '';

+ 2 - 2
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后台项目
@@ -88,7 +88,7 @@ module.exports = {
         // target:'http://118.24.244.213:8804',
         // target: 'http://192.168.1.43:8080', // 子安
         // target: 'http://192.168.1.8:8806', // 学超
-      //  target:'http://139.186.165.84:8806', //测试
+       target:'http://139.186.165.84:8806', //测试
 
         ws: false,