作者 小范

国籍和证件下拉框组件文件

  1 +<template>
  2 + <div>
  3 + <el-select v-model="document"
  4 + filterable
  5 + @click.native="getCreden"
  6 + @change="selectChange"
  7 + default-first-option
  8 + :loading="loading" placeholder="请选择"
  9 + style="text-transform:uppercase">
  10 + <el-option
  11 + v-for="item in certOptions"
  12 + :key="item.serialno"
  13 + :label="item.serialno+'-'+item.credenname"
  14 + :value="item.serialno">
  15 + <span style="float: left">{{ item.serialno }}</span>
  16 + <span style="float: right; color: #8492a6; font-size: 13px">{{ item.credenname }}</span>
  17 + </el-option>
  18 + </el-select>
  19 + </div>
  20 +</template>
  21 +
  22 +<script>
  23 + import { selectCreden} from '../../api/transport'
  24 +
  25 + export default {
  26 + name: 'Document',
  27 + props: {
  28 +
  29 + },
  30 + data() {
  31 + return {
  32 + document: '',
  33 + loading:false,
  34 + certOptions:[],
  35 + serialno:'',
  36 +
  37 + }
  38 + },
  39 + // computed: {
  40 + // },
  41 + // created() {
  42 + // },
  43 + methods: {
  44 + /*获取证件*/
  45 + getCreden:function(query){
  46 + this.certOptions=[];
  47 + let params={serialno:query};
  48 + this.loading = true;
  49 + selectCreden(params).then(res =>{
  50 + if (res!=null) {
  51 + console.log(res.data.data)
  52 + setTimeout(() => {
  53 + this.loading = false;
  54 + this.certOptions=res.data.data;
  55 + }, 200);
  56 + } else {
  57 + this.certOptions = [];
  58 + }
  59 +
  60 + });
  61 + },
  62 + selectChange:function(val){
  63 + console.log(val)
  64 + this.$emit('tellFa',val);
  65 + }
  66 + }
  67 + }
  68 +
  69 +</script>
  70 +
  71 +<style scoped>
  72 +
  73 +</style>
  1 +<template>
  2 + <div>
  3 + <el-select v-model="nationality"
  4 + filterable
  5 + @click.native="getCountry"
  6 + @change="selectChange"
  7 + default-first-option
  8 + :loading="loading" placeholder="请选择"
  9 + style="text-transform:uppercase">
  10 + <el-option
  11 + v-for="item in countryOptions"
  12 + :key="item.countryid"
  13 + :label="item.countryid+'-'+item.countrydescchn"
  14 + :value="item.countryid">
  15 + <span style="float: left">{{ item.countryid }}</span>
  16 + <span style="float: right; color: #8492a6; font-size: 13px">{{ item.countrydescchn }}</span>
  17 + </el-option>
  18 + </el-select>
  19 + </div>
  20 +</template>
  21 +
  22 +<script>
  23 + import {selectCountry} from '../../api/transport'
  24 +
  25 + export default {
  26 + name: 'Nationality',
  27 + props: {
  28 +
  29 + },
  30 + data() {
  31 + return {
  32 + nationality: '',
  33 + loading:false,
  34 + countryOptions:[],
  35 + countryid:'',
  36 +
  37 + }
  38 + },
  39 + // computed: {
  40 + // },
  41 + // created() {
  42 + // },
  43 + methods: {
  44 + /*获取国籍*/
  45 + getCountry:function(query){
  46 + this.countryOptions=[];
  47 + let params={countryid:query};
  48 + this.loading = true;
  49 + selectCountry(params).then(res =>{
  50 + if (res!=null) {
  51 + console.log(res.data.data)
  52 + setTimeout(() => {
  53 + this.loading = false;
  54 + this.countryOptions=res.data.data;
  55 + }, 200);
  56 + } else {
  57 + this.countryOptions = [];
  58 + }
  59 +
  60 + });
  61 + },
  62 + selectChange:function(val){
  63 + console.log(val)
  64 + this.$emit('tellFarther',val);
  65 + }
  66 + }
  67 + }
  68 +
  69 +</script>
  70 +
  71 +<style scoped>
  72 +
  73 +</style>