朱鑫波 3 лет назад
Родитель
Сommit
24226f8948

+ 11 - 2
src/views/modules/autoLaunch/configLaunchInfo.vue

@@ -3075,8 +3075,12 @@ export default {
                  this.$message.error('请正确填写必填项目')
                  this.$message.error('请正确填写必填项目')
                  return 
                  return 
             }
             }
-
-            this.form.validateFields((err, values) => {
+            this.getAction('/auto/aiKuaishouAccountAutoStrategy/checkStrategy', {
+                accountId: this.accountId,
+                type: 0
+            }).then(res => {
+                if(res.success){
+                    this.form.validateFields((err, values) => {
                 //console.log(values) 
                 //console.log(values) 
                 if (!err) {  
                 if (!err) {  
                     let isNotComplete = this.descriptionList.findIndex(item => {
                     let isNotComplete = this.descriptionList.findIndex(item => {
@@ -3301,6 +3305,11 @@ export default {
                     this.$message.error('请正确填写必填项目')
                     this.$message.error('请正确填写必填项目')
                 }
                 }
             })
             })
+                }else{
+                    this.$message.error(res.message)
+                }
+            })
+
             
             
         })
         })
         
         

+ 16 - 5
src/views/modules/autoLaunchRevision/autoLaunchList.vue

@@ -39,7 +39,7 @@
                         <a-col :md="6" :sm="6" :xxl="8" style="display: flex;justify-content: flex-end;">
                         <a-col :md="6" :sm="6" :xxl="8" style="display: flex;justify-content: flex-end;">
                             <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" icon="search" @click="search">查询</a-button>
                                 <a-button type="primary" icon="search" @click="search">查询</a-button>
-                                <a-button  @click="handleResetForm" icon="reload" style="margin-left:10px"
+                                <a-button @click="handleResetForm" icon="reload" style="margin-left:10px"
                                     >重置</a-button
                                     >重置</a-button
                                 >
                                 >
                             </span>
                             </span>
@@ -96,6 +96,9 @@
                                 : '统一出价'
                                 : '统一出价'
                         }}
                         }}
                     </span>
                     </span>
