master
xy 2 years ago
parent 149baff842
commit a339dd3e4c

@ -144,11 +144,12 @@ export class CreateDialog {
"padding-right": "12px",
},
props: {
model: that.form,
labelWidth: "100px",
model: this.options.disabled ? that.originalForm : that.form,
labelWidth: this.options.labelWidth || "100px",
rules: that.rules,
labelPosition: "top",
size: "small",
labelPosition: this.options.labelPosition || "top",
size: this.options.size || "small",
disabled: this.options.disabled
},
},
(() => {
@ -189,7 +190,7 @@ export class CreateDialog {
...addPropsMap.get(i.edit_input),
...this.extraProps(i),
placeholder: i.help,
value: that.form[i.field],
value: this.options.disabled ? that.originalForm[i.field] : that.form[i.field],
readonly: that.type === "show",
//disabled: that.type === 'show',
},
@ -256,6 +257,9 @@ export class CreateDialog {
]),
h("i", {
class: "el-icon-close",
style: {
"display": this.options.disabled ? "none" : "inline"
},
on: {
["click"]: () =>
this.fileRemoveHandler(
@ -346,6 +350,7 @@ export class CreateDialog {
{
props: {
size: "mini",
disabled: this.options.disabled
},
on: {
click: () => (that.dialogVisible = false),
@ -360,6 +365,7 @@ export class CreateDialog {
type: "warning",
plain: true,
size: "mini",
disabled: this.options.disabled
},
on: {
click: () => that.init(),
@ -373,6 +379,7 @@ export class CreateDialog {
props: {
type: "primary",
size: "mini",
disabled: this.options.disabled
},
on: {
click: that.submit,
@ -391,6 +398,7 @@ export class CreateDialog {
props: {
type: "warning",
plain: true,
disabled: this.options.disabled
},
on: {
click: () => that.init(),
@ -403,6 +411,7 @@ export class CreateDialog {
{
props: {
type: "primary",
disabled: this.options.disabled
},
on: {
click: that.submit,

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

File diff suppressed because it is too large Load Diff

@ -84,10 +84,10 @@ export default {
"align": "left"
},
{
"prop": "dengjimianji",
"label": "登记面积",
"prop": "shijimianji",
"label": "实际面积",
"width": 0,
"align": "center"
"align": "right"
},
{
"prop": "_chuzumianji",
@ -350,7 +350,7 @@ export default {
name: row.name,
zuoluo: row.zuoluo,
zichanweizhi: row.zichanweizhi,
dengjimianji: row.dengjimianji,
shijimianji: row.shijimianji,
_chuzumianji: 0,
_relation_id: "",
})
@ -530,7 +530,7 @@ export default {
name: row.name,
zuoluo: row.zuoluo,
zichanweizhi: row.zichanweizhi,
dengjimianji: row.dengjimianji,
shijimianji: row.shijimianji,
_chuzumianji: 0,
_relation_id: "",
land_id: row.land_id
@ -643,7 +643,7 @@ export default {
name: land.name,
zuoluo: land.zuoluo,
zichanweizhi: land.zichanweizhi,
dengjimianji: land.dengjimianji,
shijimianji: land.shijimianji,
_chuzumianji: item.chuzumianji||0,
_relation_id: item.id,
});
@ -656,7 +656,7 @@ export default {
name: house.name,
zuoluo: house.zuoluo,
zichanweizhi: house.zichanweizhi,
dengjimianji: house.dengjimianji,
shijimianji: house.shijimianji,
_chuzumianji: item.chuzumianji||0,
_relation_id: item.id,
land_id: house.land_id,

@ -0,0 +1,177 @@
<template>
<div>
<el-drawer :visible.sync="dialogVisible" title="租金收取列表" size="64%">
<div style="padding: 0 10px;">
<xy-table :action="index"
ref="xyTable"
:expand-row-keys="expands"
@expand-change="expandChange"
:default-expand-all="false"
:table-item="table"
:req-opt="select"
:is-first-req="false"
:is-handler-key="false"></xy-table>
</div>
</el-drawer>
</div>
</template>
<script>
import { index, save } from "@/api/system/baseForm"
import { deepCopy } from '@/utils'
export default {
data() {
return {
form: {},
expands: [],
select: {
table_name: "lease_plans",
filter: [
{
key: "lease_id",
op: "eq",
value: ""
}
]
},
dialogVisible: false,
table: [
{
type: "expand",
width: 120,
label: "租金收取确认",
expandFn: ({ row, $index }) => {
return (
<div style="padding-left: 40px;">
<el-form ref={`expand-form${$index}`}
label-position="top"
size="small"
rules={{
shijidaozhang: [{ required: true, message: "请输入实际到账" }],
shijidaozhangriqi: [{ required: true, message: "请选择实际到账日期" }]
}}
label-width="120px"
props={{ model: this.form }}>
<el-form-item label="实际到账" prop="shijidaozhang" required={true}>
<el-input-number
style="width: 200px"
vModel={this.form.shijidaozhang}
controls={false}
precision={2}
placeholder="请输入实际到账"
></el-input-number>
</el-form-item>
<el-form-item prop="shijidaozhangriqi" label="实际到账日期" required={true}>
<el-date-picker vModel={this.form.shijidaozhangriqi}
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>
<Button type="warning"
ghost={true}
on={{
['click']:_ => {
this.$refs[`expand-form${$index}`].resetFields()
}
}}>重置</Button>
<Button type="primary"
on={{
['click']:_ => {
this.$refs[`expand-form${$index}`].validate(valid => {
if (valid) {
console.log(this.form)
save({
...this.form,
table_name: "lease_plans"
}).then(_ => {
this.$message.success('操作成功')
this.$refs['xyTable'].getTableData()
})
} else {
return false;
}
})
}
}}>确认</Button>
</el-form-item>
</el-form>
</div>
)
}
},
{
prop: "zujindiyicidaoweishijian",
label: "租金到位时间"
},
{
prop: "yingshou",
label: "应收",
align: "right"
},
{
prop: "shijidaozhang",
label: "实际到账",
align: "right"
},
{
prop: "weidaoweiyuanyin",
label: "未到位原因",
align: "left"
},
{
prop: "shijidaozhangriqi",
label: "实际到账日期"
}
]
}
},
methods: {
index,
show () {
this.dialogVisible = true;
},
hidden () {
this.dialogVisible = false;
},
setLeaseId (id) {
this.$set(this.select.filter[0], 'value', id)
},
expandChange(row, expanded) {
if (expanded.length) {
this.expands = []
if (row) {
this.form = deepCopy(row);
this.expands.push(row.id) // pushID
}
} else {
this.expands = [] //
}
}
},
computed: {},
watch: {
dialogVisible (newVal) {
if (newVal) {
this.$nextTick(() => {
this.$refs['xyTable'].getTableData(true)
})
} else {
}
}
}
}
</script>
<style scoped lang="scss">
::v-deep .el-input-number .el-input__inner{
text-align: left;
}
</style>

@ -0,0 +1,537 @@
<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="detail.id_leases_to_assets_lease_id_relation || []" :table-item="assetTable"></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>
</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: [],
assetTable: [
{
"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>)}
},
{
"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": "chuzumianji",
"label": "出租面积",
"width": 160,
"align": "right"
},
],
leasePlanTable: [
{
prop: "zujindiyicidaoweishijian",
label: "租金到位时间",
width: 200,
},
{
prop: "yingshou",
label: "应收",
width: 160,
align: "right"
},
{
prop: "shijidaozhang",
label: "实际到账",
width: 160,
align: "right"
},
{
prop: "weidaoweiyuanyin",
label: "未到位原因",
minWidth: 180,
align: "left"
},
{
prop: "shijidaozhangriqi",
label: "实际到账日期",
width: 200,
}
]
};
},
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;
},
},
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;
}
}
</style>

@ -138,16 +138,16 @@ export default {
"width": 0,
"align": "left",
customFn: row => {
return (<span>{ row.land_id ? row.lands.name : row.house.name }</span>)
return (<span>{ row.land_id ? row.lands.zuoluo : row.house.zuoluo }</span>)
}
},
{
"prop": "dengjimianji",
"label": "登记面积",
"prop": "shijimianji",
"label": "实际面积",
"width": 0,
"align": "center",
customFn: row => {
return (<span>{ row.land_id ? row.lands.dengjimianji : row.house.dengjimianji }</span>)
return (<span>{ row.land_id ? row.lands.shijimianji : row.house.shijimianji }</span>)
}
},
{

@ -247,6 +247,7 @@
:req-opt="select"
:destroy-req-opt="select"
:table-item="table"
:btn-to-more="true"
@detail="
(row) => {
$router.push({
@ -263,7 +264,7 @@
>
<template #rentCollection="{ row }">
<template v-if="$moment().isBetween($moment(row.zulinkaishiqixian),$moment(row.zulinjieshuqixian))">
<Button size="small" type="primary" @click="$refs['addPay'].setLeaseId(row.id),$refs['addPay'].show()"></Button>
<Button size="small" type="primary" @click="$refs['payList'].setLeaseId(row.id),$refs['payList'].show()"></Button>
</template>
</template>
<template #expiredLet="{ row }">
@ -283,6 +284,7 @@
>
</add>
<addPay ref="addPay"></addPay>
<payList ref="payList"></payList>
</div>
</template>
@ -302,13 +304,15 @@ import add from "./component/addLease.vue";
import LxHeader from "@/components/LxHeader/index.vue";
import headerContent from "@/components/LxHeader/XyContent.vue";
import addPay from "@/views/lease/component/addPay.vue";
import payList from "@/views/lease/component/payList.vue"
export default {
name: 'tableList',
components: {
LxHeader,
add,
headerContent,
addPay
addPay,
payList
},
mixins: [authMixin],
provide: {

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