Sfoglia il codice sorgente

Merge branch 'work-adver' into feature/work-test

liubei@c-top.com.cn 3 anni fa
parent
commit
3555c1e6e3

+ 24 - 5
src/views/modules/account-config/account-config.vue

@@ -23,6 +23,7 @@
                             <a-select-option value="CREATIVE_IMAGE_MODE_LARGE">大图横图</a-select-option>
                             <a-select-option value="CREATIVE_IMAGE_MODE_LARGE_VERTICAL">大图竖图</a-select-option>
                             <a-select-option value="CREATIVE_IMAGE_MODE_UNION_SPLASH">开屏</a-select-option>
+                            <a-select-option value="UNIVERSAL">通投智选</a-select-option>
                         </a-select>
                     </a-form-item>
                     <a-form-item label="状态">
@@ -62,8 +63,8 @@
                 <span slot="acountRelax" slot-scope="text, record">
                     <a-switch :checked="text === 0" @change="handleSwitchChang($event, record)"/>
                 </span>
-                <span slot="creativeImageMode" slot-scope="text">
-                    <span>{{ handleChangeCreativeImage(text) }}</span>
+                <span slot="creativeImageMode" slot-scope="text,record">
+                    <span>{{ handleChangeCreativeImage(text,record) }}</span>
                 </span>
                 <span solt="accountBudget" slot-scope="text, record">
                     {{ record.accountBudgetMode === '1' ? '不限' : text }}
