国家时区选择

This commit is contained in:
PQZ 2025-11-22 11:24:19 +08:00
parent bc61944330
commit edc60f9713
4 changed files with 118 additions and 17 deletions

View File

@ -13,7 +13,7 @@ public class CusBankImportDTO {
private String taxId;
@Excel(name = "银行名称")
private String bankName;
@Excel(name = "银行账")
@Excel(name = "银行账")
private String bankAccount;
@Excel(name = "分支机构代码")
private String branchCode;

View File

@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN base_time_zone btz ON main.zone_id = btz.id
<where>
<if test="entity.nameEn != null and entity.nameEn != ''"> and name_en = #{entity.nameEn}</if>
<if test="entity.nameCn != null and entity.nameCn != ''"> and name_cn = #{entity.nameCn}</if>
<if test="entity.nameCn != null and entity.nameCn != ''"> and name_cn like concat('%', #{entity.nameCn}, '%') </if>
</where>
</select>
</mapper>

View File

@ -57,12 +57,20 @@
<el-row>
<el-col :span="12">
<el-form-item label="国家/地区" label-width="100px">
<el-select style="width: 100%" v-model="formData.mainInfo.country" filterable placeholder="国家/地区" clearable>
<el-select style="width: 100%"
filterable
remote
v-model="formData.mainInfo.country"
placeholder="请输入国家/地区"
:remote-method="remoteMethod"
@change="countryChange"
:loading="countryLoading"
clearable>
<el-option
v-for="dict in countryList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="item in countryList"
:key="item.nameCn"
:label="item.nameCn+'('+item.nameEn+')'"
:value="item.nameCn"
/>
</el-select>
</el-form-item>
@ -71,10 +79,10 @@
<el-form-item label="时区" label-width="100px">
<el-select style="width: 100%" v-model="formData.mainInfo.zoneName" filterable placeholder="时区" clearable>
<el-option
v-for="dict in timeZoneList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="item in timeZoneList"
:key="item.zoneName"
:label="item.zoneName"
:value="item.zoneName"
/>
</el-select>
</el-form-item>
@ -255,6 +263,9 @@
<script>
import { getCode, addMain } from "@/api/cus/main";
import { listCountry } from "@/api/base/country";
import { zoneList } from "@/api/base/zone";
export default {
name: 'drawForm',
dicts: ['cus_main_product', 'cus_label', 'cus_type','sys_user_sex','cus_from','cus_level','cus_busi_type','cus_follow_step'],
@ -306,6 +317,7 @@ export default {
//
//
countryList: [],
countryLoading: false,
//
timeZoneList: [],
//
@ -327,7 +339,48 @@ export default {
}
};
},
created() {
this.getZoneList()
},
methods: {
countryChange(row){
// countryListzoneName
const selectedCountry = this.countryList.find(country => country.nameCn === row);
if (selectedCountry) {
this.formData.mainInfo.zoneName = selectedCountry.zoneName;
} else {
this.formData.mainInfo.zoneName = null;
}
},
remoteMethod(query){
if (query !== ''){
this.countryLoading = true;
const queryParams = {
pageNum: 1,
pageSize: 10,
nameCn: query,
}
listCountry(queryParams).then(response => {
this.countryList = response.data.records;
this.total = response.data.total;
this.countryLoading = false;
});
} else {
this.countryList = []
}
},
/**查询时区*/
getZoneList(){
zoneList().then(res => {
this.timeZoneList = res.data
})
},
/**
* 新增联系人
*/

View File

@ -95,13 +95,21 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="国家/地区">
<el-select style="width: 100%" v-model="formData.mainInfo.country" filterable placeholder="国家/地区" clearable>
<el-form-item label="国家/地区" label-width="100px">
<el-select style="width: 100%"
filterable
remote
v-model="formData.mainInfo.country"
placeholder="请输入国家/地区"
:remote-method="remoteMethod"
@change="countryChange"
:loading="countryLoading"
clearable>
<el-option
v-for="dict in countryList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="item in countryList"
:key="item.nameCn"
:label="item.nameCn+'('+item.nameEn+')'"
:value="item.nameCn"
/>
</el-select>
</el-form-item>
@ -533,6 +541,8 @@ function debounce(fn, delay = 100) {
import { getCode, addMain,getMain } from "@/api/cus/main";
//
import { mapGetters } from 'vuex'
import { listCountry } from "@/api/base/country";
import { zoneList } from "@/api/base/zone";
export default {
name: 'CustomerForm',
@ -649,6 +659,7 @@ export default {
},
//
countryList: [],
countryLoading: false,
//
timeZoneList: [],
//
@ -671,6 +682,7 @@ export default {
}
},
mounted() {
this.getZoneList()
if(this.$route.query.id){
this.id = this.$route.query.id;
this.getDataById();
@ -695,6 +707,42 @@ export default {
contentContainer.removeEventListener('scroll', this.debouncedScroll)
},
methods: {
countryChange(row){
// countryListzoneName
const selectedCountry = this.countryList.find(country => country.nameCn === row);
if (selectedCountry) {
this.formData.mainInfo.zoneName = selectedCountry.zoneName;
} else {
this.formData.mainInfo.zoneName = null;
}
},
remoteMethod(query){
if (query !== ''){
this.countryLoading = true;
const queryParams = {
pageNum: 1,
pageSize: 10,
nameCn: query,
}
listCountry(queryParams).then(response => {
this.countryList = response.data.records;
this.total = response.data.total;
this.countryLoading = false;
});
} else {
this.countryList = []
}
},
/**查询时区*/
getZoneList(){
zoneList().then(res => {
this.timeZoneList = res.data
})
},
/**
* 根据id查询客户信息
*/