<div class="modal fade" tabindex="-1" role="dialog" id="modal">
    <div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
        <div class="modal-content">
            <div class="modal-header">
                <label class="ml-5">
                    <input class="form-control rounded-pill" @keydown.13="search($event)" placeholder="回车快捷检索地区">
                </label>
                <div class="scrollbar ml-2 border border-2 rounded pl-2 pr-5" style="overflow-y:auto;max-height:80px;overflow-x:hidden;">
                    <p class="mb-1 cursor-pointer" v-for="obj in result" v-html="obj.text" @click="selectedSearch(obj)"></p>
                </div>
                <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <label class="col-2 offset-1" for="logistic_id"><span class="text-danger">*&nbsp;</span>承运商</label>
                    <select class="col-5 form-control form-control-sm"
                            :class="errors.logistic_id ? 'is-invalid' : ''" id="logistic_id" type="text"
                            v-model="freeze.logistic_id">
                            <option v-for="logistic in data.logistics" :value="logistic.id">@{{ logistic.name }}</option>
                    </select>
                    <label class="col-2">
                        <input class="ml-1 form-control form-control-sm rounded-pill" @input="searchLogistic($event)" placeholder="搜索承运商">
                    </label>
                    <span class="invalid-feedback mt-0 offset-3" role="alert" v-if="errors.logistic_id">
                        <strong>@{{ errors.logistic_id[0] }}</strong>
                    </span>
                </div>
                <div class="row mt-2">
                    <label class="col-2 offset-1" for="thawed_at">停止日期</label>
                    <input type="date" :min="toDay" class="col-5 form-control form-control-sm" id="thawed_at" v-model="freeze.thawed_at"/>
                </div>
                <div class="row mt-2">
                    <label class="col-2 offset-1" for="province_id">省</label>
                    <select class="col-5 form-control form-control-sm"
                            :class="errors.province_id ? 'is-invalid' : ''" id="province_id" type="text"
                            v-model="freeze.province_id">
                        <option v-for="province in mapping['0']" :value="province.id">@{{ province.name }}</option>
                    </select>
                    <span class="invalid-feedback mt-0 offset-3" role="alert" v-if="errors.province_id">
                        <strong>@{{ errors.province_id[0] }}</strong>
                    </span>
                </div>
                <div class="row mt-2">
                    <label class="col-2 offset-1" for="city_id">市</label>
                    <select class="col-5 form-control form-control-sm"
                            :class="errors.city_id ? 'is-invalid' : ''" id="city_id" type="text"
                            v-model="freeze.city_id">
                        <option v-for="city in mapping[freeze.province_id]" :value="city.id">@{{ city.name }}</option>
                    </select>
                    <span class="invalid-feedback mt-0 offset-3" role="alert" v-if="errors.city_id">
                        <strong>@{{ errors.city_id[0] }}</strong>
                    </span>
                </div>
                <div class="row mt-2">
                    <label class="col-2 offset-1" for="district_id">区/县</label>
                    <select class="col-5 form-control form-control-sm"
                            :class="errors.district_id ? 'is-invalid' : ''" id="district_id" type="text"
                            v-model="freeze.district_id">
                        <option v-for="district in mapping[freeze.city_id]" :value="district.id">@{{ district.name }}</option>
                    </select>
                    <label class="col-4">
                        <input class="ml-1 form-control form-control-sm rounded-pill" @keydown.13="addRegion($event,3)" placeholder="此处输入回车添加新区/县">
                    </label>
                    <span class="invalid-feedback mt-0 offset-3" role="alert" v-if="errors.district_id">
                        <strong>@{{ errors.district_id[0] }}</strong>
                    </span>
                </div>
                <div class="row mt-2">
                    <label class="col-2 offset-1" for="town_id">乡/镇</label>
                    <select class="col-5 form-control form-control-sm"
                            :class="errors.town_id ? 'is-invalid' : ''" id="town_id" type="text"
                            v-model="freeze.town_id">
                        <option v-for="town in mapping[freeze.district_id]" :value="town.id">@{{ town.name }}</option>
                    </select>
                    <label class="col-4">
                        <input class="ml-1 form-control form-control-sm rounded-pill" @keydown.13="addRegion($event,4)" placeholder="此处输入回车添加新乡/镇">
                    </label>
                    <span class="invalid-feedback mt-0 offset-3" role="alert" v-if="errors.town_id">
                        <strong>@{{ errors.town_id[0] }}</strong>
                    </span>
                </div>
                <div class="row mt-2">
                    <label class="col-2 offset-1" for="street_id">村/街</label>
                    <select class="col-5 form-control form-control-sm"
                            :class="errors.street_id ? 'is-invalid' : ''" id="street_id" type="text"
                            v-model="freeze.street_id">
                        <option v-for="street in mapping[freeze.town_id]" :value="street.id">@{{ street.name }}</option>
                    </select>
                    <label class="col-4">
                        <input class="ml-1 form-control form-control-sm rounded-pill" @keydown.13="addRegion($event,5)" placeholder="此处输入回车添加新村/街">
                    </label>
                    <span class="invalid-feedback mt-0 offset-3" role="alert" v-if="errors.street_id">
                        <strong>@{{ errors.street_id[0] }}</strong>
                    </span>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-success" @click="submit()">提交</button>
            </div>
        </div>
    </div>
</div>