Commit 31a59c75 authored by youjie's avatar youjie

同业新增联系人

parent d4d724c1
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<template> <template>
<div class="Contacts"> <div class="Contacts">
<div class="add-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> </div>
<el-table <el-table
v-loading="loading" v-loading="loading"
...@@ -42,11 +42,12 @@ ...@@ -42,11 +42,12 @@
<template slot-scope="scope"> <template slot-scope="scope">
<p v-if="scope.row.IsFirstContact === 1" class="font-color-warning">首要联系人</p> <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-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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div v-if="addContactsShow"> <div v-if="addContactsShow">
<addContacts :ID="CustomerId" @addContactsOk="addContactsOk"/> <addContacts :ID="CustomerId" :contactID="contactID" @addContactsOk="addContactsOk"/>
</div> </div>
</div> </div>
</template> </template>
...@@ -71,6 +72,8 @@ export default { ...@@ -71,6 +72,8 @@ export default {
loading: false, loading: false,
addContactsShow: false, addContactsShow: false,
ContactList: [], ContactList: [],
userInfo: {},
contactID: 0,
}; };
},watch:{ },watch:{
CustomerId: { CustomerId: {
...@@ -81,6 +84,8 @@ export default { ...@@ -81,6 +84,8 @@ export default {
} }
}, },
mounted() { mounted() {
let userInfo = this.getLocalStorage();
this.userInfo = userInfo;
let $this = this let $this = this
this.MsgBus.$on('closeaddContacts', function (){ this.MsgBus.$on('closeaddContacts', function (){
$this.addContactsShow = false $this.addContactsShow = false
...@@ -88,6 +93,11 @@ export default { ...@@ -88,6 +93,11 @@ export default {
this.GetContactByCustomerID() this.GetContactByCustomerID()
}, },
methods: { methods: {
editContacts(item){
console.log(item,'--===')
this.contactID=item.ID
this.addContactsShow=true
},
addContactsOk(){ addContactsOk(){
this.GetContactByCustomerID() this.GetContactByCustomerID()
}, },
......
...@@ -93,6 +93,13 @@ ...@@ -93,6 +93,13 @@
</el-form-item> </el-form-item>
</div> </div>
</el-col> </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-row> <el-row>
<el-col :span="24"> <el-col :span="24">
...@@ -118,6 +125,10 @@ export default { ...@@ -118,6 +125,10 @@ export default {
type: Number, type: Number,
default: 0, default: 0,
}, },
contactID: {
type: Number,
default: 0,
},
}, },
data() { data() {
return { return {
...@@ -138,6 +149,13 @@ export default { ...@@ -138,6 +149,13 @@ export default {
ContactPhone: [ ContactPhone: [
{ required: true, message: "请输入联系电话", trigger: "blur" }, { required: true, message: "请输入联系电话", trigger: "blur" },
], ],
Password: [
{ required: true, message: "请输入密码", trigger: "blur" },
{
pattern: /^(?=.*[a-zA-Z])(?=.*\d).{6,20}$/,
message: '密码由6-20位字母、数字组成'
}
],
}, },
zwList: [], zwList: [],
form: { form: {
...@@ -149,6 +167,8 @@ export default { ...@@ -149,6 +167,8 @@ export default {
IsMain: 0, IsMain: 0,
Remark: "", Remark: "",
ID: 0, ID: 0,
InfoID: 0,
Password: '',
}, },
}; };
}, },
...@@ -159,6 +179,7 @@ export default { ...@@ -159,6 +179,7 @@ export default {
setTimeout(() => { setTimeout(() => {
$this.dialogTableVisible = true; $this.dialogTableVisible = true;
}, 50); }, 50);
if(this.contactID) this.getInfo()
}, },
methods: { methods: {
getZw() { getZw() {
...@@ -173,6 +194,20 @@ export default { ...@@ -173,6 +194,20 @@ export default {
(err) => {} (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() { closedDialog() {
this.MsgBus.$emit("closeaddContacts"); this.MsgBus.$emit("closeaddContacts");
}, },
...@@ -213,6 +248,7 @@ export default { ...@@ -213,6 +248,7 @@ export default {
IsMain: "", IsMain: "",
Remark: "", Remark: "",
ID: 0, ID: 0,
Password: '',
}; };
this.$refs[formName].resetFields(); 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