|
@@ -1,4 +1,7 @@
|
|
|
<style scoped lang="scss">
|
|
|
+::v-deep.ant-form-item {
|
|
|
+ margin-bottom: 10px !important;
|
|
|
+}
|
|
|
::v-deep.vue-treeselect__control {
|
|
|
line-height: 36px !important;
|
|
|
}
|
|
@@ -217,80 +220,7 @@ li.chouzhen.first:before {
|
|
|
<a-col :sm="24" style="margin-bottom: 20px; z-index: 10" id="container">
|
|
|
<a-card class="search-box step-jump">
|
|
|
<a-form layout="horizontal" v-bind="formItemLayout" :form="formProject">
|
|
|
- <a-row
|
|
|
- :gutter="16"
|
|
|
- v-if="createTypeData && !!!createTypeData.accountId && !!!createTypeData.projectId"
|
|
|
- >
|
|
|
- <a-col :span="16">
|
|
|
- <a-form-item label="使用范围">
|
|
|
- <a-radio-group
|
|
|
- button-style="solid"
|
|
|
- v-decorator="[
|
|
|
- 'usageRange',
|
|
|
- {
|
|
|
- rules: [{ required: true, message: '使用范围必选' }],
|
|
|
- initialValue: 2
|
|
|
- }
|
|
|
- ]"
|
|
|
- >
|
|
|
- <a-radio-button :value="2">项目</a-radio-button>
|
|
|
- <a-radio-button :value="1">账户</a-radio-button>
|
|
|
- </a-radio-group>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- <a-row
|
|
|
- :gutter="16"
|
|
|
- v-if="getFormData('usageRange') == 2 || getFormData('usageRange') == undefined"
|
|
|
- >
|
|
|
- <a-col :span="16">
|
|
|
- <a-form-item
|
|
|
- :label="
|
|
|
- createTypeData && !!!createTypeData.accountId
|
|
|
- ? !!!createTypeData.projectId
|
|
|
- ? '选择项目'
|
|
|
- : '项目ID'
|
|
|
- : '账户ID'
|
|
|
- "
|
|
|
- >
|
|
|
- <Treeselect
|
|
|
- style="width:600px"
|
|
|
- v-decorator="[
|
|
|
- 'projectId',
|
|
|
- {
|
|
|
- rules: [{ required: true, message: '项目必选' }]
|
|
|
- }
|
|
|
- ]"
|
|
|
- v-if="
|
|
|
- createTypeData &&
|
|
|
- !!!createTypeData.accountId &&
|
|
|
- !!!createTypeData.projectId
|
|
|
- "
|
|
|
- />
|
|
|
- <span v-else>{{
|
|
|
- createTypeData.accountId
|
|
|
- ? createTypeData.accountId
|
|
|
- : createTypeData.projectId
|
|
|
- }}</span>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- <a-row :gutter="16" v-else>
|
|
|
- <a-col :span="16">
|
|
|
- <a-form-item label="选择账户">
|
|
|
- <treeSelectAccount
|
|
|
- style="width:600px"
|
|
|
- v-decorator="[
|
|
|
- 'accountId',
|
|
|
- {
|
|
|
- rules: [{ required: true, message: '账户必选' }]
|
|
|
- }
|
|
|
- ]"
|
|
|
- />
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- <a-row :gutter="16" v-if="createTypeData && createTypeData.createType == '1'">
|
|
|
+ <a-row :gutter="16">
|
|
|
<a-col :span="16">
|
|
|
<a-form-item label="编号位数">
|
|
|
<a-select
|
|
@@ -315,62 +245,19 @@ li.chouzhen.first:before {
|
|
|
<a-row :gutter="16" v-if="createTypeData && createTypeData.createType == '1'">
|
|
|
<a-col :span="16">
|
|
|
<a-form-item label="编号">
|
|
|
- <a-input-number
|
|
|
- v-decorator="[
|
|
|
- 'numberMin',
|
|
|
- {
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请输入正确的编号',
|
|
|
- validator: numberMinCheck
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- ]"
|
|
|
- :precision="0"
|
|
|
- :min="1"
|
|
|
- :max="
|
|
|
- getFormData('numberLength') == 0
|
|
|
- ? 999999
|
|
|
- : getFormData('numberLength') == 3
|
|
|
- ? 999
|
|
|
- : getFormData('numberLength') == 4
|
|
|
- ? 9999
|
|
|
- : getFormData('numberLength') == 5
|
|
|
- ? 99999
|
|
|
- : 999999
|
|
|
- "
|
|
|
- />
|
|
|
- ~
|
|
|
- <a-input-number
|
|
|
+ <a-input
|
|
|
+ style="width:300px"
|
|
|
v-decorator="[
|
|
|
- 'numberMax',
|
|
|
+ 'numberValue',
|
|
|
{
|
|
|
rules: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '编号位数限制12312'
|
|
|
- }
|
|
|
+ { required: true, message: ' ' },
|
|
|
+ { validator: cpaBidValid }
|
|
|
]
|
|
|
}
|
|
|
]"
|
|
|
- @change="numberMaxCheck"
|
|
|
- @blur="numberMaxCheck"
|
|
|
- :precision="0"
|
|
|
- :min="1"
|
|
|
- :max="
|
|
|
- getFormData('numberLength') == 0
|
|
|
- ? 999999
|
|
|
- : getFormData('numberLength') == 3
|
|
|
- ? 999
|
|
|
- : getFormData('numberLength') == 4
|
|
|
- ? 9999
|
|
|
- : getFormData('numberLength') == 5
|
|
|
- ? 99999
|
|
|
- : 999999
|
|
|
- "
|
|
|
- />
|
|
|
+ >
|
|
|
+ </a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -380,7 +267,17 @@ li.chouzhen.first:before {
|
|
|
<a-input
|
|
|
v-decorator="[
|
|
|
'channelCode',
|
|
|
- { rules: [{ required: true, message: '请填写渠道号' }] }
|
|
|
+ {
|
|
|
+ rules: [
|
|
|
+ { required: true, message: '请填写渠道号' },
|
|
|
+ {
|
|
|
+ min: 1,
|
|
|
+ max: 20,
|
|
|
+ message: '渠道号不能超过20个字符',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
]"
|
|
|
allow-clear
|
|
|
id="channelCode"
|
|
@@ -404,7 +301,17 @@ li.chouzhen.first:before {
|
|
|
<a-input
|
|
|
v-decorator="[
|
|
|
'channelName',
|
|
|
- { rules: [{ required: true, message: '请填写渠道号' }] }
|
|
|
+ {
|
|
|
+ rules: [
|
|
|
+ { required: true, message: '请填写渠道号名称' },
|
|
|
+ {
|
|
|
+ min: 1,
|
|
|
+ max: 40,
|
|
|
+ message: '渠道号名称不能超过40个字符',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
]"
|
|
|
allow-clear
|
|
|
id="channelName"
|
|
@@ -416,13 +323,13 @@ li.chouzhen.first:before {
|
|
|
>
|
|
|
<a-tag
|
|
|
color="#2db7f5"
|
|
|
- @click="getChangeAll('渠道号', 'formProject', 'channelName')"
|
|
|
- >+渠道号</a-tag
|
|
|
+ @click="getChangeAll('编号', 'formProject', 'channelName')"
|
|
|
+ >+编号</a-tag
|
|
|
>
|
|
|
<a-tag
|
|
|
color="#2db7f5"
|
|
|
- @click="getChangeAll('编号', 'formProject', 'channelName')"
|
|
|
- >+编号</a-tag
|
|
|
+ @click="getChangeAll('渠道号', 'formProject', 'channelName')"
|
|
|
+ >+渠道号</a-tag
|
|
|
>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -448,6 +355,11 @@ li.chouzhen.first:before {
|
|
|
>
|
|
|
<a-tag
|
|
|
color="#2db7f5"
|
|
|
+ @click="getChangeAll('编号', 'formProject', 'schemaUri')"
|
|
|
+ >+编号</a-tag
|
|
|
+ >
|
|
|
+ <a-tag
|
|
|
+ color="#2db7f5"
|
|
|
@click="getChangeAll('渠道号', 'formProject', 'schemaUri')"
|
|
|
>+渠道号</a-tag
|
|
|
>
|
|
@@ -477,6 +389,11 @@ li.chouzhen.first:before {
|
|
|
>
|
|
|
<a-tag
|
|
|
color="#2db7f5"
|
|
|
+ @click="getChangeAll('编号', 'formProject', 'clickTrackUrl')"
|
|
|
+ >+编号</a-tag
|
|
|
+ >
|
|
|
+ <a-tag
|
|
|
+ color="#2db7f5"
|
|
|
@click="getChangeAll('渠道号', 'formProject', 'clickTrackUrl')"
|
|
|
>+渠道号</a-tag
|
|
|
>
|
|
@@ -503,6 +420,11 @@ li.chouzhen.first:before {
|
|
|
>
|
|
|
<a-tag
|
|
|
color="#2db7f5"
|
|
|
+ @click="getChangeAll('编号', 'formProject', 'actionbarClickUrl')"
|
|
|
+ >+编号</a-tag
|
|
|
+ >
|
|
|
+ <a-tag
|
|
|
+ color="#2db7f5"
|
|
|
@click="getChangeAll('渠道号', 'formProject', 'actionbarClickUrl')"
|
|
|
>+渠道号</a-tag
|
|
|
>
|
|
@@ -513,12 +435,13 @@ li.chouzhen.first:before {
|
|
|
<a-col :span="16">
|
|
|
<a-form-item label="是否关联单品">
|
|
|
<a-radio-group
|
|
|
+ disabled
|
|
|
button-style="solid"
|
|
|
v-decorator="[
|
|
|
'isHaveItem',
|
|
|
{
|
|
|
rules: [{ required: true, message: '是否关联单品必选' }],
|
|
|
- initialValue: 1
|
|
|
+ initialValue: 0
|
|
|
}
|
|
|
]"
|
|
|
>
|
|
@@ -537,7 +460,7 @@ li.chouzhen.first:before {
|
|
|
'usageLevel',
|
|
|
{
|
|
|
rules: [{ required: true, message: '使用层级必选' }],
|
|
|
- initialValue: 'account'
|
|
|
+ initialValue: 'plan'
|
|
|
}
|
|
|
]"
|
|
|
>
|
|
@@ -567,7 +490,7 @@ li.chouzhen.first:before {
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
- <a-row
|
|
|
+ <!-- <a-row
|
|
|
:gutter="16"
|
|
|
v-if="getFormData('isCycle') == 1 || getFormData('isCycle') == undefined"
|
|
|
>
|
|
@@ -591,14 +514,14 @@ li.chouzhen.first:before {
|
|
|
/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- </a-row>
|
|
|
+ </a-row> -->
|
|
|
</a-form>
|
|
|
</a-card>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</div>
|
|
|
<div style="width:100%;display:flex; justify-content: flex-end;">
|
|
|
- <a-button type="default" style="margin-right: 15px" @click="goBack">返回</a-button>
|
|
|
+ <a-button type="default" style="margin-right: 15px" @click="goBack">取消</a-button>
|
|
|
<a-button type="primary" style="margin-right: 15px" @click="saveHandler" :loading="saveLoading"
|
|
|
>确定</a-button
|
|
|
>
|
|
@@ -723,7 +646,7 @@ export default {
|
|
|
watch: {},
|
|
|
mounted() {
|
|
|
this.$nextTick(function() {
|
|
|
- this.createTypeData = JSON.parse(localStorage.getItem('createTypeData'))
|
|
|
+ this.createTypeData = JSON.parse(localStorage.getItem('channelInfo'))
|
|
|
window.addEventListener('scroll', this.onScroll)
|
|
|
const that = this
|
|
|
window.onresize = () => {
|
|
@@ -738,6 +661,49 @@ export default {
|
|
|
methods: {
|
|
|
moment,
|
|
|
...mapGetters(['userInfo']),
|
|
|
+ cpaBidValid(rule, value, callback) {
|
|
|
+ let length =
|
|
|
+ this.getFormData('numberLength') == 0 || this.getFormData('numberLength') == 5
|
|
|
+ ? 5
|
|
|
+ : this.getFormData('numberLength') == 3
|
|
|
+ ? 3
|
|
|
+ : 4
|
|
|
+ let z = /-/g
|
|
|
+ let a = /\//g
|
|
|
+ let d = /\./g
|
|
|
+ if (value === '' || value === undefined) {
|
|
|
+ callback('请填写编号')
|
|
|
+ } else if (value.match(d)) {
|
|
|
+ callback('请填写正确编号')
|
|
|
+ } else if (value.match(a)) {
|
|
|
+ callback('请填写正确编号')
|
|
|
+ } else if (value.match(z) && value.match(z).length > 1) {
|
|
|
+ callback('请填写正确编号')
|
|
|
+ } else if (value.startsWith('-') || value.endsWith('-')) {
|
|
|
+ callback('请填写正确编号')
|
|
|
+ } else if (value.match(/[^0-9+-\/]/g)) {
|
|
|
+ callback('请填写正确编号')
|
|
|
+ } else if (value.match(z) && value.match(z).length == 1) {
|
|
|
+ console.log(value.split('-'))
|
|
|
+ if (Number(value.split('-')[0]) > Number(value.split('-')[1])) {
|
|
|
+ callback('请填写正确编号')
|
|
|
+ } else {
|
|
|
+ if (value.split('-')[0].length > length || value.split('-')[1].length > length) {
|
|
|
+ callback('请填写正确编号')
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (/^[0-9]/g.test(value)) {
|
|
|
+ if (value.length > length) {
|
|
|
+ callback('请填写正确编号')
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ },
|
|
|
getDataAll(form) {
|
|
|
this.newAppFormData = form
|
|
|
},
|
|
@@ -750,7 +716,7 @@ export default {
|
|
|
if (field == 'channelName' || field == 'channelCode') {
|
|
|
v = '-{{' + type + '}}-'
|
|
|
} else {
|
|
|
- v = '{{' + type + '}}'
|
|
|
+ v = '-{{' + type + '}}-'
|
|
|
}
|
|
|
|
|
|
if (document.selection) {
|
|
@@ -839,8 +805,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
goBack() {
|
|
|
- this.$router.replace('/autoLaunch/channelManage')
|
|
|
- this.$bus.$emit('remove', '/autoLaunch/createChannel')
|
|
|
+ localStorage.removeItem('channelInfo')
|
|
|
+ this.$router.replace('/autoLaunch/channelAdmin')
|
|
|
+ this.$bus.$emit('remove', '/autoLaunch/createChannelIndex')
|
|
|
+
|
|
|
+ this.$bus.$emit('remove', '/autoLaunch/createChannelIndex?accountId=' + this.$route.query.accountId)
|
|
|
},
|
|
|
saveHandler() {
|
|
|
this.formProject.validateFields((err, values) => {
|
|
@@ -850,11 +819,19 @@ export default {
|
|
|
var params = { ...values, ...this.newAppFormData }
|
|
|
params.userId = this.userInfo().id
|
|
|
params.createType = this.createTypeData.createType
|
|
|
- if (this.createTypeData && !!this.createTypeData.accountId) {
|
|
|
+ let numberValueArr = params.numberValue.split('-')
|
|
|
+ if (numberValueArr.length > 1) {
|
|
|
+ if (numberValueArr[0] > numberValueArr[1]) {
|
|
|
+ this.$message.error('编号填写错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.createTypeData && this.createTypeData.usageRange == '1') {
|
|
|
params.usageRange = 1
|
|
|
params.projectId = null
|
|
|
params.accountId = this.createTypeData.accountId
|
|
|
- } else if (this.createTypeData && !!this.createTypeData.projectId) {
|
|
|
+ } else if (this.createTypeData && this.createTypeData.usageRange == '2') {
|
|
|
params.usageRange = 2
|
|
|
params.projectId = this.createTypeData.projectId
|
|
|
params.accountId = null
|
|
@@ -866,8 +843,13 @@ export default {
|
|
|
postAction(url, params).then(res => {
|
|
|
this.saveLoading = false
|
|
|
if (res.success) {
|
|
|
- this.$router.replace('/autoLaunch/channelManage')
|
|
|
- this.$bus.$emit('remove', '/autoLaunch/createChannel')
|
|
|
+ localStorage.removeItem('channelInfo')
|
|
|
+ this.$router.replace('/autoLaunch/channelAdmin')
|
|
|
+ this.$bus.$emit('remove', '/autoLaunch/createChannelIndex')
|
|
|
+ this.$bus.$emit(
|
|
|
+ 'remove',
|
|
|
+ '/autoLaunch/createChannelIndex?accountId=' + this.$route.query.accountId
|
|
|
+ )
|
|
|
} else {
|
|
|
this.$message.error(res.message)
|
|
|
}
|