|
@@ -30,7 +30,7 @@
|
|
|
:labelCol="labelCol"
|
|
|
:wrapperCol="wrapperCol"
|
|
|
label="供应商"
|
|
|
- v-if="model.mediaId == '2' || model.mediaId == '4'"
|
|
|
+ v-show="model.mediaId == '2' || model.mediaId == '4'"
|
|
|
>
|
|
|
<a-select
|
|
|
optionFilterProp="children"
|
|
@@ -70,15 +70,16 @@
|
|
|
</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="最高出价">
|
|
|
+ <a-form-item v-if="model.mediaId == '1' || model.mediaId == '3' || maxBidShow" :labelCol="labelCol" :wrapperCol="wrapperCol" label="最高出价">
|
|
|
<a-input placeholder="请输入最高出价" v-decorator="['maxBid', validatorRules.maxBid]" addonAfter="元" />
|
|
|
</a-form-item>
|
|
|
- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="最高转化出价">
|
|
|
+ <a-form-item v-if="model.mediaId == '1' || model.mediaId == '3'" :labelCol="labelCol" :wrapperCol="wrapperCol" label="最高转化出价">
|
|
|
<a-input placeholder="最高转化出价" v-decorator="['maxDeepCpaBid']" addonAfter="元" />
|
|
|
</a-form-item>
|
|
|
- <div v-if="model.mediaId == '2' || model.mediaId == '4'">
|
|
|
+ <div v-show="model.mediaId == '2' || model.mediaId == '4'">
|
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优化目标">
|
|
|
<a-select
|
|
|
+ @change="bidTypeChange($event)"
|
|
|
v-decorator="['bidType', { rules: [{ required: true, message: '请选择优化目标' }], initialValue: 2 }]"
|
|
|
mode="multiple"
|
|
|
>
|
|
@@ -101,9 +102,10 @@
|
|
|
>
|
|
|
<!-- v-model="model.ocpxActionType" -->
|
|
|
<a-select
|
|
|
+ @change="ocpxActionTypeChange($event)"
|
|
|
v-decorator="[
|
|
|
'ocpxActionType',
|
|
|
- { rules: [{ required: true, message: '请选择转化目标' }], initialValue: 2 },
|
|
|
+ { rules: [{ required: true, message: '请选择转化目标' }] },
|
|
|
]"
|
|
|
mode="multiple"
|
|
|
>
|
|
@@ -113,7 +115,49 @@
|
|
|
}}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
+
|
|
|
+ <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+'最高价'">
|
|
|
+ <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="depthChange($event)"
|
|
|
+ v-model="model.deepConversionType"
|
|
|
+
|
|
|
+ mode="multiple"
|
|
|
+ >
|
|
|
+ <a-select-option :value="item.deepCode" v-for="(item, index) in depthList" :key="index">{{
|
|
|
+ item.deepName
|
|
|
+ }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <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+'最高价'">
|
|
|
+ <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="销售">
|
|
@@ -220,6 +264,18 @@ export default {
|
|
|
},
|
|
|
list: [],
|
|
|
listProduct: [],
|
|
|
+ depthList:[
|
|
|
+ {
|
|
|
+ deepCode:3,
|
|
|
+ deepName:'付费(深度)'
|
|
|
+ },{
|
|
|
+ deepCode:7,
|
|
|
+ deepName:'次日留存'
|
|
|
+ },{
|
|
|
+ deepCode:92,
|
|
|
+ deepName:'付费roi'
|
|
|
+ },
|
|
|
+ ],
|
|
|
resId: '',
|
|
|
shejiId: '',
|
|
|
options: [],
|
|
@@ -227,12 +283,71 @@ export default {
|
|
|
supplierList: [],
|
|
|
editAll: false,
|
|
|
ocpxList: [],
|
|
|
+ ocpxActionTypeArray:[],
|
|
|
+ depthArray:[],
|
|
|
+ maxBidShow:false,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.getSupplierList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ deepInput(){
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ maxValueInput(){
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ bidTypeChange(item){
|
|
|
+ console.log(item);
|
|
|
+ // this.maxBidShow = item.findIndex((item) => item == 2)
|
|
|
+ let odx = item.indexOf(2)
|
|
|
+ if (odx == -1) {
|
|
|
+ this.maxBidShow = false;
|
|
|
+ }else{
|
|
|
+ this.maxBidShow = true;
|
|
|
+ }
|
|
|
+ // item.indexOf(item=>{
|
|
|
+ // console.log(item);
|
|
|
+ // if (item == 2) {
|
|
|
+ // console.log(this.maxBidShow);
|
|
|
+ // this.maxBidShow = true;
|
|
|
+ // }else{
|
|
|
+ // this.maxBidShow = false;
|
|
|
+
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ if (item.length == 0) {
|
|
|
+ this.model.deepConversionType = [];
|
|
|
+ this.depthArray = [];
|
|
|
+ this.ocpxActionTypeArray = [];
|
|
|
+ this.maxBidShow = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ocpxActionTypeChange(item){
|
|
|
+ this.ocpxActionTypeArray = [];
|
|
|
+ item.forEach(element => {
|
|
|
+ this.ocpxList.find((par)=>{
|
|
|
+ if (par.ocpxActionType == element) {
|
|
|
+ this.ocpxActionTypeArray.push({ocpxCode:par.ocpxActionType,ocpxName:par.ocpxActionName});
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ depthChange(event){
|
|
|
+ this.depthArray = [];
|
|
|
+ event.forEach(element => {
|
|
|
+ this.depthList.find((par)=>{
|
|
|
+ if (par.deepCode == element) {
|
|
|
+ this.depthArray.push({deepCode:par.deepCode,deepName:par.deepName,deepValue:par.deepValue})
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ });
|
|
|
+ console.log(this.depthArray);
|
|
|
+ },
|
|
|
validateInputCode(rule, value, callback) {
|
|
|
if (value > 0) {
|
|
|
callback()
|
|
@@ -240,9 +355,28 @@ export default {
|
|
|
callback('请输入大于0的最高报价!')
|
|
|
}
|
|
|
},
|
|
|
+ validateInputMaxNum(rule, value, callback){
|
|
|
+ if (value > 0 && value <= 999999) {
|
|
|
+ callback()
|
|
|
+ } else {
|
|
|
+ callback('请输入0~999999之间的出价')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ maxNumInput(obj){
|
|
|
+ console.log(obj);
|
|
|
+ obj.target.value = obj.target.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');
|
|
|
+ // console.log(this.form.setFieldsValue());
|
|
|
+ },
|
|
|
+
|
|
|
...mapGetters(['nickname', 'avatar', 'userInfo']),
|
|
|
onChange(e) {
|
|
|
+ console.log(e);
|
|
|
+ if (e.target.value == 1 || e.target.value == 3) {
|
|
|
+ this.ocpxActionTypeArray = [];
|
|
|
+ this.depthArray = [];
|
|
|
+ }
|
|
|
console.log(`checked = ${e.target.value}`)
|
|
|
+ // this.form.resetFields([])
|
|
|
},
|
|
|
handleChange(value) {
|
|
|
console.log(value)
|
|
@@ -296,6 +430,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
edit(record) {
|
|
|
+ console.log(record);
|
|
|
this.getSupplierList()
|
|
|
this.getList()
|
|
|
this.getOcpxList()
|
|
@@ -313,16 +448,52 @@ export default {
|
|
|
console.log(record)
|
|
|
var params = { ...record }
|
|
|
params.bidType = record.bidType == null || record.bidType == '' ? [] : JSON.parse(record.bidType)
|
|
|
- params.ocpxActionType =
|
|
|
- record.ocpxActionType == null || record.ocpxActionType == '' ? [] : JSON.parse(record.ocpxActionType)
|
|
|
+ // this.maxBidShow = params.bidType.findIndex((item) => item == 2)
|
|
|
+ params.bidType.findIndex(item=>{
|
|
|
+ if (item == 2) {
|
|
|
+ this.maxBidShow = true;
|
|
|
+ }else{
|
|
|
+ this.maxBidShow = false;
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ 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 : 0
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ let newArrayTwo = [];
|
|
|
+ newArrayTwo = record.deepConversionType == null || record.deepConversionType == '' ? [] : JSON.parse(record.deepConversionType)
|
|
|
+ params.deepConversionType = [];
|
|
|
+ newArrayTwo.forEach(event => {
|
|
|
+ params.deepConversionType.push(event.deepCode)
|
|
|
+ });
|
|
|
+ console.log( params.deepConversionType);
|
|
|
+ this.depthArray = newArrayTwo
|
|
|
+ this.depthArray.forEach(item => {
|
|
|
+ item.deepValue = item.deepValue ? item.deepValue / 1000 : 0
|
|
|
+ });
|
|
|
+ console.log( this.depthArray);
|
|
|
} else {
|
|
|
- var { ocpxActionType, bidType, ...params } = record
|
|
|
+ var { ocpxActionType,deepConversionType, bidType, ...params } = record
|
|
|
this.showDian = false
|
|
|
}
|
|
|
-
|
|
|
- console.log(record)
|
|
|
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.visible = true
|
|
@@ -346,7 +517,7 @@ export default {
|
|
|
'supplierCode',
|
|
|
// 'advertiserType',
|
|
|
'saleId',
|
|
|
- 'bidType'
|
|
|
+ 'bidType',
|
|
|
)
|
|
|
)
|
|
|
} else {
|
|
@@ -367,7 +538,8 @@ export default {
|
|
|
// 'advertiserType',
|
|
|
'saleId',
|
|
|
'bidType',
|
|
|
- 'ocpxActionType'
|
|
|
+ 'ocpxActionType',
|
|
|
+ 'deepConversionType',
|
|
|
)
|
|
|
)
|
|
|
}
|
|
@@ -399,7 +571,16 @@ export default {
|
|
|
handleOk() {
|
|
|
const that = this
|
|
|
// 触发表单验证
|
|
|
- this.form.validateFields((err, values) => {
|
|
|
+ let isEvery = this.ocpxActionTypeArray.every((item,i)=>{
|
|
|
+ return "maxValue" in item && item.maxValue != "" && item.maxValue*1000>=0&&item.maxValue*1000<=999999*1000
|
|
|
+ })
|
|
|
+ let deepIsEvery = this.depthArray.every((event,i)=>{
|
|
|
+ return "deepValue" in event && event.deepValue != "" && event.deepValue*1000>=0&&event.deepValue*1000<=999999*1000
|
|
|
+ })
|
|
|
+ if (!isEvery || !deepIsEvery) {
|
|
|
+ this.$message.warning('请输入0~999999之间的最高价')
|
|
|
+ }else{
|
|
|
+ this.form.validateFields((err, values) => {
|
|
|
if (!err) {
|
|
|
that.confirmLoading = true
|
|
|
let httpurl = ''
|
|
@@ -423,9 +604,25 @@ export default {
|
|
|
formData.designResponsibleId = values.designResponsibleId
|
|
|
formData.userId = formData.userId ? formData.userId : that.userInfo().id
|
|
|
|
|
|
- formData.ocpxActionType =
|
|
|
- formData.bidType == 2 ? JSON.stringify([0]) : JSON.stringify(formData.ocpxActionType)
|
|
|
+ // formData.ocpxActionType = formData.bidType == 2 ? JSON.stringify([0]) : JSON.stringify(formData.ocpxActionType)
|
|
|
formData.bidType = JSON.stringify(formData.bidType)
|
|
|
+ this.ocpxActionTypeArray.forEach(element => {
|
|
|
+ if (element.maxValue) {
|
|
|
+ element.maxValue = element.maxValue * 1000;
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ formData.ocpxActionType = this.ocpxActionTypeArray;
|
|
|
+ formData.ocpxActionTypeArray = this.ocpxActionTypeArray;
|
|
|
+ this.depthArray.forEach(element => {
|
|
|
+ if (element.deepValue) {
|
|
|
+ element.deepValue = element.deepValue * 1000;
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ formData.deepConversionType = this.depthArray;
|
|
|
+ formData.deepConversionTypeArray = this.depthArray;
|
|
|
httpAction(httpurl, formData, method)
|
|
|
.then((res) => {
|
|
|
if (res.success) {
|
|
@@ -441,6 +638,17 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
handleCancel() {
|
|
|
this.close()
|
|
@@ -455,7 +663,28 @@ export default {
|
|
|
getOcpxList() {
|
|
|
this.getAction('/ocpx/kuaiShouOcpxActionTypeConfig/list').then((res) => {
|
|
|
if (res.success) {
|
|
|
- this.ocpxList = res.result
|
|
|
+ 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})
|
|
|
+ // }
|
|
|
+
|
|
|
+ // })
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
},
|