朱鑫波 4 年之前
父節點
當前提交
bbee3f1d10

+ 10 - 7
src/views/dashboard/Analysis.vue

@@ -457,14 +457,17 @@
 
 
     },
     },
     mounted() {
     mounted() {
-        //  postAction('/ctop/releaseViewRecord/check', {}).then(res => {
-        //     console.log(res)
-        //     if(res.success){
-        //        this.visible=res.showPopup;
-        //        this.versionId=res.data.id;
-        //     }
+         postAction('/ctop/releaseViewRecord/check', {}).then(res => {
+            console.log(res)
+            if(res.success){
+               this.visible=res.showPopup;
+               if(res.data){
+                this.versionId=res.data.id;
+               }
+               
+            }
            
            
-        // })
+        })
     },
     },
   }
   }
 </script>
 </script>

+ 7 - 7
src/views/modules/Statistics/KSAccountReport.vue

@@ -1284,13 +1284,13 @@ export default {
     },
     },
   },
   },
   mounted() {
   mounted() {
-    // this.accountHttp()
-    // new Promise((resolve, reject) => {
-    //   this.getEchartData('sectionChart', this.sectionOption)
-    //   resolve()
-    // }).then(()=>{
-    //   this.myChart.clear()
-    // })
+    this.accountHttp()
+    new Promise((resolve, reject) => {
+      this.getEchartData('sectionChart', this.sectionOption)
+      resolve()
+    }).then(()=>{
+      this.myChart.clear()
+    })
     
     
     postAction('/toutiao/videoReportDaily/getColumnJson', {
     postAction('/toutiao/videoReportDaily/getColumnJson', {
       columnType: 2
       columnType: 2

+ 5 - 1
src/views/modules/kuaishouapp/batchCreation/campaignList.vue

@@ -673,7 +673,11 @@ export default {
   },
   },
   methods: {
   methods: {
     newCreat() {
     newCreat() {
-      window.open('/user/new-batch', '_blank')
+      if (this.appId) {
+        window.open('/user/new-batch?accountId=' + this.appId, '_blank')
+      } else {
+        window.open('/user/new-batch', '_blank')
+      }
     },
     },
     getUnitData() {
     getUnitData() {
       this.addUser()
       this.addUser()

+ 605 - 131
src/views/modules/kuaishouapp/newBatch/index.vue

@@ -50,6 +50,15 @@ img {
     font-size: 12px;
     font-size: 12px;
   }
   }
 }
 }
+.line-height-one .ant-form-item-control {
+  line-height: inherit;
+}
+.create-info .ant-form-item-control {
+  width: 60%;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
 </style>
 </style>
 <template>
 <template>
   <div ref="questionnaireBox" class="new-batch">
   <div ref="questionnaireBox" class="new-batch">
@@ -82,7 +91,7 @@ img {
         <a-col :sm="21" :push="3" style="margin-bottom: 20px; z-index: 10" id="container">
         <a-col :sm="21" :push="3" style="margin-bottom: 20px; z-index: 10" id="container">
           <a-form :form="form" @submit="handleSubmit" layout="horizontal" v-bind="formItemLayout">
           <a-form :form="form" @submit="handleSubmit" layout="horizontal" v-bind="formItemLayout">
             <a-card class="search-box step-jump" title="创建规则">
             <a-card class="search-box step-jump" title="创建规则">
-              <a-row>
+              <a-row class="line-height-one">
                 <a-col :xl="14" :md="24">
                 <a-col :xl="14" :md="24">
                   <a-form-item label="选择广告账户">
                   <a-form-item label="选择广告账户">
                     <Treeselect :appId.sync="accountId" :multiple="false" request="2,4" ref="treeSelect" />
                     <Treeselect :appId.sync="accountId" :multiple="false" request="2,4" ref="treeSelect" />
@@ -97,13 +106,13 @@ img {
                       @change="typeChange"
                       @change="typeChange"
                       v-decorator="[
                       v-decorator="[
                         'campaignType',
                         'campaignType',
-                        { rules: [{ required: true, message: 'error:' }], initialValue: '2' },
+                        { rules: [{ required: true, message: 'error:' }], initialValue: 2 },
                       ]"
                       ]"
                     >
                     >
-                      <a-radio-button value="2">提升应用安装</a-radio-button>
-                      <a-radio-button value="3" disabled>获取电商下单</a-radio-button>
-                      <a-radio-button value="4" disabled>推广品牌活动</a-radio-button>
-                      <a-radio-button value="5">收集销售线索</a-radio-button>
+                      <a-radio-button :value="2">提升应用安装</a-radio-button>
+                      <a-radio-button :value="3" disabled>获取电商下单</a-radio-button>
+                      <a-radio-button :value="4" disabled>推广品牌活动</a-radio-button>
+                      <a-radio-button :value="5">收集销售线索</a-radio-button>
                     </a-radio-group>
                     </a-radio-group>
                   </a-form-item>
                   </a-form-item>
                 </a-col>
                 </a-col>
@@ -135,7 +144,7 @@ img {
               <a-row v-if="!getData('newClick', 'form') || getData('newClick', 'form') == '1'">
               <a-row v-if="!getData('newClick', 'form') || getData('newClick', 'form') == '1'">
                 <a-col :xl="14" :md="24">
                 <a-col :xl="14" :md="24">
                   <a-form-item label="规则配置">
                   <a-form-item label="规则配置">
-                    <a-button type="primary" @click="ruleConfigVisible = true"> 规则配置 </a-button>
+                    <a-button type="primary" @click="ruleConfigShow"> 规则配置 </a-button>
                   </a-form-item>
                   </a-form-item>
                 </a-col>
                 </a-col>
               </a-row>
               </a-row>
@@ -147,6 +156,7 @@ img {
                 </a-col>
                 </a-col>
               </a-row>
               </a-row>
             </a-card>
             </a-card>
+
             <a-card class="search-box step-jump create-info">
             <a-card class="search-box step-jump create-info">
               <div slot="title">
               <div slot="title">
                 广告组基本信息 <a-button type="primary" style="float: right" @click="showDrawer"> 编辑 </a-button>
                 广告组基本信息 <a-button type="primary" style="float: right" @click="showDrawer"> 编辑 </a-button>
@@ -232,7 +242,7 @@ img {
             <div style="display: flex; justify-content: space-between; margin-bottom: 100px">
             <div style="display: flex; justify-content: space-between; margin-bottom: 100px">
               <a-button type="primary"> 预览应用/链接 </a-button>
               <a-button type="primary"> 预览应用/链接 </a-button>
               <div>
               <div>
-                <a-button type="primary" style="margin-right: 15px"> 预览广告组 </a-button>
+                <a-button type="primary" style="margin-right: 15px" @click="handleSubmit"> 预览广告组 </a-button>
                 <a-button> 清空配置 </a-button>
                 <a-button> 清空配置 </a-button>
               </div>
               </div>
             </div>
             </div>
@@ -252,12 +262,10 @@ img {
         <a-row :gutter="16">
         <a-row :gutter="16">
           <a-col :span="16">
           <a-col :span="16">
             <a-form-item label="广告分组规则">
             <a-form-item label="广告分组规则">
-              <a-radio-group
-                v-decorator="['groupRule', { rules: [{ required: true, message: '' }], initialValue: '1' }]"
-              >
-                <a-radio-button value="1">按定向包分组</a-radio-button>
-                <a-radio-button value="2">按创意分组</a-radio-button>
-                <a-radio-button value="3" disabled>按落地页分组</a-radio-button>
+              <a-radio-group v-decorator="['groupRule', { rules: [{ required: true, message: '' }], initialValue: 1 }]">
+                <a-radio-button :value="1">按定向包分组</a-radio-button>
+                <a-radio-button :value="2">按创意分组</a-radio-button>
+                <a-radio-button :value="3" disabled>按落地页分组</a-radio-button>
               </a-radio-group>
               </a-radio-group>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
@@ -294,15 +302,18 @@ img {
           <a-col :span="16">
           <a-col :span="16">
             <a-form-item label="计划默认状态">
             <a-form-item label="计划默认状态">
               <a-radio-group
               <a-radio-group
-                v-decorator="['campaignStatus', { rules: [{ required: true, message: '' }], initialValue: '0' }]"
+                v-decorator="['campaignStatus', { rules: [{ required: true, message: '' }], initialValue: 0 }]"
               >
               >
-                <a-radio-button value="1">开启</a-radio-button>
-                <a-radio-button value="0">关闭</a-radio-button>
+                <a-radio-button :value="1">开启</a-radio-button>
+                <a-radio-button :value="0">关闭</a-radio-button>
               </a-radio-group>
               </a-radio-group>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
         </a-row>
         </a-row>
-        <a-row :gutter="16" v-if="!getData('status', 'ruleConfigForm') || getData('status', 'ruleConfigForm') == '2'">
+        <a-row
+          :gutter="16"
+          v-if="!getData('campaignStatus', 'ruleConfigForm') || getData('campaignStatus', 'ruleConfigForm') == 0"
+        >
           <a-col :span="16">
           <a-col :span="16">
             <a-form-item label="是否定时开始计划">
             <a-form-item label="是否定时开始计划">
               <a-radio-group v-decorator="['isTime', { rules: [{ required: true, message: '' }], initialValue: '2' }]">
               <a-radio-group v-decorator="['isTime', { rules: [{ required: true, message: '' }], initialValue: '2' }]">
@@ -327,10 +338,10 @@ img {
           <a-col :span="16">
           <a-col :span="16">
             <a-form-item label="广告组默认状态">
             <a-form-item label="广告组默认状态">
               <a-radio-group
               <a-radio-group
-                v-decorator="['unitStatus', { rules: [{ required: true, message: '' }], initialValue: '1' }]"
+                v-decorator="['unitStatus', { rules: [{ required: true, message: '' }], initialValue: 1 }]"
               >
               >
-                <a-radio-button value="1">开启</a-radio-button>
-                <a-radio-button value="2">关闭</a-radio-button>
+                <a-radio-button :value="1">开启</a-radio-button>
+                <a-radio-button :value="2">关闭</a-radio-button>
               </a-radio-group>
               </a-radio-group>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
@@ -382,128 +393,332 @@ img {
     <!-- 规则配置结束 -->
     <!-- 规则配置结束 -->
 
 
     <!-- 广告组基本信息预设 -->
     <!-- 广告组基本信息预设 -->
-    <a-drawer
-      title="广告组基本信息"
-      :width="720"
-      :visible="visible"
-      :body-style="{ paddingBottom: '80px' }"
-      @close="onClose"
-    >
-      <a-form :form="formUnit" layout="vertical" hide-required-mark>
+    <a-drawer :width="720" :visible="visible" :body-style="{ paddingBottom: '80px' }" @close="onClose">
+      <h2 slot="title" style="margin-bottom: 0">广告组基本信息</h2>
+      <!-- class="create-info" -->
+      <a-form-model ref="ruleForm" :model="unitInfo" v-bind="formItemLayout" :rules="rules" :hideRequiredMark="true">
         <a-row :gutter="16">
         <a-row :gutter="16">
-          <a-col :span="12">
-            <a-form-item label="Name">
-              <a-input
-                v-decorator="[
-                  'name',
-                  {
-                    rules: [{ required: true, message: 'Please enter user name' }],
-                  },
-                ]"
-                placeholder="Please enter user name"
-              />
-            </a-form-item>
+          <a-col :span="16">
+            <a-form-model-item label="投放范围">
+              <a-radio-group v-model="allianceAccount" @change="LOLchange">
+                <a-radio-button value="1">默认</a-radio-button>
+                <a-radio-button value="2">快手广告联盟</a-radio-button>
+              </a-radio-group>
+            </a-form-model-item>
           </a-col>
           </a-col>
-          <a-col :span="12">
-            <a-form-item label="Url">
-              <a-input
-                v-decorator="[
-                  'url',
-                  {
-                    rules: [{ required: true, message: 'please enter url' }],
-                  },
-                ]"
+        </a-row>
+        <a-row :gutter="16">
+          <a-col :span="16">
+            <a-form-model-item label="" v-bind="tailFormItemLayout">
+              <a-checkbox v-model="unitInfo.useAppMarket" @change="appStoreCheck"> 优先从系统应用商店下载 </a-checkbox>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="16">
+          <a-col :span="16">
+            <a-form-model-item label="" :wrapperCol="{ span: 24, offset: 5 }" v-if="unitInfo.useAppMarket">
+              <a-checkbox-group v-model="unitInfo.appStore">
+                <a-checkbox value="huawei">华为</a-checkbox>
+                <a-checkbox value="oppo">OPPO</a-checkbox>
+                <a-checkbox value="vivo">VIVO</a-checkbox>
+                <a-checkbox value="xiaomi">小米</a-checkbox>
+                <a-checkbox value="meizu">魅族</a-checkbox>
+                <a-checkbox value="smartisan">锤子</a-checkbox>
+              </a-checkbox-group>
+              <br />
+              请勾选投放应用已上架的应用商店(默认全选)
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="16">
+          <a-col :span="16">
+            <a-form-model-item label="转化目标">
+              <a-button type="primary" style="margin-right: 15px"> 选择转化目标 </a-button>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <h2 style="margin: 20px 0 10px 0">预算与出价</h2>
+        <a-row :gutter="16">
+          <a-col :span="16">
+            <a-form-model-item label="单日预算">
+              <a-radio-group v-model="dayBudgetType" @change="unitInfo.dayBudget = null">
+                <a-radio-button value="1">不限</a-radio-button>
+                <a-radio-button value="2">统一预算</a-radio-button>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="16" v-if="dayBudgetType == '2'">
+          <a-col :span="16">
+            <a-form-model-item label="" :wrapperCol="{ span: 24, offset: 5 }" prop="dayBudget">
+              <a-input-number
+                v-model="unitInfo.dayBudget"
                 style="width: 100%"
                 style="width: 100%"
-                addon-before="http://"
-                addon-after=".com"
-                placeholder="please enter url"
+                placeholder="不小于500, 不超过100000000,仅支持输入自然数"
               />
               />
-            </a-form-item>
+            </a-form-model-item>
           </a-col>
           </a-col>
         </a-row>
         </a-row>
         <a-row :gutter="16">
         <a-row :gutter="16">
-          <a-col :span="12">
-            <a-form-item label="Owner">
-              <a-select
-                v-decorator="[
-                  'owner',
-                  {
-                    rules: [{ required: true, message: 'Please select an owner' }],
-                  },
+          <a-col :span="16">
+            <a-form-model-item label="投放方式" prop="speed">
+              <a-radio-group v-model="unitInfo.speed">
+                <a-radio-button value="1">快速投放</a-radio-button>
+                <a-radio-button value="2">平滑投放</a-radio-button>
+                <a-radio-button value="3">优先低成本</a-radio-button>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="16">
+          <a-col :span="16">
+            <a-form-model-item label="排期">
+              <a-radio-group v-model="unitTime" @change="setTime">
+                <a-radio-button value="1">从今天开始长期投放</a-radio-button>
+                <a-radio-button value="2">设置开始和结束日期</a-radio-button>
+              </a-radio-group>
+              <br />
+              <a-range-picker
+                v-if="unitTime == '2'"
+                v-model="unitInfo.timeRange"
+                format="YYYY-MM-DD"
+                :allowClear="false"
+                :disabled-date="disabledDate"
+              />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="16">
+          <a-col :span="16">
+            <a-form-model-item label="投放时段">
+              <a-radio-group v-model="scheduleTime" @change="setTimeAll">
+                <a-radio-button value="1">全天</a-radio-button>
+                <a-radio-button value="2">特定时间</a-radio-button>
+              </a-radio-group>
+              <br />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="16" v-if="scheduleTime == '2'">
+          <a-col :span="24">
+            <a-form-model-item label="" :wrapperCol="{ span: 24 }">
+              <selectCheckAll style="width: 100%" :scheduleTime.sync="unitInfo.scheduleTime" ref="selectCheck" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="16">
+          <a-col :span="16">
+            <a-form-model-item label="创意展现方式">
+              <a-radio-group v-model="unitInfo.showMode">
+                <a-radio-button value="2">智能优选</a-radio-button>
+                <a-radio-button value="1">随机轮播</a-radio-button>
+              </a-radio-group>
+              <br />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="16" v-if="allianceAccount == '1'">
+          <a-col :span="24" :pull="2" style="margin-left: 15px">
+            <a-form-model-item
+              label="场景广告位"
+              :labelCol="{ lg: { span: 5 }, sm: { span: 5 } }"
+              :wrapperCol="{ lg: { span: 19 }, sm: { span: 19 } }"
+            >
+              <checkBoxGroup
+                :options="[
+                  { label: '优选广告位', value: 1 },
+                  { label: '信息流广告', value: 7 },
+                  { label: '上下滑大屏广告', value: 6 },
+                  { label: '视频播放页广告', value: 3 },
                 ]"
                 ]"
-                placeholder="Please a-s an owner"
-              >
-                <a-select-option value="xiao"> Xiaoxiao Fu </a-select-option>
-                <a-select-option value="mao"> Maomao Zhou </a-select-option>
+                v-model="unitInfo.sceneId"
+                @change="changeData"
+              />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+
+        <h2 style="margin: 20px 0 10px 0">优化目标和计费</h2>
+        <a-row :gutter="16">
+          <a-col :span="16">
+            <a-form-model-item label="优化目标">
+              <a-radio-group v-model="unitInfo.bidType" @change="bidTypeChange">
+                <a-radio-button :value="1">封面点击数</a-radio-button>
+                <a-radio-button :value="10">转化数</a-radio-button>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+
+        <a-row :gutter="16" v-if="unitInfo.bidType == 10 && groupTypeData">
+          <a-col :span="16">
+            <a-form-model-item label="转化目标">
+              <a-select v-model="unitInfo.ocpxActionType">
+                <a-select-option :value="2">行为数</a-select-option>
+                <a-select-option :value="180" v-if="groupTypeData.isActivate == '1'">激活</a-select-option>
+                <a-select-option :value="53" v-if="groupTypeData.isFormSubmit == '1'">表单提交</a-select-option>
+                <a-select-option :value="394" v-if="groupTypeData.isOrderSubmit == '1'">订单提交</a-select-option>
+                <a-select-option :value="348" v-if="groupTypeData.isValidClue == '1'">使用有效线索</a-select-option>
+                <a-select-option :value="383" v-if="groupTypeData.isCreditGrant == '1'">授信出价</a-select-option>
+                <a-select-option :value="384" v-if="groupTypeData.isWanJian == '1'">完件出价</a-select-option>
+                <a-select-option :value="190" v-if="groupTypeData.isPurchase == '1'">付费出价</a-select-option>
+                <a-select-option :value="191" v-if="groupTypeData.isFirstdayRoi == '1'">首日ROI</a-select-option>
+                <a-select-option :value="396" v-if="groupTypeData.isRegister == '1'">注册优化目标</a-select-option>
               </a-select>
               </a-select>
-            </a-form-item>
+            </a-form-model-item>
           </a-col>
           </a-col>
-          <a-col :span="12">
-            <a-form-item label="Type">
-              <a-select
-                v-decorator="[
-                  'type',
-                  {
-                    rules: [{ required: true, message: 'Please choose the type' }],
-                  },
-                ]"
-                placeholder="Please choose the type"
-              >
-                <a-select-option value="private"> Private </a-select-option>
-                <a-select-option value="public"> Public </a-select-option>
+        </a-row>
+
+        <a-row
+          :gutter="16"
+          v-if="
+            groupTypeData &&
+            (unitInfo.ocpxActionType == 180 || unitInfo.ocpxActionType == 53) &&
+            groupTypeData.deepConversionTypes.length > 0
+          "
+        >
+          <a-col :span="16">
+            <a-form-model-item label="深度转化目标">
+              <a-select v-model="unitInfo.deepConversionType" allowClear>
+                <a-select-option
+                  :value="items.deepConversionType"
+                  v-for="(items, index) of groupTypeData.deepConversionTypes"
+                  :key="index"
+                >
+                  {{ items.desc }}</a-select-option
+                >
               </a-select>
               </a-select>
-            </a-form-item>
+            </a-form-model-item>
           </a-col>
           </a-col>
         </a-row>
         </a-row>
         <a-row :gutter="16">
         <a-row :gutter="16">
-          <a-col :span="12">
-            <a-form-item label="Approver">
-              <a-select
-                v-decorator="[
-                  'approver',
-                  {
-                    rules: [{ required: true, message: 'Please choose the approver' }],
-                  },
-                ]"
-                placeholder="Please choose the approver"
+          <a-col :span="16">
+            <a-form-model-item label="计费方式">
+              <a-radio default-checked>{{ unitInfo.bidType == 1 ? '点击计费' : '展示计费(oCPM)' }}</a-radio>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="16">
+          <a-col :span="16">
+            <a-form-model-item label="出价方式">
+              <a-radio-group
+                v-model="unitInfo.templateBidType"
+                @change="
+                  unitInfo.bidMin = null
+                  unitInfo.bidMax = null
+                "
               >
               >
-                <a-select-option value="jack"> Jack Ma </a-select-option>
-                <a-select-option value="tom"> Tom Liu </a-select-option>
-              </a-select>
-            </a-form-item>
+                <a-radio-button :value="1">固定出价</a-radio-button>
+                <a-radio-button :value="10">随机出价</a-radio-button>
+              </a-radio-group>
+            </a-form-model-item>
           </a-col>
           </a-col>
-          <a-col :span="12">
-            <a-form-item label="DateTime">
-              <a-date-picker
-                v-decorator="[
-                  'dateTime',
-                  {
-                    rules: [{ required: true, message: 'Please choose the dateTime' }],
-                  },
-                ]"
-                style="width: 100%"
-                :get-popup-container="(trigger) => trigger.parentNode"
-              />
+        </a-row>
+
+        <div v-if="unitInfo.bidType == 10">
+          <div v-if="unitInfo.templateBidType == 1">
+            <a-row :gutter="16">
+              <a-col :span="16">
+                <a-form-model-item label="转化目标出价" prop="cpaBid">
+                  <a-input-number v-model="unitInfo.cpaBid" style="width: 90%" />元
+                </a-form-model-item>
+              </a-col>
+            </a-row>
+            <a-row
+              :gutter="16"
+              v-if="
+                groupTypeData &&
+                (unitInfo.ocpxActionType == 180 || unitInfo.ocpxActionType == 53) &&
+                groupTypeData.deepConversionTypes.length > 0 &&
+                items.deepConversionType
+              "
+            >
+              <a-col :span="16">
+                <a-form-model-item label="深度转化目标出价">
+                  <a-input-number v-model="unitInfo.deepConversionBid" style="width: 90%" />元
+                </a-form-model-item>
+              </a-col>
+            </a-row>
+          </div>
+          <div v-else>
+            <a-row :gutter="16">
+              <a-col :span="16">
+                <a-form-model-item
+                  label="出价范围"
+                  prop="bidMin"
+                  :labelCol="{ lg: { span: 5 }, sm: { span: 5 } }"
+                  :wrapperCol="{ lg: { span: 6 }, sm: { span: 6 } }"
+                >
+                  <a-input-number v-model="unitInfo.bidMin" style="width: 60%" @change="changeBidMin" />
+                </a-form-model-item>
+              </a-col>
+              <a-col :span="2" :pull="10" style="position: relative; right: 280px; top: 8px">~</a-col>
+              <a-col :span="6" :pull="11">
+                <a-form-model-item label="" prop="bidMax">
+                  <a-input-number v-model="unitInfo.bidMax" style="width: 53.3%" @change="changeBidMax" />
+                </a-form-model-item>
+              </a-col>
+            </a-row>
+          </div>
+        </div>
+
+        <div v-else-if="unitInfo.bidType == 1">
+          <div v-if="unitInfo.templateBidType == 1">
+            <a-row :gutter="16">
+              <a-col :span="16">
+                <a-form-model-item label="转化目标出价" prop="bid">
+                  <a-input-number v-model="unitInfo.bid" style="width: 90%" />元
+                </a-form-model-item>
+              </a-col>
+            </a-row>
+          </div>
+          <div v-else>
+            <a-row :gutter="16">
+              <a-col :span="16">
+                <a-form-model-item
+                  label="出价范围"
+                  prop="bidMin"
+                  :labelCol="{ lg: { span: 5 }, sm: { span: 5 } }"
+                  :wrapperCol="{ lg: { span: 6 }, sm: { span: 6 } }"
+                >
+                  <a-input-number v-model="unitInfo.bidMin" style="width: 60%" @change="changeBidMin" />
+                </a-form-model-item>
+              </a-col>
+              <a-col :span="2" :pull="10" style="position: relative; right: 280px; top: 8px">~</a-col>
+              <a-col :span="6" :pull="11">
+                <a-form-model-item label="" prop="bidMax">
+                  <a-input-number v-model="unitInfo.bidMax" style="width: 53.3%" @change="changeBidMax" />
+                </a-form-model-item>
+              </a-col>
+            </a-row>
+          </div>
+        </div>
+        <a-row :gutter="16">
+          <a-col :span="16">
+            <a-form-model-item label="广告组名称" prop="unitName">
+              <a-input v-model="unitInfo.unitName" style="width: 90%" id="unitName" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="16">
+          <a-col :span="16">
+            <a-form-item label="" v-bind="tailFormItemLayout">
+              <a-tag color="#2db7f5" @click="getChangeAll('渠道号(应用标记)', 'unitInfo', 'unitName')"
+                >+渠道号(应用标记)</a-tag
+              >
+              <a-tag color="#2db7f5" @click="getChangeAll('定向包', 'unitInfo', 'unitName')">+定向包</a-tag>
+              <a-tag color="#2db7f5" @click="getChangeAll('日期', 'unitInfo', 'unitName')">+日期</a-tag>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
         </a-row>
         </a-row>
         <a-row :gutter="16">
         <a-row :gutter="16">
-          <a-col :span="24">
-            <a-form-item label="Description">
-              <a-textarea
-                v-decorator="[
-                  'description',
-                  {
-                    rules: [{ required: true, message: 'Please enter url description' }],
-                  },
-                ]"
-                :rows="4"
-                placeholder="please enter url description"
-              />
+          <a-col :span="16">
+            <a-form-item label="" v-bind="tailFormItemLayout">
+              <a-checkbox value="1" v-model="keep"> 存为预设 </a-checkbox>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
         </a-row>
         </a-row>
-      </a-form>
+      </a-form-model>
       <div
       <div
         :style="{
         :style="{
           position: 'absolute',
           position: 'absolute',
@@ -521,6 +736,9 @@ img {
         <a-button type="primary" @click="onClose"> Submit </a-button>
         <a-button type="primary" @click="onClose"> Submit </a-button>
       </div>
       </div>
     </a-drawer>
     </a-drawer>
+    <!-- 广告组基本信息预设结束 -->
+
+
   </div>
   </div>
 </template>
 </template>
 
 
@@ -528,9 +746,12 @@ img {
 //   import UserMenu from '../tools/UserMenu'
 //   import UserMenu from '../tools/UserMenu'
 //   import SMenu from '../menu/'
 //   import SMenu from '../menu/'
 import Logo from '@/components/tools/Logo.vue'
 import Logo from '@/components/tools/Logo.vue'
-
+import pick from 'lodash.pick'
 import { mixin } from '@/utils/mixin.js'
 import { mixin } from '@/utils/mixin.js'
 import Treeselect from '@/views/modules/Statistics/components/Treeselect.vue'
 import Treeselect from '@/views/modules/Statistics/components/Treeselect.vue'
+import moment from 'moment'
+import selectCheckAll from '@/components/formComponents/toutiaoTime'
+import checkBoxGroup from '@/components/formComponents/checkBoxGroup'
 export default {
 export default {
   name: 'GlobalHeader',
   name: 'GlobalHeader',
   components: {
   components: {
@@ -538,6 +759,8 @@ export default {
     //   SMenu,
     //   SMenu,
     Logo,
     Logo,
     Treeselect,
     Treeselect,
+    selectCheckAll,
+    checkBoxGroup,
   },
   },
   mixins: [mixin],
   mixins: [mixin],
   props: {
   props: {
@@ -580,6 +803,45 @@ export default {
         topSmenuStyle: {},
         topSmenuStyle: {},
       },
       },
       activeStep: 0,
       activeStep: 0,
+      campaignData: {},
+      //组相关
+      unitInfo: {
+        useAppMarket: false,
+        appStore: [],
+        dayBudget: null,
+        speed: '1',
+        timeRange: [moment().startOf('day'), moment().add(1, 'months')],
+        scheduleTime: '',
+        showMode: '2',
+        sceneId: [1],
+        bidType: 10,
+        ocpxActionType: 2,
+        deepConversionType: null,
+        templateBidType: 1,
+        cpaBid: null,
+        bid: null,
+        deepConversionBid: null,
+        bidMax: null,
+        bidMin: null,
+        unitName: '',
+        // 'huawei', 'oppo', 'vivo', 'xiaomi', 'meizu', 'smartisan'
+      },
+      allianceAccount: '1',
+      dayBudgetType: '1',
+      unitTime: '1',
+      scheduleTime: '1',
+      rules: {
+        dayBudget: [{ required: true, trigger: 'change', validator: this.handleConfirmValue }],
+        unitName: [{ required: true, message: '广告组名称必填', trigger: 'change' }],
+        cpaBid: [{ required: true, message: '出价必填', trigger: 'change' }],
+        bid: [{ required: true, message: '出价必填', trigger: 'change' }],
+        bidMax: [{ required: true, trigger: 'change', validator: this.maxValue }],
+        bidMin: [{ required: true, trigger: 'change', validator: this.minValue }],
+      },
+      groupTypeData: null, //加白
+      keep: false,
+      //组相关结束
+
       stepsArr: [
       stepsArr: [
         { title: '创建规则' },
         { title: '创建规则' },
         { title: '广告组基本信息' },
         { title: '广告组基本信息' },
@@ -603,11 +865,17 @@ export default {
       },
       },
     }
     }
   },
   },
-  watch: {},
-  //update-end--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
+  watch: {
+    accountId: function (n, o) {
+      if (n != '') {
+        this.getCampaignTemplate(n)
+      }
+    },
+  },
   mounted() {
   mounted() {
     console.log(this.$route.query)
     console.log(this.$route.query)
     if (this.$route.query.accountId) {
     if (this.$route.query.accountId) {
+      this.accountId = this.$route.query.accountId
     } else {
     } else {
     }
     }
     this.$nextTick(function () {
     this.$nextTick(function () {
@@ -623,6 +891,14 @@ export default {
     })
     })
   },
   },
   methods: {
   methods: {
+    checkAccountId() {
+      if (this.accountId == '') {
+        this.$message.warning('请先选择广告投放账号')
+        return false
+      } else {
+        return true
+      }
+    },
     //rules
     //rules
     handleConfirmValue(rule, value, callback) {
     handleConfirmValue(rule, value, callback) {
       if (value == '' || value < 500 || value >= 100000000) {
       if (value == '' || value < 500 || value >= 100000000) {
@@ -630,8 +906,38 @@ export default {
       }
       }
       callback()
       callback()
     },
     },
-
-    handleSubmit(e) {},
+    maxValue(rule, value, callback) {
+      if (value == '' || value == null) {
+        callback('请输入最高出价')
+      } else if (this.unitInfo.bidMin && value < this.unitInfo.bidMin) {
+        callback('最高出价不能小于最低出价')
+      } else {
+        callback()
+      }
+    },
+    minValue(rule, value, callback) {
+      if (value == '' || value == null) {
+        callback('请输入最低出价')
+      } else if (this.unitInfo.bidMax && value > this.unitInfo.bidMax) {
+        callback('最低出价不能大于最高出价')
+      } else {
+        callback()
+      }
+    },
+    changeBidMin() {
+      if (this.unitInfo.bidMax != '' && this.unitInfo.bidMax != null) {
+        this.$refs.ruleForm.validateField('bidMax')
+      }
+    },
+    changeBidMax() {
+      if (this.unitInfo.bidMin != '' && this.unitInfo.bidMin != null) {
+        this.$refs.ruleForm.validateField('bidMin')
+      }
+    },
+    handleSubmit(e) {
+      e.preventDefault()
+      this.form.validateFields((err, values) => {})
+    },
 
 
     typeChange() {},
     typeChange() {},
     onChange(link) {
     onChange(link) {
@@ -639,10 +945,53 @@ export default {
     },
     },
 
 
     showDrawer() {
     showDrawer() {
-      this.visible = true
+      if (this.checkAccountId()) {
+        this.visible = true
+        this.getAction('/kuaishou/batch/getIsActivate', {
+          accountId: this.accountId,
+        }).then((res) => {
+          if (res.success) {
+            this.groupTypeData = res.result
+          }
+        })
+      }
     },
     },
     onClose() {
     onClose() {
-      this.visible = false
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          console.log(this.unitInfo)
+
+          var str = ''
+          for (let i = 0; i < 7 * 24; i++) {
+            str += '0'
+          }
+          var params = { ...this.unitInfo }
+          params.accountId = this.accountId
+          params.sceneId = this.allianceAccount == '1' ? JSON.stringify(this.unitInfo.sceneId) : JSON.stringify([5])
+          params.dayBudget = this.dayBudgetType == '1' ? null : this.unitInfo.dayBudget * 1000
+          params.beginTime = moment(this.unitInfo.timeRange[0]).format('YYYY-MM-DD')
+          params.endTime = this.unitTime == '2' ? moment(this.unitInfo.timeRange[1]).format('YYYY-MM-DD') : null
+          params.scheduleTime = this.scheduleTime == '2' ? this.unitInfo.scheduleTime : str
+          params.useAppMarket = this.unitInfo.useAppMarket ? 1 : 0
+          params.appStore = this.unitInfo.useAppMarket ? JSON.stringify(this.unitInfo.appStore) : null
+
+          params.cpaBid = this.unitInfo.cpaBid ? this.unitInfo.cpaBid * 1000 : null
+          params.bid = this.unitInfo.bid ? this.unitInfo.bid * 1000 : null
+          params.bidMax = this.unitInfo.bidMax ? this.unitInfo.bidMax * 1000 : null
+          params.bidMin = this.unitInfo.bidMin ? this.unitInfo.bidMin * 1000 : null
+
+          //      allianceAccount: '1',
+          // dayBudgetType: '1',
+          // unitTime: '1',
+          // scheduleTime: '1',
+          this.postDataAction('/template/kuaiShouBatchGroupTemplate/saveOrUpdate', params).then((res) => {
+            console.log(res)
+          })
+        } else { 
+          console.log('error submit!!')
+          return false
+        }
+      })
     },
     },
 
 
     onChange(value, dateString) {
     onChange(value, dateString) {
@@ -652,15 +1001,75 @@ export default {
     onOk(value) {
     onOk(value) {
       console.log('onOk: ', value)
       console.log('onOk: ', value)
     },
     },
-    ruleConfigFormOk() {},
+    getCampaignTemplate(accountId) {
+      this.getAction('/template/kuaiShouBatchCampaignTemplate/getCampaignTemplate', {
+        accountId: accountId,
+      }).then((res) => {
+        console.log(res)
+        this.campaignData = res.result
+        if (this.campaignData.timeStart) {
+          this.campaignData.timeStart = moment(this.campaignData.timeStart)
+        }
+        if (this.campaignData.dayBudget) {
+          this.campaignData.budgetType = '2'
+          this.campaignData.dayBudget = res.result.dayBudget / 1000
+        }
+        var that = this
+        setTimeout(() => {
+          var mdl = Object.assign({}, that.campaignData)
+          that.$nextTick(() => {
+            that.form.setFieldsValue(pick(mdl, ['campaignType']))
+          })
+        })
+      })
+    },
+    ruleConfigFormOk(e) {
+      this.ruleConfigForm.validateFields((err, values) => {
+        if (!err) {
+          console.log('Received values of form: ', values)
+          var params = { ...values }
+          params.id = this.campaignData.id ? this.campaignData.id : null
+          params.accountId = this.accountId
+          params.systemType = this.getData('systemType', 'form')
+          params.campaignType = this.getData('campaignType', 'form')
+          params.dayBudget = values.dayBudget ? values.dayBudget * 1000 : null
+          params.timeStart = values.timeStart ? moment(values.timeStart).format('YYYY-MM-DD hh:mm:ss') : null
+          this.postDataAction('/template/kuaiShouBatchCampaignTemplate/saveOrUpdate', params).then((res) => {
+            console.log(res)
+          })
+        }
+      })
+    },
+    ruleConfigShow() {
+      if (this.checkAccountId()) {
+        this.ruleConfigVisible = true
+        var that = this
+
+        setTimeout(() => {
+          var mdl = Object.assign({}, that.campaignData)
+          console.log(mdl)
+          that.$nextTick(() => {
+            that.ruleConfigForm.setFieldsValue(
+              pick(mdl, ['budgetType', 'campaignName', 'campaignStatus', 'groupRule', 'isTime', 'keep', 'unitStatus'])
+            )
+            setTimeout(() => {
+              if (that.campaignData.isTime == '1') {
+                that.ruleConfigForm.setFieldsValue(pick(mdl, 'timeStart'))
+              }
+              if (that.campaignData.budgetType == '2') {
+                that.ruleConfigForm.setFieldsValue(pick(mdl, 'dayBudget'))
+              }
+            }, 100)
+          })
+        })
+      }
+    },
     ruleConfigFormCancel() {
     ruleConfigFormCancel() {
       this.ruleConfigVisible = false
       this.ruleConfigVisible = false
       this.ruleConfigForm.resetFields()
       this.ruleConfigForm.resetFields()
     },
     },
     getChangeAll(type, form, field) {
     getChangeAll(type, form, field) {
       var node = document.getElementById(field)
       var node = document.getElementById(field)
-
-      console.log(node)
       var v = '{{' + type + '}}-'
       var v = '{{' + type + '}}-'
       if (document.selection) {
       if (document.selection) {
         //IE
         //IE
@@ -670,6 +1079,9 @@ export default {
         sel.select()
         sel.select()
         if (field == 'campaignName') {
         if (field == 'campaignName') {
           this[form].setFieldsValue({ campaignName: sel.text })
           this[form].setFieldsValue({ campaignName: sel.text })
+        } else if (field == 'unitName') {
+          this.unitInfo.unitName = sel.text
+          this.$refs.ruleForm.validateField('unitName')
         }
         }
       } else if (node.selectionStart || node.selectionStart == '0') {
       } else if (node.selectionStart || node.selectionStart == '0') {
         //MOZILLA/GOOGLE
         //MOZILLA/GOOGLE
@@ -682,6 +1094,9 @@ export default {
         }
         }
         if (field == 'campaignName') {
         if (field == 'campaignName') {
           this[form].setFieldsValue({ campaignName: node.value })
           this[form].setFieldsValue({ campaignName: node.value })
+        } else if (field == 'unitName') {
+          this.unitInfo.unitName = node.value
+          this.$refs.ruleForm.validateField('unitName')
         }
         }
         node.focus()
         node.focus()
         node.selectionStart = startPos + v.length
         node.selectionStart = startPos + v.length
@@ -693,12 +1108,72 @@ export default {
         console.log(node.value)
         console.log(node.value)
         if (field == 'campaignName') {
         if (field == 'campaignName') {
           this[form].setFieldsValue({ campaignName: node.value })
           this[form].setFieldsValue({ campaignName: node.value })
+        } else if (field == 'unitName') {
+          this.unitInfo.unitName = node.value
+          this.$refs.ruleForm.validateField('unitName')
         }
         }
         node.focus()
         node.focus()
         // this.campaignName = node.value
         // this.campaignName = node.value
       }
       }
     },
     },
 
 
+    appStoreCheck(value) {
+      console.log(value.target.checked)
+      if (value.target.checked) {
+        this.unitInfo.appStore = ['huawei', 'oppo', 'vivo', 'xiaomi', 'meizu', 'smartisan']
+      } else {
+        this.unitInfo.appStore = []
+      }
+    },
+    LOLchange(value) {
+      if (value.target.value == '2') {
+        this.unitInfo.sceneId = [5]
+      } else {
+        this.unitInfo.sceneId = [1]
+      }
+    },
+    bidTypeChange(value) {
+      if (value.target.value == 10) {
+        this.unitInfo.ocpxActionType = 2
+        this.unitInfo.bid = null
+      } else {
+        this.unitInfo.ocpxActionType = null
+        this.unitInfo.cpaBid = null
+        this.unitInfo.deepConversionBid = null
+      }
+    },
+    setTime(e) {
+      if (e.target.value == '2') {
+        this.unitInfo.timeRange[0] = moment().startOf('day')
+        this.unitInfo.timeRange[1] = moment().add(1, 'months')
+      }
+    },
+    setTimeAll(e) {
+      //   console.log(moment('2019-12-27'))
+      if (e.target.value == '2') {
+        this.$nextTick(() => {
+          this.$refs.selectCheck.init()
+        })
+      } else {
+      }
+    },
+
+    changeData(data) {
+      if (data.length > 1 && data.findIndex((item) => item == 1) == 0) {
+        data.splice(
+          data.findIndex((item) => item == 1),
+          1
+        )
+      } else if (data.length > 1 && data.findIndex((item) => item == 1) == data.length - 1) {
+        data.splice(0, data.length - 1)
+      } else if (data.length == 0) {
+        data.push(1)
+      }
+    },
+    disabledDate(current) {
+      // Can not select days before today and today
+      return current && current < moment().subtract(1, 'days')
+    },
     onScroll() {
     onScroll() {
       // var box = document.getElementById('box')
       // var box = document.getElementById('box')
       // var t = document.documentElement.scrollTop || document.body.scrollTop
       // var t = document.documentElement.scrollTop || document.body.scrollTop
@@ -707,7 +1182,6 @@ export default {
       var jump = document.querySelectorAll('.step-jump')
       var jump = document.querySelectorAll('.step-jump')
       var distance =
       var distance =
         document.documentElement.scrollTop + 180 || window.pageYOffset + 180 || document.body.scrollTop + 180
         document.documentElement.scrollTop + 180 || window.pageYOffset + 180 || document.body.scrollTop + 180
-      console.log(distance)
       jump.forEach((item, index) => {
       jump.forEach((item, index) => {
         if (distance >= item.offsetTop) {
         if (distance >= item.offsetTop) {
           this.activeStep = index
           this.activeStep = index