魏志佳 4 gadi atpakaļ
vecāks
revīzija
47f0a54e67

+ 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))

+ 2 - 2
src/utils/request.js

@@ -13,8 +13,8 @@ if (process.env.NODE_ENV == 'development') {
 else if (process.env.NODE_ENV == 'debug') { 
 } 
 else if (process.env.NODE_ENV == 'production') { 
-    // axios.defaults.baseURL = 'http://192.168.1.251/jeecg-boot';
-axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';
+    axios.defaults.baseURL = 'http://192.168.1.251/jeecg-boot';
+// axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';
 }
 const service = axios.create({
 //   baseURL: '/jeecg-boot', // api base_url

+ 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]
 }

+ 409 - 168
src/views/modules/BatchCreate/TouTiaoBatch.vue

@@ -16,8 +16,24 @@
         </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 +108,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 +119,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="status" 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 +252,7 @@ let typeValue='预算'
 let modifyTableCol=[
     {
         title: '广告计划',
-        dataIndex: 'advertisingPlan',
+        dataIndex: 'name',
         align: 'center',
     },
     {
@@ -225,13 +262,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' },
@@ -299,69 +342,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 = [
@@ -372,13 +417,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: 'ideaID',
@@ -473,12 +518,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,
@@ -498,31 +545,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,
@@ -537,20 +582,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.columns=planColumns;
+            this.tabkey=key;
+            this.loading=true
+            if(key=='group'){
+                 this.columns=columns;
                 let params = {};
                 this.refreshCampaignList();
-            }else if(key=='group'){
-                this.columns=columns;
+            }else if(key=='plan'){               
+                this.getplanList({})
+                this.columns=planColumns;
             }else if(key=='idea'){
                 this.columns=ideaColumns;
             }
@@ -580,14 +655,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)=>{
@@ -608,13 +696,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;
+               }
+           })
         },
 
 
@@ -632,42 +732,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('删除成功');
 
         },
@@ -690,35 +783,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
             }
         },
         //更改文字提示的父节点
@@ -738,7 +907,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)
         },
@@ -755,27 +936,83 @@ 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 {
               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) {
@@ -929,6 +1166,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);

+ 56 - 35
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,7 +494,21 @@
                         </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="EXTERNAL">不限</a-radio-button>
+                            <a-radio-button value="APP_ANDROID">自定义人群</a-radio-button>                           
+                        </a-radio-group>
+                    </a-form-item>
+                    <a-form-item label="定向逻辑" :label-col="labelCol" :wrapper-col="wrapperCol">
+                        <a-radio-group  v-model="customCrowd" button-style="solid">
+                            <a-radio-button value="EXTERNAL">定向</a-radio-button>
+                            <a-radio-button value="APP_ANDROID">排除</a-radio-button>                           
+                            <a-radio-button value="APP_ANDROID">同时定向排除</a-radio-button>                           
+                        </a-radio-group>
+                    </a-form-item> -->
+                    
+                    <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="RECOMMEND">
@@ -660,10 +674,10 @@
 
                             </a-form-item>
                         </div>
-                    <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='platformArr' @getSonValue='getNewUser' />
                     </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>
@@ -693,13 +707,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">
+                    <a-form-item label="运营商" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                        <radioCheck :checkArr='carrierArr' @getSonValue='getNewUser' />
                     </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='networkArr' @getSonValue='getNewUser' />
                     </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 +737,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 +761,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 +771,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 +1008,12 @@ export default {
             labelCol: { span: 4 },
             wrapperCol: { span: 14 },
             launchPrice:'',//手机价格
+            launchPriceArr:[],
             deviceBrandType:'',
             deviceBrand:[],//手机品牌
             deviceBrandOptions:[],
             form: this.$form.createForm(this),
-            // form:{
-            //     medialType:1,
-            //     sex:'',
-            //     launchPrice:[],//手机价格
-            // },
+            
             marks: {
                 0: '0',
                 1000: '',
@@ -1064,7 +1075,7 @@ export default {
 
             autoExtendEnabled:0,//智能放量是否开启
             autoExtendOptions,//智能投放可选定向数组
-            autoExtendTarget:[],//智能放量开启后的选择数据----------需传递的参数
+            autoExtendTargets:[],//智能放量开启后的选择数据----------需传递的参数
 
             articleCategoryOptions:[],//文章分类
             articleCategory:[],//  文章分类选中的数据-----------传递的参数
@@ -1129,7 +1140,16 @@ 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
+            }
+            formData['deviceBrand']=this.deviceBrand
+
+
+            // formData['launchPrice']=this.
+            // this.$router.push('/modules/BatchCreate/directionalPackage')
         },
         //取消按钮
         cancel(){
@@ -1137,7 +1157,8 @@ export default {
         },
         //huakuai de shijian 
         slideChange(value) {
-            this.form.launchPrice=value;
+            console.log(value)
+            this.launchPriceArr=value;
         },
         btnChange(e){
             console.log(e)
@@ -1198,8 +1219,8 @@ export default {
         //获取智能放量定向的值
         getAutoExtendEnabled(val){
             console.log(val)
-            this.autoExtendTarget=[];
-            this.autoExtendTarget.push([...val])
+            this.autoExtendTargets=[];
+            this.autoExtendTargets.push([...val])
         },
         //获取手机品牌的值
         getDeviceBrand(val){

+ 2 - 2
vue.config.js

@@ -71,9 +71,9 @@ module.exports = {
        
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.1.94:8804', //请求本地 需要jeecg-boot后台项目  孙震
-        // target: 'http://192.168.1.51:8088', //请求本地 需要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: '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后台项目