master
xy 2 years ago
parent f568aad1ba
commit 5ccf6a63ae

@ -34,7 +34,7 @@ export default {
render: h("xy-table", {
ref: "houseTable",
props: {
list: this.originalForm?.id_houses_land_id_relation,
list: this.type === 'add' ? [] : this.originalForm?.id_houses_land_id_relation,
auths: [],
reqOpt: {
table_name: "houses",

@ -58,24 +58,20 @@
>{{ contentFormat(item)
}}{{ units.get(item.field) }}</el-descriptions-item
>
<el-descriptions-item :label="'关联'+(detail.hasOwnProperty('id_houses_land_id_relation') ? '房产' : '土地')">
<template v-if="/\/land/g.test($route.path)">
<div v-for="item in detail.id_houses_land_id_relation" style="display: flex;align-items: center;">
<span>{{ item.name }}</span>
<el-link style="margin-left: 10px;white-space: nowrap;" @click="$router.push(/houseDetail/+item.id)"></el-link>
</div>
</template>
<template v-if="/\/house/g.test($route.path)">
<div style="display: flex;align-items: center;">
<span>{{ (detail.land_id_lands_id_relation ? detail.land_id_lands_id_relation.name : '') }}</span>
<el-link style="margin-left: 10px;white-space: nowrap;" @click="$router.push('/landDetail/'+detail.land_id_lands_id_relation.id)"></el-link>
</div>
</template>
<!-- <div style="display: flex;align-items: center;">-->
<!-- <span>{{ detail.hasOwnProperty('id_houses_land_id_relation') ? (detail.id_houses_land_id_relation ? detail.id_houses_land_id_relation.name : '') : (detail.land_id_lands_id_relation ? detail.land_id_lands_id_relation.name : '') }}</span>-->
<!-- <el-link style="margin-left: 10px;white-space: nowrap;" @click="$router.push(detail.hasOwnProperty('id_houses_land_id_relation') ? (detail.id_houses_land_id_relation ? ('/houseDetail/'+detail.id_houses_land_id_relation.id) : '') : (detail.land_id_lands_id_relation ? ('/landDetail/'+detail.land_id_lands_id_relation.id) : ''))">查看</el-link>-->
<!-- </div>-->
</el-descriptions-item>
<!-- <el-descriptions-item :label="'关联'+(detail.hasOwnProperty('id_houses_land_id_relation') ? '房产' : '土地')">-->
<!-- <template v-if="/\/land/g.test($route.path)">-->
<!-- <div v-for="item in detail.id_houses_land_id_relation" style="display: flex;align-items: center;">-->
<!-- <span>{{ item.name }}</span>-->
<!-- <el-link style="margin-left: 10px;white-space: nowrap;" @click="$router.push(/houseDetail/+item.id)"></el-link>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-if="/\/house/g.test($route.path)">-->
<!-- <div style="display: flex;align-items: center;">-->
<!-- <span>{{ (detail.land_id_lands_id_relation ? detail.land_id_lands_id_relation.name : '') }}</span>-->
<!-- <el-link style="margin-left: 10px;white-space: nowrap;" @click="$router.push('/landDetail/'+detail.land_id_lands_id_relation.id)"></el-link>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-descriptions-item>-->
</el-descriptions>
</el-card>
@ -114,6 +110,38 @@
<!-- </template>-->
<!-- </template>-->
<!-- </el-card>-->
<el-card id="detail-link-land" v-if="/\/house/g.test($route.path)">
<div class="el-descriptions__header el-descriptions__title">
<p>关联土地</p>
<div v-if="detail.land_id_lands_id_relation" style="font-size: 14px;" @click="(detail.land_id_lands_id_relation && detail.land_id_lands_id_relation.id) ? $router.push('/landDetail/'+detail.land_id_lands_id_relation.id) : ''">
<span>查看</span>
<i class="el-icon-d-arrow-right"></i>
</div>
</div>
<el-descriptions
v-if="detail.land_id_lands_id_relation"
border
size="small"
:column="2"
:label-style="{ 'font-weight': '600' }"
>
<el-descriptions-item
v-for="item in landFields"
:label="item.label"
>{{ detail.land_id_lands_id_relation ? detail.land_id_lands_id_relation[item.prop] : "" }}{{ units.get(item.prop) }}</el-descriptions-item
>
</el-descriptions>
<el-empty v-else description="暂无关联土地"></el-empty>
</el-card>
<el-card id="detail-link-houses" v-if="/\/land/g.test($route.path)">
<div class="el-descriptions__header el-descriptions__title">
关联房产
</div>
<xy-table :is-page="false" :height="300" :list="detail.id_houses_land_id_relation" :table-item="houseTable" style="margin-top: 20px" size="mini" :auths="[]" ></xy-table>
</el-card>
<el-card id="detail-histories">
<div class="el-descriptions__header el-descriptions__title">
历史沿革
@ -267,6 +295,8 @@
detail.id_assets_atlas_files_land_id_relation.length > 0)
" />
<AnchorLink href="#detail-info" title="基本信息" />
<AnchorLink href="#detail-link-land" title="关联土地" v-if="/\/house/g.test($route.path)"/>
<AnchorLink href="#detail-link-houses" title="关联房产" v-if="/\/land/g.test($route.path)"/>
<!-- <AnchorLink href="#detail-documents" title="证件图片" />-->
<AnchorLink href="#detail-histories" title="历史沿革" />
<AnchorLink href="#detail-assetsMap" title="资产地图" />
@ -394,6 +424,240 @@ export default {
["muqianjunjia", "元"],
]),
landFields: [
{
"prop": "tudiquanshuren",
"label": "土地权属人",
"width": 0,
"align": "left"
},
{
"prop": "name",
"label": "地块名称",
"width": 0,
"align": "left",
"fixed": "left"
},
{
"prop": "tudizhenghao",
"label": "土地证号",
"width": 0,
"align": "left"
},
{
"prop": "zuoluo",
"label": "坐落",
"width": 0,
"align": "left"
},
{
"prop": "zichanweizhi",
"label": "资产位置",
"width": 0,
"align": "center"
},
{
"prop": "quanliren",
"label": "证载“权利人”",
"width": 0,
"align": "left"
},
{
"prop": "gongyouqingkuang",
"label": "共有情况",
"width": 0,
"align": "center"
},
{
"prop": "shiyongnianxian",
"label": "使用年限(年)",
"width": 0,
"align": "center"
},
{
"prop": "xianzhuang",
"label": "现状",
"width": 0,
"align": "center"
},
{
"prop": "yongtu",
"label": "用途",
"width": 0,
"align": "left"
},
{
"prop": "shiyongquanleixing",
"label": "使用权类型",
"width": 0,
"align": "center"
},
{
"prop": "lingzhengriqi",
"label": "领证日期",
"width": 0,
"align": "center"
},
{
"prop": "zhongzhiriqi",
"label": "终止日期",
"width": 0,
"align": "center"
},
{
"prop": "dengjimianji",
"label": "登记面积",
"width": 0,
"align": "center"
},
{
"prop": "shijimianji",
"label": "实际面积",
"width": 0,
"align": "center"
},
{
"prop": "ruzhangshijian",
"label": "入账时间",
"width": 0,
"align": "center"
},
{
"prop": "zhangmianyuanzhi",
"label": "账面原值",
"width": 0,
"align": "center"
},
{
"prop": "tudidengji",
"label": "土地等级",
"width": 0,
"align": "center"
},
{
"prop": "tudishuidanjia",
"label": "土地税单价",
"width": 0,
"align": "center"
},
{
"prop": "tudishui",
"label": "土地税",
"width": 0,
"align": "center"
},
{
"prop": "tudishuijiaonazhuti",
"label": "土地税缴纳主体",
"width": 0,
"align": "center"
},
{
"prop": "jiaoshuijine",
"label": "缴税金额",
"width": 0,
"align": "center"
}
],
houseTable: [
{
"prop": "quanshuren",
"label": "权属人",
"width": 0,
"align": "center"
},
{
"prop": "name",
"label": "地块名称",
"width": 0,
"fixed": "left",
"align": "left"
},
{
"prop": "quanzhenghao",
"label": "权证号",
"width": 0,
"align": "center"
},
{
"prop": "zuoluo",
"label": "坐落",
"width": 0,
"align": "left"
},
{
"prop": "zichanweizhi",
"label": "房产位置",
"width": 0,
"align": "center"
},
{
"prop": "quanliren",
"label": "证载“权利人”",
"width": 0,
"align": "center"
},
{
"prop": "yongtu",
"label": "用途",
"width": 0,
"align": "left"
},
{
"prop": "zhuangtai",
"label": "现状",
"width": 0,
"align": "left"
},
{
"prop": "dengjishijian",
"label": "登记时间",
"width": 0,
"align": "center"
},
{
"prop": "dengjimianji",
"label": "登记面积",
"width": 0,
"align": "center"
},
{
"prop": "shijimianji",
"label": "实际面积",
"width": 0,
"align": "center"
},
{
"prop": "ruzhangshijian",
"label": "入账时间",
"width": 0,
"align": "center"
},
{
"prop": "zhangmianyuanzhi",
"label": "账面原值",
"width": 0,
"align": "center"
},
{
"prop": "shiyongzhuangtai",
"label": "使用状态",
"width": 0,
"align": "center"
},
{
prop: "operate",
label: "查看",
align: 'center',
customFn: row => (
<div>
<Button type="primary"
size="small"
on={{['click']:_ => this.$router.push(/houseDetail/+row.id)}}>查看</Button>
</div>
)
}
],
inspectionTable: [
{
fixed: 'left',

@ -18,6 +18,13 @@ export default {
key: "name",
title: "资产名称"
},
{
key: "land_id",
title: "资产类型",
render: (h,{ row }) => {
return h('span',row.hasOwnProperty("land_id") ? "房产" : "土地")
}
},
{
key: "dengjimianji",
title: "登记面积"

@ -57,48 +57,14 @@ export default {
</div>
</div>
<xy-table list={
this.distinct([
...this.selectedLands,
...this.selectedHouses,
...(() => {
let temp = [];
this.originalForm?.id_lets_to_assets_let_id_relation?.forEach(item => {
if (item.land_id) {
let land = this.originalForm.land?.find(land => land.id === item.land_id);
if (land) {
temp.push({
id: land.id,
name: land.name,
zuoluo: land.zuoluo,
zichanweizhi: land.zichanweizhi,
dengjimianji: land.dengjimianji,
_chuzumianji: item.chuzumianji,
_relation_id: item.id,
_TAG_: "land"
});
}
} else {
let house = this.originalForm.house?.find(house => house.id === item.house_id);
if (house) {
temp.push({
id: house.id,
name: house.name,
zuoluo: house.zuoluo,
zichanweizhi: house.zichanweizhi,
dengjimianji: house.dengjimianji,
_chuzumianji: item.chuzumianji,
_relation_id: item.id,
_TAG_: "house"
});
}
}
})
return temp;
})()
])
}
<xy-table
row-key={
row => {
row._relation_id ? row._relation_id : (row.hasOwnProperty('land_id') ? 'house_' + row.id : 'land_' + row.id)
}
}
ref="assetsTable"
list={this.nowAssets}
height="300"
isHandlerKey={false}
is-page={false}
@ -153,19 +119,19 @@ export default {
['click']: _ => {
this.$confirm("确定删除?").then(_ => {
if (row.hasOwnProperty("land_id")) {
this.$refs["houseLinkTable"]?.toggleRowSelection(row,false)
++this.houseSelectTemp;
this.$refs["houseLinkTable"]?.toggleRowSelection(
this.$refs["houseLinkTable"].getListData().find(i => i.id === row.id)
,false)
} else {
this.$refs["landLinkTable"]?.toggleRowSelection(row,false)
++this.landSelectTemp;
this.$refs["landLinkTable"]?.toggleRowSelection(
this.$refs["landLinkTable"].getListData().find(i => i.id === row.id)
,false)
}
if (row._relation_id) {
destroy({ table_name: "lets_to_assets", id: row._relation_id },false).then(_ => {
let index = this.originalForm.id_lets_to_assets_let_id_relation?.findIndex(item => item.id === row._relation_id);
this.originalForm.id_lets_to_assets_let_id_relation?.splice(index, 1);
++this.landSelectTemp;
++this.houseSelectTemp;
this.nowAssets.splice(this.nowAssets.findIndex(j => j._relation_id === row._relation_id),1)
})
}
})
@ -375,13 +341,33 @@ export default {
on={{
['loaded']: _ => {
this.$nextTick(() => {
this.$refs['landLinkTable'].getListData()?.filter(item => this.originalForm.id_lets_to_assets_let_id_relation?.find(j => j.land_id === item.id))?.forEach(item => {
this.$refs['landLinkTable'].getListData()?.filter(item => this.nowAssets?.find(j => j.id === item.id && !j.hasOwnProperty('land_id')))?.forEach(item => {
this.$refs['landLinkTable'].toggleRowSelection(item, true)
})
++this.landSelectTemp;
})
},
['select']: _ => ++this.landSelectTemp
['select']: (selection, row) => {
if (selection.find(i => i.id === row.id)) {
this.nowAssets.push({
id: row.id,
name: row.name,
zuoluo: row.zuoluo,
zichanweizhi: row.zichanweizhi,
dengjimianji: row.dengjimianji,
_chuzumianji: 0,
_relation_id: "",
})
} else {
let index = this.nowAssets.findIndex(i => i.id === row.id && !i.hasOwnProperty('land_id') )
let temp = this.nowAssets.splice(index, 1)
if (temp._relation_id) {
destroy({
table_name: "lets_to_assets",
id: temp._relation_id
},false)
}
}
}
}}
></xy-table>
</div>
@ -532,13 +518,34 @@ export default {
on={{
['loaded']: _ => {
this.$nextTick(() => {
this.$refs['houseLinkTable'].getListData()?.filter(item => this.originalForm.id_lets_to_assets_let_id_relation?.find(j => j.house_id === item.id))?.forEach(item => {
this.$refs['houseLinkTable'].getListData()?.filter(item => this.nowAssets?.find(j => j.id === item.id && j.hasOwnProperty('land_id')))?.forEach(item => {
this.$refs['houseLinkTable'].toggleRowSelection(item, true)
})
++this.houseSelectTemp;
})
},
['select']: _ => ++this.houseSelectTemp
['select']: (selection, row) => {
if (selection.find(i => i.id === row.id)) {
this.nowAssets.push({
id: row.id,
name: row.name,
zuoluo: row.zuoluo,
zichanweizhi: row.zichanweizhi,
dengjimianji: row.dengjimianji,
_chuzumianji: 0,
_relation_id: "",
land_id: row.land_id
})
} else {
let index = this.nowAssets.findIndex(i => i.id === row.id && i.hasOwnProperty('land_id') )
let temp = this.nowAssets.splice(index, 1)
if (temp._relation_id) {
destroy({
table_name: "lets_to_assets",
id: temp._relation_id
},false)
}
}
}
}}
></xy-table>
</div>
@ -549,10 +556,9 @@ export default {
},
data() {
return {
nowAssets: [],
houseDialog: false,
houseSelectTemp: 0,
landDialog: false,
landSelectTemp: 0,
leasePlans: [],
landSelect: {
table_name: "lands",
@ -575,21 +581,6 @@ export default {
};
},
methods: {
distinct (arr, key="id") {
let newobj = {};
arr = arr.reduce((preVal, curVal) => {
if (!newobj[curVal[key]]) {
newobj[curVal[key]] = preVal.push(curVal)
} else {
let findVal = preVal.find(item => item[key] === curVal[key]);
findVal._chuzumianji = newobj[curVal[key]]["_chuzumianji"] || curVal["_chuzumianji"];
findVal._chuzumianji = newobj[curVal[key]]["_relation_id"] || curVal["_relation_id"];
findVal._TAG_ = newobj[curVal[key]]["_TAG_"] || curVal["_TAG_"];
}
return preVal
}, []);
return arr;
},
index,
setRow (row) {
this.row = row
@ -634,6 +625,36 @@ export default {
});
this.form = Object.assign({}, this.form);
this.originalForm = deepCopy(res);
this.originalForm?.lets_to_assets?.forEach(item => {
if (item.land_id) {
let land = item.lands;
if (land) {
this.nowAssets.push({
id: land.id,
name: land.name,
zuoluo: land.zuoluo,
zichanweizhi: land.zichanweizhi,
dengjimianji: land.dengjimianji,
_chuzumianji: item.chuzumianji||0,
_relation_id: item.id,
});
}
} else {
let house = item.house;
if (house) {
this.nowAssets.push({
id: house.id,
name: house.name,
zuoluo: house.zuoluo,
zichanweizhi: house.zichanweizhi,
dengjimianji: house.dengjimianji,
_chuzumianji: item.chuzumianji||0,
_relation_id: item.id,
land_id: house.land_id,
});
}
}
})
},
submit() {
@ -651,7 +672,6 @@ export default {
});
}
this.form.let_id = this.$route.params.letId;
// this.form.id_leases_to_assets_lease_id_relation = [];
// this.selectedHouses?.forEach(i => {
// this.form.id_leases_to_assets_lease_id_relation.push({
@ -669,48 +689,14 @@ export default {
// })
// this.form.id_lease_plans_lease_id_relation = this.leasePlans;
save(Object.assign(this.form, { table_name: 'lets' })).then(res => {
let leaseToAssetsData = this.distinct([
...this.selectedLands.map(i => ({...i,_TAG_: "land"})),
...this.selectedHouses.map(i => ({...i,_TAG_: "house"})),
...(() => {
let temp = [];
this.originalForm?.id_lets_to_assets_let_id_relation?.forEach(item => {
if (item.land_id) {
let land = this.originalForm.land?.find(land => land.id === item.land_id);
if (land) {
temp.push({
id: land.id,
name: land.name,
zuoluo: land.zuoluo,
zichanweizhi: land.zichanweizhi,
dengjimianji: land.dengjimianji,
_chuzumianji: item.chuzumianji,
_relation_id: item.id,
_TAG_: "land"
});
}
} else {
let house = this.originalForm.house?.find(house => house.id === item.house_id);
if (house) {
temp.push({
id: house.id,
name: house.name,
zuoluo: house.zuoluo,
zichanweizhi: house.zichanweizhi,
dengjimianji: house.dengjimianji,
_chuzumianji: item.chuzumianji,
_relation_id: item.id,
_TAG_: "house"
});
}
}
})
return temp;
})()
]).map(item => ({
Promise.all(this.originalForm.id_lets_to_assets_let_id_relation.map(i => destroy({
id: i.id,
table_name: "lets_to_assets"
},false)))
let leaseToAssetsData = this.nowAssets.map(item => ({
id: item._relation_id,
land_id: item._TAG_ === "land" ? item.id : "",
house_id: item._TAG_ === "house"? item.id : "",
land_id: !item.hasOwnProperty("land_id") ? item.id : "",
house_id: item.hasOwnProperty("land_id") ? item.id : "",
chuzumianji: item._chuzumianji,
let_id: res.id
}));
@ -729,14 +715,7 @@ export default {
},
},
computed: {
selectedLands () {
let temp = this.landSelectTemp;
return this.$refs['landLinkTable']?.getSelection() || [];
},
selectedHouses () {
let temp = this.houseSelectTemp;
return this.$refs['houseLinkTable']?.getSelection() || [];
},
},
watch: {
formInfo: {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save