addTdyt.vue
3.43 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-05-17 10:39:47
-->
<template>
<dialogBox title="土地用途信息" width="60%" isMain v-model="myValue" :isFullscreen="false" @submitForm="submitForm"
@closeDialog="closeDialog" :isButton="showButton">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="138px">
<el-row>
<el-col :span="12">
<el-form-item label="土地用途" prop="tdyt">
<el-input v-model="ruleForm.tdyt"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="土地使用权限" prop="syqx">
<el-input v-model="ruleForm.syqx"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="土地使用结束时间" prop="jssj">
<el-date-picker
v-model="ruleForm.jssj"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd">>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="土地使用起止时间" prop="qzsj">
<el-date-picker
v-model="ruleForm.qzsj"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd">>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
</dialogBox>
</template>z x addTdyt
<script>
import { mapGetters } from "vuex";
export default {
props: {
value: { type: Boolean, default: false },
details: { type: Object, default: {} },
showButton: { type: Boolean, default: false }
},
data () {
return {
myValue: this.value,
ruleForm: {
tdyt:"",
syqx:"",
jssj:"",
qzsj:""
},
rules: {
tdyt: [{ required: true, message: "土地用途", trigger: "blur" }],
syqx: [{ required: true, message: "土地使用权限", trigger: "blur" }],
jssj: [{ required: true, message: "土地使用结束时间", trigger: "blur" }],
qzsj: [{ required: true, message: "土地使用起止时间", trigger: "blur" }],
},
};
},
watch: {
value (val) {
console.log("val",val);
this.myValue = _.cloneDeep(val);
},
details: {
handler: function (val, oldVal) {
console.log("val2",val);
this.ruleForm = val;
},
deep: true,
},
},
methods: {
closeDialog () {
this.$emit("input", false);
this.$refs["ruleForm"].resetFields();
},
submitForm () {
console.log("this.ruleForm",this.ruleForm);
this.$refs.ruleForm.validate((valid) => {
if (valid) {
this.$emit("input", false);
this.$emit("updateDetail", _.cloneDeep(this.ruleForm));
} else {
return false;
}
});
},
},
};
</script>
<style scoped lang="scss">
@import "~@/styles/dialogBoxheader.scss";
.submit-button {
text-align: center;
height: 52px;
padding-top: 10px;
background-color: #fff;
}
</style>