Commit ca09eb14 authored by 罗超's avatar 罗超

修改Form表单

parent 04ad4222
<style>
.customerDialogBox.add-box .add-tit {
display: flex;
justify-content: space-between;
align-items: center;
height: 20px;
}
.customerDialogBox.add-box .add-tit p {
display: flex;
align-items: center;
font-weight: bold;
color: rgba(17, 17, 17, 1);
font-size: 14px;
}
.customerDialogBox.add-box .add-tit p span {
display: inline-block;
width: 6px;
height: 6px;
background: rgba(13, 36, 129, 1);
border-radius: 50%;
margin-right: 10px;
}
.customerDialogBox.add-box .el-dialog__header {
padding: 15px 20px;
background: rgba(255, 255, 255, 1);
}
.customerDialogBox.add-box .dialog-footer {
text-align: center;
background-color: rgba(248, 250, 251, 1);
padding-bottom: 20px;
}
.customerDialogBox.add-box .el-dialog__footer {
padding: 0;
}
.customerDialogBox.add-box .el-dialog__body {
background-color: rgba(248, 250, 251, 1);
padding-top: 20px;
max-height: 500px;
overflow: auto;
}
.customerDialogBox .add-box-btn.el-button {
border-radius: 0;
background-color: rgba(13, 36, 129, .8);
border-color: rgba(13, 36, 129, .8);
color: white;
padding: 12px 43px;
}
.customerDialogBox .add-box-btn.el-button:hover {
background-color: rgba(13, 36, 129, 1);
border-color: rgba(13, 36, 129, 1);
color: white;
}
.customerDialogBox .add-box-btn.el-button.add-box-cancel {
color: rgba(13, 36, 129, .8);
background-color: white;
}
.customerDialogBox .add-box-btn.el-button.add-box-cancel:hover {
color: rgba(13, 36, 129, 1);
background-color: white;
}
.customerDialogBox .el-input .el-input-group__append {
background-color: rgba(13, 36, 129, 1);
border-color: rgba(13, 36, 129, 1);
color: #fff;
}
.customerDialogBox .form-box .form-box-tit {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.customerDialogBox .form-box .radius {
display: flex;
width: 4px;
height: 4px;
background: rgba(255, 164, 117, 1);
border-radius: 50%;
margin-right: 10px;
}
.customerDialogBox .up-img-box .uib-item {
margin-right: 30px;
width: 120px;
height: 120px;
background-color: white;
position: relative;
margin-bottom: 30px;
}
.customerDialogBox .up-img-box .uib-item p {
position: absolute;
bottom: -30px;
font-size: 12px;
text-align: center;
width: 100%;
}
.customerDialogBox .up-img-box .uib-item:hover .imgzhe-btn {
opacity: 1
}
.customerDialogBox .imgzhe {
width: 100%;
height: 100%;
position: absolute;
top: 0;
}
.customerDialogBox .imgzhe .imgzhe-btn {
background: rgba(0, 0, 0, 0.6);
width: 100%;
height: 100%;
text-align: center;
line-height: 120px;
position: absolute;
top: 0;
opacity: 1;
transition: all linear .5s
}
.customerDialogBox .imgzhe .imgzhe-btn i {
font-size: 22px;
margin-right: 5px;
color: white;
cursor: pointer;
}
.customerDialogBox .up-ctrl {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.customerDialogBox .up-ctrl>div {
width: 100%;
height: 100%;
text-align: center;
line-height: 140px;
}
.MyEditForm-item-checkd.MyEditForm-item .el-form-item {
width: 80%;
}
.MyEditForm-item-checkd .el-checkbox {
position: absolute;
right: -50px;
top: 10px;
}
._addPassengerEconomicCapability {
line-height: 22px;
overflow: hidden;
width: 100%;
}
._addPassengerEconomicCapability span {
display: inline-block;
padding: 2px 4px;
border: 1px solid #c0c4cc;
margin: 1px;
cursor: pointer;
color: #c0c4cc;
font-size: 12px;
border-radius: 4px;
}
._addPassengerEconomicCapability span._active {
border: 1px solid rgb(123, 194, 245);
color: rgb(123, 194, 245);
}
.el-collapse-item__wrap {
background-color: rgba(248, 250, 251, 1);
}
.el-col .el-col-8 {
width: 31% !important;
margin-right: 15px;
}
.el-collapse-item__header {
padding-left: 10px;
}
.el-collapse-item__wrap {
padding-top: 15px;
}
.customerDialogBox.add-box .add-tit {
display: flex;
justify-content: space-between;
align-items: center;
height: 20px;
}
.customerDialogBox.add-box .add-tit p {
display: flex;
align-items: center;
font-weight: bold;
color: rgba(17, 17, 17, 1);
font-size: 14px;
}
.customerDialogBox.add-box .add-tit p span {
display: inline-block;
width: 6px;
height: 6px;
background: rgba(13, 36, 129, 1);
border-radius: 50%;
margin-right: 10px;
}
.customerDialogBox.add-box .el-dialog__header {
padding: 15px 20px;
background: rgba(255, 255, 255, 1);
}
.customerDialogBox.add-box .dialog-footer {
text-align: center;
background-color: rgba(248, 250, 251, 1);
padding-bottom: 20px;
}
.customerDialogBox.add-box .el-dialog__footer {
padding: 0;
}
.customerDialogBox.add-box .el-dialog__body {
background-color: rgba(248, 250, 251, 1);
padding-top: 20px;
max-height: 500px;
overflow: auto;
}
.customerDialogBox .add-box-btn.el-button {
border-radius: 0;
background-color: rgba(13, 36, 129, 0.8);
border-color: rgba(13, 36, 129, 0.8);
color: white;
padding: 12px 43px;
}
.customerDialogBox .add-box-btn.el-button:hover {
background-color: rgba(13, 36, 129, 1);
border-color: rgba(13, 36, 129, 1);
color: white;
}
.customerDialogBox .add-box-btn.el-button.add-box-cancel {
color: rgba(13, 36, 129, 0.8);
background-color: white;
}
.customerDialogBox .add-box-btn.el-button.add-box-cancel:hover {
color: rgba(13, 36, 129, 1);
background-color: white;
}
.customerDialogBox .el-input .el-input-group__append {
background-color: rgba(13, 36, 129, 1);
border-color: rgba(13, 36, 129, 1);
color: #fff;
}
.customerDialogBox .form-box .form-box-tit {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.customerDialogBox .form-box .radius {
display: flex;
width: 4px;
height: 4px;
background: rgba(255, 164, 117, 1);
border-radius: 50%;
margin-right: 10px;
}
.customerDialogBox .up-img-box .uib-item {
margin-right: 30px;
width: 120px;
height: 120px;
background-color: white;
position: relative;
margin-bottom: 30px;
}
.customerDialogBox .up-img-box .uib-item p {
position: absolute;
bottom: -30px;
font-size: 12px;
text-align: center;
width: 100%;
}
.customerDialogBox .up-img-box .uib-item:hover .imgzhe-btn {
opacity: 1;
}
.customerDialogBox .imgzhe {
width: 100%;
height: 100%;
position: absolute;
top: 0;
}
.customerDialogBox .imgzhe .imgzhe-btn {
background: rgba(0, 0, 0, 0.6);
width: 100%;
height: 100%;
text-align: center;
line-height: 120px;
position: absolute;
top: 0;
opacity: 1;
transition: all linear 0.5s;
}
.customerDialogBox .imgzhe .imgzhe-btn i {
font-size: 22px;
margin-right: 5px;
color: white;
cursor: pointer;
}
.customerDialogBox .up-ctrl {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.customerDialogBox .up-ctrl > div {
width: 100%;
height: 100%;
text-align: center;
line-height: 140px;
}
.MyEditForm-item-checkd.MyEditForm-item .el-form-item {
width: 80%;
}
.MyEditForm-item-checkd .el-checkbox {
position: absolute;
right: -50px;
top: 10px;
}
._addPassengerEconomicCapability {
line-height: 22px;
overflow: hidden;
width: 100%;
}
._addPassengerEconomicCapability span {
display: inline-block;
padding: 2px 4px;
border: 1px solid #c0c4cc;
margin: 1px;
cursor: pointer;
color: #c0c4cc;
font-size: 12px;
border-radius: 4px;
}
._addPassengerEconomicCapability span._active {
border: 1px solid rgb(123, 194, 245);
color: rgb(123, 194, 245);
}
.el-collapse-item__wrap {
background-color: rgba(248, 250, 251, 1);
}
.el-col .el-col-8 {
width: 31% !important;
margin-right: 15px;
}
.el-collapse-item__header {
padding-left: 10px;
}
.el-collapse-item__wrap {
padding-top: 15px;
}
</style>
<template>
<el-dialog :visible.sync="dialogTableVisible" @closed="closedDialog" :close-on-click-modal="false"
......@@ -214,14 +214,14 @@
<el-row :gutter="30">
<el-col :span="8">
<div class="MyEditForm-item label-pad-left">
<el-form-item label="名称" prop="ClueName ">
<el-input placeholder="请填写名称" v-model="form.ClueName "></el-input>
<el-form-item label="线索名称" prop="ClueName ">
<el-input placeholder="请填写线索名称" v-model="form.ClueName "></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="MyEditForm-item label-pad-left">
<el-form-item label="需求" prop="ClueDemand ">
<el-form-item label="客人需求" prop="ClueDemand ">
<el-input placeholder="请填写需求" v-model="form.ClueDemand "></el-input>
</el-form-item>
</div>
......@@ -229,14 +229,14 @@
<el-col :span="8">
<div class="MyEditForm-item">
<el-form-item label="微信号" prop="WeChatNo">
<el-input placeholder="请输入微信号" v-model="form.WeChatNo"></el-input>
<el-input placeholder="请输入微信号" ref="WeChatNo" v-model="form.WeChatNo"></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="MyEditForm-item">
<el-form-item label="手机号码" prop="MobilePhone">
<el-input placeholder="请输入手机号码" v-model="form.MobilePhone"></el-input>
<el-input placeholder="请输入手机号码" ref="MobilePhone" v-model="form.MobilePhone"></el-input>
</el-form-item>
</div>
</el-col>
......@@ -244,7 +244,7 @@
<el-col :span="8">
<div class="MyEditForm-item">
<el-form-item label="客户来源" prop="CustomerSourceType">
<el-select v-model="form.CustomerSourceType" placeholder="请选择客户来源">
<el-select v-model="form.CustomerSourceType" placeholder="请选择客户来源" @change="changeSourceHandler">
<el-option v-for="item in SourceEnum" :key="item.ID" :label="item.Name"
:value="item.ID">
</el-option>
......@@ -260,7 +260,7 @@
</el-form-item>
</div>
</el-col>
<el-col :span="8" v-else="SourceEnum.ID === SourceSegmentList.ID">
<el-col :span="8" v-if="SourceSegmentList && SourceSegmentList.length>0">
<div class="MyEditForm-item label-pad-left">
<el-form-item label="来源细分" prop="SourceAccount">
<el-select placeholder="请选择来源途径" v-model="form.SourceAccount">
......@@ -283,7 +283,7 @@
</div>
<div class="form-box" v-if="show">
<el-collapse v-model="activeNames" @change="handleChange">
<el-collapse v-model="activeNames">
<el-collapse-item title="更多信息" name="3">
<el-form :model="form" ref="form" class="MyEditForm">
<el-col :span="8">
......@@ -512,484 +512,550 @@
</el-dialog>
</template>
<script>
export default {
props: {
CustomerId: {
type: Number,
default: 0
},
name: {
type: String,
default: '新建客户'
export default {
props: {
CustomerId: {
type: Number,
default: 0,
},
name: {
type: String,
default: "新建客户",
},
},
data() {
let checkPhone = (rule, value, callback) => {
if (!value) {
return callback(new Error("手机号不能为空"));
} else {
const reg = /^1[3|4|5|7|8][0-9]\d{8}$/;
if (reg.test(value)) {
callback();
} else {
return callback(new Error("请输入正确的手机号"));
}
}
};
var validateWechatAndPhone = (rule, value, callback) => {
if (!this.form.WeChatNo && !this.form.MobilePhone) {
callback(new Error("微信号或手机号,请填写一个"));
} else {
//console.log(this.$refs);
if (!this.form.WeChatNo || !this.form.MobilePhone) {
this.$refs["form"].validateField("WeChatNo");
this.$refs["form"].validateField("MobilePhone");
}
callback();
}
};
var validateSourceAccount = (rule, value, callback) => {
if (this.form.CustomerSourceType != 6) {
if (
this.form.SourceAccount == "" &&
this.SourceSegmentList &&
this.SourceSegmentList.length > 0
) {
callback(new Error("请选择细分渠道选项"));
} else {
callback();
}
} else {
callback();
}
};
return {
dialogTableVisible: false,
SourceEnum: [],
countryList: "",
provinceList: "",
dialogImageUrl: "",
dialogVisible: false,
cityList: "",
district: "",
jycs: [],
fileList: [],
CustomerLevelEnum: [],
CustomerBrandList: [],
activeNames: ["0", "1"],
form: {
Id: 0,
SurName: "",
Name: "",
Sex: "",
EName: "",
ESurName: "",
Birthday: "",
BirthdayAddress: "",
PassportAddress: "",
PassportExpiry: "",
PassportNo: "",
Nationality: "",
Marriage: "",
Address: "",
AddressDetail: "",
HistoryRecord: "",
IdentityType: "",
Duty: "",
EconomicCapabilityList: [],
Remarks: "",
TravelType: "",
UnitType: "",
DutyType: "",
IsHightSchool: "",
IsRecommend: "",
PassportIssued: "",
IssuingAuthority: "",
IdCard: "",
MobilePhone: "",
CustomerSourceType: "",
CustomerSource: "",
ClueName: "",
ClueDemand: "",
WeChatNo: "",
SourceAccount: "",
},
VisaIdentityTypeEnum: [],
VisaDeparturesType: [],
VisaDutyTypeEnum: [],
TravelTypeList: [],
DutyTypeList: [],
UnitTypeList: [],
rules: {
ClueName: [
{
required: true,
message: "请填写线索名称",
trigger: "blur",
},
],
ClueDemand: [
{
required: true,
message: "请填写客人需求",
trigger: "blur",
},
],
// Remarks: [{
// required: true,
// message: '请填写备注',
// trigger: 'blur'
// }],
WeChatNo: [
{
required: true,
validator: validateWechatAndPhone,
trigger: "blur",
},
],
MobilePhone: [
{
required: true,
validator: validateWechatAndPhone,
trigger: "blur",
},
],
CustomerSource: [
{
required: true,
message: "请输入客户来源信息",
trigger: "blur",
},
],
CustomerSourceType: [
{
required: true,
message: "请选择客户来源",
trigger: "change",
},
],
SourceAccount: [
{
required: true,
validator: validateSourceAccount,
trigger: "blur",
},
],
},
show: true,
CustomerList: [],
EconomicCapabilityS: [],
// 小红书
SourceSegmentList: [],
};
},
watch: {
CustomerId: {
handler(val, oldVal) {
// console.log(val)
},
deep: true,
},
},
mounted() {
this.GetCustomerLevelEnum();
this.getJycs();
this.getCustomerBrandList();
this.getCountryList();
this.GetCustomerSourceEnum();
this.getCustomerList();
this.getVisaIdentityTypeEnum();
this.getVisaDeparturesType();
this.getVisaDutyTypeEnum();
this.getTravelType();
this.getUnitType();
this.getDutyType();
this.getEconomicCapability();
//this.getSourceSegmentList();
let $this = this;
setTimeout(() => {
$this.dialogTableVisible = true;
}, 50);
if (this.CustomerId !== 0) {
this.apipost(
"/api/Customer/GetAllGuesstCustomerModel",
{
ID: this.CustomerId,
},
(res) => {
if (res.data.resultCode == 1) {
let data = res.data.data;
if (!data.HousePhotos) {
data.HousePhotos = [];
}
if (!data.BusinessCardPhotos) {
data.BusinessCardPhotos = [];
}
if (!data.Images) {
data.Images = [];
}
if (!data.CustomerSourceType) {
data.CustomerSourceType = "";
}
if (!data.CustomerSource) {
data.CustomerSource = "";
}
if (!data.Province) {
data.Province = "";
}
if (!data.Country) {
data.Country = "";
}
if (!data.City) {
data.City = "";
}
if (!data.District) {
data.District = "";
}
if (data.Country) {
this.getProvinceList2(data.Country, 1);
}
if (data.Province) {
this.getProvinceList2(data.Province, 2);
}
if (data.City) {
this.getProvinceList2(data.City, 3);
}
this.form = data;
}
}
);
}
},
/* /api/Customer/GetGuestSourceAccountList */
methods: {
Transformation(val, type) {
let text = this.pinyin(val, {
style: this.pinyin.STYLE_NORMAL,
});
if (type == "SurName") {
let upText = text.join("").toLocaleUpperCase();
this.form.ESurName = upText;
}
if (type == "Name") {
let upText = text.join("").toLocaleUpperCase();
this.form.EName = upText;
}
},
getEconomicCapability() {
//获取经济能力
this.apipost2(
"dict_post_GetList",
{
Key: "SK_Visa_EconomicCapability",
IsTimer: 1,
},
data() {
let checkPhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('手机号不能为空'));
} else {
const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
if (reg.test(value)) {
callback();
} else {
return callback(new Error('请输入正确的手机号'));
(res) => {
this.EconomicCapabilityS = res.data.data;
if (this.CustomerId != 0) {
this.form.Id = this.CustomerId;
this.apipost(
"/api/Customer/GetAllGuesstCustomerModel",
{
ID: this.CustomerId,
},
(res) => {
if (res.data.resultCode == 1) {
let obj = res.data.data;
obj.TravelType = obj.TravelType.toString();
obj.UnitType = obj.UnitType.toString();
obj.DutyType = obj.DutyType.toString();
this.form = obj;
this.EconomicCapabilityS.forEach((x) => {
if (obj.EconomicCapabilityList) {
obj.EconomicCapabilityList.forEach((y) => {
if (x.ID == y.ID) {
x.isShow = true;
x.Content = y.Value;
}
});
}
});
}
}
return {
dialogTableVisible: false,
SourceEnum: [],
countryList: "",
provinceList: "",
dialogImageUrl: '',
dialogVisible: false,
cityList: "",
district: "",
jycs: [],
fileList: [],
CustomerLevelEnum: [],
CustomerBrandList: [],
activeNames: ['0', '1'],
form: {
Id: 0,
SurName: '',
Name: '',
Sex: '',
EName: '',
ESurName: '',
Birthday: '',
BirthdayAddress: '',
PassportAddress: '',
PassportExpiry: '',
PassportNo: '',
Nationality: '',
Marriage: '',
Address: '',
AddressDetail: '',
HistoryRecord: '',
IdentityType: '',
Duty: '',
EconomicCapabilityList: [],
Remarks: '',
TravelType: '',
UnitType: '',
DutyType: '',
IsHightSchool: '',
IsRecommend: '',
PassportIssued: '',
IssuingAuthority: '',
IdCard: '',
MobilePhone: '',
CustomerSourceType: '',
CustomerSource: '',
ClueName: '',
ClueDemand: '',
WeChatNo: '',
SourceAccount: '',
},
VisaIdentityTypeEnum: [],
VisaDeparturesType: [],
VisaDutyTypeEnum: [],
TravelTypeList: [],
DutyTypeList: [],
UnitTypeList: [],
rules: {
ClueName: [{
required: true,
message: '请填写名称',
trigger: 'blur'
}],
ClueDemand: [{
required: true,
message: '请填写需求',
trigger: 'blur'
}],
Remarks: [{
required: true,
message: '请填写备注',
trigger: 'blur'
}],
WeChatNo: [{
required: true,
message: '请填写微信号',
trigger: 'blur'
}],
MobilePhone: [{
required: true,
message: '请填写手机号码',
trigger: 'blur'
}],
CustomerSource: [{
required: true,
message: '请输入客户来源信息',
trigger: 'blur'
}],
CustomerSourceType: [{
required: true,
message: '请选择客户来源',
trigger: 'change'
}],
SourceAccount: [{
required: true,
message: '请选择你的来源',
trigger: 'change'
}]
},
show: true,
CustomerList: [],
EconomicCapabilityS: [],
// 小红书
SourceSegmentList: [],
};
}
);
}
},
watch: {
CustomerId: {
handler(val, oldVal) {
// console.log(val)
},
deep: true
}
(err) => {}
);
},
addLittleRedBook() {},
addEconomicCapability(obj) {
// 添加经济能力说明
this.EconomicCapabilityS.forEach((x) => {
if (x.ID == obj.ID) {
x.isShow ? (x.isShow = false) : (x.isShow = true);
}
});
this.$forceUpdate();
},
getDutyType() {
this.apipost2(
"dict_get_GetDictValueCommonList",
{
Key: "SK_CRM_DutyType",
},
(res) => {
if (res.data.resultCode == 1) {
this.DutyTypeList = res.data.data;
} else {
}
},
(err) => {}
);
},
getUnitType() {
this.apipost2(
"dict_get_GetDictValueCommonList",
{
Key: "SK_CRM_UnitType",
},
(res) => {
if (res.data.resultCode == 1) {
this.UnitTypeList = res.data.data;
} else {
}
},
(err) => {}
);
},
getTravelType() {
this.apipost2(
"dict_get_GetDictValueCommonList",
{
Key: "SK_CRM_TravelType",
},
(res) => {
if (res.data.resultCode == 1) {
this.TravelTypeList = res.data.data;
} else {
}
},
(err) => {}
);
},
getVisaDutyTypeEnum() {
//获取职务
let msg = {};
this.apipost2(
"dmc_get_visa_GetVisaDutyTypeEnum",
msg,
(res) => {
if (res.data.resultCode == 1) {
this.VisaDutyTypeEnum = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
mounted() {
this.GetCustomerLevelEnum()
this.getJycs()
this.getCustomerBrandList()
this.getCountryList()
this.GetCustomerSourceEnum()
this.getCustomerList()
this.getVisaIdentityTypeEnum()
this.getVisaDeparturesType()
this.getVisaDutyTypeEnum()
this.getTravelType()
this.getUnitType()
this.getDutyType()
this.getEconomicCapability()
this.getSourceSegmentList()
let $this = this
setTimeout(() => {
$this.dialogTableVisible = true
}, 50)
(err) => {}
);
},
getVisaDeparturesType() {
//获取出境记录状态
let msg = {};
this.apipost2(
"dmc_get_visa_GetVisaDeparturesTypeEnum",
msg,
(res) => {
if (res.data.resultCode == 1) {
this.VisaDeparturesType = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
(err) => {}
);
},
getVisaIdentityTypeEnum() {
//获取身份证明
let msg = {};
this.apipost2(
"dmc_get_visa_GetVisaIdentityTypeEnum",
msg,
(res) => {
if (res.data.resultCode == 1) {
this.VisaIdentityTypeEnum = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
(err) => {}
);
},
getCustomerList() {
this.apipost("/api/Customer/GetCustomerListByCreateInfo", {}, (res) => {
if (res.data.resultCode == 1) {
this.CustomerList = res.data.data;
}
});
},
closedDialog() {
this.MsgBus.$emit("closeCustomerDialogBox");
},
addData() {
if (this.form.CustomerID === "") {
this.form.CustomerID = 0;
}
this.form.EconomicCapabilityList = [];
this.EconomicCapabilityS.forEach((x) => {
if (x.isShow == true) {
this.form.EconomicCapabilityList.push({
Key: x.Name,
Value: x.Content,
ID: x.ID,
});
}
});
this.apipost(
"/api/Customer/CreateGuestCustomerClue",
this.form,
(res) => {
if (res.data.resultCode == 1) {
this.dialogTableVisible = false;
// 有id 发送更新抽屉消息
if (this.CustomerId !== 0) {
this.apipost('/api/Customer/GetAllGuesstCustomerModel', {
ID: this.CustomerId
}, res => {
if (res.data.resultCode == 1) {
let data = res.data.data
if (!data.HousePhotos) {
data.HousePhotos = []
}
if (!data.BusinessCardPhotos) {
data.BusinessCardPhotos = []
}
if (!data.Images) {
data.Images = []
}
if (!data.CustomerSourceType) {
data.CustomerSourceType = ''
}
if (!data.CustomerSource) {
data.CustomerSource = ''
}
if (!data.Province) {
data.Province = ''
}
if (!data.Country) {
data.Country = ''
}
if (!data.City) {
data.City = ''
}
if (!data.District) {
data.District = ''
}
if (data.Country) {
this.getProvinceList2(data.Country, 1)
}
if (data.Province) {
this.getProvinceList2(data.Province, 2)
}
if (data.City) {
this.getProvinceList2(data.City, 3)
}
this.form = data
}
})
this.$message.success("修改直客成功");
this.MsgBus.$emit("RefreshInfoBox");
} else {
this.$message.success("新建直客成功");
}
this.$emit("getList");
this.resetForm("form");
}
}
);
},
submitForm(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if (valid) {
this.addData();
} else {
return false;
}
});
},
resetForm(formName) {
// 重置表单
this.form = {
Id: 0,
SurName: "",
Name: 0,
Sex: "",
EName: "",
ESurName: 0,
Birthday: "",
BirthdayAddress: 2,
PassportAddress: "",
PassportExpiry: "",
PassportNo: "",
Nationality: "",
Marriage: "",
Address: "",
AddressDetail: "",
HistoryRecord: "",
IdentityType: "",
Duty: "",
EconomicCapabilityList: [],
Remarks: "",
TravelType: "",
UnitType: "",
DutyType: "",
IsHightSchool: "",
IsRecommend: "",
PassportIssued: "",
IssuingAuthority: "",
IdCard: "",
MobilePhone: "",
CustomerSourceType: "",
CustomerSource: "",
ClueName: "",
WeChatNo: "",
SourceAccount: "",
};
this.$refs[formName].resetFields();
},
getCustomerBrandList() {
// 获取品牌
this.apipost2(
"app_get_customer_brand",
{},
(res) => {
if (res.data.resultCode == 1) {
this.CustomerBrandList = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
/* /api/Customer/GetGuestSourceAccountList */
methods: {
handleChange(val) {
// console.log(val);
},
Transformation(val, type) {
let text = this.pinyin(val, {
style: this.pinyin.STYLE_NORMAL
});
if (type == "SurName") {
let upText = text.join("").toLocaleUpperCase()
this.form.ESurName = upText;
}
if (type == "Name") {
let upText = text.join("").toLocaleUpperCase()
this.form.EName = upText;
}
},
getEconomicCapability() {
//获取经济能力
this.apipost2(
"dict_post_GetList", {
Key: "SK_Visa_EconomicCapability",
IsTimer: 1
},
res => {
this.EconomicCapabilityS = res.data.data;
if (this.CustomerId != 0) {
this.form.Id = this.CustomerId;
this.apipost('/api/Customer/GetAllGuesstCustomerModel', {
ID: this.CustomerId
}, res => {
if (res.data.resultCode == 1) {
let obj = res.data.data;
obj.TravelType = obj.TravelType.toString()
obj.UnitType = obj.UnitType.toString()
obj.DutyType = obj.DutyType.toString()
this.form = obj;
this.EconomicCapabilityS.forEach(x => {
if (obj.EconomicCapabilityList) {
obj.EconomicCapabilityList.forEach(y => {
if (x.ID == y.ID) {
x.isShow = true;
x.Content = y.Value;
}
});
}
});
}
})
}
},
err => {}
);
},
addLittleRedBook() {
},
addEconomicCapability(obj) {
// 添加经济能力说明
this.EconomicCapabilityS.forEach(x => {
if (x.ID == obj.ID) {
x.isShow ? (x.isShow = false) : (x.isShow = true);
}
});
this.$forceUpdate();
},
getDutyType() {
this.apipost2(
"dict_get_GetDictValueCommonList", {
Key: 'SK_CRM_DutyType',
},
res => {
if (res.data.resultCode == 1) {
this.DutyTypeList = res.data.data
} else {}
},
err => {}
);
},
getUnitType() {
this.apipost2(
"dict_get_GetDictValueCommonList", {
Key: 'SK_CRM_UnitType',
},
res => {
if (res.data.resultCode == 1) {
this.UnitTypeList = res.data.data
} else {}
},
err => {}
);
},
getTravelType() {
this.apipost2(
"dict_get_GetDictValueCommonList", {
Key: 'SK_CRM_TravelType',
},
res => {
if (res.data.resultCode == 1) {
this.TravelTypeList = res.data.data
} else {}
},
err => {}
);
},
getVisaDutyTypeEnum() {
//获取职务
let msg = {};
this.apipost2(
"dmc_get_visa_GetVisaDutyTypeEnum",
msg,
res => {
if (res.data.resultCode == 1) {
this.VisaDutyTypeEnum = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
err => {}
);
},
getVisaDeparturesType() {
//获取出境记录状态
let msg = {};
this.apipost2(
"dmc_get_visa_GetVisaDeparturesTypeEnum",
msg,
res => {
if (res.data.resultCode == 1) {
this.VisaDeparturesType = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
err => {}
);
},
getVisaIdentityTypeEnum() {
//获取身份证明
let msg = {};
this.apipost2(
"dmc_get_visa_GetVisaIdentityTypeEnum",
msg,
res => {
if (res.data.resultCode == 1) {
this.VisaIdentityTypeEnum = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
err => {}
);
},
getCustomerList() {
this.apipost('/api/Customer/GetCustomerListByCreateInfo', {}, res => {
if (res.data.resultCode == 1) {
this.CustomerList = res.data.data
}
})
},
closedDialog() {
this.MsgBus.$emit('closeCustomerDialogBox')
},
addData() {
if (this.form.CustomerID === '') {
this.form.CustomerID = 0
}
this.form.EconomicCapabilityList = []
this.EconomicCapabilityS.forEach(x => {
if (x.isShow == true) {
this.form.EconomicCapabilityList.push({
Key: x.Name,
Value: x.Content,
ID: x.ID
});
}
});
this.apipost('/api/Customer/CreateGuestCustomerClue', this.form, res => {
if (res.data.resultCode == 1) {
this.dialogTableVisible = false;
// 有id 发送更新抽屉消息
if (this.CustomerId !== 0) {
this.$message.success('修改直客成功');
this.MsgBus.$emit('RefreshInfoBox')
} else {
this.$message.success('新建直客成功');
}
this.$emit('getList')
this.resetForm("form");
}
})
},
submitForm(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate(valid => {
if (valid) {
this.addData();
} else {
return false;
}
});
},
resetForm(formName) { // 重置表单
this.form = {
Id: 0,
SurName: '',
Name: 0,
Sex: '',
EName: '',
ESurName: 0,
Birthday: '',
BirthdayAddress: 2,
PassportAddress: '',
PassportExpiry: '',
PassportNo: '',
Nationality: '',
Marriage: '',
Address: '',
AddressDetail: '',
HistoryRecord: '',
IdentityType: '',
Duty: '',
EconomicCapabilityList: [],
Remarks: '',
TravelType: '',
UnitType: '',
DutyType: '',
IsHightSchool: '',
IsRecommend: '',
PassportIssued: '',
IssuingAuthority: '',
IdCard: '',
MobilePhone: '',
CustomerSourceType: '',
CustomerSource: '',
ClueName: '',
WeChatNo: '',
SourceAccount: '',
}
this.$refs[formName].resetFields();
},
getCustomerBrandList() { // 获取品牌
this.apipost2('app_get_customer_brand', {}, res => {
if (res.data.resultCode == 1) {
this.CustomerBrandList = res.data.data;
} else {
this.$message.error(res.data.message)
}
}, err => {})
},
getJycs() {
this.apipost2('app_today_visit_GetCustomerPremisesEnum', {}, res => {
if (res.data.resultCode == 1) {
this.jycs = res.data.data
}
}, err => {})
},
GetCustomerLevelEnum() {
this.apipost('/api/Customer/GetCustomerLevelEnum', {}, res => {
if (res.data.resultCode == 1) {
this.CustomerLevelEnum = res.data.data
}
})
},
GetCustomerSourceEnum() {
this.SourceEnum = []
this.apipost('/api/Customer/GetCustomerSourceEnum', {}, res => {
if (res.data.resultCode == 1) {
this.SourceEnum = res.data.data
}
/* if (res.data.resultCode == 1) {
(err) => {}
);
},
getJycs() {
this.apipost2(
"app_today_visit_GetCustomerPremisesEnum",
{},
(res) => {
if (res.data.resultCode == 1) {
this.jycs = res.data.data;
}
},
(err) => {}
);
},
GetCustomerLevelEnum() {
this.apipost("/api/Customer/GetCustomerLevelEnum", {}, (res) => {
if (res.data.resultCode == 1) {
this.CustomerLevelEnum = res.data.data;
}
});
},
GetCustomerSourceEnum() {
this.SourceEnum = [];
this.apipost("/api/Customer/GetCustomerSourceEnum", {}, (res) => {
if (res.data.resultCode == 1) {
this.SourceEnum = res.data.data;
}
/* if (res.data.resultCode == 1) {
let data = res.data.data
let addList = function(arr) {
arr.forEach(item => {
......@@ -1000,138 +1066,143 @@
this.SourceEnum = res.data.data;
this.getSourceSegmentList();
} */
})
},
//来源细分
getSourceSegmentList() {
this.apipost('/api/Customer/GetGuestSourceAccountList', {}, res => {
if (res.data.resultCode == 1) {
this.SourceSegmentList = res.data.data
for (let i = 0; i < this.SourceEnum.length; i++) {
for (let j = 0; j < this.SourceSegmentList.length; j++) {
if (this.SourceEnum[i].ID == this.SourceSegmentList[j].ID) {
let obj = {
ID: this.SourceSegmentList[j].ID,
}
this.SourceEnum[i].SourceSegmentList.push(obj);
}
}
}
}
})
},
getProvinceList2(ID, type) {
let msg = {
Id: ID
};
this.apipost2(
"dict_post_Destination_GetChildList",
msg,
res => {
if (type == 1) {
this.provinceList = res.data.data;
} else if (type == 2) {
this.cityList = res.data.data;
} else if (type == 3) {
this.district = res.data.data;
}
},
err => {}
);
},
//获取国家
getCountryList() {
this.apipost2(
"dict_post_Destination_GetCountry", {},
res => {
this.countryList = res.data.data;
},
err => {}
);
},
//根据省份获取城市
getProvinceList(ID, type) {
let msg = {
Id: ID
};
if (type == 1) {
this.form.Province = "";
this.form.City = "";
this.form.District = "";
} else if (type == 2) {
this.form.City = "";
this.form.District = "";
} else if (type == 3) {
this.form.District = "";
}
if (this.QCountry !== "") {
this.apipost2(
"dict_post_Destination_GetChildList",
msg,
res => {
if (type == 1) {
this.provinceList = res.data.data;
} else if (type == 2) {
this.cityList = res.data.data;
} else if (type == 3) {
this.district = res.data.data;
}
},
err => {}
);
}
},
uploadImg(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, x => {
let url = this.domainManager().ViittoFileUrl + x.data.FilePath
this.form.Images.push(url);
});
},
uploadImg2(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, x => {
let url = this.domainManager().ViittoFileUrl + x.data.FilePath
this.form.BusinessCardPhotos.push(url);
});
},
uploadImg3(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, x => {
let url = this.domainManager().ViittoFileUrl + x.data.FilePath
this.form.HousePhotos.push(url);
});
},
showImg(i) {
let url = ''
if (i === 1) {
url = this.form.Images[0]
} else if (i === 2) {
url = this.form.BusinessCardPhotos[0]
} else if (i === 3) {
url = this.form.HousePhotos[0]
}
this.dialogImageUrl = url;
this.dialogVisible = true;
},
delImg(i) {
if (i === 1) {
this.form.Images = []
} else if (i === 2) {
this.form.BusinessCardPhotos = []
} else if (i === 3) {
this.form.HousePhotos = []
}
},
});
},
changeSourceHandler(e) {
if (e != 6) {
this.getSourceSegmentList(e);
this.form.CustomerSource = "";
} else {
this.SourceSegmentList = [];
this.form.SourceAccount = "";
}
},
//来源细分
getSourceSegmentList(id) {
this.apipost(
"/api/Customer/GetGuestSourceAccountList",
{ SourceTypeId: id },
(res) => {
if (res.data.resultCode == 1) {
this.SourceSegmentList = res.data.data;
this.form.SourceAccount = "";
}
}
}
</script>
\ No newline at end of file
);
},
getProvinceList2(ID, type) {
let msg = {
Id: ID,
};
this.apipost2(
"dict_post_Destination_GetChildList",
msg,
(res) => {
if (type == 1) {
this.provinceList = res.data.data;
} else if (type == 2) {
this.cityList = res.data.data;
} else if (type == 3) {
this.district = res.data.data;
}
},
(err) => {}
);
},
//获取国家
getCountryList() {
this.apipost2(
"dict_post_Destination_GetCountry",
{},
(res) => {
this.countryList = res.data.data;
},
(err) => {}
);
},
//根据省份获取城市
getProvinceList(ID, type) {
let msg = {
Id: ID,
};
if (type == 1) {
this.form.Province = "";
this.form.City = "";
this.form.District = "";
} else if (type == 2) {
this.form.City = "";
this.form.District = "";
} else if (type == 3) {
this.form.District = "";
}
if (this.QCountry !== "") {
this.apipost2(
"dict_post_Destination_GetChildList",
msg,
(res) => {
if (type == 1) {
this.provinceList = res.data.data;
} else if (type == 2) {
this.cityList = res.data.data;
} else if (type == 3) {
this.district = res.data.data;
}
},
(err) => {}
);
}
},
uploadImg(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, (x) => {
let url = this.domainManager().ViittoFileUrl + x.data.FilePath;
this.form.Images.push(url);
});
},
uploadImg2(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, (x) => {
let url = this.domainManager().ViittoFileUrl + x.data.FilePath;
this.form.BusinessCardPhotos.push(url);
});
},
uploadImg3(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, (x) => {
let url = this.domainManager().ViittoFileUrl + x.data.FilePath;
this.form.HousePhotos.push(url);
});
},
showImg(i) {
let url = "";
if (i === 1) {
url = this.form.Images[0];
} else if (i === 2) {
url = this.form.BusinessCardPhotos[0];
} else if (i === 3) {
url = this.form.HousePhotos[0];
}
this.dialogImageUrl = url;
this.dialogVisible = true;
},
delImg(i) {
if (i === 1) {
this.form.Images = [];
} else if (i === 2) {
this.form.BusinessCardPhotos = [];
} else if (i === 3) {
this.form.HousePhotos = [];
}
},
},
};
</script>
<style>
<<<<<<< HEAD .customerDialogBox.add-box .add-tit {
display: flex;
justify-content: space-between;
align-items: center;
height: 20px;
}
.customerDialogBox.add-box .add-tit p {
display: flex;
align-items: center;
font-weight: bold;
color: rgba(17, 17, 17, 1);
font-size: 14px;
}
.customerDialogBox.add-box .add-tit p span {
display: inline-block;
width: 6px;
height: 6px;
background: rgba(13, 36, 129, 1);
border-radius: 50%;
margin-right: 10px;
}
.customerDialogBox.add-box .el-dialog__header {
padding: 15px 20px;
background: rgba(255, 255, 255, 1);
}
.customerDialogBox.add-box .dialog-footer {
text-align: center;
background-color: rgba(248, 250, 251, 1);
padding-bottom: 20px;
}
.customerDialogBox.add-box .el-dialog__footer {
padding: 0;
}
.customerDialogBox.add-box .el-dialog__body {
background-color: rgba(248, 250, 251, 1);
padding-top: 20px;
max-height: 500px;
overflow: auto;
}
.customerDialogBox .add-box-btn.el-button {
border-radius: 0;
background-color: rgba(13, 36, 129, .8);
border-color: rgba(13, 36, 129, .8);
color: white;
padding: 12px 43px;
}
.customerDialogBox .add-box-btn.el-button:hover {
background-color: rgba(13, 36, 129, 1);
border-color: rgba(13, 36, 129, 1);
color: white;
}
.customerDialogBox .add-box-btn.el-button.add-box-cancel {
color: rgba(13, 36, 129, .8);
background-color: white;
}
.customerDialogBox .add-box-btn.el-button.add-box-cancel:hover {
color: rgba(13, 36, 129, 1);
background-color: white;
}
.customerDialogBox .el-input .el-input-group__append {
background-color: rgba(13, 36, 129, 1);
border-color: rgba(13, 36, 129, 1);
color: #fff;
}
.customerDialogBox .form-box .form-box-tit {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.customerDialogBox .form-box .radius {
display: flex;
width: 4px;
height: 4px;
background: rgba(255, 164, 117, 1);
border-radius: 50%;
margin-right: 10px;
}
.customerDialogBox .up-img-box .uib-item {
margin-right: 30px;
width: 120px;
height: 120px;
background-color: white;
position: relative;
margin-bottom: 30px;
}
.customerDialogBox .up-img-box .uib-item p {
position: absolute;
bottom: -30px;
font-size: 12px;
text-align: center;
width: 100%;
}
.customerDialogBox .up-img-box .uib-item:hover .imgzhe-btn {
opacity: 1
}
.customerDialogBox .imgzhe {
width: 100%;
height: 100%;
position: absolute;
top: 0;
}
.customerDialogBox .imgzhe .imgzhe-btn {
background: rgba(0, 0, 0, 0.6);
width: 100%;
height: 100%;
text-align: center;
line-height: 120px;
position: absolute;
top: 0;
opacity: 1;
transition: all linear .5s
}
.customerDialogBox .imgzhe .imgzhe-btn i {
font-size: 22px;
margin-right: 5px;
color: white;
cursor: pointer;
}
.customerDialogBox .up-ctrl {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.customerDialogBox .up-ctrl>div {
width: 100%;
height: 100%;
text-align: center;
line-height: 140px;
}
.MyEditForm-item-checkd.MyEditForm-item .el-form-item {
width: 80%;
}
.MyEditForm-item-checkd .el-checkbox {
position: absolute;
right: -50px;
top: 10px;
}
._addPassengerEconomicCapability {
line-height: 22px;
overflow: hidden;
width: 100%;
}
._addPassengerEconomicCapability span {
display: inline-block;
padding: 2px 4px;
border: 1px solid #c0c4cc;
margin: 1px;
cursor: pointer;
color: #c0c4cc;
font-size: 12px;
border-radius: 4px;
}
._addPassengerEconomicCapability span._active {
border: 1px solid rgb(123, 194, 245);
color: rgb(123, 194, 245);
}
=======.customerDialogBox.add-box .add-tit {
display: flex;
justify-content: space-between;
align-items: center;
height: 20px;
}
.customerDialogBox.add-box .add-tit p {
display: flex;
align-items: center;
font-weight: bold;
color: rgba(17, 17, 17, 1);
font-size: 14px;
}
.customerDialogBox.add-box .add-tit p span {
display: inline-block;
width: 6px;
height: 6px;
background: #409efe;
border-radius: 50%;
margin-right: 10px;
}
.customerDialogBox.add-box .el-dialog__header {
padding: 15px 20px;
background: rgba(255, 255, 255, 1);
}
.customerDialogBox.add-box .dialog-footer {
text-align: center;
background-color: rgba(248, 250, 251, 1);
padding-bottom: 20px;
}
.customerDialogBox.add-box .el-dialog__footer {
padding: 0;
}
.customerDialogBox.add-box .el-dialog__body {
background-color: rgba(248, 250, 251, 1);
padding-top: 20px;
max-height: 500px;
overflow: auto;
}
.customerDialogBox .add-box-btn.el-button {
border-radius: 0;
background-color: #409efecc;
border-color: #409efecc;
color: white;
padding: 12px 43px;
}
.customerDialogBox .add-box-btn.el-button:hover {
background-color: #409efe;
border-color: #409efe;
color: white;
}
.customerDialogBox .add-box-btn.el-button.add-box-cancel {
color: #409efecc;
background-color: white;
}
.customerDialogBox .add-box-btn.el-button.add-box-cancel:hover {
color: #409efe;
background-color: white;
}
.customerDialogBox .el-input .el-input-group__append {
background-color: #409efe;
border-color: #409efe;
color: #fff;
}
.customerDialogBox .form-box .form-box-tit {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.customerDialogBox .form-box .radius {
display: flex;
width: 4px;
height: 4px;
background: rgba(255, 164, 117, 1);
border-radius: 50%;
margin-right: 10px;
}
.customerDialogBox .up-img-box .uib-item {
margin-right: 30px;
width: 120px;
height: 120px;
background-color: white;
position: relative;
margin-bottom: 30px;
}
.customerDialogBox .up-img-box .uib-item p {
position: absolute;
bottom: -30px;
font-size: 12px;
text-align: center;
width: 100%;
}
.customerDialogBox .up-img-box .uib-item:hover .imgzhe-btn {
opacity: 1;
}
.customerDialogBox .imgzhe {
width: 100%;
height: 100%;
position: absolute;
top: 0;
}
.customerDialogBox .imgzhe .imgzhe-btn {
background: rgba(0, 0, 0, 0.6);
width: 100%;
height: 100%;
text-align: center;
line-height: 120px;
position: absolute;
top: 0;
opacity: 1;
transition: all linear 0.5s;
}
.customerDialogBox .imgzhe .imgzhe-btn i {
font-size: 22px;
margin-right: 5px;
color: white;
cursor: pointer;
}
.customerDialogBox .up-ctrl {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.customerDialogBox .up-ctrl>div {
width: 100%;
height: 100%;
text-align: center;
line-height: 140px;
}
.MyEditForm-item-checkd.MyEditForm-item .el-form-item {
width: 80%;
}
.MyEditForm-item-checkd .el-checkbox {
position: absolute;
right: -50px;
top: 10px;
}
._addPassengerEconomicCapability {
line-height: 22px;
overflow: hidden;
width: 100%;
}
._addPassengerEconomicCapability span {
display: inline-block;
padding: 2px 4px;
border: 1px solid #c0c4cc;
margin: 1px;
cursor: pointer;
color: #c0c4cc;
font-size: 12px;
border-radius: 4px;
}
._addPassengerEconomicCapability span._active {
border: 1px solid rgb(123, 194, 245);
color: rgb(123, 194, 245);
}
<<<<<<< head .customerDialogBox.add-box .add-tit {
display: flex;
justify-content: space-between;
align-items: center;
height: 20px;
}
.customerDialogBox.add-box .add-tit p {
display: flex;
align-items: center;
font-weight: bold;
color: rgba(17, 17, 17, 1);
font-size: 14px;
}
.customerDialogBox.add-box .add-tit p span {
display: inline-block;
width: 6px;
height: 6px;
background: rgba(13, 36, 129, 1);
border-radius: 50%;
margin-right: 10px;
}
.customerDialogBox.add-box .el-dialog__header {
padding: 15px 20px;
background: rgba(255, 255, 255, 1);
}
.customerDialogBox.add-box .dialog-footer {
text-align: center;
background-color: rgba(248, 250, 251, 1);
padding-bottom: 20px;
}
.customerDialogBox.add-box .el-dialog__footer {
padding: 0;
}
.customerDialogBox.add-box .el-dialog__body {
background-color: rgba(248, 250, 251, 1);
padding-top: 20px;
max-height: 500px;
overflow: auto;
}
.customerDialogBox .add-box-btn.el-button {
border-radius: 0;
background-color: rgba(13, 36, 129, 0.8);
border-color: rgba(13, 36, 129, 0.8);
color: white;
padding: 12px 43px;
}
.customerDialogBox .add-box-btn.el-button:hover {
background-color: rgba(13, 36, 129, 1);
border-color: rgba(13, 36, 129, 1);
color: white;
}
.customerDialogBox .add-box-btn.el-button.add-box-cancel {
color: rgba(13, 36, 129, 0.8);
background-color: white;
}
.customerDialogBox .add-box-btn.el-button.add-box-cancel:hover {
color: rgba(13, 36, 129, 1);
background-color: white;
}
.customerDialogBox .el-input .el-input-group__append {
background-color: rgba(13, 36, 129, 1);
border-color: rgba(13, 36, 129, 1);
color: #fff;
}
.customerDialogBox .form-box .form-box-tit {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.customerDialogBox .form-box .radius {
display: flex;
width: 4px;
height: 4px;
background: rgba(255, 164, 117, 1);
border-radius: 50%;
margin-right: 10px;
}
.customerDialogBox .up-img-box .uib-item {
margin-right: 30px;
width: 120px;
height: 120px;
background-color: white;
position: relative;
margin-bottom: 30px;
}
.customerDialogBox .up-img-box .uib-item p {
position: absolute;
bottom: -30px;
font-size: 12px;
text-align: center;
width: 100%;
}
.customerDialogBox .up-img-box .uib-item:hover .imgzhe-btn {
opacity: 1;
}
.customerDialogBox .imgzhe {
width: 100%;
height: 100%;
position: absolute;
top: 0;
}
.customerDialogBox .imgzhe .imgzhe-btn {
background: rgba(0, 0, 0, 0.6);
width: 100%;
height: 100%;
text-align: center;
line-height: 120px;
position: absolute;
top: 0;
opacity: 1;
transition: all linear 0.5s;
}
.customerDialogBox .imgzhe .imgzhe-btn i {
font-size: 22px;
margin-right: 5px;
color: white;
cursor: pointer;
}
.customerDialogBox .up-ctrl {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.customerDialogBox .up-ctrl > div {
width: 100%;
height: 100%;
text-align: center;
line-height: 140px;
}
.MyEditForm-item-checkd.MyEditForm-item .el-form-item {
width: 80%;
}
.MyEditForm-item-checkd .el-checkbox {
position: absolute;
right: -50px;
top: 10px;
}
._addPassengerEconomicCapability {
line-height: 22px;
overflow: hidden;
width: 100%;
}
._addPassengerEconomicCapability span {
display: inline-block;
padding: 2px 4px;
border: 1px solid #c0c4cc;
margin: 1px;
cursor: pointer;
color: #c0c4cc;
font-size: 12px;
border-radius: 4px;
}
._addPassengerEconomicCapability span._active {
border: 1px solid rgb(123, 194, 245);
color: rgb(123, 194, 245);
}
=======.customerDialogBox.add-box .add-tit {
display: flex;
justify-content: space-between;
align-items: center;
height: 20px;
}
.customerDialogBox.add-box .add-tit p {
display: flex;
align-items: center;
font-weight: bold;
color: rgba(17, 17, 17, 1);
font-size: 14px;
}
.customerDialogBox.add-box .add-tit p span {
display: inline-block;
width: 6px;
height: 6px;
background: #409efe;
border-radius: 50%;
margin-right: 10px;
}
.customerDialogBox.add-box .el-dialog__header {
padding: 15px 20px;
background: rgba(255, 255, 255, 1);
}
.customerDialogBox.add-box .dialog-footer {
text-align: center;
background-color: rgba(248, 250, 251, 1);
padding-bottom: 20px;
}
.customerDialogBox.add-box .el-dialog__footer {
padding: 0;
}
.customerDialogBox.add-box .el-dialog__body {
background-color: rgba(248, 250, 251, 1);
padding-top: 20px;
max-height: 500px;
overflow: auto;
}
.customerDialogBox .add-box-btn.el-button {
border-radius: 0;
background-color: #409efecc;
border-color: #409efecc;
color: white;
padding: 12px 43px;
}
.customerDialogBox .add-box-btn.el-button:hover {
background-color: #409efe;
border-color: #409efe;
color: white;
}
.customerDialogBox .add-box-btn.el-button.add-box-cancel {
color: #409efecc;
background-color: white;
}
.customerDialogBox .add-box-btn.el-button.add-box-cancel:hover {
color: #409efe;
background-color: white;
}
.customerDialogBox .el-input .el-input-group__append {
background-color: #409efe;
border-color: #409efe;
color: #fff;
}
.customerDialogBox .form-box .form-box-tit {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.customerDialogBox .form-box .radius {
display: flex;
width: 4px;
height: 4px;
background: rgba(255, 164, 117, 1);
border-radius: 50%;
margin-right: 10px;
}
.customerDialogBox .up-img-box .uib-item {
margin-right: 30px;
width: 120px;
height: 120px;
background-color: white;
position: relative;
margin-bottom: 30px;
}
.customerDialogBox .up-img-box .uib-item p {
position: absolute;
bottom: -30px;
font-size: 12px;
text-align: center;
width: 100%;
}
.customerDialogBox .up-img-box .uib-item:hover .imgzhe-btn {
opacity: 1;
}
.customerDialogBox .imgzhe {
width: 100%;
height: 100%;
position: absolute;
top: 0;
}
.customerDialogBox .imgzhe .imgzhe-btn {
background: rgba(0, 0, 0, 0.6);
width: 100%;
height: 100%;
text-align: center;
line-height: 120px;
position: absolute;
top: 0;
opacity: 1;
transition: all linear 0.5s;
}
.customerDialogBox .imgzhe .imgzhe-btn i {
font-size: 22px;
margin-right: 5px;
color: white;
cursor: pointer;
}
.customerDialogBox .up-ctrl {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.customerDialogBox .up-ctrl > div {
width: 100%;
height: 100%;
text-align: center;
line-height: 140px;
}
.MyEditForm-item-checkd.MyEditForm-item .el-form-item {
width: 80%;
}
.MyEditForm-item-checkd .el-checkbox {
position: absolute;
right: -50px;
top: 10px;
}
._addPassengerEconomicCapability {
line-height: 22px;
overflow: hidden;
width: 100%;
}
._addPassengerEconomicCapability span {
display: inline-block;
padding: 2px 4px;
border: 1px solid #c0c4cc;
margin: 1px;
cursor: pointer;
color: #c0c4cc;
font-size: 12px;
border-radius: 4px;
}
._addPassengerEconomicCapability span._active {
border: 1px solid rgb(123, 194, 245);
color: rgb(123, 194, 245);
}
</style>
<template>
<el-dialog :visible.sync="dialogTableVisible" @closed="closedDialog" :close-on-click-modal="false"
......@@ -463,7 +463,7 @@
<el-col :span="8">
<div class="MyEditForm-item">
<el-form-item label="客户来源" prop="CustomerSourceType">
<el-select v-model="form.CustomerSourceType" placeholder="请选择客户来源">
<el-select v-model="form.CustomerSourceType" @change="changeSourceHandler" placeholder="请选择客户来源">
<el-option v-for="item in SourceEnum" :key="item.ID" :label="item.Name"
:value="item.ID">
</el-option>
......@@ -479,7 +479,7 @@
</el-form-item>
</div>
</el-col>
<el-col :span="8" v-if="form.CustomerSourceType === 7">
<el-col :span="8" v-if="SourceSegmentList && SourceSegmentList.length>0">
<div class="MyEditForm-item label-pad-left">
<el-form-item label="来源细分" prop="SourceAccount">
<el-select placeholder="请选择来源途径" v-model="form.SourceAccount">
......@@ -511,7 +511,7 @@
</div>
<div class="form-box" v-if="show">
<el-collapse v-model="activeNames" @change="handleChange">
<el-collapse>
<el-collapse-item title="更多信息" name="3">
<el-form :model="form" ref="form" class="MyEditForm">
<el-row :gutter="30">
......@@ -670,574 +670,667 @@
</el-dialog>
</template>
<script>
export default {
props: {
CustomerId: {
type: Number,
default: 0
},
name: {
type: String,
default: '新建客户'
}
export default {
props: {
CustomerId: {
type: Number,
default: 0,
},
name: {
type: String,
default: "新建客户",
},
},
data() {
let checkPhone = (rule, value, callback) => {
if (!value) {
return callback(new Error("手机号不能为空"));
} else {
const reg = /^1[3|4|5|7|8][0-9]\d{8}$/;
if (reg.test(value)) {
callback();
} else {
return callback(new Error("请输入正确的手机号"));
}
}
};
var validateWechatAndPhone = (rule, value, callback) => {
if (!this.form.WeChatNo && !this.form.MobilePhone) {
callback(new Error("微信号或手机号,请填写一个"));
} else {
//console.log(this.$refs);
if (!this.form.WeChatNo || !this.form.MobilePhone) {
this.$refs["form"].validateField("WeChatNo");
this.$refs["form"].validateField("MobilePhone");
}
callback();
}
};
var validateSourceAccount = (rule, value, callback) => {
if (this.form.CustomerSourceType != 6) {
if (
this.form.SourceAccount == "" &&
this.SourceSegmentList &&
this.SourceSegmentList.length > 0
) {
callback(new Error("请选择细分渠道选项"));
} else {
callback();
}
} else {
callback();
}
};
return {
dialogTableVisible: false,
SourceEnum: [],
countryList: "",
provinceList: "",
dialogImageUrl: "",
dialogVisible: false,
cityList: "",
district: "",
jycs: [],
fileList: [],
CustomerLevelEnum: [],
CustomerBrandList: [],
form: {
Id: 0,
CustomerSourceType: "",
CustomerSource: "",
SurName: "",
Name: "",
Sex: "",
EName: "",
ESurName: "",
Birthday: "",
BirthdayAddress: "",
PassportAddress: "",
PassportExpiry: "",
PassportNo: "",
Nationality: "",
Marriage: "",
Address: "",
AddressDetail: "",
HistoryRecord: "",
IdentityType: "",
Duty: "",
EconomicCapabilityList: [],
Remarks: "",
TravelType: "",
UnitType: "",
DutyType: "",
IsHightSchool: "",
IsRecommend: "",
PassportIssued: "",
IssuingAuthority: "",
IdCard: "",
MobilePhone: "",
ClueDemand: "",
WeChatNo: "",
SourceAccount: "",
},
VisaIdentityTypeEnum: [],
VisaDeparturesType: [],
VisaDutyTypeEnum: [],
TravelTypeList: [],
DutyTypeList: [],
UnitTypeList: [],
rules: {
PassportNo: [
{
required: true,
message: "请填写护照号",
trigger: "blur",
},
{
pattern: /^[0-9a-zA-Z]+$/,
message: "正确的护照号",
},
],
PassportIssued: [
{
required: true,
message: "请选择签发日期",
trigger: "blur",
},
],
PassportExpiry: [
{
required: true,
message: "请选择过期日",
trigger: "blur",
},
],
ESurName: [
{
required: true,
message: "请填写英文姓",
trigger: "blur",
},
{
pattern: /^[a-zA-Z]/,
message: "请输入英文姓",
},
],
IdCard: [
{
required: true,
message: "请填身份证号码",
trigger: "blur",
},
],
SurName: [
{
required: true,
message: "请填写中文姓",
trigger: "blur",
},
],
CustomerSource: [
{
required: true,
message: "请输入客户来源信息",
trigger: "blur",
},
],
CustomerSourceType: [
{
required: true,
message: "请选择客户来源",
trigger: "change",
},
],
ClueDemand: [
{
required: true,
message: "请填写需求",
trigger: "blur",
},
],
// Remarks: [{
// required: true,
// message: '请填写备注',
// trigger: 'blur'
// }],
WeChatNo: [
{
required: true,
validator: validateWechatAndPhone,
trigger: "blur",
},
],
MobilePhone: [
{
required: true,
validator: validateWechatAndPhone,
trigger: "blur",
},
],
SourceAccount: [
{
required: true,
validator: validateSourceAccount,
trigger: "blur",
},
],
},
show: true,
CustomerList: [],
EconomicCapabilityS: [],
// 小红书
SourceSegmentList: [],
};
},
watch: {
CustomerId: {
handler(val, oldVal) {
// console.log(val)
},
deep: true,
},
},
mounted() {
this.GetCustomerLevelEnum();
this.getJycs();
this.getCustomerBrandList();
this.getCountryList();
this.GetCustomerSourceEnum();
this.getVisaIdentityTypeEnum();
this.getVisaDeparturesType();
this.getVisaDutyTypeEnum();
this.getTravelType();
this.getUnitType();
this.getDutyType();
this.getEconomicCapability();
// this.getCustomerList()
//this.getSourceSegmentList();
let $this = this;
setTimeout(() => {
$this.dialogTableVisible = true;
}, 50);
},
methods: {
Transformation(val, type) {
let text = this.pinyin(val, {
style: this.pinyin.STYLE_NORMAL,
});
if (type == "SurName") {
let upText = text.join("").toLocaleUpperCase();
this.form.ESurName = upText;
}
if (type == "Name") {
let upText = text.join("").toLocaleUpperCase();
this.form.EName = upText;
}
},
getEconomicCapability() {
//获取经济能力
this.apipost2(
"dict_post_GetList",
{
Key: "SK_Visa_EconomicCapability",
IsTimer: 1,
},
data() {
let checkPhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('手机号不能为空'));
} else {
const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
if (reg.test(value)) {
callback();
} else {
return callback(new Error('请输入正确的手机号'));
(res) => {
this.EconomicCapabilityS = res.data.data;
if (this.CustomerId != 0) {
this.form.Id = this.CustomerId;
this.apipost(
"/api/Customer/GetAllGuesstCustomerModel",
{
ID: this.CustomerId,
},
(res) => {
if (res.data.resultCode == 1) {
let obj = res.data.data;
obj.TravelType = obj.TravelType.toString();
obj.UnitType = obj.UnitType.toString();
obj.DutyType = obj.DutyType.toString();
this.form = obj;
this.EconomicCapabilityS.forEach((x) => {
if (obj.EconomicCapabilityList) {
obj.EconomicCapabilityList.forEach((y) => {
if (x.ID == y.ID) {
x.isShow = true;
x.Content = y.Value;
}
});
}
});
}
}
return {
dialogTableVisible: false,
SourceEnum: [],
countryList: "",
provinceList: "",
dialogImageUrl: '',
dialogVisible: false,
cityList: "",
district: "",
jycs: [],
fileList: [],
CustomerLevelEnum: [],
CustomerBrandList: [],
form: {
Id: 0,
CustomerSourceType: '',
CustomerSource: '',
SurName: '',
Name: '',
Sex: '',
EName: '',
ESurName: '',
Birthday: '',
BirthdayAddress: '',
PassportAddress: '',
PassportExpiry: '',
PassportNo: '',
Nationality: '',
Marriage: '',
Address: '',
AddressDetail: '',
HistoryRecord: '',
IdentityType: '',
Duty: '',
EconomicCapabilityList: [],
Remarks: '',
TravelType: '',
UnitType: '',
DutyType: '',
IsHightSchool: '',
IsRecommend: '',
PassportIssued: '',
IssuingAuthority: '',
IdCard: '',
MobilePhone: '',
ClueDemand: '',
WeChatNo: '',
SourceAccount: '',
},
VisaIdentityTypeEnum: [],
VisaDeparturesType: [],
VisaDutyTypeEnum: [],
TravelTypeList: [],
DutyTypeList: [],
UnitTypeList: [],
rules: {
PassportNo: [{
required: true,
message: "请填写护照号",
trigger: "blur"
}, {
pattern: /^[0-9a-zA-Z]+$/,
message: "正确的护照号"
}],
PassportIssued: [{
required: true,
message: "请选择签发日期",
trigger: "blur"
}],
PassportExpiry: [{
required: true,
message: "请选择过期日",
trigger: "blur"
}],
ESurName: [{
required: true,
message: "请填写英文姓",
trigger: "blur"
}, {
pattern: /^[a-zA-Z]/,
message: "请输入英文姓"
}],
IdCard: [{
required: true,
message: "请填身份证号码",
trigger: "blur"
}],
SurName: [{
required: true,
message: "请填写中文姓",
trigger: "blur"
}],
CustomerSource: [{
required: true,
message: '请输入客户来源信息',
trigger: 'blur'
}],
CustomerSourceType: [{
required: true,
message: '请选择客户来源',
trigger: 'change'
}],
ClueDemand: [{
required: true,
message: '请填写需求',
trigger: 'blur'
}],
Remarks: [{
required: true,
message: '请填写备注',
trigger: 'blur'
}],
WeChatNo: [{
required: true,
message: '请填写微信号',
trigger: 'blur'
}],
MobilePhone: [{
required: true,
message: '请填写手机号码',
trigger: 'blur'
}],
SourceAccount: [{
required: true,
message: '请选择你的来源',
trigger: 'change'
}]
},
show: true,
CustomerList: [],
EconomicCapabilityS: [],
// 小红书
SourceSegmentList: [],
};
}
);
}
},
watch: {
CustomerId: {
handler(val, oldVal) {
// console.log(val)
},
deep: true
}
(err) => {}
);
},
addEconomicCapability(obj) {
// 添加经济能力说明
this.EconomicCapabilityS.forEach((x) => {
if (x.ID == obj.ID) {
x.isShow ? (x.isShow = false) : (x.isShow = true);
}
});
this.$forceUpdate();
},
getDutyType() {
this.apipost2(
"dict_get_GetDictValueCommonList",
{
Key: "SK_CRM_DutyType",
},
mounted() {
this.GetCustomerLevelEnum()
this.getJycs()
this.getCustomerBrandList()
this.getCountryList()
this.GetCustomerSourceEnum()
this.getVisaIdentityTypeEnum()
this.getVisaDeparturesType()
this.getVisaDutyTypeEnum()
this.getTravelType()
this.getUnitType()
this.getDutyType()
this.getEconomicCapability();
// this.getCustomerList()
this.getSourceSegmentList()
let $this = this
setTimeout(() => {
$this.dialogTableVisible = true
}, 50)
(res) => {
if (res.data.resultCode == 1) {
this.DutyTypeList = res.data.data;
} else {
}
},
methods: {
Transformation(val, type) {
let text = this.pinyin(val, {
style: this.pinyin.STYLE_NORMAL
});
if (type == "SurName") {
let upText = text.join("").toLocaleUpperCase()
this.form.ESurName = upText;
}
if (type == "Name") {
let upText = text.join("").toLocaleUpperCase()
this.form.EName = upText;
}
},
getEconomicCapability() {
//获取经济能力
this.apipost2(
"dict_post_GetList", {
Key: "SK_Visa_EconomicCapability",
IsTimer: 1
},
res => {
this.EconomicCapabilityS = res.data.data;
if (this.CustomerId != 0) {
this.form.Id = this.CustomerId;
this.apipost('/api/Customer/GetAllGuesstCustomerModel', {
ID: this.CustomerId
}, res => {
if (res.data.resultCode == 1) {
let obj = res.data.data;
obj.TravelType = obj.TravelType.toString()
obj.UnitType = obj.UnitType.toString()
obj.DutyType = obj.DutyType.toString()
this.form = obj;
this.EconomicCapabilityS.forEach(x => {
if (obj.EconomicCapabilityList) {
obj.EconomicCapabilityList.forEach(y => {
if (x.ID == y.ID) {
x.isShow = true;
x.Content = y.Value;
}
});
}
});
}
})
}
},
err => {}
);
},
addEconomicCapability(obj) {
// 添加经济能力说明
this.EconomicCapabilityS.forEach(x => {
if (x.ID == obj.ID) {
x.isShow ? (x.isShow = false) : (x.isShow = true);
}
});
this.$forceUpdate();
},
getDutyType() {
this.apipost2(
"dict_get_GetDictValueCommonList", {
Key: 'SK_CRM_DutyType',
},
res => {
if (res.data.resultCode == 1) {
this.DutyTypeList = res.data.data
} else {}
},
err => {}
);
},
getUnitType() {
this.apipost2(
"dict_get_GetDictValueCommonList", {
Key: 'SK_CRM_UnitType',
},
res => {
if (res.data.resultCode == 1) {
this.UnitTypeList = res.data.data
} else {}
},
err => {}
);
},
getTravelType() {
this.apipost2(
"dict_get_GetDictValueCommonList", {
Key: 'SK_CRM_TravelType',
},
res => {
if (res.data.resultCode == 1) {
this.TravelTypeList = res.data.data
} else {}
},
err => {}
);
},
getVisaDutyTypeEnum() {
//获取职务
let msg = {};
this.apipost2(
"dmc_get_visa_GetVisaDutyTypeEnum",
msg,
res => {
if (res.data.resultCode == 1) {
this.VisaDutyTypeEnum = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
err => {}
);
},
getVisaDeparturesType() {
//获取出境记录状态
let msg = {};
this.apipost2(
"dmc_get_visa_GetVisaDeparturesTypeEnum",
msg,
res => {
if (res.data.resultCode == 1) {
this.VisaDeparturesType = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
err => {}
);
},
getVisaIdentityTypeEnum() {
//获取身份证明
let msg = {};
this.apipost2(
"dmc_get_visa_GetVisaIdentityTypeEnum",
msg,
res => {
if (res.data.resultCode == 1) {
this.VisaIdentityTypeEnum = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
err => {}
);
},
getCustomerList() {
this.apipost('/api/Customer/GetCustomerListByCreateInfo', {}, res => {
if (res.data.resultCode == 1) {
this.CustomerList = res.data.data
}
})
},
getSourceSegmentList() {
this.apipost('/api/Customer/GetGuestSourceAccountList', {}, res => {
if (res.data.resultCode == 1) {
this.SourceSegmentList = res.data.data
}
})
},
closedDialog() {
this.MsgBus.$emit('closeCustomerDialogBox')
},
addData() {
if (this.form.CustomerID === '') {
this.form.CustomerID = 0
}
this.form.EconomicCapabilityList = []
this.EconomicCapabilityS.forEach(x => {
if (x.isShow == true) {
this.form.EconomicCapabilityList.push({
Key: x.Name,
Value: x.Content,
ID: x.ID
});
}
});
this.apipost('/api/Customer/CreateGuesstCustomer', this.form, res => {
if (res.data.resultCode == 1) {
this.dialogTableVisible = false;
// 有id 发送更新抽屉消息
if (this.CustomerId !== 0) {
this.$message.success('修改直客成功');
this.MsgBus.$emit('RefreshInfoBox')
} else {
this.$message.success('新建直客成功');
}
this.$emit('getList')
this.resetForm("form");
}
})
},
submitForm(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate(valid => {
if (valid) {
this.addData();
} else {
return false;
}
});
},
resetForm(formName) { // 重置表单
this.form = {
Id: 0,
SurName: '',
Name: 0,
Sex: '',
EName: '',
ESurName: 0,
Birthday: '',
BirthdayAddress: 2,
PassportAddress: '',
PassportExpiry: '',
PassportNo: '',
Nationality: '',
Marriage: '',
Address: '',
AddressDetail: '',
HistoryRecord: '',
IdentityType: '',
Duty: '',
EconomicCapabilityList: [],
CustomerSourceType: '',
CustomerSource: '',
Remarks: '',
TravelType: '',
UnitType: '',
DutyType: '',
IsHightSchool: '',
IsRecommend: '',
PassportIssued: '',
IssuingAuthority: '',
IdCard: '',
MobilePhone: '',
}
this.$refs[formName].resetFields();
},
getCustomerBrandList() { // 获取品牌
this.apipost2('app_get_customer_brand', {}, res => {
if (res.data.resultCode == 1) {
this.CustomerBrandList = res.data.data;
} else {
this.$message.error(res.data.message)
}
}, err => {})
},
getJycs() {
this.apipost2('app_today_visit_GetCustomerPremisesEnum', {}, res => {
if (res.data.resultCode == 1) {
this.jycs = res.data.data
}
}, err => {})
},
GetCustomerLevelEnum() {
this.apipost('/api/Customer/GetCustomerLevelEnum', {}, res => {
if (res.data.resultCode == 1) {
this.CustomerLevelEnum = res.data.data
}
})
},
GetCustomerSourceEnum() {
this.apipost('/api/Customer/GetCustomerSourceEnum', {}, res => {
if (res.data.resultCode == 1) {
this.SourceEnum = res.data.data
}
})
},
getProvinceList2(ID, type) {
let msg = {
Id: ID
};
this.apipost2(
"dict_post_Destination_GetChildList",
msg,
res => {
if (type == 1) {
this.provinceList = res.data.data;
} else if (type == 2) {
this.cityList = res.data.data;
} else if (type == 3) {
this.district = res.data.data;
}
},
err => {}
);
},
//获取国家
getCountryList() {
this.apipost2(
"dict_post_Destination_GetCountry", {},
res => {
this.countryList = res.data.data;
},
err => {}
);
},
//根据省份获取城市
getProvinceList(ID, type) {
let msg = {
Id: ID
};
if (type == 1) {
this.form.Province = "";
this.form.City = "";
this.form.District = "";
} else if (type == 2) {
this.form.City = "";
this.form.District = "";
} else if (type == 3) {
this.form.District = "";
}
if (this.QCountry !== "") {
this.apipost2(
"dict_post_Destination_GetChildList",
msg,
res => {
if (type == 1) {
this.provinceList = res.data.data;
} else if (type == 2) {
this.cityList = res.data.data;
} else if (type == 3) {
this.district = res.data.data;
}
},
err => {}
);
}
},
uploadImg(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, x => {
let url = this.domainManager().ViittoFileUrl + x.data.FilePath
this.form.Images.push(url);
});
},
uploadImg2(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, x => {
let url = this.domainManager().ViittoFileUrl + x.data.FilePath
this.form.BusinessCardPhotos.push(url);
});
},
uploadImg3(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, x => {
let url = this.domainManager().ViittoFileUrl + x.data.FilePath
this.form.HousePhotos.push(url);
});
},
showImg(i) {
let url = ''
if (i === 1) {
url = this.form.Images[0]
} else if (i === 2) {
url = this.form.BusinessCardPhotos[0]
} else if (i === 3) {
url = this.form.HousePhotos[0]
}
this.dialogImageUrl = url;
this.dialogVisible = true;
},
delImg(i) {
if (i === 1) {
this.form.Images = []
} else if (i === 2) {
this.form.BusinessCardPhotos = []
} else if (i === 3) {
this.form.HousePhotos = []
}
},
(err) => {}
);
},
getUnitType() {
this.apipost2(
"dict_get_GetDictValueCommonList",
{
Key: "SK_CRM_UnitType",
},
(res) => {
if (res.data.resultCode == 1) {
this.UnitTypeList = res.data.data;
} else {
}
},
(err) => {}
);
},
getTravelType() {
this.apipost2(
"dict_get_GetDictValueCommonList",
{
Key: "SK_CRM_TravelType",
},
(res) => {
if (res.data.resultCode == 1) {
this.TravelTypeList = res.data.data;
} else {
}
},
(err) => {}
);
},
getVisaDutyTypeEnum() {
//获取职务
let msg = {};
this.apipost2(
"dmc_get_visa_GetVisaDutyTypeEnum",
msg,
(res) => {
if (res.data.resultCode == 1) {
this.VisaDutyTypeEnum = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
(err) => {}
);
},
getVisaDeparturesType() {
//获取出境记录状态
let msg = {};
this.apipost2(
"dmc_get_visa_GetVisaDeparturesTypeEnum",
msg,
(res) => {
if (res.data.resultCode == 1) {
this.VisaDeparturesType = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
(err) => {}
);
},
getVisaIdentityTypeEnum() {
//获取身份证明
let msg = {};
this.apipost2(
"dmc_get_visa_GetVisaIdentityTypeEnum",
msg,
(res) => {
if (res.data.resultCode == 1) {
this.VisaIdentityTypeEnum = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
(err) => {}
);
},
getCustomerList() {
this.apipost("/api/Customer/GetCustomerListByCreateInfo", {}, (res) => {
if (res.data.resultCode == 1) {
this.CustomerList = res.data.data;
}
});
},
changeSourceHandler(e) {
if (e != 6) {
this.getSourceSegmentList(e);
this.form.CustomerSource = "";
this.form.SourceAccount = "";
} else {
this.SourceSegmentList = [];
this.form.SourceAccount = "";
this.form.CustomerSource = "";
}
},
//来源细分
getSourceSegmentList(id) {
this.apipost(
"/api/Customer/GetGuestSourceAccountList",
{ SourceTypeId: id },
(res) => {
if (res.data.resultCode == 1) {
this.SourceSegmentList = res.data.data;
}
}
);
},
closedDialog() {
this.MsgBus.$emit("closeCustomerDialogBox");
},
addData() {
if (this.form.CustomerID === "") {
this.form.CustomerID = 0;
}
this.form.EconomicCapabilityList = [];
this.EconomicCapabilityS.forEach((x) => {
if (x.isShow == true) {
this.form.EconomicCapabilityList.push({
Key: x.Name,
Value: x.Content,
ID: x.ID,
});
}
});
this.apipost("/api/Customer/CreateGuesstCustomer", this.form, (res) => {
if (res.data.resultCode == 1) {
this.dialogTableVisible = false;
// 有id 发送更新抽屉消息
if (this.CustomerId !== 0) {
this.$message.success("修改直客成功");
this.MsgBus.$emit("RefreshInfoBox");
} else {
this.$message.success("新建直客成功");
}
this.$emit("getList");
this.resetForm("form");
}
});
},
submitForm(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if (valid) {
this.addData();
} else {
return false;
}
});
},
resetForm(formName) {
// 重置表单
this.form = {
Id: 0,
SurName: "",
Name: 0,
Sex: "",
EName: "",
ESurName: 0,
Birthday: "",
BirthdayAddress: 2,
PassportAddress: "",
PassportExpiry: "",
PassportNo: "",
Nationality: "",
Marriage: "",
Address: "",
AddressDetail: "",
HistoryRecord: "",
IdentityType: "",
Duty: "",
EconomicCapabilityList: [],
CustomerSourceType: "",
CustomerSource: "",
Remarks: "",
TravelType: "",
UnitType: "",
DutyType: "",
IsHightSchool: "",
IsRecommend: "",
PassportIssued: "",
IssuingAuthority: "",
IdCard: "",
MobilePhone: "",
};
this.$refs[formName].resetFields();
},
getCustomerBrandList() {
// 获取品牌
this.apipost2(
"app_get_customer_brand",
{},
(res) => {
if (res.data.resultCode == 1) {
this.CustomerBrandList = res.data.data;
} else {
this.$message.error(res.data.message);
}
},
(err) => {}
);
},
getJycs() {
this.apipost2(
"app_today_visit_GetCustomerPremisesEnum",
{},
(res) => {
if (res.data.resultCode == 1) {
this.jycs = res.data.data;
}
},
(err) => {}
);
},
GetCustomerLevelEnum() {
this.apipost("/api/Customer/GetCustomerLevelEnum", {}, (res) => {
if (res.data.resultCode == 1) {
this.CustomerLevelEnum = res.data.data;
}
});
},
GetCustomerSourceEnum() {
this.apipost("/api/Customer/GetCustomerSourceEnum", {}, (res) => {
if (res.data.resultCode == 1) {
this.SourceEnum = res.data.data;
}
}
</script>
\ No newline at end of file
});
},
getProvinceList2(ID, type) {
let msg = {
Id: ID,
};
this.apipost2(
"dict_post_Destination_GetChildList",
msg,
(res) => {
if (type == 1) {
this.provinceList = res.data.data;
} else if (type == 2) {
this.cityList = res.data.data;
} else if (type == 3) {
this.district = res.data.data;
}
},
(err) => {}
);
},
//获取国家
getCountryList() {
this.apipost2(
"dict_post_Destination_GetCountry",
{},
(res) => {
this.countryList = res.data.data;
},
(err) => {}
);
},
//根据省份获取城市
getProvinceList(ID, type) {
let msg = {
Id: ID,
};
if (type == 1) {
this.form.Province = "";
this.form.City = "";
this.form.District = "";
} else if (type == 2) {
this.form.City = "";
this.form.District = "";
} else if (type == 3) {
this.form.District = "";
}
if (this.QCountry !== "") {
this.apipost2(
"dict_post_Destination_GetChildList",
msg,
(res) => {
if (type == 1) {
this.provinceList = res.data.data;
} else if (type == 2) {
this.cityList = res.data.data;
} else if (type == 3) {
this.district = res.data.data;
}
},
(err) => {}
);
}
},
uploadImg(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, (x) => {
let url = this.domainManager().ViittoFileUrl + x.data.FilePath;
this.form.Images.push(url);
});
},
uploadImg2(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, (x) => {
let url = this.domainManager().ViittoFileUrl + x.data.FilePath;
this.form.BusinessCardPhotos.push(url);
});
},
uploadImg3(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, (x) => {
let url = this.domainManager().ViittoFileUrl + x.data.FilePath;
this.form.HousePhotos.push(url);
});
},
showImg(i) {
let url = "";
if (i === 1) {
url = this.form.Images[0];
} else if (i === 2) {
url = this.form.BusinessCardPhotos[0];
} else if (i === 3) {
url = this.form.HousePhotos[0];
}
this.dialogImageUrl = url;
this.dialogVisible = true;
},
delImg(i) {
if (i === 1) {
this.form.Images = [];
} else if (i === 2) {
this.form.BusinessCardPhotos = [];
} else if (i === 3) {
this.form.HousePhotos = [];
}
},
},
};
</script>
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