Browse Source

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

魏志佳 4 years ago
parent
commit
fe2d11dbb4

+ 57 - 34
src/views/modules/kuaishouapp/account/stepForm/Step3.vue

@@ -432,21 +432,21 @@ li.chouzhen.first:before {
             </a-layout>
           </a-form-item>
 
-          <a-form-item label="创意分类" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-form-item label="创意分类" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="creativeCategorySwitch">
             <a-cascader
               :options="createOptions"
-              v-decorator="['creativeCategory']"
+              v-decorator="['creativeCategory',{ rules: [{ required: true, message: '创意分类必选' }] }]"
               :fieldNames="fieldNames"
               placeholder="请选择创意分类"
             />
           </a-form-item>
 
-          <a-form-item label="创意标签" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-form-item label="创意标签" :labelCol="labelCol" :wrapperCol="wrapperCol"  v-if="creativeCategorySwitch">
             <a-select
               mode="tags"
               style="width: 100%"
               placeholder="按回车生成标签"
-              v-decorator="['creativeTag', { validator: creativeTagValid }]"
+              v-decorator="['creativeTag',{ rules: [{ required: true, message: '创意标签必填' }] }]"
               dropdownClassName="display-none-selset"
               :token-separators="[',', ' ', ',']"
             >
@@ -541,7 +541,7 @@ li.chouzhen.first:before {
               >监测链接列表</a
             >
           </a-form-item>
-          <a-form-item label="第三方ActionBar点击监控链接" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-form-item label="第三方ActionBar点击监控链接" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="actionbarClickUrlSwitch">
             <a-input
               v-decorator="[
                 'actionbarClickUrl',
@@ -868,35 +868,35 @@ li.chouzhen.first:before {
       <span style="color: red" v-if="!showTrackUrlNameElse">名称重复</span>
     </a-modal>
     <a-modal title="监测链接列表" v-model="clickTrackUrlList" :width="1000" :footer="null">
-       <a-spin :spinning="spinning">
-      <a-row :gutter="10" class="onlny-click-track">
-        <a-col :sm="24" style="margin-bottom: 20px; z-index: 10">
-          <a-card class="search-box" style="over-flow: auto">
-            <!-- <a-input v-model="trackName"></a-input> -->
-            <a-input-search
-              placeholder="请输入监测链接名称"
-              enter-button="Search"
-              size="large"
-              @search="onSearch"
-              style="width: 40%; margin-bottom: 20px"
-              v-model="trackName"
-            />
-            <a-list size="large" bordered :dataSource="trackUrlList">
-              <a-list-item slot="renderItem" slot-scope="item" :title="item.trackUrl" style="line-height: 50px">
-                <div slot="actions">
-                  <a @click="okClickTrackUrl(item)">选择</a>
-                  <a-divider type="vertical" />
-                  <a @click="removeClickTrackUrl(item)">删除</a>
-                </div>
+      <a-spin :spinning="spinning">
+        <a-row :gutter="10" class="onlny-click-track">
+          <a-col :sm="24" style="margin-bottom: 20px; z-index: 10">
+            <a-card class="search-box" style="over-flow: auto">
+              <!-- <a-input v-model="trackName"></a-input> -->
+              <a-input-search
+                placeholder="请输入监测链接名称"
+                enter-button="Search"
+                size="large"
+                @search="onSearch"
+                style="width: 40%; margin-bottom: 20px"
+                v-model="trackName"
+              />
+              <a-list size="large" bordered :dataSource="trackUrlList">
+                <a-list-item slot="renderItem" slot-scope="item" :title="item.trackUrl" style="line-height: 50px">
+                  <div slot="actions">
+                    <a @click="okClickTrackUrl(item)">选择</a>
+                    <a-divider type="vertical" />
+                    <a @click="removeClickTrackUrl(item)">删除</a>
+                  </div>
 
-                {{ item.trackName }}
-                <a-input v-model="item.trackUrl" readOnly style="margin: 10px; width: 70%"></a-input>
-              </a-list-item>
-            </a-list>
-          </a-card>
-        </a-col>
-      </a-row>
-       </a-spin>
+                  {{ item.trackName }}
+                  <a-input v-model="item.trackUrl" readOnly style="margin: 10px; width: 70%"></a-input>
+                </a-list-item>
+              </a-list>
+            </a-card>
+          </a-col>
+        </a-row>
+      </a-spin>
     </a-modal>
   </a-card>
 </template>
@@ -945,7 +945,7 @@ export default {
       clickTrackUrlShow: false,
       clickTrackUrlShowType: '1',
       clickTrackUrlList: false,
-      spinning:false,
+      spinning: false,
       trackUrlList: [],
       trackUrlName: '',
       showSite: true,
@@ -1083,6 +1083,8 @@ export default {
       },
       tagName: '',
       optionsTag: [],
+      creativeCategorySwitch:false,
+      actionbarClickUrlSwitch:false,
     }
   },
   methods: {
@@ -2374,6 +2376,27 @@ export default {
           this.stickerStyles = []
         }
       })
+
+      getAction('/kuaishou/batch/getWhiteList', {
+        accountId: localStorage.getItem('accountId'),
+      }).then((res) => {
+        if (res.success) {
+          // console.log(res)
+          if (res.result) {
+            this.creativeCategorySwitch = res.result.creative_category_switch == 1 ? true : false
+            this.actionbarClickUrlSwitch = res.result.actionbar_click_url_switch == 1 ? true : false
+
+            // if (res.result.alliance_account == 1) {
+            //   this.allianceAccount = true
+            // } else {
+            //   this.allianceAccount = false
+            // }
+          } else {
+            this.creativeCategorySwitch = false
+            this.actionbarClickUrlSwitch = false
+          }
+        }
+      })
     })
   },
 }

