|
@@ -14,31 +14,31 @@
|
|
</j-tree-select>
|
|
</j-tree-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户类型">
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户类型">
|
|
- <a-select v-decorator="['advertiserType', validatorRules.advertiserId]">
|
|
|
|
|
|
+ <a-select v-decorator="['advertiserType',{ rules: [{ required: true, message: '请选择客户类型' }] }]"
|
|
|
|
+ :disabled="disableOne"
|
|
|
|
+ @change="changeData">
|
|
<a-select-option :value="1">自拓客户</a-select-option>
|
|
<a-select-option :value="1">自拓客户</a-select-option>
|
|
<a-select-option :value="2">公司客户</a-select-option>
|
|
<a-select-option :value="2">公司客户</a-select-option>
|
|
<a-select-option :value="3">代理商</a-select-option>
|
|
<a-select-option :value="3">代理商</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售"
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售"
|
|
- v-if="getFormFieldValue('advertiserType')==1||getFormFieldValue('advertiserType')==2">
|
|
|
|
- <a-select showSearch optionFilterProp="children" style="width: 100%" @focus="handleFocus" @blur="handleBlur"
|
|
|
|
- @change="handleChange" :filterOption="filterOption"
|
|
|
|
- v-decorator="['saleId', { rules: [{ required: true, message: '请选择销售' }] }]">
|
|
|
|
|
|
+ v-if="model.advertiserType==1||model.advertiserType==2">
|
|
|
|
+ <a-select showSearch optionFilterProp="children" style="width: 100%" :filterOption="filterOption"
|
|
|
|
+ v-decorator="['saleId', { rules: [{ required: true,message: '请选择销售' }] }]">
|
|
<a-select-option v-for="appModel in options" :key="appModel.userId + new Date().getTime()"
|
|
<a-select-option v-for="appModel in options" :key="appModel.userId + new Date().getTime()"
|
|
:value="appModel.userId">{{ appModel.realName }}  {{ appModel.roleName }}</a-select-option>
|
|
:value="appModel.userId">{{ appModel.realName }}  {{ appModel.roleName }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="代理商"
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="代理商"
|
|
- v-if="getFormFieldValue('advertiserType')==3">
|
|
|
|
- <a-select showSearch optionFilterProp="children" style="width: 100%" @focus="handleFocus" @blur="handleBlur"
|
|
|
|
- @change="handleChange" :filterOption="filterOption"
|
|
|
|
- v-decorator="['agentId', { rules: [{ required: true, message: '请选择代理商' }] }]">
|
|
|
|
|
|
+ v-if="model.advertiserType==3">
|
|
|
|
+ <a-select showSearch optionFilterProp="children" style="width: 100%" :filterOption="filterOption"
|
|
|
|
+ v-decorator="['agentId', { rules: [{ required: true,message: '请选择代理商' }] }]">
|
|
<a-select-option v-for="appModel in optionsTwo" :key="appModel.id + new Date().getTime()"
|
|
<a-select-option v-for="appModel in optionsTwo" :key="appModel.id + new Date().getTime()"
|
|
:value="appModel.id">{{ appModel.name }}</a-select-option>
|
|
:value="appModel.id">{{ appModel.name }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
-
|
|
|
|
|
|
+
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系人姓名">
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系人姓名">
|
|
<a-input placeholder="请输入联系人姓名" v-decorator="['contact', validatorRules.contact ]" />
|
|
<a-input placeholder="请输入联系人姓名" v-decorator="['contact', validatorRules.contact ]" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -91,8 +91,8 @@
|
|
span: 16
|
|
span: 16
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- options:[],
|
|
|
|
- optionsTwo:[],
|
|
|
|
|
|
+ options: [],
|
|
|
|
+ optionsTwo: [],
|
|
confirmLoading: false,
|
|
confirmLoading: false,
|
|
form: this.$form.createForm(this),
|
|
form: this.$form.createForm(this),
|
|
validatorRules: {
|
|
validatorRules: {
|
|
@@ -139,6 +139,7 @@
|
|
getList: '/ctop/advertiser/list',
|
|
getList: '/ctop/advertiser/list',
|
|
getTwoList: '/ctop/agentInfo/list'
|
|
getTwoList: '/ctop/agentInfo/list'
|
|
},
|
|
},
|
|
|
|
+ disableOne:true
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -146,16 +147,24 @@
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapGetters(['nickname', 'avatar', 'userInfo']),
|
|
...mapGetters(['nickname', 'avatar', 'userInfo']),
|
|
|
|
+ changeData(data){
|
|
|
|
+ this.model.advertiserType = data
|
|
|
|
+ },
|
|
add() {
|
|
add() {
|
|
this.edit({});
|
|
this.edit({});
|
|
},
|
|
},
|
|
edit(record) {
|
|
edit(record) {
|
|
|
|
+ if(record.advertiserType){
|
|
|
|
+ this.disableOne = true
|
|
|
|
+ }else{
|
|
|
|
+ this.disableOne = false
|
|
|
|
+ }
|
|
this.form.resetFields();
|
|
this.form.resetFields();
|
|
this.model = Object.assign({}, record);
|
|
this.model = Object.assign({}, record);
|
|
this.visible = true;
|
|
this.visible = true;
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.form.setFieldsValue(pick(this.model, 'name', 'industryId', 'contact', 'mobile', 'email',
|
|
this.form.setFieldsValue(pick(this.model, 'name', 'industryId', 'contact', 'mobile', 'email',
|
|
- 'advertiserType', 'saleId','agentId'))
|
|
|
|
|
|
+ 'advertiserType', 'saleId', 'agentId'))
|
|
//时间格式化
|
|
//时间格式化
|
|
});
|
|
});
|
|
getAction('/sys/user/getAllUserList', '').then(res => {
|
|
getAction('/sys/user/getAllUserList', '').then(res => {
|
|
@@ -217,6 +226,9 @@
|
|
getFormFieldValue(field) {
|
|
getFormFieldValue(field) {
|
|
return this.form.getFieldValue(field)
|
|
return this.form.getFieldValue(field)
|
|
},
|
|
},
|
|
|
|
+ filterOption(input, option) {
|
|
|
|
+ return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
+ },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|