From 5ccf6a63aee6245dd5f75dcb70eefca8e35ab686 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Wed, 17 Jul 2024 17:40:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/component/addLand.vue | 2 +- src/views/assets/detail.vue | 300 ++++- src/views/dataShow/tooltip.vue | 7 + src/views/lease/component/addLet.vue | 225 ++-- src/views/lease/sign.vue | 1534 +++++++++++++----------- 5 files changed, 1198 insertions(+), 870 deletions(-) diff --git a/src/views/assets/component/addLand.vue b/src/views/assets/component/addLand.vue index dbcafe0..6396610 100644 --- a/src/views/assets/component/addLand.vue +++ b/src/views/assets/component/addLand.vue @@ -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", diff --git a/src/views/assets/detail.vue b/src/views/assets/detail.vue index 284c767..3098ae6 100644 --- a/src/views/assets/detail.vue +++ b/src/views/assets/detail.vue @@ -58,24 +58,20 @@ >{{ contentFormat(item) }}{{ units.get(item.field) }} - - - - {{ item.name }} - 查看 - - - - - {{ (detail.land_id_lands_id_relation ? detail.land_id_lands_id_relation.name : '') }} - 查看 - - - - - - - + + + + + + + + + + + + + + @@ -114,6 +110,38 @@ + + + 关联土地 + + + 查看 + + + + + {{ detail.land_id_lands_id_relation ? detail.land_id_lands_id_relation[item.prop] : "" }}{{ units.get(item.prop) }} + + + + + + 关联房产 + + + + + 历史沿革 @@ -267,6 +295,8 @@ detail.id_assets_atlas_files_land_id_relation.length > 0) " /> + + @@ -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": "登记面积(m²)", + "width": 0, + "align": "center" + }, + { + "prop": "shijimianji", + "label": "实际面积(m²)", + "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": "登记面积(m²)", + "width": 0, + "align": "center" + }, + { + "prop": "shijimianji", + "label": "实际面积(m²)", + "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 => ( + + this.$router.push(/houseDetail/+row.id)}}>查看 + + ) + } + ], inspectionTable: [ { fixed: 'left', diff --git a/src/views/dataShow/tooltip.vue b/src/views/dataShow/tooltip.vue index 032c2b4..cb92c07 100644 --- a/src/views/dataShow/tooltip.vue +++ b/src/views/dataShow/tooltip.vue @@ -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: "登记面积" diff --git a/src/views/lease/component/addLet.vue b/src/views/lease/component/addLet.vue index 7e23e59..0232533 100644 --- a/src/views/lease/component/addLet.vue +++ b/src/views/lease/component/addLet.vue @@ -57,48 +57,14 @@ export default { - { - 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; - })() - ]) - } + { + 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) + } + } + } }} > @@ -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) + } + } + } }} > @@ -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: { diff --git a/src/views/lease/sign.vue b/src/views/lease/sign.vue index 5f82975..b86d383 100644 --- a/src/views/lease/sign.vue +++ b/src/views/lease/sign.vue @@ -1,59 +1,67 @@
关联土地