+ 28 - 5
src/views/modules/kuaishouapp/account/stepForm/Step4.vue

@@ -380,21 +380,21 @@ li.chouzhen.first:before {
             </div>
           </a-form-item>
 
-          <a-form-item label="创意分类" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-form-item label="创意分类" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="creativeCategorySwitch">
             <a-cascader
               :options="createOptions"
-              v-decorator="['creativeCategory']"
+              v-decorator="['creativeCategory',{ rules: [{ required: true, message: '创意分类必选' }] }]"
               :fieldNames="fieldNames"
               placeholder="请选择创意分类"
             />
           </a-form-item>
 
-          <a-form-item label="创意标签" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-form-item label="创意标签" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="creativeCategorySwitch">
             <a-select
               mode="tags"
               style="width: 100%"
               placeholder="按回车生成标签"
-              v-decorator="['creativeTag', { validator: creativeTagValid }]"
+              v-decorator="['creativeTag',{ rules: [{ required: true, message: '创意标签必填' }] }]"
               dropdownClassName="display-none-selset"
               :token-separators="[',',' ',',']"
             >
@@ -477,7 +477,7 @@ li.chouzhen.first:before {
           </a-form-item>
           
           <!-- , { validator: handleConfirmValue } -->
-          <a-form-item label="第三方ActionBar点击监控链接" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-form-item label="第三方ActionBar点击监控链接" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="actionbarClickUrlSwitch">
             <a-input
               v-decorator="[
                 'actionbarClickUrl',
@@ -878,6 +878,8 @@ export default {
   },
   data() {
     return {
+      creativeCategorySwitch: false,
+      actionbarClickUrlSwitch: false,
       optionsTag: [],
       defaultProps: {
         children: 'children',
@@ -2443,6 +2445,27 @@ export default {
           this.stickerStyles = []
         }
       })
+
+      getAction('/kuaishou/batch/getWhiteList', {
+        accountId: localStorage.getItem('accountId'),
+      }).then((res) => {
+        if (res.success) {
+          // console.log(res)
+          if (res.result) {
+            this.creativeCategorySwitch = res.result.creative_category_switch == 1 ? true : false
+            this.actionbarClickUrlSwitch = res.result.actionbar_click_url_switch == 1 ? true : false
+
+            // if (res.result.alliance_account == 1) {
+            //   this.allianceAccount = true
+            // } else {
+            //   this.allianceAccount = false
+            // }
+          } else {
+            this.creativeCategorySwitch = false
+            this.actionbarClickUrlSwitch = false
+          }
+        }
+      })
     })
   },
 }

