|
|
@@ -27,17 +27,41 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="联系人:" prop="name" v-if="param.content.isuppictured === 1" :rules="{required:true,message:'请填写联系人',trigger:'blur'}">
|
|
|
- <el-input v-model="param.content.name" placeholder="请填写联系人"></el-input>
|
|
|
+ <contactsTemplate ref="contactsRef" @contactSelect="contactSelect" :name="param.content.name"></contactsTemplate>
|
|
|
+ <!-- <el-input v-model="param.content.name" placeholder="请填写联系人"></el-input>-->
|
|
|
</el-form-item>
|
|
|
<el-form-item label="联系人:" prop="name" v-else>
|
|
|
- <el-input v-model="param.content.name" placeholder="请填写联系人"></el-input>
|
|
|
+ <contactsTemplate ref="contactsRef" @contactSelect="contactSelect" :name="param.content.name"></contactsTemplate>
|
|
|
+ <!-- <el-input v-model="param.content.name" placeholder="请填写联系人"></el-input>-->
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
+<!-- <el-col :span="24">
|
|
|
<el-form-item label="联系方式:" prop="phonenumber">
|
|
|
<el-input v-model="param.content.phonenumber" placeholder="请填写手机号"></el-input>
|
|
|
</el-form-item>
|
|
|
+ </el-col>-->
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item>
|
|
|
+ <el-radio v-model="param.content.isTelephone" label="0" @change="phoneChange('手机')">手机号</el-radio>
|
|
|
+ <el-radio v-model="param.content.isTelephone" label="1" @change="phoneChange('座机')">座机电话</el-radio>
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24" v-if="param.content.isTelephone == '1'">
|
|
|
+ <el-form-item label="联系方式:" prop="telephone" >
|
|
|
+ <el-input v-model="param.content.areaCode" style="width: 25%" autocomplete="on" placeholder="请填写区号"></el-input>
|
|
|
+ <span style="color: #999999">——</span>
|
|
|
+ <el-input v-model="param.content.telephone" style="width: 68%" autocomplete="on" placeholder="请填写座机电话"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" >
|
|
|
+ <el-form-item v-if="param.content.isTelephone == '0'" label="联系方式:" prop="phonenumber" :rules="[
|
|
|
+ { required: true, message: '手机号码不能为空'},
|
|
|
+ { pattern:/^1[3-9][0-9]\d{8}$/, message: '请输入正确手机号码',trigger: 'change' }
|
|
|
+ ]">
|
|
|
+ <el-input v-model="param.content.phonenumber" autocomplete="on" placeholder="请填写手机号码"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="联系人角色:" prop="contactsrole">
|
|
|
<el-input v-model="param.content.contactsrole" placeholder="请填写联系人角色"></el-input>
|
|
|
@@ -205,9 +229,23 @@ import tableList from '@/components/table/index5';
|
|
|
import designingInstitute from '@/template/clueModel/designingInstitute'
|
|
|
import designer from '@/template/clueModel/designer'
|
|
|
import project from '@/template/clueModel/project'
|
|
|
+import contactsTemplate from '@/template/contactsTemplate/index'
|
|
|
export default {
|
|
|
- components: {selectActivity,businessMessage,tableList,designingInstitute,designer,project},
|
|
|
+ components: {selectActivity,businessMessage,tableList,designingInstitute,designer,project,contactsTemplate},
|
|
|
data () {
|
|
|
+ var telephone = (rule,value,callback) =>{
|
|
|
+ if (this.param.content.areaCode === '' && this.param.content.telephone === ''){
|
|
|
+ callback(new Error('座机电话不能为空'))
|
|
|
+ } else {
|
|
|
+ var reg=/^0\d{2,3}-\d{7,8}$/
|
|
|
+ let telephone = this.param.content.areaCode + '-' + this.param.content.telephone
|
|
|
+ if (!reg.test(telephone)){
|
|
|
+ callback(new Error('请输入正确座机电话'))
|
|
|
+ }else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
var begdateTime = (rule,value,callback) =>{
|
|
|
this.$refs.ruleForm.validateField('enddate_due')
|
|
|
if (this.param.content.enddate_due !== ''){
|
|
|
@@ -274,6 +312,9 @@ export default {
|
|
|
"sys_enterpriseid":'',//设计院
|
|
|
"contactsid":'',//设计师
|
|
|
"sa_projectid":'',//关联项目
|
|
|
+ "areaCode":'',
|
|
|
+ "telephone":'',
|
|
|
+ "isTelephone":'0',
|
|
|
}
|
|
|
},
|
|
|
unitnameList:[],
|
|
|
@@ -289,7 +330,7 @@ export default {
|
|
|
{ required: false, validator: enddateTime, trigger: 'change' }
|
|
|
],
|
|
|
name:[
|
|
|
- { required: true, message: '请输入联系人', trigger: 'blur'}
|
|
|
+ { required: true, message: '请输入联系人', trigger: 'change'}
|
|
|
],
|
|
|
tradefield:[
|
|
|
{ required: true, message: '请选择领域', trigger: 'change'}
|
|
|
@@ -305,7 +346,12 @@ export default {
|
|
|
],
|
|
|
costofconstruction:[
|
|
|
{required: false,pattern:/^\d+(.\d{1,2})?$/, message: '请输入数字值', trigger: 'blur'}
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ telephone:[
|
|
|
+ { required: true, validator: telephone, trigger: 'change' }
|
|
|
+ /* { required: true, message: '请输入座机电话', trigger: 'change' },
|
|
|
+ { pattern:/^0\d{2,3}-\d{7,8}$/, message: '请输入正确座机电话',trigger: 'change' }*/
|
|
|
+ ],
|
|
|
},
|
|
|
areaSelectResult:'',
|
|
|
options: [],
|
|
|
@@ -332,7 +378,6 @@ export default {
|
|
|
methods: {
|
|
|
onShow () {
|
|
|
this.drawer = true
|
|
|
-
|
|
|
this.queryIsuppictured(JSON.parse(sessionStorage.getItem('active_account')).hrid)
|
|
|
this.queryTradefield()
|
|
|
this.queryUnitname()
|
|
|
@@ -387,6 +432,9 @@ export default {
|
|
|
} else if (this.areaSelectResult.length == 1) {
|
|
|
this.param.content.province = this.areaSelectResult[0]
|
|
|
}
|
|
|
+ if (this.param.content.isTelephone == '1'){
|
|
|
+ this.param.content.phonenumber = this.param.content.areaCode + "-" + this.param.content.telephone
|
|
|
+ }
|
|
|
let res = await this.$api.requested(this.param)
|
|
|
this.tool.showMessage(res,() => {
|
|
|
this.drawer = false
|
|
|
@@ -397,6 +445,10 @@ export default {
|
|
|
this.param.content.sa_projectid = ''
|
|
|
this.param.content.projectname = ''
|
|
|
this.$refs.designingInstitute.enterprisename = ''
|
|
|
+ this.param.content.areaCode = ''
|
|
|
+ this.param.content.telephone = ''
|
|
|
+ this.param.content.phonenumber = ''
|
|
|
+ this.param.content.isTelephone = '0'
|
|
|
this.$emit('onSuccess')
|
|
|
})
|
|
|
})
|
|
|
@@ -414,6 +466,10 @@ export default {
|
|
|
this.param.content.projectname = ''
|
|
|
this.activityVisible = false
|
|
|
this.$refs.businessMessage.businessShow = false
|
|
|
+ this.param.content.areaCode = ''
|
|
|
+ this.param.content.telephone = ''
|
|
|
+ this.param.content.phonenumber = ''
|
|
|
+ this.param.content.isTelephone = '0'
|
|
|
},
|
|
|
centerChange (data) {
|
|
|
this.param.content.campaign_name = data[0].name
|
|
|
@@ -479,6 +535,29 @@ export default {
|
|
|
this.param.content.sa_projectid = id
|
|
|
}
|
|
|
|
|
|
+ },
|
|
|
+ phoneChange(val){
|
|
|
+ if (val === '手机'){
|
|
|
+ this.param.content.telephone = ''
|
|
|
+ this.param.content.areaCode = ''
|
|
|
+ }else {
|
|
|
+ this.param.content.phonenumber = ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /*联系人选择*/
|
|
|
+ contactSelect(val){
|
|
|
+ this.param.content.name = val.name
|
|
|
+ if (val.phonenumber.indexOf('-') != '-1'){
|
|
|
+ this.param.content.isTelephone = '1'
|
|
|
+ this.param.content.areaCode = val.phonenumber.substring(0,val.phonenumber.indexOf('-'))
|
|
|
+ this.param.content.telephone = val.phonenumber.substring(this.param.content.areaCode.length+1)
|
|
|
+ this.param.content.phonenumber = ''
|
|
|
+ }else {
|
|
|
+ this.param.content.isTelephone = '0'
|
|
|
+ this.param.content.phonenumber = val.phonenumber
|
|
|
+ this.param.content.areaCode = ''
|
|
|
+ this.param.content.telephone = ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|