修改文档

master
xy 2 years ago
parent cc4a9beae6
commit c10c9a2dd0

@ -1,11 +1,17 @@
<template>
<div id="app">
<router-view />
<onlineFile></onlineFile>
</div>
</template>
<script>
import onlineFile from "@/components/onlineFile/onlineFile.vue"
export default {
components: {
onlineFile
},
name: 'App'
}
</script>

@ -0,0 +1,49 @@
<template>
<div>
<Modal
:width="76"
transfer
:z-index="9999"
v-model="showModal"
:footer-hide="true"
title="预览"
>
<template>
<iframe
style="width: 100%; height: 57vh"
:src="codeUri"
border="0"
></iframe>
</template>
</Modal>
</div>
</template>
<script>
export default {
data() {
return {
showModal:false,
codeUri: "",
}
},
methods: {
open(url) {
this.codeUri = `${process.env.VUE_APP_PREVIEW}?url=${encodeURIComponent(
new Buffer(url).toString("base64")
)}`;
this.showModal = true;
}
},
computed: {},
created() {
this.$bus.$on('online-file',(url) => this.open(url))
},
beforeDestroy() {
this.$bus.$off('online-file')
}
}
</script>
<style scoped lang="scss">
</style>

@ -106,15 +106,15 @@ const actions = {
page: 1,
page_size: 999,
filter: [
{
key: 'zulinjieshuqixian',
op: 'range',
value: `${$moment().format("YYYY-MM-DD")},${preDate}`
},
// {
// key: 'zulinjieshuqixian',
// op: 'range',
// value: `${$moment().format("YYYY-MM-DD")},${preDate}`
// },
{
key: 'zulinkaishiqixian',
op: 'range',
value: ``
value: `1999-01-01,${$moment().format("YYYY-MM-DD")}`
}
]
}).then(res => {

@ -1,6 +1,6 @@
import { domMap } from "@/const/inputType";
import { addPropsMap } from "@/const/addProps";
import { download } from "@/utils/downloadRequest";
export class CreateDialog {
replaces;
self;
@ -44,6 +44,8 @@ export class CreateDialog {
let that = this.self;
that.file[field] = that.file[field].filter((item) => item !== file);
that.file = Object.assign({}, that.file);
that.form[field] = that.file[field].map(i => i.response?.id).filter(i => i);
}
extraProps(info) {
let that = this.self;
@ -62,11 +64,12 @@ export class CreateDialog {
props.onSuccess = (response, file, fileList) => {
that.file[info.field] = fileList;
that.form[info.field] = fileList.map(i => i.response?.id).filter(i => i)
that.form[info.field] = fileList.map(i => i.response?.id).filter(i => i);
};
props.onRemove = (file, fileList) => {
that.file[info.field] = fileList;
that.form[info.field] = fileList.map(i => i.response?.id).filter(i => i);
};
props.onError = (err, file, fileList) => {
@ -236,57 +239,96 @@ export class CreateDialog {
file: (scope) => {
let { file } = scope;
return [
h("div", {}, [
h("i", {
class: {
"el-icon-circle-check":
file.status ===
"success",
"el-icon-loading":
file.status ===
"uploading",
},
style: {
color:
file.status ===
"success"
? "green"
: "",
},
}),
h(
"a",
{
attrs: {
href: file.url,
download: file.name,
target: "_blank",
},
h('div', {
style: {
display: 'flex',
'align-items': 'center'
}
},[h("div", {
style: {
'margin-right': "auto"
}
}, [
h("i", {
class: {
"uploaded-a":
"el-icon-circle-check":
file.status ===
"success",
"el-icon-loading":
file.status ===
"uploading",
},
style: {
padding: "0 4px",
color:
file.status ===
"success"
? "green"
: "",
},
}),
h(
"a",
{
attrs: {
href: file.url,
download: file.name,
target: "_blank",
},
class: {
"uploaded-a":
file.status ===
"success",
},
style: {
padding: "0 4px",
},
},
file.original_name || file.name
),
]),
h("div",{
style: {
"margin-right": "32px",
'display': file.status === 'success' ? 'block' : 'none'
}
},[
h("i",{
class: "el-icon-view",
style: {
'cursor': 'pointer',
'margin-right': '12px'
},
on: {
['click']: _ => {
that.$bus.$emit('online-file', file.url)
}
}
}),
h("i",{
class: "el-icon-download",
style: {
'cursor': 'pointer'
},
on: {
['click']: _ => {
download(file.url)
}
}
})
]),
h("i", {
class: "el-icon-close",
style: {
"display": this.options.disabled ? "none" : "inline"
},
file.original_name || file.name
),
]),
h("i", {
class: "el-icon-close",
style: {
"display": this.options.disabled ? "none" : "inline"
},
on: {
["click"]: () =>
this.fileRemoveHandler(
file,
i.field
),
},
}),
on: {
["click"]: () =>
this.fileRemoveHandler(
file,
i.field
),
},
})])
];
},
}

@ -270,7 +270,7 @@
></el-button>
<el-button
type="primary"
icon="el-icon-search"
icon="el-icon-view"
circle
size="mini"
@click="open(item.url)"
@ -306,23 +306,6 @@
</el-col>
</el-row>
<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 style="position:fixed;right: 40px;bottom: 80px;background: #fff;border-radius: 100%;width: 40px;height: 40px;display: flex;align-items: center;justify-content: center;font-size: 20px;cursor: pointer;" @click="print">
<Icon type="md-print" />
</div>
@ -368,7 +351,7 @@
></el-button>
<el-button
type="primary"
icon="el-icon-search"
icon="el-icon-view"
circle
size="mini"
@click="open(item.url)"
@ -896,11 +879,7 @@ export default {
},
open(url) {
this.codeUri = `${process.env.VUE_APP_PREVIEW}?url=${encodeURIComponent(
new Buffer(url).toString("base64")
)}`;
this.showModal = true;
this.$bus.$emit('online-file', url)
},
down(e) {

@ -60,7 +60,7 @@
></el-button>
<el-button
type="primary"
icon="el-icon-search"
icon="el-icon-view"
circle
size="mini"
@click="open(item.url)"

@ -55,22 +55,6 @@
<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>
@ -193,11 +177,11 @@ export default {
></el-button>
<el-button
type="primary"
icon="el-icon-search"
icon="el-icon-view"
circle
size="mini"
on={{
['click']:_ => this.open(row.url)
['click']:_ => this.$bus.$emit("online-file",row.url)
}}
></el-button>
</div>

@ -185,7 +185,7 @@ export default {
></el-button>
<el-button
type="primary"
icon="el-icon-search"
icon="el-icon-view"
circle
size="mini"
on={{

@ -6,7 +6,7 @@
<span>
<SvgIcon class="text-icon" icon-class="skill"></SvgIcon>
</span>
<span class="fs-xl text mx-2">资产数据</span>
<span class="fs-xl text mx-2">租赁台账</span>
</div>
<div class="d-flex">
<div class="decoration2">
@ -15,7 +15,21 @@
</div>
</div>
<div>
<Chart :cdata="cdata" />
<div>
<span v-for="item in leaseName">{{ item.name }}</span>
<div>
<div>承租方</div>
<div>{{ showLease.chengzufang }}</div>
</div>
<div>
<div>租赁期限</div>
<div>{{ showLease.zulinkaishiqixian }}~{{ showLease.zulinjieshuqixian }}</div>
</div>
<div>
<div>面积</div>
<div>{{ showLease.chengzufang }}</div>
</div>
</div>
</div>
</div>
</div>
@ -26,67 +40,35 @@ import SvgIcon from "@/components/SvgIcon"
import Chart from "@/components/Charts"
export default {
components: {
SvgIcon,
Chart
SvgIcon
},
data () {
return {
drawTiming: null,
cdata: {
year: null,
weekCategory: [],
radarData: [],
radarDataAvg: [],
maxData: 12000,
weekMaxData: [],
weekLineData: []
}
showLease: {},
timer: null,
index: 0,
}
},
mounted () {
this.drawTimingFn();
this.timer = setInterval(() => {
this.showLease = this.leaseList[this.index%this.leaseList.length]
this.index++;
},5000)
},
beforeDestroy () {
clearInterval(this.drawTiming);
clearInterval(this.timer)
},
methods: {
drawTimingFn () {
this.setData();
this.drawTiming = setInterval(() => {
this.setData();
}, 6000);
},
setData () {
let myAsset,assets;
if (this.assetsList instanceof Array) {
assets = this.assetsList.filter(i => !!(i.jiaotong || i.jiaoyu || i.shangquan || i.shushidu))
myAsset = assets[Math.floor(Math.random() * assets.length)];
}
// if (this.leaseList instanceof Array) {
// console.log(this.leaseList)
// myLease = this.leaseList[Math.floor(Math.random() * this.leaseList.length)];
// console.log(myLease)
// }
//
this.cdata.asset = myAsset??{};
this.cdata.lease = myAsset ? myAsset["id_leases_land_id_relation"] : [];
this.cdata.radarData = myAsset ? [myAsset.jiaotong, myAsset.jiaoyu, myAsset.shangquan, myAsset.shushidu] : [];
this.cdata.radarDataAvg = assets ?
[
assets.reduce((a,b) => (a + Number(b.jiaotong??0)),0)/assets.length,
assets.reduce((a,b) => (a + Number(b.jiaoyu??0)),0)/assets.length,
assets.reduce((a,b) => (a + Number(b.shangquan??0)),0)/assets.length,
assets.reduce((a,b) => (a + Number(b.shushidu??0)),0)/assets.length
] :
[0, 0, 0, 0];
}
},
computed: {
assetsList () {
return this.$store.state.bigdata.assets[1]
leaseName () {
let temp = this.index;
return [...this.showLease?.land || [],...this.showLease?.houses || []]
},
leaseList () {
return this.$store.state.bigdata.leases
return this.$store.state.bigdata.adventLeases || []
}
}
};

@ -85,6 +85,7 @@ export default {
<style scoped lang="scss">
.table {
width: 350px;
border-radius: 20px;
}
::v-deep .ivu-table {}

@ -1,5 +1,5 @@
<template>
<div>
<div style="padding: 0 20px;">
<el-page-header
:content="$route.meta.title"
style="
@ -60,7 +60,7 @@
></el-button>
<el-button
type="primary"
icon="el-icon-search"
icon="el-icon-view"
circle
size="mini"
@click="open(item.url)"
@ -104,27 +104,23 @@
:summary-method="summaryPlans"
></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="logLeases"
:table-item="logLeaseTable"
></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>
@ -144,6 +140,28 @@ export default {
showModal: false,
codeUri: "",
logLeases: [],
logLeaseTable: [
{
prop: 'biangengshijian',
label: '变更时间'
},
{
prop: "show",
label: "查看",
customFn: row => (
<div>
<Button type="primary"
size="small"
on={{
['click']: _ => {
this.$router.push( '/leaseLog/detail/' + row.id)
}
}}>查看</Button>
</div>
)
}
],
detail: {},
fields: [],
relation: [],
@ -249,11 +267,7 @@ export default {
},
methods: {
open(url) {
this.codeUri = `${process.env.VUE_APP_PREVIEW}?url=${encodeURIComponent(
new Buffer(url).toString("base64")
)}`;
this.showModal = true;
this.$bus.$emit('online-file', url)
},
down(e) {
@ -310,13 +324,7 @@ export default {
i._params = res.detail;
}
)
: this.index({
table_name: i._relations.link_table_name,
page: 1,
page_size: 9999,
}).then((res) => {
i._params = res.data;
});
: "";
}
}
});
@ -510,6 +518,23 @@ export default {
table_name: this.customForm.tableName,
});
this.detail = detail;
await this.getLogLease()
},
async getLogLease () {
const logLease = await index({
table_name: "leases_histories",
page: 1,
page_size: 999,
filter: [
{
key: 'original_lease_id',
op: 'eq',
value: this.$route.params.id
}
]
})
this.logLeases = logLease?.data || [];
},
summaryAssets ({ columns, data }) {

@ -52,7 +52,7 @@
></el-button>
<el-button
type="primary"
icon="el-icon-search"
icon="el-icon-view"
circle
size="mini"
@click="open(item.url)"

@ -60,7 +60,7 @@
></el-button>
<el-button
type="primary"
icon="el-icon-search"
icon="el-icon-view"
circle
size="mini"
@click="open(item.url)"

@ -81,7 +81,6 @@ export default {
<el-row gutter={10}>
<el-col
span={12}
style={{ display: this.isShowOldData ? "block" : "none" }}
>
<el-card style="margin-top: 20px;">
<div slot="header" style="display: flex;align-items: center;">
@ -104,15 +103,10 @@ export default {
</div>
<xy-table
row-key={(row) => {
row._relation_id
? row._relation_id
: row.hasOwnProperty("land_id")
? "house_" + row.id
: "land_" + row.id;
}}
row-style={({ row }) => {
return this.originalForm.id_leases_to_assets_lease_id_relation?.find(j => ((j.land_id === row.land_id) || (j.house_id === row.house_id))) ? '' : { 'background': 'rgba(0,255,0,0.06)' }
if (!this.originalForm.id_hisleases_to_assets_hislease_id_relation?.find(j => ((j.land_id === row.land_id && row.land_id) || (j.house_id === row.house_id && row.house_id)))) {
return { 'background': 'rgba(0,255,0,0.06)' }
}
}}
list={this.oldLease.id_leases_to_assets_lease_id_relation}
height="300"
@ -178,7 +172,7 @@ export default {
customFn: row => (
<span style={{
color: (() => {
return row.chuzumianji === this.originalForm?.id_leases_to_assets_lease_id_relation?.find(j => (j.land_id === row.land_id) || (j.house_id === row.house_id))?.chuzumianji ? '' : 'red'
return row.chuzumianji === this.originalForm?.id_hisleases_to_assets_hislease_id_relation?.find(j => (j.land_id === row.land_id) || (j.house_id === row.house_id))?.chuzumianji ? '' : 'red'
})()
}}>{ row.chuzumianji }</span>
)
@ -196,7 +190,7 @@ export default {
</div>
<div style="display: grid;grid-gap: 10px;grid-template-columns: repeat(3, 1fr);">
{this.oldLeasePlans.map((leasePlan, index) => (
{this.oldLease?.id_lease_plans_lease_id_relation?.map((leasePlan, index) => (
<Card padding={10}>
<div
slot="title"
@ -260,14 +254,7 @@ export default {
</div>
<xy-table
row-key={(row) => {
row._relation_id
? row._relation_id
: row.hasOwnProperty("land_id")
? "house_" + row.id
: "land_" + row.id;
}}
list={this.originalForm.id_leases_to_assets_lease_id_relation}
list={this.originalForm.id_hisleases_to_assets_hislease_id_relation}
row-style={({ row }) => {
return this.oldLease.id_leases_to_assets_lease_id_relation?.find(j => ((j.land_id === row.land_id) || (j.house_id === row.house_id))) ? '' : { 'background': 'rgba(255,0,0,0.06)' }
}}
@ -343,7 +330,7 @@ export default {
</div>
<div style="display: grid;grid-gap: 10px;grid-template-columns: repeat(3, 1fr);">
{this.leasePlans.map((leasePlan, index) => (
{this.originalForm?.id_hislease_plans_hislease_id_relation?.map((leasePlan, index) => (
<Card padding={10}>
<div
slot="title"
@ -365,6 +352,7 @@ export default {
<el-date-picker
style="width: 100%;"
value-format="yyyy-MM-dd"
disabled={true}
vModel={leasePlan.zujindiyicidaoweishijian}
></el-date-picker>
</el-form-item>
@ -372,6 +360,7 @@ export default {
<el-input-number
controls={false}
precision={2}
disabled={true}
style="width: 100%"
vModel={leasePlan.yingshou}
></el-input-number>
@ -489,12 +478,11 @@ export default {
}
});
this.form = Object.assign({}, this.form);
this.leasePlans = res.id_lease_plans_lease_id_relation;
this.originalForm = deepCopy(res);
if (this.originalForm.original_lease_id) {
if (res.original_lease_id) {
const oldLease = await show({
id: this.originalForm.original_lease_id,
id: res.original_lease_id,
table_name: "leases"
})
this.oldLease = oldLease;
@ -509,100 +497,6 @@ export default {
}
},
submit() {
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
}
}
if (this.type === "editor" || this.type === "change") {
Object.defineProperty(this.form, "id", {
value: this.id,
enumerable: true,
configurable: true,
writable: true,
});
}
this.form.let_id = this.$route.params.letId;
save(Object.assign(this.form, { table_name: "leases" })).then((res) => {
if (this.type !== "add") {
Promise.all([
...this.originalForm.id_leases_to_assets_lease_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",
},
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 : "",
chuzumianji: item._chuzumianji,
lease_id: res.id,
}));
if (leaseToAssetsData && leaseToAssetsData.length > 0) {
imports(
{
table_name: "leases_to_assets",
data: leaseToAssetsData,
},
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 logData = deepCopy(this.originalForm)
logData.original_lease_id = logData.id;
delete logData.id;
for (let key in logData) {
if (/_relation/g.test(key)) {
logData[key].forEach(item => {
delete item.id;
})
}
}
save(
{
...logData,
table_name: "leases_histories",
biangengshijian: this.$moment().format("YYYY-MM-DD HH:mm:ss")
},
false
);
}
this.$Message.success({
content: `${this.type === "add" ? "新增" : "编辑"}成功`,
});
this.$emit("refresh");
this.$router.push("/lease");
});
},
},
computed: {},
watch: {
@ -633,7 +527,6 @@ export default {
})
this.$nextTick(() => {
console.log(this.$refs['oldElForm'])
this.$refs['oldElForm'].validate()
})
}

@ -321,6 +321,7 @@ export default {
firstAdjustTable: true,
op,
select: {
sort_name: 'zujindiyicidaoweishijian',
table_name: "",
filter: [
{
@ -462,13 +463,7 @@ export default {
i._params = res.detail;
}
)
: this.index({
table_name: i._relations.link_table_name,
page: 1,
page_size: 9999,
}).then((res) => {
i._params = res.data;
});
: ''
}
}
});
@ -584,6 +579,46 @@ export default {
width: 120,
label: "承租方",
formatter: (row, column, cellValue) => row.lease_id_leases_id_relation?.chengzufang
},
{
label: "资产标的",
prop: 'assets',
width: 340,
align: 'left',
customFn: row => {
let tags = [
...row?.land?.map((i) =>
(
<Tag type="dot" color="#3fa45a" style="background: #e5f4ea !important;">{i.name}</Tag>
)
),
...row?.houses?.map((i) =>
(
<Tag type="dot" color="#2254e4" style="background: #e8edfc !important">{i.name}</Tag>
)
),
]
return (
<div>
{
tags.slice(0, 2)
}
<el-popover>
<el-link slot="reference"
type="primary"
style={{
"word-break": "keep-all",
display: tags.length > 2 ? "inline" : "none",
}}>更多</el-link>
<div slot="default">
{
tags
}
</div>
</el-popover>
</div>
)
}
}
])
},

@ -62,7 +62,8 @@ export default {
},
],
{
disabled: true
disabled: true,
fromFile: "originalFile"
},
false
);
@ -750,6 +751,7 @@ export default {
<el-drawer
title="土地列表"
append-to-body={true}
visible={this.landDialog}
size="64%"
on={{
@ -1000,6 +1002,7 @@ export default {
<el-drawer
title="房产列表"
append-to-body={true}
visible={this.houseDialog}
size="64%"
on={{
@ -1290,6 +1293,7 @@ export default {
this.oldLeasePlans = deepCopy(this.leasePlans)
}
this.originalForm = deepCopy(res);
this.originalFile = deepCopy(this.file);
if (this.type !== "add") {
this.originalForm?.id_leases_to_assets_lease_id_relation?.forEach(
@ -1408,10 +1412,17 @@ export default {
logData.original_lease_id = logData.id;
delete logData.id;
for (let key in logData) {
if (/_relation/g.test(key)) {
if (key === 'id_leases_to_assets_lease_id_relation') {
logData[key].forEach(item => {
delete item.id;
})
logData['id_hisleases_to_assets_hislease_id_relation'] = logData[key]
}
if (key === 'id_lease_plans_lease_id_relation') {
logData[key].forEach(item => {
delete item.id;
})
logData['id_hislease_plans_hislease_id_relation'] = logData[key]
}
}
save(

Loading…
Cancel
Save