mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-19 17:58:17 +08:00
todo:pdf预览
This commit is contained in:
parent
6316980a42
commit
25329c6d6d
@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.system.fantang.controller;
|
package com.ruoyi.system.fantang.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
@ -17,6 +18,13 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.ServletOutputStream;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -177,4 +185,33 @@ public class FtPrepaymentDaoController extends BaseController {
|
|||||||
public AjaxResult remove(@PathVariable Long[] prepaymentIds) {
|
public AjaxResult remove(@PathVariable Long[] prepaymentIds) {
|
||||||
return toAjax(iFtPrepaymentDaoService.removeByIds(Arrays.asList(prepaymentIds)) ? 1 : 0);
|
return toAjax(iFtPrepaymentDaoService.removeByIds(Arrays.asList(prepaymentIds)) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/generateReceiptPdf")
|
||||||
|
public void generateReceiptPdf(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||||
|
|
||||||
|
//根据文件信息中文件名字 和 文件存储路径获取文件输入流
|
||||||
|
String realpath = "E:\\Dev\\jmfx_1\\fantang\\ruoyi-ui\\src\\assets\\images\\login-background.jpg";
|
||||||
|
//PDF文件地址
|
||||||
|
File file = new File(realpath);
|
||||||
|
if (file.exists()) {
|
||||||
|
byte[] data = null;
|
||||||
|
FileInputStream input=null;
|
||||||
|
try {
|
||||||
|
input= new FileInputStream(file);
|
||||||
|
data = new byte[input.available()];
|
||||||
|
input.read(data);
|
||||||
|
response.getOutputStream().write(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("pdf文件处理异常:" + e);
|
||||||
|
}finally{
|
||||||
|
try {
|
||||||
|
if(input!=null){
|
||||||
|
input.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,3 +101,11 @@ export function exportPrepayment(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function generateReceiptPdf(data) {
|
||||||
|
return request({
|
||||||
|
url: '/fantang/prepayment/generateReceiptPdf',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@ -179,7 +179,7 @@ import {
|
|||||||
updateNursingInfo,
|
updateNursingInfo,
|
||||||
} from "@/api/fantang/staffInfo";
|
} from "@/api/fantang/staffInfo";
|
||||||
import {listDepart} from "@/api/fantang/depart";
|
import {listDepart} from "@/api/fantang/depart";
|
||||||
import UploadImage from '@/components/UploadImage';
|
import UploadImage from '../../../components/UploadImage';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "StaffInfo",
|
name: "StaffInfo",
|
||||||
|
|||||||
@ -43,30 +43,6 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['fantang:prepayment:add']"
|
|
||||||
>预付收款
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['fantang:prepayment:export']"
|
|
||||||
>导出
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="prepaymentList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="prepaymentList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center"/>
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
<el-table-column label="预付费id" align="center" prop="prepaymentId" v-if="false"/>
|
<el-table-column label="预付费id" align="center" prop="prepaymentId" v-if="false"/>
|
||||||
@ -77,22 +53,35 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="床号" align="center" prop="bedId"/>
|
<el-table-column label="床号" align="center" prop="bedId"/>
|
||||||
<el-table-column label="预付款余额" align="center" prop="prepaid"/>
|
<el-table-column label="预付款余额" align="center" prop="prepaid"/>
|
||||||
<!-- <el-table-column label="结算时间" align="center" prop="settlementAt" width="180">-->
|
|
||||||
<!-- <template slot-scope="scope">-->
|
|
||||||
<!-- <span>{{ parseTime(scope.row.settlementAt, '{y}-{m}-{d}') }}</span>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-news"
|
icon="el-icon-s-claim"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['fantang:prepayment:remove']"
|
v-hasPermi="['fantang:prepayment:remove']"
|
||||||
v-if=""
|
v-if="scope.row.noPrepayment"
|
||||||
>出院结清
|
>出院结清
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-printer"
|
||||||
|
@click="handleGenerateReceiptPdf(scope.row)"
|
||||||
|
v-hasPermi="['fantang:prepayment:remove']"
|
||||||
|
v-if="scope.row.noPrepayment"
|
||||||
|
>打印
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-money"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['fantang:prepayment:remove']"
|
||||||
|
v-if="!scope.row.noPrepayment"
|
||||||
|
>收款
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -164,7 +153,7 @@ import {
|
|||||||
addPrepayment,
|
addPrepayment,
|
||||||
delPrepayment,
|
delPrepayment,
|
||||||
exportPrepayment,
|
exportPrepayment,
|
||||||
getCountById,
|
generateReceiptPdf,
|
||||||
getPrepayment,
|
getPrepayment,
|
||||||
listNoPrepayment,
|
listNoPrepayment,
|
||||||
listPrepay
|
listPrepay
|
||||||
@ -249,7 +238,11 @@ export default {
|
|||||||
if (this.queryParams.settlementFlag === 0) {
|
if (this.queryParams.settlementFlag === 0) {
|
||||||
// 查询已交预付费信息
|
// 查询已交预付费信息
|
||||||
listPrepay(this.queryParams).then(response => {
|
listPrepay(this.queryParams).then(response => {
|
||||||
this.prepaymentList = response.data.records;
|
this.prepaymentList = response.data.records.map((item) => {
|
||||||
|
console.log(item);
|
||||||
|
item.noPrepayment = true;
|
||||||
|
return item;
|
||||||
|
});
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
})
|
})
|
||||||
@ -259,6 +252,14 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 生产收据 pdf
|
||||||
|
handleGenerateReceiptPdf(row) {
|
||||||
|
console.log(row);
|
||||||
|
generateReceiptPdf(row).then(response => {
|
||||||
|
// window.open("http://47.106.12.11:8080/prod-api/" + response.msg)
|
||||||
|
})
|
||||||
|
console.log(process.env);
|
||||||
|
},
|
||||||
// 获取用户相关信息
|
// 获取用户相关信息
|
||||||
myGetUser() {
|
myGetUser() {
|
||||||
getUserProfile().then(response => {
|
getUserProfile().then(response => {
|
||||||
@ -310,7 +311,11 @@ export default {
|
|||||||
getDefaultNoPrepayment() {
|
getDefaultNoPrepayment() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listNoPrepayment(this.queryParams).then(response => {
|
listNoPrepayment(this.queryParams).then(response => {
|
||||||
this.prepaymentList = response.rows;
|
this.prepaymentList = response.rows.map(item => {
|
||||||
|
console.log(item);
|
||||||
|
item.noPrepayment = false;
|
||||||
|
return item;
|
||||||
|
});
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.suggestionList = this.prepaymentList.map(item => {
|
this.suggestionList = this.prepaymentList.map(item => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user