e7e27a75 by 杨威

楼盘表添加层户功能

1 parent ddb49435
......@@ -84,23 +84,11 @@ const constantRoutes = [
component: () => import("@/views/systemZD/index"),
},
{
path: "/ljz",
name: "逻辑幢",
code: "1-6",
component: () => import("@/views/systemZRZ/ljz/index"),
},
{
path: "/c",
name: "层",
code: "1-7",
component: () => import("@/views/systemZRZ/c/index"),
},
{
path: "/zdy",
name: "幢单元",
code: "1-8",
component: () => import("@/views/systemZRZ/lpb/zdy/index"),
},
],
},
];
......
<template>
<div class="addCh">
<el-table
class="addChTable"
:data="tableData"
style="width: 100%"
border
>
<el-table-column prop="cz" width="40" align="center">
<template slot-scope="scope">
<span class="cp" @click="handleRowClick(scope.row,scope.$index)">{{scope.row.cz}}</span>
</template>
</el-table-column>
<el-table-column prop="ljzbsm" label="逻辑幢" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.ljzbsm"></el-input>
</template>
</el-table-column>
<el-table-column prop="zdybsm" label="幢单元" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.zdybsm"></el-input>
</template>
</el-table-column>
<el-table-column prop="qsc" label="起始层" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.qsc"></el-input>
</template>
</el-table-column>
<el-table-column prop="jsc" label="结束层" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.jsc"></el-input>
</template>
</el-table-column>
<el-table-column prop="mchs" label="每层户数" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.mchs"></el-input>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
name:"",
components:{},
props:{},
data(){
return {
tableData:[
],
formData:{
cz:'+',
ljzbsm:'',
zdybsm:'',
qsc:'',
jsc:'',
mchs:'',
}
}
},
created(){
this.tableData.push(this.formData)
},
mounted(){},
methods:{
//行操作
handleRowClick(row,index){
console.log(index);
if(row.cz =='+'){
let temp = JSON.parse(JSON.stringify(this.formData));
temp.cz = '-';
this.tableData.push(temp);
}else{
this.tableData.splice(index, 1)
}
},
//重置数据
reset(){
this.tableData = [
{
cz:'+',
ljzbsm:'',
zdybsm:'',
qsc:'',
jsc:'',
mchs:'',
}
]
}
},
computed: {},
watch: {},
}
</script>
<style lang="less">
.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;
}
}
</style>
\ No newline at end of file
......@@ -70,10 +70,10 @@
<addLjz ref="ljz"></addLjz>
</div>
<div class="addCh" v-show="menuType == 'zdy'">
幢单元
<addZdy ref="zdy"></addZdy>
</div>
<div class="addCh" v-show="menuType == 'ch'">
层户
<addCh ref="ch"></addCh>
</div>
<div class="btnGroup">
<el-button type="primary" @click="saveInfo">保存</el-button>
......@@ -86,11 +86,13 @@
<script>
import LineTree from "../../../../components/lineTree/lineTree";
import addLjz from "../../ljz/index"
import addLjz from "./ljz/index"
import addZdy from "./zdy/index"
import addCh from "./ch/index"
import {getLpbMenuTree} from "../../../../api/lpb"
export default {
name:"",
components:{LineTree,addLjz},
components:{LineTree,addLjz,addZdy,addCh},
props:{},
data(){
return {
......@@ -202,12 +204,13 @@ export default {
},
//弹框中的保存按钮
saveInfo(){
debugger
switch (this.menuType) {
case 'ljz':
this.$refs.ljz.onSave(this.$refs.ljz.form,this.treeData.bsm)
break;
case 'zdy':
this.$refs.zdy.submitForm('form',this.pd[0].bsm,this.treeData.bsm)
break;
case 'ch':
......@@ -224,10 +227,10 @@ export default {
this.$refs.ljz.reset()
break;
case 'zdy':
this.$refs.zdy.reset()
break;
case 'ch':
this.$refs.ch.reset()
break;
default:
......
......@@ -161,8 +161,8 @@
</template>
<script>
import {insertLjzInfo} from "../../../api/zrz";
import {formdate} from "../../../libs/function";
import {insertLjzInfo} from "../../../../../api/zrz";
import {formdate} from "../../../../../libs/function";
export default {
name:'ljz',
components:{},
......
......@@ -39,25 +39,16 @@
</tr>
</tbody>
</table>
<el-row :gutter="24">
<el-col :span="24">
<el-button type="primary" @click="submitForm('form')">立即创建</el-button>
</el-col>
</el-row>
</el-form>
</div>
</template>
<script>
import {insertZdyInfo} from "../../../../api/lpb"
import {insertZdyInfo} from "../../../../../api/lpb"
export default {
name: "index",
components: {},
data(){
return{
form:{
......@@ -112,6 +103,16 @@
}
});
},
reset(){
this.form = {
zdyh:'',
zdymc:'',
dscs:'',
dxcs:'',
zcs:'',
bz:'',
}
}
}
}
</script>
......