bug修复

This commit is contained in:
hongchao 2025-03-19 15:29:39 +08:00
parent 5f31bb9f09
commit e76d4346e4
6 changed files with 238 additions and 32 deletions

View File

@ -119,6 +119,15 @@ export function editRelief(params){
})
}
// 查询费用结算申请详情
export function getProjectListByUnitIds(params){
return request({
url: '/material/slt_agreement_info/getProjectListByUnitIds',
method: 'post',
data: params
})
}

View File

@ -24,7 +24,12 @@
</el-form-item>
<el-form-item label="审核状态" prop="taskStatus">
<el-select v-model="queryParams.taskStatus" placeholder="请选择审核状态" clearable>
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
<el-option
v-for="dict in dict.type.lease_apply_task_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
@ -65,14 +70,7 @@
>
<!-- 插槽 -->
<template v-slot="scope" v-if="column.prop == 'taskStatus'">
<el-tag v-if="scope.row.taskStatus == '0'" type="warning" size="mini" style="margin-right: 5px">
待审核
</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '6'" size="mini" style="margin-right: 5px">审核中</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '1' || scope.row.taskStatus == '3' || scope.row.taskStatus == '4'" type="success" size="mini" style="margin-right: 5px">
已完成
</el-tag>
<el-tag v-else-if="scope.row.taskStatus == '5'" size="mini" style="margin-right: 5px">待提交</el-tag>
<dict-tag :options="dict.type.lease_apply_task_status" :value="scope.row.taskStatus"/>
</template>
</el-table-column>
<!-- 操作 -->
@ -268,6 +266,7 @@ import printJS from 'print-js'
import { getLeaseTaskList, deleteLeaseTask, getLeaseTask, getCodePDF } from '@/api/business/index'
export default {
dicts: ['lease_apply_task_status'],
data() {
return {
showSearch: true,
@ -280,9 +279,11 @@ export default {
},
//
statusOptions: [
{ label: '待提交', value: '5' },
{ label: '待审核', value: '0' },
{ label: '审核中', value: '6' },
{ label: '已完成', value: '1' }
{ label: '已完成', value: '2' },
{ label: '已驳回', value: '3' },
],
total: 0, //
//

View File

@ -1,14 +1,18 @@
<template>
<div class="app-container" id="costApplyList">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="80px">
<el-form-item prop="unitIds">
<el-form-item >
<treeselect
v-model="queryParams.unitId"
ref="treeselectRef"
v-model="unitIds"
:options="unitList" :normalizer="normalizer"
:show-count="true" style="width: 240px" :disable-branch-nodes="true"
:show-count="true" style="width: 300px;"
:disable-branch-nodes="true"
noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
placeholder="请选择结算单位" @select="unitChange"
/>
:multiple="true"
>
</treeselect>
<!-- <el-cascader v-model="unitIds"
:show-all-levels="false"
:options="unitList"
@ -17,6 +21,7 @@
clearable
collapse-tags
@change="unitChange"
popper-class="popper-select"
placeholder="请选择单位"
></el-cascader> -->
</el-form-item>
@ -70,13 +75,13 @@
@click="resetQuery"
>重置</el-button
>
<!-- <el-button
<el-button
type="primary"
plain
size="mini"
@click="handleApplyList"
>批量结算</el-button
> -->
>
<el-button
type="primary"
plain
@ -231,11 +236,11 @@
<script>
import {
getProjectList,
// getProjectList,
getUnitList,
getAgreementInfoById,
} from '@/api/back/index.js'
import { getSltAgreementInfo } from '@/api/cost/cost'
import { getSltAgreementInfo,getProjectListByUnitIds } from '@/api/cost/cost'
import vueEasyPrint from "vue-easy-print";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -259,13 +264,13 @@ export default {
unitList: [],
//
proList: [],
unitIds: null,
unitIds: [],
projectIds: null,
selectTreeProps: {
children: 'children',
label: 'name',
value: 'id',
// multiple: true,//false
multiple: true,//false
},
// statusList: [
// { id: '1', name: '' },
@ -289,9 +294,20 @@ export default {
openPrint:false
}
},
// updated() {
// this.$nextTick(() => {
// // ref treeselect DOM
// const treeselectElm = this.$refs.treeselectRef.$el;
// if (treeselectElm && typeof treeselectElm.getBoundingClientRect === 'function') {
// const rect = treeselectElm.getBoundingClientRect();
// // rect
// console.log(rect);
// }
// });
// },
created() {
this.GetUnitData()
this.GetProData()
// this.GetProData()
this.getList()
},
methods: {
@ -317,11 +333,15 @@ export default {
this.getAgreementInfo()
},
unitChange(val){
console.log('Selected values:', val); //
// this.unitIds.push(Number(val.id));
// if(val&&val.length>0){
// this.queryParams.unitId=this.unitIds[this.unitIds.length - 1]
// }else if(val&&val.length==0){
// this.queryParams.unitId=""
// }
console.log("xxxxxxxxx",this.queryParams.unitId)
console.log("yyyyyyyyy",this.unitIds)
// this.GetProData()
setTimeout(()=>{
this.queryParams.projectId=null
@ -332,10 +352,11 @@ export default {
},
//
async GetProData() {
const unitIdsAsNumbers = this.unitIds.map(id => Number(id));
const params = {
unitId: this.queryParams.unitId,
unitIds: unitIdsAsNumbers,
}
const res = await getProjectList(params)
const res = await getProjectListByUnitIds(params)
this.proList = res.data;
this.getAgreementInfo()

View File

@ -1107,7 +1107,7 @@ export default {
text-align: center;
font-size: 12px;
color: #333;
z-index: 999999;
// z-index: 999999;
}
.file-overlay {

View File

@ -260,6 +260,7 @@ export default {
endTime: this.queryParams.time && this.queryParams.time[1],
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum,
taskStatus: this.queryParams.taskStatus,
};
getInventoryList(params).then((response) => {
this.typeList = response.data.rows;

View File

@ -28,10 +28,50 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置
</el-button>
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</el-form-item>
<el-form-item label="附件" prop="bmFileInfos">
<el-upload
:action="uploadUrl"
:file-list="maForm.bmFileInfos"
:show-file-list="true"
:auto-upload="true"
:key="uploadKey"
:limit="5"
list-type="picture-card"
accept=".png, .jpg, .jpeg, .pdf"
:class="{ disabledFbs: uploadDisabled }"
:on-preview="picturePreviewFbs"
>
<!-- 文件格式下载图片格式预览 -->
<div slot="file" slot-scope="{ file }">
<img v-if="isImage(file)" class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
<div v-else class="picture-card-container">
<img class="picture-card" :src="urlTemp" alt="" />
<p class="file-name">{{ file.name }}</p>
</div>
<span class="el-upload-list__item-actions">
<span v-if="updataIf(file)" class="el-upload-list__item-delete" @click="handleDownload(file)">
<i class="el-icon-download" />
</span>
<span v-else class="el-upload-list__item-preview" @click="picturePreviewFbs(file)">
<i class="el-icon-zoom-in" />
</span>
</span>
</div>
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
@ -42,19 +82,19 @@
>导出</el-button
>
</el-col>
</el-row>
</el-row> -->
<el-table v-loading="loading" :data="equipmentList">
<el-table-column label="序号" align="center" type="index" />
<el-table-column
label="物资类型"
align="center"
prop="typeName"
prop="maTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="typeModelName"
prop="typeName"
:show-overflow-tooltip="true"
/>
<el-table-column
@ -90,6 +130,10 @@
:show-overflow-tooltip="true"
/>
</el-table>
<!-- 图片查看弹窗 -->
<el-dialog :visible.sync="dialogVisible" width="600px" height="600px">
<img width="100%" height="500px" :src="dialogImageUrl" />
</el-dialog>
</div>
</template>
@ -98,6 +142,7 @@
import {
getScrapInfo
} from "@/api/repair/scrapLedgerReview";
import { downloadFile, downloadFileData } from '@/utils/download'
import { getToken } from "@/utils/auth";
export default {
name: "QueryTools",
@ -139,10 +184,22 @@ export default {
rowData: {},
maForm: {
keyWord: "",
bmFileInfos: []
},
urlTemp: '',
//
dialogImageUrl: '',
dialogVisible: false,
uploadKey: Date.now(),
uploadUrl: process.env.VUE_APP_BASE_API + '/file/upload' //
};
},
computed: {},
computed: {
//1
uploadDisabled() {
return this.maForm.bmFileInfos && this.maForm.bmFileInfos.length <= 5
},
},
mounted() {
this.taskId = this.queryTaskId;
this.getTaskInfo();
@ -155,8 +212,8 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.keyWord = "";
this.resetForm("maForm");
this.maForm.keyWord = "";
this.handleQuery();
},
//-
@ -165,11 +222,64 @@ export default {
console.log('xxxxxxxxxxxxxxxxxxxxx',this.taskId)
getScrapInfo({'taskId':this.taskId,'keyWord':this.maForm.keyWord}).then((response) => {
this.equipmentList = response.data.scrapApplyDetailsList;
this.maForm.bmFileInfos = response.data.fileList
this.loading = false;
});
},
isImage(file) {
this.urlTemp = require('@/assets/file.png')
if (this.updataIf(file)) {
return false
} else {
return true
}
},
// ,
updataIf(e) {
if (e.fileName) {
const parts = e.fileName.split('.')
const extension = parts.pop()
if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') {
return false
} else {
return true
}
} else {
const parts = e.name.split('.')
const extension = parts.pop()
if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') {
return false
} else {
return true
}
}
},
//-
picturePreviewFbs(file) {
console.log("yyyyyyyyyy",file)
this.dialogImageUrl = file.url.replaceAll('#', '%23')
const parts = file.name.split('.')
const extension = parts.pop()
if (extension === 'pdf') {
const windowName = file.name
window.open(file.url, windowName)
} else {
this.dialogVisible = true
}
},
handleDownload(file) {
console.log(file)
if (file.status === 'ready') {
downloadFile({ fileName: file.name, fileData: file.raw, fileType: 'application/vnd.ms-excel;charset=utf-8' })
} else if (file.status === 'success') {
downloadFileData({ fileName: file.name, fileUrl: file.url })
// downloadFileData({ fileName: file.name,fileUrl:file.url })
}
},
/** 导出按钮操作 */
handleExport() {
this.download(
@ -182,10 +292,23 @@ export default {
};
</script>
<style lang="scss" scoped>
::v-deep.disabledFbs {
.el-upload--picture-card {
display: none;
}
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
::v-deep .el-upload-list__item {
margin-bottom: 20px;
overflow: visible !important;
}
::v-deep .el-upload-list__item-actions {
overflow: visible !important;
}
//css
::v-deep.disabled {
.el-upload--picture-card {
@ -208,4 +331,55 @@ export default {
font-size: 16px;
letter-spacing: 1px;
}
.el-upload-list__item-thumbnail {
height: 145px !important;
}
.picture-card-container {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
}
.picture-card {
width: 100%;
height: 100%;
object-fit: cover;
justify-content: center;
// border: 1px solid #ddd;
// border-radius: 4px;
}
.file-name {
width: 90%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
position: absolute;
bottom: -35px;
margin-top: 8px;
text-align: center;
font-size: 12px;
color: #333;
z-index: 999999;
}
.file-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: 20px;
}
</style>