Browse Source

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

魏志佳 4 years ago
parent
commit
e6ca5835c3

+ 5 - 1
src/components/uploadFileMd5Push.vue

@@ -12,6 +12,7 @@
   height: 100% !important;
   width: 100%;
 }
+
 </style>
 <template>
   <div class="upload-file md5-file">
@@ -146,6 +147,7 @@ export default {
       previewVisible: false,
       previewImage: '',
       md5: '',
+      accountId: '',
     }
   },
   filters: {},
@@ -234,7 +236,8 @@ export default {
       } else {
         this.checkFile(file)
           .then((res) => {
-            this.md5 = res
+            this.md5 = res.md5
+            this.accountId = res.accountId
             this.cosUpload(file)
           })
           .catch(() => {
@@ -329,6 +332,7 @@ export default {
                   return { url: item.url, signature: that.md5 }
                 })[0]
               )
+             
             }
           } else {
             that.$message.error('上传已达上限' + that.fileCount + '张')

+ 11 - 2
src/filters.js

@@ -81,9 +81,9 @@ const filters = {
         var data = {
             null: '-',
             1: 'CPM',
-            2: 'CPC',
+            2: '封面点击(CPC)',
             6: 'OCPC',
-            10: 'OCPM',
+            10: '转化(OCPM)',
         }
         return data[sta]
     },
@@ -310,6 +310,15 @@ const filters = {
 
         return data[val]
     },
+    platform(str) {
+        var data = {
+            1: 'Android应用下载',
+            2: 'Android网页游戏',
+            3: 'iOS应用下载',
+            4: 'iOS网页游戏'
+        }
+        return data[str]
+    }
 
 }
 

+ 2 - 2
src/utils/request.js

