This commit is contained in:
Paidax
2024-12-27 10:32:31 +08:00
parent a45b3d638a
commit d2caf57a55
4 changed files with 28 additions and 20 deletions
@@ -732,10 +732,10 @@ public class WelfareSingleController {
try {
response.setContentType("application/octet-stream");
response.setHeader("content-disposition", "attachment;filename="
+ URLEncoder.encode(welfareProject.getName() + "签收表.xlsx", "UTF-8"));
+ URLEncoder.encode(sysUnion.getUnioncode() + sysUnion.getUnionname() + welfareProject.getName() + "签收表.xlsx", "UTF-8"));
//获取这个福利项目下的所有数据
List<NutMap> allUser = welfareSingleService.getUserByProjectId(projectId, month, unionGroupId);
List<NutMap> userChoose = welfareSingleService.getUserChooseByProjectId(projectId, month, unionGroupId);
// List<NutMap> allUser = welfareSingleService.getUserByProjectId(projectId, month, unionGroupId);
// List<NutMap> userChoose = welfareSingleService.getUserChooseByProjectId(projectId, month, unionGroupId);
welfareSingleService.exportReceiveDetail(projectId, welfareUnitId, new ArrayList<>(), new ArrayList<>(), response.getOutputStream());
ViTool.excelResponse(response, sysUnion.getUnioncode() + sysUnion.getUnionname() + welfareProject.getName() + "签收表.xlsx");
} catch (Exception e) {
@@ -716,18 +716,19 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
});
List<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("序号", "no", 20));
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
exportEntities.add(new ExcelExportEntity("工号", "loginname", 20));
exportEntities.add(new ExcelExportEntity("所在分工会", "unionname", 20));
exportEntities.add(new ExcelExportEntity("序号", "no", 10));
exportEntities.add(new ExcelExportEntity("姓名", "username", 10));
exportEntities.add(new ExcelExportEntity("工号", "loginname", 15));
// exportEntities.add(new ExcelExportEntity("所在分工会", "unionname", 20));
exportEntities.add(new ExcelExportEntity("所在单位", "unitname", 20));
for (NutMap option : options) {
exportEntities.add(new ExcelExportEntity(option.getString("optionName"), option.getString("id"), 20));
exportEntities.add(new ExcelExportEntity(option.getString("optionName"), option.getString("id"), 10));
}
ExcelExportEntity excelExportEntity = new ExcelExportEntity();
excelExportEntity.setName("签字");
excelExportEntity.setKey("qzBytes");
excelExportEntity.setHeight(20);
excelExportEntity.setWidth(20);
excelExportEntity.setType(2);
excelExportEntity.setExportImageType(2);
@@ -647,13 +647,15 @@ layout("/mobile/platform.html"){
})
if (code === 0) {
this.getUserSelection(this.projectId)
this.$modal.msgSuccess(msg)
this.$modal.msgSuccess("您已完成本次福利选择。")
} else {
this.$modal.msgError(msg)
}
this.confirmPopup = false
await this.getProjectInfo()
window.location.reload()
setTimeout(() => {
window.location.reload()
}, 1000)
},
//查看详情
@@ -246,6 +246,7 @@ layout("/layouts/platform.html"){
<el-input-number :disabled="isView"
:max="option.maxNum"
:min="0"
@keydown.native="onKeydown"
@change="numChange(option.selectNum,option,oidx)"
style="width: 150px;position: absolute;right: 0;bottom: 0;"
v-model="option.selectNum"></el-input-number>
@@ -485,6 +486,11 @@ layout("/layouts/platform.html"){
},
},
methods: {
onKeydown(event) {
if (event.key !== "ArrowUp" && event.key !== "ArrowDown") {
event.preventDefault();
}
},
confirmButtonInfo(row) {
const {choiceTimeEnd, choiceTimeStart, overdueChoiceTimeEnd, isChoose, selectTime} = row
const now = moment().valueOf()
@@ -562,14 +568,12 @@ layout("/layouts/platform.html"){
},
//数量更改
numChange(value, option, optionIndex) {
this.$nextTick(() => {
// 查找+1按钮
const plusButton = document.querySelector('.el-input-number__increase');
// 添加点击事件监听器
plusButton.addEventListener('click', this.handlePlusButtonClick(value, option, optionIndex));
})
},
handlePlusButtonClick(value, option, optionIndex) {
const {
@@ -590,7 +594,7 @@ layout("/layouts/platform.html"){
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
if (sum > multiSelectNum) {
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], 'selectNum', value - 1)
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], 'selectNum', multiSelectNum)
this.$message.warning('此次福利最多只能选择' + multiSelectNum + '份');
}
@@ -680,10 +684,7 @@ layout("/layouts/platform.html"){
projectId: this.projectInfo.id
})
if (code === 0) {
this.$message({
message: msg,
type: 'success'
});
this.$message.success('您已完成本次福利选择。')
} else {
this.$message({
message: msg,
@@ -755,9 +756,13 @@ layout("/layouts/platform.html"){
r.name = "收货地址:" + r.province + r.city + r.county + r.addressDetail + ",收件人:" + r.userName + ",联系方式:" + r.tel
})
this.addressOptions = resp.data
this.formData.addressId = this.addressOptions.find(v=> v.isDefault).id
this.$nextTick(() => {
const address = this.addressOptions.find(v=> v.isDefault)
if (address) {
this.$set(this.formData, "addressId", address.id)
this.$set(this.formData, "receiveAddress", address.name)
}
})
},
},
async created() {