8c030a19 by 杨威

引导页新建自然幢表单验证

1 parent e0ea3a26
......@@ -95,26 +95,19 @@
</el-tab-pane>
<el-tab-pane class="eltabspane" label="宗海" name="zh">宗海</el-tab-pane>
<el-tab-pane class="eltabspane" label="自然幢" name="zrz">
<el-form :inline="true" class="zrzProject">
<el-form-item label="项目名称">
<el-form :inline="true" :rules="rules1" :model="ruleForm1" ref="ruleForm1" class="zrzProject">
<el-form-item label="项目名称" prop="xmmc">
<el-input
v-model="zrzProjectName"
v-model="ruleForm1.xmmc"
placeholder="项目名称"
style="width:400px;"
></el-input>
</el-form-item>
<div>
<el-form-item style="margin-left:300px;">
<el-button type="primary">导入图形</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="newZrz">创建</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="close">取消</el-button>
</el-form-item>
</div>
<el-form-item class="handleBtn">
<el-button type="primary">导入图形</el-button>
<el-button type="primary" @click="newZrz">创建</el-button>
<el-button type="primary" @click="close">取消</el-button>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane class="eltabspane" label="多幢" name="dz">多幢</el-tab-pane>
......@@ -154,6 +147,11 @@ export default {
"xzqbsm": "",
"zdtzmbsm": ""
},
ruleForm1:{
zdbsm:'',
xmmc:'',
userbsm:''
},
rules: {
xzqbsm: [
{ required: true, message: '请选择行政区', trigger: 'change' }
......@@ -174,6 +172,11 @@ export default {
{ required: true, message: '请选择宗地特征码', trigger: 'change' }
]
},
rules1: {
xmmc: [
{ required: true, message: '请输入项目名称', trigger: 'blur' },
],
},
syqlx: [
{
label: "国家所有",
......@@ -227,35 +230,37 @@ export default {
},
newZrz() {
//todo 在新增时,如果是点击顶部新建里面的自然幢则不传zdbsm 如果是点击右键里面的添加定着物则传zdbsm
var data = {
userbsm: "",
xmmc: this.zrzProjectName,
zdbsm: "",
};
console.log(data);
insertZrzjbxx(data)
.then((res) => {
if (res.code == "200") {
this.$message({
message: "创建成功!",
type: "success",
});
//todo 跳转到自然幢基本信息内容表页面 (预留)
this.close();
this.$store.state.zdbsm=res.result.zdbsm;
this.$store.state.zrzbsm=res.result.bsm;
this.$store.state.xmmc=res.result.xmmc;
this.$router.push({
path: '/zrz', query:{
source: 1,
bsm:res.result.bsm
this.$refs['ruleForm1'].validate((valid) => {
if (valid) {
insertZrzjbxx(this.ruleForm1)
.then((res) => {
if (res.code == "200") {
this.$message({
message: "创建成功!",
type: "success",
});
//todo 跳转到自然幢基本信息内容表页面 (预留)
this.close();
this.$store.state.zdbsm=res.result.zdbsm;
this.$store.state.zrzbsm=res.result.bsm;
this.$store.state.xmmc=res.result.xmmc;
this.$router.push({
path: '/zrz', query:{
source: 1,
bsm:res.result.bsm
}
});
} else {
this.$message.error("创建失败!");
}
});
} else {
this.$message.error("创建失败!");
}
})
.catch((error) => {});
})
.catch((error) => {});
} else {
console.log('error submit!!');
return false;
}
});
},
getXzqList() {
getAllList()
......@@ -319,6 +324,9 @@ export default {
height: 100%;
width: 100%;
padding: 20px;
.el-form--inline .el-form-item__label{
width: 100px;
}
.el-form-item{
margin-bottom: 20px;
}
......@@ -340,7 +348,4 @@ export default {
.zrzProject {
margin-top: 80px;
}
.el-form--inline .el-form-item__label{
width: 100px;
}
</style>
......