+ 134 - 44
src/views/modules/kuaishouapp/batchCreation/creat/creatUnit.vue

@@ -441,8 +441,15 @@
           :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
           v-if="item.bidType == 1"
         >
+                    <!-- v-model="item.bid" -->
           <a-input-number
-            v-model="item.bid"
+
+            v-decorator="[
+            'bid',
+            {
+              rules: [{ required: true, message: '出价必填' }],
+            },
+          ]"
             @change="showTip(index)"
             :style="{ borderColor: item.showTipCheck ? 'red' : '#d9d9d9' }"
             style="width: 100%"
@@ -458,10 +465,15 @@
           :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
           v-else
         >
+                    <!-- v-model="item.cpaBid" -->
           <a-input-number
-            v-model="item.cpaBid"
+
+            v-decorator="[
+            'cpaBid',
+            {
+              rules: [{ required: true, message: '目标成本必填' }],
+            },]"
             @change="showTip(index)"
-            :style="{ borderColor: item.showTipCheck ? 'red' : '#d9d9d9' }"
             style="width: 100%"
           >
           </a-input-number>
@@ -472,7 +484,7 @@
           }}</span>
           <span
             style="color: red; font-weight: 700"
-            v-else-if="item.ocpxActionType == 2 && item.cpaBid && item.cpaBid > 1"
+            v-else-if="item.ocpxActionType == 2 && getData('cpaBid') && getData('cpaBid') > 1"
           >
             行为出价大于1元,请注意!!!
           </span>
@@ -492,7 +504,7 @@
             @change="deep_conversion_bidTip(index)"
             :style="{ borderColor: item.deepConversionBidCheck ? 'red' : '#d9d9d9' }"
             style="width: 100%"
-            :disabled="item.cpaBid == ''"
+            :disabled="getData('cpaBid')==null||getData('cpaBid') == ''"
           ></a-input-number>
           <span style="color: red" v-if="item.deepConversionBidCheck"
             >深度转化目标成本必须高于优化目标成本,且不得高于3000元</span
@@ -503,7 +515,12 @@
           :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
           :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
         >
-          <a-input v-model="item.unitName" @change="checkGroup($event, index)"></a-input>
+        <!-- v-model="item.unitName"  -->
+          <a-input  v-decorator="[
+            'unitName',
+            {
+              rules: [{ required: true, message: '广告组必填' }],
+            },]" @change="checkGroup($event, index)"></a-input>
           <span style="color: red" v-if="item.unitNameCheck">广告组名称重复</span>
         </a-form-item>
       </div>
@@ -540,11 +557,25 @@
         ></a-input>
       </a-form-item>
       <a-form-item
+        label="创建类型"
+        :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+      >
+         <a-radio-group
+          buttonStyle="solid"
+          v-decorator="['createType', { rules: [{ required: true, message: '请选择目标应用' }], initialValue: '0' }]"
+          @change="getPageSize"
+        >
+          <a-radio-button value="0">单品</a-radio-button>
+          <a-radio-button value="1">混搭</a-radio-button>
+        </a-radio-group>
+      </a-form-item>
+      <a-form-item
         label="选择视频"
         :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
         :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
       >
-        <a @click="getVideoList()">选择视频</a> {{ videoList.length + '/' + getData('createCount') }}
+        <a @click="getVideoList()">选择视频</a> {{ videoList.length + '/' + (getData('createType')=='0'?getData('createCount'):getData('createCount')*15) }}
         <br />
         <div v-if="videoList.length > 0 && showVideo" style="display:flex;flex-wrap:wrap">
           <span v-for="(item, index) of videoList" :key="index" style="position: relative" class="width-video">
@@ -605,10 +636,11 @@
         label="创意分类"
         :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
         :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+        v-if="creativeCategorySwitch"
       >
         <a-cascader
           :options="createOptions"
-          v-decorator="['creativeCategory']"
+          v-decorator="['creativeCategory',{ rules: [{ required: true, message: '创意分类必选' }] }]"
           :fieldNames="fieldNames"
           placeholder="请选择创意分类"
         />
@@ -617,19 +649,19 @@
         label="创意标签"
         :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
         :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+        v-if="creativeCategorySwitch"
       >
         <a-select
           mode="tags"
           style="width: 100%"
           placeholder="按回车生成标签"
