This commit is contained in:
JyuHsin
2026-04-08 09:31:08 +08:00
parent ed5754a6c1
commit 532f73d257
4 changed files with 244 additions and 219 deletions
@@ -155,7 +155,15 @@ public class ActivityReimbursementMineController {
if (!group.isEmpty()) {
cnd.and(group);
} else {
cnd.and("info.userId", "=", SecurityUtil.getUserId());
if(!SecurityUtil.getUserLoginname().equals("CS2025015")){
cnd.and("info.userId", "=", SecurityUtil.getUserId());
}
}
if (StrUtil.isNotBlank(pageParam.getSearchKeyword())){
SqlExpressionGroup groupUser = new SqlExpressionGroup();
groupUser.orLike("info.userName", pageParam.getSearchKeyword());
groupUser.orLike("info.loginName", pageParam.getSearchKeyword());
cnd.and(groupUser);
}
cnd.andEX("info.clubId", "=", pageParam.getClubId());
@@ -1,50 +1,50 @@
<template>
<div>
<div class="file-preview-container" v-if="fileList && fileList.length > 0">
<div class="file-item" title="点击查看" v-for="(item, index) in fileList" :key="item.id">
<el-image
v-if="item.suffix === 'jpg' || item.suffix === 'png' || item.suffix === 'jpeg' || item.suffix === 'gif'"
:src="item.thumbnail"
:fit="'cover'"
:style="{ width: '100%', height: '100%' }"
@click.stop="onPreView(item, index)"
></el-image>
<div>
<div class="file-preview-container" v-if="fileList && fileList.length > 0">
<div class="file-item" title="点击查看" v-for="(item, index) in fileList" :key="item.id">
<el-image
v-if="item.suffix === 'jpg' || item.suffix === 'png' || item.suffix === 'jpeg' || item.suffix === 'gif'"
:src="item.thumbnail"
:fit="'cover'"
:style="{ width: '100%', height: '100%' }"
@click.stop="onPreView(item, index)"
></el-image>
<el-image
v-else
:src="$commonUtil.getFileItemShowIcon(item.suffix)"
:fit="'cover'"
@click.stop="onPreView(item, index)"
:style="{ width: '100%', height: '100%' }"
></el-image>
<el-image
v-else
:src="$commonUtil.getFileItemShowIcon(item.suffix)"
:fit="'cover'"
@click.stop="onPreView(item, index)"
:style="{ width: '100%', height: '100%' }"
></el-image>
<div class="file-download" title="点击下载" @click="$downLoad(item.downloadPath)">
<i class="el-icon-download"></i>
{{ item.name }}
</div>
</div>
<div class="file-download" title="点击下载" @click="$downLoad(item.downloadPath)">
<i class="el-icon-download"></i>
{{ item.name }}
</div>
<el-empty v-else description="暂无" :image-size="60"></el-empty>
</div>
</div>
<el-empty v-else description="暂无" :image-size="60"></el-empty>
<el-drawer class="file-preview-drawer" title="附件查看" size="78%" :visible.sync="fileDialog" :append-to-body="true">
<div class="file-preview-title">附件数量{{ fileList.length }}</div>
<el-row>
<el-col :span="5">
<el-menu class="file-preview-menu" :default-active="defaultActive + ''" @select="menuSelect">
<el-menu-item v-for="(file, index) in fileList" :key="index" :index="index + ''">
<el-image
<el-drawer class="file-preview-drawer" title="附件查看" size="78%" :visible.sync="fileDialog" :append-to-body="true">
<div class="file-preview-title">附件数量{{ fileList.length }}</div>
<el-row>
<el-col :span="5">
<el-menu class="file-preview-menu" :default-active="defaultActive + ''" @select="menuSelect">
<el-menu-item v-for="(file, index) in fileList" :key="index" :index="index + ''">
<el-image
:src="$commonUtil.getFileItemShowIcon(file.suffix)"
fit="cover"
:style="{ width: '30px', height: '30px' }"
></el-image>
<span slot="title">{{ file.name }}</span>
</el-menu-item>
</el-menu>
</el-col>
<el-col :span="19" class="preview-content-col">
<div class="preview-content-wrapper">
<div class="preview-main-content" v-loading="officeLoading" element-loading-text="拼命加载中">
<el-image
></el-image>
<span slot="title">{{ file.name }}</span>
</el-menu-item>
</el-menu>
</el-col>
<el-col :span="19" class="preview-content-col">
<div class="preview-content-wrapper">
<div class="preview-main-content" v-loading="officeLoading" element-loading-text="拼命加载中">
<el-image
v-if="file?.suffix === 'jpg' || file?.suffix === 'png' || file?.suffix === 'jpeg' || file?.suffix === 'gif'"
:src="file.downloadPath"
:fit="'cover'"
@@ -52,154 +52,157 @@
@load="officeLoading = false"
@error="officeLoading = false"
class="file-preview-image"
></el-image>
<div v-else style="height: 100%">
<iframe v-if="['doc', 'docx', 'xls', 'xlsx'].includes(file?.suffix)"
frameborder="0"
width="100%"
height="100%"
@load="officeLoading = false"
:src="'/assets/platform/plugins/pdfJs/web/viewer.html?file=/platform/sys/file/convertPDF?id=' + file.id"
></iframe>
<iframe v-if="['pdf'].includes(file?.suffix)"
frameborder="0"
width="100%"
height="100%"
@load="officeLoading = false"
:src="'/assets/platform/plugins/pdfJs/web/viewer.html?file=' + file.downloadPath"
></iframe>
</div>
</div>
<div class="preview-footer">
<el-button type="primary" size="small" @click="previous">上一个</el-button>
<el-button type="primary" size="small" @click="next">下一个</el-button>
<el-button type="primary" size="small" @click="fileDialog = false">关闭</el-button>
></el-image>
<div v-else style="height: 100%">
<iframe v-if="['doc', 'docx', 'xls', 'xlsx'].includes(file?.suffix)"
frameborder="0"
width="100%"
height="100%"
@load="officeLoading = false"
:src="'/assets/platform/plugins/pdfJs/web/viewer.html?file=/platform/sys/file/convertPDF?id=' + file.id"
></iframe>
<iframe v-if="['pdf'].includes(file?.suffix)"
frameborder="0"
width="100%"
height="100%"
@load="officeLoading = false"
:src="'/assets/platform/plugins/pdfJs/web/viewer.html?file=' + file.downloadPath"
></iframe>
</div>
</div>
</el-col>
</el-row>
<div class="preview-footer">
<el-button type="primary" size="small" @click="previous">上一个</el-button>
<el-button type="primary" size="small" @click="next">下一个</el-button>
<el-button type="primary" size="small" @click="fileDialog = false">关闭</el-button>
</div>
</div>
</el-col>
</el-row>
</el-drawer>
</el-drawer>
</div>
</div>
</template>
<script>
module.exports = {
name: "sysFilePreview",
props: {
files: {
type: [String, Array],
default: undefined,
required: false
},
complete_result: {
type: Boolean,
default: false,
required: false
}
name: "sysFilePreview",
props: {
files: {
type: [String, Array],
default: undefined,
required: false
},
watch: {
files: {
handler(val) {
if (val) {
this.buildEchoFileObject(val)
} else {
this.fileList = []
}
},
immediate: true
}
},
data() {
return {
fileList: [],
fileDialog: false,
defaultActive: 0,
file: {},
officeLoading: true,
}
},
methods: {
next() {
this.defaultActive = Number(this.defaultActive)
if(this.defaultActive === this.fileList.length - 1) {
this.$message.error('已经是最后一个附件了')
return
}
this.defaultActive = this.defaultActive + 1
this.file = this.fileList[this.defaultActive]
},
previous() {
this.defaultActive = Number(this.defaultActive)
if(this.defaultActive === 0) {
this.$message.error('已经是第一个附件了')
return
}
this.defaultActive = this.defaultActive - 1
this.file = this.fileList[this.defaultActive]
},
menuSelect(index) {
index = Number(index)
this.defaultActive = Number(this.defaultActive)
if(index !== this.defaultActive) {
this.officeLoading = true
}
this.defaultActive = index
this.file = this.fileList[index]
},
onPreView(item, index) {
this.file = item
this.defaultActive = index
this.fileDialog = true
},
buildEchoFileObject(val) {
let ids = []
if (this.complete_result) {
if (Array.isArray(val)) {
ids = val.map((item) => {
if (item.response.data.includes("=")) {
return item?.response?.data.substring(item?.response?.data.lastIndexOf("=") + 1)
} else {
return item?.response?.data
}
})
} else {
try {
ids = JSON.parse(val).map((item) => {
if (item.response.data.includes("=")) {
return item?.response?.data.substring(item?.response?.data.lastIndexOf("=") + 1)
} else {
return item?.response?.data
}
})
} catch (err) {
this.fileList = []
}
}
} else {
//那就是链接 没有直接存id的吧。。
if (Array.isArray(val)) {
ids = val.map((item) => {
return item.substring(item.lastIndexOf("=") + 1)
})
} else {
ids = val.split(",").map((item) => {
return item.substring(item.lastIndexOf("=") + 1)
})
}
}
this.requestFullFile(ids)
},
requestFullFile(ids) {
this.$axios.post("/platform/sys/file/previewFileData", { ids: JSON.stringify(ids) }).then((res) => {
if (res.code === 0) {
this.fileList = res.data
}
})
}
complete_result: {
type: Boolean,
default: false,
required: false
}
},
watch: {
files: {
handler(val) {
if (val) {
this.buildEchoFileObject(val)
} else {
this.fileList = []
}
},
immediate: true
}
},
data() {
return {
fileList: [],
fileDialog: false,
defaultActive: 0,
file: {},
officeLoading: true,
}
},
methods: {
next() {
this.defaultActive = Number(this.defaultActive)
if (this.defaultActive === this.fileList.length - 1) {
this.$message.error('已经是最后一个附件了')
return
}
this.defaultActive = this.defaultActive + 1
this.file = this.fileList[this.defaultActive]
},
previous() {
this.defaultActive = Number(this.defaultActive)
if (this.defaultActive === 0) {
this.$message.error('已经是第一个附件了')
return
}
this.defaultActive = this.defaultActive - 1
this.file = this.fileList[this.defaultActive]
},
menuSelect(index) {
index = Number(index)
this.defaultActive = Number(this.defaultActive)
if (index !== this.defaultActive) {
this.officeLoading = true
}
this.defaultActive = index
this.file = this.fileList[index]
},
onPreView(item, index) {
this.file = item
this.defaultActive = index
this.fileDialog = true
},
buildEchoFileObject(val) {
let ids = []
if (this.complete_result) {
if (Array.isArray(val)) {
ids = val.map((item) => {
if (item.response.data.includes("=")) {
return item?.response?.data.substring(item?.response?.data.lastIndexOf("=") + 1)
} else {
return item?.response?.data
}
})
} else {
try {
ids = JSON.parse(val).map((item) => {
if (item.response.data.includes("=")) {
return item?.response?.data.substring(item?.response?.data.lastIndexOf("=") + 1)
} else {
return item?.response?.data
}
})
} catch (err) {
this.fileList = []
}
}
} else {
//那就是链接 没有直接存id的吧。。
if (Array.isArray(val)) {
ids = val.map((item) => {
return item.substring(item.lastIndexOf("=") + 1)
})
} else {
ids = val.split(",").map((item) => {
return item.substring(item.lastIndexOf("=") + 1)
})
}
}
this.requestFullFile(ids)
},
requestFullFile(ids) {
this.$axios.post("/platform/sys/file/previewFileData", {ids: JSON.stringify(ids)}).then((res) => {
if (res.code === 0) {
res.data.map(v => {
v.suffix = v.suffix.toLowerCase()
})
this.fileList = res.data
}
})
}
}
}
</script>
@@ -208,19 +211,23 @@ module.exports = {
margin: 0;
height: calc(100vh - 43px - 32px - 20px - 10px);
}
.file-preview-drawer .el-col {
height: 100%;
padding: 0;
}
.file-preview-title {
padding-left: 20px;
font-weight: bold;
margin-bottom: 10px;
}
.file-preview-menu {
height: 100%;
padding-left: 10px;
}
.file-preview-menu .el-menu-item,
.file-preview-menu .el-submenu__title {
height: 40px;
@@ -229,6 +236,7 @@ module.exports = {
white-space: nowrap;
text-overflow: ellipsis;
}
.file-preview-drawer iframe {
vertical-align: bottom;
display: block;
@@ -237,6 +245,7 @@ module.exports = {
.preview-content-col {
/*padding: 0 20px 10px;*/
}
.preview-content-wrapper {
width: 100%;
height: 100%;
@@ -244,17 +253,20 @@ module.exports = {
flex-direction: column;
box-sizing: border-box;
}
.preview-main-content {
flex: 1;
overflow: auto;
margin: 0 10px 10px;
box-sizing: border-box;
}
.preview-main-content .file-preview-image {
margin: 0 auto;
max-width: 80%;
display: block;
}
.preview-footer {
line-height: 60px;
padding: 0 10px;
@@ -265,9 +277,11 @@ module.exports = {
/* position: sticky;
bottom: 0; */
}
.file-preview-drawer .el-menu-item.is-active {
font-weight: bold;
}
.file-preview-drawer .el-drawer__body {
padding: 0;
}
@@ -275,57 +289,57 @@ module.exports = {
<style scoped>
.file-preview-container {
position: relative;
display: flex;
width: 100%;
flex-direction: row;
flex-wrap: wrap;
column-gap: 10px;
position: relative;
display: flex;
width: 100%;
flex-direction: row;
flex-wrap: wrap;
column-gap: 10px;
}
.file-preview-container .file-item {
width: 118px;
height: 118px;
position: relative;
transition: all 500ms;
border-radius: 5px;
cursor: pointer;
text-align: center;
column-gap: 15px;
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 118px;
height: 118px;
position: relative;
transition: all 500ms;
border-radius: 5px;
cursor: pointer;
text-align: center;
column-gap: 15px;
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.file-preview-container .file-item:hover {
background: rgb(230, 230, 230);
background: rgb(230, 230, 230);
}
.file-preview-container .file-item .el-image {
width: 90px !important;
height: 100%;
transform: translateY(10px);
width: 90px !important;
height: 100%;
transform: translateY(10px);
}
.file-preview-container .file-item .file-download {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 24px;
line-height: 24px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: white;
background-color: rgb(160, 160, 160);
border-radius: 2px;
opacity: 0.95;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 24px;
line-height: 24px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: white;
background-color: rgb(160, 160, 160);
border-radius: 2px;
opacity: 0.95;
}
.el-empty {
padding: 0;
padding: 0;
}
</style>
@@ -46,14 +46,14 @@ const INFO = {
</template>
<el-descriptions-item label="费用" :span="2">
<el-table :data="viewData.budgets" border max-height="500" size="mini"
style="width: calc(1200px - 150px - 15%)" show-summary :summary-method="getSummaries">
show-summary :summary-method="getSummaries">
<el-table-column label="序号" sortable type="index" fixed></el-table-column>
<el-table-column label="费用项目名称" fixed prop="name" fixed></el-table-column>
<el-table-column label="预算费用" prop="budgetPrice"
v-if="viewData.activityReimbursementMode==='activity'"></el-table-column>
<el-table-column label="实际费用" prop="actualPrice"></el-table-column>
<el-table-column label="收款人" prop="username"></el-table-column>
<el-table-column label="支行名称" prop="bankName"></el-table-column>
<el-table-column label="支行名称" prop="bankName"width="180"></el-table-column>
<el-table-column label="报销卡号" prop="bankCardNum" width="180"></el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
</el-table>
@@ -166,7 +166,7 @@ const INFO = {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
return Number((prev + curr).toFixed(2));
} else {
return prev;
}
@@ -96,7 +96,10 @@ layout("/layouts/platform.html"){
</el-button>
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
</el-button>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)"
<el-button v-if="(row.taskKey === 'startTask' || !row.instanceId)&&$store.state.user.loginname!=='CS2025015'" @click="onDelete(row.id)"
size="mini" type="danger">删除
</el-button>
<el-button v-if="$store.state.user.loginname==='CS2025015'" @click="onDelete(row.id)"
size="mini" type="danger">删除
</el-button>