Commit a17deb6a authored by 吴春's avatar 吴春

11

parent 8b798bb2
......@@ -157,26 +157,20 @@
</el-form-item>
</li>
<li v-if="addMsg.Nationality==NationalityId">
<el-form-item :label="$t('visaT.Chinesesurname')" prop="SurNameID">
<el-select class="w230" ref="options" v-model="addMsg.SurNameID" filterable remote reserve-keyword
placeholder="请输入关键词" :remote-method="(query)=>remoteMethod(query,1)" @change="(e)=>getName(e,1)">
<el-option v-for="item in options" :key="item.value" :label="`${item.name}`" :value="item.value">
<span style="float: left">{{ item.label }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</span>
</el-option>
</el-select>
<el-form-item :label="$t('visaT.Chinesesurname')" prop="SurName">
<el-autocomplete class="w230" v-model="addMsg.SurName"
:fetch-suggestions="(queryString, cb) => remoteMethod(queryString, cb, 1)"
:placeholder="$t('objFill.v101.FinancialModule.qingsrgjzcx')" :trigger-on-focus="false"
@select="(item) => getName(item, 1)">
</el-autocomplete>
</el-form-item>
</li>
<li v-if="addMsg.Nationality==NationalityId">
<el-form-item :label="$t('admin.admin_Surname')" prop="NameID">
<el-select class="w230" ref="optionsNames" v-model="addMsg.NameID" filterable remote reserve-keyword
:placeholder="$t('rule.qsrzwm')" :remote-method="(query)=>remoteMethod(query)"
@change="(e)=>getName(e)">
<el-option v-for="item in optionsNames" :key="item.value" :label="`${item.name}`" :value="item.value">
<span style="float: left">{{ item.label }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</span>
</el-option>
</el-select>
<el-form-item :label="$t('admin.admin_Surname')" prop="Name">
<el-autocomplete class="w230" v-model="addMsg.Name"
:fetch-suggestions="(queryString, cb) => remoteMethod(queryString, cb)" :placeholder="$t('rule.qsrzwm')"
:trigger-on-focus="false" @select="(item) => getName(item)">
</el-autocomplete>
</el-form-item>
</li>
<li>
......@@ -204,7 +198,8 @@
</li>
<li>
<!--国内线且国籍是中国的才验证身份证-->
<el-form-item :label="$t('admin.admin_IDcard')" prop="IdCard" v-if="LineId==90&&addMsg.Nationality==NationalityId">
<el-form-item :label="$t('admin.admin_IDcard')" prop="IdCard"
v-if="LineId==90&&addMsg.Nationality==NationalityId">
<el-input v-model="addMsg.IdCard" type="text" :class=" IdCardSure ? '' : 'colorRed'" size=mini
class="w230" :placeholder="$t('visaT.Pleasefillin')" @blur.prevent="authentication()">
</el-input>
......@@ -675,7 +670,7 @@
TravelTypeList: [],
UnitTypeList: [],
DutyTypeList: [],
NationalityId:0,
NationalityId: 0,
ppAge: 0,
loading: false,
PassportNoSure: true,
......@@ -900,38 +895,24 @@
};
},
methods: {
getName(e, type) {
let findIndex
getName(selectItem, type) {
if (type) {
findIndex = this.options.findIndex(x => x.value == e)
let obj = this.options[findIndex]
this.addMsg.SurName = obj.name.toUpperCase();
this.addMsg.ESurName = obj.label.toUpperCase();
this.addMsg.SurName = selectItem.name.trim();
this.addMsg.ESurName = selectItem.label.toUpperCase().trim();
} else {
findIndex = this.optionsNames.findIndex(x => x.value == e)
let obj = this.optionsNames[findIndex]
this.addMsg.Name = obj.name.toUpperCase();
this.addMsg.EName = obj.label.toUpperCase();
this.addMsg.Name = selectItem.name.trim();
this.addMsg.EName = selectItem.label.toUpperCase().trim();
}
},
remoteMethod(query, type) {
remoteMethod(query, cb, type) {
if (query !== '') {
if (type == 1) {
if (query != this.addMsg.SurName) {
this.addMsg.SurName = query;
this.addMsg.SurNameID = "";
}
this.Transformation(query, 'SurName')
var tempArray = this.Transformation(query);
if (tempArray && tempArray.length == 1) {
this.getName(tempArray[0], type);
cb([]);
} else {
if (query != this.addMsg.Name) {
this.addMsg.Name = query;
this.addMsg.NameID = '';
cb(tempArray);
}
this.Transformation(query, 'Name')
}
} else {
if (type == 1) this.options = [];
else this.optionsNames = []
}
},
getDutyType() {
......@@ -949,12 +930,11 @@
},
GetDefaultCountryList() {
this.apipost(
"dict_get_GetDefaultCountryList", {
},
"dict_get_GetDefaultCountryList", {},
res => {
if (res.data.resultCode == 1) {
this.NationalityId = res.data.data.ID
this.addMsg.Nationality= res.data.data.ID
this.addMsg.Nationality = res.data.data.ID
} else {}
},
err => {}
......@@ -1040,7 +1020,7 @@
},
res => {
if (res.data.resultCode == 1) {
console.log("res.data.data",res.data.data);
console.log("res.data.data", res.data.data);
this.JingDianList = res.data.data
} else {
......@@ -1345,89 +1325,36 @@
dfs(0, "");
return result.join(",");
},
Transformation(val, type, input) {
let text = this.pinyin(val, {
Transformation(val) {
let resultArray = [];
let textArray = this.pinyin(val, {
heteronym: true, // 启用多音字模式
style: this.pinyin.STYLE_NORMAL,
segment: true
});
// 如果当前字是 "茜",则替换为自定义拼音
if (val.includes('茜')) {
text = text.map(pinyinArr => {
textArray = textArray.map(pinyinArr => {
if (pinyinArr[0] === 'qian') { // 默认返回的是 qian
return ['qian', 'xi']; // 替换成自定义多音字
}
return pinyinArr;
});
}
const pinyinArray = text
const result = this.combinePinyinDP(pinyinArray);
if (type == "SurName") {
let upText = result
this.options = []
let names = upText.split(',')
names.forEach((x, index) => {
this.options.push({
label: x.toUpperCase(),
value: index + 1,
name: this.addMsg.SurName.toUpperCase(),
const resultStr = this.combinePinyinDP(textArray);
if (resultStr && resultStr != '') {
let tempArray = resultStr.split(',')
if (tempArray && tempArray.length > 0) {
tempArray.forEach((x, index) => {
resultArray.push({
label: (x).toUpperCase(),
value: (x).toUpperCase() + " " + val,
name: val,
})
})
if (names != null && names.length == 1) {
if (input) {
this.addMsg.SurNameID = this.options[0].value;
this.addMsg.ESurName = this.options[0].label;
} else {
setTimeout(() => {
this.addMsg.SurNameID = this.options[0].value;
this.addMsg.ESurName = this.options[0].label;
}, 500);
}
} else {
let findIndex = this.options.findIndex(x => x.label == this.addMsg.ESurName)
if (findIndex != -1) {
this.addMsg.SurNameID = this.options[findIndex].value;
} else {
this.addMsg.SurNameID = '';
this.addMsg.ESurName = '';
}
}
this.$forceUpdate()
}
if (type == "Name") {
let upText = result
this.optionsNames = []
let names = upText.split(',')
names.forEach((x, index) => {
this.optionsNames.push({
label: x.toUpperCase(),
value: index + 1,
name: this.addMsg.Name.toUpperCase(),
})
})
if (names != null && names.length == 1) {
if (input) {
this.addMsg.NameID = this.optionsNames[0].value;
this.addMsg.EName = this.optionsNames[0].label;
} else {
setTimeout(() => {
if (this.optionsNames.length > 0) {
this.addMsg.NameID = this.optionsNames[0].value;
this.addMsg.EName = this.optionsNames[0].label;
}
}, 500);
}
} else {
let findIndex = this.optionsNames.findIndex(x => x.label == this.addMsg.EName)
if (findIndex != -1) {
this.addMsg.NameID = this.optionsNames[findIndex].value;
return
}
this.addMsg.NameID = '';
this.addMsg.EName = '';
}
}
this.$forceUpdate()
return resultArray;
},
getVisaIdentityTypeEnum() {
//获取身份证明
......@@ -1511,24 +1438,24 @@
},
// 中国护照验证逻辑
isValidPassport:function() {
var isCheck=true;
isValidPassport: function () {
var isCheck = true;
if(this.addMsg.Nationality===2&&this.LineId!=90){
if (this.addMsg.Nationality === 2 && this.LineId != 90) {
if (this.addMsg.PassportNo.length !== 9) {
this.$message.error("请输入9位护照号")
isCheck=false;
return ;
isCheck = false;
return;
}
// 单个字母开头(E或G)后跟8位数字
const pattern1 = /^[EGHA][0-9]{8}$/;
// 两个字母开头(E开头,第二个字母不能是I或O)后跟7位数字
const pattern2 = /^[EP][A-HJ-NP-Z][0-9]{7}$/;
this.PassportNoSure= pattern1.test(this.addMsg.PassportNo) || pattern2.test(this.addMsg.PassportNo);
if(!this.PassportNoSure){
this.PassportNoSure = pattern1.test(this.addMsg.PassportNo) || pattern2.test(this.addMsg.PassportNo);
if (!this.PassportNoSure) {
this.$message.error("护照格式不正确")
isCheck=false;
return ;
isCheck = false;
return;
}
}
return isCheck;
......@@ -1536,7 +1463,7 @@
//中国护照验证逻辑
isValidPassport: function () {
var isCheck = true;
if(this.addMsg.Nationality===2&&this.LineId!=90){
if (this.addMsg.Nationality === 2 && this.LineId != 90) {
if (this.addMsg.PassportNo.length !== 9) {
this.$message.error("请输入9位护照号")
isCheck = false;
......@@ -1630,12 +1557,19 @@
this.addMsg.DutyType = obj.DutyType.toString();
this.addMsg.UnitType = obj.UnitType.toString();
this.addMsg.TravelType = obj.TravelType.toString();
this.addMsg.Marriage = obj.Marriage?.toString() || "0";
this.addMsg.Marriage = ""
if (obj && obj.Marriage) {
console.log(obj.Marriage, "obj.Marriage");
this.addMsg.Marriage = obj.Marriage.toString() || "0";
}
if (this.addMsg.Marriage == "0") {
this.addMsg.Marriage = "";
}
this.addMsg.IsCriminalRecord = obj.IsCriminalRecord === null ? '' : obj.IsCriminalRecord.toString();
this.addMsg.IsDepartureRecord = obj.IsDepartureRecord?.toString() || "";;
this.addMsg.IsDepartureRecord = "";
if (obj.IsDepartureRecord) {
this.addMsg.IsDepartureRecord = obj.IsDepartureRecord.toString();
}
this.EconomicCapabilityS.forEach(x => {
if (obj.EconomicCapabilityList) {
obj.EconomicCapabilityList.forEach(y => {
......@@ -1694,7 +1628,7 @@
ClearData() {
this.options = [];
this.optionsNames = [];
this.addMsg.CouponsIds=[];
this.addMsg.CouponsIds = [];
this.addMsg.SurNameID = "";
this.addMsg.NameID = "";
this.addMsg.SurName = "";
......
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