abcfe658 by 杨威

多次新建自然幢,每次重置表单信息

1 parent 28f6f8fd
......@@ -177,6 +177,9 @@ export default {
"$store.state.zdbsm": function(bsm) {
this.getRightTree(bsm);
},
"$store.state.zrzbsm": function(bsm) {
this.getRightTreeByZrzbsm(this.$store.state.zrzbsm);
},
"$store.state.treeData":function (val) {
console.log(val,'val');
......@@ -430,6 +433,8 @@ export default {
width: 100%;
height: 100vh;
position: relative;
min-width: 1500px;
overflow-x: auto;
.calcWidth{
width: calc(100% - 300px);
}
......
......@@ -98,11 +98,10 @@
</el-tab-pane>
<el-tab-pane class="eltabspane" label="自然幢" name="zrz">
<el-form :inline="true" :rules="rules1" :model="ruleForm1" ref="ruleForm1" class="demo-form-inline">
<el-form-item label="项目名称" prop="xmmc">
<el-form-item label="项目名称" class="w100" prop="xmmc">
<el-input
v-model="ruleForm1.xmmc"
placeholder="项目名称"
style="width:400px;"
></el-input>
</el-form-item>
</el-form>
......@@ -114,11 +113,10 @@
</el-tab-pane>
<el-tab-pane class="eltabspane" label="多幢" name="dz">
<el-form :inline="true" :rules="rules2" :model="ruleForm2" ref="ruleForm2" class="demo-form-inline">
<el-form-item label="项目名称" prop="xmmc">
<el-form-item label="项目名称" class="w100" prop="xmmc">
<el-input
v-model="ruleForm2.xmmc"
placeholder="项目名称"
style="width:400px;"
></el-input>
</el-form-item>
</el-form>
......@@ -243,9 +241,16 @@ export default {
methods: {
// 重置
reset(){
this.$refs['ruleForm'].resetFields();
this.$refs["ruleForm1"].resetFields();
this.$refs["ruleForm2"].resetFields();
debugger
if(this.$refs['ruleForm']){
this.$refs['ruleForm'].resetFields();
}
if(this.$refs["ruleForm1"]){
this.$refs["ruleForm1"].resetFields();
}
if (this.$refs["ruleForm2"]) {
this.$refs["ruleForm2"].resetFields();
}
},
handleClick(tab, event) {
console.log(tab, event);
......@@ -290,7 +295,6 @@ export default {
this.ruleForm1.dzbsm = this.$store.state.dzbsm != '' ? this.$store.state.dzbsm : '';
insertZrzjbxx(this.ruleForm1)
.then((res) => {
debugger
if (res.code == "200") {
this.$message({
message: "创建成功!",
......@@ -300,13 +304,13 @@ export default {
this.$store.state.zdbsm=res.result.zdbsm;
this.$store.state.zrzbsm=res.result.bsm;
this.$store.state.xmmc=res.result.xmmc;
this.close();
this.$router.push({
path: '/zrz', query:{
source: 1,
bsm:res.result.bsm
}
});
this.close();
} else {
this.$message.error("创建失败!");
}
......@@ -334,13 +338,13 @@ export default {
this.$store.state.zdbsm=res.result.zdbsm;
this.$store.state.dzbsm=res.result.bsm;
this.$store.state.xmmc=res.result.xmmc;
this.close();
this.$router.push({
path: '/dz', query:{
source: 1,
bsm:res.result.bsm
}
});
this.close();
} else {
this.$message.error("创建失败!");
}
......@@ -405,8 +409,8 @@ export default {
}
},
close() {
this.$emit("closeDialog");
this.reset();
this.$emit("closeDialog");
},
},
computed: {},
......