Преглед изворни кода

Merge remote-tracking branch 'origin/master'

syh пре 5 година
родитељ
комит
9228b2055f

+ 2 - 1
src/components/DatePicker.vue

@@ -6,6 +6,7 @@
     <a-range-picker v-clickoutside="handleClose"
       v-model="dateValue"
       style="width:250px;"
+      :allowClear=false
       :open="openOptions"
       :disabled-date="disabledDate"
       :openChange="openChange"
@@ -113,7 +114,7 @@ export default {
   data() {
     return {
       moment,
-      dateValue: [],
+      dateValue: [moment(),moment()],
       type: 0,
       pickOptions
       // pickOptions:JSON.parse(JSON.stringify(pickOptions))

+ 1 - 1
src/utils/util.js

@@ -7,7 +7,7 @@ export function timeFix() {
 }
 
 export function welcome() {
-  const arr = ['休息一会儿吧', '准备吃什么呢?', '要不要打一把 DOTA', '我猜你可能累了']
+  const arr = ['休息一会儿吧', '准备吃什么呢?', '我猜你可能累了']
   let index = Math.floor((Math.random() * arr.length))
   return arr[index]
 }

+ 412 - 180
src/views/modules/BatchCreate/TouTiaoBatch.vue

@@ -9,15 +9,32 @@
                 </a-tab-pane>
                 <a-tab-pane key="idea" tab="广告创意">
                 </a-tab-pane>
-                <a-button type='primary' slot="tabBarExtraContent" @click="goBatch">
+                <a-button type='primary'  slot="tabBarExtraContent" @click="goBatch">
                    + 头条批量创建
                 </a-button>
+                
             </a-tabs>
         </div>
         </keep-alive>
         <div class="topOptions">
-            <span class="OptinItem">
-                <Treeselect :appId.sync="accountID" :multiple="false" request="2,4" ref="treeSelect" style="margin-bottom:8px " />
+            <span class="OptinItem topOpt">
+                <!-- <Treeselect :appId.sync="accountID" :multiple="false" request="2,4" reqUrl='/ctop/projectMember/getProjectAccountByUserId' ref="treeSelect" style="margin-bottom:8px " /> -->
+                
+                <a-tree-select
+                    show-search
+                    allow-clear
+                    dropdownMatchSelectWidth
+                    v-model="accountID"
+                    style="width: 60%"
+                    :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
+                    :tree-data="treeData"
+                    placeholder="请选择具体账户"                   
+                    :filterOption='filterOption'
+                    treeNodeFilterProp='title'
+                    @change='accountIDChange'                  
+                >
+                    
+                </a-tree-select>
             </span>
             <span class="OptinItem">
                 <a-select  style="width: 120px" v-model="statusValue" @change="statusChange" placeholder="请选择状态">
@@ -92,7 +109,7 @@
                                 <a-radio value="BUDGET_MODE_INFINITE">不限</a-radio>
                                 <a-radio value="BUDGET_MODE_DAY">日预算</a-radio>
                             </a-radio-group>
-                            <span v-show="radioValue=='dayBudget'">预计金额: <a-input-number :min="0" v-model="dayBudgetValue" :step="0.1" @change="budgetChange" size="small" style='margin-right:20px' /></span>
+                            <span v-show="radioValue=='BUDGET_MODE_DAY'">预计金额: <a-input-number :min="0" v-model="dayBudgetValue" :step="0.1" @change="budgetChange" size="small" style='margin-right:20px' /></span>
                             <a-button type='default' @click="showPricecancel"  style='margin-right:10px'>取消</a-button>
                             <a-button type='primary' @click="showPriceOk"  class="ok">保存</a-button>
                         </div>
@@ -103,104 +120,125 @@
                     <a-button type='default' @click="changeofferPrice" v-show="tabkey=='plan'">更改出价</a-button>
 
                  </span>
-                <span class="optionBtn">
+                <!-- <span class="optionBtn">
                     <a-button type='primary' @click="reset">自定义列</a-button>
-                </span>
+                </span> -->
             </div>
             <div class="table">
                 <a-table
                 :columns="columns"
-                :data-source="data"
-                :row-selection="rowSelection"
+                :data-source="data"               
+                :rowSelection="rowSelection"
                 bordered
                 :pagination="ipagination"
                 :loading="loading"
                 @change="sort"
                 >
                     <template slot="name" slot-scope="text,record">
-                        <editableCell :text="text" slotName='campaignName' @change="onCellChange(record.key, 'campaignName', $event)" />
+                        <editableCell :text="text" slotName='campaignName' @change="onCellChange(record.key, 'name', $event)" />
                     </template>
                     <span slot="budget" slot-scope="text,record">
-                       <editableCell :text="text" slotName='groupBudget' @change="onCellChange(record.key, 'groupBudget', $event)" />
+                       <editableCell :text="text" slotName='groupBudget' @change="onCellChange(record.key, 'budget', $event)" />
+                    </span>
+                    <span slot="bid" slot-scope="text,record">
+                       <editableCell :text="text" slotName='bid' @change="onCellChange(record.key, 'bid', $event)" />
                     </span>
                     <span slot="campaignStatus" slot-scope="text,record">
                         <a-switch size="default" :checked=text  @change="switchChange(text,record)"/>
                     </span>
-                    <span slot="options" slot-scope="record">
+                    <!-- <span slot="toutiaoStatus" slot-scope="text,record">
+                        <a-switch size="default" :checked=text  @change="switchChange(text,record)"/>
+                    </span> -->
+                    <!-- <span slot="options" slot-scope="record">
                         <a href="javascript:;" style="margin-right:10px">编辑</a>
                         <a href="javascript:;" v-if="tabkey=='plan'" @click="copyPlan(record)">复制</a>
                         <a href="javascript:;" v-if="tabkey=='idea'">预览</a>
-                    </span>
-                    <span slot="parentGroup" slot-scope="text,record">
+                    </span> -->
+                    <span slot="parentGroup" slot-scope="text">
                         <a href="javascript:;" >{{text}}</a>
                     </span>
-                    <span slot="parentPlan" slot-scope="text,record">
+                    <span slot="parentPlan" slot-scope="text">
                         <a href="javascript:;" >{{text}}</a>
                     </span>
+                    <span slot="time" slot-scope="text,record">
+                        {{record.startTime}}至{{record.endTime}}
+                    </span>
+                    <span slot="flowControlMode" slot-scope="text">
+                        <span v-if="text=='FLOW_CONTROL_MODE_FAST'">优先跑量</span>
+                        <span v-if="text=='FLOW_CONTROL_MODE_SMOOTH'">优先低成本</span>
+                        <span v-if="text=='FLOW_CONTROL_MODE_BALANCE'">均衡投放</span>
+                    </span>
                 </a-table>
             </div>
         </div>
         <!-- 出价的模态框 -->
-        <div class="batchModal">
-            <a-modal v-model="offerPriceVisiable" :title="'批量修改'+ModalTitle" @ok="handleOk" width='55%' id="batchModal" >
-                <div class="selectePlan">已选{{}}个广告计划</div>
-                <div class="modifyRules">
-                    <span class="rules">修改规则:</span>
-                    <a-radio-group v-model="modifyRulesValue" @change="modifyRulesChange">
-                        <a-radio-button value="total">
-                            统一修改
-                        </a-radio-button>
-                        <a-radio-button value="separately">
-                            分别修改
-                        </a-radio-button>
-                    </a-radio-group>
-                    <span class="totalPrice" v-if="modifyRulesValue=='total'"><span>{{ModalTitle=='出价'?'出价':'总预算'}}</span>
-                        :
-                        <a-input-number :min="0" v-model="inputValue" :step="0.1" @change="budgetChange" size="small"  /> 元
-                    </span>
-                </div>
-                <div class="modifyTable">
-                        <a-table
-                        :columns="modifyTableCol"
-                        :data-source="modifyTableData"
-                        bordered
-                        tableLayout="auto"
-                        :pagination="false"
-                        :loading='modifyTableloading'
-                        style="word-break: break-all;"
-                    >
-                        <span slot="changeBudget" slot-scope="">
-                            <span v-if="ModalTitle=='出价'">oCPM</span>
-                            <span v-else>{{modifyRulesValue=='total'?'总预算':'日预算'}}</span>
-                            :<a-input-number :min="0" v-model="inputValue" :step="0.1" @change="budgetChange"  size="small" :disabled="modifyRulesValue=='total'" /> 元
-                        </span>
-                        <span slot="currentCost" slot-scope="currentCost">{{ currentCost | decimalsHandle }}</span>
-                        <span slot="currentBudget" slot-scope="text">
-                            <span v-if="ModalTitle=='出价'">oCPM: {{text | decimalsHandle}}</span>
-                            <span v-else>日预算:{{  text | decimalsHandle }}</span>
+        <div class="batchModal" >
+            <a-modal v-model="offerPriceVisiable" :title="'批量修改'+ModalTitle" @ok="modifyChangeOk" width='55%' id="batchModal" >
+                <div id="batchModal">                
+                    <div class="selectePlan">已选{{}}个广告计划</div>
+                    <div class="modifyRules">
+                        <span class="rules">修改规则:</span>
+                        <a-radio-group v-model="modifyRulesValue" @change="modifyRulesChange">
+                            <a-radio-button value="total">
+                                统一修改
+                            </a-radio-button>
+                            <a-radio-button value="separately">
+                                分别修改
+                            </a-radio-button>
+                        </a-radio-group>
+                        <span class="totalPrice" v-if="modifyRulesValue=='total'"><span>{{ModalTitle=='出价'?'出价:':'总预算:'}}</span>
+                            
+                            <a-input-number :min="0" v-model="inputValue" :step="0.1" @change="totalbudgetChange" size="small"  /> 元
                         </span>
-                    </a-table>
+                    </div>
+                    <div class="modifyTable">
+                        <a-table
+                            :columns="modifyTableCol"
+                            :data-source="modifyTableData"
+                            bordered
+                            tableLayout="auto"
+                            :pagination="false"
+                            :loading='modifyTableloading'
+                            style="word-break: break-all;"
+                            >
+                            <span slot="changeBudget" slot-scope="text,records">
+                                <span v-if="ModalTitle=='出价'">oCPM</span>
+                                <span v-else>{{modifyRulesValue=='total'?'总预算:':'日预算:'}}</span>
+                                <a-input-number :min="0"  :step="0.1"  @blur='budgetChange($event,records)' size="small" :disabled="modifyRulesValue=='total'" /> 元
+                            </span>
+                            <span slot="currentCost" slot-scope="currentCost">{{ currentCost | decimalsHandle }}</span>
+                            <span slot="budget" slot-scope="text">
+                                
+                                <span >日预算:{{  text | decimalsHandle }}</span>
+                            </span>
+                            <span slot="bid" slot-scope="text" >
+                                <span >oCPM: {{text | decimalsHandle}}</span>
+                                
+                            </span>
+                        </a-table>
+                    </div>
                 </div>
-
             </a-modal>
         </div>
 
         <!-- 复制计划的弹出框 -->
         <a-modal v-model="copyPlanVisiable" title="复制计划" @ok="copyPlanOk" id="copyModal" :maskClosable='false'>
+            <div id="copyModal">
+                <p class="copyTip">复制说明:适用于批量复制多个广告计划,默认同事复制所属创意。此类型不直接跨广告投放账号复制,且只能复制完成后逐一修改</p>
+                <p style="font-weight:700;font-size:15px">被复制广告计划:<span>{{}}</span></p>
+                <p><span class="copyName"><b class="copyKeyStart">*</b> 复制个数:</span>
+                    <a-input-number :min="1" :max="10" v-model="copyNum" style="width:250px" />
 
-            <p class="copyTip">复制说明:适用于批量复制多个广告计划,默认同事复制所属创意。此类型不直接跨广告投放账号复制,且只能复制完成后逐一修改</p>
-            <p style="font-weight:700;font-size:15px">被复制广告计划:<span>{{}}</span></p>
-            <p><span class="copyName"><b class="copyKeyStart">*</b> 复制个数:</span>
-                <a-input-number :min="1" :max="10" v-model="copyNum" style="width:250px" />
-
-            </p>
-            <p><span class="copyName"><b class="copyKeyStart">*</b>复制到广告组:</span>
-                <a-select size="default" default-value="a1" style="width: 250px" v-model="copyGroup" >
-                <a-select-option v-for="i in 25" :key="(i + 9).toString(36) + i">
-                    {{ (i + 9).toString(36) + i }}
-                </a-select-option>
-                </a-select>
-            </p>
+                </p>
+                <p><span class="copyName"><b class="copyKeyStart">*</b>复制到广告组:</span>
+                    <a-select size="default" default-value="a1" style="width: 250px" v-model="copyGroup" >
+                    <a-select-option v-for="i in 25" :key="(i + 9).toString(36) + i">
+                        {{ (i + 9).toString(36) + i }}
+                    </a-select-option>
+                    </a-select>
+                </p>
+            </div>
+            
         </a-modal>
     </div>
 </template>
@@ -215,7 +253,7 @@ let typeValue='预算'
 let modifyTableCol=[
     {
         title: '广告计划',
-        dataIndex: 'advertisingPlan',
+        dataIndex: 'name',
         align: 'center',
     },
     {
@@ -225,13 +263,19 @@ let modifyTableCol=[
         scopedSlots: { customRender: 'currentCost' },
     },
     {
-        title: '当前'+typeValue,
-        dataIndex: 'currentBudget',
+        title: '当前预算',
+        dataIndex: 'budget',
         align: 'center',
-        scopedSlots: { customRender: 'currentBudget' },
+        scopedSlots: { customRender:'budget'  },
     },
     {
-        title: '统一修改'+typeValue,
+        title: '当前出价',
+        dataIndex: 'bid',
+        align: 'center',
+        scopedSlots: { customRender:'bid' },
+    },
+    {
+        title: '修改'+typeValue,
         dataIndex: 'changeBudget',
         align: 'center',
         scopedSlots: { customRender: 'changeBudget' },
@@ -297,69 +341,71 @@ const planColumns = [
     align: 'center',
     scopedSlots: { customRender: 'status' }
   },
-  {
-    title: '操作',
-    dataIndex: 'options',
-    key: 'options',
-    align: 'center',
-    scopedSlots: { customRender: 'options' }
-  },
+    //   {
+    //     title: '操作',
+    //     dataIndex: 'options',
+    //     key: 'options',
+    //     align: 'center',
+    //     width:200,
+    //     scopedSlots: { customRender: 'options' }
+    //   },
   {
     title: '计划名称',
-    dataIndex: 'planName',
-    key: 'planName',
+    dataIndex: 'name',
+    key: 'name',
     align: 'center',
     width:300,
-    scopedSlots: { customRender: 'planName' }
+    scopedSlots: { customRender: 'name' }
   },
   {
     title: '计划ID',
-    dataIndex: 'planID',
-    key: 'planID',
+    dataIndex: 'id',
+    key: 'id',
     align: 'center',
   },
   {
     title: '账户',
-    dataIndex: 'accountName',
-    key: 'promotionPurpose',
+    dataIndex: 'accountId',
+    key: 'accountId',
     align: 'center',
   },
   {
     title: '计划预算(元)',
-    dataIndex: 'planBudget',
-    key: 'planBudget',
+    dataIndex: 'budget',
+    key: 'budget',
     align: 'center',
     width:150,
-    scopedSlots: { customRender: 'planBudget' }
+    scopedSlots: { customRender: 'budget' }
   },
   {
     title: '出价(元)',
-    dataIndex: 'planoffer',
-    key: 'planoffer',
+
+    dataIndex: 'bid',
+    key: 'bid',
     align: 'center',
     width:150,
-    scopedSlots: { customRender: 'planoffer' }
+    scopedSlots: { customRender: 'bid' }
   },
   {
     title: '投放方式',
-    dataIndex: 'Launchmode',
-    key: 'Launchmode',
+    dataIndex: 'flowControlMode',
+    key: 'flowControlMode',
     align: 'center',
-    scopedSlots: { customRender: 'Launchmode' }
+    scopedSlots: { customRender: 'flowControlMode' }
   },
   {
     title: '投放时间',
-    dataIndex: 'LaunchTime',
-    key: 'LaunchTime',
+    dataIndex: 'time',
+    key: 'time',
     align: 'center',
-    scopedSlots: { customRender: 'LaunchTime' }
+    scopedSlots: { customRender: 'time' }
   },
   {
     title: '所属广告组',
-    dataIndex: 'parentGroup',
-    key: 'parentGroup',
+    dataIndex: 'campaignId',
+    key: 'campaignId',
     align: 'center',
-    scopedSlots: { customRender: 'parentGroup' }
+    scopedSlots: { customRender: 'campaignId' }
   },
 ];
 const ideaColumns = [
@@ -370,13 +416,13 @@ const ideaColumns = [
     align: 'center',
     scopedSlots: { customRender: 'status' }
   },
-  {
-    title: '操作',
-    dataIndex: 'options',
-    key: 'options',
-    align: 'center',
-    scopedSlots: { customRender: 'options' }
-  },
+    //   {
+    //     title: '操作',
+    //     dataIndex: 'options',
+    //     key: 'options',
+    //     align: 'center',
+    //     scopedSlots: { customRender: 'options' }
+    //   },
   {
     title: '创意ID',
     dataIndex: 'id',
@@ -437,12 +483,14 @@ export default {
         editableCell,
         Treeselect,
     },
-     mixins: [JeecgListMixin],
+    mixins: [JeecgListMixin],
     data() {
         return {
             moment,
             loading:false,
-            accountID:'',
+            accountID:undefined,
+            openID:undefined,
+            treeData:[],
             // account:'',//媒体账号
             optionId:'',//input输入的id或关键词
             statusValue:undefined,
@@ -462,31 +510,29 @@ export default {
             data:[],
             columns,
             selectedRowKeys:[],
+            selectedRows:[],
             rowSelection:{
                 onChange: (selectedRowKeys, selectedRows) => {
                     console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
-                    console.log(selectedRowKeys);
                     this.selectedRowKeys=selectedRowKeys;
+                    this.selectedRows=selectedRows;
                 },
                 onSelect: (record, selected, selectedRows) => {
                     console.log(record, selected, selectedRows);
-
+                    this.modifyTableData=selectedRows;
+                    this.selectedRows=selectedRows;
                 },
                 onSelectAll: (selected, selectedRows, changeRows) => {
                     console.log(selected, selectedRows, changeRows);
-
+                    this.modifyTableData=selectedRows
+                    this.selectedRows=selectedRows;
                 },
             },
             editID:0,
             //批量修改里的表格
             typeValue,
             modifyTableData:[
-                {
-                    advertisingPlan:'王者荣耀',
-                    currentCost:826595312,
-                    currentBudget:10000,
-                    changeBudget:''
-                }
+                
             ],
             modifyTableCol,
             modifyTableloading:false,
@@ -501,20 +547,50 @@ export default {
               campaignList: "/ctop/byteDanceCampaign/list",
               planList: "/ctop/byteDanceAdvertisePlan/list",
               creativeList: "/ctop/byteDanceCreative/list",
+              
+
             },
+
+
+            xiugaiData:[],//存分别修改时候的数组
         }
     },
 
     methods: {
+        // table里的函数
+        
+        // table里的函数在上
+
+        accountIDChange(val){
+            console.log(val);
+            let currentData=this.treeData.filter((item)=>{
+                return item.value==val
+            })
+            console.log(currentData);
+            if(currentData.length>0){
+                this.accountID=undefined;
+                this.openID=val
+            }
+        },
+        
+        filterOption(input, option){
+            console.log(input, option)
+            return (
+                option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+            );
+        },
         //tab切换页的函数
         callback(key) {
             console.log(key);
-            if(key=='plan'){
+            this.tabkey=key;
+            this.loading=true
+            if(key=='group'){
+                 this.columns=columns;
+                let params = {};
+                this.refreshCampaignList();
+            }else if(key=='plan'){               
+                this.getplanList({})
                 this.columns=planColumns;
-            }else if(key=='group'){
-              this.columns=columns;
-              let params = {};
-              this.refreshCampaignList();
             }else if(key=='idea'){
               this.columns=ideaColumns;
               let params = {};
@@ -523,7 +599,7 @@ export default {
         },
         //跳转到批量页面
         goBatch(){
-
+            this.$router.push('/modules/BatchCreate/newGroup')
         },
         //状态改变
         statusChange(value){
@@ -546,14 +622,27 @@ export default {
         //查询按钮事件
         search(){
             // console.log(this.accountID,this.dateString,this.statusValue,this.optionId);
-            this.refreshCampaignList({
-                accountId:this.accountID,
-                name:this.optionId,
-                status:this.statusValue,
-                startDate:this.dateString[0],
-                endDate:this.dateString[1],
-                pageNo:this.ipagination.current
-             })
+             this.loading=true
+            if(this.tabkey=='group'){
+                this.refreshCampaignList({
+                    accountId:this.accountID,
+                    name:this.optionId,
+                    status:this.statusValue,
+                    startDate:this.dateString[0],
+                    endDate:this.dateString[1],
+                    pageNo:this.ipagination.current
+                })
+            }else if(this.tabkey=='plan'){
+                this.getplanList({
+                    accountId:this.accountID,
+                    name:this.optionId,
+                    status:this.statusValue,
+                    startDate:this.dateString[0],
+                    endDate:this.dateString[1],
+                    pageNo:this.ipagination.current
+                })
+            }
+            
             // postAction('',{
 
             // }).then((res)=>{
@@ -574,13 +663,25 @@ export default {
         //重置按钮事件
         reset(){
 
+
         },
         //状态改变
         switchChange(text,record){
-            // console.log(`a-switch to ${checked}`);
+            
             console.log(text,record);
-            record.status=!text;
-            console.log(this.data)
+            let recordData=JSON.parse(JSON.stringify(record))
+            if(text){
+                recordData.toutiaoStatus='AD_STATUS_DISABLE'
+            }else{
+                recordData.toutiaoStatus='AD_STATUS_DELIVERY_OK'
+            }
+           
+           postAction('/ctop/byteDanceAdvertisePlan/edit',recordData).then((res)=>{
+               console.log(res);
+               if(res.success){
+                    record.status=!text;
+               }
+           })
         },
 
 
@@ -598,42 +699,35 @@ export default {
             this.selectDisable=true;
             if(this.optValue){
                 if(this.optValue=='pause'){
-                    if(this.selectedRowKeys.length>0){
-                        this.selectedRowKeys.forEach((item,index)=>{
-                            this.data.forEach((ele)=>{
-                                if(ele.key==item){
-                                    ele.status=false;
-                                }
-                            })
-
+                    if(this.selectedRowKeys.length>0){                       
+                        this.selectedRows.forEach((item)=>{
+                            item.toutiaoStatus='AD_STATUS_DISABLE'
                         })
                     }
                 }else if(this.optValue=='open'){
                    if(this.selectedRowKeys.length>0){
-                        this.selectedRowKeys.forEach((item,index)=>{
-                           this.data.forEach((ele)=>{
-                                if(ele.key==item){
-                                    ele.status=true;
-                                }
-                            })
+                        
+                        this.selectedRows.forEach((item)=>{
+                            item.toutiaoStatus='AD_STATUS_DELIVERY_OK'
                         })
                     }
                 }
-                console.log(this.data)
+              
+                this.batchEditHttp(this.selectedRows)
             }
-
+            // this.selectedRows=[];
         },
         //确定删除
         confirm(e) {
-            console.log(e);
+            // console.log(e);
                 if(this.optValue=='delete'){
-                    if(this.selectedRowKeys.length>0){
-
-                        this.selectedRowKeys.forEach((item,index)=>{
-                            this.data.splice(item,1)
+                    if(this.selectedRowKeys.length>0){                        
+                        this.selectedRows.forEach((item)=>{
+                            item.toutiaoStatus='AD_STATUS_DELETE'
                         })
                     }
                 }
+            this.batchEditHttp(this.selectedRows)
             this.$message.success('删除成功');
 
         },
@@ -656,35 +750,111 @@ export default {
         radioChange(e) {
             console.log('radio checked', e.target.value,this.radioValue);
         },
-        budgetChange(){
-            console.log(this.inputValue)
+        totalbudgetChange(val){
+            console.log(this.inputValue,'------',val)
+        },
+        budgetChange(e,record){
+            console.log(e.target.value,'------',record);
+            this.xiugaiData.push(JSON.parse(JSON.stringify(record)))
+            if(this.typeValue=='预算'){
+                if(e.target.value ){
+                    this.xiugaiData.forEach((item)=>{
+                        if(item.id==record.id){
+                            item.budget=e.target.value*1
+                        }
+                    })
+                    // console.log(this.xiugaiData)
+                }
+                
+            }else if(this.typeValue=='出价'){
+                if(e.target.value ){                   
+                    this.xiugaiData.forEach((item)=>{
+                        if(item.id==record.id){
+                            item.bid==e.target.value*1
+                        }
+                    })
+
+                }
+            }
+
         },
         //广告计划下的预算
         changebudget(){
             this.offerPriceVisiable=true;
             this.ModalTitle='预算'
-            typeValue='预算'
+            this.typeValue='预算'
+            this.modifyTableCol[4].title='修改预算';
+            this.xiugaiData=[];
+            this.inputValue=undefined;
         },
         //修改出价
         changeofferPrice(){
             this.offerPriceVisiable=true;
             this.ModalTitle='出价'
-            typeValue='出价';
-            this.modifyTableCol[2].title='出价';
-
-            this.modifyTableCol[3].title='统一修改出价';
-
+            this.typeValue='出价';
+            this.modifyTableCol[4].title='修改出价';
+            this.xiugaiData=[]
+            this.inputValue=undefined
         },
-        handleOk(e) {
+        //批量修改出价和预算的弹出框确定
+        modifyChangeOk(e) {
             console.log(e);
             this.offerPriceVisiable = false;
+            console.log(this.inputValue);
+            if(this.modifyRulesValue=='separately'){
+                
+                let batchArr=[...this.xiugaiData]
+                // console.log(batchArr)
+                this.batchEditHttp(batchArr)
+            }else if(this.modifyRulesValue=='total'){
+                let batchArr=[...this.modifyTableData]
+                if(this.typeValue=='出价'){
+                    batchArr.forEach((item)=>{
+                        item.bid=this.inputValue
+                    })
+                }else if(this.typeValue=='预算'){
+                    batchArr.forEach((item)=>{
+                        item.budget=this.inputValue
+                    })
+                }
+                this.batchEditHttp(batchArr)
+            }
+            
+            this.modifyTableData=[];
+            this.selectedRowKeys=[]
+            // console.log(this.rowSelection)
+            // this.rowSelection.onChange('',[]);
+            // this.rowSelection.onSelect({},false,[]);
+            // this.rowSelection.onSelectAll([],[],[]);
+            
+        },
+        batchEditHttp(params){
+            postAction('/ctop/byteDanceAdvertisePlan/batchEdit',params).then((res)=>{
+                console.log(res);
+                if(res.success){
+                    if(res.result.length>0){
+                        this.modifyTableData=[]
+                        this.modifyTableData=res.result
+                        this.getplanList({
+                            accountId:this.accountID,
+                            name:this.optionId,
+                            status:this.statusValue,
+                            startDate:this.dateString[0],
+                            endDate:this.dateString[1],
+                            pageNo:this.ipagination.current
+                        })
+                    }
+                }
+            })
         },
         //修改规则的改变
         modifyRulesChange(e){
+            console.log(e.target.value)
+            this.modifyRulesValue=e.target.value
             if(e.target.value=='total'){
                 this.inputValue=''
             }else{
-                this.inputValue=10000
+                this.inputValue=0
             }
         },
         //更改文字提示的父节点
@@ -704,7 +874,19 @@ export default {
             const target = dataSource.find(item => item.key === key);
             if (target) {
                 target[dataIndex] = value;
-                    this.data = dataSource;
+                console.log(target)
+                //单独修改预算
+                postAction('/ctop/byteDanceAdvertisePlan/edit',target).then((res)=>{
+                    console.log(res);
+                    if(res.success){
+                        // this.data = dataSource;
+                        this.$message.success({
+                            content:'修改成功!',
+                            duration:2
+                        })
+                    }
+                })
+                
             }
             console.log(this.data)
         },
@@ -721,12 +903,15 @@ export default {
             console.log(this.copyNum,'---',this.copyGroup)
         },
         refreshCampaignList(params){
-            this.loading=true
+            // this.loading=true
           getAction(this.url.campaignList, params).then(res => {
             console.log(res);
             if (res.success) {
                 this.ipagination.total = res.result.total
-                this.loading = false
+                this.loading = false;
+                res.result.records.forEach((item)=>{
+                        item.key=item.id
+                })
                 this.data = res.result.records;
 
             } else {
@@ -734,24 +919,67 @@ export default {
             }
           })
         },
-      refreshCreativeList(params){
-        getAction(this.url.creativeList, params).then(res => {
-          console.log(res);
-          if (res.success) {
-            this.data = res.result.records;
-          } else {
-            console.log(res.message);
-          }
-        })
-      }
+        getplanList(params){
+
+            getAction(this.url.planList,params).then((res)=>{
+                this.data=[]
+                console.log(res)
+                if(res.success){
+                    
+                    this.ipagination.total = res.result.total
+                    this.loading = false
+                    res.result.records.forEach((item)=>{
+                        item.key=item.id
+                    })
+                    
+                    this.data = res.result.records;
+                    console.log(this.data)
+                }
+            })
+        },
+        //请求项目和账户内容
+        accountHttp(){
+            this.treeData=[];
+            this.accountID=undefined;
+            getAction('/ctop/projectMember/getProjectAccountByUserId', {}).then(res => {
+            if(res.success){
+                    // console.log(res);
+                    if(res.result){
+                        res.result.forEach((element,index) => {
+                        if(element){                  
+                            this.treeData.push({});                    
+                            this.treeData[index].title=element.project.projectName +'_('+ element.project.advertiserName +')';
+                            this.treeData[index].value='project'+element.project.projectId;
+                            this.treeData[index].key=element.project.projectId;
+                            this.treeData[index].mediaId=element.project.mediaId;
+                            this.treeData[index].children=[];
+                                                
+                            if(element.account.length){
+                            element.account.forEach((ele,i)=>{
+                                this.treeData[index].children.push({});
+                                this.treeData[index].children[i].title=ele.userName+'_'+ele.authName;
+                                this.treeData[index].children[i].value=ele.accountId;
+                                this.treeData[index].children[i].key=ele.accountId;
+                            })
+                                
+                            }                           
+                        }      
+                        });
+                        // console.log(this.treeData)
+                        
+                    }
+            }
+            })
+        },
     },
     mounted() {
         console.log(this);
-        this.data=data;
+      
         let params = {}
         // this.dateString=[moment().format("YYYY-MM-DD"),moment().format("YYYY-MM-DD")]
         //初始
         this.refreshCampaignList(params);
+        this.accountHttp()
     },
     filters: {
         toPercentage(val) {
@@ -905,6 +1133,10 @@ export default {
     }
     .topOptions{
         padding: 15px 0;
+        .topOpt{
+            width: 100%;
+            margin-bottom: 10px;
+        }
     }
     .optionBtn{
         // display: inline-block;

+ 219 - 0
src/views/modules/BatchCreate/components/Treeselect.vue

@@ -0,0 +1,219 @@
+<style lang="scss" scoped>
+  .select-project {
+    width: 70%;
+  }
+</style>
+<template>
+  <div class="select-project">
+    <treeselect :multiple="multiple" :disable-branch-nodes="!multiple" :options="options" 
+      placeholder="请选择项目以及账户" v-model="value" :value-consists-of="valueConsistsOf" :auto-load-root-options="false"
+      @select="update" @input="emitValue" :limit="2"  :default-options="true" :limitText="
+        count => {
+          return '隐藏' + count + '条'
+        }
+      " noChildrenText="该项目下暂无账号" :noOptionsText="showLoading" />
+  </div>
+</template>
+
+<script>
+  //   @open="getParticipateList"
+  // import the component
+  import Treeselect from '@riophae/vue-treeselect'
+  // import the styles
+  import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+  import {
+    LOAD_CHILDREN_OPTIONS
+  } from '@riophae/vue-treeselect'
+
+  import {
+    getAction,
+    postAction
+  } from '@/api/manage'
+  import {
+    mapGetters
+  } from 'vuex'
+  // We just use `setTimeout()` here to simulate an async operation
+  // instead of requesting a real API server for demo purpose.
+  let called = false
+  export default {
+    data: () => ({
+      value: null,
+      valueConsistsOf: 'LEAF_PRIORITY',
+      options: [],
+      showLoading: 'loading...'
+    }),
+    props: {
+      //是否多选
+      multiple: {
+        type: Boolean,
+        default () {
+          return true
+        }
+      },
+      //判断媒体类型
+      request: {
+        type: String,
+        default () {
+          return '1,3'
+        }
+      },
+      //一级请求接口
+      reqUrl: {
+        type: String,
+        default () {
+          return '/ctop/projectMember/participateList'
+        }
+
+      }
+    },
+    components: {
+      Treeselect
+    },
+    watch: {
+      $route(n, o) {},
+    //   appId: {
+    //     handler(n, o) {
+    //       console.log(n)
+    //       if (n.length == 0) {
+    //         if (this.multiple) {
+    //           this.value = []
+    //         } else {
+    //           this.value = ''
+    //         }
+    //       }
+    //     },
+    //     deep: true
+    //   }
+    },
+    methods: {
+      ...mapGetters(['nickname', 'avatar', 'userInfo']),
+      update(node, id) {
+          console.log(node)
+        // getAction('/ctop/userAllocation/getAccountListByProjectId', {
+        //   projectId: node.id
+        // }).then(res => {
+        //   // console.log(res)
+        //   if (res.code == 0) {
+        //     if (res.result.length > 0) {
+        //       node.children = res.result.map(item => {
+        //         return {
+        //           id: item.accountId,
+        //           label: item.userName + '         ' + item.authName
+        //         }
+        //       })
+        //     } else {
+
+        //     }
+        //   } else {
+        //     new Error('Failed to load options: network error.')
+        //   }
+        // })
+      },
+      emitValue() {
+        this.$emit('update:appId', this.value)
+      },
+      loadOptions({
+        action,
+        parentNode,
+        callback
+      }) {
+        // Typically, do the AJAX stuff here.
+        // Once the server has responded,
+        // assign children options to the parent node & call the callback.
+        if (action === LOAD_CHILDREN_OPTIONS) {
+          getAction('/ctop/userAllocation/getAccountListByProjectId', {
+            projectId: parentNode.id
+          }).then(res => {
+            if (res.code == 0) {
+              if (res.result.length > 0) {
+                parentNode.children = res.result.map(item => {
+                  return {
+                    id: item.accountId,
+                    label: item.userName + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + item.authName
+                  }
+                })
+                callback()
+              } else {
+                parentNode.children = []
+                callback()
+              }
+            } else {
+              callback(new Error('Failed to load options: network error.'))
+            }
+          })
+        }
+      },
+      getParticipateList() {
+        //我参与的
+        //   toutiaoParticipateList
+        // getAction(this.reqUrl, {
+        //   userId: this.userInfo().id
+        // }).then(res => {
+        //   if (res.code == 0) {
+        //     if (res.result.length > 0) {
+        //       var arr = this.request.split(',')
+        //       var dataTwo = []
+        //       var data = res.result.filter(item => {
+        //         return item.mediaId == arr[0]
+        //       })
+        //       if (arr.length > 1) {
+        //         dataTwo = res.result.filter(item => {
+        //           return item.mediaId == arr[1]
+        //         })
+        //       }
+        //       var allData = data.concat(dataTwo)
+        //       this.options = allData.map(item => {
+        //         return {
+        //           id: item.projectId,
+        //           label: item.projectName + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + item
+        //             .advertiserName,
+        //           children: null
+        //         }
+        //       })
+        //     }else{
+        //         this.showLoading = '暂无数据'
+        //     }
+
+        //   }
+        // })
+        this.options=[];
+        this.accountID=undefined;
+            getAction('/ctop/projectMember/getProjectAccountByUserId', {}).then(res => {
+                if(res.success){
+                    // console.log(res);
+                    if(res.result){
+                        res.result.forEach((element,index) => {
+                        if(element){                  
+                            this.options.push({});                    
+                            this.options[index].label=element.project.projectName +'_('+ element.project.advertiserName +')';
+                            this.options[index].id='project'+element.project.projectId;
+                            this.options[index].key=element.project.projectId;
+                            this.options[index].mediaId=element.project.mediaId;
+                            this.options[index].children=[];
+                                                
+                            if(element.account.length){
+                            element.account.forEach((ele,i)=>{
+                                this.options[index].children.push({});
+                                this.options[index].children[i].label=ele.userName+'_'+ele.authName;
+                                this.options[index].children[i].id=ele.accountId;
+                                this.options[index].children[i].key=ele.accountId;
+                            })
+                                
+                            }                           
+                        }      
+                        });
+                        // console.log(this.options)
+                        
+                    }
+                }
+            })
+        
+
+      },
+    },
+
+    mounted() {
+      this.getParticipateList()
+    }
+  }
+</script>

+ 23 - 2
src/views/modules/BatchCreate/editableCell.vue

@@ -2,7 +2,7 @@
     <div class="myedit">
         <div class="editable-cell">
         <div v-if="editable" class="editable-cell-input-wrapper">
-          <a-input :value="value" @change="handleChange" @pressEnter="check" /><a-icon
+          <a-input v-model="value" @blur="blurChange" @change="handleChange" @pressEnter="check" /><a-icon
             type="check"
             class="editable-cell-icon-check"
             @click="check"
@@ -27,8 +27,16 @@
               editable: false,
             };
         },
+        watch:{
+          text:{
+            handler(n,o){
+              this.value=n
+            },
+            deep:true
+          }
+        },
         methods: {
-            handleChange(e) {
+            blurChange(e) {
               console.log(e)
               const value = e.target.value;
               if(this.slotName=='groupBudget'){
@@ -41,9 +49,22 @@
                 }else{
                   this.value='不限'
                 }    
+              }else if(this.slotName=='bid'){
+                if(this.value*1){
+                  if(value*1 && value*1>0.1 &&value*1<9999999.99){
+                    this.value = value;
+                  }else{
+                    this.$message.error('请输入0.1-9999999.99的数')
+                  }
+                }else{
+                  this.value='不限'
+                }   
               }
               
             },
+            handleChange(e){
+              console.log(e)
+            },
             check() {
               this.editable = false;
               this.$emit('change', this.value);

+ 15 - 0
src/views/modules/BatchCreate/newCreate.vue

@@ -0,0 +1,15 @@
+<template>
+    <div>
+chuangyi
+    </div>
+</template>
+
+<script>
+    export default {
+        
+    }
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 131 - 46
src/views/modules/BatchCreate/newDirectedPackage.vue

@@ -389,7 +389,7 @@
                     <a-form-item label="定向包名称" :label-col="labelCol" :wrapper-col="wrapperCol">
                        <a-input placeholder="请输入定向包名称,至多20个字符" style="width:40%" v-decorator="['name', { rules: [{ required: true, message: '请输入定向包名称' }] }]" />
                     </a-form-item>                    
-                    <a-form-item label="定向包类型" :label-col="labelCol" :wrapper-col="wrapperCol">
+                    <a-form-item label="定向包类型" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <a-radio-group  v-decorator="['landingType', { initialValue:'EXTERNAL' }]" @change='landingTypeChange' button-style="solid">
                             <a-radio-button value="EXTERNAL">落地页</a-radio-button>
                             <a-radio-button value="APP_ANDROID">应用下载-安卓</a-radio-button>
@@ -411,12 +411,12 @@
                             
                         </a-radio-group>
                     </a-form-item>
-                    <a-form-item label="媒体" :label-col="labelCol" :wrapper-col="wrapperCol">
+                    <a-form-item label="媒体" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <a-radio-group  v-decorator="['medialType', { initialValue:1 }]"  button-style="solid">
                             <a-radio-button :value="1">头条</a-radio-button>
                         </a-radio-group>
                     </a-form-item>
-                    <a-form-item label="地域" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                    <a-form-item label="地域" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <a-radio-group  button-style="solid" v-model="regionValue">
                             <a-radio-button value="">不限</a-radio-button>
                             <a-radio-button value="REGION_LEVEL_PROVINCE">按省市</a-radio-button>
@@ -476,17 +476,17 @@
                             </div>
                         </div>                        
                     </a-form-item>
-                    <a-form-item label="性别" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                    <a-form-item label="性别" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                          <a-radio-group  v-decorator="['gender', {initialValue:'NONE' }]"  button-style="solid">
                             <a-radio-button value="NONE">不限</a-radio-button>
                             <a-radio-button value="GENDER_MALE">男</a-radio-button>
                             <a-radio-button value="GENDER_FEMALE">女</a-radio-button>
                         </a-radio-group>
                     </a-form-item>
-                    <a-form-item label="年龄" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                    <a-form-item label="年龄" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <radioCheck :checkArr='ageArr' @getSonValue='getAgeSelect' />
                     </a-form-item>
-                    <a-form-item label="精选流量包" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                    <a-form-item label="精选流量包" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <a-radio-group  button-style="solid" v-decorator="['medialType', { initialValue:''}]">
                             <a-radio-button value="">不限</a-radio-button>
                             <a-radio-button value="men" :disabled='getFormData("deliveryRange")!="UNION"'>应用软件精选</a-radio-button>
@@ -494,9 +494,39 @@
                         </a-radio-group>
                         <span class="tishi"><a-icon type="exclamation-circle" class="tubiao" />精选流量包仅支持穿山甲、穿山甲-精选游戏广告位</span>
                     </a-form-item>
-                    <a-form-item label="行为兴趣:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                    <a-form-item label="自定义人群" :label-col="labelCol" :wrapper-col="wrapperCol">
+                        <a-radio-group  v-model="customCrowd" button-style="solid">
+                            <a-radio-button value="NONE">不限</a-radio-button>
+                            <a-radio-button value="CUSTOMt_CROWED">自定义人群</a-radio-button>                           
+                        </a-radio-group>
+                    </a-form-item>
+                    <a-form-item label="定向逻辑" :label-col="labelCol" :wrapper-col="wrapperCol" v-if="customCrowd=='CUSTOMt_CROWED'">
+                        <a-radio-group  v-model="directLogic" button-style="solid" @change="directLogicChange">
+                            <a-radio-button value="RETARGETING_INCLUDE">定向</a-radio-button>
+                            <a-radio-button value="RETARGETING_EXCLUDE">排除</a-radio-button>                           
+                            <a-radio-button value="ALL">同时定向排除</a-radio-button>                           
+                        </a-radio-group>
+                    </a-form-item>
+                    <div class="zidingyirenqun" v-if="customCrowd=='CUSTOMt_CROWED'">
+                      
+                        <a-form-item  class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                            <a-input placeholder="请输入人群包名称或者ID" v-model="dxInputValue" v-if="directLogic!='ALL'" style="width:50%">
+                                <a-icon type="search" slot="addonAfter"/>
+                            </a-input>
+                            <div class="dingxiang" v-if="directLogic=='RETARGETING_INCLUDE'">
+
+                            </div>
+                            <div class="paichu" v-if="directLogic=='RETARGETING_EXCLUDE'">
+
+                            </div>
+                            <div class="dingxiang_paichu" v-if="directLogic=='ALL'">
+
+                            </div>
+                        </a-form-item>                                   
+                    </div>
+                    <a-form-item label="行为兴趣" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <a-radio-group v-model="interestActionMode" button-style="solid">
-                            <a-radio-button value="">不限</a-radio-button>
+                            <a-radio-button value="UNLIMITED">不限</a-radio-button>
                             <a-radio-button value="RECOMMEND">
                                 系统推荐
                                 <a-tooltip>
@@ -511,7 +541,7 @@
                         
                     </a-form-item>
                     <div class="interestActionMode" v-show="interestActionMode=='CUSTOM'">
-                            <a-form-item label="行为" class="optItem"  :label-col="labelCol" :wrapper-col="wrapperCol">
+                            <a-form-item label="行为" class="optItem"  :label-col="labelCol" :wrapper-col="wrapperCol">
                                 <div>
                                     <span style="margin-right:5px">在</span> 
                                     <a-select
@@ -656,14 +686,14 @@
                                     </div>
                                 </div>
                             </a-form-item>
-                            <a-form-item label="兴趣" class="optItem"  :label-col="labelCol" :wrapper-col="wrapperCol">
+                            <a-form-item label="兴趣" class="optItem"  :label-col="labelCol" :wrapper-col="wrapperCol">
 
                             </a-form-item>
                         </div>
-                    <a-form-item label="平台" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
-                        <radioCheck :checkArr='platformArr' @getSonValue='getNewUser' />
+                    <a-form-item label="平台" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                        <radioCheck :checkArr='platformArr' @getSonValue='getPlatForm' />
                     </a-form-item>
-                    <a-form-item label="过滤已安装" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol" v-if="landingTypeValue=='APP_ANDROID'">
+                    <a-form-item label="过滤已安装" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol" v-if="landingTypeValue=='APP_ANDROID'">
                         <a-radio-group  button-style="solid" v-decorator="['hideIfExists', {initialValue:0 }]" >
                             <a-radio-button :value='0'>不过滤</a-radio-button>
                             <a-radio-button :value="1">过滤</a-radio-button>
@@ -684,7 +714,7 @@
                         </a-select>
                     </a-form-item>
                     <a-form-item label="过滤已转化用户" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
-                         <a-radio-group  v-decorator="['gender', {initialValue:'NO_EXCLUDE' }]"  button-style="solid">
+                         <a-radio-group  v-decorator="['filterConvertedUsers', {initialValue:'NO_EXCLUDE' }]"  button-style="solid">
                             <a-radio-button value="NO_EXCLUDE">不过滤</a-radio-button>
                             <a-radio-button value="AD">广告计划</a-radio-button>
                             <a-radio-button value="CAMPAIGN">广告组</a-radio-button>
@@ -693,13 +723,13 @@
                         <span class="tishi"><a-icon type="exclamation-circle" class="tubiao" />过滤已转化不支持投放目标为展示、点击计划,不支持受众预估
                         </span>
                     </a-form-item>
-                    <a-form-item label="运营商" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
-                       <radioCheck :checkArr='carrierArr' @getSonValue='getNewUser' />
+                    <a-form-item label="运营商" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                       <radioCheck :checkArr='carrierArr' @getSonValue='getCarrier' />
                     </a-form-item>
-                    <a-form-item label="网络" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
-                       <radioCheck :checkArr='networkArr' @getSonValue='getNewUser' />
+                    <a-form-item label="网络" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                       <radioCheck :checkArr='networkArr' @getSonValue='getAc' />
                     </a-form-item>
-                    <a-form-item label="文章类型" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                    <a-form-item label="文章类型" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                        <a-radio-group  button-style="solid" v-model="articleType">
                             <a-radio-button value="">不限</a-radio-button>
                             <a-radio-button value="articleCategory">文章分类</a-radio-button>                          
@@ -723,7 +753,7 @@
                             <singleLayersSelecte  title='文章类型'  :listArr='articleCategoryOptions'  @getCheckedList='getArticleCategory'/>
                         </div>
                     </a-form-item>
-                    <a-form-item label="手机品牌" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                    <a-form-item label="手机品牌" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                        <a-radio-group  v-model="deviceBrandType" button-style="solid">
                             <a-radio-button value="">不限</a-radio-button>
                             <a-radio-button value="byBrand">按品牌</a-radio-button>
@@ -747,7 +777,7 @@
                             <singleLayersSelecte  title='手机品牌' :listArr='deviceBrandOptions'  @getCheckedList='getDeviceBrand' />
                         </div>
                     </a-form-item>
-                    <a-form-item label="手机价格"  class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                    <a-form-item label="手机价格"  class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                        <a-radio-group  v-model="launchPrice" button-style="solid">
                             <a-radio-button value="">不限</a-radio-button>
                             <a-radio-button value="custom">自定义</a-radio-button>
@@ -757,33 +787,33 @@
                         </span>
                         <span v-else></span>
                     </a-form-item>
-                    <a-form-item label="新用户" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">                      
+                    <a-form-item label="新用户" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">                      
                         <radioCheck :checkArr='newUser' @getSonValue='getNewUser' />
                     </a-form-item>
-                    <a-form-item label="智能放量" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
-                        <a-radio-group  button-style="solid" v-model="autoExtendEnabled">
+                    <a-form-item label="智能放量" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                        <a-radio-group v-decorator="['autoExtendEnabled', { initialValue:0 }]" button-style="solid">
                             <a-radio-button :value="0">不启用</a-radio-button>
                             <a-radio-button :value="1">启用</a-radio-button>
                         </a-radio-group>
                         <span class="tishi"><a-icon type="exclamation-circle" class="tubiao" />智能放量不支持受众预估</span>
-                        <div v-if="autoExtendEnabled==1" class="deviceBrand">
-                            <singleLayersSelecte  title='可放开定向' :listArr='autoExtendOptions'  @getCheckedList='getAutoExtendEnabled'/>
-                            
+                        <div v-if="getFormData('autoExtendEnabled')==1" class="deviceBrand">
+                            <singleLayersSelecte  title='可放开定向' :listArr='autoExtendOptions'  @getCheckedList='getAutoExtendEnabled'/>                            
                         </div>
                     </a-form-item>
-                    <a-form-item label="保存为模板" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                    <a-form-item label="保存为模板" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <a-radio-group default-value="no" button-style="solid">
                             <a-radio value="yes">是</a-radio>
                             <a-radio value="no">否</a-radio>
                         </a-radio-group>
                     </a-form-item>
-                    <a-form-item :wrapper-col="{ span: 14, offset: 4 }" :label-col="labelCol"> 
+                    <a-form-item :wrapper-col="{ span: 14, offset: 10 }" :label-col="labelCol"> 
+                        
+                        <a-button style="margin-right: 30px;" @click="cancel">
+                            取消
+                        </a-button>
                         <a-button type="primary" @click="applicatiSubmit">
                             应用
                         </a-button>
-                        <a-button style="margin-left: 10px;" @click="cancel">
-                            取消
-                        </a-button>
                     </a-form-item>       
                 </a-form>           
             </div>
@@ -994,15 +1024,12 @@ export default {
             labelCol: { span: 4 },
             wrapperCol: { span: 14 },
             launchPrice:'',//手机价格
+            launchPriceArr:[2000, 7000],
             deviceBrandType:'',
             deviceBrand:[],//手机品牌
             deviceBrandOptions:[],
             form: this.$form.createForm(this),
-            // form:{
-            //     medialType:1,
-            //     sex:'',
-            //     launchPrice:[],//手机价格
-            // },
+            
             marks: {
                 0: '0',
                 1000: '',
@@ -1047,7 +1074,7 @@ export default {
             MapselectValue:undefined,//地图的搜索地址
 
             //行为兴趣选择
-            interestActionMode:'',
+            interestActionMode:'UNLIMITED',
             actionScene:[],//行为场景
 
             actionDays:30,//行为天数
@@ -1064,7 +1091,7 @@ export default {
 
             autoExtendEnabled:0,//智能放量是否开启
             autoExtendOptions,//智能投放可选定向数组
-            autoExtendTarget:[],//智能放量开启后的选择数据----------需传递的参数
+            autoExtendTargets:[],//智能放量开启后的选择数据----------需传递的参数
 
             articleCategoryOptions:[],//文章分类
             articleCategory:[],//  文章分类选中的数据-----------传递的参数
@@ -1075,6 +1102,12 @@ export default {
             landingTypeValue:'',//定向包类型的值  用来判断平台的值
             androidOsvArr:[],//受众安卓版本号数组
             iosOsvArr:[],//受众ios版本号数组
+            platform:[],//受众平台-------------传递参数
+            activateType:[],//用户首次激活时间---------传递参数
+
+            customCrowd:'NONE',//自定义人群 选择的值
+            directLogic:'RETARGETING_INCLUDE',//定向逻辑的值
+            dxInputValue:undefined,//自定义人群包下面的搜索框(定向/排除)
         }
     },
     methods: {
@@ -1129,7 +1162,36 @@ export default {
         //应用按钮
         applicatiSubmit(){
             console.log('submit!', this.form);
-            this.$router.push('/modules/BatchCreate/directionalPackage')
+            let formData=this.form.getFieldsValue()
+            console.log(formData)
+            if(this.launchPrice=='custom'){
+                formData['launchPrice']=this.launchPriceArr
+            }
+            if(!this.regionValue==''){
+                console.log('需要处理地域的值')
+            }
+            let userinfo=localStorage.getItem('pro__Login_Userinfo')
+            
+            if(userinfo){
+                let userId=JSON.parse(userinfo).value.id
+                formData['userId']=userId
+            }
+            formData['activateType']=this.activateType
+            formData['deviceBrand']=this.deviceBrand
+            formData['autoExtendEnabled']=this.autoExtendEnabled
+            formData['autoExtendTargets']=this.autoExtendTargets
+            formData['articleCategory']=this.articleCategory
+            formData['age']=this.age
+            formData['carrier']=this.carrier
+            formData['ac']=this.ac
+            formData['interestActionMode']=this.interestActionMode
+            
+
+            postAction('/ctop/audiencePackage/add',formData).then((res)=>{
+                console.log(res)
+            })
+            // formData['launchPrice']=this.
+            // this.$router.push('/modules/BatchCreate/directionalPackage')
         },
         //取消按钮
         cancel(){
@@ -1137,7 +1199,8 @@ export default {
         },
         //huakuai de shijian 
         slideChange(value) {
-            this.form.launchPrice=value;
+            console.log(value)
+            this.launchPriceArr=value;
         },
         btnChange(e){
             console.log(e)
@@ -1147,6 +1210,12 @@ export default {
         //获取新用户的选中值
         getNewUser(val){
             console.log(val);
+            if(val.length==1&&val[0]==""){
+                this.activateType=[]
+            }else{
+                this.activateType=val;
+            }
+            
         },
         //地域选择里的搜索
         regionOnSearch(value) {
@@ -1198,20 +1267,20 @@ export default {
         //获取智能放量定向的值
         getAutoExtendEnabled(val){
             console.log(val)
-            this.autoExtendTarget=[];
-            this.autoExtendTarget.push([...val])
+            this.autoExtendTargets=[];
+            this.autoExtendTargets.push(...val)
         },
         //获取手机品牌的值
         getDeviceBrand(val){
             console.log(val);
             this.deviceBrand=[];
-            this.deviceBrand.push([...val])
+            this.deviceBrand.push(...val)
         },
         //获取文章分类的值
         getArticleCategory(val){
             console.log(val)
             this.articleCategory=[];
-            this.articleCategory.push([...val])
+            this.articleCategory.push(...val)
         },
 
         //获取选中的年龄段
@@ -1235,13 +1304,29 @@ export default {
         },
 
         //获取受众网络
-        getAc(){
+        getAc(val){
             if(val.length==1&&val[0]==""){
                 this.ac=[]
             }else{
                 this.ac=val;
             }
         },
+
+        // 获取平台
+        getPlatForm(val){
+            console.log(val)
+            if(val.length==1&&val[0]==""){
+                this.platform=[]
+            }else{
+                this.platform=val;
+            }
+            
+        },
+
+        // 自定义人群下的 定向排除
+        directLogicChange(val){
+            this.dxInputValue=undefined
+        },
     },
     mounted() {
         //手机品牌

+ 40 - 0
src/views/modules/BatchCreate/newGroup.vue

@@ -0,0 +1,40 @@
+<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="currentAccount">
+
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            
+        }
+    },
+    methods: {
+        
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.newGroup{
+    background: #FFF;
+    padding: 20px;
+    display: flex;
+    
+    .steps{
+        width: 8%;
+    }
+}
+</style>

+ 15 - 0
src/views/modules/BatchCreate/newPlan.vue

@@ -0,0 +1,15 @@
+<template>
+    <div>
+guanggaojihua
+    </div>
+</template>
+
+<script>
+    export default {
+        
+    }
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 24 - 21
src/views/modules/BatchCreate/radioCheck.vue

@@ -52,31 +52,32 @@ export default {
     methods: {
         //单选多选的事件
         radioCheckChange(e,item){
-            console.log(e.target,item);
+            console.log(e.target,item,!item.disabled);
+            
             this.currentSelect=e.target.value;
             if(!item.disabled){
 
-            if(e.target.value=='' || this.selectValue.length==0 ){
-                this.selectValue=[''];
-            }else{
-                if(this.selectValue.indexOf('')>-1){
-                    let i=this.selectValue.indexOf('');
-                    this.selectValue.splice(0,1)
-                }
-                
-                if(this.selectValue.indexOf(e.target.value)==-1){
-                    this.selectValue.push(e.target.value)
+                if(e.target.value=='' || this.selectValue.length==0 ){
+                    this.selectValue=[''];
                 }else{
-                    this.selectValue=this.selectValue.filter((item)=>{
-                        return item!=e.target.value
-                    })  
-                }
+                    if(this.selectValue.indexOf('')>-1){
+                        let i=this.selectValue.indexOf('');
+                        this.selectValue.splice(0,1)
+                    }
+                    
+                    if(this.selectValue.indexOf(e.target.value)==-1){
+                        this.selectValue.push(e.target.value)
+                    }else if(this.selectValue.indexOf(e.target.value)>-1){
+                        this.selectValue=this.selectValue.filter((item)=>{
+                            return item!=e.target.value
+                        })  
+                    }
 
-                if(this.selectValue.length==0){
-                    this.selectValue=[''];
+                    if(this.selectValue.length==0){
+                        this.selectValue=[''];
+                    }
+                    
                 }
-                
-            }
             // console.log(this.currentSelect,this.selectValue);
             }
             this.$emit('getSonValue',this.selectValue)
@@ -84,9 +85,11 @@ export default {
     },
     mounted() {
         // this.selectValue=[]
+        // console.log(this.checkArr)
         this.checkArr.forEach((item,index)=>{
-            if(!item.disabled){
-                this.selectValue[0]=item
+            
+            if(item.disabled&&item.disabled!=undefined){
+                this.selectValue[0]=item.value
             }else{
                 this.selectValue=['']
             }

+ 3 - 3
src/views/modules/kuaishouapp/account/accountIndex.vue

@@ -21,7 +21,7 @@
       <a-row class="image-list-heading vm-panel" style="padding: 8px 20px;">
         <a-col :md="7" :sm="8" style="display:flex">
           <a-form-item label="计划id">
-            <a-input placeholder="请输入计划id" v-model="campaignId"></a-input>
+            <a-input placeholder="请输入计划id" v-model="campaignIdSearch"></a-input>
           </a-form-item>
         </a-col>
         <a-col :md="7" :sm="8" style="display:flex">
@@ -284,7 +284,7 @@
     },
     data: function () {
       return {
-        campaignId: '',
+        campaignIdSearch: '',
         campaignName: '',
         loadingList: false,
         form: this.$form.createForm(this),
@@ -505,7 +505,7 @@
           params.accountId = this.appId + ''
           params.pageNo = this.ipagination.current
           params.pageSize = this.ipagination.pageSize
-          params.campaignId = this.campaignId
+          params.campaignId = this.campaignIdSearch
           params.campaignName = this.campaignName
           this.getCampaignList(params)
         } else {

+ 1 - 4
src/views/modules/kuaishouapp/account/stepForm/Step3.vue

@@ -1460,7 +1460,7 @@
         }).then(res => {
           if (res.success) {
             this.pans[bestIndex].list[nowIndex].description =
-              res.result ? res.result.creativeCopywriter : ''
+              res.result ? (res.result.creativeCopywriter ? res.result.creativeCopywriter : '') : ''
           }
         })
         getAction('/ctop/MaterialImageInfo/list', {
@@ -1476,9 +1476,6 @@
           }
         })
 
-
-
-
         this.pans[bestIndex].list[nowIndex].videoList = this.checkVideo[0]
         this.visibleMatemal = false
         this.ipagination.current = 1

+ 4 - 4
vue.config.js

@@ -62,10 +62,10 @@ module.exports = {
         // target: 'http://192.168.1.94:8804', //请求本地 需要jeecg-boot后台项目  孙震
         // target: 'http://192.168.1.51:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.165:8848', //请求本地 需要jeecg-boot后台项目  毕洁泉
-        // target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
-        // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
-        // target: 'http://192.168.1.251:8088', //请求本地 需要jeecg-boot后台项目
-        // target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目
+        target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
+        // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
+        // target: 'http://192.168.1.251:8088', //请求本地 需要jeecg-boot后台项目 
+        // target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目 
 
 
         ws: false,