-          v-decorator="['creativeTag']"
+          v-decorator="['creativeTag',{ rules: [{ required: true, message: '创意标签必填' }] }]"
           dropdownClassName="display-none-selset"
           :token-separators="[',', ' ', ',']"
         >
         </a-select>
         <span v-if="getData('creativeTag') && getData('creativeTag').length > 10" style="color: red"
-          >创意标签最多填写10个,请删减</span
-        >
+        >创意标签最多填写10个,请删减</span>
         <br />
         <a-popconfirm @confirm="getInfo()">
           <div slot="title">
@@ -708,6 +740,7 @@
         label="第三方ActionBar点击监控链接"
         :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
         :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+        v-if="actionbarClickUrlSwitch"
       >
         <a-input v-decorator="['actionbarClickUrl']" placeholder="请输入第三方点击监控链接"> </a-input>
         <span style="color: red; position: relative; top: -10px">仅加白使用</span>
@@ -759,7 +792,8 @@
     >
       <a-tabs type="card" @change="callback" v-model="active" class="check-video">
         <div slot="tabBarExtraContent">
-          当前选择数量{{ sumContent  + '/' + getData('createCount') }}
+          当前选择数量
+          {{ sumContent + '/' + (getData('createType')=='0'?getData('createCount'):getData('createCount')*15) }}
           <a-button  type="primary" @click="tongbu()" :loading="tongbuLoading" style="margin-left:10px">
           刷新素材</a-button
         >
@@ -1181,6 +1215,8 @@ export default {
       ],
       templateList: [],
       allianceAccount: false,
+      creativeCategorySwitch: false,
+      actionbarClickUrlSwitch: false,
       tongbuLoading: false,
       convert: false,
       convertId: '',