@@ -16,8 +16,8 @@ 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://139.186.151.174:8804/jeecg-boot';     
-  // axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';
+  // axios.defaults.baseURL = 'http://139.186.151.174:8804/jeecg-boot';     
+  axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';
 }
 const service = axios.create({
 //   baseURL: '/jeecg-boot', // api base_url

+ 7 - 0
src/views/modules/Statistics/components/Treeselect.vue

@@ -19,6 +19,7 @@
       @input="emitValue"
       :limit="limit"
       :default-options="true"
+      :disabled="disabled"
       :limitText="
         (count) => {
           return '隐藏' + count + '条'
@@ -90,6 +91,12 @@ export default {
         return 2
       },
     },
+    disabled:{
+      type: Boolean,
+      default() {
+        return false
+      },
+    }
   },
   components: {
     Treeselect,

+ 49 - 16
src/views/modules/advertiser/AdvertiserList.vue

@@ -19,15 +19,13 @@
                 @search="getList"
               >
                 <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>
           </a-col>
           <a-col :md="8" :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="searchQueryOne" icon="search">查询</a-button>
               <a-button type="primary" @click="searchRe" icon="reload" style="margin-left: 8px">重置</a-button>
             </span>
@@ -44,18 +42,18 @@
       <a-tab-pane key="product" tab="产品列表">
         <a-tag
           color="blue"
-          style="height:30px;line-height:30px;font-size:14px;margin-bottom:20px"
+          style="height: 30px; line-height: 30px; font-size: 14px; margin-bottom: 20px"
           v-if="queryParam.advertiserId"
         >
-          {{advertiserName}}
+          {{ advertiserName }}
           <a-icon type="close" @click="clear('advertiserId')" />
         </a-tag>
-        <a-row :gutter="24" style="margin-bottom:20px">
+        <a-row :gutter="24" style="margin-bottom: 20px">
           <a-col :md="8" :sm="8">
             <a-input placeholder="请输入产品名称" v-model="queryParam.productName"></a-input>
           </a-col>
           <a-col :md="8" :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="searchQueryOne" icon="search">查询</a-button>
             </span>
           </a-col>
@@ -64,18 +62,18 @@
       <a-tab-pane key="project" tab="项目列表">
         <a-tag
           color="blue"
-          style="height:30px;line-height:30px;font-size:14px;margin-bottom:20px"
+          style="height: 30px; line-height: 30px; font-size: 14px; margin-bottom: 20px"
           v-if="queryParam.productId"
         >
-          {{advertiserName?advertiserName+' / '+productName:productName}}
+          {{ advertiserName ? advertiserName + ' / ' + productName : productName }}
           <a-icon type="close" @click="clear('productId')" />
         </a-tag>
-        <a-row :gutter="24" style="margin-bottom:20px">
+        <a-row :gutter="24" style="margin-bottom: 20px">
           <a-col :md="8" :sm="8">
             <a-input placeholder="请输入项目名称" v-model="queryParam.projectName"></a-input>
           </a-col>
           <a-col :md="8" :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="searchQueryOne" icon="search">查询</a-button>
             </span>
           </a-col>
@@ -96,6 +94,25 @@
         :loading="loading"
         @change="handleTableChange"
       >
+        <span slot="ocpxActionType" slot-scope="text">
+          <div v-if="text">
+            <span v-for="(item, index) of JSON.parse(text)" :key="index"
+              >{{ item | ocpxActionType }}{{ index == JSON.parse(text).length - 1 ? '' : ',' }}</span
+            >
+          </div>
+          <div v-else>-</div>
+
+          <!-- {{ text | ocpxActionType }} -->
+        </span>
+        <span slot="bidType" slot-scope="text">
+          <div v-if="text && JSON.parse(text).length > 0">
+            <span v-for="(item, index) of JSON.parse(text)" :key="index"
+              >{{ item | bidType }}{{ index == JSON.parse(text).length - 1 ? '' : ',' }}</span
+            >
+          </div>
+          <div v-else>-</div>
+        </span>
+
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
@@ -105,7 +122,7 @@
           </a-popconfirm>
         </span>
         <span slot="actionProduct" slot-scope="text, record">
-          <a @click="handleEditElse(record,'product')">编辑</a>
+          <a @click="handleEditElse(record, 'product')">编辑</a>
 
           <a-divider type="vertical" />
           <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
@@ -113,7 +130,7 @@
           </a-popconfirm>
         </span>
         <span slot="actionProject" slot-scope="text, record">
-          <a @click="handleEditElse(record,'project')">编辑</a>
+          <a @click="handleEditElse(record, 'project')">编辑</a>
 
           <a-divider type="vertical" />
           <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
@@ -122,8 +139,8 @@
         </span>
         <span slot="maxBid" slot-scope="text">{{ text / 1000 }}</span>
         <span slot="maxDeepCpaBid" slot-scope="text">{{ text / 1000 }}</span>
-        <a slot="name" slot-scope="text,record" @click="toProduct(record,'product')">{{text}}</a>
-        <a slot="productName" slot-scope="text,record" @click="toProduct(record,'project')">{{text}}</a>
+        <a slot="name" slot-scope="text, record" @click="toProduct(record, 'product')">{{ text }}</a>
+        <a slot="productName" slot-scope="text, record" @click="toProduct(record, 'project')">{{ text }}</a>
       </a-table>
     </div>
     <!-- table区域-begin -->
@@ -256,6 +273,22 @@ const projectColumns = [
     },
   },
   {
+    title: '优化目标',
+    align: 'center',
+    dataIndex: 'bidType',
+    scopedSlots: {
+      customRender: 'bidType',
+    },
+  },
+  {
+    title: '转化目标',
+    align: 'center',
+    dataIndex: 'ocpxActionType',
+    scopedSlots: {
+      customRender: 'ocpxActionType',
+    },
+  },
+  {
     title: '供应商',
     align: 'center',
     dataIndex: 'supplierCode_dictText',

+ 1 - 0
src/views/modules/advertiser/ProjectMemberList.vue

@@ -850,6 +850,7 @@ export default {
     },
     searchReset() {
       this.keyWord = ''
+      this.ipagination.current = 1
       // this.dataSource = this.dataElse
       if (this.noTitleKey == 'participation') {
         this.getParticipateList()

+ 77 - 30
src/views/modules/advertiser/modules/ProjectModal.vue

@@ -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>
@@ -59,9 +53,7 @@
             v-decorator="['advertiserId', validatorRules.advertiserId]"
           >
             <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>
@@ -71,38 +63,64 @@
             showSearch
             :filterOption="filterOption"
             v-decorator="['productId', validatorRules.productId]"
-            :disabled="getFormFieldValue('advertiserId')==''||getFormFieldValue('advertiserId')==null"
+            :disabled="getFormFieldValue('advertiserId') == '' || getFormFieldValue('advertiserId') == null"
           >
             <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>
+        <div v-if="model.mediaId == '2' || model.mediaId == '4'">
+          <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优化目标">
+            <a-select
+              v-decorator="['bidType', { rules: [{ required: true, message: '请输入表单名称' }], initialValue: 2 }]"
+              mode="multiple"
+            >
+              <a-select-option :value="2">点击数</a-select-option>
+              <a-select-option :value="10">OCPM</a-select-option>
+              <a-select-option :value="6">OCPC</a-select-option>
+            </a-select>
+          </a-form-item>
+          <div v-if="Array.isArray(getFormFieldValue('bidType'))">
+            <a-form-item
+              label="转化目标"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              v-show="
+                getFormFieldValue('bidType').findIndex((item) => item == 10) > -1 ||
+                getFormFieldValue('bidType').findIndex((item) => item == 6) > -1
+              "
+            >
+              <a-select v-model="model.ocpxActionType" mode="multiple">
+                <a-select-option :value="2">行为数</a-select-option>
+                <a-select-option :value="item.ocpxActionType" v-for="(item, index) in ocpxList" :key="index">{{
+                  item.ocpxActionName
+                }}</a-select-option>
+              </a-select>
+            </a-form-item>
+          </div>
+        </div>
+
         <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="运营负责人">
@@ -119,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="设计负责人">
@@ -136,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>
@@ -197,6 +217,7 @@ export default {
       optionsElse: [],
       supplierList: [],
       editAll: false,
+      ocpxList: [],
     }
   },
   created() {
@@ -204,7 +225,7 @@ export default {
   },
   methods: {
     validateInputCode(rule, value, callback) {
-      if ( value > 0) {
+      if (value > 0) {
         callback()
       } else {
         callback('请输入大于0的最高报价!')
@@ -237,7 +258,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)
@@ -268,6 +289,7 @@ export default {
     edit(record) {
       this.getSupplierList()
       this.getList()
+      this.getOcpxList()
       if (record.advertiserId) {
         this.editAll = true
         getAction('/ctop/product/list', { advertiserId: record.advertiserId, pageSize: 1000 }).then((res) => {
@@ -276,7 +298,18 @@ export default {
           }
         })
       }
-      var params = { ...record }
+
+      // var params = { ...record }
+      if (record.mediaId == '2' || record.mediaId == '4') {
+        console.log(record)
+        var params = { ...record }
+        params.bidType = record.bidType == null || record.bidType == '' ? [] : JSON.parse(record.bidType)
+        params.ocpxActionType =
+          record.ocpxActionType == null || record.ocpxActionType == '' ? [] : JSON.parse(record.ocpxActionType)
+      } else {
+        var { ocpxActionType, bidType, ...params } = record
+        this.showDian = false
+      }
 
       console.log(record)
       this.form.resetFields()
@@ -303,7 +336,8 @@ export default {
               'industryCode',
               'supplierCode',
               // 'advertiserType',
-              'saleId'
+              'saleId',
+              'bidType'
             )
           )
         } else {
@@ -322,7 +356,9 @@ export default {
               'industryCode',
               'supplierCode',
               // 'advertiserType',
-              'saleId'
+              'saleId',
+              'bidType',
+              'ocpxActionType'
             )
           )
         }
@@ -374,6 +410,10 @@ export default {
           formData.responsibleId = values.responsibleId
           formData.designResponsibleId = values.designResponsibleId
           formData.userId = formData.userId ? formData.userId : that.userInfo().id
+
+          formData.ocpxActionType =
+            formData.bidType == 2 ? JSON.stringify([0]) : JSON.stringify(formData.ocpxActionType)
+          formData.bidType = JSON.stringify(formData.bidType)
           httpAction(httpurl, formData, method)
             .then((res) => {
               if (res.success) {
@@ -400,6 +440,13 @@ export default {
       console.log(valueName, key)
       this.resId = key
     },
+    getOcpxList() {
+      this.getAction('/ocpx/kuaiShouOcpxActionTypeConfig/list').then((res) => {
+        if (res.success) {
+          this.ocpxList = res.result
+        }
+      })
+    },
   },
 }
 </script>

+ 8 - 7
src/views/modules/autoLaunch/configLaunchInfo.vue

@@ -865,17 +865,17 @@
                             </a-form-item>        
                         </div>
                     </div>
-                    <div class="row-item">
+                    <div class="row-item" v-if="whiteList.creative_category_switch==1">
                         <div class="hint-item"></div>
                         <div class="label-item">
                         <div class="text-item">创意分类</div>
-                        <div class="required-item" v-show="whiteList.creative_category_switch"></div>
+                        <div class="required-item" ></div>
                         </div>
                         <div class="input-item">
                         <a-form-item >
                             <a-cascader
                                 :options="createOptions"
-                                v-decorator="['creativeCategory',{ rules: [{ initialValue:[],required: whiteList.creative_category_switch==1, message: '创意分类必填' }] }]"
+                                v-decorator="['creativeCategory',{ rules: [{ required: whiteList.creative_category_switch==1, message: '创意分类必填' }],initialValue:[], }]"
                                 :fieldNames="fieldNames"
                                 placeholder="请选择创意分类"
                                 
@@ -883,11 +883,11 @@
                         </a-form-item>
                         </div>
                     </div>
-                    <div class="row-item">
+                    <div class="row-item" v-if="whiteList.creative_category_switch">
                         <div class="hint-item"></div>
                         <div class="label-item">
                         <div class="text-item">创意标签</div>
-                        <div class="required-item" v-show="whiteList.creative_category_switch"></div>
+                        <div class="required-item" ></div>
                         </div>
                         <div class="input-item">
                         <a-form-item>
@@ -895,7 +895,7 @@
                             mode="tags"
                             style="width: 100%"
                             placeholder="按回车生成标签"
-                            v-decorator="['creativeTag',{rules: [ {initialValue:[],required: whiteList.creative_category_switch==1, validator: creativeTagValid }]}]"
+                            v-decorator="['creativeTag',{rules: [ {required: whiteList.creative_category_switch==1, validator: creativeTagValid }],initialValue:[],}]"
                             dropdownClassName="display-none-selset"
                             :token-separators="[',', ' ', ',']"
                             >
@@ -1968,6 +1968,7 @@ export default {
                     }
                  
                     if(values.creativeCategory&&values.creativeCategory.length>0){
+                        
                         values.creativeCategory=values.creativeCategory[values.creativeCategory.length-1]
                     }else{
                          values.creativeCategory=undefined
@@ -2230,7 +2231,7 @@ export default {
                     this.noAreaBreak=res.result.noAreaBreak?true:false
                     this.noGenderBreak=res.result.noGenderBreak?true:false
                     this.noAgeBreak=res.result.noAgeBreak?true:false
-                    this.appStore=res.result.appStore?JSON.parse(res.result.appStore):this.appStore
+                    this.appStore=res.result.appStore?JSON.parse(res.result.appStore):[]
                     this.ageArr=[];
                     this.ageArr=JSON.parse(JSON.stringify(ageArr))
                     

+ 22 - 9
src/views/modules/kuaishouapp/account/accountIndex.vue

@@ -15,6 +15,7 @@
       <a-col :span="24" style="display: flex">
         <Treeselect :appId.sync="appId" :multiple="false" request="2,4" ref="treeSelect" style="margin: 8px 20px" />
         <a-button type="primary" style="margin: 10px" @click="addUser">搜索</a-button>
+        <a-button type="primary" style="margin: 10px; float: right" @click="newCreat">批量创建</a-button>
       </a-col>
     </a-row>
     <a-form layout="inline">
@@ -226,7 +227,14 @@
     </a-modal>
 
     <!-- 实时数据 -->
-    <a-modal v-model="realTimeVisiable" title="广告计划实时数据" @afterClose="clear" width="80%" :maskClosable="false" :footer='false'>
+    <a-modal
+      v-model="realTimeVisiable"
+      title="广告计划实时数据"
+      @afterClose="clear"
+      width="80%"
+      :maskClosable="false"
+      :footer="false"
+    >
       <div class="optBody">
         <a-range-picker
           :disabled-date="disabledDate"
@@ -746,6 +754,13 @@ export default {
     },
   },
   methods: {
+    newCreat() {
+      if (this.appId) {
+        window.open('/user/new-batch?accountId=' + this.appId, '_blank')
+      } else {
+        window.open('/user/new-batch', '_blank')
+      }
+    },
     disabledDate(current) {
       // console.log(current)
       return (current && current > moment()) || (current && current < moment().subtract(7, 'days'))
@@ -869,12 +884,11 @@ export default {
       }
     },
     handleSubmit(e) {
-      if(this.unitId){
+      if (this.unitId) {
         this.$refs.copyGroup.handleSubmit(e)
-      }else{
+      } else {
         this.$message.error('请选择广告组后操作')
       }
-      
     },
     toDetail(record) {
       localStorage.setItem('advertisingGroupKey', record.campaignId)
@@ -983,7 +997,6 @@ export default {
       this.searchLabel()
     },
     addUser() {
-      
       this.loading = true
       this.dataList = []
       var params = {}
@@ -993,7 +1006,7 @@ export default {
       if (this.appId) {
         this.getSpend(params)
         this.getCampaignList(params)
-        localStorage.setItem('accountId',this.appId)
+        localStorage.setItem('accountId', this.appId)
       } else {
         this.$message.error('请选择账户')
       }
@@ -1199,11 +1212,11 @@ export default {
     },
   },
   watch: {
-    allUnitCopy:function(n,o){
-      if(!n){
+    allUnitCopy: function (n, o) {
+      if (!n) {
         this.editUnit = '2'
       }
-    }
+    },
   },
 
   computed: {},

+ 22 - 8
src/views/modules/kuaishouapp/account/advertisingGroup.vue

@@ -1176,18 +1176,32 @@ let realTimeColumn=[
               ...res.result.appInfo,
               ...res.result.target
             }
-
+          if(this.campaignType=='2'||this.campaignType==2){
+            getAction('/kuaishou/batch/getIsActivate', {
+              accountId: localStorage.getItem('accountId'),
+              appId:this.copyData.appId,
+              campaignType:2
+            }).then(res => {
+              if (res.success) {
+                this.allForm.groupTypeData = res.result
+              }
+            })
+          }else{
+            getAction('/kuaishou/batch/getIsActivate', {
+              accountId: localStorage.getItem('accountId'),
+              campaignType:this.campaignType
+            }).then(res => {
+              if (res.success) {
+                this.allForm.groupTypeData = res.result
+              }
+            })
+          }
             this.copyLoading = false
           }
 
         })
-        getAction('/kuaishou/batch/getIsActivate', {
-          accountId: localStorage.getItem('accountId')
-        }).then(res => {
-          if (res.success) {
-            this.allForm.groupTypeData = res.result
-          }
-        })
+        
+       
       },
       toDetail(record) {
         // 点击改行时要做的事情

+ 16 - 18
src/views/modules/kuaishouapp/account/copyAllUnit.vue

@@ -671,22 +671,22 @@ export default {
         }
       })
 
-        getAction('/kuaishou/batch/getWhiteList', {
-          accountId: item.accountId,
-        }).then((res) => {
-          if (res.success) {
-            // console.log(res)
-            if (res.result) {
-              // this.creativeCategorySwitch = res.result.creative_category_switch == 1 ? true : false
-              this.allianceAccount = res.result.alliance_account == 1 ? true : false
-              // this.actionbarClickUrlSwitch = res.result.actionbar_click_url_switch == 1 ? true : false
-            } else {
-              this.allianceAccount = false
-              // this.creativeCategorySwitch = false
-              // this.actionbarClickUrlSwitch = false
-            }
+      getAction('/kuaishou/batch/getWhiteList', {
+        accountId: item.accountId,
+      }).then((res) => {
+        if (res.success) {
+          // console.log(res)
+          if (res.result) {
+            // this.creativeCategorySwitch = res.result.creative_category_switch == 1 ? true : false
+            this.allianceAccount = res.result.alliance_account == 1 ? true : false
+            // this.actionbarClickUrlSwitch = res.result.actionbar_click_url_switch == 1 ? true : false
+          } else {
+            this.allianceAccount = false
+            // this.creativeCategorySwitch = false
+            // this.actionbarClickUrlSwitch = false
           }
-        })
+        }
+      })
       getAction('/kuaishou/batch/getProjectMaxBid', {
         accountId: item.accountId,
       }).then((res) => {
@@ -728,11 +728,9 @@ export default {
       this.templateList = []
       getAction('/batch/kuaishouTemplate/list', {
         accountId: accountId,
-        pageSize: 1000,
-        pageNo: 1,
       }).then((res) => {
         if (res.success) {
-          this.templateList = res.result.records.map((item, index) => {
+          this.templateList = res.result.map((item, index) => {
             return {
               ...item,
               key: index,

+ 58 - 21
src/views/modules/kuaishouapp/account/stepForm/Step2.vue

@@ -45,7 +45,7 @@
         <creat-application ref="application" />
       </a-form-item>
       <a-form-item label="转化类型" :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
-        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }" v-if="campaignType == '3'">
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }" v-if="campaignType == 3">
         <a-radio-group buttonStyle="solid"
           v-decorator="['urlType', { rules: [{ required: true, message: '请选择目标应用' }], initialValue: '1' }]">
           <a-radio-button value="1">淘宝商品</a-radio-button>
@@ -672,18 +672,38 @@
         this.checkedTrue = e.target.checked
       },
       addGroup() {
-        this.allForm.group.push({
-          bidType:  10,
-          bid: '',
-          cpaBid: '',
-          showTipCheck: false,
-          deepConversionBidCheck: false,
-          unitName: '',
-          unitNameCheck: false,
-          deepConversionType: '',
-          deepConversionBid: '',
-          ocpxActionType:this.campaignType == '2' && this.allForm.groupTypeData.isActivate == '1' ? 180 : 2,
-        })
+        if(this.campaignType=='2'||this.campaignType==2){
+          if(this.getData('appId')){
+            this.allForm.group.push({
+              bidType:  10,
+              bid: '',
+              cpaBid: '',
+              showTipCheck: false,
+              deepConversionBidCheck: false,
+              unitName: '',
+              unitNameCheck: false,
+              deepConversionType: '',
+              deepConversionBid: '',
+              ocpxActionType:this.campaignType == '2' && this.allForm.groupTypeData.isActivate == '1' ? 180 : 2,
+            })
+          }else{
+            this.$message.error('请选择目标应用之后添加广告组')
+          }
+        }else{
+           this.allForm.group.push({
+              bidType:  10,
+              bid: '',
+              cpaBid: '',
+              showTipCheck: false,
+              deepConversionBidCheck: false,
+              unitName: '',
+              unitNameCheck: false,
+              deepConversionType: '',
+              deepConversionBid: '',
+              ocpxActionType:this.campaignType == '2' && this.allForm.groupTypeData.isActivate == '1' ? 180 : 2,
+            })
+        }
+
       },
       resData(index) {
         this.allForm.group[index].bid = ''
@@ -974,6 +994,16 @@
       },
       handleChange(value) {
         //   this.$refs.population.getAppList(value)
+        this.allForm.group = []
+        getAction('/kuaishou/batch/getIsActivate', {
+          accountId: localStorage.getItem('accountId'),
+          appId:this.getData('appId'),
+          campaignType:2
+        }).then(res => {
+          if (res.success) {
+            this.allForm.groupTypeData = res.result
+          }
+        })
       },
       handleChangeMould(value) {
         if (value) {
@@ -1044,7 +1074,19 @@
         getAction('/kuaishou/batch/getCampaignList', params).then(res => {
           if (res.success) {
             this.campaignType = res.result.records[0].campaignType
-            console.log(this.campaignType)
+
+
+            if(this.campaignType!=2){
+              getAction('/kuaishou/batch/getIsActivate', {
+                accountId: localStorage.getItem('accountId'),
+                campaignType:this.campaignType
+              }).then(res => {
+                if (res.success) {
+                  this.allForm.groupTypeData = res.result
+                }
+              })
+            }
+            // console.log(this.campaignType)
           }
         })
       },
@@ -1062,13 +1104,8 @@
       this.getAppList()
       this.getCampaignList()
       this.getMould()
-      getAction('/kuaishou/batch/getIsActivate', {
-        accountId: localStorage.getItem('accountId')
-      }).then(res => {
-        if (res.success) {
-          this.allForm.groupTypeData = res.result
-        }
-      })
+
+
 
       getAction('/kuaishou/batch/getWhiteList',{
         accountId:localStorage.getItem('accountId')

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

@@ -15,7 +15,7 @@
       <a-col :span="24" style="display: flex">
         <Treeselect :appId.sync="appId" :multiple="false" request="2,4" ref="treeSelect" style="margin: 8px 20px" />
         <a-button type="primary" style="margin: 10px" @click="addUser">搜索</a-button>
-        <a-button type="primary" style="margin: 10px; float: right" @click="newCreat">批量创建</a-button>
+        <!-- <a-button type="primary" style="margin: 10px; float: right" @click="newCreat">批量创建</a-button> -->
       </a-col>
     </a-row>
     <a-form layout="inline">

+ 1 - 3
src/views/modules/kuaishouapp/batchCreation/creat/creatUnit.vue

@@ -1882,11 +1882,9 @@ export default {
       this.templateList = []
       getAction('/batch/kuaishouTemplate/list', {
         accountId: accountId,
-        pageSize: 1000,
-        pageNo: 1,
       }).then((res) => {
         if (res.success) {
-          this.templateList = res.result.records.map((item, index) => {
+          this.templateList = res.result.map((item, index) => {
             return {
               ...item,
               key: index,

+ 1 - 3
src/views/modules/kuaishouapp/crossAccount/createUnit.vue

@@ -1418,11 +1418,9 @@ export default {
       this.templateList = []
       getAction('/batch/kuaishouTemplate/list', {
         accountId: accountId,
-        pageSize: 1000,
-        pageNo: 1,
       }).then((res) => {
         if (res.success) {
-          this.templateList = res.result.records.map((item, index) => {
+          this.templateList = res.result.map((item, index) => {
             return {
               ...item,
               key: index,

File diff suppressed because it is too large
+ 1839 - 616
src/views/modules/kuaishouapp/newBatch/index.vue


+ 189 - 34
src/views/modules/kuaishouapp/newBatch/lookPreview.vue

@@ -1,4 +1,10 @@
 <style scoped lang="scss">
+.slick-prev {
+  z-index: 1000000;
+}
+.slick-next {
+  z-index: 1000000;
+}
 .chouzhen {
   border-style: solid;
   border-width: 1px;
@@ -128,10 +134,17 @@ li.chouzhen.first:before {
       </div>
     </a-layout-header>
     <div style="width: 100%; padding: 0 20px" class="chartBox">
-      <a-card title="预览区">
+      <a-card>
+        <div slot="title">
+          <a-button style="margin: 0 15px 0 0" @click="backNewBatch" :disabled="newBatch"> 返回 </a-button>
+          预览区
+        </div>
         <div slot="extra">
           预估生成<span style="color: #409EFF">{{ groupCount }}</span
-          >个广告组 <a-button type="primary" style="margin: 0 15px"> 全部提交审核 </a-button>
+          >个广告组
+          <a-button type="primary" style="margin: 0 15px" @click="createAll" :disabled="groupCount == 0">
+            全部提交审核
+          </a-button>
         </div>
         <div v-if="campaignList">
           <h2 style="display: flex; justify-content: space-between">
@@ -148,12 +161,12 @@ li.chouzhen.first:before {
                 <a-button style="margin: 0 15px"> 批量修改 <a-icon type="down" /> </a-button>
               </a-dropdown>
               <a-popconfirm :title="`确定要删除这 ${groupCheck.length} 项吗?`" @confirm="handleConfirmDelete">
-                <a-button style="margin: 0 15px" :disabled="groupCheck.length == 0" @click="">
-                  批量删除广告组
-                </a-button>
+                <a-button style="margin: 0 15px" :disabled="groupCheck.length == 0"> 批量删除广告组 </a-button>
               </a-popconfirm>
 
-              <a-button type="primary" style="margin: 0 15px"> 全部提交审核 </a-button>
+              <a-button type="primary" style="margin: 0 15px" :disabled="groupCheck.length == 0" @click="createArr">
+                提交审核
+              </a-button>
             </div>
           </h2>
           <!-- <div v-for="(item, index) in campaignList" :key="index"></div> -->
@@ -170,7 +183,7 @@ li.chouzhen.first:before {
                   <span style="width: 10%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap"
                     >预算:{{ item.dayBudget ? item.dayBudget / 1000 + '元' : '不限' }}</span
                   >
-                  <a-checkbox style="width: 10%" v-model="item.checkAll" @click.stop> 全选 </a-checkbox>
+                  <!-- <a-checkbox style="width: 10%" v-model="item.checkAll" @click.stop="setAll(item)"> 全选 </a-checkbox> -->
                 </h3>
               </template>
               <a-table
@@ -210,31 +223,36 @@ li.chouzhen.first:before {
                 </span>
                 <span slot="dayBudget" slot-scope="text, records">
                   <p style="text-align: left">
-                    预算:{{ records.dayBudget || records.dayBudget == 0 ? records.dayBudget / 1000 + '元' : '不限' }}
+                    预算:{{ records.dayBudget || records.dayBudget > 0 ? records.dayBudget / 1000 + '元' : '不限' }}
                   </p>
                   <p style="text-align: left">
                     出价:{{ records.bid ? records.bid / 1000 : records.cpaBid ? records.cpaBid / 1000 : '' }}元
                   </p>
-                  <p style="text-align: left">
+                  <p style="text-align: left" v-if="records.deepConversionType">
                     深度转化出价:{{ records.deepConversionBid ? records.deepConversionBid / 1000 : '无' }}
                   </p>
                   <a-icon
                     type="edit"
                     style="float: left; color: #409EFF"
                     class="count"
-                    @click.stop="editBid(records, records.bid ? 'bid' : 'cpaBid')"
+                    @click.stop="editBid(records, records.bidType==2 ? 'bid' : 'cpaBid')"
                   />
                 </span>
                 <span slot="appId" slot-scope="text, records">
+                  <div style="width: 100%" v-if="text">
+                    <p style="text-align: left">
+                      {{ setAppName(text) }}
+                    </p>
+                    <a-icon
+                      type="edit"
+                      style="float: left; color: #409EFF; margin-top: 5px"
+                      class="count"
+                      @click="editAppAndSite(records)"
+                    />
+                  </div>
                   <p style="text-align: left">
-                    {{ setAppName(text) }}
+                    {{ records.url }}
                   </p>
-                  <a-icon
-                    type="edit"
-                    style="float: left; color: #409EFF; margin-top: 5px"
-                    class="count"
-                    @click="editAppAndSite(records)"
-                  />
                 </span>
                 <span slot="action" slot-scope="text, record">
                   <a-popconfirm :title="`确定要删除这项吗?`" @confirm="removeGroup(record.id)">
@@ -266,9 +284,9 @@ li.chouzhen.first:before {
                     @click.stop="editClickTrackUrl(records)"
                   />
                 </span>
-                <span slot="isSuccess" slot-scope="text, records">{{ text ? '待提交' : '提交成功' }}</span>
+                <span slot="isSuccess" slot-scope="text, records">{{ text == 0 ? '待提交' : '提交成功' }}</span>
                 <span slot="siteId" slot-scope="text, records">
-                  {{ text ? setSiteName(records.appId, text) : '无' }}
+                  {{ text ? text : '无' }}
                 </span>
               </a-table>
             </el-collapse-item>
@@ -313,13 +331,22 @@ li.chouzhen.first:before {
             <a-input-number
               v-decorator="['dayBudget']"
               style="width: 100%"
-              placeholder="不小于500,不超过100000000,仅支持输入自然数,如填0,则为不限"
+              :min="500"
+              :precision="0"
+              :max="100000000"
+              placeholder="不小于500,不超过100000000,仅支持输入自然数"
             />
           </a-form-item>
           <a-form-item label="出价">
-            <a-input-number v-decorator="['bid']" style="width: 100%" />
+            <a-input-number
+              v-decorator="['bid']"
+              style="width: 100%"
+              :max="getData('dayBudget', 'ruleConfigForm') ? getData('dayBudget', 'ruleConfigForm') : 3000"
+              :min="0"
+              :precision="2"
+            />
           </a-form-item>
-          <a-form-item label="深度转化出价">
+          <a-form-item label="深度转化出价" v-if="deepConversionType">
             <a-input-number v-decorator="['deepConversionBid']" style="width: 100%" />
           </a-form-item>
         </a-form>
@@ -337,7 +364,7 @@ li.chouzhen.first:before {
           <a-form-item label="应用">
             <a-select v-decorator="['appId']" style="width: 100%" allowClear @change="setSiteId">
               <a-select-option v-for="appModel in appListArr" :key="appModel.appId" :value="appModel.appId">
-                {{ appModel.appName }}
+                {{ appModel.appName }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ appModel.appVersion }}
               </a-select-option>
             </a-select>
           </a-form-item>
@@ -380,11 +407,21 @@ li.chouzhen.first:before {
       </a-modal>
 
       <a-modal title="素材预览" v-model="coverPreviewVisible" :width="1000" :footer="null">
-        <a-carousel arrows class="cover_carousel_con" v-if="videoData.length > 0">
+        <a-carousel arrows class="cover_carousel_con" v-if="videoData.length > 0" @next="next" @prev="prev">
           <div v-for="(item, index) in videoData" :key="index" class="content">
             <div style="display: flex !important; justify-content: space-around">
-              <img :src="item.videoUrl.coverUrl" :width="300" />
-              <img :src="item.imageUrl" :width="300" />
+              <div style="display: flex; flex-direction: column; align-items: center">
+                <!-- <video :src="item.videoUrl.coverUrl" :width="300" /> -->
+                <video class="video" :src="item.videoUrl.url" controls="controls" style="width: 300px">
+                  您的浏览器不支持 video 标签。
+                </video>
+                <span style="font-size: 20px; margin-top: 15px">视频素材</span>
+              </div>
+              <div style="display: flex; flex-direction: column; align-items: center">
+                <img :src="item.imageUrl" v-if="item.imageUrl" :width="300" />
+                <img :src="item.videoUrl.coverUrl" v-else :width="300" />
+                <span style="font-size: 20px; margin-top: 15px">封面素材</span>
+              </div>
             </div>
           </div>
           <a-icon
@@ -415,6 +452,7 @@ 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'
+import { stopOtherVideo, closeAllVideoFun } from '@/utils/videoControl' // 停止除当前外的其他视频播放,及停止所有视频播放的方法
 function tqFun(qcArr1) {
   var tempArr = []
   function bbFun(qcArr) {
@@ -465,6 +503,7 @@ export default {
   },
   data() {
     return {
+      newBatch: false,
       videoData: [],
       coverPreviewVisible: false,
       clickTrackUrlEditVisible: false,
@@ -601,9 +640,13 @@ export default {
       bid: null,
       dayBudget: null,
       deepConversionBid: null,
+      deepConversionType: false,
       siteList: [],
       allData: null,
       editAll: false,
+
+      groupIds: [],
+      campaignIds: [],
     }
   },
   computed: {
@@ -641,9 +684,73 @@ export default {
     // })
   },
   methods: {
+    next() {
+      closeAllVideoFun()
+    },
+    prev() {
+      closeAllVideoFun()
+    },
+    createArr() {
+      this.newBatch = true
+      var params = {}
+      params.accountId = this.accountId
+      params.dataList = {
+        campaigns: this.groupCheckRow.map((item) => {
+          return item.planId
+        }),
+        groups: this.groupCheck,
+      }
+      this.postDataAction('/kuaishouBatch/creativePreview/createAdcampaignAndGroups', params).then((res) => {
+        if (res.success) {
+          this.getAction('/kuaishouBatch/groupPreview/deleteBatch', {
+            ids: this.groupCheck.join(),
+          }).then((res) => {
+            if (res.success) {
+              this.groupCheck = []
+              this.getPreviewList()
+              setTimeout(() => {
+                var dataConunt = this.campaignList.filter((a) => {
+                  return a.kuaishouBatchGroupPreviews.length > 0
+                })
+                if (dataConunt.length > 0) {
+                } else {
+                  localStorage.removeItem('lookPreview')
+                  window.close()
+                }
+              })
+            }
+          })
+        }
+      })
+    },
+    setAll(item) {
+      //  groupIds:[],
+      // campaignIds:[]
+      setTimeout(() => {
+        if (item.checkAll) {
+          this.groupCheck.push(
+            ...item.kuaishouBatchGroupPreviews.map((i) => {
+              return i.id
+            })
+          )
+          this.groupCheckRow = JSON.parse(JSON.stringify(item.kuaishouBatchGroupPreviews))
+        } else {
+          for (let i = 0; i < item.kuaishouBatchGroupPreviews.length; i++) {
+            var index = this.groupCheck.findIndex((c) => c == item.kuaishouBatchGroupPreviews[i].id)
+            var indexTwo = this.groupCheckRow.findIndex((c) => c.id == item.kuaishouBatchGroupPreviews[i].id)
+            if (index > -1) {
+              this.groupCheck.splice(index, 1)
+            }
+            if (indexTwo > -1) {
+              this.groupCheckRow.splice(indexTwo, 1)
+            }
+          }
+        }
+      })
+    },
     handleConfirmDelete() {
-      this.getAction('/kuaishouBatch/campaignPreview/deleteBatch', {
-        ids: this.groupCheck,
+      this.getAction('/kuaishouBatch/groupPreview/deleteBatch', {
+        ids: this.groupCheck.join(),
       }).then((res) => {
         if (res.success) {
           this.groupCheck = []
@@ -655,6 +762,7 @@ export default {
     handleMenuClick(e) {
       if (e.key == '1') {
         this.bidEditVisible = true
+        this.bidType = this.campaignList[0].kuaishouBatchGroupPreviews[0].bidType==2?'bid':'cpaBid'
       } else {
         this.clickTrackUrlEditVisible = true
       }
@@ -662,6 +770,7 @@ export default {
       this.editAll = true
     },
     setSiteId(e) {
+      this.appIdConfigForm.setFieldsValue({ siteId: undefined })
       this.getSiteList(e)
     },
     getData(className, formName) {
@@ -725,7 +834,8 @@ export default {
       // })
     },
     setSiteName(appId, siteId) {
-      var data = null
+      var data = []
+
       this.getAction('/kuaishou/batch/getPageList', {
         accountId: this.accountId,
         appId: appId,
@@ -733,14 +843,11 @@ export default {
       }).then((res) => {
         if (res.success) {
           data = res.result.filter((item) => {
-            return item.siteId == siteId
+            return item.siteId == siteId + ''
           })
         } else {
         }
       })
-      if (data.length > 0) {
-        return data[0].name
-      }
     },
     editUnitName(item) {
       this.unitNameEditVisible = true
@@ -766,6 +873,7 @@ export default {
       this.bid = item[type] / 1000
       this.dayBudget = item.dayBudget / 1000
       this.deepConversionBid = item.deepConversionBid ? item.deepConversionBid / 1000 : null
+      this.deepConversionType = item.deepConversionType ? true : false
     },
     okUnitBid() {
       this.ruleConfigForm.validateFields((err, values) => {
@@ -806,7 +914,7 @@ export default {
       this.appIdEditVisible = true
       this.allData = item
       this.$nextTick(() => {
-        this.appIdConfigForm.setFieldsValue({ appId: item.appId, siteId: item.siteId })
+        this.appIdConfigForm.setFieldsValue({ appId: item.appId, siteId: item.siteId ? item.siteId + '' : undefined })
         this.getSiteList(item.appId)
       })
 
@@ -947,6 +1055,53 @@ export default {
         }
       })
     },
+    popstateFun() {
+      //监听浏览器回退的回调
+      window.history.pushState(null, null, document.URL) //想浏览器跳转记录中添加一条空记录
+    },
+    backNewBatch() {
+      var that = this
+      this.$confirm({
+        title: '返回不会保存你修改的信息,是否确定?',
+
+        onOk() {
+          window.open('/user/new-batch?accountId=' + that.accountId + '&batchId=' + that.batchId, '_self')
+          // window.close()
+        },
+        onCancel() {
+          console.log('Cancel')
+        },
+        class: 'test',
+      })
+    },
+    createAll() {
+      this.newBatch = true
+      var groupIds = []
+      for (let i = 0; i < this.campaignList.length; i++) {
+        for (let j = 0; j < this.campaignList[i].kuaishouBatchGroupPreviews.length; j++) {
+          groupIds.push(this.campaignList[i].kuaishouBatchGroupPreviews[j].id)
+        }
+      }
+      var params = {}
+      params.accountId = this.accountId
+      params.dataList = {
+        campaigns: this.campaignList.map((item) => {
+          return item.id
+        }),
+        groups: groupIds,
+      }
+      console.log(params)
+      this.postDataAction('/kuaishouBatch/creativePreview/createAdcampaignAndGroups', params).then((res) => {
+        this.$success({
+          title: '全部提交成功',
+          // JSX support
+          onOk: function () {
+            localStorage.removeItem('lookPreview')
+            window.close()
+          },
+        })
+      })
+    },
   },
 }
 </script>

+ 2 - 2
vue.config.js

@@ -79,13 +79,13 @@ module.exports = {
         // target: 'http://192.168.1.219:8080', //请求本地 需要jeecg-boot后台项目  赵西安
         // target: 'http://192.168.1.193:8080', //请求本地 需要jeecg-boot后台项目  李煜一
         // target: 'http://192.168.1.193:31012', //请求本地 需要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://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目
         //  target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.1.251/', //请求本地 需要jeecg-boot后台项目
         // target:'http://118.24.244.213:8804',
-       target:'http://139.186.151.174:8804', //测试
+      //  target:'http://139.186.151.174:8804', //测试
 
         ws: false,