国家时区选择
This commit is contained in:
parent
bc61944330
commit
edc60f9713
@ -13,7 +13,7 @@ public class CusBankImportDTO {
|
|||||||
private String taxId;
|
private String taxId;
|
||||||
@Excel(name = "银行名称")
|
@Excel(name = "银行名称")
|
||||||
private String bankName;
|
private String bankName;
|
||||||
@Excel(name = "银行账户")
|
@Excel(name = "银行账号")
|
||||||
private String bankAccount;
|
private String bankAccount;
|
||||||
@Excel(name = "分支机构代码")
|
@Excel(name = "分支机构代码")
|
||||||
private String branchCode;
|
private String branchCode;
|
||||||
|
|||||||
@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
LEFT JOIN base_time_zone btz ON main.zone_id = btz.id
|
LEFT JOIN base_time_zone btz ON main.zone_id = btz.id
|
||||||
<where>
|
<where>
|
||||||
<if test="entity.nameEn != null and entity.nameEn != ''"> and name_en = #{entity.nameEn}</if>
|
<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>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -57,12 +57,20 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="国家/地区" label-width="100px">
|
<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
|
<el-option
|
||||||
v-for="dict in countryList"
|
v-for="item in countryList"
|
||||||
:key="dict.value"
|
:key="item.nameCn"
|
||||||
:label="dict.label"
|
:label="item.nameCn+'('+item.nameEn+')'"
|
||||||
:value="dict.value"
|
:value="item.nameCn"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -71,10 +79,10 @@
|
|||||||
<el-form-item label="时区" label-width="100px">
|
<el-form-item label="时区" label-width="100px">
|
||||||
<el-select style="width: 100%" v-model="formData.mainInfo.zoneName" filterable placeholder="时区" clearable>
|
<el-select style="width: 100%" v-model="formData.mainInfo.zoneName" filterable placeholder="时区" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in timeZoneList"
|
v-for="item in timeZoneList"
|
||||||
:key="dict.value"
|
:key="item.zoneName"
|
||||||
:label="dict.label"
|
:label="item.zoneName"
|
||||||
:value="dict.value"
|
:value="item.zoneName"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -255,6 +263,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getCode, addMain } from "@/api/cus/main";
|
import { getCode, addMain } from "@/api/cus/main";
|
||||||
|
import { listCountry } from "@/api/base/country";
|
||||||
|
import { zoneList } from "@/api/base/zone";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'drawForm',
|
name: 'drawForm',
|
||||||
dicts: ['cus_main_product', 'cus_label', 'cus_type','sys_user_sex','cus_from','cus_level','cus_busi_type','cus_follow_step'],
|
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: [],
|
countryList: [],
|
||||||
|
countryLoading: false,
|
||||||
//可选时区列表
|
//可选时区列表
|
||||||
timeZoneList: [],
|
timeZoneList: [],
|
||||||
// 表单校验
|
// 表单校验
|
||||||
@ -327,7 +339,48 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.getZoneList()
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
countryChange(row){
|
||||||
|
// 通过国家名称从countryList中查找对应对象,并设置zoneName
|
||||||
|
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
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增联系人
|
* 新增联系人
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -95,13 +95,21 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="国家/地区">
|
<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
|
<el-option
|
||||||
v-for="dict in countryList"
|
v-for="item in countryList"
|
||||||
:key="dict.value"
|
:key="item.nameCn"
|
||||||
:label="dict.label"
|
:label="item.nameCn+'('+item.nameEn+')'"
|
||||||
:value="dict.value"
|
:value="item.nameCn"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -533,6 +541,8 @@ function debounce(fn, delay = 100) {
|
|||||||
import { getCode, addMain,getMain } from "@/api/cus/main";
|
import { getCode, addMain,getMain } from "@/api/cus/main";
|
||||||
// 在组件中引入
|
// 在组件中引入
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
import { listCountry } from "@/api/base/country";
|
||||||
|
import { zoneList } from "@/api/base/zone";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CustomerForm',
|
name: 'CustomerForm',
|
||||||
@ -649,6 +659,7 @@ export default {
|
|||||||
},
|
},
|
||||||
//可选国家列表
|
//可选国家列表
|
||||||
countryList: [],
|
countryList: [],
|
||||||
|
countryLoading: false,
|
||||||
//可选时区列表
|
//可选时区列表
|
||||||
timeZoneList: [],
|
timeZoneList: [],
|
||||||
// 表单校验
|
// 表单校验
|
||||||
@ -671,6 +682,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.getZoneList()
|
||||||
if(this.$route.query.id){
|
if(this.$route.query.id){
|
||||||
this.id = this.$route.query.id;
|
this.id = this.$route.query.id;
|
||||||
this.getDataById();
|
this.getDataById();
|
||||||
@ -695,6 +707,42 @@ export default {
|
|||||||
contentContainer.removeEventListener('scroll', this.debouncedScroll)
|
contentContainer.removeEventListener('scroll', this.debouncedScroll)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
countryChange(row){
|
||||||
|
// 通过国家名称从countryList中查找对应对象,并设置zoneName
|
||||||
|
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查询客户信息
|
* 根据id查询客户信息
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user