@@ -1249,7 +1285,7 @@ export default {
       cunTitleVisible: false,
       cunTitleList: [],
       createCount: 0,
-      tongbuLoading:false
+      tongbuLoading: false,
     }
   },
   computed: {
@@ -1667,14 +1703,29 @@ export default {
         sum += this.checkVideoWai[i].length
       }
       this.sumContent = sum
-      if (sum > this.getData('createCount')) {
-        this.$message.error('最多选择' + this.getData('createCount') + '个素材')
-        this.checkVideo = []
-        this.sumContent = this.sumContent - 5
-        if (this.active == 0) {
-          this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
-        } else if (this.active == 1) {
-          this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
+      if (this.getData('createType') == '0') {
+        if (sum > this.getData('createCount')) {
+          this.$message.error('最多选择' + this.getData('createCount') + '个素材')
+          this.checkVideo = []
+          this.sumContent = this.sumContent - 5
+
+          if (this.active == 0) {
+            this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
+          } else if (this.active == 1) {
+            this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
+          }
+        }
+      } else {
+        if (sum > this.getData('createCount') * 15) {
+          this.$message.error('最多选择' + this.getData('createCount') * 15 + '个素材')
+          this.checkVideo = []
+          this.sumContent = this.sumContent - 15
+
+          if (this.active == 0) {
+            this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
+          } else if (this.active == 1) {
+            this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
+          }
         }
       }
     },
@@ -1699,14 +1750,28 @@ export default {
         sum += this.checkVideoWai[i].length
       }
       this.sumContent = sum
-      if (sum > this.getData('createCount')) {
-        this.$message.error('最多选择' + this.getData('createCount') + '个素材')
-        this.checkVideo.pop()
-        this.sumContent--
-        if (this.active == 0) {
-          this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
-        } else if (this.active == 1) {
-          this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
+
+      if (this.getData('createType') == '0') {
+        if (sum > this.getData('createCount')) {
+          this.$message.error('最多选择' + this.getData('createCount') + '个素材')
+          this.checkVideo.pop()
+          this.sumContent--
+          if (this.active == 0) {
+            this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
+          } else if (this.active == 1) {
+            this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
+          }
+        }
+      } else {
+        if (sum > this.getData('createCount') * 15) {
+          this.$message.error('最多选择' + this.getData('createCount') * 15 + '个素材')
+          this.checkVideo.pop()
+          this.sumContent--
+          if (this.active == 0) {
+            this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
+          } else if (this.active == 1) {
+            this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
+          }
         }
       }
     },
@@ -1872,11 +1937,11 @@ export default {
     addGroup() {
       this.allForm.group.push({
         bidType: 10,
-        bid: '',
-        cpaBid: '',
+        // bid: '',
+        // cpaBid: '',
         showTipCheck: false,
         deepConversionBidCheck: false,
-        unitName: '',
+        // unitName: '',
         unitNameCheck: false,
         deepConversionType: '',
         deepConversionBid: '',
@@ -1896,7 +1961,7 @@ export default {
     },
     deep_conversion_bidTip(index) {
       if (
-        this.allForm.group[index].deepConversionBid < this.allForm.group[index].cpaBid ||
+        this.allForm.group[index].deepConversionBid < this.getData('cpaBid') ||
         this.allForm.group[index].deepConversionBid > 3000
       ) {
         this.allForm.group[index].deepConversionBidCheck = true
@@ -1920,13 +1985,13 @@ export default {
     },
     showTip(index) {
       if (this.allForm.group[index].bidType == 1) {
-        if (this.allForm.group[index].bid < 0.2 || this.allForm.group[index].bid > this.maxBid) {
+        if (this.getData('bid') < 0.2 || this.getData('bid') > this.maxBid) {
           this.allForm.group[index].showTipCheck = true
         } else {
           this.allForm.group[index].showTipCheck = false
         }
       } else {
-        if (this.allForm.group[index].cpaBid < 1 || this.allForm.group[index].cpaBid > this.maxBid) {
+        if (this.getData('cpaBid') < 1 || this.getData('cpaBid') > this.maxBid) {
           this.allForm.group[index].showTipCheck = true
         } else {
           this.allForm.group[index].showTipCheck = false
@@ -2079,8 +2144,14 @@ export default {
     },
     handleSubmit(e) {
       e.preventDefault()
-      if (this.checkVideo.length < this.getData('createCount')) {
-        this.$message.error('选择的素材不能小于创建条数')
+      if (
+        this.checkVideo.length <
+        (this.getData('createType') == '0' ? this.getData('createCount') : this.getData('createCount') * 15)
+      ) {
+        // this.$message.error('选择的素材不能小于创建条数')
+        this.getData('createType') == '0'
+          ? this.$message.error('选择的素材不能小于创建条数')
+          : this.$message.error('选择的素材不能小于创建条数*15')
       } else {
         this.form.validateFields((err, values) => {
           if (!err) {
@@ -2088,8 +2159,7 @@ export default {
             var groupArr = this.allForm.group.map((item) => {
               return {
                 ...item,
-                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,
@@ -2097,6 +2167,8 @@ export default {
             })
             var json = {
               ...values,
+              cpaBid: values.cpaBid && values.cpaBid != '' ? values.cpaBid * 1000 : null,
+              bid: values.bid && values.bid != '' ? values.bid * 1000 : null,
               convertId: this.convertId ? this.convertId.key : null,
               dayBudget: values.dayBudget * 1000,
               photoArr: this.checkVideo,
@@ -2167,6 +2239,18 @@ export default {
     handleFocus() {
       // console.log('focus')
     },
+    getPageSize(data) {
+      if (data.target.value == '0') {
+        this.ipagination.pageSize = 5
+      } else if (data.target.value == '1') {
+        this.ipagination.pageSize = 15
+      }
+      this.videoList = []
+      this.checkVideo = []
+      this.checkVideoAll = []
+      this.checkVideoWai = []
+      this.sumContent = 0
+    },
     filterOption(input, option) {
       return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
     },
@@ -2308,13 +2392,19 @@ export default {
       if (res.success) {
         // console.log(res)
         if (res.result) {
-          if (res.result.alliance_account == 1) {
-            this.allianceAccount = true
-          } else {
-            this.allianceAccount = false
-          }
+          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
+
+          // if (res.result.alliance_account == 1) {
+          //   this.allianceAccount = true
+          // } else {
+          //   this.allianceAccount = false
+          // }
         } else {
           this.allianceAccount = false
+          this.creativeCategorySwitch = false
+          this.actionbarClickUrlSwitch = false
         }
       }
     })