Browse Source

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-vue

魏志佳 4 years ago
parent
commit
80afd363be

+ 54 - 13
src/views/modules/advertiser/ProjectList.vue

@@ -22,9 +22,7 @@
                 placeholder="请选择广告主名称"
               >
                 <a-select-option :value="item.id" v-for="(item, index) of list" :key="index">
-                  {{
-                  item.name
-                  }}
+                  {{ item.name }}
                 </a-select-option>
               </a-select>
             </a-form-item>
@@ -47,7 +45,8 @@
                     v-for="appModel in options"
                     :key="appModel.userId + new Date().getTime()"
                     :value="appModel.userId"
-                  >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option>
+                    >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option
+                  >
                 </a-select>
               </a-form-item>
             </a-col>
@@ -70,7 +69,8 @@
                     v-for="appModel in options"
                     :key="appModel.userId + new Date().getTime()"
                     :value="appModel.userId"
-                  >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option>
+                    >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option
+                  >
                 </a-select>
               </a-form-item>
             </a-col>
@@ -88,14 +88,9 @@
             </a-col>
           </template>
           <a-col :md="6" :sm="8">
-            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+            <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-              <a-button
-                type="primary"
-                @click="searchReset"
-                icon="reload"
-                style="margin-left: 8px"
-              >重置</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
               <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
                 {{ toggleSearchStatus ? '收起' : '展开' }}
                 <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
@@ -127,7 +122,12 @@
       >
         <span slot="maxBid" slot-scope="text">{{ text / 1000 }}</span>
         <span slot="maxDeepCpaBid" slot-scope="text">{{ text / 1000 }}</span>
-
+        <span slot="ocpxActionType" slot-scope="text">
+          {{ text | ocpxActionType }}
+        </span>
+        <span slot="bidType" slot-scope="text">
+          {{ text | bidType }}
+        </span>
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
@@ -191,6 +191,22 @@ export default {
           },
         },
         {
+          title: '优化目标',
+          align: 'center',
+          dataIndex: 'bidType',
+          scopedSlots: {
+            customRender: 'bidType',
+          },
+        },
+        {
+          title: '转化目标',
+          align: 'center',
+          dataIndex: 'ocpxActionType',
+          scopedSlots: {
+            customRender: 'ocpxActionType',
+          },
+        },
+        {
           title: '供应商',
           align: 'center',
           dataIndex: 'supplierCode_dictText',
@@ -230,6 +246,31 @@ export default {
       options: [],
     }
   },
