89c35c2d by 杨威

自然幢表单校验完善

1 parent d77eef37
......@@ -284,6 +284,7 @@
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
@blur="inputBlur($event,true)"
@input="startTime(index,childIndex)"
>
</el-date-picker>
......@@ -332,6 +333,7 @@
value-format="yyyy-MM-dd"
:picker-options="childItem.pickerEnd"
placeholder="选择日期"
@blur="inputBlur($event,true)"
@input="endTime(index,childIndex)"
>
</el-date-picker>
......
<template>
<div class="main">
<div class="main" ref="mainBox">
<div class="formMenu">
<Qlr ref="qlrxxModule" :bsm="bsm" :qszt="form.qszt"></Qlr>
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="zrzTable">
......@@ -43,7 +43,7 @@
<tr>
<td colspan="2" >房屋性质<i class="requisite">*</i></td>
<td colspan="4" >
<el-select class="formSelect" ref="fwxz" @blur="inputBlur($event)" :disabled="form.qszt!='0'" v-model="form.fwxzbsm" placeholder="请选择" >
<el-select class="formSelect" ref="fwxz" :disabled="form.qszt!='0'" v-model="form.fwxzbsm" placeholder="请选择" >
<el-option
v-for="item in $store.state.fwxzOptions"
:key="item.bsm"
......@@ -156,7 +156,6 @@
<td colspan="3" >
<el-select-tree style="width:100%"
ref="ghyt"
@blur="inputBlur($event)"
v-if="show"
:default-expand-all="defaultExpandAll"
:multiple="multiple"
......@@ -173,7 +172,6 @@
<td colspan="4" >
<el-select-tree style="width:100%"
ref="yt"
@blur="inputBlur($event)"
v-if="show"
:default-expand-all="defaultExpandAll"
:multiple="multiple"
......@@ -198,7 +196,7 @@
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;删除</span>
</td>
<td colspan="9" >
<el-select class="persent78" ref="fwjg" @blur="inputBlur($event)" :disabled="form.qszt!='0'" v-model="item1.fwjgzdbsm" placeholder="请选择" >
<el-select class="persent78" ref="fwjg" :disabled="form.qszt!='0'" v-model="item1.fwjgzdbsm" placeholder="请选择" >
<el-option
v-for="item in $store.state.jgOptions"
:key="item.bsm"
......@@ -266,10 +264,11 @@
</tr>
</table>
<div style="min-height: 40px;text-align: center;margin-top: 10px">
<el-button type="success" @click="onSave">保存</el-button>
<el-button type="primary" @click="onSubmit">提交</el-button>
<el-button type="primary" @click="registerCall">登记调用</el-button>
<div class="header-button" :style="{width:mainBoxWidth+'px'}">
<el-button type="primary" class="saveBtn" @click="onSave">保存</el-button>
<el-button type="primary" @click="onSubmit">提交</el-button>
<el-button type="primary" @click="registerCall">登记调用</el-button>
<!-- <el-button type="primary" class="saveBtn" @click="save">保存</el-button> -->
</div>
</div>
</div>
......@@ -398,6 +397,7 @@
BSM:"",
},
rules:[],
mainBoxWidth:0,
}
},
methods: {
......@@ -491,13 +491,13 @@
this.form.fwytList.forEach((item,index)=>{
this.rules.push(
{
data:this.form.fwytList[index].ghyt,
data:item.fwytzdbsm,
name:'规划用途',
dom:this.$refs.ghyt[index],
rule: /^\s*$/g, //非空
},
{
data:this.form.fwytList[index].yt,
data:item.fwytzdbsm,
name:'用途',
dom:this.$refs.yt[index],
rule: /^\s*$/g, //非空
......@@ -507,7 +507,7 @@
this.form.fwjgList.forEach((item,index)=>{
this.rules.push(
{
data:this.form.fwjgList[index].fwjg,
data:item.fwjgzdbsm,
name:'房屋结构',
dom:this.$refs.fwjg[index],
rule: /^\s*$/g, //非空
......@@ -541,15 +541,15 @@
});
}else{
saveZrzInfo(this.form).then((res)=>{
if(res.code===200){
this.$message.success("保存完成!")
}else {
this.$message({
message: res.message,
type: "warning",
});
}
this.loading=false;
if(res.code===200){
this.$message.success("保存完成!")
}else {
this.$message({
message: res.message,
type: "warning",
});
}
this.loading=false;
})
this.loading=false;
......@@ -717,7 +717,11 @@
this.getZrzDetailByBsm(this.$route.query.bsm)
}
},
mounted() {},
mounted() {
this.$nextTick(() => {
this.mainBoxWidth = this.$refs.mainBox.clientWidth;
})
},
computed: {
zrzbsm() {
return this.$store.state.zdbsm;
......@@ -726,7 +730,46 @@
watch:{
zrzbsm:function (val) {
this.reload()
}
},
"form.bdcdyh":function (val) {
if (val != '') {
this.$refs.bdcdyh.style.border = '';
}
},
"form.zrzh":function (val) {
if (val != '') {
this.$refs.zrzh.style.border = '';
}
},
"form.fwxzbsm":{
handler:function (val) {
if (val != '') {
this.$refs.fwxz.$el.style.border = '';
}
},
immediate:false
},
"form.fwytList": {
handler : function (newVal, oldVal) {
newVal.forEach((item,ind)=>{
if(item.fwytzdbsm != ''){
this.$refs.ghyt[ind].$el.style.border=""
this.$refs.yt[ind].$el.style.border=""
}
})
},
deep:true
},
"form.fwjgList": {
handler : function (newVal, oldVal) {
newVal.forEach((item,ind)=>{
if(item.fwjgzdbsm != ''){
this.$refs.fwjg[ind].$el.style.border=""
}
})
},
deep:true
},
}
}
</script>
......@@ -738,6 +781,7 @@
.formMenu {
width: 100%;
margin: 0 auto;
margin-bottom: 50px;
}
.zrzTable {
margin: 10px 0;
......@@ -791,5 +835,26 @@
width: 100%;
}
}
.header-button {
height: 50px;
position: fixed;
bottom: 0;
right: 6px;
text-align: center;
background-color: #ffffff;
.el-button{
padding: 10px 30px;
margin-top: 8px;
cursor: pointer;
}
.saveBtn {
background-color: #00CACD;
border-color: #00CACD;
}
.saveBtn:hover {
background-color: rgba(0, 202, 205, .8);
border-color: rgba(0, 202, 205, .8);
}
}
}
</style>
......