爱心帮扶-职工慰问-慰问类型设置:新增‘是否有领据’选项,如果没有领据,慰问阅览导出附件时就标记为‘已导出’;修复导出后‘是否导出字段’不自动刷新问题;
This commit is contained in:
@@ -113,7 +113,8 @@ public class CondolenceReadCon {
|
|||||||
be.unionname be_unionname,
|
be.unionname be_unionname,
|
||||||
state.state_name,
|
state.state_name,
|
||||||
state.state_color,
|
state.state_color,
|
||||||
type.`code`
|
type.`code`,
|
||||||
|
type.hasReceipt AS has_receipt
|
||||||
FROM
|
FROM
|
||||||
condolence con
|
condolence con
|
||||||
LEFT JOIN `user` be ON con.be_user = be.id
|
LEFT JOIN `user` be ON con.be_user = be.id
|
||||||
@@ -375,6 +376,7 @@ public class CondolenceReadCon {
|
|||||||
type.`name` AS type_name,
|
type.`name` AS type_name,
|
||||||
type.money,
|
type.money,
|
||||||
type.`code` typeCode,
|
type.`code` typeCode,
|
||||||
|
type.hasReceipt AS has_receipt,
|
||||||
c.remark,
|
c.remark,
|
||||||
c.deadImmediateFamily,
|
c.deadImmediateFamily,
|
||||||
c.inpatientSurgicalName,
|
c.inpatientSurgicalName,
|
||||||
@@ -402,6 +404,10 @@ public class CondolenceReadCon {
|
|||||||
sql.setParam("id", id);
|
sql.setParam("id", id);
|
||||||
NutMap nutMap = condolenceService.fetch(sql);
|
NutMap nutMap = condolenceService.fetch(sql);
|
||||||
|
|
||||||
|
if (nutMap.get("has_receipt") != null && !nutMap.getBoolean("has_receipt")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(nutMap.getString("lkrSignData"))) {
|
if (StrUtil.isNotBlank(nutMap.getString("lkrSignData"))) {
|
||||||
try {
|
try {
|
||||||
nutMap.put("lkr", ViTool.poiBase64Image7030(nutMap.getString("lkrSignData")));
|
nutMap.put("lkr", ViTool.poiBase64Image7030(nutMap.getString("lkrSignData")));
|
||||||
@@ -451,6 +457,8 @@ public class CondolenceReadCon {
|
|||||||
nutMap.put("detail", username + "其它慰问");
|
nutMap.put("detail", username + "其它慰问");
|
||||||
} else if (typeCode.equals("J")) {
|
} else if (typeCode.equals("J")) {
|
||||||
nutMap.put("detail", username + "取环慰问");
|
nutMap.put("detail", username + "取环慰问");
|
||||||
|
} else {
|
||||||
|
nutMap.put("detail", username + nutMap.getString("type_name"));
|
||||||
}
|
}
|
||||||
double m = nutMap.getDouble("money");
|
double m = nutMap.getDouble("money");
|
||||||
String cm = Convert.digitToChinese(m);
|
String cm = Convert.digitToChinese(m);
|
||||||
@@ -461,7 +469,8 @@ public class CondolenceReadCon {
|
|||||||
try {
|
try {
|
||||||
String fileName = nutMap.getString("unionname") + nutMap.getString("detail") + "领据";
|
String fileName = nutMap.getString("unionname") + nutMap.getString("detail") + "领据";
|
||||||
response.addHeader("Content-Type", "application/octet-stream");
|
response.addHeader("Content-Type", "application/octet-stream");
|
||||||
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\".docx");
|
response.addHeader("Content-Disposition", "attachment;filename="
|
||||||
|
+ URLEncoder.encode(fileName + ".docx", StandardCharsets.UTF_8));
|
||||||
ServletOutputStream outputStream = response.getOutputStream();
|
ServletOutputStream outputStream = response.getOutputStream();
|
||||||
Configure config = Configure.newBuilder().build();
|
Configure config = Configure.newBuilder().build();
|
||||||
XWPFTemplate.compile(officeTemplateUtil.getPath("condolenceDocument2"), config).render(nutMap).writeAndClose(response.getOutputStream());
|
XWPFTemplate.compile(officeTemplateUtil.getPath("condolenceDocument2"), config).render(nutMap).writeAndClose(response.getOutputStream());
|
||||||
@@ -574,6 +583,7 @@ public class CondolenceReadCon {
|
|||||||
bwwr.username AS bwwrname,
|
bwwr.username AS bwwrname,
|
||||||
bwwr.unionname,
|
bwwr.unionname,
|
||||||
type.`name` AS type_name,
|
type.`name` AS type_name,
|
||||||
|
type.hasReceipt AS has_receipt,
|
||||||
c.files
|
c.files
|
||||||
FROM
|
FROM
|
||||||
`condolence` c
|
`condolence` c
|
||||||
@@ -602,9 +612,13 @@ public class CondolenceReadCon {
|
|||||||
zipOutputStream.write(bytes, 0, bytes.length);
|
zipOutputStream.write(bytes, 0, bytes.length);
|
||||||
zipOutputStream.closeEntry();
|
zipOutputStream.closeEntry();
|
||||||
}
|
}
|
||||||
zipOutputStream.finish();
|
|
||||||
response.flushBuffer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
zipOutputStream.finish();
|
||||||
|
if (condolence.get("has_receipt") != null && !condolence.getBoolean("has_receipt")) {
|
||||||
|
condolenceService.update(Chain.make("isExport", 1), Cnd.where("id", "=", id));
|
||||||
|
}
|
||||||
|
response.flushBuffer();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,11 @@ public class CondolenceType {
|
|||||||
@ColDefine(type = ColType.BOOLEAN)
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
private Boolean isUploadFile;
|
private Boolean isUploadFile;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("是否有领据")
|
||||||
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
|
private Boolean hasReceipt;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@Comment("上传附件说明")
|
@Comment("上传附件说明")
|
||||||
@ColDefine(type = ColType.VARCHAR,width = 200)
|
@ColDefine(type = ColType.VARCHAR,width = 200)
|
||||||
|
|||||||
@@ -66,6 +66,15 @@ layout("/layouts/platform.html"){
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column align="center" header-align="center" label="是否有领据"
|
||||||
|
show-overflow-tooltip
|
||||||
|
prop="hasReceipt">
|
||||||
|
<template scope="{row}">
|
||||||
|
<span v-if="row.hasReceipt != false" class="text-success">是</span>
|
||||||
|
<span v-else class="text-danger">否</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="是否禁用" prop="isDisabled" header-align="center"
|
<el-table-column label="是否禁用" prop="isDisabled" header-align="center"
|
||||||
align="center">
|
align="center">
|
||||||
<template scope="{row}">
|
<template scope="{row}">
|
||||||
@@ -152,6 +161,13 @@ layout("/layouts/platform.html"){
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="是否有领据" prop="hasReceipt">
|
||||||
|
<el-radio-group v-model="formData.hasReceipt">
|
||||||
|
<el-radio-button :label="true">是</el-radio-button>
|
||||||
|
<el-radio-button :label="false">否</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="上传附件说明" prop="uploadFileDesc" v-if="formData.isUploadFile">
|
<el-form-item label="上传附件说明" prop="uploadFileDesc" v-if="formData.isUploadFile">
|
||||||
<el-input v-model="formData.uploadFileDesc" type="textarea" :rows="3" maxlength="200"
|
<el-input v-model="formData.uploadFileDesc" type="textarea" :rows="3" maxlength="200"
|
||||||
show-word-limit clearable></el-input>
|
show-word-limit clearable></el-input>
|
||||||
@@ -239,6 +255,7 @@ layout("/layouts/platform.html"){
|
|||||||
openAdd() {
|
openAdd() {
|
||||||
this.formData = {
|
this.formData = {
|
||||||
isUploadFile: true,
|
isUploadFile: true,
|
||||||
|
hasReceipt: true,
|
||||||
goodsAlbum: []
|
goodsAlbum: []
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
@@ -315,6 +332,9 @@ layout("/layouts/platform.html"){
|
|||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
this.formData = data
|
this.formData = data
|
||||||
this.$set(this.formData, 'goodsAlbum', data.goodsAlbum || [])
|
this.$set(this.formData, 'goodsAlbum', data.goodsAlbum || [])
|
||||||
|
if (data.hasReceipt == null) {
|
||||||
|
this.$set(this.formData, 'hasReceipt', true)
|
||||||
|
}
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
if (this.$refs['form']) {
|
if (this.$refs['form']) {
|
||||||
this.$refs['form'].resetFields()
|
this.$refs['form'].resetFields()
|
||||||
|
|||||||
@@ -142,7 +142,8 @@ layout("/layouts/platform.html"){
|
|||||||
<el-table-column align="center" prop="state_id" header-align="center"
|
<el-table-column align="center" prop="state_id" header-align="center"
|
||||||
label="是否导出" sortable>
|
label="是否导出" sortable>
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
<span v-if="scope.row.exportdocumentno" class="text-success">
|
<span v-if="scope.row.exportdocumentno || (scope.row.has_receipt == false && scope.row.isexport)"
|
||||||
|
class="text-success">
|
||||||
是
|
是
|
||||||
</span>
|
</span>
|
||||||
<span v-else class="text-danger">否</span>
|
<span v-else class="text-danger">否</span>
|
||||||
@@ -162,7 +163,8 @@ layout("/layouts/platform.html"){
|
|||||||
<el-dropdown-item :command="{type:'view',data:row}">
|
<el-dropdown-item :command="{type:'view',data:row}">
|
||||||
查看
|
查看
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item :command="{type:'exportReceipt',data:row}">
|
<el-dropdown-item v-if="row.has_receipt != false"
|
||||||
|
:command="{type:'exportReceipt',data:row}">
|
||||||
导出领据
|
导出领据
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item :command="{type:'exportFiles',data:row}">
|
<el-dropdown-item :command="{type:'exportFiles',data:row}">
|
||||||
@@ -230,13 +232,44 @@ layout("/layouts/platform.html"){
|
|||||||
} else if (type == 'Print') {
|
} else if (type == 'Print') {
|
||||||
condolence.doPrint(data.id)
|
condolence.doPrint(data.id)
|
||||||
} else if (type == 'exportReceipt') {
|
} else if (type == 'exportReceipt') {
|
||||||
if (!['D', 'E', 'F', 'G', 'H', 'I', 'J'].includes(data.code)) {
|
if (data.has_receipt == false) {
|
||||||
this.notifyWarning('只有住院和去世类型才可导出领据')
|
this.notifyWarning('该慰问类型没有领据')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
window.open(loc() + '/exportReceipt?id=' + data.id)
|
this.downloadAndRefresh(loc() + '/exportReceipt?id=' + data.id, '慰问领据.docx')
|
||||||
} else if (type == 'exportFiles') {
|
} else if (type == 'exportFiles') {
|
||||||
window.open(loc() + '/exportFiles?id=' + data.id)
|
this.downloadAndRefresh(loc() + '/exportFiles?id=' + data.id, '申请附件.zip')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async downloadAndRefresh(url, defaultFileName) {
|
||||||
|
const loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: '正在导出,请稍候',
|
||||||
|
spinner: 'el-icon-loading'
|
||||||
|
})
|
||||||
|
try {
|
||||||
|
const response = await axios.get(url, {responseType: 'blob'})
|
||||||
|
const disposition = response.headers['content-disposition'] || ''
|
||||||
|
let fileName = disposition.includes('filename=')
|
||||||
|
? disposition.substring(disposition.indexOf('filename=') + 9).replace(/"/g, '')
|
||||||
|
: defaultFileName
|
||||||
|
fileName = decodeURIComponent(fileName.replace(/\+/g, ' '))
|
||||||
|
|
||||||
|
const downloadUrl = window.URL.createObjectURL(response.data)
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.href = downloadUrl
|
||||||
|
link.download = fileName
|
||||||
|
link.style.display = 'none'
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
window.URL.revokeObjectURL(downloadUrl)
|
||||||
|
|
||||||
|
this.pageData()
|
||||||
|
} catch (e) {
|
||||||
|
this.notifyError('导出失败')
|
||||||
|
} finally {
|
||||||
|
loading.close()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
doExportSummary() {
|
doExportSummary() {
|
||||||
|
|||||||
Reference in New Issue
Block a user