+                    <span slot="customCreatedUnitCnt" slot-scope="text, record">
+                        {{ text + '/' + record.programCreatedUnitCnt }}
+                    </span>
                     <div slot="cpaBid" slot-scope="text, record">
                     <div slot="cpaBid" slot-scope="text, record">
                         <!-- {{
                         <!-- {{
                           text==0?record.roiRatio:
                           text==0?record.roiRatio:
@@ -125,7 +128,7 @@
                     </span>
                     </span>
                     <span slot="time" slot-scope="text, record"> {{ record.startTime }}至{{ record.endTime }} </span>
                     <span slot="time" slot-scope="text, record"> {{ record.startTime }}至{{ record.endTime }} </span>
                     <span slot="operator" slot-scope="text, record">
                     <span slot="operator" slot-scope="text, record">
-                        <a href="javascript:;" @click="goPlanList(record)">编辑</a>
+                        <a href="javascript:;" @click="goNewConfigInfo(record.id)">编辑</a>
                         <a-divider type="vertical" />
                         <a-divider type="vertical" />
                         <!-- <a href="javascript:;"  @click="deleteRecord(record)">删除</a>
                         <!-- <a href="javascript:;"  @click="deleteRecord(record)">删除</a>
                         <a-divider type="vertical" /> -->
                         <a-divider type="vertical" /> -->
@@ -315,6 +318,14 @@ const strategyColumns = [
         scopedSlots: { customRender: 'cpaBid' }
         scopedSlots: { customRender: 'cpaBid' }
         // sorter:() => {}
         // sorter:() => {}
     },
     },
+
+    {
+        title: '自定义/程序化创建数量',
+        dataIndex: 'customCreatedUnitCnt',
+        align: 'center',
+        scopedSlots: { customRender: 'customCreatedUnitCnt' }
+        // sorter:() => {}
+    },
     //   {
     //   {
     //         title: '是否开启程序化创建',
     //         title: '是否开启程序化创建',
     //         dataIndex: 'openProgramCreate',
     //         dataIndex: 'openProgramCreate',
@@ -435,7 +446,7 @@ export default {
             record.spin = true
             record.spin = true
 
 
             let status = text == 1 ? 0 : 1
             let status = text == 1 ? 0 : 1
-            getAction(`/ctop/aiKuaishouAdvertiserStrategy/oprateStatus`, {
+            this.postDataAction(`/auto/aiKuaishouAccountAutoStrategy/edit`, {
                 id: record.id,
                 id: record.id,
                 status
                 status
             }).then(res => {
             }).then(res => {
@@ -528,7 +539,7 @@ export default {
         },
         },
         goNewConfigInfo(id) {
         goNewConfigInfo(id) {
             // this.$router.push('/autoLaunch/configLaunchInfo')
             // this.$router.push('/autoLaunch/configLaunchInfo')
-            
+
             if (id) {
             if (id) {
                 window.open('/create-launch?id=' + id, '_blank')
                 window.open('/create-launch?id=' + id, '_blank')
             } else {
             } else {
@@ -570,7 +581,7 @@ export default {
             this.ipagination.current = 1
             this.ipagination.current = 1
             this.getStrategyList()
             this.getStrategyList()
         },
         },
-        handleResetForm(){
+        handleResetForm() {
             this.accountId = ''
             this.accountId = ''
             this.status = null
             this.status = null
             this.ipagination.current = 1
             this.ipagination.current = 1

+ 4 - 1
src/views/modules/autoLaunchRevision/components/targetedPopulation.vue

@@ -651,7 +651,7 @@ import { getAction, postAction } from '@/api/manage'
 import moment from 'moment'
 import moment from 'moment'
 import { mapGetters } from 'vuex'
 import { mapGetters } from 'vuex'
 import jq from 'jquery'
 import jq from 'jquery'
-
+import selectRegion from './selectRegion'
 import pick from 'lodash.pick'
 import pick from 'lodash.pick'
 let dateQuantumRangeConst = ''
 let dateQuantumRangeConst = ''
 const clickoutside = {
 const clickoutside = {
@@ -751,6 +751,9 @@ let retargetColumns = [
 
 
 export default {
 export default {
     name: 'new-create-template',
     name: 'new-create-template',
+    components:{
+        selectRegion
+    },
     props: {
     props: {
         campaignId: {
         campaignId: {
             type: String,
             type: String,

+ 405 - 239
src/views/modules/autoLaunchRevision/createLaunch.vue

@@ -1,4 +1,11 @@
 <style scoped lang="scss">
 <style scoped lang="scss">
+::v-deep.vue-treeselect__control {
+    line-height: 20px !important;
+}
+::v-deep .table-page-search-wrapper .ant-form-item .ant-form-item-control {
+    height: auto !important;
+    line-height: 20px !important;
+}
 /deep/.display-none-selset {
 /deep/.display-none-selset {
     display: none !important;
     display: none !important;
 }
 }
@@ -238,7 +245,7 @@ li.chouzhen.first:before {
                     <a-card class="search-box step-jump" title="选择项目">
                     <a-card class="search-box step-jump" title="选择项目">
                         <a-form layout="horizontal" v-bind="formItemLayout" :form="formProject">
                         <a-form layout="horizontal" v-bind="formItemLayout" :form="formProject">
                             <a-row :gutter="16">
                             <a-row :gutter="16">
-                                <a-col :span="16">
+                                <a-col :span="16" class=" table-page-search-wrapper">
                                     <a-form-item
                                     <a-form-item
                                         label="账户名称"
                                         label="账户名称"
                                         :labelCol="formItemLayout.labelCol"
                                         :labelCol="formItemLayout.labelCol"
@@ -254,7 +261,7 @@ li.chouzhen.first:before {
                                             ]"
                                             ]"
                                             style="display: inline-block;position: relative;margin-left: 0px;width:100%"
                                             style="display: inline-block;position: relative;margin-left: 0px;width:100%"
                                             :limit="1"
                                             :limit="1"
-                                            :disabled="$route.query.id"
+                                            :disabled="!!$route.query.id"
                                         />
                                         />
                                     </a-form-item>
                                     </a-form-item>
                                 </a-col>
                                 </a-col>
@@ -273,8 +280,8 @@ li.chouzhen.first:before {
                                             ]"
                                             ]"
                                         >
                                         >
                                             <a-radio-button :value="2">提升应用安装</a-radio-button>
                                             <a-radio-button :value="2">提升应用安装</a-radio-button>
-                                            <a-radio-button :value="5">收集销售线索</a-radio-button>
-                                            <a-radio-button :value="7">提高应用活跃</a-radio-button>
+                                            <a-radio-button :value="5" disabled>收集销售线索</a-radio-button>
+                                            <a-radio-button :value="7" disabled>提高应用活跃</a-radio-button>
                                         </a-radio-group>
                                         </a-radio-group>
                                     </a-form-item>
                                     </a-form-item>
                                 </a-col>
                                 </a-col>
@@ -1018,15 +1025,27 @@ li.chouzhen.first:before {
                                     </span>
                                     </span>
                                     <span v-else>-</span>
                                     <span v-else>-</span>
                                 </a-descriptions-item>
                                 </a-descriptions-item>
-                                <a-descriptions-item label="自定义组上限">
-                                    <span v-if="showCreativeData && showCreativeData.customUnitCnt">
-                                        {{ showCreativeData.customUnitCnt }}
+                                <a-descriptions-item label="自定义计划数量/组数量">
+                                    <span
+                                        v-if="
+                                            showCreativeData &&
+                                                showCreativeData.customPlanCnt &&
+                                                showCreativeData.customUnitCnt
+                                        "
+                                    >
+                                        {{ showCreativeData.customPlanCnt + '/' + showCreativeData.customUnitCnt }}
                                     </span>
                                     </span>
                                     <span v-else>-</span>
                                     <span v-else>-</span>
                                 </a-descriptions-item>
                                 </a-descriptions-item>
-                                <a-descriptions-item label="程序化组上限">
-                                    <span v-if="showCreativeData && showCreativeData.programUnitCnt">
-                                        {{ showCreativeData.programUnitCnt }}
+                                <a-descriptions-item label="程序化计划数量/组数量">
+                                    <span
+                                        v-if="
+                                            showCreativeData &&
+                                                showCreativeData.programUnitCnt &&
+                                                showCreativeData.programPlanCnt
+                                        "
+                                    >
+                                        {{ showCreativeData.programPlanCnt + '/' + showCreativeData.programUnitCnt }}
                                     </span>
                                     </span>
                                     <span v-else>-</span>
                                     <span v-else>-</span>
                                 </a-descriptions-item>
                                 </a-descriptions-item>
@@ -1138,7 +1157,7 @@ li.chouzhen.first:before {
                                         </span>
                                         </span>
                                         <a-radio-group
                                         <a-radio-group
                                             v-decorator="[
                                             v-decorator="[
-                                                'matchingLogic',
+                                                'matchType',
                                                 {
                                                 {
                                                     rules: [
                                                     rules: [
                                                         {
                                                         {
@@ -2185,17 +2204,17 @@ li.chouzhen.first:before {
                         </a-form-item>
                         </a-form-item>
                     </a-col>
                     </a-col>
                 </a-row>
                 </a-row>
-                <a-row :gutter="16">
+                <a-row :gutter="16" v-if="getFormData('formOriginality', 'unitType') != 7">
                     <a-col :span="16">
                     <a-col :span="16">
-                        <a-form-item label="关联封面数">
+                        <a-form-item label="自定义计划数量">
                             <a-input-number
                             <a-input-number
                                 style="width:200px"
                                 style="width:200px"
-                                :max="imageCntMax"
+                                :max="600"
                                 :step="1"
                                 :step="1"
                                 :min="1"
                                 :min="1"
                                 v-decorator="[
                                 v-decorator="[
-                                    'imageCnt',
-                                    { initialValue: 5, rules: [{ required: true, message: '请填写关联封面数' }] }
+                                    'customPlanCnt',
+                                    { initialValue: 5, rules: [{ required: true, message: '请填写自定义计划数量' }] }
                                 ]"
                                 ]"
                                 @change="setImageCnt"
                                 @change="setImageCnt"
                             />
                             />
@@ -2204,31 +2223,66 @@ li.chouzhen.first:before {
                 </a-row>
                 </a-row>
                 <a-row :gutter="16" v-if="getFormData('formOriginality', 'unitType') != 7">
                 <a-row :gutter="16" v-if="getFormData('formOriginality', 'unitType') != 7">
                     <a-col :span="16">
                     <a-col :span="16">
-                        <a-form-item label="自定义组上限">
+                        <a-form-item label="自定义组数量">
                             <a-input-number
                             <a-input-number
+                                style="width:200px"
+                                :max="unitCntMax"
+                                :step="1"
+                                :min="1"
                                 v-decorator="[
                                 v-decorator="[
                                     'customUnitCnt',
                                     'customUnitCnt',
-                                    { initialValue: 400, rules: [{ required: true, message: '请填写自定义组上限' }] }
+                                    { initialValue: 120, rules: [{ required: true, message: '请填写自定义组数量' }] }
                                 ]"
                                 ]"
-                                style="width: 100%"
+                                @change="setCreativeCntMax"
+                            />
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="16" v-if="getFormData('formOriginality', 'unitType') != 7">
+                    <a-col :span="16">
+                        <a-form-item label="自定义创意数量">
+                            <a-input-number
+                                style="width:200px"
+                                :max="creativeCntMax"
+                                :step="1"
+                                :min="1"
+                                v-decorator="[
+                                    'imageCnt',
+                                    { initialValue: 5, rules: [{ required: true, message: '请填写自定义创意数量' }] }
+                                ]"
+                            />
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="16" v-if="getFormData('formOriginality', 'unitType') != 4">
+                    <a-col :span="16">
+                        <a-form-item label="程序化计划数量">
+                            <a-input-number
+                                v-decorator="[
+                                    'programPlanCnt',
+                                    { initialValue: 3, rules: [{ required: true, message: '请填写程序化计划数量' }] }
+                                ]"
+                                style="width:200px"
                                 placeholder="仅支持输入自然数"
                                 placeholder="仅支持输入自然数"
-                                :max="900"
+                                :max="300"
                                 :precision="0"
                                 :precision="0"
+                                :step="1"
+                                @change="setProgramUnitCnt"
                             />
                             />
                         </a-form-item>
                         </a-form-item>
                     </a-col>
                     </a-col>
                 </a-row>
                 </a-row>
                 <a-row :gutter="16" v-if="getFormData('formOriginality', 'unitType') != 4">
                 <a-row :gutter="16" v-if="getFormData('formOriginality', 'unitType') != 4">
                     <a-col :span="16">
                     <a-col :span="16">
-                        <a-form-item label="程序化组上限">
+                        <a-form-item label="程序化组数量">
                             <a-input-number
                             <a-input-number
                                 v-decorator="[
                                 v-decorator="[
                                     'programUnitCnt',
                                     'programUnitCnt',
-                                    { initialValue: 60, rules: [{ required: true, message: '请填写程序化组上限' }] }
+                                    { initialValue: 100, rules: [{ required: true, message: '请填写程序化组数量' }] }
                                 ]"
                                 ]"
-                                style="width: 100%"
+                                style="width: 200px"
                                 placeholder="仅支持输入自然数"
                                 placeholder="仅支持输入自然数"
-                                :max="300"
+                                :max="imageCntMax"
                                 :precision="0"
                                 :precision="0"
                             />
                             />
                         </a-form-item>
                         </a-form-item>
@@ -2343,7 +2397,7 @@ li.chouzhen.first:before {
                                 </div>
                                 </div>
                             </div>
                             </div>
                             <div style="display:flex">
                             <div style="display:flex">
-                                <a style="margin-right:10px">选择广告语</a>
+                                <a style="margin-right:10px" @click="selectDescription">选择广告语</a>
                                 <a @click="importExcel">导入广告语</a>
                                 <a @click="importExcel">导入广告语</a>
                             </div>
                             </div>
                         </a-form-item>
                         </a-form-item>
@@ -2493,6 +2547,30 @@ li.chouzhen.first:before {
                 </a-button>
                 </a-button>
             </a-upload>
             </a-upload>
         </a-modal>
         </a-modal>
+        <a-modal v-model="selectDescriptionVisible" title="选择广告语">
+            <template slot="footer">
+                <a-button
+                    key="back"
+                    @click="
+                        selectDescriptionVisible = false
+                        selectDescriptionArr = []
+                    "
+                    >取消</a-button
+                >
+                <a-button key="submit" type="primary" @click="okDescription">
+                    确定
+                </a-button>
+            </template>
+            <a-checkbox-group v-model="selectDescriptionArr">
+                <a-list bordered :data-source="descriptionListCheck">
+                    <a-list-item slot="renderItem" slot-scope="item, index">
+                        <a-checkbox :value="item.textCopywriter">
+                            {{ item.textCopywriter }}
+                        </a-checkbox>
+                    </a-list-item>
+                </a-list>
+            </a-checkbox-group>
+        </a-modal>
 
 
         <templateModal ref="templateModal" @getData="getTargetPerson" />
         <templateModal ref="templateModal" @getData="getTargetPerson" />
     </div>
     </div>
@@ -2708,7 +2786,9 @@ export default {
             programUnitCnt: 60,
             programUnitCnt: 60,
             customUnitCnt: 400,
             customUnitCnt: 400,
             customUnitCntMax: 400,
             customUnitCntMax: 400,
-            imageCntMax: 15,
+            imageCntMax: 300,
+            unitCntMax: 600,
+            creativeCntMax: 15,
             actionBarTextList: [],
             actionBarTextList: [],
             descriptionList: [{ value: '' }],
             descriptionList: [{ value: '' }],
             fieldNames: {
             fieldNames: {
@@ -2719,6 +2799,9 @@ export default {
             createOptions: [],
             createOptions: [],
             showCreativeData: null,
             showCreativeData: null,
             importExcelVisible: false,
             importExcelVisible: false,
+            selectDescriptionVisible: false,
+            selectDescriptionArr: [],
+            descriptionListCheck: [],
             tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
             tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
             fileList: [],
             fileList: [],
             fileUrl: '',
             fileUrl: '',
@@ -2782,38 +2865,7 @@ export default {
         }
         }
     },
     },
     computed: {},
     computed: {},
-    watch: {
-        projectId: function(n, o) {
-            if (this.$route.query.id) {
-                return
-            } else {
-                if (n) {
-                    this.getAction('/kuaishouProjectStrategy/checkProjectisOpen', { projectId: n }).then(res => {
-                        console.log(res)
-                        if (res.success) {
-                            if (res.result === 1) {
-                                this.disabled = false
-                            } else {
-                                this.$message.error('此项目有开启的配置,无法新建配置')
-                                this.disabled = true
-                            }
-                        }
-                    })
-                    this.formProject.resetFields()
-                    this.formInformation.resetFields()
-                    this.formOptimize.resetFields()
-                    this.formMaterial.resetFields()
-                    this.multipleBidData = []
-                    this.appDetail = {}
-                    this.showCheckPerson = []
-                    this.checkPerson = []
-                    this.checkPersonAll = []
-                    this.showCreativeData = null
-                    this.description = [{ value: '' }]
-                }
-            }
-        }
-    },
+    watch: {},
     mounted() {
     mounted() {
         this.$nextTick(function() {
         this.$nextTick(function() {
             // this.accountId = 23212
             // this.accountId = 23212
@@ -2908,6 +2960,31 @@ export default {
         importExcel() {
         importExcel() {
             this.importExcelVisible = true
             this.importExcelVisible = true
         },
         },
+        selectDescription() {
+            this.selectDescriptionVisible = true
+            this.getDescriptionList()
+        },
+        okDescription() {
+            var data = this.selectDescriptionArr.map(item => {
+                return { value: item }
+            })
+            if (this.descriptionList[0].value == '') {
+                this.descriptionList = data
+            } else {
+                this.descriptionList.push(...data)
+            }
+        },
+        getDescriptionList() {
+            var params = {}
+            params.accountIds = JSON.stringify([this.getFormData('formProject', 'accountId')])
+            params.Keywords = null
+            params.pageNumber = 1
+            params.pageSize = 50
+
+            this.getAction('/document/library/getDocumentList', params).then(res => {
+                console.log(res)
+            })
+        },
         beforeUpload(file) {
         beforeUpload(file) {
             this.dataFile = $('.fileUpload').find('input')[0].files[0]
             this.dataFile = $('.fileUpload').find('input')[0].files[0]
             console.log(this.dataFile)
             console.log(this.dataFile)
@@ -3072,29 +3149,38 @@ export default {
             //             formMaterial: this.$form.createForm(this), //素材表单
             //             formMaterial: this.$form.createForm(this), //素材表单
         },
         },
         getQueryById(id) {
         getQueryById(id) {
-            this.getAction('/kuaishouProjectStrategy/queryById', { id }).then(res => {
+            this.getAction('/auto/aiKuaishouAccountAutoStrategy/queryById', { id }).then(res => {
                 if (res.success) {
                 if (res.success) {
                     this.getActionBarText()
                     this.getActionBarText()
-                    this.getAction('/ctop/userAllocation/getAccountListByProjectId', {
-                        projectId: res.result.projectId
-                    }).then(res => {
-                        if (res.success) {
-                            this.getAction('/kuaishou/batch/getCreativeCategory', {
-                                accountId: res.result[0].accountId
-                            }).then(result => {
-                                if (result.success) {
-                                    //console.log(res)
-                                    this.createOptions = result.result
-                                }
-                            })
+                    // this.getAction('/ctop/userAllocation/getAccountListByProjectId', {
+                    //     projectId: res.result.projectId
+                    // }).then(res => {
+                    //     if (res.success) {
+
+                    //     }
+                    // })
+
+                    this.getAction('/kuaishou/batch/getCreativeCategory', {
+                        accountId: res.result.accountId
+                    }).then(result => {
+                        if (result.success) {
+                            //console.log(res)
+                            this.createOptions = result.result
                         }
                         }
                     })
                     })
                     this.$nextTick(() => {
                     this.$nextTick(() => {
                         let data = res.result
                         let data = res.result
-                        this.projectName = data.projectName
-                        this.projectId = data.projectId
-                        this.formProject.setFieldsValue(pick(data, 'campaignType'))
-                        this.formInformation.setFieldsValue(pick(data, 'campaignName', 'groupName'))
+                        this.formProject.setFieldsValue(pick(data, 'campaignType', 'accountId'))
+
+                        this.formInformaData = {
+                            budgetType: data.campaignDayBudget ? '2' : '1',
+                            dayBudgetType: data.unitDayBudget ? '2' : '1',
+                            campaignName: data.campaignName,
+                            groupName: data.groupName,
+                            campaignDayBudget: data.campaignDayBudget ? data.campaignDayBudget / 1000 : undefined,
+                            unitDayBudget: data.unitDayBudget ? data.unitDayBudget / 1000 : undefined
+                        }
+
                         if (data.campaignDayBudget && data.campaignDayBudget > 0) {
                         if (data.campaignDayBudget && data.campaignDayBudget > 0) {
                             this.budgetType = '2'
                             this.budgetType = '2'
                             data.campaignDayBudget = data.campaignDayBudget / 1000
                             data.campaignDayBudget = data.campaignDayBudget / 1000
@@ -3160,7 +3246,7 @@ export default {
                             pick(data, 'bidType', 'ocpxActionType', 'deepConversionType', 'cpaBid', 'deepConversionBid')
                             pick(data, 'bidType', 'ocpxActionType', 'deepConversionType', 'cpaBid', 'deepConversionBid')
                         )
                         )
                         res.result.sourceMaterial = JSON.parse(res.result.sourceMaterial)
                         res.result.sourceMaterial = JSON.parse(res.result.sourceMaterial)
-                        this.formMaterial.setFieldsValue(pick(data, 'sourceMaterial', 'matchingLogic'))
+                        this.formMaterial.setFieldsValue(pick(data, 'sourceMaterial', 'matchType', 'materialKeyword'))
                         if (res.result.creativeCategory) {
                         if (res.result.creativeCategory) {
                             // let arr=[];
                             // let arr=[];
                             if (res.result.creativeCategory > 10000) {
                             if (res.result.creativeCategory > 10000) {
@@ -3195,7 +3281,9 @@ export default {
                             'unitType',
                             'unitType',
                             'sceneId',
                             'sceneId',
                             'imageCnt',
                             'imageCnt',
+                            'customPlanCnt',
                             'customUnitCnt',
                             'customUnitCnt',
+                            'programPlanCnt',
                             'programUnitCnt',
                             'programUnitCnt',
                             'channelType',
                             'channelType',
                             'assetMining',
                             'assetMining',
@@ -3205,58 +3293,87 @@ export default {
                             'creativeTag'
                             'creativeTag'
                         )
                         )
                         // this.appDetail = { platformOs: data.platformOs, singleAppid: 1 }
                         // this.appDetail = { platformOs: data.platformOs, singleAppid: 1 }
-                        this.postDataAction('/kuaishouAppPackage/getAppsDetail', {
-                            apptemIds: JSON.parse(data.appIdArray)
+                        this.postDataAction('/kuaishou/kuaiShouAppList/getAppNames', {
+                            appIdArray: JSON.parse(data.appIdArray)
                         }).then(result => {
                         }).then(result => {
                             if (result.success) {
                             if (result.success) {
                                 this.multipleBidData = result.result
                                 this.multipleBidData = result.result
                                 this.appDetail = {
                                 this.appDetail = {
                                     platformOs: result.result[0].platform < 3 ? 1 : 2,
                                     platformOs: result.result[0].platform < 3 ? 1 : 2,
                                     singleAppid: 1,
                                     singleAppid: 1,
-                                    appId: { key: result.result[0].apptemId },
-                                    schemaUri: res.result.schemaUri
+                                    appId: { key: result.result[0].appId },
+                                    schemaUri: res.result.schemaUri,
+                                    useChannel: this.useChannel
                                 }
                                 }
                             }
                             }
                         })
                         })
-                        this.checkPerson = JSON.parse(data.templateIdArray)
-                        this.checkPersonElse = JSON.parse(data.templateIdArray)
-                        this.postDataAction('/kuaishouDirectionalPackage/getProjectTargetByIds', {
-                            ids: this.checkPerson
-                        }).then(res => {
-                            if (res.success) {
-                                this.showCheckPerson = res.result.map(item => {
-                                    return {
-                                        ...item,
-                                        regionName: []
+                        this.useChannel = res.result.useChannel ? (res.result.useChannel == 1 ? true : false) : false
+
+                        if (this.useChannel) {
+                            var paramsData = {}
+                            paramsData.appIdArray = JSON.parse(data.appIdArray)
+                            this.postDataAction('/kuaishou/kuaiShouAppList/getAppNames', paramsData).then(result => {
+                                var params = {}
+                                params.appNameArray = result.result.map(item => {
+                                    return item.appName
+                                })
+                                params.accountId = data.accountId
+                                this.postDataAction('/channel/queryChannelLevel', params).then(res => {
+                                    if (res.code === 200) {
+                                        if (res.result) {
+                                            this.channelData = res.result
+                                        } else {
+                                            this.useChannel = false
+                                            this.$message.error(res.message)
+                                        }
+                                    } else {
+                                        this.useChannel = false
+                                        this.$message.error('该账户不能使用渠道号')
                                     }
                                     }
                                 })
                                 })
+                            })
+                        }
+                        this.checkPerson = JSON.parse(data.autoTargetArray)
+                        this.checkPersonElse = JSON.parse(data.autoTargetArray)
+                        if (data.autoTargetArray) {
+                            this.postDataAction('/auto/aiKuaishouAccountAutoTarget/getAutoTargetByIds', {
+                                ids: this.checkPerson
+                            }).then(res => {
+                                if (res.success) {
+                                    this.showCheckPerson = res.result.map(item => {
+                                        return {
+                                            ...item,
+                                            regionName: []
+                                        }
+                                    })
 
 
-                                for (let i = 0; i < this.showCheckPerson.length; i++) {
-                                    if (
-                                        this.showCheckPerson[i] &&
-                                        (this.showCheckPerson[i].region == '' ||
-                                            this.showCheckPerson[i].region == null ||
-                                            JSON.parse(this.showCheckPerson[i].region).length == 0)
-                                    ) {
-                                    } else {
-                                        // this.showRegion(this.personList[i].region, this.personList[i].regionName)
-                                        let that = this
-                                        new Promise((resolve, reject) => {
-                                            this.postDataAction('/kuaishou/batch/getRegionDetail', {
-                                                regionArr: that.showCheckPerson[i].region
-                                            }).then(res => {
-                                                if (res.success) {
-                                                    //   this.populationData.allForm.region = res.result
-                                                    that.showCheckPerson[i].regionName = res.result.map(item => {
-                                                        return item.label
-                                                    })
-                                                }
+                                    for (let i = 0; i < this.showCheckPerson.length; i++) {
+                                        if (
+                                            this.showCheckPerson[i] &&
+                                            (this.showCheckPerson[i].region == '' ||
+                                                this.showCheckPerson[i].region == null ||
+                                                JSON.parse(this.showCheckPerson[i].region).length == 0)
+                                        ) {
+                                        } else {
+                                            // this.showRegion(this.personList[i].region, this.personList[i].regionName)
+                                            let that = this
+                                            new Promise((resolve, reject) => {
+                                                this.postDataAction('/kuaishou/batch/getRegionDetail', {
+                                                    regionArr: that.showCheckPerson[i].region
+                                                }).then(res => {
+                                                    if (res.success) {
+                                                        //   this.populationData.allForm.region = res.result
+                                                        that.showCheckPerson[i].regionName = res.result.map(item => {
+                                                            return item.label
+                                                        })
+                                                    }
+                                                })
                                             })
                                             })
-                                        })
+                                        }
                                     }
                                     }
                                 }
                                 }
-                            }
-                        })
+                            })
+                        }
                     })
                     })
                 }
                 }
             })
             })
@@ -3265,9 +3382,7 @@ export default {
             let formProjectData = new Promise((resolve, reject) => {
             let formProjectData = new Promise((resolve, reject) => {
                 this.formProject.validateFields((err, values) => {
                 this.formProject.validateFields((err, values) => {
                     if (!err) {
                     if (!err) {
-                        if (this.projectId) {
-                            resolve({ ...values, projectId: this.projectId })
-                        }
+                        resolve({ ...values })
                     } else {
                     } else {
                         reject('选择项目表单出错')
                         reject('选择项目表单出错')
                     }
                     }
@@ -3301,116 +3416,150 @@ export default {
                     }
                     }
                 })
                 })
             })
             })
-            Promise.all([formProjectData, formInformationData, formOptimizeData, formMaterialData])
-                .then(res => {
-                    if (
-                        !this.showCreativeData ||
-                        this.showCheckPerson.length === 0 ||
-                        this.multipleBidData.length === 0
-                    ) {
-                        this.$message.error('请填写完整')
-                        return
-                    }
-                    this.sumbitLoading = true
-                    let params = { ...res[0], ...res[1], ...res[2], ...res[3], ...this.showCreativeData }
-                    if (this.budgetType === '2') {
-                        params.campaignDayBudget = params.campaignDayBudget * 1000
-                    } else {
-                        params.campaignDayBudget = 0
-                    }
-                    if (this.dayBudgetType === '2') {
-                        params.unitDayBudget = params.unitDayBudget * 1000
-                    } else {
-                        params.unitDayBudget = 0
-                    }
-                    if (params.cpaBid) {
-                        if ((params.cpaBid + '').includes('/')) {
-                            let bidArr = params.cpaBid.split('/')
-                            for (let index = 0; index < bidArr.length; index++) {
-                                bidArr[index] = bidArr[index] * 1000
+
+            this.getAction('/auto/aiKuaishouAccountAutoStrategy/checkStrategy', {
+                accountId: this.getFormData('formProject', 'accountId'),
+                type: 1
+            }).then(res => {
+                if (res.success) {
+                    Promise.all([formProjectData, formInformationData, formOptimizeData, formMaterialData])
+                        .then(res => {
+                            if (
+                                !this.showCreativeData ||
+                                this.showCheckPerson.length === 0 ||
+                                this.multipleBidData.length === 0
+                            ) {
+                                this.$message.error('请填写完整')
+                                return
                             }
                             }
-                            params.cpaBid = bidArr.join('/')
-                        } else if ((params.cpaBid + '').includes('-')) {
-                            let bidArr = params.cpaBid.split('-')
-                            for (let index = 0; index < bidArr.length; index++) {
-                                bidArr[index] = bidArr[index] * 1000
+                            this.sumbitLoading = true
+                            let params = {
+                                ...res[0],
+                                ...res[1],
+                                ...res[2],
+                                ...res[3],
+                                ...this.showCreativeData,
+                                ...this.formInformaData
                             }
                             }
-                            params.cpaBid = bidArr.join('-')
-                        } else {
-                            params.cpaBid = params.cpaBid * 1000
-                        }
-                    } else {
-                        params.cpaBid = 0
-                    }
-                    if (params.deepConversionBid && params.deepConversionBid != 0) {
-                        if ((params.deepConversionBid + '').includes('/')) {
-                            let bidArr = params.deepConversionBid.split('/')
-                            for (let index = 0; index < bidArr.length; index++) {
-                                bidArr[index] = bidArr[index] * 1000
+                            if (this.budgetType === '2') {
+                                params.campaignDayBudget = params.campaignDayBudget * 1000
+                            } else {
+                                params.campaignDayBudget = 0
                             }
                             }
-                            params.deepConversionBid = bidArr.join('/')
-                        } else if ((params.deepConversionBid + '').includes('-')) {
-                            let bidArr = params.deepConversionBid.split('-')
-                            for (let index = 0; index < bidArr.length; index++) {
-                                bidArr[index] = bidArr[index] * 1000
+                            if (this.dayBudgetType === '2') {
+                                params.unitDayBudget = params.unitDayBudget * 1000
+                            } else {
+                                params.unitDayBudget = 0
                             }
                             }
-                            params.deepConversionBid = bidArr.join('-')
-                        } else {
-                            params.deepConversionBid = params.deepConversionBid * 1000
-                        }
-                    } else {
-                        params.deepConversionBid = 0
-                    }
-                    if (params.creativeCategory && params.creativeCategory.length > 0) {
-                        params.creativeCategory = params.creativeCategory[params.creativeCategory.length - 1]
-                    } else {
-                        params.creativeCategory = undefined
-                    }
-                    params.creativeTag = params.creativeTag ? JSON.stringify(params.creativeTag) : undefined
-                    params.appIdArray = this.multipleBidData.map(res => {
-                        return res.apptemId
-                    })
-                    params.templateIdArray = this.showCheckPerson.map(item => {
-                        return item.id
-                    })
-                    params.description = JSON.stringify(
-                        this.descriptionList.map(item => {
-                            return item.value
-                        })
-                    )
-                    params.singleAppid = 1
-                    params.actionBarText = params.actionBarText.join()
-                    params.deepConversionType = params.deepConversionType ? params.deepConversionType : ''
-                    params.deepConversionBid = params.deepConversionBid ? params.deepConversionBid : ''
-                    if (this.$route.query.id) {
-                        params.id = this.$route.query.id
-                    }
-                    this.getAction('/kuaishouProjectStrategy/checkProjectisOpen', { projectId: params.projectId }).then(
-                        res => {
-                            if (res.success) {
-                                if (res.result === 1) {
-                                    this.postDataAction('/kuaishouProjectStrategy/createProjectStrategy', params).then(
-                                        res => {
-                                            if (res.success) {
-                                                this.sumbitLoading = false
-                                                window.close()
-                                            } else {
-                                                this.sumbitLoading = false
-                                                this.$message.error('创建失败')
-                                            }
-                                        }
-                                    )
+                            if (params.cpaBid) {
+                                if ((params.cpaBid + '').includes('/')) {
+                                    let bidArr = params.cpaBid.split('/')
+                                    for (let index = 0; index < bidArr.length; index++) {
+                                        bidArr[index] = bidArr[index] * 1000
+                                    }
+                                    params.cpaBid = bidArr.join('/')
+                                } else if ((params.cpaBid + '').includes('-')) {
+                                    let bidArr = params.cpaBid.split('-')
+                                    for (let index = 0; index < bidArr.length; index++) {
+                                        bidArr[index] = bidArr[index] * 1000
+                                    }
+                                    params.cpaBid = bidArr.join('-')
                                 } else {
                                 } else {
-                                    this.$message.error('此项目有开启的配置,无法新建配置')
-                                    this.sumbitLoading = false
+                                    params.cpaBid = params.cpaBid * 1000
                                 }
                                 }
+                            } else {
+                                params.cpaBid = 0
                             }
                             }
-                        }
-                    )
-                })
-                .catch(err => {
-                    this.$message.error('请填写完整')
-                })
+                            if (params.deepConversionBid && params.deepConversionBid != 0) {
+                                if ((params.deepConversionBid + '').includes('/')) {
+                                    let bidArr = params.deepConversionBid.split('/')
+                                    for (let index = 0; index < bidArr.length; index++) {
+                                        bidArr[index] = bidArr[index] * 1000
+                                    }
+                                    params.deepConversionBid = bidArr.join('/')
+                                } else if ((params.deepConversionBid + '').includes('-')) {
+                                    let bidArr = params.deepConversionBid.split('-')
+                                    for (let index = 0; index < bidArr.length; index++) {
+                                        bidArr[index] = bidArr[index] * 1000
+                                    }
+                                    params.deepConversionBid = bidArr.join('-')
+                                } else {
+                                    params.deepConversionBid = params.deepConversionBid * 1000
+                                }
+                            } else {
+                                params.deepConversionBid = 0
+                            }
+                            if (params.creativeCategory && params.creativeCategory.length > 0) {
+                                params.creativeCategory = params.creativeCategory[params.creativeCategory.length - 1]
+                            } else {
+                                params.creativeCategory = undefined
+                            }
+                            params.creativeTag = params.creativeTag ? JSON.stringify(params.creativeTag) : undefined
+                            params.appIdArray = JSON.stringify(
+                                this.multipleBidData.map(res => {
+                                    return res.appId
+                                })
+                            )
+                            params.autoTargetArray = this.showCheckPerson.map(item => {
+                                return item.id
+                            })
+                            params.description = JSON.stringify(
+                                this.descriptionList.map(item => {
+                                    return item.value
+                                })
+                            )
+                            params.singleAppid = 1
+                            params.actionBarText = params.actionBarText.join()
+                            params.deepConversionType = params.deepConversionType ? params.deepConversionType : ''
+                            params.deepConversionBid = params.deepConversionBid ? params.deepConversionBid : ''
+                            params.usageLevel =
+                                this.channelData && this.channelData ? this.channelData.channel.usageLevel : null
+                            params.useChannel = this.appDetail.useChannel ? 1 : 0
+                            params.sourceMaterial = JSON.stringify(params.sourceMaterial)
+                            params.sceneId = JSON.stringify(params.sceneId)
+                            params.autoTargetArray = JSON.stringify(params.autoTargetArray)
+                            if (this.$route.query.id) {
+                                params.id = this.$route.query.id
+                                this.postDataAction('/auto/aiKuaishouAccountAutoStrategy/edit', params).then(res => {
+                                    if (res.success) {
+                                        this.sumbitLoading = false
+                                        window.close()
+                                    } else {
+                                        this.sumbitLoading = false
+                                        this.$message.error('创建失败')
+                                    }
+                                })
+                            } else {
+                                this.postDataAction('/auto/aiKuaishouAccountAutoStrategy/add', params).then(res => {
+                                    if (res.success) {
+                                        this.sumbitLoading = false
+                                        window.close()
+                                    } else {
+                                        this.sumbitLoading = false
+                                        this.$message.error(res.message)
+                                    }
+                                })
+                            }
+                            // this.getAction('/kuaishouProjectStrategy/checkProjectisOpen', { projectId: params.projectId }).then(
+                            //     res => {
+                            //         if (res.success) {
+                            //             if (res.result === 1) {
+
+                            //             } else {
+                            //                 this.$message.error('此项目有开启的配置,无法新建配置')
+                            //                 this.sumbitLoading = false
+                            //             }
+                            //         }
+                            //     }
+                            // )
+                        })
+                        .catch(err => {
+                            this.$message.error('请填写完整')
+                        })
+                }else{
+                    this.$message.error(res.message)
+                }
+            })
         },
         },
         clearAllData() {
         clearAllData() {
             window.close()
             window.close()
@@ -3444,7 +3593,9 @@ export default {
         closeCreative() {
         closeCreative() {
             this.optimizeVisible = false
             this.optimizeVisible = false
             this.customUnitCntMax = 400
             this.customUnitCntMax = 400
-            this.imageCntMax = 15
+            this.imageCntMax = 300
+            this.unitCntMax = 600
+            this.creativeCntMax = 15
             this.formOriginality.resetFields()
             this.formOriginality.resetFields()
         },
         },
         submitCreative() {
         submitCreative() {
@@ -3484,15 +3635,32 @@ export default {
             }
             }
         },
         },
         unitTypeCheck(e) {
         unitTypeCheck(e) {
-            console.log(e.target.value)
+            // console.log(e.target.value)
             if (e.target.value === 7) {
             if (e.target.value === 7) {
-                this.imageCntMax = 8
+                this.imageCntMax = 300
             } else {
             } else {
-                this.imageCntMax = 15
+                this.unitCntMax = 600
+                this.creativeCntMax = 15
             }
             }
         },
         },
         setImageCnt(e) {
         setImageCnt(e) {
-            this.customUnitCntMax = e ? Math.floor(2000 / e) : 2000
+            this.unitCntMax = e ? Math.floor(600 / e) : 600
+            this.creativeCntMax = e
+                ? Math.floor(2000 / (e * this.getFormData('formOriginality', 'customUnitCnt'))) > 15
+                    ? 15
+                    : Math.floor(2000 / (e * this.getFormData('formOriginality', 'customUnitCnt')))
+                : 15
+        },
+        setCreativeCntMax(e) {
+            //  v-if="getFormData('formOriginality', 'unitType') != 7"
+            this.creativeCntMax = e
+                ? Math.floor(2000 / (e * this.getFormData('formOriginality', 'customPlanCnt'))) > 15
+                    ? 15
+                    : Math.floor(2000 / (e * this.getFormData('formOriginality', 'customPlanCnt')))
+                : 15
+        },
+        setProgramUnitCnt(e) {
+            this.imageCntMax = e ? Math.floor(300 / e) : 300
         },
         },
         creativeTagValid(rule, value, callback) {
         creativeTagValid(rule, value, callback) {
             //console.log(rule, value, callback)
             //console.log(rule, value, callback)
@@ -3688,12 +3856,14 @@ export default {
         },
         },
         formInfoShow() {
         formInfoShow() {
             this.$nextTick(() => {
             this.$nextTick(() => {
+                console.log(this.formInformaData)
                 if (this.formInformaData) {
                 if (this.formInformaData) {
                     this.formInformationVisible = true
                     this.formInformationVisible = true
                     this.budgetType = this.formInformaData.budgetType
                     this.budgetType = this.formInformaData.budgetType
                     this.dayBudgetType = this.formInformaData.dayBudgetType
                     this.dayBudgetType = this.formInformaData.dayBudgetType
-
-                    this.formInformation.setFieldsValue(pick(this.formInformaData, 'campaignName', 'groupName'))
+                    setTimeout(() => {
+                        this.formInformation.setFieldsValue(pick(this.formInformaData, 'campaignName', 'groupName'))
+                    }, 100)
                     if (this.budgetType == '2') {
                     if (this.budgetType == '2') {
                         setTimeout(() => {
                         setTimeout(() => {
                             this.formInformation.setFieldsValue(pick(this.formInformaData, 'campaignDayBudget'))
                             this.formInformation.setFieldsValue(pick(this.formInformaData, 'campaignDayBudget'))
@@ -4053,20 +4223,16 @@ export default {
         originalityEdit() {
         originalityEdit() {
             this.optimizeVisible = true
             this.optimizeVisible = true
             this.getActionBarText()
             this.getActionBarText()
-            this.getAction('/ctop/userAllocation/getAccountListByProjectId', { projectId: this.projectId }).then(
-                res => {
-                    if (res.success) {
-                        this.getAction('/kuaishou/batch/getCreativeCategory', {
-                            accountId: res.result[0].accountId
-                        }).then(result => {
-                            if (result.success) {
-                                //console.log(res)
-                                this.createOptions = result.result
-                            }
-                        })
-                    }
+
+            this.getAction('/kuaishou/batch/getCreativeCategory', {
+                accountId: this.getFormData('formProject', 'accountId')
+            }).then(result => {
+                if (result.success) {
+                    //console.log(res)
+                    this.createOptions = result.result
                 }
                 }
-            )
+            })
+
             this.$nextTick(() => {
             this.$nextTick(() => {
                 if (this.showCreativeData) {
                 if (this.showCreativeData) {
                     if (this.showCreativeData.unitType === 7) {
                     if (this.showCreativeData.unitType === 7) {