7c93ae9d by 田浩浩
2 parents 9d981e8d 05ae1e8d
<template>
<div class="h content-form">
<el-form ref="form" :model="form" label-width="160px">
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="hTable">
<tbody>
<tr height="30">
<td colspan="12" align="center">
<font size="4">层基本信息</font>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">层号</td>
<td colspan="4">
<el-input v-model="form.ch"></el-input>
</td>
<td colspan="2" align="center" class="tdright">自然幢号</td>
<td colspan="4">
<el-input v-model="form.zrzh"></el-input>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">实际层</td>
<td colspan="4">
<el-input v-model="form.sjc"></el-input>
</td>
<td colspan="2" align="center" class="tdright">名义层</td>
<td colspan="4">
<el-input v-model="form.myc"></el-input>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">层建筑面积(㎡)</td>
<td colspan="4">
<el-input v-model="form.cjzmj"></el-input>
</td>
<td colspan="2" align="center" class="tdright">层套内建筑面积(㎡)</td>
<td colspan="4">
<el-input v-model="form.ctnjzmj"></el-input>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">层阳台面积(㎡)</td>
<td colspan="4">
<el-input v-model="form.cytmj"></el-input>
</td>
<td colspan="2" align="center" class="tdright">层半墙面积(㎡)</td>
<td colspan="4">
<el-input v-model="form.cbqmj"></el-input>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">层共有建筑面积(㎡)</td>
<td colspan="4">
<el-input v-model="form.cgyjzmj"></el-input>
</td>
<td colspan="2" align="center" class="tdright">层分摊建筑面积(㎡)</td>
<td colspan="4">
<el-input v-model="form.cftjzmj"></el-input>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">层高</td>
<td colspan="4">
<el-input v-model="form.cg"></el-input>
</td>
<td colspan="2" align="center" class="tdright">水平投影面积</td>
<td colspan="4">
<el-input v-model="form.sptymj"></el-input>
</td>
</tr>
<tr height="30">
</tr>
</tbody>
</table>
</el-form>
</div>
</template>
<script>
// import { getQjCDetailById, updateQjC } from "@api/c";
export default {
name: 'c',
components: {},
props: {
cbsm: {
type: String,
default: '',
}
},
data () {
return {
form: {
zrzbsm: '',
ch: '', //层号
zrzh: '', //自然幢号
sjc: '', //实际层
myc: '', //名义层
cjzmj: '', //层建筑面积
ctnjzmj: '', //层套内建筑面积
cytmj: '', //层阳台面积
cbqmj: '', //层半墙面积
cgyjzmj: '', //层共有建筑面积
cftjzmj: '', //层分摊建筑面积
cg: '', //层高
sptymj: '', //水平投影面积
},
value: '',
}
},
methods: {
onSave () {
this.form.zrzbsm = this.$route.query.bsm;
//编辑层信息接口调用 TODO
// updateQjC(this.form).then((res) => {
// if (res.code === 200) {
// this.$message.success("保存成功")
// }
// })
},
getCinfo (bsm) {
this.reset();
//获取层信息接口调用 TODO
// getQjCDetailById(bsm).then((res) => {
// if (res.code === 200) {
// this.form = res.result;
// this.form.zrzh = this.$store.state.zrzh;
// }
// })
},
reset () {
this.form = {
zrzbsm: '',
ch: '', //层号
zrzh: '', //自然幢号
sjc: '', //实际层
myc: '', //名义层
cjzmj: '', //层建筑面积
ctnjzmj: '', //层套内建筑面积
cytmj: '', //层阳台面积
cbqmj: '', //层半墙面积
cgyjzmj: '', //层共有建筑面积
cftjzmj: '', //层分摊建筑面积
cg: '', //层高
sptymj: '', //水平投影面积
}
}
},
mounted () {
this.getCinfo(this.cbsm);
},
watch: {
cbsm: {
handler: function (item) {
console.log(item, "item")
console.log(this.$parent.$parent.menuType, "this.$parent.$parent.menuType")
if (item != '' && this.$parent.$parent.menuType == 'c') {
this.getCinfo(item)
}
},
immediate: true
},
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.h {
min-height: 200px;
width: 100%;
margin: 0 auto;
/deep/.el-input__inner {
width: 100%;
border: 0;
}
/deep/textarea {
width: 100%;
border: 0;
}
.el-form-item {
font-weight: bold;
font-size: xx-large
}
table {
background: #fff;
table-layout: fixed;
}
td {
//bgcolor:#F1F4FC;
bgcolor: #fff;
width: 8.33%
}
.el-select {
display: block;
}
}
table {
font-size: 14px;
}
.hTable {
margin-top: 10px;
}
</style>
\ No newline at end of file
<template>
<div class="addCh">
<el-table class="addChTable" :data="tableData" style="width: 100%" border>
<el-table-column prop="cz" width="60" align="center">
<template slot-scope="scope">
<span class="cp" @click="handleRowClick(scope.row, scope.$index)">
<i class="iconfont iconicon-test1" style="color:#FA6400;font-size:30px" @click="deleteYtInfo(index)"
v-if="scope.row.cz == '+'"></i>
<i class="iconfont iconicon-test" style="color:#FA6400;font-size:30px" @click="deleteYtInfo(index)"
v-if="scope.row.cz == '-'"></i>
</span>
</template>
</el-table-column>
<el-table-column prop="zrzmc" label="自然幢" align="center">
</el-table-column>
<el-table-column prop="ljzmc" label="逻辑幢" align="center">
</el-table-column>
<el-table-column prop="zdymc" label="幢单元" align="center">
</el-table-column>
<el-table-column prop="qsc" label="起始层" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.qsc" type="number"></el-input>
</template>
</el-table-column>
<el-table-column prop="jsc" label="结束层" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.jsc" type="number"></el-input>
</template>
</el-table-column>
<el-table-column prop="hs" label="每层户数" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.hs" type="number"></el-input>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
// import { insertChInfo } from "@api/lpb";
export default {
name: "",
components: {},
props: {
treeData: {},
dialogVisible: {
type: Boolean,
default: false,
},
scyclx: {
type: String,
default: "1",
},
},
data () {
return {
ljzBsm: null,
zdyBsm: null,
zrzBsm: null,
tableData: [],
formData: {
cz: "+",
ljzbsm: "",
ljzmc: "",
zdymc: "",
zdybsm: "",
zrzbsm: "",
scyclx: "1",
qsc: "",
jsc: "",
hs: "",
},
};
},
created () { },
mounted () {
console.log(this.treeData, "treeData");
},
methods: {
//行操作
handleRowClick (row, index) {
if (row.cz == "+") {
let temp = JSON.parse(JSON.stringify(this.formData));
temp.qsc = '';
temp.jsc = '';
temp.hs = '';
temp.cz = "-";
this.tableData.push(temp);
} else {
this.tableData.splice(index, 1);
}
},
onSave (bsm) {
console.log(this.tableData)
let totalHs = 0;
for (let k = 0; k < this.tableData.length; k++) {
if (this.tableData[k].qsc === "" || this.tableData[k].jsc === "" || this.tableData[k].hs === "") {
this.$message.warning("表单不完整,请填写完整")
return false
}
if (this.tableData[k].qsc - this.tableData[k].jsc > 0) {
this.$message.warning("存在结束层大于起始层,请重写填写")
return false
}
totalHs = totalHs + (this.tableData[k].jsc - this.tableData[k].qsc + 1) * this.tableData[k].hs;
}
if (totalHs >= 5000) {
this.$message.warning("单次添加户数累积超过5000户,请分次添加!")
return false
}
// insertChInfo(this.tableData).then((res) => {
// if (res.code === 200) {
// this.$message.success("保存成功");
// //更新树结构数据
// console.log(this);
// this.$parent.$parent.getLpbMenuTree(bsm);
// this.$parent.$parent.getlpbData();
// //关闭弹框
// this.$parent.$parent.closeDaialog();
// } else {
// this.$message({
// message: res.message,
// type: "warning",
// })
// }
// });
},
//重置数据
reset () {
this.tableData[0].qsc = "";
this.tableData[0].jsc = "";
this.tableData[0].hs = "";
},
},
computed: {},
watch: {
treeData: {
handler (n) {
this.formData = {
cz: "+",
ljzbsm: "",
zdybsm: "",
zrzbsm: "",
scyclx: this.scyclx,
qsc: "",
jsc: "",
hs: "",
};
//给自然幢,逻辑幢,幢单元的bsm和mc赋值
switch (n.type) {
case "zrz":
this.formData.zrzbsm = n.bsm;
this.formData.zrzmc = n.mc;
break;
case "ljz":
this.formData.zrzbsm = n.zrzbsm;
this.formData.ljzbsm = n.bsm;
this.formData.zrzmc = n.zrzmc;
this.formData.ljzmc = n.mc;
break;
case "zdy":
this.formData.zrzbsm = n.zrzbsm;
this.formData.ljzbsm = n.ljzbsm;
this.formData.zdybsm = n.bsm;
this.formData.zrzmc = n.zrzmc;
this.formData.ljzmc = n.ljzmc;
this.formData.zdymc = n.mc;
break;
default:
break;
}
this.tableData = [];
this.tableData.push(this.formData);
},
//深度监听,第一次接收到父组件传值就触发事件
immediate: true,
deep: true,
},
scyclx: {
handler (n) {
this.$nextTick(() => {
this.formData.scyclx = this.scyclx;
})
}
}
},
};
</script>
<style lang="scss">
.addCh {
.addChTable {
.el-input__inner {
height: 20px;
margin: 0;
line-height: 20px;
outline: none;
border: none;
color: #606764;
overflow: visible;
cursor: text;
text-align: center;
}
}
.cp {
cursor: pointer;
position: relative;
top: 4px;
}
.el-table .cell {
line-height: 34px;
}
.el-table .cell,
.el-table--border td:first-child .cell,
.el-table--border th:first-child .cell {
padding-left: 5px;
}
.el-table td,
.el-table th {
padding: 4px 0;
}
}
</style>
......@@ -7,7 +7,7 @@
<el-radio-button label="0">预测</el-radio-button>
<el-radio-button label="1">实测</el-radio-button>
</el-radio-group>
<el-input maxlength="28" v-model="bdcdyh" :style="{ width: inputWidth + 'px' }" class="searchInput"
<el-input maxlength="28" v-model="" :style="{ width: inputWidth + 'px' }" class="searchInput"
placeholder="输入不动产单元号或室号"><i slot="suffix" class="el-input__icon el-icon-search" @click="inputChange"></i>
</el-input>
</el-col>
......@@ -117,13 +117,7 @@
</template>
<script>
import { Message } from "element-ui"
import addLjz from "./ljz/index";
import addZdy from "./zdy/index";
import addCh from "./ch/index";
import editCinfo from "./c/index";
import lpbContent from "./lpbContent/index";
export default {
name: "lpb",
props: {
......@@ -133,19 +127,13 @@ export default {
}
},
components: {
addLjz,
addZdy,
addCh,
lpbContent,
editCinfo
lpbContent
},
data () {
return {
bsms: [],
dialogVisible: false,
scyclx: "0", //1是实测 0是预测
bdcdyh: "",
islpb: true,
pd: [], //创建楼盘的树结构数据
menuType: "",
treeData: {},
......@@ -216,14 +204,7 @@ export default {
time: "",
dyztBsmList: {}, //单元状态bsmList
bjztFlag: true,
taskTitle: '添加',
curBsm: '',
qsztList: [],
uploadVisible: false, //批量上传弹框
fileData: {
glbsmList: [],
dylx: 'h'
}
};
},
created () {
......@@ -326,18 +307,6 @@ export default {
this.bsms = data;
}
},
inputChange () {
console.log(this.bdcdyh, 'this.bdcdyh');
if (this.bdcdyh != "") {
// console.log("查询" + this.bdcdyh);
this.$refs.lpbContent.lpbDataMap(this.bdcdyh);
} else {
this.$message({
message: "请输入内容后查询",
type: "warning",
});
}
},
//调用楼盘表信息查询和图例统计接口
getlpbData () {
this.$refs.lpbContent.loadingData(this.$store.state.zrzbsm, this.scyclx);
......@@ -364,32 +333,6 @@ export default {
})
},
open (hasGenerateCount, unGenerateCount) {
this.$confirm('未生成单元号有' + unGenerateCount + '户,已经生成单元号有' + hasGenerateCount + '户,是否覆盖全部重新生成?', '确认信息', {
distinguishCancelAndClose: true,
confirmButtonText: '覆盖全部生成',
cancelButtonText: '跳过已生成单元号户'
})
.then(() => {
batchGeneratorBdcdyh(this.$store.state.zrzh, this.pd[0].bsm, 2).then(
(res) => {
if (res.code === 200) {
this.$message.success("生成完成!");
}
});
})
.catch(action => {
if (action === 'cancel') {
batchGeneratorBdcdyh(this.$store.state.zrzh, this.pd[0].bsm, 1).then(
(res) => {
if (res.code === 200) {
this.$message.success("生成完成!");
}
});
}
});
},
//获取各项单元状态统计数据
getDyztBsmList () {
......@@ -516,10 +459,6 @@ export default {
selectedZt (n) {
this.legendToggleFlag = true;
},
bsms (n) {
this.fileData.glbsmList = n;
console.log(this.fileData, 'filedata');
}
},
};
</script>
......
<template>
<div class="h content-form">
<el-form ref="form" :model="form" label-width="160px">
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="hTable">
<tbody>
<tr height="30">
<td colspan="12" align="center">
<font size="4">逻辑幢基本信息</font>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright"><i class="requisite">*</i>逻辑幢号</td>
<td colspan="4">
<input class="formInput" ref="ljzh" @blur="inputBlur($event)" v-model="form.ljzh" />
</td>
<td colspan="2" align="center" class="tdright">自然幢号</td>
<td colspan="4">
<el-input v-model="form.zrzh" maxlength="24" disabled></el-input>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright"><i class="requisite">*</i>逻辑幢名称</td>
<td colspan="4">
<input class="formInput" ref="ljzmc" @blur="inputBlur($event)" v-model="form.ljzmc" />
</td>
<td colspan="2" align="center" class="tdright">建筑物状态</td>
<td colspan="4">
<el-input v-model="form.jzwzt"></el-input>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">门牌号</td>
<td colspan="4">
<el-input v-model="form.mph"></el-input>
</td>
<td colspan="2" align="center" class="tdright">竣工日期</td>
<td colspan="4">
<el-date-picker v-model="form.jgrq" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
</el-date-picker>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">预测建筑面积(㎡)</td>
<td colspan="4">
<el-input v-model="form.ycjzmj" oninput="value = (value.match(/^\d{0,9}(\.?\d{0,3})/g)[0]) || null">
</el-input>
</td>
<td colspan="2" align="center" class="tdright">实测建筑面积(㎡)</td>
<td colspan="4">
<el-input v-model="form.scjzmj" oninput="value = (value.match(/^\d{0,9}(\.?\d{0,3})/g)[0]) || null">
</el-input>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">预测地下面积(㎡)</td>
<td colspan="4">
<el-input v-model="form.ycdxmj" oninput="value = (value.match(/^\d{0,9}(\.?\d{0,3})/g)[0]) || null">
</el-input>
</td>
<td colspan="2" align="center" class="tdright">实测地下面积(㎡)</td>
<td colspan="4">
<el-input v-model="form.scdxmj" oninput="value = (value.match(/^\d{0,9}(\.?\d{0,3})/g)[0]) || null">
</el-input>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">预测其他面积(㎡)</td>
<td colspan="4">
<el-input v-model="form.ycqtmj" oninput="value = (value.match(/^\d{0,9}(\.?\d{0,3})/g)[0]) || null">
</el-input>
</td>
<td colspan="2" align="center" class="tdright">实测其他面积(㎡)</td>
<td colspan="4">
<el-input v-model="form.scqymj" oninput="value = (value.match(/^\d{0,9}(\.?\d{0,3})/g)[0]) || null">
</el-input>
</td>
</tr>
<tr height="30" v-for="(item1, index) in form.ytList" :key="'yt' + index">
<td colspan="2" v-if="index === 0" :rowspan="ytTitleRowspan" align="center" class="tdright">
<i class="iconfont iconicon-test1" style="margin-right: 8px;color:#66b1ff;font-size:30px"
@click="addYtInfo"></i>
<span style="position:relative;top:-6px"><i class="requisite">*</i>房屋用途</span>
</td>
<td colspan="1" align="center">
<i class="iconfont iconicon-test" style="color:#FA6400;font-size:30px" @click="deleteYtInfo(index)"></i>
</td>
<td colspan="9">
<el-select-tree style="width:100%" ref="yt" v-if="show" :default-expand-all="defaultExpandAll"
:multiple="multiple" :placeholder="placeholder" :data="$store.state.fwytList" :props="treeProps"
:check-strictly="checkStrictly" :clearable="clearable" v-model="item1.fwytzdbsm"></el-select-tree>
</td>
</tr>
<tr height="30" v-for="(item1, index) in form.fwjgList" :key="'jg' + index">
<td colspan="2" v-if="index === 0" :rowspan="fwjgTitleRowspan" align="center" class="tdright">
<i class="iconfont iconicon-test1" style="margin-right: 8px;color:#66b1ff;font-size:30px"
@click="addFwjgInfo"></i>
<span style="position:relative;top:-6px"><i class="requisite">*</i>房屋结构</span>
</td>
<td colspan="1" align="center">
<i class="iconfont iconicon-test" style="color:#FA6400;font-size:30px" @click="deleteFwjgInfo(index)"></i>
</td>
<td colspan="9">
<el-select-tree style="width:100%" ref="fwjg" v-if="show" :default-expand-all="defaultExpandAll"
:multiple="multiple" :placeholder="placeholder" :data="$store.state.jgOptions" :props="treeProps"
:check-strictly="checkStrictly" :clearable="clearable" v-model="item1.fwjgzdbsm"></el-select-tree>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">地下层数</td>
<td colspan="4">
<el-input v-model="form.dxcs"></el-input>
</td>
<td colspan="2" align="center" class="tdright">地上层数</td>
<td colspan="4">
<el-input v-model="form.dscs"></el-input>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">总层数</td>
<td colspan="10">
<el-input v-model="form.zcs"></el-input>
</td>
</tr>
<tr height="30">
<td colspan="2" rowspan="2" class="tdright">
<span>备注</span>
</td>
<td colspan="10" rowspan="2">
<el-input v-model="form.bz" type="textarea"></el-input>
</td>
</tr>
<tr height="30"></tr>
</tbody>
</table>
</el-form>
</div>
</template>
<script>
// import { insertLjzInfo } from "@api/lpb";
// import { getQjLjzDetailById, updateQjLjz } from "@api/ljz";
// import { formdate } from "@libs/function";
export default {
name: "ljz",
components: {},
props: {
ljzbsm: {
type: String,
default: '',
}
},
data () {
return {
//树型结构
show: true,
clearable: true,
defaultExpandAll: true,
multiple: false,
placeholder: '请选择',
disabled: false,
checkStrictly: true,
treeProps: {
value: 'bsm',
children: 'children',
label: 'mc'
},
rules: [],
form: {
zrzbsm: "",
ljzh: "", //逻辑幢号
zrzh: "", //自然幢号
ljzmc: "", //逻辑幢顺序号
bdcdyh: "", //不动产单元号
mph: "", //门牌号
jgrq: "", //竣工日期
ycjzmj: "", //预测建筑面积
scjzmj: "", //实测建筑面积
ycdxmj: "", //预测地下面积
scdxmj: "", //实测地下面积
ycqtmj: "", //预测其他面积
scqymj: "", //实测其他面积
ytList: [
{
glbsm: "", //关联标识码
fwytzdbsm: "", //房屋用途字典标识码
sx: "", //顺序
},
],
fwjgList: [
{
fwjgzdbsm: "", //房屋结构字典标识码
glbsm: "", //关联标识码
sx: "", //顺序
},
],
dxcs: "", //地下层数
dscs: "", //地上层数
zcs: "", //总层数
jzwzt: "", //建筑物状态
},
value: "",
ytTitleRowspan: 1, //用途的单元格垂直合并数量
fwjgTitleRowspan: 1, //房屋结构的单元格垂直合并数量
};
},
methods: {
inputBlur (e) {
if (e.target.value != '') {
e.target.style.border = ""
} else {
e.target.style.border = "1px solid red";
e.target.style.boxSizing = 'border-box';
}
},
addYtInfo () {
this.form.ytList.push({
glbsm: "",
fwytzdbsm: "",
sx: "",
});
this.ytTitleRowspan = this.form.ytList.length;
},
deleteYtInfo (index) {
if (this.form.ytList.length <= 1) {
this.$message({
message: "不能删除,最少含有一条房屋用途信息",
type: "warning",
});
} else {
this.form.ytList.splice(index, 1);
this.ytTitleRowspan = this.form.ytList.length;
}
},
addFwjgInfo () {
this.form.fwjgList.push({
fwjgzdbsm: "", //房屋结构字典标识码
glbsm: "", //关联标识码
sx: "", //顺序
});
this.fwjgTitleRowspan = this.form.fwjgList.length;
},
//重置数据
reset () {
this.form = {
// zrzbsm: "",
ljzh: "", //逻辑幢号
zrzh: this.$store.state.zrzh, //自然幢号
ljzmc: "", //逻辑幢顺序号
bdcdyh: "", //不动产单元号
mph: "", //门牌号
jgrq: "", //竣工日期
ycjzmj: "", //预测建筑面积
scjzmj: "", //实测建筑面积
ycdxmj: "", //预测地下面积
scdxmj: "", //实测地下面积
ycqtmj: "", //预测其他面积
scqymj: "", //实测其他面积
ytList: [
{
glbsm: "", //关联标识码
fwytzdbsm: "", //房屋用途字典标识码
sx: "", //顺序
},
],
fwjgList: [
{
fwjgzdbsm: "", //房屋结构字典标识码
glbsm: "", //关联标识码
sx: "", //顺序
},
],
dxcs: "", //地下层数
dscs: "", //地上层数
zcs: "", //总层数
jzwzt: "", //建筑物状态
};
this.ytTitleRowspan = 1; //用途的单元格垂直合并数量
this.fwjgTitleRowspan = 1; //用途的单元格垂直合并数量
},
deleteFwjgInfo (index) {
if (this.form.fwjgList.length <= 1) {
this.$message({
message: "不能删除,最少含有一条房屋结构信息",
type: "warning",
});
} else {
this.form.fwjgList.splice(index, 1);
this.fwjgTitleRowspan = this.form.fwjgList.length;
}
},
onSave (data, bsm) {
this.rules = [
{
data: this.form.ljzh,
name: '自然幢号',
dom: this.$refs.ljzh,
rule: /^\s*$/g, //非空
},
{
data: this.form.ljzmc,
name: '不动产单元号',
dom: this.$refs.ljzmc,
rule: /^\s*$/g, //非空
},
];
this.form.ytList.forEach((item, index) => {
this.rules.push(
{
data: item.fwytzdbsm,
name: '用途',
dom: this.$refs.yt[index],
rule: /^\s*$/g, //非空
},
)
});
this.form.fwjgList.forEach((item, index) => {
this.rules.push(
{
data: item.fwjgzdbsm,
name: '房屋结构',
dom: this.$refs.fwjg[index],
rule: /^\s*$/g, //非空
},
)
});
//自然幢标识码
this.form.zrzbsm = bsm;
let flag = true;
this.rules.forEach(item => {
if (item.rule.test(item.data) || item.data == null) {
if (item.dom.$el) {
item.dom.$el.style.border = '1px solid red';
item.dom.$el.style.boxSizing = 'border-box';
} else {
item.dom.style.border = '1px solid red';
item.dom.style.boxSizing = 'border-box';
}
flag = false;
return false
}
})
this.$nextTick(() => {
if (flag) {
if (this.ljzbsm == '') {
// insertLjzInfo(this.form).then((res) => {
// if (res.code === 200) {
// this.$message.success("保存成功");
// //更新树结构数据
// console.log(this);
// this.$parent.$parent.getLpbMenuTree(bsm);
// //关闭弹框
// this.$parent.$parent.closeDaialog();
// } else {
// this.$message.error(res.message);
// }
// });
} else {
//逻辑幢更新接口调用 TODO
console.log('保存');
updateQjLjz(this.form).then((res) => {
if (res.code === 200) {
this.$message.success("修改成功")
}
})
}
}
})
},
onSubmit () {
// console.log(this.form);
},
//根据逻辑幢bsm查询逻辑幢信息
getLjzInfo (bsm) {
//逻辑幢信息查询接口调用 bsm为逻辑幢bsm
getQjLjzDetailById(bsm).then((res) => {
if (res.code === 200) {
this.form = res.result;
this.form.zrzh = this.$store.state.zrzh;
this.form.fwjgList = [
{
fwjgzdbsm: "", //房屋结构字典标识码
glbsm: "", //关联标识码
sx: "", //顺序
},
];
this.form.ytList = [
{
glbsm: "", //关联标识码
fwytzdbsm: "", //房屋用途字典标识码
sx: "", //顺序
},
];
if (this.form.qjfwjg.length > 0) {
this.form.fwjgList = [];
for (let i = 0; i < this.form.qjfwjg.length; i++) {
this.form.fwjgList.push({
fwjgzdbsm: this.form.qjfwjg[i].fwjgzdbsm, //房屋结构字典标识码
glbsm: this.form.qjfwjg[i].glbsm, //关联标识码
sx: this.form.qjfwjg[i].sx, //顺序
})
}
}
if (this.form.qjfwyt.length > 0) {
this.form.ytList = [];
for (let i = 0; i < this.form.qjfwyt.length; i++) {
this.form.ytList.push({
fwytzdbsm: this.form.qjfwyt[i].fwytzdbsm, //房屋结构字典标识码
glbsm: this.form.qjfwyt[i].glbsm, //关联标识码
sx: this.form.qjfwyt[i].sx, //顺序
})
}
}
console.log(JSON.stringify(this.form) + ":this.form")
}
})
this.$forceUpdate();
}
},
created () {
},
mounted () {
this.form.zrzh = this.$store.state.zrzh;
},
watch: {
"form.ljzh": function (val) {
if (val != '') {
this.$refs.ljzh.style.border = '';
}
},
"form.ljzmc": function (val) {
if (val != '') {
this.$refs.ljzmc.style.border = '';
}
},
"form.ytList": {
handler: function (newVal, oldVal) {
newVal.forEach((item, ind) => {
if (item.fwytzdbsm != '') {
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
},
ljzbsm: {
handler: function (item) {
console.log(item, 'item');
if (item != '' && this.$parent.$parent.menuType == 'ljz') {
this.getLjzInfo(this.ljzbsm)
}
},
immediate: true
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.h {
min-height: 200px;
width: 100%;
margin: 0 auto;
/deep/.el-input__inner {
width: 100%;
border: 0;
}
/deep/textarea {
width: 100%;
border: 0;
}
.el-form-item {
font-weight: bold;
font-size: xx-large;
}
table {
background: #fff;
table-layout: fixed;
}
td {
//bgcolor:#F1F4FC;
background-color: #fff;
width: 8.33%;
height: 36px
}
.el-select {
display: block;
}
}
table {
font-size: 14px;
}
.hTable {
margin-top: 10px;
}
</style>
......@@ -286,19 +286,6 @@ export default {
.sort(this.compare("place"))
.reverse();
this.lpbData = res.result == null ? this.lpbData : res.result;
//给实预测楼盘表对象赋值,默认加载预测楼盘表数据
// if (scyclx == 0) {
// this.yclpbData = res.result == null ? this.yclpbData : res.result;
// this.lpbData = this.yclpbData;
// } else {
// this.sclpbData = res.result == null ? this.sclpbData : res.result;
// }
// if (actual) {
// this.lpbData = res.result == null ? this.yclpbData : res.result;
// }
// if (this.lpbParent == 'isFwsxbg') {
// this.lpbData = this.$parent.scyclx == '0' ? this.yclpbData : this.sclpbData;
// }
this.$nextTick(() => {
//渲染楼盘表
this.dataChange();
......@@ -482,12 +469,6 @@ export default {
this.$nextTick(function () {
this.$refs.hbj.$refs.hbj.getHInfo(this.hbsm);
});
// if (this.isHbfg) {
// }else{
// this.hbsmList.push(bsm); // 将户bsm放进hbsmList
// this.$parent.getHbsm(bsm, true);
// }
},
//删除多重数组中的某一项
deleteArrOption (arr, item) {
......
<template>
<div class="zdy-content">
<el-form :model="form" :rules="rules" ref="form" label-width="110px" size="small">
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="hTable">
<tbody>
<tr height="30">
<td colspan="12" align="center">
<font size="4">幢单元基本信息</font>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">幢单元号</td>
<td colspan="4">
<el-input v-model="form.zdyh"></el-input>
</td>
<td colspan="2" align="center" class="tdright"><i class="requisite">*</i>幢单元名称</td>
<td colspan="4">
<el-input v-model="form.zdymc" ref="zdymc"></el-input>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">地上层数</td>
<td colspan="4">
<el-input v-model="form.dscs"></el-input>
</td>
<td colspan="2" align="center" class="tdright">地下层数</td>
<td colspan="4">
<el-input v-model="form.dxcs"></el-input>
</td>
</tr>
<tr height="30">
<td colspan="2" align="center" class="tdright">总层数</td>
<td colspan="4">
<el-input v-model="form.zcs"></el-input>
</td>
<td colspan="2" align="center" class="tdright">备注</td>
<td colspan="4">
<el-input v-model="form.bz"></el-input>
</td>
</tr>
</tbody>
</table>
</el-form>
</div>
</template>
<script>
// import { insertZdyInfo } from "@api/lpb"
// import { getQjZdyDetailById, updateQjZdy } from "@api/zdy"
export default {
name: "index",
components: {},
props: {
zdybsm: {
type: String,
default: '',
}
},
data () {
return {
form: {
zdyh: '',
zdymc: '',
dscs: '',
dxcs: '',
zcs: '',
bz: '',
},
rules: {
zdyh: [
{ required: true, message: '幢单元号不能为空', trigger: 'blur' },
{ min: 5, max: 50, message: '长度最少 5 个字符', trigger: 'blur' }
],
zdymc: [
{ required: true, message: '名称不能为空', trigger: 'change' }
],
dscs: [
{ required: true, message: '地上层数不能为空', trigger: 'blur' },
{ type: 'number', message: '必须是数字', trigger: 'blur' }
],
dxcs: [
{ required: true, message: '地下层数不能为空', trigger: 'blur' },
{ type: 'number', message: '必须是数字' }
],
zcs: [
{ required: true, message: '名称不能为空', trigger: 'change' }
]
}
}
},
methods: {
//在自然幢节点上添加幢单元只需传zrzbsm,ljzbsm为'';在逻辑幢上添加幢单元时需要同时传入zrzbsm和ljzbsm
submitForm (formName, zrzbsm, ljzbsm) {
this.form.zrzbsm = zrzbsm;
this.form.ljzbsm = zrzbsm == ljzbsm ? '' : ljzbsm;
if (this.form.zdymc == '') {
this.$message.warning("请完善表单后再继续操作");
this.$refs.zdymc.$el.style.border = '1px solid red';
} else {
//判断zdybsm是否为空,不为空的时候是编辑,为空的时候是新增
if (this.zdybsm == '') {
this.$refs[formName].validate((valid) => {
if (valid) {
// insertZdyInfo(this.form).then((res) => {
// if (res.code === 200) {
// this.$message.success("保存成功!")
// //更新树结构数据
// this.$parent.$parent.getLpbMenuTree(zrzbsm);
// //关闭弹框
// this.$parent.$parent.closeDaialog()
// }
// return true;
// })
} else {
console.log('error submit!!');
return false;
}
});
} else {
//编辑幢单元接口
updateQjZdy(this.form).then((res) => {
if (res.code === 200) {
this.$message.success("保存成功")
}
})
}
}
},
getZdyInfo (bsm) {
//查询幢单元信息接口
getQjZdyDetailById(bsm).then((res) => {
if (res.code === 200) {
this.form = res.result;
}
})
},
reset () {
this.form = {
zdyh: '',
zdymc: '',
dscs: '',
dxcs: '',
zcs: '',
bz: '',
}
}
},
watch: {
zdybsm: {
handler: function (item) {
if (item != '' && this.$parent.$parent.menuType == 'zdy') {
this.getZdyInfo(item)
}
},
immediate: true
},
"form.zdymc": {
handler: function (item) {
if (item != '') {
this.$refs.zdymc.$el.style.border = '';
}
},
immediate: true
},
}
}
</script>
<style scoped lang="scss">
/deep/.el-input__inner {
width: 100%;
border: 0;
}
table {
background: #fff;
table-layout: fixed;
}
</style>
\ No newline at end of file