更新工作汇报相关代码

This commit is contained in:
许允枞 2025-02-12 17:57:53 +08:00
parent 5b7dd337df
commit 159c4f49e8
3 changed files with 43 additions and 14 deletions

View File

@ -96,9 +96,9 @@ export default {
this.formData = res.data;
this.dialogTitle = "修改工作汇报";
//
if (this.formData.filePath !== undefined && this.formData.filePath !== null && this.formData.filePath !== "") {
this.formData.filePath = this.formData.filePath.split(",");
console.log(this.formData)
console.log(this.formData.filePath)
}
} finally {
this.formLoading = false;
}

View File

@ -51,6 +51,13 @@ export function getReportPage(params) {
params
})
}
// 获得工作汇报分页
export function workReportView(id) {
return request({
url: '/work/report/workReportView?id=' + id,
method: 'get',
})
}
// 导出工作汇报 Excel
export function exportReportExcel(params) {
return request({

View File

@ -48,6 +48,9 @@
<el-table-column label="汇报人" align="center" prop="userName"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="workReportView(scope.row.id)"
v-hasPermi="['work:report:update']">打印
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
v-hasPermi="['work:report:update']">修改
</el-button>
@ -57,6 +60,12 @@
</template>
</el-table-column>
</el-table>
<el-dialog :visible.sync="showView" width="50%" center>
<div v-html="htmText" id="printMe"></div>
<el-button type="primary" style="margin-left: 90%;margin-top:20px " v-print="'#printMe'" size="small">打印
</el-button>
</el-dialog>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
@ -68,9 +77,14 @@
<script>
import * as ReportApi from '@/views/inspection/workReport/api/index';
import ReportForm from './ReportForm.vue';
import print from 'vue-print-nb'
import {workReportView} from "@/views/inspection/workReport/api/index";
export default {
name: "Report",
directives: {
print
},
components: {
ReportForm,
},
@ -78,10 +92,12 @@ export default {
return {
//
loading: true,
showView:false,
//
exportLoading: false,
//
showSearch: true,
htmText:'',
//
total: 0,
//
@ -135,6 +151,12 @@ export default {
openForm(id) {
this.$refs["formRef"].open(id);
},
workReportView(id){
this.showView = true
ReportApi.workReportView(id).then(res => {
this.htmText = res.data
})
},
/** 删除按钮操作 */
async handleDelete(row) {
const id = row.id;