master
xy 3 years ago
parent c944b75d31
commit 818ef69158

@ -635,7 +635,7 @@ export default {
dom.push(<el-dropdown-item divided command="edit">编辑</el-dropdown-item>)
}
if (this.auths.indexOf('delete') !== -1) {
dom.push(<el-dropdown-item command="delete">删除</el-dropdown-item>)
dom.push(<el-dropdown-item command="delete"><span style="color: red;">删除</span></el-dropdown-item>)
}
return dom;
})()

@ -0,0 +1,253 @@
<template>
<div>
<Modal
ref="dialog"
v-model="isShow"
title="附件"
:footer-hide="true"
>
<el-upload
style="width: 400px"
ref="upload"
multiple
:on-success="successHandle"
:before-upload="uploadBefore"
:before-remove="beforeRemove"
accept=".jpg,.png,.gif"
:action="action"
:file-list="fileList"
:on-remove="removeHande"
:limit="100"
list-type="picture"
>
<el-button slot="trigger" size="small" type="primary"
>选取文件
</el-button
>
<div slot="tip" class="el-upload__tip">
只能上传jpg/png/gif文件
<br/>单个文件不能超过50M
</div>
</el-upload>
</Modal>
</div>
</template>
<script>
import { save, index, destroy } from '@/api/system/baseForm'
export default {
props: {},
data() {
return {
isShow: false,
id: '',
type: '',
action: process.env.VUE_APP_UPLOAD_API,
fileList: [],
form: {
file: []
},
rules: {
name: [
{
required: true,
message: '请填写名称'
}
],
upload_id: [
{
validator: (rule, value, callback) => {
if (this.fileList.length > 0) {
callback()
} else {
callback(new Error('请上传文件'))
}
},
message: '请上传文件'
}
]
}
}
},
methods: {
show() {
this.isShow = true
},
hidden() {
this.isShow = false
},
init() {
this.form = {
file: []
}
},
setId(id) {
if (typeof id == 'number') {
this.id = id
} else {
console.error('error typeof id: ' + typeof id)
}
},
getId() {
return this.id
},
setType(type = 'add') {
let types = ['add', 'editor']
if (types.includes(type)) {
this.type = type
} else {
console.warn('Unknown type: ' + type)
}
},
setForm(key = [], value = []) {
if (key instanceof Array) {
key.forEach((key, index) => {
this.form[key] = value[index] ?? ''
})
}
if (typeof key === 'string') {
this.form[key] = value
}
if (!key) {
this.init()
}
},
//
successHandle(response, file, fileList) {
this.fileList = fileList
this.submit(response)
},
removeHande(file, fileList) {
this.fileList = fileList
},
uploadBefore(file) {
console.log(file)
if (file.size / 1000 > 50 * 1024) {
this.$message({
type: 'warning',
message: '上传图片大小超过50M'
})
return false
}
},
beforeRemove(file, fileList) {
return this.$confirm('确认要删除吗?').then(res => {
destroy({
table_name: 'assets_atlas_files',
id: file.response.id
}).then(_ => true).catch(_ => false)
})
},
async getDetail() {
const res = await index({
table_name: 'asset_file_files',
page: 1,
page_size: 999,
filter: [
{
key: /\/land/g.test(this.$route.path) ? 'land_id' : 'house_id',
op: 'eq',
value: this.id
}
]
})
this.fileList = res.data.map((item) => {
return {
name: item.original_name,
url: item.url,
response: item
}
})
this.$integrateData(this.form, res)
},
submit(response) {
save({
table_name: 'asset_file_files',
file_id: response.id,
[/\/land/g.test(this.$route.path) ? 'land_id' : 'house_id']: this.id,
name: response.name,
original_name: response.original_name,
//TODO:
url: response.url.replace(/:\/\/:\/\//g, '://')
}).then(res => {
this.$message({
type: 'success',
message: '附件上传成功'
})
})
}
},
watch: {
isShow(val) {
if (val) {
this.getDetail()
} else {
this.id = ''
this.type = ''
this.fileList = []
}
}
}
}
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
.img__delete {
transform: scale(0.8, 0.8);
position: absolute;
top: 4px;
right: 4px;
}
::v-deep .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
::v-deep .avatar-uploader .el-upload:hover {
border-color: $primaryColor;
}
::v-deep .el-upload--picture-card {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar {
width: 80px !important;
display: block;
border-radius: 6px;
}
::v-deep .el-input__inner {
text-align: left;
}
</style>

@ -272,7 +272,7 @@
:destroy-req-opt="select"
:table-item="table"
:btn-to-more="true"
:more-auths="['edit','delete','picture']"
:more-auths="['edit','delete','picture','file']"
@detail="
(row) => {
$router.push({
@ -292,6 +292,10 @@
$refs['atlas'].setId(row.id);
$refs['atlas'].show();
}"
@file="(row) => {
$refs['files'].setId(row.id);
$refs['files'].show();
}"
>
<template #leave="{ row }">
<Button
@ -312,6 +316,11 @@
>图集</span
>
</template>
<template #file="{row}">
<span
>附件</span
>
</template>
</xy-table>
<add
@ -324,6 +333,7 @@
<history ref="history"></history>
<lease ref="lease"></lease>
<atlas ref="atlas"></atlas>
<files ref="files"></files>
<!-- <imports-->
<!-- :table-name="customForm.tableName"-->
<!-- :form-info="form"-->
@ -354,6 +364,7 @@ import addHistory from "@/views/assets/component/addHistory.vue";
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 drawer from "@/views/component/drawer.vue";
// import imports from "./imports.vue";
// import atlas from "@/views/assets/atlas.vue";
@ -367,6 +378,7 @@ export default {
LxHeader,
add,
headerContent,
files,
// drawer,
// imports,

@ -248,7 +248,7 @@
:destroy-req-opt="select"
:table-item="table"
:btn-to-more="true"
:more-auths="['edit','delete','picture']"
:more-auths="['edit','delete','picture','file']"
@detail="
(row) => {
$router.push({
@ -267,6 +267,10 @@
$refs['atlas'].setId(row.id);
$refs['atlas'].show();
}"
@file="(row) => {
$refs['files'].setId(row.id);
$refs['files'].show();
}"
>
<template #leave="{ row }">
<Button
@ -291,6 +295,12 @@
>图集</span
>
</template>
<template #file="{row}">
<span
>附件</span
>
</template>
</xy-table>
<add
@ -303,6 +313,7 @@
<history ref="history"></history>
<lease ref="lease"></lease>
<atlas ref="atlas"></atlas>
<files ref="files"></files>
<!-- <drawer-->
<!-- :table-name="customForm.tableName"-->
<!-- :form-info="form"-->
@ -338,6 +349,7 @@ import lease from '@/views/assets/lease.vue';
// import drawer from "@/views/component/drawer.vue";
import imports from "@/views/component/imports.vue";
import atlas from "@/views/assets/atlas.vue";
import files from "@/views/assets/files.vue";
// import assetsHistoryList from '@/views/assets/assetsHistoryList.vue'
export default {
name: 'tableList',
@ -350,7 +362,7 @@ export default {
atlas,
// drawer,
imports,
files,
// assetsHistoryList
},
mixins: [authMixin],

@ -68,12 +68,14 @@
<template>
<template
v-if="
detail.id_assets_file_files_file_id_relation &&
detail.id_assets_file_files_file_id_relation.length > 0
(detail.id_asset_file_files_land_id_relation &&
detail.id_asset_file_files_land_id_relation.length > 0) ||
(detail.id_asset_file_files_house_id_relation &&
detail.id_asset_file_files_house_id_relation.length > 0)
"
>
<div
v-for="item in detail.id_assets_file_files_file_id_relation"
v-for="item in /\/land/g.test($route.path) ? detail.id_asset_file_files_land_id_relation : detail.id_asset_file_files_house_id_relation"
style="display: flex; justify-content: space-between"
>
<a :download="item.url">{{ item.original_name }}</a>
@ -108,18 +110,20 @@
<template>
<template
v-if="
detail.id_assets_picture_files_file_id_relation &&
detail.id_assets_picture_files_file_id_relation.length > 0
(detail.id_asset_picture_files_land_id_relation &&
detail.id_asset_picture_files_land_id_relation.length > 0) ||
(detail.id_asset_picture_files_house_id_relation &&
detail.id_asset_picture_files_house_id_relation.length > 0)
"
>
<div
v-for="item in detail.id_assets_picture_files_file_id_relation"
v-for="item in /\/land/g.test($route.path) ? detail.id_asset_picture_files_land_id_relation : detail.id_asset_picture_files_house_id_relation"
>
<el-image
style="width: 100%; height: 100%"
:src="item.url"
:preview-src-list="
detail.id_assets_picture_files_file_id_relation.map(
(/\/land/g.test($route.path) ? detail.id_asset_picture_files_land_id_relation : detail.id_asset_picture_files_house_id_relation).map(
(i) => i.url
)
"
@ -200,6 +204,20 @@
资产安全
</div>
</el-card>
<el-card id="detail-contract" v-if="/\/land/g.test(this.$route.path)">
<div class="el-descriptions__header el-descriptions__title">
租凭合同
</div>
<xy-table :is-page="false" :height="300" :list="detail.id_leases_land_id_relation" :table-item="leaseTable" style="margin-top: 20px" size="mini" stripe ref="table1" :auths="[]" ></xy-table>
</el-card>
<el-card id="detail-repair">
<div class="el-descriptions__header el-descriptions__title">
维修保养
</div>
</el-card>
</el-col>
<el-col :span="3">
<Anchor show-ink :offset-top="64">
@ -215,6 +233,8 @@
<AnchorLink href="#detail-histories" title="历史沿革" />
<AnchorLink href="#detail-assetsMap" title="资产地图" />
<AnchorLink href="#detail-safe" title="资产安全"></AnchorLink>
<AnchorLink href="#detail-contract" title="租凭合同"></AnchorLink>
<AnchorLink href="#detail-repair" title="维修保养"></AnchorLink>
</Anchor>
</el-col>
</el-row>
@ -269,6 +289,71 @@ export default {
["dikuaimianji", "m²"],
["muqianjunjia", "元"],
]),
leaseTable: [
{
fixed: 'left',
type: 'index',
width: 46,
},
{
label: '地块名称',
prop: 'dikuaimingcheng',
width: 180,
fixed: 'left',
align: 'left'
},
{
label: '出租房',
prop: 'chuzufang',
width: 150
},
{
label: '承租方',
prop: 'chengzufang',
width: 150
},
{
label: '租聘期限',
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>
)
}
},
{
label: '应收租金',
prop: 'yingshouzujin',
align: 'right',
width: 120
},
{
label: '实收租金',
prop: 'shishouzujin',
align: 'right',
width: 120
},
{
label: '保证金',
prop: 'baozhengjin',
width: 120,
customFn:row => {
return (
<div style={{'text-align': row.baozhengjin === '无' ? 'center' : 'right' }}>{ row.baozhengjin }</div>
)
}
},
{
label: '未到位原因',
prop: 'weidaoweiyuanyin',
minWidth: 140
}
]
};
},
methods: {

Loading…
Cancel
Save