+  filters: {
+    bidType(sta) {
+      var data = {
+        null: '-',
+        1: 'CPM',
+        2: 'CPC',
+        6: 'OCPC',
+        10: 'OCPM',
+      }
+      return data[sta]
+    },
+    ocpxActionType(sta) {
+      var data = {
+        null: '-',
+        0: '封面点击',
+        2: '行为数',
+        10: '曝光',
+        11: '点击',
+        31: '下载完成',
+        53: '提交线索',
+        180: '激活',
+      }
+      return data[sta]
+    },
+  },
   computed: {
     importExcelUrl: function () {
       return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`

+ 55 - 29
src/views/modules/advertiser/modules/projectListModal.vue

@@ -18,8 +18,8 @@
             <a-radio-button value="4">快手内广</a-radio-button>
           </a-radio-group>
         </a-form-item> -->
-        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="项目名称" >
-          <a-input placeholder="请输入项目名称" v-decorator="['projectName', validatorRules.projectName]" disabled/>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="项目名称">
+          <a-input placeholder="请输入项目名称" v-decorator="['projectName', validatorRules.projectName]" disabled />
         </a-form-item>
         <!-- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="行业">
           <j-tree-select ref="treeSelect" placeholder="请选择行业" v-decorator="['industryId']"
@@ -30,7 +30,7 @@
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="供应商"
-          v-if="model.mediaId=='2'||model.mediaId=='4'"
+          v-if="model.mediaId == '2' || model.mediaId == '4'"
         >
           <a-select
             optionFilterProp="children"
@@ -38,14 +38,8 @@
             :filterOption="filterOption"
             v-decorator="['supplierCode', validatorRules.supplierCode]"
           >
-            <a-select-option
-              :value="item.supplierCode"
-              v-for="(item, index) of supplierList"
-              :key="index"
-            >
-              {{
-              item.supplierName
-              }}
+            <a-select-option :value="item.supplierCode" v-for="(item, index) of supplierList" :key="index">
+              {{ item.supplierName }}
             </a-select-option>
           </a-select>
         </a-form-item>
@@ -61,9 +55,7 @@
             disabled
           >
             <a-select-option :value="item.id" v-for="(item, index) of list" :key="index">
-              {{
-              item.name
-              }}
+              {{ item.name }}
             </a-select-option>
           </a-select>
         </a-form-item>
@@ -77,35 +69,58 @@
             disabled
           >
             <a-select-option :value="item.id" v-for="(item, index) of listProduct" :key="index">
-              {{
-              item.productName
-              }}
+              {{ item.productName }}
             </a-select-option>
           </a-select>
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="最高出价">
-          <a-input
-            placeholder="请输入最高出价"
-            v-decorator="['maxBid', validatorRules.maxBid]"
-            addonAfter="元"
-          />
+          <a-input placeholder="请输入最高出价" v-decorator="['maxBid', validatorRules.maxBid]" addonAfter="元" />
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="最高转化出价">
           <a-input placeholder="最高转化出价" v-decorator="['maxDeepCpaBid']" addonAfter="元" />
         </a-form-item>
+
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优化目标">
+          <a-radio-group buttonStyle="solid" v-decorator="['bidType', { initialValue: 2 }]">
+            <a-radio-button :value="2">点击数</a-radio-button>
+            <a-radio-button :value="10">转化数</a-radio-button>
+          </a-radio-group>
+        </a-form-item>
+        <a-form-item
+          label="转化目标"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          v-show="getFormFieldValue('bidType') == 10"
+        >
+          <a-select v-decorator="['ocpxActionType', { initialValue: 2 }]">
+            <a-select-option :value="2">行为数</a-select-option>
+            <a-select-option :value="180">激活</a-select-option>
+            <a-select-option :value="53">表单提交</a-select-option>
+
+            <a-select-option :value="394">订单提交</a-select-option>
+            <a-select-option :value="348">使用有效线索</a-select-option>
+            <a-select-option :value="383">授信出价</a-select-option>
+            <a-select-option :value="384">完件出价</a-select-option>
+            <a-select-option :value="190">付费出价</a-select-option>
+            <a-select-option :value="191">首日ROI</a-select-option>
+            <a-select-option :value="396">注册优化目标</a-select-option>
+          </a-select>
+        </a-form-item>
+
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售">
           <a-select
             showSearch
             optionFilterProp="children"
             style="width: 100%"
             :filterOption="filterOption"
-            v-decorator="['saleId', { rules: [{  required: true,message: '请选择销售' }] }]"
+            v-decorator="['saleId', { rules: [{ required: true, message: '请选择销售' }] }]"
           >
             <a-select-option
               v-for="appModel in optionsElse"
               :key="appModel.userId + new Date().getTime()"
               :value="appModel.userId"
-            >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option>
+              >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option
+            >
           </a-select>
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="运营负责人">
@@ -122,7 +137,8 @@
               v-for="appModel in options"
               :key="appModel.userId + new Date().getTime()"
               :value="appModel.userId"
-            >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option>
+              >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option
+            >
           </a-select>
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="设计负责人">
@@ -139,7 +155,8 @@
               v-for="appModel in options"
               :key="appModel.userId + new Date().getTime()"
               :value="appModel.userId"
-            >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option>
+              >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option
+            >
           </a-select>
         </a-form-item>
       </a-form>
@@ -240,7 +257,7 @@ export default {
       params.pageSize = 1000
       params.pageNo = 1
       console.log(params)
-      getAction(this.url.getList,params)
+      getAction(this.url.getList, params)
         .then((res) => {
           if (res.success) {
             console.log(res)
@@ -287,6 +304,8 @@ export default {
       this.model = Object.assign({}, params)
       this.model.maxBid = this.model.maxBid ? this.model.maxBid / 1000 : 0
       this.model.maxDeepCpaBid = this.model.maxDeepCpaBid ? this.model.maxDeepCpaBid / 1000 : 0
+      this.model.bidType = this.model.bidType == null ? 2 : this.model.bidType
+      this.model.ocpxActionType = this.model.ocpxActionType == null ? 2 : this.model.ocpxActionType
       this.visible = true
       this.$nextTick(() => {
         console.log(this.model)
@@ -307,7 +326,9 @@ export default {
               'industryCode',
               'supplierCode',
               // 'advertiserType',
-              'saleId'
+              'saleId',
+              'bidType',
+              'ocpxActionType'
             )
           )
         } else {
@@ -326,7 +347,9 @@ export default {
               'industryCode',
               'supplierCode',
               // 'advertiserType',
-              'saleId'
+              'saleId',
+              'bidType',
+              'ocpxActionType'
             )
           )
         }
@@ -378,11 +401,14 @@ export default {
           formData.responsibleId = values.responsibleId
           formData.designResponsibleId = values.designResponsibleId
           formData.userId = formData.userId ? formData.userId : that.userInfo().id
+          formData.ocpxActionType = formData.bidType == 2 ? 0 : formData.ocpxActionType
+          console.log(formData)
           httpAction(httpurl, formData, method)
             .then((res) => {
               if (res.success) {
                 that.$message.success(res.message)
                 that.$emit('ok')
+                that.confirmLoading = false
               } else {
                 that.$message.warning(res.message)
               }

+ 2 - 2
src/views/modules/kuaishouapp/account/editGroup.vue

@@ -765,8 +765,8 @@
                 cpaBid: item.cpaBid != '' ? item.cpaBid * 1000 : '',
                 bid: item.bid != '' ? item.bid * 1000 : '',
                 deepConversionBid: item.deepConversionBid != '' ? item.deepConversionBid * 1000 : '',
-                ocpxActionType: item.ocpxActionType,
-                bidType: item.bidType == 1 ? 2 : 10
+                ocpxActionType: item.bidType == 4?53:item.ocpxActionType,
+                bidType: item.bidType == 1 ? 2 :item.bidType == 4? item.bidType : 10
               }
             })[0]
             var json = {

+ 4 - 4
src/views/modules/kuaishouapp/account/editGroupNew.vue

@@ -835,8 +835,8 @@
                   cpaBid: item.cpaBid != '' ? item.cpaBid * 1000 : '',
                   bid: item.bid != '' ? item.bid * 1000 : '',
                   deepConversionBid: item.deepConversionBid != '' ? item.deepConversionBid * 1000 : '',
-                  ocpxActionType: item.ocpxActionType,
-                  bidType: item.bidType == 1 ? 2 : 10
+                  ocpxActionType: item.bidType == 4?53:item.ocpxActionType,
+                  bidType: item.bidType == 1 ? 2 :item.bidType == 4? item.bidType : 10
                 }
               })[0]
               var param = {
@@ -879,8 +879,8 @@
                   cpaBid: item.cpaBid != '' ? item.cpaBid * 1000 : '',
                   bid: item.bid != '' ? item.bid * 1000 : '',
                   deepConversionBid: item.deepConversionBid != '' ? item.deepConversionBid * 1000 : '',
-                  ocpxActionType: item.ocpxActionType,
-                  bidType: item.bidType == 1 ? 2 : 10
+                  ocpxActionType: item.bidType == 4?53:item.ocpxActionType,
+                  bidType: item.bidType == 1 ? 2 :item.bidType == 4? item.bidType : 10
                 }
               })[0]
               console.log(groupArrTwo)

+ 1 - 0
src/views/modules/kuaishouapp/account/stepForm/Step4.vue

@@ -591,6 +591,7 @@ li.chouzhen.first:before {
             <a-checkbox
               :value="item.signature"
               style="position: absolute; z-index: 100; width: 100%; height: 100%; right: 0; top: 0; float: right"
+               :disabled="checkList.filter(i=>i==item.signature).length==0&&checkList.length>=4"
             >
               <img :src="item.url" alt style="width: 100%" />
             </a-checkbox>

+ 3 - 2
src/views/modules/kuaishouapp/crossAccount/createCampaign.vue

@@ -117,7 +117,7 @@
         :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
         :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
       >
-        <a-radio-group @change="showBudgetStatusChange" v-model="campaignBudget">
+        <a-radio-group @change="showBudgetStatusChange" v-model="campaignBudget" buttonStyle="solid">
           <a-radio-button value="UNLIMITED">不限</a-radio-button>
           <a-radio-button value="AS_BUDGET">统一预算</a-radio-button>
           <a-radio-button value="DAY_BUDGET">分日预算</a-radio-button>
@@ -253,7 +253,7 @@ export default {
       }
     },
     getChangeAll(name, indexBest, index, items) {
-      var node = document.getElementsByClassName('rending')[indexBest]
+      var node = document.getElementsByClassName('rending')[indexBest + this.getData('createTotal') * index]
       var v = '{{' + name + '}}-'
       if (document.selection) {
         //IE
@@ -279,6 +279,7 @@ export default {
       } else {
         //OTHER
         node.value += v
+        console.log(node.value)
         items.campaignName = node.value
         node.focus()
         // this.campaignName = node.value

+ 564 - 0
src/views/modules/kuaishouapp/crossAccount/createUnit.vue

@@ -0,0 +1,564 @@
+<style>
+.create-unit .ant-form-item-control {
+  line-height: inherit;
+}
+.create-unit .ant-tabs-bar {
+  width: 50%;
+  margin: auto;
+  margin-bottom: 16px;
+  border-bottom: 1px solid #e8e8e8;
+  outline: none;
+  -webkit-transition: padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
+  transition: padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
+}
+.create-unit .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active {
+  color: #fff;
+  background: #1890ff !important;
+  border-color: #1890ff !important;
+  border-bottom: 1px solid #1890ff !important;
+}
+.create-unit .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab {
+  height: 40px;
+  margin: 0;
+  margin-right: 2px;
+  padding: 0 16px;
+  line-height: 38px;
+  background: #fafafa;
+  border: 1px solid #e8e8e8 !important;
+  border-radius: 4px 4px 0 0 !important;
+  -webkit-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
+  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
+}
+</style>
+<template>
+  <div class="create-unit">
+    <a-card :body-style="{ padding: '24px 32px' }" :bordered="false">
+      <a-form-model ref="unitCreate" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
+        <a-tabs type="card" :label-col="labelCol" :wrapper-col="wrapperCol">
+          <a-tab-pane
+            :key="item.account.accountId"
+            :tab="'账户:' + item.account.accountName"
+            v-for="(item, index) of form.accountArr"
+          >
+            <a-form-model-item label="计划下组是否相同" prop="campaignAgreement">
+              <a-radio-group v-model="item.account.campaignAgreement" buttonStyle="solid" @change="nameTypeChange">
+                <a-radio-button :value="0">是</a-radio-button>
+                <a-radio-button :value="1">否</a-radio-button>
+              </a-radio-group>
+            </a-form-model-item>
+            <a-form-model-item label="计划下组数量" prop="unitCount">
+              <a-input-number v-model="item.account.unitCount" :min="1" :max="10" @change="changeCreateTotal(item)" />
+            </a-form-model-item>
+            <!-- <a-form-model-item label="计划名称" prop="campaign"> -->
+            <a-tabs type="card" v-if="item.account.campaignAgreement == 1">
+              <a-tab-pane
+                :key="campaign.campaignId"
+                :tab="'计划:' + campaign.campaignName"
+                v-for="(campaign, campaignIndex) of item.account.campaignList"
+              >
+                <a-form-model-item
+                  ref="unitName"
+                  v-for="(unitName, indexUnit) of campaign.unitNames"
+                  :key="indexUnit"
+                  :label="indexUnit == 0 ? '组名称' : ''"
+                  v-bind="indexUnit !== 0 ? formItemLayout : {}"
+                  :prop="
+                    'accountArr.' +
+                    index +
+                    '.account.campaignList.' +
+                    campaignIndex +
+                    '.unitNames.' +
+                    indexUnit +
+                    '.value'
+                  "
+                  :rules="{
+                    required: true,
+                    message: '组名称必填',
+                    trigger: 'blur',
+                  }"
+                  ><a-input v-model="unitName.value" placeholder="请输入组名称" style="width: 60%; margin-right: 8px" />
+                </a-form-model-item>
+                <a-form-model-item label="投放范围" v-if="item.account.allianceAccount">
+                  <a-radio-group buttonStyle="solid" v-model="campaign.allianceAccount">
+                    <a-radio-button value="1">默认</a-radio-button>
+                    <a-radio-button value="2">联盟广告</a-radio-button>
+                  </a-radio-group>
+                </a-form-model-item>
+              </a-tab-pane>
+            </a-tabs>
+            <div v-else>
+              <a-form-model-item
+                ref="unitName"
+                v-for="(unitName, indexUnit) of item.account.campaignOne.unitNames"
+                :key="indexUnit"
+                :label="indexUnit == 0 ? '组名称' : ''"
+                v-bind="indexUnit !== 0 ? formItemLayout : {}"
+                :prop="'accountArr.' + index + '.account.campaignOne.unitNames.' + indexUnit + '.value'"
+                :rules="{
+                  required: true,
+                  message: '组名称必填',
+                  trigger: 'blur',
+                }"
+                ><a-input v-model="unitName.value" placeholder="请输入组名称" style="width: 60%; margin-right: 8px" />
+              </a-form-model-item>
+              <a-form-model-item label="投放范围" v-if="item.account.allianceAccount">
+                <a-radio-group buttonStyle="solid" v-model="item.account.campaignOne.allianceAccount">
+                  <a-radio-button value="1">默认</a-radio-button>
+                  <a-radio-button value="2">联盟广告</a-radio-button>
+                </a-radio-group>
+              </a-form-model-item>
+            </div>
+
+            <!-- </a-form-model-item> -->
+          </a-tab-pane>
+          <!-- <a-tab-pane key="2" tab="Tab 2"> Content of Tab Pane 2 </a-tab-pane>
+          <a-tab-pane key="3" tab="Tab 3"> Content of Tab Pane 3 </a-tab-pane> -->
+        </a-tabs>
+        <a-form-model-item
+          :wrapperCol="{
+            xs: { span: 24, offset: 0 },
+            sm: { span: 20, offset: 7 },
+          }"
+        >
+          <a-button type="primary" html-type="submit" @click="submitForm('unitCreate')"> 提交 </a-button>
+          <a-button style="margin-left: 10px" @click="resetForm('unitCreate')"> 重置 </a-button>
+        </a-form-model-item>
+        <!-- <a-form-model-item
+          ref="unitName"
+          prop="unitName"
+          v-for="(domain, index) in tabList[activeIndex].form.unitName"
+          :key="index"
+          :label="index === 0 ? '组名称' : ''"
+          :prop="'unitName.' + index + '.value'"
+          :rules="{
+            required: true,
+            message: '组名称必填',
+            trigger: 'blur',
+          }"
+          ><a-input v-model="domain.value" placeholder="请输入组名称" style="width: 60%; margin-right: 8px" />
+        </a-form-model-item> -->
+      </a-form-model>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { deleteAction, postAction, getAction } from '@/api/manage'
+import moment from 'moment'
+import { mapActions, mapGetters } from 'vuex'
+import Treeselect from '@/views/modules/Statistics/components/Treeselect.vue'
+export default {
+  name: 'create-unit',
+  components: {
+    Treeselect,
+  },
+  data() {
+    return {
+      labelCol: { span: 7 },
+      wrapperCol: { span: 17 },
+      formItemLayout: {
+        labelCol: {
+          xs: { span: 7 },
+          sm: { span: 7 },
+        },
+        wrapperCol: {
+          xs: { span: 17, offset: 0 },
+          sm: { span: 17, offset: 7 },
+        },
+      },
+      form: {
+        accountArr: [
+          {
+            account: {
+              accountId: 23212,
+              accountName: '环球黑卡',
+              campaignAgreement: 0,
+              unitCount: 1,
+              allianceAccount: true,
+              campaignType: 2,
+              campaignList: [
+                { campaignId: 1231231, campaignName: '测试', unitNames: [{ value: '' }], allianceAccount: '1' },
+                { campaignId: 12331, campaignName: '测`试', unitNames: [{ value: '' }], allianceAccount: '1' },
+                { campaignId: 123311, campaignName: '测1试', unitNames: [{ value: '' }], allianceAccount: '1' },
+                { campaignId: 123312, campaignName: '测3试', unitNames: [{ value: '' }], allianceAccount: '1' },
+              ],
+              campaignOne: { unitNames: [{ value: '' }], allianceAccount: '1' },
+            },
+          },
+          {
+            account: {
+              accountId: 232121,
+              accountName: '环球黑卡2',
+              campaignAgreement: 0,
+              campaignType: 3,
+              allianceAccount: false,
+              unitCount: 1,
+              campaignList: [
+                { campaignId: 1231231, campaignName: '测试', unitNames: [{ value: '' }], allianceAccount: '1' },
+              ],
+              campaignOne: { unitNames: [{ value: '' }], allianceAccount: '1' },
+            },
+          },
+          {
+            account: {
+              accountId: 232,
+              accountName: '环球黑卡`2',
+              campaignAgreement: 0,
+              campaignType: 4,
+              allianceAccount: false,
+              unitCount: 1,
+              campaignList: [
+                { campaignId: 1231231, campaignName: '测试', unitNames: [{ value: '' }], allianceAccount: '1' },
+              ],
+              campaignOne: { unitNames: [{ value: '' }], allianceAccount: '1' },
+            },
+          },
+        ],
+      },
+      tabList: [
+        {
+          key: 'article',
+          tab: '账户1',
+          form: {
+            campaignAgreement: 0,
+            unitName: [{ value: '' }],
+          },
+        },
+        {
+          key: 'app',
+          tab: '账户2',
+          form: {
+            campaignAgreement: 0,
+            unitName: [{ value: '' }],
+          },
+        },
+        {
+          key: 'project',
+          tab: '账户3',
+          form: {
+            campaignAgreement: 1,
+            unitName: [{ value: '' }],
+          },
+        },
+      ],
+      key: 'article',
+      activeIndex: 0,
+      accountIds: [],
+      active: null,
+      promotionName: '',
+      tabs: [],
+      dayBudgetSchedule: [{ one: '' }, { one: '' }, { one: '' }, { one: '' }, { one: '' }, { one: '' }, { one: '' }],
+      type: '2',
+      typeList: {},
+      appList: {},
+      showBudgetDaily: false,
+      campaignName: '',
+      campaignBudget: 'UNLIMITED',
+      dayBudget: 0,
+      appId: '0', //应用目标
+      showApp: true,
+      redirectUrl: '', // 链接地址
+      showRedirect: false,
+      urlType: '1',
+      showUrlType: false,
+      channelType: '1',
+      showChannelType: false,
+      loading: false,
+
+      url: {
+        dictListUrl: 'toutiao/dictitem/list',
+        appListUrl: '/kuaishou/kuaiShouCreateAppTemplate/list',
+        insertTemplateUrl: '/kuaishou/batch/campaignCreate',
+      },
+      createTotal: [],
+    }
+  },
+  methods: {
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          alert('submit!')
+          console.log(this.tabList)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    resetForm(formName) {
+      this.$refs[formName].resetFields()
+    },
+    onTabChange(key, type) {
+      console.log(key, type)
+      this[type] = key
+      this.activeIndex = this.tabList.findIndex((item) => this.key == item.key)
+    },
+    ...mapGetters(['nickname', 'avatar', 'userInfo']),
+    numberReturn(num) {
+      var arr = ['一', '二', '三', '四', '五', '六', '天']
+      return arr[num]
+    },
+    getCampaignId(campaignId) {
+      alert(1)
+    },
+    changeCreateTotal(item) {
+      this.$nextTick(() => {
+        // if()
+        console.log(item)
+        var arr = []
+        for (let i = 0; i < item.account.unitCount; i++) {
+          arr.push({ value: '' })
+        }
+        item.account.campaignOne.unitNames = JSON.parse(JSON.stringify(arr))
+        item.account.campaignList.forEach((element) => {
+          element.unitNames = JSON.parse(JSON.stringify(arr))
+        })
+      })
+    },
+    nameTypeChange(e) {
+      console.log(e.target.value)
+      if (e.target.value == 1) {
+        if (this.accountIds.length > 0) {
+          postAction('/kuaishou/crossAccount/getAuthName', { accountArr: this.accountIds }).then((res) => {
+            if (res.success) {
+              this.tabs = res.result.map((item) => {
+                return {
+                  ...item,
+                  campaignNames: JSON.parse(JSON.stringify(this.createTotal)),
+                }
+              })
+              this.active = res.result[0].accountId
+            } else {
+              this.tabs = []
+            }
+          })
+        }
+      } else {
+      }
+    },
+    getChangeAll(name, indexBest, index, items) {
+      var node = document.getElementsByClassName('rending')[indexBest]
+      var v = '{{' + name + '}}-'
+      if (document.selection) {
+        //IE
+        node.focus()
+        var sel = document.selection.createRange()
+        sel.text = v
+        sel.select()
+        items.campaignName = v
+      } else if (node.selectionStart || node.selectionStart == '0') {
+        //MOZILLA/GOOGLE
+        var startPos = node.selectionStart
+        var endPos = node.selectionEnd
+        var restoreTop = node.scrollTop
+        node.value = node.value.substring(0, startPos) + v + node.value.substring(endPos, node.value.length)
+        if (restoreTop > 0) {
+          node.scrollTop = restoreTop
+        }
+        items.campaignName = node.value
+        node.focus()
+        node.selectionStart = startPos + v.length
+        node.selectionEnd = startPos + v.length
+        // this.campaignName = node.value
+      } else {
+        //OTHER
+        node.value += v
+        items.campaignName = node.value
+        node.focus()
+        // this.campaignName = node.value
+      }
+    },
+    getChange(name, index) {
+      console.log(index, document.getElementsByClassName('rending'))
+      var node = document.getElementsByClassName('rending')[index]
+      var v = '{{' + name + '}}-'
+      if (document.selection) {
+        //IE
+        node.focus()
+        var sel = document.selection.createRange()
+        sel.text = v
+        sel.select()
+        this.campaignName = v
+      } else if (node.selectionStart || node.selectionStart == '0') {
+        //MOZILLA/GOOGLE
+        var startPos = node.selectionStart
+        var endPos = node.selectionEnd
+        var restoreTop = node.scrollTop
+        node.value = node.value.substring(0, startPos) + v + node.value.substring(endPos, node.value.length)
+        if (restoreTop > 0) {
+          node.scrollTop = restoreTop
+        }
+        this.campaignName = node.value
+        node.focus()
+        node.selectionStart = startPos + v.length
+        node.selectionEnd = startPos + v.length
+        // this.campaignName = node.value
+      } else {
+        //OTHER
+        node.value += v
+        this.campaignName = node.value
+        node.focus()
+        // this.campaignName = node.value
+      }
+    },
+    handleConfirmValue(rule, value, callback) {
+      if (value == '' || value < 500 || value >= 100000000) {
+        callback('请输入正确预算金额')
+      }
+      callback()
+    },
+
+    handleConfirmAppId(rule, value, callback) {
+      if (this.type == 2 && (this.appId == '0' || this.appId == '')) {
+        callback('请选择目标应用')
+      }
+      callback()
+    },
+
+    handleSubmit(e) {
+      e.preventDefault()
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          this.loading = true
+
+          let params = {}
+          params.type = values.type
+          //   params.campaignBudget = this.campaignBudget
+          if (this.campaignBudget == 'UNLIMITED') {
+            params.dayBudget = 0
+          } else if (this.campaignBudget == 'AS_BUDGET') {
+            params.dayBudget = values.dayBudget * 1000
+          } else {
+            params.dayBudgetSchedule = this.dayBudgetSchedule.map((item) => {
+              if (item.one == '') {
+                return 0
+              } else {
+                return item.one * 1000
+              }
+            })
+          }
+          // if (this.getData('nameType') == 0) {
+          //   var dataArr = this.campaignName.split('-')
+          //   if (dataArr[dataArr.length - 1] == '') {
+          //     dataArr.pop()
+          //   }
+          //   params.campaignName = dataArr.join('-')
+          // } else {
+          //   params.nameArr = this.tabs.map((item) => {
+          //     return {
+          //       accountId: item.accountId,
+          //       campaignNames: item.campaignNames.map((i) => {
+          //         return i.campaignName
+          //       }),
+          //     }
+          //   })
+          // }
+
+          params.accountArr = this.accountIds
+          params.nameType = values.nameType
+          params.createTotal = values.createTotal
+          console.log(params)
+
+          postAction('/kuaishou/crossAccount/batchCampaignCreate', params).then((res) => {
+            console.log(res)
+            if (res.success) {
+              this.$message.success('创建成功')
+              localStorage.setItem('campaignId', res.result)
+              this.loading = false
+              this.nextStep(res.result)
+            } else {
+              this.$message.error(res.message)
+              this.loading = false
+            }
+          })
+        }
+      })
+    },
+    onChange(value) {
+      console.log(value)
+    },
+    showBudgetStatusChange() {
+      if (this.campaignBudget == 'UNLIMITED') {
+        this.showBudgetDaily = false
+        this.dayBudget = 0
+      } else {
+        this.showBudgetDaily = true
+        this.dayBudget = ''
+      }
+    },
+    typeChange() {
+      if (this.type == 2) {
+        this.promotionName = '提升应用安装'
+        this.showApp = true
+        this.showRedirect = false
+        this.showUrlType = false
+        this.showChannelType = false
+      }
+      if (this.type == 3) {
+        this.promotionName = '获取电商下单'
+        this.showApp = false
+        this.showRedirect = true
+        this.showUrlType = true
+        this.showChannelType = false
+      }
+      if (this.type == 4) {
+        this.promotionName = '推广品牌活动'
+        this.showApp = false
+        this.showRedirect = true
+        this.showUrlType = false
+        this.showChannelType = false
+      }
+      if (this.type == 5) {
+        this.promotionName = '收集销售线索'
+        this.showApp = false
+        this.showRedirect = true
+        this.showUrlType = false
+        this.showChannelType = true
+      }
+      this.campaignName = this.promotionName + '_' + moment(new Date())
+    },
+    handleChange(value) {
+      console.log(`selected ${value}`)
+    },
+    handleBlur() {
+      console.log('blur')
+    },
+    handleFocus() {
+      console.log('focus')
+    },
+    filterOption(input, option) {
+      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+    },
+    nextStep() {
+      this.$emit('nextStep')
+    },
+    // getData(className) {
+    //   return this.form.getFieldValue(className)
+    // },
+    getLOLTrue(accountId) {
+      getAction('/kuaishou/batch/getWhiteList', {
+        accountId: accountId,
+      }).then((res) => {
+        if (res.success) {
+          console.log(res)
+          if (res.result) {
+            if (res.result.alliance_account == 1) {
+              return true
+            } else {
+              return false
+            }
+          } else {
+            return false
+          }
+        }
+      })
+    },
+  },
+  mounted: function () {
+    this.$nextTick(() => {
+      // this.changeCreateTotal()
+      this.activeIndex = this.tabList.findIndex((item) => this.key == item.key)
+    })
+  },
+}
+</script>

+ 1 - 1
vue.config.js

@@ -68,7 +68,7 @@ module.exports = {
     open : true,
     proxy: {
       '/jeecg-boot': {
-        //  target: 'http://192.168.1.8:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
+         target: 'http://192.168.1.8:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.0.59:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.1.188:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云