<div class="modal " id="edit-ownerMaterial" tabindex="-1" >
    <div class="modal-dialog modal-lg modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title text-center">项目耗材编辑</h5>
                <button type="button" class="close" data-dismiss="modal" >
                    <span>&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <form class="form">
                    <div class="form-group row">
                        <label for="edit-owner-id" class="col-sm-2 col-form-label text-right">货主</label>
                        <div class="col-sm-10 form-inline">
                            <select   id="edit-owner-id" class="form-control col-sm-5" v-model="editOwnerMaterial.owner_id"
                                      :class="materialErrors.owner_id?'is-invalid':''"
                                      @focus="materialErrors.owner_id= null">
                                <option v-for="(owner,i) in filterOwners"  :value="owner.id">@{{ owner.name }}</option>
                            </select>
                            <input type="text" placeholder="输入货主进行筛选" class="form-control col-sm-4 offset-1" id="editOwnerName" @change="filterOwner($event,2)">
                            <div class="invalid-feedback" v-if="materialErrors.owner_id">
                                @{{ materialErrors.owner_id[0] }}
                            </div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="edit-material-code" class="col-sm-2 col-form-label text-right">耗材编码</label>
                        <div class="col-sm-10 form-inline">
                            <input type="text"  id="edit-material-code" class="form-control col-sm-10" placeholder="耗材编码"
                                   v-model="editOwnerMaterial.material_code"
                                   :class="materialErrors.material_code?'is-invalid':''"
                                   @focus="materialErrors.material_code= null">
                            <div class="invalid-feedback" v-if="materialErrors.material_code">
                                @{{ materialErrors.material_code[0] }}
                            </div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="edit-material-id" class="col-sm-2 col-form-label text-right">耗材</label>
                        <div class="col-sm-10 form-inline">
                            <select  id="edit-material-id" class="form-control col-sm-5"
                                     v-model="editOwnerMaterial.material_id"
                                     :class="materialErrors.material_id?'is-invalid':''"
                                     @focus="materialErrors.material_id = null">
                                <option v-for="(materials,i) in filterMaterials"  :value="materials.id">@{{ materials.code }}</option>
                            </select>
                            <input type="text" placeholder="输入耗材进行筛选" class="form-control col-m-4 offset-1" @change="filterMaterial($event,2)">
                            <div class="invalid-feedback" v-if="materialErrors.material_id">
                                @{{ materialErrors.material_id[0] }}
                            </div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="edit-size" class="col-sm-2 col-form-label text-right">尺寸</label>
                        <div class="col-sm-10 form-inline">
                            <input type="text" id="edit-size" class="form-control col-10"   v-model="editOwnerMaterial.size" placeholder="项目耗材尺寸"
                                   :class="materialErrors.size?'is-invalid':''"
                                   @focus="materialErrors.size = null">
                            <div class="invalid-feedback" v-if="materialErrors.size">
                                @{{ materialErrors.size[0] }}
                            </div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="edit-special" class="col-sm-2 col-form-label text-right">特殊要求</label>
                        <div class="col-sm-10 form-inline">
                            <textarea   id="edit-special" cols="30" rows="3" v-model="editOwnerMaterial.special" class="form-control form-text col-10"></textarea>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="edit-specification" class="col-sm-2 col-form-label text-right">材质规格</label>
                        <div class="col-sm-10 form-inline">
                            <textarea   id="edit-specification" cols="30" rows="5"  class="form-control form-text col-10" v-model="editOwnerMaterial.specification"></textarea>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary"  data-dismiss="modal" >关闭</button>
                <button type="button" class="btn btn-primary" @click="update">保存</button>
            </div>
        </div>
    </div>
</div>
