master
xy 2 years ago
parent a339dd3e4c
commit 152ec95a3d

@ -84,18 +84,18 @@ export default {
"align": "left"
},
{
"prop": "dengjimianji",
"label": "登记面积",
"prop": "shijimianji",
"label": "实际面积",
"width": 0,
"align": "center"
},
{
"prop": "_chuzhimianji",
"label": "处置面积",
"prop": "_zichanshengyumianji",
"label": "资产剩余面积",
"width": 160,
customFn: row => {
return (
<el-input-number controls={false} precision={2} vModel={row._chuzhimianji} size="small"></el-input-number>
<el-input-number controls={false} precision={2} vModel={row._zichanshengyumianji} size="small"></el-input-number>
)
}
},
@ -189,7 +189,10 @@ export default {
"prop": "area",
"label": "区域",
"width": 0,
"align": "center"
"align": "center",
"formatter": (data, row, value) => {
return this.wxAreas[value]
}
},
{
"prop": "name",
@ -347,8 +350,8 @@ export default {
name: row.name,
zuoluo: row.zuoluo,
zichanweizhi: row.zichanweizhi,
dengjimianji: row.dengjimianji,
_chuzhimianji: 0,
shijimianji: row.shijimianji,
_zichanshengyumianji: 0,
_relation_id: "",
})
} else {
@ -412,7 +415,10 @@ export default {
"prop": "area",
"label": "区域",
"width": 0,
"align": "center"
"align": "center",
"formatter": (data, row, value) => {
return this.wxAreas[value]
}
},
{
"prop": "name",
@ -524,8 +530,8 @@ export default {
name: row.name,
zuoluo: row.zuoluo,
zichanweizhi: row.zichanweizhi,
dengjimianji: row.dengjimianji,
_chuzhimianji: 0,
shijimianji: row.shijimianji,
_zichanshengyumianji: 0,
_relation_id: "",
land_id: row.land_id
})
@ -550,6 +556,19 @@ export default {
},
data() {
return {
wxAreas: [
"宜兴市",
"惠山区",
"新吴区",
"梁溪区",
"江阴市",
"滨湖区",
"锡山区",
],
customForm: {
customFormId: "",
tableName: ""
},
nowAssets: [],
houseDialog: false,
landDialog: false,
@ -605,6 +624,19 @@ export default {
}
},
getTableParams () {
if (this.$route.meta.params?.custom_form) {
let decode = decodeURIComponent(this.$route.meta.params?.custom_form);
try {
let custom_form = JSON.parse(decode);
this.customForm.customFormId = custom_form.custom_form_id;
this.customForm.tableName = custom_form.table_name;
} catch (err) {
console.warn(err);
}
}
},
async getDetail() {
const res = await show({ id: this.id, table_name: 'asset_handles' });
this.$integrateData(this.form, res);
@ -628,8 +660,8 @@ export default {
name: land.name,
zuoluo: land.zuoluo,
zichanweizhi: land.zichanweizhi,
dengjimianji: land.dengjimianji,
_chuzhimianji: item.chuzhimianji||0,
shijimianji: land.shijimianji,
_zichanshengyumianji: item.zichanshengyumianji||0,
_relation_id: item.id,
});
}
@ -641,8 +673,8 @@ export default {
name: house.name,
zuoluo: house.zuoluo,
zichanweizhi: house.zichanweizhi,
dengjimianji: house.dengjimianji,
_chuzhimianji: item.chuzhimianji||0,
shijimianji: house.shijimianji,
_zichanshengyumianji: item.zichanshengyumianji||0,
_relation_id: item.id,
land_id: house.land_id,
});
@ -683,16 +715,18 @@ export default {
// })
// this.form.id_lease_plans_lease_id_relation = this.leasePlans;
save(Object.assign(this.form, { table_name: 'asset_handles' })).then(res => {
Promise.all(this.originalForm.id_asset_handles_to_assets_handles_id_relation?.map(i => destroy({
id: i.id,
table_name: "asset_handles_to_assets"
},false)))
if (this.type !== 'add') {
Promise.all(this.originalForm.id_asset_handles_to_assets_handles_id_relation?.map(i => destroy({
id: i.id,
table_name: "asset_handles_to_assets"
},false)))
}
let leaseToAssetsData = this.nowAssets.map(item => ({
id: item._relation_id,
land_id: !item.hasOwnProperty("land_id") ? item.id : "",
house_id: item.hasOwnProperty("land_id") ? item.id : "",
chuzhimianji: item._chuzhimianji,
let_id: res.id
zichanshengyumianji: item._zichanshengyumianji,
handle_id: res.id
}));
if (leaseToAssetsData && leaseToAssetsData.length > 0) {
imports({
@ -772,9 +806,10 @@ export default {
},
},
created() {
this.getTableParams();
this.id = this.$route.query.id;
this.type = this.$route.query.type;
resolveFormInfo(27).then(res => {
resolveFormInfo(this.customForm.customFormId).then(res => {
this.formInfo = res;
if (this.type === "editor" || this.type === "change") {

@ -812,7 +812,7 @@ export default {
{
width: 140,
prop: "yingshou",
label: "应收",
label: "应收租金",
customFn: ({ row }) => {
return (
<div>

@ -262,7 +262,7 @@
@loaded="adjustAlignment"
>
<template #sign="{ row }">
<Button type="primary" size="small" @click="$router.push('/handle/'+row.id+'?type=add')"></Button>
<Button type="primary" size="small" @click="$router.push('/handleSign/'+row.id+'?type=add')"></Button>
</template>
</xy-table>

@ -124,8 +124,8 @@ export default {
}
},
{
"prop": "chuzhimianji",
"label": "处置面积",
"prop": "zichanshengyumianji",
"label": "资产剩余面积",
"width": 160,
},
]

@ -168,7 +168,7 @@ export default {
}
if (row._relation_id) {
destroy({ table_name: "leases_to_assets", id: row._relation_id },false).then(_ => {
destroy({ table_name: "handle_signs_to_assets", id: row._relation_id },false).then(_ => {
this.nowAssets.splice(this.nowAssets.findIndex(j => j._relation_id === row._relation_id),1)
})
}
@ -186,201 +186,6 @@ export default {
></xy-table>
</div>
{/* 租金收取计划 */}
<div style="margin-bottom: 10px;">
<div style="display: flex;margin-bottom: 10px;align-items: center;">
<p style="font-weight: 700;line-height: 2;">租金收取计划</p>
<Button
style="margin-left: auto;"
type="primary"
shape="circle"
on={{
["click"]: (_) => {
this.leasePlans.push({
zujindiyicidaoweishijian: "",
yingshou: "",
shijidaozhang: "",
weidaoweiyuanyin: "",
shijidaozhangriqi: "",
lease_id: "",
});
},
}}
>
新增
</Button>
</div>
<div style="display: flex;flex-wrap: wrap;justify-content: space-between;">
{
this.leasePlans.map((leasePlan, index) => (
<Card padding={10} style="flex-basis: calc(50% - 5px);">
<div slot="title" style="display: flex;align-items: center;">
<p style="font-size: 14px;">租金收取计划{index+1}</p>
<Button type="error"
size="small"
ghost={true}
on={{
["click"]: (_) => {
this.$confirm("确定删除?").then((_) => {
this.leasePlans.splice(index, 1);
if (leasePlan.id) {
destroy(
{ table_name: "lease_plans", id: leasePlan.id },
false
);
}
});
},
}}>删除</Button>
</div>
<div>
<el-form ref={'leasePlan'+index}
props={{
model: leasePlan
}}>
<el-form-item label="租金到位时间">
</el-form-item>
</el-form>
</div>
</Card>
))
}
</div>
{ /*<xy-table
height="300"
isHandlerKey={false}
is-page={false}
list={leasePlans}
table-item={[
{
width: 46,
type: "index"
},
{
prop: "zujindiyicidaoweishijian",
label: "租金到位时间",
width: 160,
customFn: (row) => {
return (
<el-date-picker
style="width: 100%;"
size="small"
vModel={row.zujindiyicidaoweishijian}
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
/>
);
},
},
{
prop: "yingshou",
label: "应收",
width: 160,
customFn: (row) => {
return (
<el-input-number
style="width: 100%;"
size="small"
controls={false}
precision={2}
vModel={row.yingshou}
size="small"
></el-input-number>
);
},
},
{
prop: "shijidaozhang",
label: "实际到账",
width: 160,
customFn: (row) => {
return (
<el-input-number
style="width: 100%;"
size="small"
controls={false}
precision={2}
vModel={row.shijidaozhang}
size="small"
></el-input-number>
);
},
},
{
prop: "weidaoweiyuanyin",
label: "未到位原因",
width: 180,
customFn: (row) => {
return (
<el-input
style="width: 100%;"
size="small"
vModel={row.weidaoweiyuanyin}
size="small"
></el-input>
);
},
},
{
prop: "shijidaozhangriqi",
label: "实际到账日期",
width: 160,
customFn: (row) => {
return (
<el-date-picker
style="width: 100%;"
size="small"
vModel={row.shijidaozhangriqi}
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
/>
);
},
},
{
prop: "operate",
label: "操作",
minWidth: 120,
customFn: (row, { $index }) => {
return (
<div style="display: flex;">
<Button
type="error"
size="small"
ghost={true}
on={{
["click"]: (_) => {
this.$confirm("确定删除?").then((_) => {
this.leasePlans.splice($index, 1);
if (row.id) {
destroy(
{ table_name: "lease_plans", id: row.id },
false
);
}
});
},
}}
>
删除
</Button>
</div>
);
},
},
]}
></xy-table> */ }
</div>
{dialog.render()}
</el-card>
@ -439,6 +244,9 @@ export default {
label: "区域",
width: 0,
align: "center",
"formatter": (data, row, value) => {
return this.wxAreas[value]
}
},
{
prop: "name",
@ -596,7 +404,7 @@ export default {
zuoluo: row.zuoluo,
zichanweizhi: row.zichanweizhi,
shijimianji: row.shijimianji,
_chuzumianji: 0,
_zichanshengyumianji: 0,
_relation_id: "",
})
} else {
@ -604,7 +412,7 @@ export default {
let temp = this.nowAssets.splice(index, 1)
if (temp._relation_id) {
destroy({
table_name: "leases_to_assets",
table_name: "handle_signs_to_assets",
id: temp._relation_id
},false)
}
@ -670,6 +478,9 @@ export default {
label: "区域",
width: 0,
align: "center",
"formatter": (data, row, value) => {
return this.wxAreas[value]
}
},
{
prop: "name",
@ -781,7 +592,7 @@ export default {
zuoluo: row.zuoluo,
zichanweizhi: row.zichanweizhi,
shijimianji: row.shijimianji,
_chuzumianji: 0,
_zichanshengyumianji: 0,
_relation_id: "",
land_id: row.land_id
})
@ -790,7 +601,7 @@ export default {
let temp = this.nowAssets.splice(index, 1)
if (temp._relation_id) {
destroy({
table_name: "leases_to_assets",
table_name: "handle_signs_to_assets",
id: temp._relation_id
},false)
}
@ -805,10 +616,22 @@ export default {
},
data() {
return {
wxAreas: [
"宜兴市",
"惠山区",
"新吴区",
"梁溪区",
"江阴市",
"滨湖区",
"锡山区",
],
customForm: {
customFormId: "",
tableName: ""
},
nowAssets: [],
houseDialog: false,
landDialog: false,
leasePlans: [],
landSelect: {
table_name: "lands",
keyword: "",
@ -860,8 +683,21 @@ export default {
}
},
getTableParams () {
if (this.$route.meta.params?.custom_form) {
let decode = decodeURIComponent(this.$route.meta.params?.custom_form);
try {
let custom_form = JSON.parse(decode);
this.customForm.customFormId = custom_form.custom_form_id;
this.customForm.tableName = custom_form.table_name;
} catch (err) {
console.warn(err);
}
}
},
async getDetail() {
const res = await show({ id: this.id, table_name: "leases" });
const res = await show({ id: this.id, table_name: "handle_leases" });
this.$integrateData(this.form, res);
this.formInfo.forEach((i) => {
@ -872,10 +708,9 @@ export default {
}
});
this.form = Object.assign({}, this.form);
this.leasePlans = res.id_lease_plans_lease_id_relation;
this.originalForm = deepCopy(res);
if (this.type !== 'add') {
this.originalForm?.id_leases_to_assets_lease_id_relation?.forEach(
this.originalForm?.id_handle_signs_to_assets_handle_sign_id_relation?.forEach(
(item) => {
if (item.land_id) {
let land = this.originalForm.land?.find(
@ -888,7 +723,7 @@ export default {
zuoluo: land.zuoluo,
zichanweizhi: land.zichanweizhi,
shijimianji: land.shijimianji,
_chuzumianji: item.chuzumianji,
_zichanshengyumianji: item.zichanshengyumianji,
_relation_id: item.id,
});
}
@ -903,7 +738,7 @@ export default {
zuoluo: house.zuoluo,
zichanweizhi: house.zichanweizhi,
shijimianji: house.shijimianji,
_chuzumianji: item.chuzumianji,
_zichanshengyumianji: item.zichanshengyumianji,
_relation_id: item.id,
_TAG_: "house",
land_id: house.land_id
@ -931,45 +766,31 @@ export default {
}
this.form.let_id = this.$route.params.letId;
save(Object.assign(this.form, { table_name: "leases" })).then((res) => {
save(Object.assign(this.form, { table_name: "handle_leases" })).then((res) => {
if (this.type !== 'add') {
Promise.all([
...this.originalForm.id_leases_to_assets_lease_id_relation?.map(i => destroy({
...this.originalForm.id_handle_signs_to_assets_handle_sign_id_relation?.map(i => destroy({
id: i.id,
table_name: "leases_to_assets"
},false)),
...this.originalForm.id_lease_plans_lease_id_relation?.map(i => destroy({
id: i.id,
table_name: "lease_plans"
table_name: "handle_signs_to_assets"
},false))
])
}
let leaseToAssetsData = this.nowAssets.map(item => ({
let handleToAssetsData = this.nowAssets.map(item => ({
id: item._relation_id,
land_id: !item.hasOwnProperty("land_id") ? item.id : "",
house_id: item.hasOwnProperty("land_id") ? item.id : "",
chuzumianji: item._chuzumianji,
lease_id: res.id
zichanshengyumianji: item._zichanshengyumianji,
handle_id: res.id
}));
if (leaseToAssetsData && leaseToAssetsData.length > 0) {
if (handleToAssetsData && handleToAssetsData.length > 0) {
imports(
{
table_name: "leases_to_assets",
data: leaseToAssetsData,
table_name: "handle_signs_to_assets",
data: handleToAssetsData,
},
false
);
}
let leasePlansData = this.leasePlans.map((item) => ({
...item,
lease_id: res.id,
}));
if (leasePlansData && leasePlansData.length > 0) {
imports({
table_name: "lease_plans",
data: leasePlansData,
});
}
//
if (this.type === "change") {
let content = "";
@ -1053,16 +874,17 @@ export default {
},
},
created() {
this.id = this.$route.query.leaseId;
this.getTableParams();
this.id = this.$route.query.handleId;
this.type = this.$route.query.type;
resolveFormInfo(15).then((res) => {
resolveFormInfo(this.customForm.customFormId).then((res) => {
this.formInfo = res;
if (this.type === "editor" || this.type === "change") {
this.$nextTick(() => this.getDetail());
} else {
show({ id: this.$route.params.letId, table_name: "lets" }).then(letDetail => {
letDetail?.lets_to_assets?.forEach(item => {
show({ id: this.$route.params.handleId, table_name: "asset_handles" }).then(handleDetail => {
handleDetail?.lets_to_assets?.forEach(item => {
if (item.land_id) {
let land = item.lands;
if (land) {

@ -201,11 +201,11 @@
{
title: '地块名称',
key: 'dikuaimingcheng',
width: 180,
width: 260,
fixed: 'left',
align: 'left',
render: (h, { row }) => {
return h('div',[
let tags = [
...row?.land?.map(i => h('Tag', {
props: {
color: "green"
@ -216,6 +216,28 @@
color: "blue"
}
},i.name))
]
return h('div',[
...tags.slice(0, 3),
h('el-popover',{
props: {
title: "地块名称",
width: 200,
trigger: "hover"
}
},[
h('el-link',{
style: {
"word-break": "keep-all",
display: tags.length > 3 ? "inline" : "none"
},
props: {
type: "primary",
},
slot: "reference"
},"更多"),
h('div',tags)
]),
])
}
},

@ -42,10 +42,14 @@ export default {
label: "租金收取确认",
expandFn: ({ row, $index }) => {
return (
<div style="padding-left: 40px;">
<div style="margin: auto;width: 90%;">
<el-form ref={`expand-form${$index}`}
label-position="top"
size="small"
style={{
"display": "grid",
"grid-template-columns": "repeat(2,1fr)"
}}
rules={{
shijidaozhang: [{ required: true, message: "请输入实际到账" }],
shijidaozhangriqi: [{ required: true, message: "请选择实际到账日期" }]
@ -67,13 +71,25 @@ export default {
style="width: 200px;"
placeholder="请选择实际到账日期"></el-date-picker>
</el-form-item>
<el-form-item prop="zulinjieduankaishiriqi" label="租赁阶段开始日期">
<el-date-picker vModel={this.form.zulinjieduankaishiriqi}
value-format="yyyy-MM-dd"
style="width: 200px;"
placeholder="请选择租赁阶段开始日期"></el-date-picker>
</el-form-item>
<el-form-item prop="zulinjieduanjieshuriqi" label="租赁阶段结束日期">
<el-date-picker vModel={this.form.zulinjieduanjieshuriqi}
value-format="yyyy-MM-dd"
style="width: 200px;"
placeholder="请选择租赁阶段结束日期"></el-date-picker>
</el-form-item>
<el-form-item label="未到位原因">
<el-input type="textarea"
style="width: 200px;"
autosize={{minRows: 2}}
vModel={this.form.weidaoweiyuanyin}></el-input>
</el-form-item>
<el-form-item>
<el-form-item style={{ "grid-row": "4","grid-column": "1 / 3", "justify-self": "center" }}>
<Button type="warning"
ghost={true}
on={{
@ -86,7 +102,11 @@ export default {
['click']:_ => {
this.$refs[`expand-form${$index}`].validate(valid => {
if (valid) {
console.log(this.form)
for (let key in this.form) {
if (/_relation/g.test(key)) {
delete this.form[key]
}
}
save({
...this.form,
table_name: "lease_plans"
@ -112,7 +132,7 @@ export default {
},
{
prop: "yingshou",
label: "应收",
label: "应收租金",
align: "right"
},
{
@ -174,4 +194,8 @@ export default {
::v-deep .el-input-number .el-input__inner{
text-align: left;
}
::v-deep .el-form-item__error {
left: 0!important;
transform: translateX(0);
}
</style>

@ -38,10 +38,18 @@
</template>
<template v-else-if="item.edit_input === 'files'">
<div
v-for="(item, index) in detail[`${item.field}_upload_details`]"
style="display: flex; justify-content: space-between;margin-bottom: 4px;"
v-for="(item, index) in detail[
`${item.field}_upload_details`
]"
style="
display: flex;
justify-content: space-between;
margin-bottom: 4px;
"
>
<a :download="item.url">{{++index}}.{{ item.original_name }}</a>
<a :download="item.url"
>{{ ++index }}.{{ item.original_name }}</a
>
<div>
<el-button
type="primary"
@ -63,8 +71,7 @@
<template v-else>
{{ contentFormat(item) }}
</template>
</el-descriptions-item
>
</el-descriptions-item>
</el-descriptions>
</el-card>
@ -72,14 +79,30 @@
<div class="el-descriptions__header el-descriptions__title">
资产详情
</div>
<xy-table size="mini" :height="300" :is-page="false" :list="detail.id_leases_to_assets_lease_id_relation || []" :table-item="assetTable"></xy-table>
<xy-table
size="mini"
:height="300"
:is-page="false"
:list="detail.id_leases_to_assets_lease_id_relation || []"
:table-item="assetTable"
:show-summary="true"
:summary-method="summaryAssets"
></xy-table>
</el-card>
<el-card>
<div class="el-descriptions__header el-descriptions__title">
租金收取计划
</div>
<xy-table size="mini" :height="300" :is-page="false" :list="detail.id_lease_plans_lease_id_relation || []" :table-item="leasePlanTable"></xy-table>
<xy-table
size="mini"
:height="300"
:is-page="false"
:list="detail.id_lease_plans_lease_id_relation || []"
:table-item="leasePlanTable"
:show-summary="true"
:summary-method="summaryPlans"
></xy-table>
</el-card>
</el-col>
</el-row>
@ -107,7 +130,10 @@
<script>
import { show, index } from "@/api/system/baseForm";
import { show as formShow, index as customFormIndex } from "@/api/system/customForm";
import {
show as formShow,
index as customFormIndex,
} from "@/api/system/customForm";
import { getparameter } from "@/api/system/dictionary";
import { listdept } from "@/api/system/department";
import { download } from "@/utils/downloadRequest";
@ -115,7 +141,7 @@ export default {
name: "detail",
data() {
return {
showModal:false,
showModal: false,
codeUri: "",
detail: {},
@ -130,38 +156,61 @@ export default {
linkTableList: [],
assetTable: [
{
"prop": "name",
"label": "地块名称",
"width": 0,
"fixed": "left",
"align": "left",
customFn: row => {
prop: "name",
label: "地块名称",
width: 0,
fixed: "left",
align: "left",
customFn: (row) => {
return (
<span>{row.land_id ? this.detail?.land?.find(i => i.id === row.land_id)?.name : this.detail?.houses?.find(i => i.id === row.house_id)?.name }</span>)}
<span>
{row.land_id
? this.detail?.land?.find((i) => i.id === row.land_id)?.name
: this.detail?.houses?.find((i) => i.id === row.house_id)
?.name}
</span>
);
},
},
{
"prop": "zuoluo",
"label": "坐落",
"width": 0,
"align": "left",
customFn: row => {
return (<span>{row.land_id ? this.detail?.land?.find(i => i.id === row.land_id)?.zuoluo : this.detail?.houses?.find(i => i.id === row.house_id)?.zuoluo }</span>)
}
prop: "zuoluo",
label: "坐落",
width: 0,
align: "left",
customFn: (row) => {
return (
<span>
{row.land_id
? this.detail?.land?.find((i) => i.id === row.land_id)?.zuoluo
: this.detail?.houses?.find((i) => i.id === row.house_id)
?.zuoluo}
</span>
);
},
},
{
"prop": "shijimianji",
"label": "实际面积",
"width": 160,
"align": "right",
customFn: row => {
return (<span>{row.land_id ? this.detail?.land?.find(i => i.id === row.land_id)?.shijimianji : this.detail?.houses?.find(i => i.id === row.house_id)?.shijimianji }</span>)
}
prop: "shijimianji",
label: "实际面积",
width: 160,
align: "right",
customFn: (row) => {
return (
<span>
{parseFloat((row.land_id
? this.detail?.land?.find((i) => i.id === row.land_id)
?.shijimianji
: this.detail?.houses?.find((i) => i.id === row.house_id)
?.shijimianji)??0).toFixed(2)}
</span>
);
},
},
{
"prop": "chuzumianji",
"label": "出租面积",
"width": 160,
"align": "right"
prop: "chuzumianji",
label: "出租面积",
width: 160,
align: "right",
formatter: (row, data ,val) => parseFloat(val??0).toFixed(2)
},
],
leasePlanTable: [
@ -172,28 +221,30 @@ export default {
},
{
prop: "yingshou",
label: "应收",
label: "应收租金",
width: 160,
align: "right"
align: "right",
formatter: (row, data ,val) => parseFloat(val??0).toFixed(2)
},
{
prop: "shijidaozhang",
label: "实际到账",
width: 160,
align: "right"
align: "right",
formatter: (row, data ,val) => parseFloat(val??0).toFixed(2)
},
{
prop: "weidaoweiyuanyin",
label: "未到位原因",
minWidth: 180,
align: "left"
align: "left",
},
{
prop: "shijidaozhangriqi",
label: "实际到账日期",
width: 200,
}
]
},
],
};
},
methods: {
@ -209,19 +260,22 @@ export default {
download(e.url, "get", {}, e.original_name);
},
formatColumn (info) {
formatColumn(info) {
let table = [];
//
//
let baseTable = new Map([
['departments', async () => {
const res = await listdept()
return res
}],
['admins',[]]
])
[
"departments",
async () => {
const res = await listdept();
return res;
},
],
["admins", []],
]);
let { fields, relation } = info;
let fieldRes = fields.sort((a,b) => a.sort - b.sort)
let fieldRes = fields.sort((a, b) => a.sort - b.sort);
if (
!fields ||
!relation ||
@ -232,47 +286,51 @@ export default {
}
fieldRes?.forEach((i, index) => {
i._relations = relation.find((j) => j.custom_form_field === i.field);
if (i.select_item && typeof i.select_item === 'object') {
let keys = Object.keys(i.select_item)
i._params = keys.map(key => {
if (i.select_item && typeof i.select_item === "object") {
let keys = Object.keys(i.select_item);
i._params = keys.map((key) => {
return {
key,
value: i.select_item[key]
}
})
value: i.select_item[key],
};
});
}
if (i.edit_input === 'file' || i.edit_input === 'files') {
return
if (i.edit_input === "file" || i.edit_input === "files") {
return;
}
if (i._relations) {
if (baseTable.get(i._relations.link_table_name)) {
baseTable.get(i._relations.link_table_name)().then(res => i._params = res)
baseTable
.get(i._relations.link_table_name)()
.then((res) => (i._params = res));
} else {
i._params = i._relations.parameter_id
? getparameter({ id: i._relations.parameter_id },false).then((res) => {
i._params = res.detail;
})
? getparameter({ id: i._relations.parameter_id }, false).then(
(res) => {
i._params = res.detail;
}
)
: this.index({
table_name: i._relations.link_table_name,
page: 1,
page_size: 9999,
}).then((res) => {
i._params = res.data;
});
table_name: i._relations.link_table_name,
page: 1,
page_size: 9999,
}).then((res) => {
i._params = res.data;
});
}
}
});
fields
?.filter((i) => i.list_show)
.forEach((i) => {
if (i._relations) return
if (i._relations) return;
let linkOb = {};
if (i.edit_input === "richtext") {
linkOb.customFn = (row) => {
return (
<div
style={{ "max-height": "55px","overflow": "scroll" }}
style={{ "max-height": "55px", overflow: "scroll" }}
domPropsInnerHTML={row[i.field]}
></div>
);
@ -324,12 +382,10 @@ export default {
return (
<div style="display: flex;flex-direction: column;">
{row[link_with_name]?.map((o) => (
<a>
{ o?.original_name || o?.name }
</a>
<a>{o?.original_name || o?.name}</a>
))}
</div>
)
);
} else {
return (
<div>
@ -370,7 +426,6 @@ export default {
},
async getFields() {
if (this.$route.meta.params?.custom_form) {
let decode = decodeURIComponent(this.$route.meta.params?.custom_form);
try {
@ -410,9 +465,7 @@ export default {
fields
.sort((a, b) => a.sort - b.sort)
.forEach((i) => {
i._relations = relation.find(
(j) => j.custom_form_field === i.field
);
i._relations = relation.find((j) => j.custom_form_field === i.field);
if (i.select_item && typeof i.select_item === "object") {
let keys = Object.keys(i.select_item);
i._params = keys.map((key) => {
@ -459,11 +512,43 @@ export default {
this.detail = detail;
},
summaryAssets ({ columns, data }) {
return columns.map((column,index) => {
if (index === 0) return '合计'
if (column.property === 'chuzumianji') {
return data.reduce((pre,cur) => pre + parseFloat(cur[column.property]??0),0).toFixed(2)
} else if (column.property === 'shijimianji') {
return data.reduce((pre,cur) => pre + parseFloat((
cur.land_id
? this.detail?.land?.find((i) => i.id === cur.land_id)
?.shijimianji
: this.detail?.houses?.find((i) => i.id === cur.house_id)
?.shijimianji
)??0),0).toFixed(2)
} else {
return ""
}
})
},
summaryPlans ({ columns, data }) {
const summaryColumns = ["yingshou","shijidaozhang"]
return columns.map((column,index) => {
if (index === 0) return '合计'
return summaryColumns.indexOf(column.property) !== -1 ? data.reduce((pre,cur) => pre + parseFloat(cur[column.property]??0),0).toFixed(2) : ""
})
}
},
computed: {
showFields () {
return this.fields.filter(field => (!field._relations || field._relations.link_relation === 'hasOne' || field._relations.link_relation === 'newHasOne') && !/_id/g.test(field.field))
showFields() {
return this.fields.filter(
(field) =>
(!field._relations ||
field._relations.link_relation === "hasOne" ||
field._relations.link_relation === "newHasOne") &&
!/_id/g.test(field.field)
);
},
contentFormat() {
return function (i) {
@ -493,8 +578,7 @@ export default {
},
},
created() {
this.getFields().then(_ => {
})
this.getFields().then((_) => {});
},
};
</script>
@ -519,14 +603,17 @@ a:hover {
}
.el-descriptions__title {
position: relative;
padding-left: 14px;
&::before {
content: '';
content: "";
width: 4px;
background: linear-gradient(to bottom,rgb(57, 129, 199), rgba(118, 148, 183, 0.7));
background: linear-gradient(
to bottom,
rgb(57, 129, 199),
rgba(118, 148, 183, 0.7)
);
position: absolute;
left: 0;
@ -534,4 +621,8 @@ a:hover {
bottom: 2px;
}
}
::v-deep .el-table__fixed-footer-wrapper .el-table__cell:first-child .cell {
text-align: center;
}
</style>

@ -0,0 +1,579 @@
<template>
<div>
<el-page-header
:content="$route.meta.title"
style="
padding: 1em;
font-size: 1em;
background: #fff;
margin: 1.67em 0;
box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
border-radius: 5px;
"
@back="$router.back()"
>
</el-page-header>
<el-row :gutter="20">
<el-col :span="24">
<el-card>
<div class="el-descriptions__header el-descriptions__title">
基本信息
</div>
<el-descriptions
border
:column="2"
:label-style="{ 'font-weight': '600' }"
>
<el-descriptions-item
v-for="item in showFields"
:label="item.name"
v-if="!['file', 'picture'].find((j) => j === item.field)"
>
<template v-if="item.edit_input === 'richtext'">
<div v-html="detail[item.field]"></div>
</template>
<template v-else-if="item.edit_input === 'file'">
<div>img</div>
</template>
<template v-else-if="item.edit_input === 'files'">
<div
v-for="(item, index) in detail[
`${item.field}_upload_details`
]"
style="
display: flex;
justify-content: space-between;
margin-bottom: 4px;
"
>
<a :download="item.url"
>{{ ++index }}.{{ item.original_name }}</a
>
<div>
<el-button
type="primary"
icon="el-icon-download"
circle
size="mini"
@click="down(item)"
></el-button>
<el-button
type="primary"
icon="el-icon-search"
circle
size="mini"
@click="open(item.url)"
></el-button>
</div>
</div>
</template>
<template v-else>
{{ contentFormat(item) }}
</template>
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card>
<div class="el-descriptions__header el-descriptions__title">
资产详情
</div>
<xy-table
size="mini"
:height="300"
:is-page="false"
:list="leaseDetail.id_leases_to_assets_lease_id_relation || []"
:table-item="assetTable"
:show-summary="true"
:summary-method="summaryAssets"
></xy-table>
</el-card>
</el-col>
</el-row>
<el-backtop></el-backtop>
<Modal
:width="76"
transfer
:z-index="6000"
v-model="showModal"
:footer-hide="true"
title="预览"
>
<template>
<iframe
style="width: 100%; height: 57vh"
:src="codeUri"
border="0"
></iframe>
</template>
</Modal>
</div>
</template>
<script>
import { show, index } from "@/api/system/baseForm";
import {
show as formShow,
index as customFormIndex,
} from "@/api/system/customForm";
import { getparameter } from "@/api/system/dictionary";
import { listdept } from "@/api/system/department";
import { download } from "@/utils/downloadRequest";
export default {
name: "detail",
data() {
return {
showModal: false,
codeUri: "",
detail: {},
fields: [],
relation: [],
customForm: {
customFormId: "",
tableName: "",
},
allTables: [],
linkTableList: [],
leaseDetail: {},
assetTable: [
{
prop: "name",
label: "地块名称",
width: 0,
fixed: "left",
align: "left",
customFn: (row) => {
return (
<span>
{row.land_id
? this.leaseDetail?.land?.find((i) => i.id === row.land_id)?.name
: this.leaseDetail?.houses?.find((i) => i.id === row.house_id)
?.name}
</span>
);
},
},
{
prop: "zuoluo",
label: "坐落",
width: 0,
align: "left",
customFn: (row) => {
return (
<span>
{row.land_id
? this.leaseDetail?.land?.find((i) => i.id === row.land_id)?.zuoluo
: this.leaseDetail?.houses?.find((i) => i.id === row.house_id)
?.zuoluo}
</span>
);
},
},
{
prop: "shijimianji",
label: "实际面积",
width: 160,
align: "right",
customFn: (row) => {
return (
<span>
{parseFloat((row.land_id
? this.leaseDetail?.land?.find((i) => i.id === row.land_id)
?.shijimianji
: this.leaseDetail?.houses?.find((i) => i.id === row.house_id)
?.shijimianji)??0).toFixed(2)}
</span>
);
},
},
{
prop: "chuzumianji",
label: "出租面积",
width: 160,
align: "right",
formatter: (row, data ,val) => parseFloat(val??0).toFixed(2)
},
],
};
},
methods: {
open(url) {
this.codeUri = `${process.env.VUE_APP_PREVIEW}?url=${encodeURIComponent(
new Buffer(url).toString("base64")
)}`;
this.showModal = true;
},
down(e) {
download(e.url, "get", {}, e.original_name);
},
formatColumn(info) {
let table = [];
//
//
let baseTable = new Map([
[
"departments",
async () => {
const res = await listdept();
return res;
},
],
["admins", []],
]);
let { fields, relation } = info;
let fieldRes = fields.sort((a, b) => a.sort - b.sort);
if (
!fields ||
!relation ||
!fields instanceof Array ||
!relation instanceof Array
) {
throw new Error("fields或relation格式错误");
}
fieldRes?.forEach((i, index) => {
i._relations = relation.find((j) => j.custom_form_field === i.field);
if (i.select_item && typeof i.select_item === "object") {
let keys = Object.keys(i.select_item);
i._params = keys.map((key) => {
return {
key,
value: i.select_item[key],
};
});
}
if (i.edit_input === "file" || i.edit_input === "files") {
return;
}
if (i._relations) {
if (baseTable.get(i._relations.link_table_name)) {
baseTable
.get(i._relations.link_table_name)()
.then((res) => (i._params = res));
} else {
i._params = i._relations.parameter_id
? getparameter({ id: i._relations.parameter_id }, false).then(
(res) => {
i._params = res.detail;
}
)
: this.index({
table_name: i._relations.link_table_name,
page: 1,
page_size: 9999,
}).then((res) => {
i._params = res.data;
});
}
}
});
fields
?.filter((i) => i.list_show)
.forEach((i) => {
if (i._relations) return;
let linkOb = {};
if (i.edit_input === "richtext") {
linkOb.customFn = (row) => {
return (
<div
style={{ "max-height": "55px", overflow: "scroll" }}
domPropsInnerHTML={row[i.field]}
></div>
);
};
}
if (
i.select_item &&
typeof i.select_item === "object" &&
!(i.select_item instanceof Array)
) {
let keys = Object.keys(i.select_item);
linkOb.customFn = (row) => {
let paramMap = new Map();
keys.forEach((key) => {
paramMap.set(i.select_item[key], key);
});
return <span>{paramMap.get(row[i.field]?.toString())}</span>;
};
}
if (i._relations) {
let { link_relation, foreign_key, link_with_name } = i._relations;
if (link_relation === "newHasOne" || link_relation === "hasOne") {
linkOb.customFn = (row) => {
if (i.edit_input === "file") {
return (
<a
download={row[link_with_name]?.original_name}
href={row[link_with_name]?.url}
>
{row[link_with_name]?.original_name}
</a>
);
} else {
return (
<span>
{row[link_with_name]?.name ||
row[link_with_name]?.no ||
row[link_with_name]?.value}
</span>
);
}
};
}
if (link_relation === "hasMany" || link_relation === "newHasMany") {
linkOb.customFn = (row) => {
if (i.edit_input === "files") {
return (
<div style="display: flex;flex-direction: column;">
{row[link_with_name]?.map((o) => (
<a>{o?.original_name || o?.name}</a>
))}
</div>
);
} else {
return (
<div>
{row[link_with_name]?.map((o) => (
<p>
{o?.name ||
o?.no ||
o?.value ||
o?.biaoti ||
o?.mingcheng}
</p>
))}
</div>
);
}
};
}
}
table.push(
Object.assign(
{
prop: i.field,
label: i.name,
width: i.width,
fixed: i.is_fixed,
},
linkOb
)
);
});
table.unshift({
type: "index",
width: 60,
label: "序号",
});
return table;
},
async getFields() {
if (this.$route.meta.params?.custom_form) {
let decode = decodeURIComponent(this.$route.meta.params?.custom_form);
try {
let custom_form = JSON.parse(decode);
this.customForm.customFormId = custom_form.custom_form_id;
this.customForm.tableName = custom_form.table_name;
} catch (err) {
console.warn(err);
}
}
const res = await formShow({ id: this.customForm.customFormId }, false);
this.fields = res.fields.sort((a, b) => a.sort - b.sort);
this.relation = res.relation;
//
//
let baseTable = new Map([
[
"departments",
async () => {
const res = await listdept();
return res;
},
],
["admins", []],
]);
let { fields, relation } = this;
if (
!fields ||
!relation ||
!fields instanceof Array ||
!relation instanceof Array
) {
throw new Error("fields或relation格式错误");
}
fields
.sort((a, b) => a.sort - b.sort)
.forEach((i) => {
i._relations = relation.find((j) => j.custom_form_field === i.field);
if (i.select_item && typeof i.select_item === "object") {
let keys = Object.keys(i.select_item);
i._params = keys.map((key) => {
return {
key,
value: /^\d*$/.test(i.select_item[key])
? Number(i.select_item[key])
: i.select_item[key],
};
});
}
if (i.edit_input === "file" || i.edit_input === "files") {
return;
}
if (i._relations) {
if (baseTable.get(i._relations.link_table_name)) {
baseTable
.get(i._relations.link_table_name)()
.then((res) => {
i._params = res.data;
});
} else {
// i._params = i._relations.parameter_id
// ? getparameter({ id: i._relations.parameter_id }, false).then(
// (res) => {
// i._params = res.detail;
// }
// )
// : this.index({
// table_name: i._relations.link_table_name,
// page: 1,
// page_size: 9999,
// }).then((res) => {
// i._params = res.data;
// });
}
}
});
const detail = await show({
id: this.$route.params.id,
table_name: this.customForm.tableName,
});
this.detail = detail;
const leaseDetail = await show({
id: detail.lease_id,
table_name: "leases"
})
this.leaseDetail = leaseDetail;
},
summaryAssets ({ columns, data }) {
return columns.map((column,index) => {
if (index === 0) return '合计'
if (column.property === 'chuzumianji') {
return data.reduce((pre,cur) => pre + parseFloat(cur[column.property]??0),0).toFixed(2)
} else if (column.property === 'shijimianji') {
return data.reduce((pre,cur) => pre + parseFloat((
cur.land_id
? this.leaseDetail?.land?.find((i) => i.id === cur.land_id)
?.shijimianji
: this.leaseDetail?.houses?.find((i) => i.id === cur.house_id)
?.shijimianji
)??0),0).toFixed(2)
} else {
return ""
}
})
},
},
computed: {
showFields() {
return this.fields.filter(
(field) =>
(!field._relations ||
field._relations.link_relation === "hasOne" ||
field._relations.link_relation === "newHasOne") &&
!/_id/g.test(field.field)
);
},
contentFormat() {
return function (i) {
let { _relations } = i;
if (_relations && _relations.link_table_name) {
if (
_relations.link_relation === "hasOne" ||
_relations.link_relation === "newHasOne"
) {
return (
this.detail[_relations.link_with_name]?.original_name ||
this.detail[_relations.link_with_name]?.name ||
this.detail[_relations.link_with_name]?.no ||
this.detail[_relations.link_with_name]?.value ||
this.detail[_relations.link_with_name]?.mingcheng
);
}
return;
}
if (i._params && i._params.length > 0) {
return i._params.find((j) => j.value == this.detail[i.field])?.key;
}
return this.detail[i.field];
};
},
},
created() {
this.getFields().then((_) => {});
},
};
</script>
<style scoped lang="scss">
::v-deep .el-card {
margin-bottom: 20px;
}
::v-deep .el-empty__image {
width: 120px;
}
a {
color: red;
text-decoration: none;
transition: all 0.2s;
}
a:hover {
color: red;
text-decoration: underline;
}
.el-descriptions__title {
position: relative;
padding-left: 14px;
&::before {
content: "";
width: 4px;
background: linear-gradient(
to bottom,
rgb(57, 129, 199),
rgba(118, 148, 183, 0.7)
);
position: absolute;
left: 0;
top: 2px;
bottom: 2px;
}
}
::v-deep .el-table__fixed-footer-wrapper .el-table__cell:first-child .cell {
text-align: center;
}
</style>

@ -254,6 +254,13 @@
$refs['dialog'].show();
}
"
@detail="
(row) => {
$router.push({
path: $route.path + '/detail/' + row.id
})
}
"
@loaded="adjustAlignment"
>
</xy-table>
@ -565,12 +572,20 @@ export default {
)
);
});
this.table.unshift({
prop: "id",
width: 60,
label: "序号",
formatter: (row, column, cellValue, index) => (this.$refs['xyTable'].selectOpt.page - 1) * this.$refs['xyTable'].selectOpt.page_size + index + 1
})
this.table.unshift(...[
{
prop: "id",
width: 60,
label: "序号",
formatter: (row, column, cellValue, index) => (this.$refs['xyTable'].selectOpt.page - 1) * this.$refs['xyTable'].selectOpt.page_size + index + 1
},
{
prop: "chengzufang",
width: 120,
label: "承租方",
formatter: (row, column, cellValue) => row.lease_id_leases_id_relation?.chengzufang
}
])
},
adjustAlignment () {
@ -583,20 +598,21 @@ export default {
let minLength = Infinity;
let numberLength = 0;
let temp = 0;
let hasVal = 0;
while (temp < data.length) {
hasVal += data[temp][i.field] ? 1 : 0;
maxLength = Math.max(maxLength, data[temp][i.field]?.length??0);
minLength = Math.min(minLength, data[temp][i.field]?.length??0);
numberLength += /^-?[0-9]+(\.[0-9]+)?$/.test(data[temp][i.field]) ? 1 : 0;
temp++;
}
if (numberLength === temp && numberLength !== 0) {
if (numberLength === temp && numberLength !== 0 && i.edit_input !== 'radio') {
this.table.find(a => a.prop === i.field).align = 'right';
}
else if (Math.abs(maxLength - minLength) > 4) {
else if (hasVal > 1 && Math.abs(maxLength - minLength) > 4) {
this.table.find(a => a.prop === i.field).align = 'left';
}
})
console.log(this.table)
} catch (e) {
console.error(e)
}

@ -201,7 +201,7 @@ export default {
vModel={leasePlan.zujindiyicidaoweishijian}
></el-date-picker>
</el-form-item>
<el-form-item label="应收">
<el-form-item label="应收租金">
<el-input-number
controls={false}
precision={2}
@ -292,7 +292,7 @@ export default {
},
{
prop: "shijidaozhangriqi",
label: "实际到账日期",
label: "租金应到时间",
width: 160,
customFn: (row) => {
return (
@ -597,7 +597,7 @@ export default {
vModel={leasePlan.zujindiyicidaoweishijian}
></el-date-picker>
</el-form-item>
<el-form-item label="应收">
<el-form-item label="应收租金">
<el-input-number
controls={false}
precision={2}
@ -688,7 +688,7 @@ export default {
},
{
prop: "shijidaozhangriqi",
label: "实际到账日期",
label: "租金应到时间",
width: 160,
customFn: (row) => {
return (
@ -799,6 +799,9 @@ export default {
label: "区域",
width: 0,
align: "center",
"formatter": (data, row, value) => {
return this.wxAreas[value]
}
},
{
prop: "name",
@ -1046,6 +1049,9 @@ export default {
label: "区域",
width: 0,
align: "center",
"formatter": (data, row, value) => {
return this.wxAreas[value]
}
},
{
prop: "name",
@ -1196,6 +1202,15 @@ export default {
},
data() {
return {
wxAreas: [
"宜兴市",
"惠山区",
"新吴区",
"梁溪区",
"江阴市",
"滨湖区",
"锡山区",
],
isShowOldData: true,
nowAssets: [],
oldNowAssets: [],
@ -1386,6 +1401,7 @@ export default {
//
if (this.type === "change") {
let logData = deepCopy(this.originalForm)
logData.original_lease_id = logData.id;
delete logData.id;
for (let key in logData) {
if (/_relation/g.test(key)) {

Loading…
Cancel
Save