|
|
@ -75,10 +75,10 @@ |
|
|
|
<el-input placeholder="请输入联系人姓名" v-model="form.name"></el-input> |
|
|
|
<el-input placeholder="请输入联系人姓名" v-model="form.name"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="phone" label="手机号"> |
|
|
|
<el-form-item prop="phone" label="手机号"> |
|
|
|
<el-input placeholder="请输入联系人手机号" v-model="form.phone" maxlength="11"></el-input> |
|
|
|
<el-input placeholder="请输入联系人手机号" v-model="form.phone" maxlength="11" @blur="phoneChange"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="email" label="邮箱"> |
|
|
|
<el-form-item prop="email" label="邮箱"> |
|
|
|
<el-input placeholder="请输入邮箱" v-model="form.email"></el-input> |
|
|
|
<el-input placeholder="请输入邮箱" v-model="form.email" @blur="emailChange"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
@ -272,6 +272,7 @@ export default { |
|
|
|
showImg:false, |
|
|
|
showImg:false, |
|
|
|
fileSrc:'', |
|
|
|
fileSrc:'', |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
|
|
|
|
customerId: "", |
|
|
|
customerName: '', |
|
|
|
customerName: '', |
|
|
|
countries: '中国', |
|
|
|
countries: '中国', |
|
|
|
industryClassId: '', |
|
|
|
industryClassId: '', |
|
|
@ -362,7 +363,6 @@ export default { |
|
|
|
storeName: '1个月', |
|
|
|
storeName: '1个月', |
|
|
|
total: '2019.01.02 11:00', |
|
|
|
total: '2019.01.02 11:00', |
|
|
|
payamount: '2019.01.02 11:00', |
|
|
|
payamount: '2019.01.02 11:00', |
|
|
|
payamount: '700d12h1min', |
|
|
|
|
|
|
|
swtich: true, |
|
|
|
swtich: true, |
|
|
|
Intranet: '10.20.202.1', |
|
|
|
Intranet: '10.20.202.1', |
|
|
|
extranet: '10.20.202.1' |
|
|
|
extranet: '10.20.202.1' |
|
|
@ -373,12 +373,13 @@ export default { |
|
|
|
storeName: '1个月', |
|
|
|
storeName: '1个月', |
|
|
|
total: '2019.01.02 11:00', |
|
|
|
total: '2019.01.02 11:00', |
|
|
|
payamount: '2019.01.02 11:00', |
|
|
|
payamount: '2019.01.02 11:00', |
|
|
|
payamount: '700d12h1min', |
|
|
|
|
|
|
|
swtich: true, |
|
|
|
swtich: true, |
|
|
|
Intranet: '', |
|
|
|
Intranet: '', |
|
|
|
extranet: '' |
|
|
|
extranet: '' |
|
|
|
}], |
|
|
|
}], |
|
|
|
NoAdd: true |
|
|
|
NoAdd: true, |
|
|
|
|
|
|
|
phoneRepeat: false, |
|
|
|
|
|
|
|
emailRepeat: false, |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
@ -389,6 +390,7 @@ export default { |
|
|
|
}).then((res) => { |
|
|
|
}).then((res) => { |
|
|
|
let customer = res.result.customer |
|
|
|
let customer = res.result.customer |
|
|
|
this.form = { |
|
|
|
this.form = { |
|
|
|
|
|
|
|
customerId: customer.customerId, |
|
|
|
schoolId: customer.schoolId, |
|
|
|
schoolId: customer.schoolId, |
|
|
|
countries: customer.countries, |
|
|
|
countries: customer.countries, |
|
|
|
industryClassId: customer.industryClassId, |
|
|
|
industryClassId: customer.industryClassId, |
|
|
@ -494,9 +496,60 @@ export default { |
|
|
|
this.$message.success(val ? '启用成功' : '禁用成功') |
|
|
|
this.$message.success(val ? '启用成功' : '禁用成功') |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
phoneChange() { // 切换手机号 |
|
|
|
|
|
|
|
let regex = /^1[3456789]\d{9}$/; |
|
|
|
|
|
|
|
if (regex.test(this.form.phone)) { |
|
|
|
|
|
|
|
let url = ""; |
|
|
|
|
|
|
|
if (!this.form.customerId) { |
|
|
|
|
|
|
|
url = `${this.api.checkEmailOrPhone}?phone=${this.form.phone}&email=`; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
url = `${this.api.checkEmailOrPhone}?customerId=${this.form.customerId}&phone=${this.form.phone}&email=`; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$post(url).then(res => { |
|
|
|
|
|
|
|
if (res.status === 200) { |
|
|
|
|
|
|
|
this.phoneRepeat = false; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message.warning("该手机号已存在") |
|
|
|
|
|
|
|
this.phoneRepeat = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
this.phoneRepeat = true; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async emailChange() { // 切换邮箱 |
|
|
|
|
|
|
|
let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/; |
|
|
|
|
|
|
|
if (regex.test(this.form.email)) { |
|
|
|
|
|
|
|
let url = ""; |
|
|
|
|
|
|
|
if (!this.form.customerId) { |
|
|
|
|
|
|
|
url = `${this.api.checkEmailOrPhone}?email=${this.form.email}&phone=`; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
url = `${this.api.checkEmailOrPhone}?customerId=${this.form.customerId}&email=${this.form.email}&phone=`; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$post(url).then(res => { |
|
|
|
|
|
|
|
if (res.status === 200) { |
|
|
|
|
|
|
|
this.emailRepeat = false; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message.warning("该邮箱已存在") |
|
|
|
|
|
|
|
this.emailRepeat = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
this.emailRepeat = true; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
saveAdd(formName){ |
|
|
|
saveAdd(formName){ |
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
|
|
|
|
console.log(this.phoneRepeat); |
|
|
|
|
|
|
|
if (this.phoneRepeat) { |
|
|
|
|
|
|
|
this.$message.warning("该手机号已存在"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.emailRepeat) { |
|
|
|
|
|
|
|
this.$message.warning("该邮箱已存在"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
if(this.NoAdd){ |
|
|
|
if(this.NoAdd){ |
|
|
|
let obj = {}; |
|
|
|
let obj = {}; |
|
|
|
obj = this.schoolList.find((item)=>{ |
|
|
|
obj = this.schoolList.find((item)=>{ |
|
|
@ -530,24 +583,24 @@ export default { |
|
|
|
}).catch((res) => {}) |
|
|
|
}).catch((res) => {}) |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
this.$post(this.api.addCustomer,data).then((res) => { |
|
|
|
this.$post(this.api.addCustomer,data).then((res) => { |
|
|
|
// let customerId = res.customerId |
|
|
|
let customerId = res.customerId |
|
|
|
// this.$store.commit('schoolIdData',{schoolId: this.form.schoolId}) |
|
|
|
this.$store.commit('schoolIdData',{schoolId: this.form.schoolId}) |
|
|
|
// this.$post(this.api.saveOrUpdate,{ |
|
|
|
this.$post(this.api.saveOrUpdate,{ |
|
|
|
// clientId: 0, |
|
|
|
clientId: 0, |
|
|
|
// id: '', |
|
|
|
id: '', |
|
|
|
// roleName: '超级管理员', |
|
|
|
roleName: '超级管理员', |
|
|
|
// remark: '拥有一切权限', |
|
|
|
remark: '拥有一切权限', |
|
|
|
// isPort: 2 |
|
|
|
isPort: 2 |
|
|
|
// }).then(res => { |
|
|
|
}).then(res => { |
|
|
|
// let roleId = res.roleId |
|
|
|
let roleId = res.roleId |
|
|
|
// let perData = { |
|
|
|
let perData = { |
|
|
|
// roleId, |
|
|
|
roleId, |
|
|
|
// permissionId: ["1408370117262635009","1409351488911056897","1409351867862228993","1408370186435096578","1409352518310699009","1409352550615228418","1409352584240963585","1409352623344459778","1409352647054860289","1409352682471563266","1409352720786530305","1409352742290726913","1408370244584927233","1409352872662278146","1409352903574298626","1409352923509825538","1409352940068937730","1409353018443702273"], |
|
|
|
permissionId: ["1408370117262635009","1409351488911056897","1409351867862228993","1408370186435096578","1409352518310699009","1409352550615228418","1409352584240963585","1409352623344459778","1409352647054860289","1409352682471563266","1409352720786530305","1409352742290726913","1408370244584927233","1409352872662278146","1409352903574298626","1409352923509825538","1409352940068937730","1409353018443702273"], |
|
|
|
// isPort: 2 |
|
|
|
isPort: 2 |
|
|
|
// } |
|
|
|
} |
|
|
|
// this.$post(this.api.doAssign,perData).then(res => {}).catch(res => {}) |
|
|
|
this.$post(this.api.doAssign,perData).then(res => {}).catch(res => {}) |
|
|
|
// this.$post(`${this.api.updateCustomerByRoleId}?customerId=${customerId}&roleId=${roleId}`).then(res => {}).catch(res => {}) |
|
|
|
this.$post(`${this.api.updateCustomerByRoleId}?customerId=${customerId}&roleId=${roleId}`).then(res => {}).catch(res => {}) |
|
|
|
// }).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
|
|
|
|
this.$message.success('添加成功') |
|
|
|
this.$message.success('添加成功') |
|
|
|
this.goback() |
|
|
|
this.goback() |
|
|
|