|
@@ -13,6 +13,15 @@
|
|
|
<a-radio-button value="6">磁力金牛</a-radio-button>
|
|
|
</a-radio-group>
|
|
|
</a-form-item>
|
|
|
+ <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="代理商名称">
|
|
|
+ <a-select optionFilterProp="children" showSearch :filterOption="filterOption"
|
|
|
+ v-decorator="['agentCode', validatorRules.agentCodeRule]">
|
|
|
+ <a-select-option :value="item.agentCode" v-for="(item, index) in agentCodeList" :key="index">
|
|
|
+ {{ item.agentName }}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="项目名称">
|
|
|
<a-input placeholder="请输入项目名称" v-decorator="['projectName', validatorRules.projectName]" />
|
|
|
</a-form-item>
|
|
@@ -54,7 +63,8 @@
|
|
|
</a-form-item>
|
|
|
<a-form-item v-if="model.mediaId == '1' || model.mediaId == '3'|| model.mediaId == '5'" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
|
|
label="最高转化出价">
|
|
|
- <a-input placeholder="最高转化出价" v-decorator="['maxDeepCpaBid']" addonAfter="元" />
|
|
|
+ <a-input placeholder="最高转化出价" v-decorator="['maxDeepCpaBid']" addonAfter="元"
|
|
|
+ @keyup.native="form.setFieldsValue({maxDeepCpaBid:getFormFieldValue('maxDeepCpaBid').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')})"/>
|
|
|
</a-form-item>
|
|
|
<div v-show="model.mediaId == '2' || model.mediaId == '4'|| model.mediaId == '6'">
|
|
|
<div v-if="model.mediaId == '2' || model.mediaId == '4'|| model.mediaId == '6'">
|
|
@@ -126,6 +136,54 @@
|
|
|
|
|
|
</div>
|
|
|
|
|
|
+ <div v-show="model.mediaId == '1' || model.mediaId == '3'|| model.mediaId == '5'">
|
|
|
+ <div v-if="model.mediaId == '1' || model.mediaId == '3'|| model.mediaId == '5'">
|
|
|
+ <a-form-item label="转化目标" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
+ <!-- v-model="model.ocpxActionType" -->
|
|
|
+ <a-select @change="ocpxActionToutiaoChange($event)" @deselect="ocpextiondeselect" v-decorator="[
|
|
|
+ 'ocpxActionType',
|
|
|
+ { rules: [{ required: true, message: '请选择转化目标' }] },
|
|
|
+ ]" mode="multiple">
|
|
|
+ <!-- <a-select-option :value="2">行为数</a-select-option> -->
|
|
|
+ <a-select-option :value="item.ocpxActionType" v-for="(item, index) in ocpxList.conversionType" :key="index">{{
|
|
|
+ item.ocpxActionName
|
|
|
+ }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <div v-if="Array.isArray(getFormFieldValue('ocpxActionType'))">
|
|
|
+ <a-form-item v-if="getFormFieldValue('ocpxActionType').length > 0" :labelCol="labelCol"
|
|
|
+ :wrapperCol="wrapperCol" 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="元" />
|
|
|
+ </a-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-if="Array.isArray(getFormFieldValue('ocpxActionType'))">
|
|
|
+ <a-form-item label="深度转化目标" :labelCol="labelCol" :wrapperCol="wrapperCol" >
|
|
|
+ <!-- v-model="model.ocpxActionType" -->
|
|
|
+ <a-select @change="depthToutiaoChange($event)" @deselect="depthChangedeselect" v-model="model.deepConversionType" mode="multiple">
|
|
|
+ <a-select-option :value="item.ocpxActionType" v-for="(item, index) in ocpxList.deepConversionType" :key="index">{{
|
|
|
+ item.ocpxActionName
|
|
|
+ }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <a-form-item v-show="model.deepConversionType.length >0" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
|
|
+ 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="元" />
|
|
|
+ </a-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售">
|
|
|
<a-select showSearch optionFilterProp="children" style="width: 100%" :filterOption="filterOption"
|
|
|
v-decorator="['saleId', { rules: [{ required: true, message: '请选择销售' }] }]">
|
|
@@ -191,8 +249,9 @@
|
|
|
advertiserId: { rules: [{ required: true, message: '请选择广告主!' }] },
|
|
|
productId: { rules: [{ required: true, message: '请选择产品!' }] },
|
|
|
supplierCode: { rules: [{ required: true, message: '请选择供应商!' }], initialValue: 'kuaishou_001' },
|
|
|
+ agentCodeRule: { rules: [{ required: true, message: '请选择代理商!' }] },
|
|
|
responsibleName: { rules: [{ required: true, message: '请选择负责人!' }] },
|
|
|
- maxBid: { rules: [{ required: true, message: '请输入最高出价!' }, { validator: this.validateInputCode }] },
|
|
|
+ maxBid: { rules: [{ required: false, message: '请输入最高出价!' }] },
|
|
|
},
|
|
|
url: {
|
|
|
add: '/ctop/project/add',
|
|
@@ -218,6 +277,7 @@
|
|
|
options: [],
|
|
|
optionsElse: [],
|
|
|
supplierList: [],
|
|
|
+ agentCodeList:[],
|
|
|
editAll: false,
|
|
|
ocpxList: [],
|
|
|
ocpxActionTypeArray: [],
|
|
@@ -227,6 +287,7 @@
|
|
|
},
|
|
|
created() {
|
|
|
this.getSupplierList()
|
|
|
+ this.getAgentCodeList()
|
|
|
},
|
|
|
methods: {
|
|
|
deepInput() {
|
|
@@ -277,6 +338,21 @@
|
|
|
this.model.deepConversionType = [];
|
|
|
}
|
|
|
},
|
|
|
+ ocpxActionToutiaoChange(item){
|
|
|
+ item.forEach(element => {
|
|
|
+ this.ocpxList.conversionType.find((par) => {
|
|
|
+ if (par.ocpxActionType == element) {
|
|
|
+
|
|
|
+ this.ocpxActionTypeArray.push({ ocpxCode: par.ocpxActionType, ocpxName: par.ocpxActionName,maxValue:undefined });
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ });
|
|
|
+ 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++) {
|
|
@@ -309,6 +385,17 @@
|
|
|
});
|
|
|
this.duplicate();
|
|
|
},
|
|
|
+ depthToutiaoChange(event){
|
|
|
+ this.depthArray = []
|
|
|
+ event.forEach(element => {
|
|
|
+ this.ocpxList.deepConversionType.find((par) => {
|
|
|
+ if (par.ocpxActionType == element) {
|
|
|
+ this.depthArray.push({ deepCode: par.ocpxActionType, deepName: par.ocpxActionName, deepValue: undefined })
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
duplicate(){
|
|
|
for (var i = 0; i < this.depthArray.length - 1; i++) {
|
|
|
for (var j = i + 1; j < this.depthArray.length; j++) {
|
|
@@ -321,11 +408,9 @@
|
|
|
}
|
|
|
},
|
|
|
depthChangedeselect(item){
|
|
|
- this.depthArray.forEach((element,index) => {
|
|
|
- if (element.deepCode == item) {
|
|
|
- this.depthArray.splice(index,1)
|
|
|
- }
|
|
|
- });
|
|
|
+ console.log(item, this.depthArray)
|
|
|
+ var index = this.depthArray.findIndex((v) => v.deepCode === item)
|
|
|
+ this.depthArray.splice(index, 1)
|
|
|
},
|
|
|
validateInputCode(rule, value, callback) {
|
|
|
if (value > 0) {
|
|
@@ -351,26 +436,30 @@
|
|
|
onChange(e) {
|
|
|
console.log(this.ocpxActionTypeArray);
|
|
|
console.log(e);
|
|
|
-
|
|
|
- if (e.target.value == 1 || e.target.value == 3) {
|
|
|
- // console.log(this.model.bidType);
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.form.setFieldsValue({maxBid:this.model.maxBid,bidType:this.model.bidType})
|
|
|
- })
|
|
|
+ this.getOcpxList()
|
|
|
+ this.depthArray = []
|
|
|
+ this.ocpxActionTypeArray = []
|
|
|
+ this.model.deepConversionType = []
|
|
|
+ this.form.resetFields()
|
|
|
+ // if (e.target.value == 1 || e.target.value == 3) {
|
|
|
+ // // console.log(this.model.bidType);
|
|
|
+ // this.$nextTick(()=>{
|
|
|
+ // this.form.setFieldsValue({maxBid:this.model.maxBid,bidType:this.model.bidType})
|
|
|
+ // })
|
|
|
|
|
|
- // this.form.maxBid = this.model.maxBid ? this.model.maxBid / 1000 : 0
|
|
|
- // console.log(this.form.getFieldValue('maxBid'));
|
|
|
- }else{
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.form.setFieldsValue({bidType:this.model.bidType})
|
|
|
- })
|
|
|
- setTimeout(()=>{
|
|
|
- this.form.setFieldsValue({ocpxActionType:this.model.ocpxActionType})
|
|
|
- },100)
|
|
|
- console.log(this.model.bidType);
|
|
|
+ // // this.form.maxBid = this.model.maxBid ? this.model.maxBid / 1000 : 0
|
|
|
+ // // console.log(this.form.getFieldValue('maxBid'));
|
|
|
+ // }else{
|
|
|
+ // this.$nextTick(()=>{
|
|
|
+ // this.form.setFieldsValue({bidType:this.model.bidType})
|
|
|
+ // })
|
|
|
+ // setTimeout(()=>{
|
|
|
+ // this.form.setFieldsValue({ocpxActionType:this.model.ocpxActionType})
|
|
|
+ // },100)
|
|
|
+ // console.log(this.model.bidType);
|
|
|
|
|
|
- }
|
|
|
- console.log(`checked = ${e.target.value}`)
|
|
|
+ // }
|
|
|
+ // console.log(`checked = ${e.target.value}`)
|
|
|
// this.form.resetFields([])
|
|
|
},
|
|
|
handleChange(value) {
|
|
@@ -407,6 +496,17 @@
|
|
|
})
|
|
|
.finally(() => { })
|
|
|
},
|
|
|
+ getAgentCodeList() {
|
|
|
+ // /agent/agentConfig/list
|
|
|
+ getAction('/agent/agentConfig/list').then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.success) {
|
|
|
+ this.agentCodeList = res.result.records
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
getSupplierList() {
|
|
|
var params = {}
|
|
|
getAction('/ctop/supplierList/list', { pageNo: 1, pageSize: 100 }).then((res) => {
|
|
@@ -485,19 +585,55 @@
|
|
|
console.log(params.deepConversionType);
|
|
|
this.depthArray = newArrayTwo
|
|
|
this.depthArray.forEach(item => {
|
|
|
- item.deepValue = item.deepValue ? item.deepValue / 1000 : 0
|
|
|
+ item.deepValue = item.deepValue ? item.deepValue / 1000 : undefined
|
|
|
});
|
|
|
console.log(this.depthArray);
|
|
|
} else {
|
|
|
var { ocpxActionType, deepConversionType, bidType, ...params } = record
|
|
|
+ let newArray = [];
|
|
|
+ newArray = record.ocpxActionType == null || record.ocpxActionType == '' ? [] : JSON.parse(record.ocpxActionType)
|
|
|
+ params.ocpxActionType = [];
|
|
|
+ newArray.forEach(element => {
|
|
|
+ if (element.ocpxCode) {
|
|
|
+ params.ocpxActionType.push(element.ocpxCode)
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ this.ocpxActionTypeArray = newArray
|
|
|
+ this.ocpxActionTypeArray.forEach(item => {
|
|
|
+ if (item.maxValue) {
|
|
|
+ item.maxValue = item.maxValue ? item.maxValue / 1000 : undefined
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ let newArrayTwo = [];
|
|
|
+ newArrayTwo = record.deepConversionType == null || record.deepConversionType == '' ? [] : JSON.parse(record.deepConversionType)
|
|
|
+ params.deepConversionType = [];
|
|
|
+ newArrayTwo.forEach(event => {
|
|
|
+ params.deepConversionType.push(event.deepCode)
|
|
|
+ });
|
|
|
+
|
|
|
+ let obj = {}
|
|
|
+ newArrayTwo = newArrayTwo.reduce((preVal,curVal) => {
|
|
|
+ obj[curVal.deepCode] ? "" : obj[curVal.deepCode] = preVal.push(curVal)
|
|
|
+ return preVal
|
|
|
+ },[])
|
|
|
+ console.log(params.deepConversionType);
|
|
|
+ this.depthArray = newArrayTwo
|
|
|
+ this.depthArray.forEach(item => {
|
|
|
+ item.deepValue = item.deepValue ? item.deepValue / 1000 : undefined
|
|
|
+ });
|
|
|
+ console.log(this.depthArray);
|
|
|
this.showDian = false
|
|
|
}
|
|
|
this.form.resetFields()
|
|
|
this.model = Object.assign({}, params)
|
|
|
console.log(this.model);
|
|
|
- this.model.maxBid = this.model.maxBid ? this.model.maxBid / 1000 : 0
|
|
|
- this.model.maxDeepCpaBid = this.model.maxDeepCpaBid ? this.model.maxDeepCpaBid / 1000 : 0
|
|
|
+ this.model.maxBid = this.model.maxBid ? this.model.maxBid / 1000 : undefined
|
|
|
+ this.model.maxDeepCpaBid = this.model.maxDeepCpaBid ? this.model.maxDeepCpaBid / 1000 : undefined
|
|
|
this.visible = true
|
|
|
+ this.getOcpxList()
|
|
|
this.$nextTick(() => {
|
|
|
console.log(this.model)
|
|
|
if (record.advertiserId) {
|
|
@@ -519,6 +655,7 @@
|
|
|
// 'advertiserType',
|
|
|
'saleId',
|
|
|
'bidType',
|
|
|
+ 'agentCode'
|
|
|
)
|
|
|
)
|
|
|
} else {
|
|
@@ -541,6 +678,7 @@
|
|
|
'bidType',
|
|
|
'ocpxActionType',
|
|
|
'deepConversionType',
|
|
|
+ 'agentCode'
|
|
|
)
|
|
|
)
|
|
|
}
|
|
@@ -595,11 +733,11 @@
|
|
|
}
|
|
|
var data = values.advertiserId
|
|
|
let formData = Object.assign(this.model, values)
|
|
|
- if (this.model.mediaId == 1 || this.model.mediaId == 3|| this.model.mediaId == 5) {
|
|
|
- this.ocpxActionTypeArray = [];
|
|
|
- this.depthArray = [];
|
|
|
- formData.bidType = [];
|
|
|
- }
|
|
|
+ // if (this.model.mediaId == 1 || this.model.mediaId == 3|| this.model.mediaId == 5) {
|
|
|
+ // this.ocpxActionTypeArray = [];
|
|
|
+ // this.depthArray = [];
|
|
|
+ // formData.bidType = [];
|
|
|
+ // }
|
|
|
|
|
|
if (this.maxBidShow) {
|
|
|
formData.maxBid = formData.maxBid * 1000
|
|
@@ -623,6 +761,9 @@
|
|
|
|
|
|
// formData.ocpxActionType = formData.bidType == 2 ? JSON.stringify([0]) : JSON.stringify(formData.ocpxActionType)
|
|
|
formData.bidType = JSON.stringify(formData.bidType)
|
|
|
+ if (this.model.mediaId == '1' || this.model.mediaId == '3'|| this.model.mediaId == '5') {
|
|
|
+ formData.bidType = '[]'
|
|
|
+ }
|
|
|
this.ocpxActionTypeArray.forEach(element => {
|
|
|
if (element.maxValue) {
|
|
|
element.maxValue = element.maxValue * 1000;
|
|
@@ -678,32 +819,41 @@
|
|
|
this.resId = key
|
|
|
},
|
|
|
getOcpxList() {
|
|
|
- this.getAction('/ocpx/kuaiShouOcpxActionTypeConfig/list').then((res) => {
|
|
|
- if (res.success) {
|
|
|
- this.ocpxList = res.result;
|
|
|
- // this.ocpxActionTypeArray = [];
|
|
|
- // this.model.ocpxActionType.forEach(element => {
|
|
|
- // this.ocpxList.find((par)=>{
|
|
|
- // if (par.ocpxActionType == element) {
|
|
|
- // this.ocpxActionTypeArray.push({ocpxCode:par.ocpxActionType,ocpxName:par.ocpxActionName});
|
|
|
- // }
|
|
|
- // })
|
|
|
- // });
|
|
|
- // if (this.model.deepConversionType) {
|
|
|
- // this.depthArray = [];
|
|
|
- // this.model.deepConversionType.forEach(element => {
|
|
|
- // this.depthList.find((par)=>{
|
|
|
- // if (par.value == element) {
|
|
|
- // this.depthArray.push({deepCode:par.value,deepName:par.name})
|
|
|
- // }
|
|
|
-
|
|
|
- // })
|
|
|
- // });
|
|
|
- // }
|
|
|
+ if(this.model.mediaId == '1' ||this.model.mediaId == '3'||this.model.mediaId == '5' ){
|
|
|
+ this.getAction('/ocpx/kuaiShouOcpxActionTypeConfig/bytedanceList').then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.ocpxList = res.result;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.getAction('/ocpx/kuaiShouOcpxActionTypeConfig/list').then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.ocpxList = res.result;
|
|
|
+ // this.ocpxActionTypeArray = [];
|
|
|
+ // this.model.ocpxActionType.forEach(element => {
|
|
|
+ // this.ocpxList.find((par)=>{
|
|
|
+ // if (par.ocpxActionType == element) {
|
|
|
+ // this.ocpxActionTypeArray.push({ocpxCode:par.ocpxActionType,ocpxName:par.ocpxActionName});
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // });
|
|
|
+ // if (this.model.deepConversionType) {
|
|
|
+ // this.depthArray = [];
|
|
|
+ // this.model.deepConversionType.forEach(element => {
|
|
|
+ // this.depthList.find((par)=>{
|
|
|
+ // if (par.value == element) {
|
|
|
+ // this.depthArray.push({deepCode:par.value,deepName:par.name})
|
|
|
+ // }
|
|
|
+
|
|
|
+ // })
|
|
|
+ // });
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
- }
|
|
|
- })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
},
|
|
|
}
|