aa47701f by weimo934

Merge remote-tracking branch 'origin/master'

2 parents 3b430fe8 82f389eb
......@@ -75,3 +75,25 @@ export function ZdfggetZxx(zdbsm) {
}
})
}
/**
* 多幢分割获取自然幢信息
*/
export function dzfgGetZrzxx(dzbsm) {
return request({
url:"/bg/dzSplitMerge/fgSelectZrz",
method:'get',
params:{
dzbsm
}
})
}
/**
* 多幢分割保存
*/
export function saveDzFg(data) {
return request({
url: '/bg/dzSplitMerge/dzFg',
method: 'post',
data: data,
})
}
......
......@@ -154,16 +154,16 @@
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="多幢" name="dz">
<ul>
<li :class="[zdFghData.newZdlist[index].dz.indexOf(childItem) > -1 ? 'choosed':'',(zdDzList[childIndex].hasChoosed === index || zdDzList[childIndex].hasChoosed === '' )? '':'cantClick']"
@click="dzHandleCommand(childItem,childItem.bsm,index,childIndex)" v-for="(childItem,childIndex) in zdDzList" :key="childItem.bsm+childIndex">
<li :class="[zdFghData.newZdlist[index].dz.indexOf(childItem) > -1 ? 'choosed':'',(childItem.hasChoosed === index || childItem.hasChoosed === '' )? '':'cantClick']"
@click="dzHandleCommand(childItem,childItem.bsm,index,childIndex)" v-for="(childItem,childIndex) in zdDzList" :key="childIndex*Math.random()">
{{childItem.xmmc}}<i class="fa fa-check" style="color:'#4EB2FF'"></i>
</li>
</ul>
</el-tab-pane>
<el-tab-pane label="自然幢" name="zrz">
<ul>
<li :class="[zdFghData.newZdlist[index].zrz.indexOf(childItem) > -1 ? 'choosed':'',(zdZrzList[childIndex].hasChoosed === index || zdZrzList[childIndex].hasChoosed === '' )? '':'cantClick']"
@click="zrzHandleCommand(childItem,childItem.bsm,index,childIndex)" v-for="(childItem,childIndex) in zdZrzList" :key="childItem.bsm+childIndex">
<li :class="[zdFghData.newZdlist[index].zrz.indexOf(childItem) > -1 ? 'choosed':'',(childItem.hasChoosed === index || childItem.hasChoosed === '' )? '':'cantClick']"
@click="zrzHandleCommand(childItem,childItem.bsm,index,childIndex)" v-for="(childItem,childIndex) in zdZrzList" :key="childIndex*Math.random()">
{{childItem.xmmc}} <i class="fa fa-check" style="color:'#4EB2FF'"></i>
</li>
</ul>
......@@ -209,35 +209,16 @@
<div class="zxx">
<el-card class="zrz">
<div slot="header" class="clearfix">
<span><i class="iconfont iconziranchuang"></i>自然幢<span style="color:red">{{zdZxx.zrzList.length}}</span></span>
<span><i class="iconfont iconziranchuang"></i>自然幢<span style="color:red">{{dzFgqZrzData.length}}</span></span>
</div>
<ul>
<li v-for="(item,index) in zdZxx.zrzList" :key="index+item.xmmc"
<li v-for="(item,index) in dzFgqZrzData" :key="index+item.xmmc"
:class="tempBsmList.indexOf(item.bsm) > -1 ? 'hasChoosed':''"
>
<i class="iconfont iconziranchuang"></i> {{item.displays}}
<i class="iconfont iconziranchuang"></i> {{item.xmmc}}
</li>
</ul>
</el-card>
<!-- <div class="dz">
<div class="title">
<span>多幢信息({{zdZxx.zrzList.length}}个)</span>
</div>
<ul>
<li v-for="(item,index) in zdZxx.zrzList" :key="index">{{item.xmmc}}</li>
</ul>
</div>
<div class="zrz">
<div class="title">
<span class="">自然幢信息({{zdZxx.dzList.length}}个)</span>
</div>
<ul>
<li v-for="(item,index) in zdZxx.dzList" :key="index"
:class="(index+1)%2==0?'':'oddborder'">{{item.xmmc}}
</li>
</ul>
</div> -->
</div>
</div>
<div class="fgh">
......@@ -252,14 +233,11 @@
>+
</el-button>
</th>
<th class="xzq">行政区</th>
<th class="djq">地籍区</th>
<th class="djzq">地籍子区</th>
<th class="syqlx">所有权类型</th>
<th class="tdtzm">土地特征码</th>
<th class="xmmc">项目名称</th>
<th class="xzq">幢类型</th>
<th class="xmmc" width="300px">项目名称</th>
<th class="xmmc">幢信息</th>
</tr>
<tr v-for="(item,index) in dzFghData.newZdlist" :key="index">
<tr v-for="(item,index) in dzFghData.fwlist" :key="index*Math.random()">
<td class="cz">
<el-button
type="primary"
......@@ -270,49 +248,9 @@
>
</td>
<td class="xzq">
<el-select v-model="item.xzqbsm" @change="changeXzq(item.xzqbsm,index)">
<el-option
v-for="i in xzq"
:key="i.bsm"
:label="i.mc"
:value="i.bsm"
></el-option>
</el-select>
</td>
<td class="djq">
<el-select v-model="item.djqbsm" @change="changeDjq(item.djqbsm,index)">
<el-option
v-for="i in djq"
:key="i.bsm"
:label="i.mc"
:value="i.bsm"
></el-option>
</el-select>
</td>
<td class="syqlx">
<el-select v-model="item.djzqbsm">
<el-select v-model="item.ztype" @change="changeXzq(item.xzqbsm,index)">
<el-option
v-for="i in djzq"
:key="i.bsm"
:label="i.mc"
:value="i.bsm"
></el-option>
</el-select>
</td>
<td class="tdtzm">
<el-select v-model="item.syqlxbsm">
<el-option
v-for="i in syq"
:key="i.value"
:label="i.label"
:value="i.value"
></el-option>
</el-select>
</td>
<td class="syqlx">
<el-select v-model="item.zdtzmbsm">
<el-option
v-for="i in tdtzm"
v-for="i in zlx"
:key="i.bsm"
:label="i.mc"
:value="i.bsm"
......@@ -322,6 +260,36 @@
<td class="xmmc">
<input type="text" v-model="item.xmmc" class="formInput"/>
</td>
<td class="zxx">
<div class="fghzxx">
<div class="choosedZxx">
<span v-for="(dzItem,dzIndex) in item.zrzmclist" :key="dzIndex*Math.random()" class="zxx">
{{dzItem}}
<i class="fa fa-times" @click="delZxx(dzItem,index,dzIndex,'dz')"></i>
</span>
</div>
<p class="choose">
<el-popover
placement="top-end"
width="300"
popper-class="popper-zxx"
style="padding:0 12px"
trigger="click">
<ul>
<!-- <li :class="[zdFghData.newZdlist[index].dz.indexOf(childItem) > -1 ? 'choosed':'',(zdDzList[childIndex].hasChoosed === index || zdDzList[childIndex].hasChoosed === '' )? '':'cantClick']"
@click="zrzHandleCommand(childItem,childItem.bsm,index,childIndex)" -->
<li :class="[dzFghData.fwlist[index].zrzlist.indexOf(childItem.bsm) > -1 ? 'choosed':'',(childItem.hasChoosed === index || childItem.hasChoosed === '' )? '':'cantClick']"
v-for="(childItem,childIndex) in dzFgZrzList" :key="childIndex*Math.random()"
@click="zrzHandleCommand(childItem,childItem.bsm,index,childIndex)"
>
{{childItem.xmmc}}<i class="fa fa-check" style="color:'#4EB2FF'"></i>
</li>
</ul>
<span slot="reference">选择</span>
</el-popover>
</p>
</div>
</td>
</tr>
</table>
</div>
......@@ -483,7 +451,7 @@
getDdicByMC
} from "./../../../../api/common";
import {getQjZdjbxxDetailById, zdfg, getZrz} from './../../../../api/zd'
import {getZdxx, ZdfggetZxx} from './../../../../api/dz'
import {getZdxx, ZdfggetZxx,dzfgGetZrzxx,saveDzFg} from './../../../../api/dz'
import {getHZdxx} from './../../../../api/h'
import QueryData from './../../../../components/queryData/queryData'
import zdQueryData from './../../../../components/zdQueryData/zdQueryData'
......@@ -544,8 +512,8 @@
newZdlist: []
},
dzFghData: {
oldZdbsm: "",
newZdlist: []
olddzbsm: "",
fwlist: []
},
hFghData: {
oldZdbsm: "",
......@@ -554,7 +522,19 @@
fgBoxWidth: 0,
tableHeight:0,
activeName:'dz',
tempBsmList:[]
tempBsmList:[],
dzFgqZrzData:[], //多幢分割前自然幢数据
zlx:[
{
bsm:'dz',
mc:'多幢'
},
{
bsm:'zrz',
mc:'自然幢'
}
],
dzFgZrzList:[] //多幢分割前供分割选择的自然幢数据
}
},
created() {
......@@ -569,28 +549,23 @@
},
methods: {
delZxx(item,index, chilInd,type) {
let dz={};
let len=this.zdFghData.newZdlist[index].fwlist.length-1;
this.tempBsmList = this.tempBsmList.filter(i => i!== item.bsm);
switch (type) {
case "dz":
dz = this.zdFghData.newZdlist[index].dz[chilInd];
// 删除数据
this.zdFghData.newZdlist[index].dz.splice(chilInd, 1);
for (let i=0;i<len;i++){
let fw=this.zdFghData.newZdlist[index].fwlist[i];
if (fw.ztype=='dz'&& fw.zbsm == dz.bsm){
this.zdFghData.newZdlist[index].fwlist.splice(i, 1);
}
}
this.zdDzList.forEach(i=>{
if (i.bsm == item.bsm) {
let bsm = this.dzFghData.fwlist[index].zrzlist[chilInd];
this.dzFghData.fwlist[index].zrzmclist.splice(chilInd,1);
this.dzFghData.fwlist[index].zrzlist.splice(chilInd,1);
this.tempBsmList = this.tempBsmList.filter(i => i!== bsm);
this.dzFgqZrzData.forEach(i=>{
if (i.bsm == bsm) {
i.hasChoosed = ""
}
})
break;
case "zrz":
dz = this.zdFghData.newZdlist[index].zrz[chilInd];
let len=this.zdFghData.newZdlist[index].fwlist.length-1;
this.tempBsmList = this.tempBsmList.filter(i => i!== item.bsm);
// 删除数据
this.zdFghData.newZdlist[index].zrz.splice(chilInd, 1);
for (let i=0;i<len;i++){
......@@ -620,8 +595,8 @@
break
case "dz":
this.dzFghData = {
oldZdbsm: "",
newZdlist: []
olddzbsm: "",
fwlist: []
}
break
case "h":
......@@ -646,7 +621,9 @@
ztype: 'zrz'
})
},
dzHandleCommand(obj,bsm, index,childIndex) {
//判断选中状态
if(this.zdDzList[childIndex].hasChoosed === '' || this.zdDzList[childIndex].hasChoosed === index){
this.zdDzList[childIndex].hasChoosed = index;
if(this.zdFghData.newZdlist[index].dz.indexOf(obj) < 0){
......@@ -666,6 +643,8 @@
}
},
zrzHandleCommand(obj,bsm, index,childIndex) {
switch (this.tabName) {
case 'zd':
if(this.zdZrzList[childIndex].hasChoosed === '' || this.zdZrzList[childIndex].hasChoosed === index){
this.zdZrzList[childIndex].hasChoosed = index;
if(this.zdFghData.newZdlist[index].zrz.indexOf(obj) < 0){
......@@ -683,7 +662,36 @@
}else{
return
}
case 'dz':
let fwlist = this.dzFghData.fwlist[index];
if(this.dzFgZrzList[childIndex].hasChoosed === '' || this.dzFgZrzList[childIndex].hasChoosed === index){
// this.zdZrzList[childIndex].hasChoosed = index;
if(fwlist.zrzlist.indexOf(bsm) < 0){
if(fwlist.ztype == 'zrz' && fwlist.zrzlist.length>0){
Message.warning("当前幢类型只能选择一个自然幢")
}else{
//存入当前选择幢信息的bsm
fwlist.zrzlist.push(bsm)
fwlist.zrzmclist.push(obj.xmmc)
this.tempBsmList.push(bsm);
this.dzFgZrzList[childIndex].hasChoosed = index;
}
}else{
fwlist.zrzlist = fwlist.zrzlist.filter(i => i !== bsm);
fwlist.zrzmclist = fwlist.zrzmclist.filter(i => i !== obj.xmmc);
this.tempBsmList = this.tempBsmList.filter(i => i!== bsm);
this.dzFgZrzList[childIndex].hasChoosed = '';
}
}else{
return
}
break;
default:
break;
}
},
//宗地分割前获取幢信息
ZdgetDzXx(zdbsm) {
ZdfggetZxx(zdbsm).then(res => {
if (res.success) {
......@@ -700,6 +708,18 @@
}
})
},
//多幢分割前获取自然幢信息
dzfgGetZrzxx(dzbsm){
dzfgGetZrzxx(dzbsm).then(res => {
if (res.success) {
console.log(res.result,'res.result');
res.result.forEach(item=>{
item.hasChoosed = ''
})
this.dzFgqZrzData = res.result;
}
})
},
handleNodeClick(node) {
this.zdFghData.newZdlist[this.selectIndex].fwlist.push({
zbsm: node.label,
......@@ -744,7 +764,15 @@
}
},
saveDz() {
console.log(this.dzFghData,'dzFghData');
saveDzFg(this.dzFghData).then(res => {
if (res.success) {
Message.success("保存成功")
//TO DO 多幢分割完成后的操作
} else {
Message.error("保存失败")
}
})
},
saveH() {
......@@ -804,10 +832,19 @@
case "zd":
this.zdFghData.newZdlist[index].djqbsm = '';
this.zdFghData.newZdlist[index].djzqbsm = '';
getListByXzqbsm(id)
.then((res) => {
if (res.result == null) {
this.djq = null;
} else {
this.djq = res.result;
}
})
.catch((error) => {
});
break;
case "dz":
this.dzFghData.newZdlist[index].djqbsm = '';
this.dzFghData.newZdlist[index].djzqbsm = '';
//to do
break;
case "h":
this.hFghData.newZdlist[index].djqbsm = '';
......@@ -816,18 +853,7 @@
default:
break;
}
}
getListByXzqbsm(id)
.then((res) => {
if (res.result == null) {
this.djq = null;
} else {
this.djq = res.result;
}
})
.catch((error) => {
});
},
changeDjq(item, index) {
this.djzq = [];
......@@ -866,19 +892,16 @@
this.$set(this.zdFghData.newZdlist, this.zdFghData.newZdlist.length - 1, JSON.parse(JSON.stringify(this.checkedData)))
break
case 'dz':
this.dzFghData.newZdlist.push({
xzqbsm: "",
djqbsm: "",
djzqbsm: "",
xmmc: "",
syqlxbsm: "",
zdtzmbsm: "",
userbsm: "",
fwlist: []
});
this.changeXzq(this.checkedData.xzqbsm)
this.changeDjq(this.checkedData.djqbsm)
this.$set(this.dzFghData.newZdlist, this.dzFghData.newZdlist.length - 1, JSON.parse(JSON.stringify(this.checkedData)))
this.dzFghData.fwlist.push(
{
"xmmc": this.dzFgqData.xmmc,
"zrzlist": [],
"zrzmclist": [],
"ztype": "zrz"
}
);
this.dzFghData.olddzbsm = this.dzFgqData.bsm;
this.dzFgZrzList = this.dzFgqZrzData;
break
case 'h':
this.hFghData.newZdlist.push({
......@@ -905,7 +928,7 @@
this.zdFghData.newZdlist.splice(index, 1);
break;
case "dz":
this.dzFghData.newZdlist.splice(index, 1);
this.dzFghData.fwlist.splice(index, 1);
break;
case "h":
this.hFghData.newZdlist.splice(index, 1);
......@@ -935,7 +958,7 @@
default:
break
}
console.log(this.dzFgqData,'this.dzFgqData');
},
},
computed: {},
......@@ -952,6 +975,7 @@
handler: function (item) {
this.dzFgqData.oldZdbsm = item.glbsm;
this.getDzZdjbxx(item.glbsm);
this.dzfgGetZrzxx(item.glbsm)
},
deep: true
},
......@@ -968,6 +992,9 @@
this.changeDjq(item.djqbsm)
},
deep: true
},
tabName(){
this.tempBsmList = [];
}
}
}
......