|
|
@@ -18,14 +18,37 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="联系人:" prop="name">
|
|
|
- <el-input v-model="param.content.name" placeholder="请填写联系人"></el-input>
|
|
|
+<!-- <el-input v-model="param.content.name" placeholder="请填写联系人"></el-input>-->
|
|
|
+ <contactsTemplate ref="contactsRef" @contactSelect="contactSelect" :name="param.content.name"></contactsTemplate>
|
|
|
</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="wechatnum">
|
|
|
<el-input v-model="param.content.wechatnum" placeholder="请填写微信"></el-input>
|
|
|
@@ -147,9 +170,23 @@
|
|
|
<script>
|
|
|
import selectActivity from '@/SManagement/orderclue/components/selectActivity/selectActivity'
|
|
|
import businessMessage from "@/components/businessMessage";
|
|
|
+import contactsTemplate from '@/template/contactsTemplate/index'
|
|
|
export default {
|
|
|
- components: {selectActivity,businessMessage},
|
|
|
+ components: {selectActivity,businessMessage,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 !== ''){
|
|
|
@@ -207,7 +244,10 @@ export default {
|
|
|
"begdate_due": "", //预计开工时间
|
|
|
"enddate_due": "", //预计完工时间
|
|
|
"tradefield":"",
|
|
|
- "unitname":''
|
|
|
+ "unitname":'',
|
|
|
+ "areaCode":'',
|
|
|
+ "telephone":'',
|
|
|
+ "isTelephone":'0',
|
|
|
}
|
|
|
},
|
|
|
unitnameList:[],
|
|
|
@@ -236,7 +276,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' }*/
|
|
|
+ ],
|
|
|
/*totalinvestment:[
|
|
|
{
|
|
|
validator: (rule, value, callback) => {
|
|
|
@@ -348,6 +393,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.$refs.ruleForm.resetFields()
|
|
|
@@ -368,6 +416,10 @@ export default {
|
|
|
"isprivate":1,
|
|
|
"campaign_name":''
|
|
|
}
|
|
|
+ this.param.content.areaCode = ''
|
|
|
+ this.param.content.telephone = ''
|
|
|
+ this.param.content.phonenumber = ''
|
|
|
+ this.param.content.isTelephone = '0'
|
|
|
this.$emit('onSuccess')
|
|
|
})
|
|
|
})
|
|
|
@@ -395,6 +447,10 @@ export default {
|
|
|
"isprivate":1,
|
|
|
"campaign_name":''
|
|
|
}
|
|
|
+ this.param.content.areaCode = ''
|
|
|
+ this.param.content.telephone = ''
|
|
|
+ this.param.content.phonenumber = ''
|
|
|
+ this.param.content.isTelephone = '0'
|
|
|
this.$refs.businessMessage.businessShow = false
|
|
|
},
|
|
|
centerChange (data) {
|
|
|
@@ -424,6 +480,29 @@ export default {
|
|
|
this.unitnameList = res.data
|
|
|
})
|
|
|
},
|
|
|
+ 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 = ''
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|