Commit 31a59c75 authored by youjie's avatar youjie

同业新增联系人

parent d4d724c1
......@@ -10,7 +10,7 @@
<template>
<div class="Contacts">
<div class="add-contacts">
<el-button icon="el-icon-plus" class="crm-btn query-btn crm-btn-mini margin-right0" @click="addContactsShow=true">新建联系人</el-button>
<el-button icon="el-icon-plus" class="crm-btn query-btn crm-btn-mini margin-right0" @click="contactID=0,addContactsShow=true">新建联系人</el-button>
</div>
<el-table
v-loading="loading"
......@@ -42,11 +42,12 @@
<template slot-scope="scope">
<p v-if="scope.row.IsFirstContact === 1" class="font-color-warning">首要联系人</p>
<p v-else-if="IsRead === 0 && scope.row.IsFirstContact !== 1" class="font-color-link cp" @click="SetFirstContact(scope)">设为首要联系人</p>
<p v-if="userInfo.EmployeeId==scope.row.CreateBy" class="font-color-link cp" @click="editContacts(scope.row)">编辑</p>
</template>
</el-table-column>
</el-table>
<div v-if="addContactsShow">
<addContacts :ID="CustomerId" @addContactsOk="addContactsOk"/>
<addContacts :ID="CustomerId" :contactID="contactID" @addContactsOk="addContactsOk"/>
</div>
</div>
</template>
......@@ -71,6 +72,8 @@ export default {
loading: false,
addContactsShow: false,
ContactList: [],
userInfo: {},
contactID: 0,
};
},watch:{
CustomerId: {
......@@ -81,6 +84,8 @@ export default {
}
},
mounted() {
let userInfo = this.getLocalStorage();
this.userInfo = userInfo;
let $this = this
this.MsgBus.$on('closeaddContacts', function (){
$this.addContactsShow = false
......@@ -88,6 +93,11 @@ export default {
this.GetContactByCustomerID()
},
methods: {
editContacts(item){
console.log(item,'--===')
this.contactID=item.ID
this.addContactsShow=true
},
addContactsOk(){
this.GetContactByCustomerID()
},
......
......@@ -93,6 +93,13 @@
</el-form-item>
</div>
</el-col>
<el-col :span="8" v-if="!form.ID">
<div class="MyEditForm-item">
<el-form-item label="密码" prop="Password">
<el-input type="text" show-Password placeholder="请输入密码" v-model="form.Password"></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
......@@ -118,6 +125,10 @@ export default {
type: Number,
default: 0,
},
contactID: {
type: Number,
default: 0,
},
},
data() {
return {
......@@ -138,6 +149,13 @@ export default {
ContactPhone: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
],
Password: [
{ required: true, message: "请输入密码", trigger: "blur" },
{
pattern: /^(?=.*[a-zA-Z])(?=.*\d).{6,20}$/,
message: '密码由6-20位字母、数字组成'
}
],
},
zwList: [],
form: {
......@@ -149,6 +167,8 @@ export default {
IsMain: 0,
Remark: "",
ID: 0,
InfoID: 0,
Password: '',
},
};
},
......@@ -159,6 +179,7 @@ export default {
setTimeout(() => {
$this.dialogTableVisible = true;
}, 50);
if(this.contactID) this.getInfo()
},
methods: {
getZw() {
......@@ -173,6 +194,20 @@ export default {
(err) => {}
);
},
getInfo() {
this.form.ID = this.contactID
this.apipost(
"/api/Customer/GetAllContactModel",
{
Id: this.contactID
},
(res) => {
if (res.data.resultCode == 1) {
console.log(res.data.data,'------')
}
}
);
},
closedDialog() {
this.MsgBus.$emit("closeaddContacts");
},
......@@ -213,6 +248,7 @@ export default {
IsMain: "",
Remark: "",
ID: 0,
Password: '',
};
this.$refs[formName].resetFields();
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment