<div class="modal fade " id="addModal" tabindex="1" aria-labelledby="title" >
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="add-title">添加耗材类型</h5>
                <button type="button" class="close"  data-dismiss="modal" @click="addMaterial={}">
                    <span>&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label for="add-material-code">编号</label>
                        <input type="text" id="add-material-code" class="form-control" v-model="addMaterial.code" :class="materialError.code ? 'is-invalid':''" @click="materialError.code = null">
                        <div class="invalid-feedback" v-if="materialError.code">
                            @{{ materialError.code[0] }}
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="add-material-name">名称</label>
                        <input type="text" id="add-material-name" class="form-control" v-model="addMaterial.name" :class="materialError.name ? 'is-invalid':''" @click="materialError.name = null">
                        <div class="invalid-feedback" v-if="materialError.name">
                            @{{ materialError.name[0] }}
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary"  data-dismiss="modal" @click="addMaterial={}">关闭</button>
                <button type="button" class="btn btn-primary" @click="create(addMaterial)">提交</button>
            </div>
        </div>
    </div>
</div>
