master
xy 2 years ago
parent 1f7fd298f6
commit a1e74f5583

Binary file not shown.

After

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

@ -30,7 +30,8 @@ import Layout from '@/layout'
* a base page that does not have permission requirements
* all roles can be accessed
*/
export const constantRoutes = [{
export const constantRoutes = [
{
path: '/login',
component: () => import('@/views/login/index'),
hidden: true

@ -0,0 +1,249 @@
<script>
import { save, show, index, destroy } from "@/api/system/baseForm";
import { CreateDialog } from "@/utils/createDialog"
import { deepCopy } from "@/utils";
import { resolveFormInfo } from '@/utils/createTable'
export default {
props: {
tableName: String,
},
render(h) {
let dialog = new CreateDialog(this,[
{
key: 'chuzhileixing',
label: '处置类型',
render: h('el-select', {
props: {
value: this.form['chuzhileixing'],
filterable: true,
allowCreate: true,
defaultFirstOption: true
},
style: {
width: '100%'
},
on: {
['change']:e => {
this.form['chuzhileixing'] = e
this.$set(this,'form',Object.assign({},this.form))
}
}
},['拆迁','转让','报废'].map(i => {
return h('el-option',{
props: {
value: i,
label: i
}
})
}))
}
],{
width: "650px"
})
return dialog.render()
},
data() {
return {
columns: 1,
row: {},
formInfo: [],
id: "",
type: "add",
dialogVisible: false,
form: {},
originalForm: {},
rules: {},
file: {},
};
},
methods: {
setRow (row) {
this.row = row
},
init() {
for (let key in this.form) {
if (this.form[key] instanceof Array) {
this.form[key] = [];
} else {
this.form[key] = "";
}
}
this.$refs["elForm"].clearValidate();
},
show() {
this.dialogVisible = true;
},
hidden() {
this.dialogVisible = false;
},
setType(type = "add") {
let types = ["add", "editor", "show"];
if (types.includes(type)) {
this.type = type;
} else {
console.warn("Unknown type: " + type);
}
},
setId(id) {
if (typeof id == "number") {
this.id = id;
} else {
console.error("error typeof id: " + typeof id);
}
},
async getDetail() {
const res = await show({ id: this.id, table_name: 'his_evolutions' });
this.$integrateData(this.form, res);
this.formInfo.forEach((i) => {
if (i && (i.edit_input === "file" || i.edit_input === "files")) {
res[i._relations.link_with_name]
? (this.file[i.field] =
res[i._relations.link_with_name] instanceof Array
? res[i._relations.link_with_name].map((i) => {
return {
name: i?.name,
url: i?.url,
response: i,
};
})
: [
{
name: res[i._relations.link_with_name]?.name,
url: res[i._relations.link_with_name]?.url,
response: res[i._relations.link_with_name],
},
])
: (this.file[i.field] = []);
}
this.form = Object.assign({}, this.form);
this.originalForm = deepCopy(res);
});
},
submit() {
if (/\/house/g.test(this.$route.path)) {
this.form['house_id'] = this.row.id
}
if (/\/land/g.test(this.$route.path)) {
this.form['land_id'] = this.row.id
}
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
}
}
if (this.type === "editor") {
Object.defineProperty(this.form, "id", {
value: this.id,
enumerable: true,
configurable: true,
writable: true,
});
}
save(Object.assign(this.form, { table_name: 'asset_handles' })).then(res => {
this.$Message.success({
content: `${this.type === "add" ? "新增" : "编辑"}成功`,
});
this.$emit("refresh");
this.hidden();
})
},
},
computed: {
title () {
if (this.type === 'add') return '新增'
if (this.type === 'editor') return '编辑'
if (this.type === 'show') return '查看'
}
},
watch: {
formInfo: {
handler: function (newVal) {
this.form = {};
this.rules = {};
this.file = {};
newVal.forEach((i) => {
if (i.field) {
this.form[i.field] = "";
if (
i.validation instanceof Array &&
i.validation.length > 0 &&
!!i.validation.find((i) => i === "required")
) {
this.rules[i.field] = [
{ required: true, message: `请填写${i.name}` },
];
}
if (i.edit_input === "files") {
this.form[i.field] = [];
}
if (i.edit_input === "files" || i.edit_input === "file") {
this.file[i.field] = [];
}
if (i.edit_input === "checkbox") {
this.form[i.field] = [];
}
if (i._relations) {
this.form[i._relations?.link_with_name] = [];
}
}
});
this.columns = newVal.length > 11 ? '2' : '1'
},
//immediate: true,
},
dialogVisible(val) {
if (val) {
document.documentElement.style.setProperty(
"--column-num",
this.columns
);
if (this.type === "editor" || this.type === "show") {
this.$nextTick(() => this.getDetail());
}
} else {
this.id = "";
this.type = "";
this.init();
this.$refs["elForm"].clearValidate();
delete this.form.id;
for (let key in this.file) {
this.file[key] = [];
}
}
},
},
created() {
resolveFormInfo(27).then(res => this.formInfo = res)
}
};
</script>
<style>
:root {
--column-num: 2;
}
</style>
<style scoped lang="scss">
.uploaded-a {
color: red;
text-decoration: none;
transition: all 0.2s;
}
.uploaded-a:hover {
color: red;
text-decoration: underline;
}
.form-body {
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(var(--column-num), 1fr);
}
</style>

@ -297,6 +297,14 @@
$refs['files'].show();
}"
>
<template #handle="{ row }">
<Button
size="small"
type="primary"
@click="toHandle(row)"
>资产处置</Button
>
</template>
<template #leave="{ row }">
<Button
size="small"
@ -334,6 +342,7 @@
<lease ref="lease"></lease>
<atlas ref="atlas"></atlas>
<files ref="files"></files>
<addHandle ref="addHandle"></addHandle>
<!-- <imports-->
<!-- :table-name="customForm.tableName"-->
<!-- :form-info="form"-->
@ -365,6 +374,7 @@ import lease from '@/views/assets/lease.vue'
import atlas from '@/views/assets/atlas.vue'
import history from '@/views/assets/history.vue'
import files from "@/views/assets/files.vue";
import addHandle from '@/views/assets/component/addHandle.vue'
// import drawer from "@/views/component/drawer.vue";
// import imports from "./imports.vue";
// import atlas from "@/views/assets/atlas.vue";
@ -379,6 +389,7 @@ export default {
add,
headerContent,
files,
addHandle,
// drawer,
// imports,
@ -755,6 +766,10 @@ export default {
toLeave (row) {
this.$refs['lease'].setRow(row);
this.$refs['lease'].show();
},
toHandle (row) {
this.$refs['addHandle'].setRow(row);
this.$refs['addHandle'].show();
}
},

@ -237,7 +237,7 @@
</div>
<xy-table
:btn-width="300"
:btn-width="360"
:auths="auths_auth_mixin"
:delay-req="true"
:destroy-action="destroy"
@ -272,6 +272,14 @@
$refs['files'].show();
}"
>
<template #handle="{ row }">
<Button
size="small"
type="primary"
@click="toHandle(row)"
>资产处置</Button
>
</template>
<template #leave="{ row }">
<Button
size="small"
@ -314,6 +322,7 @@
<lease ref="lease"></lease>
<atlas ref="atlas"></atlas>
<files ref="files"></files>
<handle ref="handle"></handle>
<!-- <drawer-->
<!-- :table-name="customForm.tableName"-->
<!-- :form-info="form"-->
@ -350,6 +359,7 @@ import lease from '@/views/assets/lease.vue';
import imports from "@/views/component/imports.vue";
import atlas from "@/views/assets/atlas.vue";
import files from "@/views/assets/files.vue";
import handle from "@/views/assets/component/addHandle.vue";
// import assetsHistoryList from '@/views/assets/assetsHistoryList.vue'
export default {
name: 'tableList',
@ -363,6 +373,7 @@ export default {
// drawer,
imports,
files,
handle,
// assetsHistoryList
},
mixins: [authMixin],
@ -749,6 +760,10 @@ export default {
toLeave (row) {
this.$refs['lease'].setRow(row);
this.$refs['lease'].show();
},
toHandle (row) {
this.$refs['handle'].setRow(row);
this.$refs['handle'].show();
}
},

@ -83,14 +83,14 @@ export default {
})
: [
h(
domMap.get(i.edit_input),
domMap.get(i._params ? 'radio' : i.edit_input),
{
ref: `elEdit_${i.field}`,
style: {
width: "100%",
},
props: {
...addPropsMap.get(i.edit_input),
...addPropsMap.get(i._params ? 'radio' : i.edit_input),
...this.extraProps(i),
placeholder: i.help,
value: this.form[i.field],
@ -251,7 +251,7 @@ export default {
//
optionsRender(h, info) {
if (info.edit_input === "checkbox" || info.edit_input === "radio") {
if (info.edit_input === "checkbox" || info.edit_input === "radio" || info._params) {
return info._params && info._params instanceof Array
? info._params.map((i) =>
h("el-option", {

@ -457,14 +457,16 @@ export default {
);
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 (keys.length > 0) {
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
@ -521,7 +523,7 @@ export default {
paramMap.set(i.select_item[key], key);
});
return <span>{paramMap.get(row[i.field]?.toString())}</span>;
return <span>{ paramMap.get(row[i.field]) ? paramMap.get(row[i.field].toString()) : row[i.field] }</span>;
};
}
if (i._relations) {

@ -1,146 +0,0 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
const animationDuration = 6000
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '500px'
},
chartData: {
type: Object
}
},
data() {
return {
chart: null
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons');
this.setOptions(this.chartData);
},
setOptions(chartdata) {
console.log(chartdata.xArr)
this.chart.setOption({
dataZoom: [
//x
{
startValue: 0,
endValue: 6, //
type: 'slider',
show: true,
xAxisIndex: [0],
handleSize: 0, // 2
height: 8, //
left: 50, //
right: 40, //
bottom: 26, //
handleColor: '#EFEFEF', //h
handleStyle: {
borderColor: '#409EFF',
borderWidth: '1',
shadowBlur: 2,
background: '#EFEFEF',
shadowColor: '#EFEFEF'
},
fillerColor: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
// 410
//01
offset: 0,
color: '#409EFF'
},
{
offset: 1,
color: '#409EFF'
}
]),
backgroundColor: '#EFEFEF', //
showDataShadow: false, // auto
showDetail: false, // true
handleIcon: 'M-292,322.2c-3.2,0-6.4-0.6-9.3-1.9c-2.9-1.2-5.4-2.9-7.6-5.1s-3.9-4.8-5.1-7.6c-1.3-3-1.9-6.1-1.9-9.3c0-3.2,0.6-6.4,1.9-9.3c1.2-2.9,2.9-5.4,5.1-7.6s4.8-3.9,7.6-5.1c3-1.3,6.1-1.9,9.3-1.9c3.2,0,6.4,0.6,9.3,1.9c2.9,1.2,5.4,2.9,7.6,5.1s3.9,4.8,5.1,7.6c1.3,3,1.9,6.1,1.9,9.3c0,3.2-0.6,6.4-1.9,9.3c-1.2,2.9-2.9,5.4-5.1,7.6s-4.8,3.9-7.6,5.1C-285.6,321.5-288.8,322.2-292,322.2z',
filterMode: 'filter'
}
//
// {
// type: 'inside',
// show: true,
// xAxisIndex: [0],
// start: 0, //1
// end: 50,
// },
],
grid: {
top: 10,
left: '2%',
right: '2%',
bottom: '3%',
containLabel: true
},
xAxis: [{
type: 'category',
data: chartdata.xArr,
axisTick: {
alignWithLabel: true
}
}],
yAxis: [{
type: 'value',
minInterval: 1,
axisTick: {
show: false
}
}],
series: [{
name: '数据',
type: 'bar',
stack: 'vistors',
barWidth: '60%',
data: chartdata.yArr,
animationDuration
}]
})
}
}
}
</script>

@ -1,40 +1,69 @@
<template>
<div>
<div style="margin: 20px 0;">
<el-row :gutter="20">
<el-col :span="12">
<div class="contract__title">
<h3>制度文档</h3>
</div>
<xy-table :height="400" :table-item="table1" style="margin-top: 20px" size="mini" stripe ref="table1" :auths="[]" :action="index" :req-opt="select"></xy-table>
</el-col>
<el-col :span="12">
<div class="contract__title">
<h3>通知</h3>
</div>
<xy-table :height="400" :table-item="table1" style="margin-top: 20px" size="mini" stripe ref="table1" :auths="[]" :action="index" :req-opt="select"></xy-table>
</el-col>
</el-row>
</div>
<div class="contract">
<div class="contract__title">
<h3>租赁台账</h3>
<div>
<RadioGroup v-model="radio" type="button" button-style="solid" @on-change="radioPick">
<Radio :label="3">合约中</Radio>
<Radio :label="1">临期</Radio>
<Radio :label="2">已过期</Radio>
</RadioGroup>
</div>
<Card style="margin: 20px 0;">
<div>
<el-row :gutter="80">
<el-col :span="12">
<div class="contract__title">
<h3>通知</h3>
</div>
<div class="list">
<div class="list-item" v-for="item in notices">
<span>{{ item.name }}</span>
<span>{{ item.shijian }}</span>
</div>
<Page class="list-page" :page-size="noticeSelect.page_size" :total="noticeTotal" size="small" />
</div>
<!-- <xy-table :height="400" :table-item="table1" style="margin-top: 20px" size="mini" stripe ref="table1" :auths="[]" :action="index" :req-opt="select"></xy-table>-->
</el-col>
<el-col :span="12">
<div class="contract__title">
<h3>制度文档</h3>
</div>
<div class="list">
<div class="list-item" v-for="item in systems">
<span>{{ item.name }}</span>
<span>{{ $moment(new Date(item.created_at)).format('YYYY-MM-DD') }}</span>
</div>
<Page class="list-page" :page-size="systemSelect.page_size" :total="systemTotal" size="small" />
</div>
<!-- <xy-table :height="400" :table-item="table2" style="margin-top: 20px" size="mini" stripe ref="table1" :auths="[]" :action="index" :req-opt="select1"></xy-table>-->
</el-col>
</el-row>
</div>
<xy-table :height="400" :table-item="table1" style="margin-top: 20px" size="mini" stripe ref="table1" :auths="[]" :action="index" :req-opt="select"></xy-table>
</div>
<Divider></Divider>
<div class="contract">
<div class="contract__title">
<h3>租赁台账</h3>
</div>
<div class="type-bar">
<div class="type-bar__item" :class="{ 'type-bar__item--active': radio === 0 }" @click="radioPick(0)"></div>
<div class="type-bar__item" :class="{ 'type-bar__item--active': radio === 1 }" @click="radioPick(1)"></div>
<div class="type-bar__item" :class="{ 'type-bar__item--active': radio === 2 }" @click="radioPick(2)"></div>
<svg xmlns="http://www.w3.org/2000/svg" :style="{ 'left': 80 * radio + 'px' }" viewBox="0 0 100 10" preserveAspectRatio="xMinYMin meet">
<path d="M 0 10,L 44 10,L 50 2,L56 10,L 100 10" stroke="#aaa" stroke-width="1" fill="#fff"></path>
</svg>
</div>
<!-- <Tabs style="width: 24%;">-->
<!-- <TabPane label="合约中3"></TabPane>-->
<!-- <TabPane label="临期1"></TabPane>-->
<!-- <TabPane label="已过期2"></TabPane>-->
<!-- </Tabs>-->
<Table style="margin-top: 20px;" :loading="leaseTableLoading" size="small" stripe highlight-row :height="400" :data="leases" :columns="leaseTable"></Table>
<Page style="margin-top: 14px;display: flex;justify-content: flex-end;" size="small" :total="leaseTotal" show-elevator show-total :page-size="leaseSelect.page_size"></Page>
<!-- <xy-table :border="false" :is-page="false" :height="400" :table-item="table1" style="margin-top: 20px" size="mini" stripe ref="table1" :auths="[]" :action="index" :req-opt="select"></xy-table>-->
</div>
</Card>
</div>
</template>
@ -81,8 +110,13 @@
orderArr: [],
chartData: {},
radio: 3,
select: {
radio: 0,
config: {
time: 1,
unit: 'months'
},
leaseTableLoading: false,
leaseSelect: {
table_name: 'leases',
filter: [
{
@ -95,59 +129,78 @@
op: 'range',
value: `${this.$moment(0).format("YYYY-MM-DD")},${this.$moment().format("YYYY-MM-DD")}`
}
]
],
page: 1,
page_size: 10
},
table1: [
leases: [],
leaseTotal: 0,
leaseTable: [
{
title: '序号',
fixed: 'left',
type: 'index',
width: 46,
align: 'center',
width: 60,
render:(h, { row, column, index }) => {
return h('div',{
style: {
height: '18px',
width: '18px',
'border-radius': '100%',
color: '#fff',
background: '#4986cc',
'text-align': 'center',
'font-size': '12px'
}
},index+1)
}
},
{
label: '地块名称',
prop: 'dikuaimingcheng',
title: '地块名称',
key: 'dikuaimingcheng',
width: 180,
fixed: 'left',
align: 'left'
},
{
label: '出租方',
prop: 'chuzufang',
title: '出租方',
key: 'chuzufang',
align: 'left',
width: 150
},
{
label: '承租方',
prop: 'chengzufang',
title: '承租方',
align: 'center',
key: 'chengzufang',
width: 150
},
{
label: '租赁期限',
title: '租赁期限',
width: 190,
customFn:row => {
return (
<div>
<span>{ this.$moment(new Date(row.zulinkaishiqixian)).format('YYYY.MM.DD') }</span>
<span> - </span>
<span>{ this.$moment(new Date(row.zulinjieshuqixian)).format('YYYY.MM.DD') }</span>
</div>
)
align: 'center',
render:(h,{ row }) => {
return ('div',[
h('span',this.$moment(new Date(row.zulinkaishiqixian)).format('YYYY.MM.DD')),
h('span',' - '),
h('span',this.$moment(new Date(row.zulinjieshuqixian)).format('YYYY.MM.DD'))
])
}
},
{
label: '应收租金',
prop: 'yingshouzujin',
title: '应收租金',
key: 'yingshouzujin',
align: 'right',
width: 120
},
{
label: '实收租金',
prop: 'shishouzujin',
title: '实收租金',
label: 'shishouzujin',
align: 'right',
width: 120
},
{
label: '保证金',
prop: 'baozhengjin',
title: '保证金',
key: 'baozhengjin',
width: 120,
customFn:row => {
return (
@ -156,11 +209,27 @@
}
},
{
label: '未到位原因',
prop: 'weidaoweiyuanyin',
title: '未到位原因',
key: 'weidaoweiyuanyin',
minWidth: 140
}
]
],
systemSelect: {
table_name: 'systems',
filter: [
],
page: 1,
page_size: 10
},
systems: [],
systemTotal: 0,
noticeSelect: {
table_name: 'notices',
page: 1,
page_size: 10
},
noticeTotal: 0,
notices: [],
}
},
watch: {
@ -244,7 +313,10 @@
},
},
}
]
],
select1: {
}
})
this.line = echarts.init(document.getElementById('line-chart'))
@ -302,27 +374,69 @@
},
async radioPick (e) {
this.radio = e
if (e === 1) {
let date = this.$moment()
let preDate = date.subtract(1, "months").format("YYYY-MM-DD")
this.select.filter[0].value = `${preDate},${date.format("YYYY-MM-DD")}`
this.select.filter[1].value = ''
let preDate = date.subtract(this.config.time, this.config.unit).format("YYYY-MM-DD")
this.leaseSelect.filter[0].value = `${preDate},${date.format("YYYY-MM-DD")}`
this.leaseSelect.filter[1].value = ''
}
if (e === 2) {
this.select.filter[0].value = `${this.$moment(0).format("YYYY-MM-DD")},${this.$moment().format("YYYY-MM-DD")}`
this.select.filter[1].value = ''
this.leaseSelect.filter[0].value = `${this.$moment(0).format("YYYY-MM-DD")},${this.$moment().format("YYYY-MM-DD")}`
this.leaseSelect.filter[1].value = ''
}
if (e === 3) {
this.select.filter[0].value = `${this.$moment().format("YYYY-MM-DD")},2999-12-31`
this.select.filter[1].value = `${this.$moment(0).format("YYYY-MM-DD")},${this.$moment().format("YYYY-MM-DD")}`
if (e === 0) {
this.leaseSelect.filter[0].value = `${this.$moment().format("YYYY-MM-DD")},2999-12-31`
this.leaseSelect.filter[1].value = `${this.$moment(0).format("YYYY-MM-DD")},${this.$moment().format("YYYY-MM-DD")}`
}
this.leaseSelect.page = 1;
await this.getLeases();
},
this.$refs['table1'].getTableData(true)
async getConfig () {
const res = await index({
table_name: 'warnings',
filter: [
{
key: 'flag',
op: 'eq',
value: 'contract'
}
]
})
this.config.time = Number(res.data[0]?.time);
this.config.unit = res.data[0]?.unit;
},
async getNotices () {
const res = await index(this.noticeSelect,false);
this.notices = res.data;
this.noticeTotal = res.total;
},
async getSystems () {
const res = await index(this.systemSelect,false);
this.systems = res.data;
this.systemTotal = res.total;
},
async getLeases () {
try {
this.leaseTableLoading = true;
const res = await index(this.leaseSelect,false);
this.leases = res.data;
this.leaseTotal = res.total;
this.leaseTableLoading = false;
}catch (e) {
this.leaseTableLoading = false;
}
}
},
created() {
this.getNotices();
this.getSystems();
this.getConfig().then(_ => {
this.getLeases();
})
//this.loadData();
},
mounted() {
@ -474,4 +588,81 @@
}
}
}
.type-bar {
display: flex;
position: relative;
top: 4px;
&::before {
content: '';
height: .5px;
background: #aaa;
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
&__item {
cursor: pointer;
text-align: center;
width: 80px;
line-height: 40px;
transition: all .2s;
&--active {
color: $primaryColor;
font-weight: 600;
}
}
& > svg {
width: 80px;
transition: all .2s;
position: absolute;
left: 0;
bottom: 0;
}
}
.list {
padding: 10px 10px 0 10px;
&-page {
display: flex;
justify-content: center;
margin-top: 30px;
}
&-item {
display: flex;
align-items: center;
justify-content: space-between;
padding-left: 16px;
position: relative;
& > span + span {
color: #999;
zoom: .9;
}
&::before {
content: '';
width: 4px;
height: 4px;
border-radius: 100%;
background: $primaryColor;
transform: translateY(-50%);
position: absolute;
left: 0;
top: 50%
}
}
&-item + &-item {
margin-top: 10px;
}
}
</style>

@ -433,14 +433,16 @@ export default {
);
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 (keys instanceof Array && keys.length > 0) {
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

Loading…
Cancel
Save