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