@@ -430,9 +431,26 @@ export default {
         this.handleInitTable();
     },
     methods: {
+        
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
-        handleChangeCreativeImage(val) {
-            return val ? this.creativeImageOption.filter(item => item.id === val)[0].value : '-';
+        handleChangeCreativeImage(val,record) {
+            let orrr = []
+           if (record.inventoryCatalog == 'UNIVERSAL') {
+            // this.creativeImageOption.forEach(item=>{
+            //    val.split(',').forEach(element => {
+            //        if (item.id == element) {
+            //            orrr.push(item.value)
+                       
+            //        }
+            //    });
+            // })
+            return  record.inventoryCatalog != null && record.inventoryCatalog == 'UNIVERSAL' ?'通投智选' : '-'
+           }else{
+               return val ? this.creativeImageOption.filter(item => item.id === val)[0].value : '-';
+           }
+                
+            
+            
         },
         handleAccountMode(e) {
             this.budgetForm.budget = 1000;
@@ -552,7 +570,8 @@ export default {
             const paramsData = {
                 accountId: this.acountId,
                 status: this.searchStatus === 2 ? '' : this.searchStatus,
-                creativeImageMode: this.creativeStatus === 2 ? '' : this.creativeStatus,
+                creativeImageMode: this.creativeStatus === 2 || this.creativeStatus == 'UNIVERSAL'? '' : this.creativeStatus,
+                inventoryCatalog:this.creativeStatus == 'UNIVERSAL' ? 'UNIVERSAL' :'',
                 loginUserId: this.userInfo().id,
                 pageNo: this.tablePag.page,
                 pageSize: this.tablePag.size

+ 27 - 1
src/views/modules/account-config/components/configuration-modal.vue

@@ -2640,6 +2640,7 @@ export default {
             }
         },
         getAgeSelect(data) {
+            console.log(data);
             if (data.length > 1 && data.findIndex(item => item === 'NONE') === 0) {
                 data.splice(data.findIndex(item => item === 'NONE'), 1);
             }
@@ -2779,6 +2780,7 @@ export default {
                 this.pictureStatus = false;
                 this.creativeImageShow = true;
                 this.configForm.creativeImageMode.push('CREATIVE_IMAGE_MODE_VIDEO_VERTICAL');
+                // this.configForm.creativeImageMode = this.configForm.creativeImageMode.toString();
             }
             else if(e.target.value === 'd'){
                 this.configForm.radioChangeValue = '';
@@ -2789,6 +2791,7 @@ export default {
                 this.creativeImageShow = false;
                 this.configForm.creativeImageMode = [];
                 this.configForm.creativeImageMode.push('CREATIVE_IMAGE_MODE_VIDEO_VERTICAL');
+                // this.configForm.creativeImageMode = this.configForm.creativeImageMode.toString();
             }
             this.configForm.adUnionVideoType = '';
             // this.configForm.creativeImageMode = 'CREATIVE_IMAGE_MODE_VIDEO_VERTICAL';
@@ -3196,10 +3199,14 @@ export default {
                         else {
                             this.configForm.launchTimeInterval = 'buxian';
                         }
+                        console.log(
+                            detailData
+                        );
                         if (detailData.creativeSceneInventory) {
                             this.configForm.adverPosition = 'c';
                             this.configForm.radioChangeValue = detailData.creativeSceneInventory;
                         }
+                        
                         else if (detailData.creativeInventoryType) {
                             this.configForm.adverPosition = 'b';
                             this.configForm.checkboxChangeValue = detailData.creativeInventoryType.split(',');
@@ -3222,6 +3229,8 @@ export default {
                                 this.configForm.adDeliveryRange = '';
                             }
                             this.NewCheckboxChangeValue(this.configForm.checkboxChangeValue);
+                        }else if(detailData.inventoryCatalog == 'UNIVERSAL'){
+                            this.configForm.adverPosition  = 'd'
                         }
                         else {
                             this.configForm.adverPosition = 'a';
@@ -3232,7 +3241,14 @@ export default {
                             })
                         }
                         this.$nextTick(()=>{
-                            this.configForm.creativeImageMode = detailData.creativeImageMode;
+                            // this.configForm.creativeImageMode = detailData.creativeImageMode
+                            if (detailData.inventoryCatalog == 'UNIVERSAL') {
+                                this.creativeImageShow = false;
+                                this.configForm.creativeImageMode = detailData.creativeImageMode.split(',')
+                            }else{
+                                this.creativeImageShow = true
+                                this.configForm.creativeImageMode = detailData.creativeImageMode
+                            }
                         })
                         this.configForm.adInterestActionMode = detailData.adInterestActionMode;
                         this.configForm.creativeDisplayMode = detailData.creativeDisplayMode;
@@ -3670,6 +3686,10 @@ export default {
                     return;
                 }
                 paramsFormData.creativeSceneInventory = paramsFormData.radioChangeValue;
+            }else if (paramsFormData.adverPosition === 'd') {
+                paramsFormData.inventoryCatalog = 'UNIVERSAL';
+                paramsFormData.creativeSmartInventory = 'UNIVERSAL';
+                paramsFormData.adDeliveryRange = 'UNIVERSAL'
             }
             if (paramsFormData.launchTimeInterval === 'buxian') {
                 paramsFormData.adScheduleTime = '';
@@ -3712,6 +3732,12 @@ export default {
             paramsFormData.adKeywords = this.creativeTag;
             paramsFormData.copywritingNumber = paramsFormData.copywritingNumber?paramsFormData.copywritingNumber:0
             paramsFormData.userId = this.userInfo().id;
+            console.log(paramsFormData.creativeImageMode);
+            if (typeof paramsFormData.creativeImageMode == 'object'){
+                paramsFormData.creativeImageMode = paramsFormData.creativeImageMode.toString()
+            }
+            console.log(paramsFormData);
+            
             this.$refs.ruleForm.validate(valid => {
                 if (valid) {
                     this.sureLoading = true;

+ 46 - 27
src/views/modules/advertiser/AdvertiserList.vue

@@ -94,16 +94,27 @@
         :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>
+      <span slot="maxBid" slot-scope="text,record">{{ record.maxBid == 0? '-': record.maxBid / 1000 }}</span>
+      <span slot="ocpxActionType" slot-scope="text,record">
+        <div v-if="!!record.ocpxActionTypeArray&&record.ocpxActionTypeArray.length>0">
+          <span v-for="(item, index)  in record.ocpxActionTypeArray" :key="index"
+            >{{item.ocpxName}}({{(item.maxValue / 1000).toFixed(2)}})<br></span
+          >
+        </div>
+        <div v-else>-</div>
 
-          <!-- {{ text | ocpxActionType }} -->
-        </span>
+        <!-- {{ text | ocpxActionType }} -->
+      </span>
+      <span slot="deepConversionType" slot-scope="text,record">
+        <div v-if="!!record.deepConversionTypeArray&&record.deepConversionTypeArray.length != 0">
+          <span v-for="(item, index)  in record.deepConversionTypeArray" :key="index"
+            >{{item.deepName}}({{(item.deepValue / 1000).toFixed(2)}})<br></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"
@@ -137,8 +148,8 @@
             <a>删除</a>
           </a-popconfirm>
         </span>
-        <span slot="maxBid" slot-scope="text">{{ text / 1000 }}</span>
-        <span slot="maxDeepCpaBid" slot-scope="text">{{ text / 1000 }}</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-table>
@@ -257,21 +268,21 @@ const projectColumns = [
     dataIndex: 'advertiserId_dictText',
   },
   {
-    title: '最高出价',
+    title: '最高出价(元)',
     align: 'center',
     dataIndex: 'maxBid',
     scopedSlots: {
       customRender: 'maxBid',
     },
   },
-  {
-    title: '最高转化出价',
-    align: 'center',
-    dataIndex: 'maxDeepCpaBid',
-    scopedSlots: {
-      customRender: 'maxDeepCpaBid',
-    },
-  },
+  // {
+  //   title: '最高转化出价',
+  //   align: 'center',
+  //   dataIndex: 'maxDeepCpaBid',
+  //   scopedSlots: {
+  //     customRender: 'maxDeepCpaBid',
+  //   },
+  // },
   {
     title: '优化目标',
     align: 'center',
@@ -281,13 +292,22 @@ const projectColumns = [
     },
   },
   {
-    title: '转化目标',
+    title: '转化目标(出价/元)',
     align: 'center',
     dataIndex: 'ocpxActionType',
+    width: 150,
     scopedSlots: {
       customRender: 'ocpxActionType',
     },
-  },
+  },{
+          title: '深度转化目标(出价)',
+          align: 'center',
+          dataIndex: 'deepConversionType',
+          width: 150,
+          scopedSlots: {
+            customRender: 'deepConversionType',
+          },
+        },
   {
     title: '供应商',
     align: 'center',
@@ -312,6 +332,7 @@ const projectColumns = [
     title: '操作',
     dataIndex: 'actionProject',
     align: 'center',
+    width:100,
     scopedSlots: {
       customRender: 'actionProject',
     },
@@ -426,12 +447,14 @@ export default {
     clear(type) {
       this.queryParam.name = null
       this.queryParam.advertiserId = null
+      this.advertiserId = null
       this.queryParam.productId = null
       this.queryParam.id = null
       this.queryParam.productName = null
       this.queryParam.projectName = null
       this.allIdUser = {}
       this.loadData(1)
+      
     },
     addNew() {
       if (this.active == 'advertiser') {
@@ -448,11 +471,7 @@ export default {
         this.$refs.modalFormTwo.disableSubmit = false
       } else if (this.active == 'project') {
         this.$refs.modalFormThree.add({
-          advertiserId: this.queryParam.advertiserId
-            ? this.queryParam.advertiserId
-            : this.advertiserId
-            ? this.advertiserId
-            : undefined,
+          advertiserId: this.queryParam.advertiserId ? this.queryParam.advertiserId : this.advertiserId ? this.advertiserId : undefined,
           productId: this.queryParam.productId ? this.queryParam.productId : undefined,
         })
         this.$refs.modalFormThree.title = '新增'

+ 10 - 10
src/views/modules/advertiser/ProjectList.vue

@@ -121,7 +121,7 @@
         @change="handleTableChange"
       >
         <span slot="maxBid" slot-scope="text,record">{{ record.maxBid == 0? '-': record.maxBid / 1000 }}</span>
-        <span slot="maxDeepCpaBid" slot-scope="text">{{ text / 1000 }}</span>
+        <!-- <span slot="maxDeepCpaBid" slot-scope="text">{{ text / 1000 }}</span> -->
         <span slot="ocpxActionType" slot-scope="text,record">
           <div v-if="!!record.ocpxActionTypeArray&&record.ocpxActionTypeArray.length>0">
             <span v-for="(item, index)  in record.ocpxActionTypeArray" :key="index"
@@ -205,21 +205,21 @@ export default {
           dataIndex: 'advertiserId_dictText',
         },
         {
-          title: '最高出价',
+          title: '最高出价(元)',
           align: 'center',
           dataIndex: 'maxBid',
           scopedSlots: {
             customRender: 'maxBid',
           },
         },
-        {
-          title: '最高转化出价',
-          align: 'center',
-          dataIndex: 'maxDeepCpaBid',
-          scopedSlots: {
-            customRender: 'maxDeepCpaBid',
-          },
-        },
+        // {
+        //   title: '最高转化出价',
+        //   align: 'center',
+        //   dataIndex: 'maxDeepCpaBid',
+        //   scopedSlots: {
+        //     customRender: 'maxDeepCpaBid',
+        //   },
+        // },
         {
           title: '优化目标',
           align: 'center',

+ 36 - 6
src/views/modules/advertiser/modules/ProjectModal.vue

@@ -62,7 +62,7 @@
               <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-option :value="12">最大转化</a-select-option>
+              <a-select-option :value="12">最大转化</a-select-option>
             </a-select>
           </a-form-item>
           <div v-if="Array.isArray(getFormFieldValue('bidType'))">
@@ -72,7 +72,7 @@
                 getFormFieldValue('bidType').findIndex((item) => item == 12) > -1
               ">
               <!-- v-model="model.ocpxActionType" -->
-              <a-select @change="ocpxActionTypeChange($event)" v-decorator="[
+              <a-select @change="ocpxActionTypeChange($event)" @deselect="ocpextiondeselect" v-decorator="[
                   'ocpxActionType',
                   { rules: [{ required: true, message: '请选择转化目标' }] },
                 ]" mode="multiple">
@@ -86,7 +86,7 @@
             <div v-if="Array.isArray(getFormFieldValue('ocpxActionType'))">
               <a-form-item v-show="getFormFieldValue('ocpxActionType').length > 0" :labelCol="labelCol"
                 :wrapperCol="wrapperCol" v-for="(item, index) in ocpxActionTypeArray" :key="index"
-                :label="item.ocpxName+'最高价'">
+                :label="item.ocpxName+'最高价'">
                 <a-input @input="maxValueInput"
                   @keyup.native="item.maxValue = item.maxValue.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');"
                   placeholder="请输入最高出价" v-model="item.maxValue" addonAfter="元" />
@@ -94,7 +94,11 @@
             </div>
 
             <div v-if="Array.isArray(getFormFieldValue('ocpxActionType'))">
-              <a-form-item label="深度转化目标" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="getFormFieldValue('ocpxActionType').length > 0">
+              <a-form-item v-if="
+              getFormFieldValue('bidType').findIndex((item) => item == 10) > -1 ||
+              getFormFieldValue('bidType').findIndex((item) => item == 6) > -1||
+              getFormFieldValue('bidType').findIndex((item) => item == 12) > -1 || getFormFieldValue('ocpxActionType').length == 0
+            " label="深度转化目标" :labelCol="labelCol" :wrapperCol="wrapperCol" >
                 <!-- v-model="model.ocpxActionType" -->
                 <a-select @change="depthChange($event)" v-model="model.deepConversionType" mode="multiple">
                   <a-select-option :value="item.deepCode" v-for="(item, index) in depthList" :key="index">{{
@@ -106,7 +110,7 @@
 
             <div v-if="model.deepConversionType">
               <a-form-item v-show="model.deepConversionType.length >0" :labelCol="labelCol" :wrapperCol="wrapperCol"
-                v-for="(item, index) in depthArray" :key="index" :label="item.deepName+'最高价'">
+                v-for="(item, index) in depthArray" :key="index" :label="item.deepName+'最高价'">
                 <a-input placeholder="请输入最高出价" @input="deepInput"
                   @keyup.native="item.deepValue = item.deepValue.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');"
                   v-model="item.deepValue" addonAfter="元" />
@@ -234,6 +238,10 @@
           this.maxBidShow = false;
         } else {
           this.maxBidShow = true;
+          this.model.deepConversionType = [];
+          this.depthArray = [];
+          this.ocpxActionTypeArray = [];
+          // this.maxBidShow = false;
         }
         // item.indexOf(item=>{
         //   console.log(item);
@@ -253,19 +261,41 @@
         }
       },
       ocpxActionTypeChange(item) {
-        this.ocpxActionTypeArray = [];
+        // this.ocpxActionTypeArray = [];
         item.forEach(element => {
           this.ocpxList.find((par) => {
             if (par.ocpxActionType == element) {
+             
               this.ocpxActionTypeArray.push({ ocpxCode: par.ocpxActionType, ocpxName: par.ocpxActionName });
             }
 
           })
         });
+        this.deWeight();
         if (item.length == 0) {
           this.model.deepConversionType = [];
         }
       },
+      deWeight() {
+            for (var i = 0; i < this.ocpxActionTypeArray.length - 1; i++) {
+                for (var j = i + 1; j < this.ocpxActionTypeArray.length; j++) {
+                    if (this.ocpxActionTypeArray[i].ocpxName == this.ocpxActionTypeArray[j].ocpxName) {
+                        this.ocpxActionTypeArray.splice(j, 1);
+                        //因为数组长度减小1,所以直接 j++ 会漏掉一个元素,所以要 j--
+                        j--;
+                    }
+                }
+            }
+            // return this.ocpxActionTypeArray;
+            
+        },
+        ocpextiondeselect(item){
+          this.ocpxActionTypeArray.forEach((element,index) => {
+            if (element.ocpxCode == item) {
+              this.ocpxActionTypeArray.splice(index,1)
+            }
+          });
+        },
       depthChange(event) {
         this.depthArray = [];
         event.forEach(element => {

+ 31 - 6
src/views/modules/advertiser/modules/projectListModal.vue

@@ -55,7 +55,7 @@
               <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-option :value="12">最大转化</a-select-option>
+              <a-select-option :value="12">最大转化</a-select-option>
             </a-select>
           </a-form-item>
           <div v-if="Array.isArray(getFormFieldValue('bidType'))">
@@ -64,7 +64,7 @@
                 getFormFieldValue('bidType').findIndex((item) => item == 6) > -1||
                 getFormFieldValue('bidType').findIndex((item) => item == 12) > -1
               ">
-              <a-select v-model="model.ocpxActionType" @change="ocpxActionTypeChange($event)" mode="multiple">
+              <a-select v-model="model.ocpxActionType" @change="ocpxActionTypeChange($event)"  @deselect="ocpextiondeselect" mode="multiple">
                 <!-- <a-select-option :value="2">行为数</a-select-option> -->
                 <a-select-option :value="item.ocpxActionType" v-for="(item, index) in ocpxList" :key="item.id">{{
                   item.ocpxActionName
@@ -74,7 +74,7 @@
 
             <div v-if="model.ocpxActionType">
               <a-form-item v-show="model.ocpxActionType.length > 0" :labelCol="labelCol" :wrapperCol="wrapperCol"
-                v-for="(item, index) in ocpxActionTypeArray" :key="index" :label="item.ocpxName+'最高价'">
+                v-for="(item, index) in ocpxActionTypeArray" :key="index" :label="item.ocpxName+'最高价'">
                 <a-input @input="maxValueInput"
                   @keyup.native="item.maxValue = item.maxValue.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');"
                   placeholder="请输入最高出价" v-model="item.maxValue" addonAfter="元" />
@@ -97,7 +97,7 @@
 
           <div v-if="model.deepConversionType">
             <a-form-item v-show="model.deepConversionType.length >0" :labelCol="labelCol" :wrapperCol="wrapperCol"
-              v-for="(item, index) in depthArray" :key="index" :label="item.deepName+'最高价'">
+              v-for="(item, index) in depthArray" :key="index" :label="item.deepName+'最高价'">
               <a-input placeholder="请输入最高出价" @input="deepInput"
                 @keyup.native="item.deepValue = item.deepValue.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');"
                 v-model="item.deepValue" addonAfter="元" />
@@ -254,6 +254,11 @@
           this.maxBidShow = false;
         } else {
           this.maxBidShow = true;
+          this.model.deepConversionType = [];
+          this.model.ocpxActionType = [];
+          this.depthArray = [];
+          this.ocpxActionTypeArray = [];
+          // this.maxBidShow = false;
         }
         if (item.length == 0) {
           this.model.deepConversionType = [];
@@ -264,7 +269,7 @@
         }
       },
       ocpxActionTypeChange(item) {
-        this.ocpxActionTypeArray = [];
+        // this.ocpxActionTypeArray = [];
         item.forEach(element => {
           this.ocpxList.find((par) => {
             if (par.ocpxActionType == element) {
@@ -274,12 +279,32 @@
 
           })
         });
-
+        this.deWeight();
         if (item.length == 0) {
           this.model.deepConversionType = [];
         }
 
       },
+      deWeight() {
+            for (var i = 0; i < this.ocpxActionTypeArray.length - 1; i++) {
+                for (var j = i + 1; j < this.ocpxActionTypeArray.length; j++) {
+                    if (this.ocpxActionTypeArray[i].ocpxName == this.ocpxActionTypeArray[j].ocpxName) {
+                        this.ocpxActionTypeArray.splice(j, 1);
+                        //因为数组长度减小1,所以直接 j++ 会漏掉一个元素,所以要 j--
+                        j--;
+                    }
+                }
+            }
+            // return this.ocpxActionTypeArray;
+            
+        },
+        ocpextiondeselect(item){
+          this.ocpxActionTypeArray.forEach((element,index) => {
+            if (element.ocpxCode == item) {
+              this.ocpxActionTypeArray.splice(index,1)
+            }
+          });
+        },
       depthChange(event) {
         this.depthArray = [];
         event.forEach(element => {