Bladeren bron

'添加选择计划页面以及修改新建计划中的深度转化出价'

魏志佳 4 jaren geleden
bovenliggende
commit
80829672bd

+ 68 - 36
src/views/modules/BatchCreate/TouTiaoBatch.vue

@@ -14,13 +14,19 @@
                 </a-tab-pane>
                 <a-tab-pane key="idea" tab="广告创意">
                    
-                    <a-tag color="blue" style="height:30px;line-height:30px;font-size:14px;" v-show="currentPlan.name">
-                        {{currentPlan.name}}	 <a-icon type="close" @click="clearPlan" />
+                    <a-tag color="blue" style="height:30px;line-height:30px;font-size:14px;" v-show="currentPlan.name ">
+                        {{currentPlan.name }}	 <a-icon type="close" @click="clearPlan" />
                     </a-tag>
                 </a-tab-pane>
-                <a-button type='primary'  slot="tabBarExtraContent" @click="goBatch">
+                <a-button type='primary'  slot="tabBarExtraContent" @click="goBatch" v-if="tabkey=='group'">
                    + 头条批量创建
                 </a-button>
+                <a-button type='primary'  slot="tabBarExtraContent" @click="createPlan" v-if="tabkey=='plan'">
+                   + 新建计划
+                </a-button>
+                <a-button type='primary'  slot="tabBarExtraContent" @click="createIdea" v-if="tabkey=='idea'">
+                   + 新建创意
+                </a-button>
 
             </a-tabs>
         </div>
@@ -653,6 +659,10 @@ export default {
                     pageNo:this.ipagination.current,
                     campaignId:item.id
                 })
+
+                let groupInfo=JSON.stringify(item)
+                localStorage.setItem('groupInfo',groupInfo)
+                
             }else if(this.tabkey=='plan'){
                 this.tabkey='idea';
                 this.columns=ideaColumns;
@@ -668,6 +678,8 @@ export default {
                     endDate:this.dateString[1],
                     pageNo:this.ipagination.current
                 })
+                let planInfo=JSON.stringify([item])
+                localStorage.setItem('planInfo',planInfo)
             }
             
         },
@@ -713,7 +725,14 @@ export default {
                 this.accountID=undefined;
                 this.openID=val
             }
-
+            this.treeData.forEach((item)=>{
+                item.children.forEach(ele=>{
+                    if(ele.value==val){
+                        let accountInfo=JSON.stringify(ele)
+                        localStorage.setItem('accountInfo',accountInfo)
+                    }
+                })
+            })
             this.search();
         },
 
@@ -784,6 +803,31 @@ export default {
             //      this.$router.push('/modules/BatchCreate/newCreate')
             // }
         },
+        createPlan(){
+            if(this.currentGroup.name){
+                console.log(this.currentGroup)
+                this.$router.push('/modules/BatchCreate/newPlan');
+                let groupInfo=JSON.stringify(this.currentGroup);
+                localStorage.setItem('groupInfo',groupInfo)
+            }else {
+                this.$router.push('/modules/BatchCreate/newGroup')
+            }
+        },
+        createIdea(){
+            if(this.accountID){
+                if(this.currentPlan.name){
+                    console.log(this.currentPlan)
+                    this.$router.push('/modules/BatchCreate/newCreate');
+                    let planInfo=JSON.stringify(this.currentGroup);
+                    localStorage.setItem('groupInfo',groupInfo)
+                }else if(!this.currentPlan.name){
+                    console.log('hhhh    去新建或者选择已有');
+                    this.$router.push('/modules/BatchCreate/selectPlanList');
+                }
+            }else {
+                this.$router.push('/modules/BatchCreate/newGroup')
+            }
+        },
         //状态改变
         statusChange(value){
             console.log(value);
@@ -854,12 +898,7 @@ export default {
         },
         //点击分页
         sort(pagination, filters, sorter, { currentDataSource }){
-            // console.log(pagination, filters, sorter)
-            // if(sorter.order == 'ascend'){
-            //     this.HttpPost(sorter.columnKey+'+')
-            // }else if(sorter.order == 'descend'){
-            //     this.HttpPost(sorter.columnKey+'-')
-            // }
+            
             this.ipagination.current=pagination.current;
             this.search()
         },
@@ -916,22 +955,24 @@ export default {
                    status:status,
                })).then((res)=>{
                 //    console.log(res);
-                   if(res.success){
-                    //    this.data=[];
-                    record.spin=false;
-                        this.refreshCreativeList({
-                            accountId:this.accountID,
-                            name:this.optionId,
-                            status:this.statusValue,
-                            startDate:this.dateString[0],
-                            endDate:this.dateString[1],
-                            pageNo:this.ipagination.current,
-                            planId:this.currentPlan.id,
-                        })
-                   }else{
-                       record.spin=false;
-                       this.$message.error(res.message)
-                   }
+                
+                    if(res.success){
+                        //    this.data=[];
+                        record.spin=false;
+                            this.refreshCreativeList({
+                                accountId:this.accountID,
+                                name:this.optionId,
+                                status:this.statusValue,
+                                startDate:this.dateString[0],
+                                endDate:this.dateString[1],
+                                pageNo:this.ipagination.current,
+                                planId:this.currentPlan.id,
+                                
+                            })
+                    }else{
+                        record.spin=false;
+                        this.$message.error(res.message)
+                    }
                })
            }
 
