Commit ba2cc665 authored by 黄奎's avatar 黄奎
parents 0dbd088f 3dee9245
<style>
.addTeamman .add-tit {
display: flex;
justify-content: space-between;
align-items: center;
height: 20px;
}
.addTeamman .add-tit p {
display: flex;
align-items: center;
font-weight: bold;
color: rgba(17, 17, 17, 1);
font-size: 14px;
}
.addTeamman .add-tit p span {
display: inline-block;
width: 6px;
height: 6px;
/* background: #409efe; */
border-radius: 50%;
margin-right: 10px;
}
.addTeamman .el-dialog__header {
padding: 15px 20px;
background: rgba(255, 255, 255, 1);
}
.addTeamman .dialog-footer {
text-align: center;
background-color: rgba(248, 250, 251, 1);
padding-bottom: 20px;
}
.addTeamman .el-dialog__footer {
padding: 0;
}
.addTeamman .el-tag.el-tag--info {
background-color: rgba(0, 0, 0, 0);
border-color: rgba(0, 0, 0, 0);
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<template>
<div>
<el-dialog custom-class="w800" :title="$t('hotel.suplier_contact')" :visible.sync="showVisible" center @close="close">
<div style="margin-bottom: 0px;text-align: right;">
<el-button class="hollowFixedBtn el-icon-plus" @click="openContact" >{{$t('hotel.suplier_contact')}}</el-button>
</div>
<el-table
v-loading="loading"
stripe
ref="multipleTable"
:data="dataList"
tooltip-effect="dark"
style="width: 100%"
row-class-name="font-size-12">
<el-table-column
prop="ContactName"
:label="$t('system.query_name')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="ContactPhone"
:label="$t('pub.mbPhone')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="ContactDutyStr"
:label="$t('visaT.post')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop=""
:label="$t('hotel.table_operat')"
show-overflow-tooltip>
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="$t('pub.edit')" placement="top-start">
<el-button @click.stop="EditContact(scope.row)" style="padding:4px" type="primary" icon="el-icon-edit" circle></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" :content="$t('adm.adm_resetpd')" placement="top-start">
<el-button @click.stop="EditPassword(scope.row)" style="padding:4px" type="success" icon="el-icon-refresh" circle></el-button>
</el-tooltip>
<!-- <el-tooltip class="item" effect="dark" :content="$t('system.ph_shanchu')" placement="top-start">
<el-button @click.stop="EditMsg(scope.row)" style="padding:4px" type="danger" icon="el-icon-delete" circle></el-button>
</el-tooltip> -->
</template>
</el-table-column>
</el-table>
<addCustomerContact v-if="addTeammanShow" :ContactData="ContactData" @addTeammanOk="addTeammanOk" @closeaddTeamman="addTeammanShow=false"/>
</el-dialog>
<el-dialog :modal="false" :visible.sync="showUpdatePW" width="300px" :close-on-click-modal="false">
<div class="add-tit" slot="title">
<p><span></span>{{PasswordData.ContactName}}</p>
<span icon="el-icon-close"></span>
</div>
<div class="form-box">
<el-form :model="PasswordData" ref="PasswordData" class="MyEditForm">
<el-row :gutter="30">
<el-col :span="30">
<div class="MyEditForm-item">
<el-form-item :label="$t('adm.adm_newPd')" prop="Password">
<el-input :placeholder="$t('objFill.qingshuruxmm')" v-model="PasswordData.Password"></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" class="add-box-btn" @click="submitPassword" :loading="loadingOut">{{$t('pub.sureBtn')}}</el-button>
<el-button class="add-box-btn add-box-cancel" @click="showUpdatePW = false,PasswordData.Password=''">{{$t('pub.cancelBtn')}}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import addCustomerContact from "./addCustomerContact";
export default {
props: ["customerId"],
components: {addCustomerContact},
data() {
return {
loadingOut: false,
loadingRom: false,
ContactData:{
InfoID: 0,
ContactName: "",
ContactPhone: "",
ContactDuty: "",
Sex: 0,
IsMain: 0,
Remark: "",
ID: 0,
NextContactTime: "",
Password:""
},
IDs: null,
detailsData: null,
addTeammanShow: false,
IsRead: null,
multipleSelection: [],
showVisible: true,
loading: false,
dataList: [],
showUpdatePW:false,
PasswordData:{
ContactId: 0,
ContactName:"",
Password:""
}
};
},
filters: {
},
methods: {
openContact(){
this.ContactData = {
InfoID: this.customerId,
ContactName: "",
ContactPhone: "",
ContactDuty: "",
Sex: 0,
IsMain: 0,
Remark: "",
ID: 0,
NextContactTime: "",
Password:""
};
this.addTeammanShow=true;
},
EditContact(row){
this.ContactData=row;
this.ContactData.InfoID= row.CustomerId;
this.addTeammanShow=true;
},
addTeammanOk(){
this.addTeammanShow = false
this.GetCustomerContactList()
},
success(){
this.$emit('success')
this.close()
},
close(){
this.$emit('close')
},
GetCustomerContactList(){
if(this.customerId === 0) return
this.loading = true
this.crmapipost('/api/Customer/GetContactByCustomerID', {CustomerId: this.customerId}, res=>{
if (res.data.resultCode == 1) {
this.loading = false
this.dataList = res.data.data
}else{
this.loading = false
}
})
},
EditPassword(row){
this.PasswordData.ContactId=row.ID;
this.PasswordData.ContactName=row.ContactName;
this.PasswordData.Password='';
this.showUpdatePW=true;
},
submitPassword(){
if(this.PasswordData.ContactId<=0) {
return this.$message.error("ID-Error")
}
if(this.PasswordData.Password=='') {
return this.$message.error(this.$t('objFill.qingshuruxmm'))
}
this.loadingOut = true
this.crmapipost('/api/Customer/SetCustomerContactPW', this.PasswordData, res=>{
if (res.data.resultCode == 1) {
this.loadingOut = false
this.$message.success(res.data.message)
this.GetCustomerContactList();
this.showUpdatePW=false;
}else{
this.$message.error(res.data.message);
this.loadingOut = false;
this.showUpdatePW=false;
}
})
}
},
mounted() {
this.GetCustomerContactList()
},
};
</script>
<style>
.addContacts .add-tit {
display: flex;
justify-content: space-between;
align-items: center;
height: 20px;
}
.addContacts .add-tit p {
display: flex;
align-items: center;
font-weight: bold;
color: rgba(17, 17, 17, 1);
font-size: 14px;
}
.addContacts .add-tit p span {
display: inline-block;
width: 6px;
height: 6px;
background: #409efe;
border-radius: 50%;
margin-right: 10px;
}
.addContacts .el-dialog__header {
padding: 15px 20px;
background: rgba(255, 255, 255, 1);
}
.addContacts .dialog-footer {
text-align: center;
background-color: rgba(248, 250, 251, 1);
padding-bottom: 20px;
}
.addContacts .el-dialog__footer {
padding: 0;
}
</style>
<template>
<el-dialog @closed="closedDialog" :modal="false" :visible.sync="dialogTableVisible" :close-on-click-modal="false" class="addContacts">
<div class="add-tit" slot="title">
<p v-if="form.ID==0"><span></span>添加联系人</p>
<p v-else><span></span>修改联系人</p>
<span icon="el-icon-close"></span>
</div>
<div class="form-box">
<el-form :model="form" ref="form" class="MyEditForm" :rules="rules">
<el-row :gutter="30">
<el-col :span="8">
<div class="MyEditForm-item">
<el-form-item label="联系人" prop="ContactName">
<el-input placeholder="请输入联系人姓名" v-model="form.ContactName"></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="MyEditForm-item">
<el-form-item label="电话" prop="ContactPhone">
<el-input placeholder="请输入联系电话" v-model="form.ContactPhone"></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="MyEditForm-item">
<el-form-item label="职务" prop="ContactDuty">
<el-select v-model="form.ContactDuty" placeholder="请选择联系人职务">
<el-option
v-for='item in zwList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="8">
<div class="MyEditForm-item">
<el-form-item label="性别" prop="Sex">
<el-select v-model="form.Sex" placeholder="请选择联系人性别">
<el-option label='保密' :value='0' :key='0'> </el-option>
<el-option label='男' :value='1' :key='1'> </el-option>
<el-option label='女' :value='2' :key='2'> </el-option>
</el-select>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="MyEditForm-item">
<el-form-item label="是否决策人" prop="IsMain">
<el-select v-model="form.IsMain" placeholder="请选择是否决策人">
<el-option label='否' :value='0' :key='0'> </el-option>
<el-option label='是' :value='1' :key='1'> </el-option>
</el-select>
</el-form-item>
</div>
</el-col>
<el-col v-if="ContactData.ID==0" :span="8">
<div class="MyEditForm-item">
<el-form-item label="密码" prop="Password">
<el-input placeholder="请输入登录密码" v-model="form.Password"></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="MyEditForm-item label-pad-left">
<el-form-item label="备注">
<el-input type="textarea" placeholder="请输入备注" v-model="form.Remark"></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" class="add-box-btn" @click="submitForm('form')" :loading="loading">{{$t('pub.sureBtn')}}</el-button>
<el-button class="add-box-btn add-box-cancel" @click="dialogTableVisible = false, resetForm('form')">{{$t('pub.cancelBtn')}}</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
props: ["ContactData"],
data() {
return {
loading: false,
dialogTableVisible: true,
rules: {
IsMain: [
{ required: true, message: "请选择是否决策人", trigger: "change" },
],
Sex: [
{ required: true, message: "请选择联系人性别", trigger: "change" },
],
ContactDuty: [
{ required: true, message: "请选择联系人职务", trigger: "change" },
],
ContactName: [
{ required: true, message: "请输入联系人姓名", trigger: "blur" },
],
ContactPhone: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
],
Password: [
{ required: true, message: "请输入登录密码", trigger: "blur" },
],
},
zwList: [],
form: {
InfoID: 0,
ContactName: "",
ContactPhone: "",
ContactDuty: "",
Sex: 0,
IsMain: 0,
Remark: "",
ID: 0,
NextContactTime: "",
Password:""
},
};
},
watch: {},
mounted() {
if(this.ContactData){
this.form = this.ContactData;
}
this.getZw();
let $this = this;
setTimeout(() => {
$this.dialogTableVisible = true;
}, 50);
},
methods: {
closedDialog() {
this.$emit("closeaddTeamman");
},
addData() {
this.crmapipost(
"/api/Customer/CreateMyCustomerContact",
this.form,
(res) => {
if (res.data.resultCode == 1) {
this.$message.success("操作成功");
this.resetForm("form");
this.dialogTableVisible = false;
this.$emit("addTeammanOk");
}else{
this.$message.error(res.data.message)
}
}
);
},
submitForm(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if (valid) {
this.addData();
} else {
return false;
}
});
},
resetForm(formName) {
// 重置表单
this.form = {
InfoID: 0,
ContactName: "",
ContactPhone: "",
ContactDuty: "",
Sex: 0,
IsMain: 0,
Remark: "",
ID: 0,
NextContactTime: "",
Password:""
};
this.$refs[formName].resetFields();
},
getZw() {
this.apipost(
"app_today_visit_GetCustomerDutyEnum",
{},
(res) => {
if (res.data.resultCode == 1) {
this.zwList = res.data.data;
}
},
(err) => {}
);
},
},
};
</script>
......@@ -530,7 +530,7 @@
<th v-if="currentUserInfo&&currentUserInfo.RB_Group_id==2">{{$t('salesModule.belongUnion')}}</th>
<th v-if="currentUserInfo&&currentUserInfo.RB_Group_id==2">{{$t('active.ad_yhq')}}</th>
<th v-if="currentUserInfo&&currentUserInfo.RB_Group_id==2">{{$t('objFill.yucunyue')}}</th>
<th width="200px">{{$t('hotel.table_operat')}}</th>
<th width="220px">{{$t('hotel.table_operat')}}</th>
</tr>
<tr v-for="(item,i) in dataList" :key="i">
<td>
......@@ -613,6 +613,10 @@
<el-button style="padding:4px" @click.stop="goTeamMember(item)" type="primary" icon="el-icon-user-solid"
circle></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" :content="$t('hotel.suplier_contact')" placement="top-start">
<el-button style="padding:4px" @click.stop="customerId=item.customerId,showContact=true" type="danger" icon="el-icon-s-custom"
circle></el-button>
</el-tooltip>
</td>
</tr>
<tr v-if="dataList.length==0">
......@@ -1010,23 +1014,31 @@
<!-- 团队成员 -->
<TeamMemberList v-if="ShowTeamMember" :customerId="customerId" @close="ShowTeamMember=false,customerId=null"
@success="getList"></TeamMemberList>
<!-- 联系人 -->
<CustomerContactList v-if="showContact" :customerId="customerId" @close="showContact=false,customerId=null"
@success="getList"></CustomerContactList>
</div>
</template>
<script>
import detailList from "../FinancialModule/PrestorageManagement/components/detailList.vue";
import signedClientList from './Common/signedClientList'
import TeamMemberList from './Common/TeamMemberList'
import CustomerContactList from './Common/CustomerContactList'
export default {
components: {
signedClientList,
detailList,
TeamMemberList
TeamMemberList,
CustomerContactList
},
data() {
return {
loadingSave: false,
customerId: null,
ShowTeamMember: false,
showContact: false,
detailObj: null,
showdetail: false,
isVisa: false, // 是否是签证下面的菜单
......
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