clxxAddDialog.vue
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<template>
<dialogBox title="新建材料信息" width="40%" v-model="myValue" :isFullscreen="false" :isButton="false">
<el-form :model="ruleForm" ref="ruleForm" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="材料类型">
<el-input v-model="ruleForm.cllx"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="材料名称">
<el-input v-model="ruleForm.clmc"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="submit-button" style="padding-bottom: 20px">
<el-button type="primary" @click="onSave">保存</el-button>
<el-button @click="closeDialog">取消</el-button>
</div>
</dialogBox>
</template>
<script>
export default {
props: {
value: { type: Boolean, default: false },
},
data () {
return {
myValue: this.value,
ruleForm: {
cllx: "",
clmc: "",
},
};
},
watch: {
value (val) {
this.myValue = val;
},
},
methods: {
closeDialog () {
this.$emit("input", false);
},
onSave () {
this.$parent.addSave(this.ruleForm);
this.$emit("input", false);
},
},
};
</script>
<style scoped lang="scss">
.submit-button {
text-align: center;
height: 52px;
padding-top: 10px;
background-color: #fff;
}
</style>