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;
|
||||||
@ -59,7 +67,7 @@ public class FtPrepaymentDaoController extends BaseController {
|
|||||||
// return AjaxResult.error("无该记录");
|
// return AjaxResult.error("无该记录");
|
||||||
// return AjaxResult.success("操作成功", dao);
|
// return AjaxResult.success("操作成功", dao);
|
||||||
FtPrepaymentDao ftPrepaymentDao = iFtPrepaymentDaoService.getByPatientId(patientId);
|
FtPrepaymentDao ftPrepaymentDao = iFtPrepaymentDaoService.getByPatientId(patientId);
|
||||||
if (ftPrepaymentDao == null){
|
if (ftPrepaymentDao == null) {
|
||||||
return AjaxResult.error("无该记录");
|
return AjaxResult.error("无该记录");
|
||||||
}
|
}
|
||||||
return AjaxResult.success("操作成功", ftPrepaymentDao);
|
return AjaxResult.success("操作成功", ftPrepaymentDao);
|
||||||
@ -76,7 +84,7 @@ public class FtPrepaymentDaoController extends BaseController {
|
|||||||
// 查询所有已缴费列表
|
// 查询所有已缴费列表
|
||||||
@PreAuthorize("@ss.hasPermi('fantang:prepayment:list')")
|
@PreAuthorize("@ss.hasPermi('fantang:prepayment:list')")
|
||||||
@GetMapping("/listPrepay")
|
@GetMapping("/listPrepay")
|
||||||
public AjaxResult listPrepay(@RequestParam("pageNum")Integer pageNum, @RequestParam("pageSize")Integer pageSize) {
|
public AjaxResult listPrepay(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize) {
|
||||||
return AjaxResult.success(iFtPrepaymentDaoService.listPrepay(pageNum, pageSize));
|
return AjaxResult.success(iFtPrepaymentDaoService.listPrepay(pageNum, pageSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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"/>
|
||||||
@ -76,23 +52,36 @@
|
|||||||
<el-table-column label="科室" align="center" prop="departName" width="180">
|
<el-table-column label="科室" align="center" prop="departName" width="180">
|
||||||
</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>
|
||||||
@ -125,9 +114,9 @@
|
|||||||
<span class="addr">
|
<span class="addr">
|
||||||
{{ item.departName }}
|
{{ item.departName }}
|
||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
{{ item.bedId}}
|
{{ item.bedId }}
|
||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
{{ item.value}}
|
{{ item.value }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-autocomplete>
|
</el-autocomplete>
|
||||||
@ -139,7 +128,7 @@
|
|||||||
<el-input v-model="formAddPrepayment.prepaid"
|
<el-input v-model="formAddPrepayment.prepaid"
|
||||||
onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))" type="number"
|
onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))" type="number"
|
||||||
placeholder="请输入预付费金额"
|
placeholder="请输入预付费金额"
|
||||||
style="width: 250px" />
|
style="width: 250px"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="预付费时间" prop="prepaidAt">
|
<el-form-item label="预付费时间" prop="prepaidAt">
|
||||||
<el-date-picker clearable size="small" style="width: 250px"
|
<el-date-picker clearable size="small" style="width: 250px"
|
||||||
@ -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 => {
|
||||||
@ -292,7 +293,7 @@ export default {
|
|||||||
|
|
||||||
buildSuggestionList() {
|
buildSuggestionList() {
|
||||||
listNoPrepayment().then(response => {
|
listNoPrepayment().then(response => {
|
||||||
console.log("aaaaaaaaaaaaa",response);
|
console.log("aaaaaaaaaaaaa", response);
|
||||||
let prepaymentList = response.rows;
|
let prepaymentList = response.rows;
|
||||||
this.suggestionList = prepaymentList.map(item => {
|
this.suggestionList = prepaymentList.map(item => {
|
||||||
return {
|
return {
|
||||||
@ -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 {
|
||||||
@ -332,7 +337,7 @@ export default {
|
|||||||
this.formAddPrepayment.patientId = item.patientId;
|
this.formAddPrepayment.patientId = item.patientId;
|
||||||
this.formAddPrepayment.bedId = item.bedId;
|
this.formAddPrepayment.bedId = item.bedId;
|
||||||
this.formAddPrepayment.departName = item.departName;
|
this.formAddPrepayment.departName = item.departName;
|
||||||
this.formAddPrepayment["hospitalId"] = item.value ;
|
this.formAddPrepayment["hospitalId"] = item.value;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 处理点击查询图标的事件
|
// 处理点击查询图标的事件
|
||||||
@ -360,7 +365,7 @@ export default {
|
|||||||
prepaidAt: new Date(),
|
prepaidAt: new Date(),
|
||||||
hospitalId: null,
|
hospitalId: null,
|
||||||
name: null,
|
name: null,
|
||||||
userName:null,
|
userName: null,
|
||||||
};
|
};
|
||||||
this.resetForm("formAddPrepayment");
|
this.resetForm("formAddPrepayment");
|
||||||
},
|
},
|
||||||
@ -405,11 +410,11 @@ export default {
|
|||||||
this.formAddPrepayment.collectBy = this.user.userName;
|
this.formAddPrepayment.collectBy = this.user.userName;
|
||||||
this.$refs["formAddPrepayment"].validate(valid => {
|
this.$refs["formAddPrepayment"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (!this.suggestionList.find(x=> {
|
if (!this.suggestionList.find(x => {
|
||||||
return x.value === hospitalId;
|
return x.value === hospitalId;
|
||||||
})) {
|
})) {
|
||||||
this.msgError("未找到该住院号记录,请先添加!");
|
this.msgError("未找到该住院号记录,请先添加!");
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.formAddPrepayment.prepaidAt = null;
|
this.formAddPrepayment.prepaidAt = null;
|
||||||
@ -451,11 +456,11 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.my-autocomplete {
|
.my-autocomplete {
|
||||||
li {
|
li {
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
@ -474,5 +479,5 @@ export default {
|
|||||||
color: #ddd;
|
color: #ddd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user