@@ -1223,11 +1264,7 @@ export default {
                 this.inputValue=0
             }
         },
-        //更改文字提示的父节点
-        // getPopupContainer(){
-        //     // console.log(this);
-        //     return this.$el
-        // },
+        
 
         //点击修改广告名
         // changecampaignName(text,record){
@@ -1444,12 +1481,7 @@ export default {
         },
     },
     mounted() {
-        
 
-        // let params = {}
-        // // this.dateString=[moment().format("YYYY-MM-DD"),moment().format("YYYY-MM-DD")]
-        // //初始
-        // this.refreshCampaignList(params);
         this.accountHttp()
     },
     filters: {

+ 1 - 1
src/views/modules/BatchCreate/newCreate.vue

@@ -416,7 +416,7 @@
   export default {
     data() {
       return {
-        planInfo: {},
+        planInfo: [],
         groupInfo: {},
         accountInfo: {},
         createTip: "",

+ 2 - 0
src/views/modules/BatchCreate/newDirectedPackage.vue

@@ -782,6 +782,8 @@
                             <a-radio-button value="AD">广告计划</a-radio-button>
                             <a-radio-button value="CAMPAIGN">广告组</a-radio-button>
                             <a-radio-button value="ADVERTISER">广告账户</a-radio-button>
+                            <a-radio-button value="CUSTOMER">公司账户</a-radio-button>
+                            <a-radio-button value="APP">APP</a-radio-button>
                         </a-radio-group>
                         <span class="tishi"><a-icon type="exclamation-circle" class="tubiao" />过滤已转化不支持投放目标为展示、点击计划,不支持受众预估
                         </span>

+ 48 - 13
src/views/modules/BatchCreate/newGroup.vue

@@ -1,12 +1,5 @@
 <template>
     <div class="newGroup">
-        <div class="steps">
-            <!-- <a-steps direction="vertical" :current="0">
-                <a-step title="广告组" description="推广目的" />
-                <a-step title="广告计划"  description="所属广告组  投放范围  投放目标 用户定向 预算与出价 计划名称" />
-                <a-step title="广告创意" description="设置投放位置 制作创意 创意分类 监测链接" />
-            </a-steps> -->
-        </div>
         
         <div class="currentOPt">
             <div class="currentAccount">
@@ -37,7 +30,7 @@
                                     <a-radio-button value="LINK">销售线索收集</a-radio-button>                                   
                                 </a-radio-group>
                             </a-form-item>
-                            <a-form-item label="广告预算" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+                            <a-form-item label="广告预算" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
                                 <a-radio-group  v-decorator="['budgetMode',{initialValue:'BUDGET_MODE_INFINITE' }]">
                                     <a-radio-button value="BUDGET_MODE_INFINITE">不限</a-radio-button>
                                     <a-radio-button value="BUDGET_MODE_DAY">指定日预算</a-radio-button>                                   
@@ -47,7 +40,7 @@
                                 <a-input-number  :max="9999999.99" :step="1"  v-decorator="['budget',{initialValue:1000 }]" @change="budgetChange" @blur='budgetBlur' />
                                 <span class="tip" v-if="getFormData('budget')<1000">预算不少于1000.00元,不超过9999999.99元,请正确输入</span>
                             </a-form-item>
-                            <a-form-item label="广告名称" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+                            <a-form-item label="广告名称" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
                                <a-input   v-decorator="['campaignName', { rules: [{ required: true ,message: '广告组名称必须填写'}] }]" />
                             </a-form-item>
                             <a-form-item label="广告组状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
@@ -96,6 +89,7 @@
             </div>
             <div class="creatBody">
                 <a-button type='default' class="goback" @click="goback">返回</a-button>
+                <a-button type='primary' @click="goShowTable" style="margin-right:20px">保存并返回</a-button>
                 <a-button type='danger' @click="nextHandle" :loading='nextLoading'>创建并下一步</a-button>
             </div>
         </div>
@@ -286,7 +280,7 @@ export default {
                             })
                         }
                     }else{
-                        console.log(err)
+                         this.$message.error('请正确填写必填选项') 
                     }
                 });
            }else{
@@ -315,9 +309,50 @@ export default {
             this.$router.replace(`/modules/BatchCreate/newPlan`)
         },
         //分页页码改变
-        pageNoChange(){
-
-        }
+        pageNoChange(val){
+            console.log(val);
+            this.currentPage=val;
+            this.selectedCampaign()
+        },
+        goShowTable(){
+            if(this.accountID){
+                this.form.validateFields((err, values) => {
+                    if (!err) {
+                        this.nextLoading=true;
+                        console.log('Received values of form: ', values);
+                       if(values.budgetMode== "BUDGET_MODE_DAY" && (values.budget<1000||values.budget>9999999.99 )){
+                            this.$message.error('日预算不少于1000.00元,不超过9999999.99元,请正确输入')
+                        }else{
+                             postAction('/ctop/byteDanceCampaign/add',qs.stringify({
+                                accountId:this.accountID,
+                                ...values
+                            })).then(res=>{
+                                console.log(res)
+                                if(res.success){
+                                    this.nextLoading=false;
+                                    this.$message.success('广告组创建成功,即将返回批量页面');
+                                    values.id=res.campaign_id;
+                                    values.accountId=this.accountID
+                                    let groupInfo=JSON.stringify(values)
+                                    localStorage.setItem('groupInfo',groupInfo)
+                                    setTimeout(() => {
+                                        this.$router.push('/modules/BatchCreate/TouTiaoBatch')
+                                    },1000);                                
+                                }else{
+                                    this.nextLoading=false;
+                                    this.$message.error(res.message) 
+                                }
+                            })
+                        }
+                    }else{
+                        // console.log(err)
+                        this.$message.error('请正确填写必填选项') 
+                    }
+                });
+           }else{
+               this.$message.error('请选择具体的账户')
+           }
+        },
     },
     mounted() {
         this.accountHttp();

+ 105 - 73
src/views/modules/BatchCreate/newPlan.vue

@@ -271,14 +271,14 @@
             <div class="input-item">
               <a-form-item>
                 <a-radio-group                       
-                  v-show="convertType=='AD_CONVERT_SOURCE_TYPE_NORMAL_APP_DOWNLOAD'"
+                  v-if="convertType=='AD_CONVERT_SOURCE_TYPE_NORMAL_APP_DOWNLOAD'"
                   @change="externalActionsChange"
                 > 
                   <a-radio-button v-for="item in currentConvertType.external_actions" :key="item.external_action" :value="item.external_action">
                     {{item.external_name}}</a-radio-button>
                 </a-radio-group>
-                <a-select  style="width: 335px" v-show="convertType=='AD_CONVERT_SOURCE_TYPE_APP_DOWNLOAD'"  @change="APIChange">
-                  <a-select-option v-for="item in currentConvertType.external_actions" :key="item.external_action" :value='item.external_action'>
+                <a-select  style="width: 335px" v-if="convertType=='AD_CONVERT_SOURCE_TYPE_APP_DOWNLOAD'"  @change="APIChange">
+                  <a-select-option v-for="item in currentConvertType.external_actions" :key="item.convert_id" :value='item.convert_id'>
                     {{item.external_name}}
                   </a-select-option>
                 </a-select>
@@ -318,8 +318,8 @@
                   ctions" :key="item.external_action" :value="item.external_action">
                     {{item.external_name}}</a-radio-button>
                 </a-radio-group> -->
-                <a-select  style="width: 335px" v-show="convertType=='AD_CONVERT_SOURCE_TYPE_INTERNAL'&&currentConvertType.external_actions.length>0"  @change="APIChange" placeholder="请选择转化目标">
-                  <a-select-option v-for="item in currentConvertType.external_actions"   :key="item.external_action" :value='item.external_action'>
+                <a-select  style="width: 335px" v-if="convertType=='AD_CONVERT_SOURCE_TYPE_INTERNAL'&&currentConvertType.external_actions.length>0"  @change="APIChange" placeholder="请选择转化目标">
+                  <a-select-option v-for="item in currentConvertType.external_actions"   :key="item.convert_id" :value='item.convert_id'>
                     {{item.external_name}}
                   </a-select-option>
                 </a-select>
@@ -706,6 +706,74 @@
               >请输入目标转化出价,不少于0.1元,不超过10000元</span>
             </div>
           </div>
+          
+          <div class="row-item" v-if="externalAction=='AD_CONVERT_TYPE_ACTIVE'">
+            <div class="hint-item"> </div>
+            <div class="label-item">
+              <div class="text-item">深度优化方式</div>
+              <div class="required-item"></div>
+            </div>
+            <div class="input-item">
+              <a-form-item>
+                <a-radio-group
+                  v-decorator="['deepBidType', { initialValue:'DEEP_BID_PACING' }]"
+                >
+                  <a-radio-button value="DEEP_BID_PACING" v-if="currentDeepConvert.deep_external_action=='AD_CONVERT_TYPE_NEXT_DAY_OPEN'">自动优化</a-radio-button>
+                  <a-radio-button value="DEEP_BID_MIN" v-if="currentDeepConvert.deep_external_action=='AD_CONVERT_TYPE_NEXT_DAY_OPEN'">自定义双出价</a-radio-button>
+                  <a-radio-button value="ROI_COEFFICIENT" v-if="currentDeepConvert.deep_external_action=='AD_CONVERT_TYPE_LT_ROI'">ROI系数</a-radio-button>
+                 
+                </a-radio-group>
+              </a-form-item>
+            </div>
+          </div>
+          <!-- {{currentDeepConvert}} -->
+          <div class="row-item" v-if="getFormData('smartBidType')=='SMART_BID_CUSTOM'&&getFormData('deepBidType')=='DEEP_BID_MIN'">
+            <div class="hint-item"> </div>
+            <div class="label-item">
+              <div class="text-item">深度转化出价</div>
+              <div class="required-item"></div>
+            </div>
+            <div class="input-item">
+              <a-form-item>
+                <a-input-number
+                  style="width:200px"
+                  :max="10000"
+                  :step="0.1"
+                  :min='0.1'
+                  v-decorator="['deepCpabid', {rules:validationRules.bid} ]"                 
+                />
+ 
+                <span style="margin-left:5px">元</span>
+              </a-form-item>
+              <span
+                class="tip"
+                v-if="getFormData('pricing')!='PRICING_CPA'&&getFormData('deepCpabid')<0.1"
+              >请输入深度转化出价,不少于0.1元,不超过10000元</span>
+            </div>
+          </div>
+          <div class="row-item" v-if="getFormData('smartBidType')=='SMART_BID_CUSTOM'&&getFormData('deepBidType')=='ROI_COEFFICIENT'">
+            <div class="hint-item"> </div>
+            <div class="label-item">
+              <div class="text-item">ROI系数</div>
+              <div class="required-item"></div>
+            </div>
+            <div class="input-item">
+              <a-form-item>
+                <a-input-number
+                  style="width:200px"
+                  :max="5"                 
+                  :min='0.001'
+                  v-decorator="['roiGoal', {rules:validationRules.roi} ]"                 
+                />
+ 
+                <span style="margin-left:5px">元</span>
+              </a-form-item>
+              <span
+                class="tip"
+                v-if="getFormData('pricing')!='PRICING_CPA'&&(getFormData('roiGoal')<0 || getFormData('roiGoal')>5)"
+              >请输入ROI系数,ROI系数不大于5,保留小数点后四位</span>
+            </div>
+          </div>
         </div>
       </div>
       <!-- 计划名称 -->
@@ -798,7 +866,12 @@ export default {
           required: true,
           message:'出价信息必须填写',
           // validator: this.validateBid,
-        }]
+        }],
+        roi:[{
+          required: true,
+          message:'ROI系数必须填写',
+          // validator: this.validateBid,
+        }],
       },
       isShowConversionTarget: false,
       downloadMode: '',
@@ -811,6 +884,7 @@ export default {
       convertType:'',
       currentConvertType:{},
       convertId:undefined,
+      currentDeepConvert:{},
       externalAction:'',
     }
   },
@@ -870,13 +944,26 @@ export default {
     // 应用下载API
     APIChange(val){
       console.log(val,this.currentConvertType);
+      this.convertId=val
       this.currentConvertType.external_actions.forEach(item=>{
-        if(item.external_action==val){
-          this.convertId=item.convert_id;
-          
+        if(item.convert_id==val){
+          console.log(item)
+          this.externalAction=item.external_action;
+          this.currentDeepConvert=item.deep_external_actions[0];
+          if(item.deep_external_actions[0].deep_external_action=='AD_CONVERT_TYPE_LT_ROI'){
+            this.form.getFieldDecorator('deepBidType')
+            this.form.setFieldsValue({
+              deepBidType:'ROI_COEFFICIENT'
+            })
+          }else if(item.deep_external_actions[0].deep_external_action=='AD_CONVERT_TYPE_NEXT_DAY_OPEN'){
+            this.form.getFieldDecorator('deepBidType')
+            this.form.setFieldsValue({
+              deepBidType:'DEEP_BID_PACING'
+            })
+          }
         }
       })
-      this.externalAction=val
+      
     },
     //  转化目标显示
     SelectConversionTarget() {
@@ -899,22 +986,7 @@ export default {
           })).then(res=>{
             // console.log(res)
             if(res.success){
-              // if(res.result.data){
-              //     res.result.data.list.forEach((item)=>{
-              //       if(item.convert_type=='AD_CONVERT_SOURCE_TYPE_NORMAL_APP_DOWNLOAD'){
-              //         item.convert_name='普通应用下载'
-              //       }
-              //       if(item.convert_type=='AD_CONVERT_SOURCE_TYPE_SDK'){
-              //         item.convert_name='应用下载SDK'
-              //       }
-              //       if(item.convert_type=='AD_CONVERT_SOURCE_TYPE_APP_DOWNLOAD'){
-              //         item.convert_name='应用下载API'
-              //       }
-              //       if(item.convert_type=='AD_CONVERT_SOURCE_TYPE_INTERNAL'){
-              //         item.convert_name='线索通'
-              //       }
-              //     })
-              // }
+             
               this.convertList=[];
               this.convertList=res.result.data.list;
               this.isShowConversionTarget = true
@@ -927,6 +999,10 @@ export default {
       
       
     },
+    // 深度转化方式改变
+    deepBidTypeChange(e){
+      console.log(e)
+    },
     //获取表单的某一个属性值
     getFormData(className) {
       return this.form.getFieldValue(className)
@@ -1058,7 +1134,7 @@ export default {
           this.form.validateFieldsAndScroll((err, values) => {
             if (!err) {
               this.goPlanShowloading=true;
-              // console.log('Received values of form: ', values)
+              console.log('Received values of form: ', values)
               // console.log(this.names)
               values.accountId = this.groupInfo.accountId
               values.campaignId = this.groupInfo.id;
@@ -1091,7 +1167,7 @@ export default {
                        this.$router.replace(`/modules/BatchCreate/TouTiaoBatch`)
                     },2000)
                   }else{
-                    if(res.message='convert_id is required'){
+                    if(res.message=='convert_id is required'){
                         this.$message.error('转化方式必须选择!')
                     }else{
                       this.$message.error(res.message)
@@ -1203,51 +1279,7 @@ export default {
       this.directPackageValue={};
       this.directPackageValue=val;
     },
-    goHttp() {
-      // console.log(this.validatorName())
-      this.$nextTick(()=>{
-        console.log(this.$refs.directedPackage)
-        if(this.visible){
-          this.$refs.directedPackage.getValuehandle()
-        }
-        if (this.validatorName()) {
-          this.form.validateFieldsAndScroll((err, values) => {
-            if (!err) {
-              console.log('Received values of form: ', values)
-              console.log(this.names)
-              values.accountId = this.groupInfo.accountId
-              values.campaignId = this.groupInfo.id;
-              values.convertId = this.convertId;
-              values.appType=this.getFormData('appType')
-              values.externalAction=this.externalAction
-              
-              postAction('/ctop/byteDanceAdvertisePlan/add', {
-                names: this.names,
-                landingType: this.groupInfo.landingType,
-                ...values,
-                ...this.directPackageValue
-              }).then((res) => {
-                console.log(res)
-                if (res.success) {
-                  if(res.code==0){
-                     this.$message.success('广告计划创建成功,2s后将跳转到新建计划页面')
-                    let planInfo=JSON.stringify({...values,...this.directPackageValue,names:this.names,landingType: this.groupInfo.landingType,})
-                    localStorage.setItem('planInfo',planInfo) 
-                  }else{
-                    this.$message.error(res.message)
-                  }
-                 
-                } else {
-                  this.$message.error('网络开小差了,等会再试试')
-                }
-              })
-            }else{
-              console.log(err)
-            }
-          })
-        }
-      })
-    },
+    
   },
   created() {},
   beforeMount() {},

+ 389 - 0
src/views/modules/BatchCreate/selectPlanList.vue

@@ -0,0 +1,389 @@
+<template>
+  <div class="selectPlan">
+    <!-- 跳转至选择已有 -->
+    <div class="moduler">
+        <div class="moduler-title">选择广告组</div>
+        <div>
+          广告组名称:
+                 
+            <a-tree-select
+                show-search
+                allow-clear
+                dropdownMatchSelectWidth
+                v-model="groupId"
+                style="width: 60%"
+                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
+                :tree-data="treeData"
+                placeholder="请选择具体广告组"                   
+                :filterOption='filterOption'
+                treeNodeFilterProp='title'
+                @change='groupChange'                  
+            >                   
+            </a-tree-select>
+          
+
+        </div>
+    </div>
+    <div class="tabBody">
+       <a-tabs v-model="tabKey">
+          <a-tab-pane key="exist" tab="选择已有广告计划" forceRender>
+              <div class="selectedExist">
+                  <a-input v-model="selectedPlanValue" class="input" placeholder="请输入广告计划id或名称" @change="selectedPlan">
+                      <a-icon slot="addonAfter" type="search" />
+                  </a-input>
+                  <div class="campaign-have-list">
+                      <div class="campaign-have-header">列表</div>
+                      <div class="hasAccountID" v-if="groupId">
+                          <a-spin :spinning="spinning">
+                              <ul v-if="planHaveList.length>0">
+                                  <li class="ad-d-flex ad-d-flex-between" v-for="(item,index) in planHaveList" :key="index" @click="goCreate(item)">
+                                      <span class="info">{{item.name}}</span>
+                                      <!-- <span class="landing-type"></span> -->
+                                  </li>
+                              </ul>
+                              <div v-else class="noAccountID">
+                                  暂无数据
+                              </div>
+                          </a-spin>
+                      </div>
+                      <div class="noAccountID" v-else>
+                          选择广告组后,才能选择已有广告计划
+                      </div>
+                      
+                  </div>
+                  <div class="fenye" v-if="totalPage">
+                      <a-pagination :current='currentPage' size='small' :total='totalPage' :pageSize='10' @change="pageNoChange" />
+                  </div>
+              </div>             
+              <a-tab-pane key="create" tab="新建广告组">
+                
+              </a-tab-pane>
+          </a-tab-pane>      
+          <a-tab-pane key="create" tab="新建广告计划" forceRender>
+              <div class="selectedExist">
+                  
+                  <div class="campaign-have-list">
+                      <div class="campaign-have-header">操作</div>
+                      <div class="hasAccountID" v-if="groupId">
+                          <a-button type='danger' @click="newCreate" style="margin-top:150px">去新建计划</a-button>
+                      </div>
+                      <div class="noAccountID" v-else>
+                          选择广告组后,才能新建已有广告计划
+                      </div>
+                      
+                  </div>
+                 
+              </div>             
+          </a-tab-pane>      
+      </a-tabs>
+    </div>
+  </div>
+</template>
+
+<script>
+import moment from 'moment'
+import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
+import qs from 'qs'
+  export default {
+    data() {
+      return {
+        selectedPlanValue:undefined,
+        spinning:false,
+        currentPage:1,
+        totalPage:0,
+        tabKey:'exist',
+        planHaveList:[],
+        groupId:undefined,
+        planId:undefined,
+        treeData:[],
+        accountInfo:{},
+
+      }
+    },
+    methods: {
+      //分页页码改变
+      pageNoChange(val){
+          console.log(val);
+          this.currentPage=val;
+          this.selectedPlan()
+      },
+      selectedPlan(e){
+            // console.log(e.target.value,this.selectedPlanValue);
+            if(this.groupId){
+                this.getExsitPlanList();
+            }else{
+                this.$message.warning('请选择具体广告组后重试!')
+                this.selectedPlanValue=undefined;
+            }
+      },
+      getExsitPlanList(){
+          this.spinning=true;
+          getAction('/ctop/byteDanceAdvertisePlan/list',{
+              accountId:this.accountInfo.value,
+              pageNo:this.currentPage,
+              name:this.selectedPlanValue,
+              campaignId:this.groupId
+          }).then(res=>{
+              console.log(res)
+              if(res.success){
+                  this.spinning=false;
+                  this.totalPage=res.result.total;
+                  this.planHaveList=res.result.records;
+              }
+          })
+      },
+      filterOption(input, option){
+            console.log(input, option)
+            return (
+                option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+            );
+      },
+      groupChange(val){
+          console.log(val,this.groupId);
+          // let currentData=this.treeData.filter((item)=>{
+          //     return item.value==val
+          // })
+          // // console.log(currentData);
+          // if(currentData.length>0){
+          //     this.groupId=undefined;
+          //     this.openID=val
+          // }
+          this.getExsitPlanList();
+          console.log(this.treeData)
+          this.treeData.forEach((item)=>{
+              
+            if(item.value==val){
+                let groupInfo=JSON.stringify(item)
+                localStorage.setItem('groupInfo',groupInfo)
+            }
+          })
+         
+      },
+      
+      goCreate(item){
+          // console.log(item)
+          let planInfo=JSON.stringify([item])
+          localStorage.setItem('planInfo',planInfo);
+          this.$router.replace(`/modules/BatchCreate/newCreate`);
+
+      },
+      newCreate(){
+        this.$router.replace(`/modules/BatchCreate/newPlan`);
+      },
+      groupHttp(){
+        this.treeData=[];
+        this.groupId=undefined;
+        getAction('/ctop/byteDanceCampaign/list', {
+           accountId:this.accountInfo.value,
+           pageSize:1000,
+        }).then(res => {
+          console.log(res);
+          if(res.success){
+              
+            if(res.result){
+              // this.treeData=res.result.records
+                let treeData=[]
+                res.result.records.forEach((element,index) => {
+                  if(element){
+                      element.title=element.name+'_('+element.landingType_dictText+')';
+                      element.value=element.id;
+                      element.key=element.id;        
+                  }
+                });
+                // console.log(this.treeData)
+                this.treeData=res.result.records
+            }
+          }
+        })
+      },
+    },
+    mounted() {
+      let accountInfo = localStorage.getItem('accountInfo');
+      if(accountInfo){
+        this.accountInfo=accountInfo
+      }
+      this.groupHttp()
+    },
+    beforeDestroy() {
+      this.$bus.$emit('remove', '/modules/BatchCreate/selectPlanList')
+    },
+  }
+</script>
+
+<style lang="less" scoped>
+.selectPlan{
+  ul,li{
+    margin: 0;
+    padding:0
+  }
+  .moduler {
+    background: #fff;
+    margin-bottom: 16px;
+    position: relative;
+    padding: 32px 24px 48px 32px;
+    border-radius: 4px;
+    box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.05);
+    .moduler-title {
+      display: flex;
+      align-items: center;
+      font-size: 22px;
+      margin-bottom: 20px;
+    }
+    .row-item {
+      display: flex;
+      justify-content: flex-start;
+      align-items: center;
+      margin-bottom: 32px;
+    }
+    .row-item:last-of-type {
+      margin-bottom: 0;
+    }
+    .row-item .hint-item {
+      width: 24px;
+      min-width: 24px;
+      align-self: flex-start;
+      line-height: 20px;
+      height: 20px;
+      margin-top: 5px;
+    }
+    .row-item .label-item {
+      position: relative;
+      align-items: flex-start;
+      align-self: flex-start;
+      line-height: 20px;
+      height: 20px;
+      margin-top: 7px;
+      width: 80px;
+      min-width: 80px;
+      .text-item {
+        font-size: 14px;
+        width: 60px;
+      }
+    }
+    .row-item .required-item {
+      width: 4px;
+      height: 4px;
+      border-radius: 2px;
+      background: #f45858;
+      position: absolute;
+      right: 10px;
+      top: 50%;
+      transform: translateY(-50%);
+    }
+    .row-item .input-item {
+      min-width: 480px;
+      position: relative;
+      // height: 35px;
+      .tip {
+        font-size: 12px;
+        color: tomato;
+      }
+    }
+  }
+  
+        .tabBody{
+            background: #fff;
+            margin-bottom: 20px;
+            padding: 20px 30px;
+            .tip{
+                font-size: 12px;
+                color: tomato;
+                display: block;
+                margin-top: 5px;
+                height: 20px;
+                line-height: 20px;
+                
+            }
+            .selectedExist{
+                width: 600px;
+                .input{
+                    margin-bottom:16px ;
+                }
+                .campaign-have-list{
+                    font-family: PingFangSC-Regular;
+                    font-size: 14px;
+                    color: #333;
+                    border: 1px solid #DADFE3;
+                    border-radius: 4px;
+                    margin-bottom: 16px;
+                    height: 388px;
+                    .campaign-have-header {
+                        height: 38px;
+                        width: 100%;
+                        padding-left: 13px;
+                        line-height: 38px;
+                        background: #f8f9fa;
+                        border-radius: 4px 4px 0px 0px;
+                        border-bottom: 1px solid #DADFE3;
+                    }
+                    .campaign-have-list ul {
+                        width: 100%;
+                        height: 350px;
+                        padding-top: 6px;
+                        
+                    }
+                    li{
+                        padding: 6px 10px;
+                        cursor: pointer;
+                    }
+                    li:hover{
+                        background: #EDF1F5;
+                    }
+                    .ad-d-flex-between {
+                        justify-content: space-between !important;
+                    }
+
+                    .ad-d-flex, .ad-btn {
+                        display: flex;
+                        align-items: center;
+                    }
+                    .byted-loading-v {
+                        position: absolute;
+                        top: 0;
+                        right: 0;
+                        bottom: 0;
+                        left: 0;
+                        z-index: 996;
+                        background-color: hsla(0,0%,96%,.9);
+                    }
+                    .info{
+                        width: 60%;
+                        overflow: hidden;
+                        text-overflow: ellipsis;
+                        white-space: nowrap;
+                        text-align: left;
+                    }
+                    .landing-type {
+                        color: #999;
+                        font-size: 12px;
+                        white-space: nowrap;
+                    }
+                }
+                .noAccountID{
+                    font-size: 14px;
+                    text-align: center;
+                    color: #999;
+                    line-height: 388px;
+                }
+                .fenye{
+                    height: 60px;
+                    padding-top: 12px;
+                    text-align: right;
+                }
+                .hasAccountID{
+                  text-align: center;
+                }
+            }
+        }
+        .creatBody{
+            background: #fff;
+            margin-bottom: 20px;
+            padding: 20px 30px;
+            text-align: right;
+            .goback{
+                margin-right: 20px;
+            }
+        }
+    
+}
+</style>

+ 3 - 3
vue.config.js

@@ -57,12 +57,12 @@ module.exports = {
     proxy: {
       '/jeecg-boot': {
         // target: 'http://192.168.1.90:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
-        target: 'http://192.168.1.72:8088', //请求本地 需要jeecg-boot后台项目  英豪
+        // target: 'http://192.168.1.72:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.1.94:8910', //请求本地 需要jeecg-boot后台项目  孙震
         // target: 'http://192.168.0.230:8088', //请求本地 需要jeecg-boot后台项目  孙震
-        // target: 'http://192.168.1.51:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
-        // target: 'http://192.168.1.165:8848', //请求本地 需要jeecg-boot后台项目  毕洁泉
+        target: 'http://192.168.1.51:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
+        // target: 'http://192.168.0.170:8088', //请求本地 需要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后台项目