Compare commits

...
2 Commits
Author SHA1 Message Date
c-chenxs1 894c720bb8 feat: 优化福利2 2026-11-03 20:35:12 +08:00
c-chenxs1 39ee74f0a9 feat: 优化福利 2026-11-03 20:20:59 +08:00
14 changed files with 368 additions and 87 deletions
@@ -5,7 +5,6 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.export.ExcelExportService;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
@@ -24,6 +23,13 @@ import com.budwk.app.zhgh.welfare.param.WelfareSelectionSituationPageForm;
import com.budwk.app.zhgh.welfare.service.WelfareSelectionSituationService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.ClientAnchor;
import org.apache.poi.ss.usermodel.Drawing;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
@@ -232,55 +238,69 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
List<WelfareProjectSubjectOption> optionList = dao().query(WelfareProjectSubjectOption.class, Cnd.where(WelfareProjectSubjectOption::getWelfareId, "=", pageForm.getProjectId()).asc("optionSort"));
for (NutMap map : list) {
if (map.get("selectOptionIds") != null){
String[] selectOptionIds = map.getString("selectOptionIds").split(",");
for (WelfareProjectSubjectOption option : optionList) {
if(Arrays.asList(selectOptionIds).contains(option.getId())){
map.put(option.getOptionName(), "√");
}
}
}
if (map.get("userSign") != null){
if (map.get("userSign") != null) {
try {
Sys_file file = dao().fetch(Sys_file.class, Cnd.where(Sys_file::getDownloadPath, "=", map.getString("userSign")));
byte[] userSignBytes = SysFileMinIoUtil.getFileBytes(file.getBucket(), file.getStoragePath());
map.put("userSign", userSignBytes);
}catch (Exception e){
e.printStackTrace();
log.error("下载图片失败", e);
BufferedImage image = ImageIO.read(new ByteArrayInputStream(userSignBytes));
if (image != null) {
ByteArrayOutputStream png = new ByteArrayOutputStream();
ImageIO.write(image, "png", png);
map.put("userSign", png.toByteArray());
}
} catch (Exception e) {
log.error("下载签字图片失败", e);
}
}
}
List<Map<String, Object>> safeList = list.stream().map(nutMap -> {
Map<String, Object> map = new HashMap<>(nutMap);
return map;
}).toList();
// 分组
Map<String, List<Map<String, Object>>> listMap = safeList.stream()
.collect(Collectors.groupingBy(n -> (String) n.get("welfareUnionName")));
// 构建 Excel 列
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("工号", "loginName", 20));
entities.add(new ExcelExportEntity("姓名", "userName", 20));
optionList.forEach(option -> {
entities.add(new ExcelExportEntity(option.getOptionName(), option.getOptionName(), 20));
});
ExcelExportEntity userSignEntity = new ExcelExportEntity("签字", "userSign", 20);
userSignEntity.setType(2);
userSignEntity.setExportImageType(2);
entities.add(userSignEntity);
// 导出
Map<String, List<NutMap>> rowsByUnion = list.stream()
.collect(Collectors.groupingBy(n -> n.getString("welfareUnionName")));
Workbook workbook = new HSSFWorkbook();
listMap.forEach((k, v) -> {
ExcelExportService service = new ExcelExportService();
ExportParams exportParams = new ExportParams();
exportParams.setSheetName(k);
exportParams.setType(ExcelType.HSSF);
service.createSheetForMap(workbook, exportParams, entities, v);
if (rowsByUnion.isEmpty()) {
rowsByUnion.put("领取表", Collections.emptyList());
}
CellStyle headerStyle = workbook.createCellStyle();
Font headerFont = workbook.createFont();
headerFont.setBold(true);
headerStyle.setFont(headerFont);
List<String> headers = new ArrayList<>(List.of("工号", "姓名"));
optionList.forEach(option -> headers.add(option.getOptionName()));
headers.add("签字");
int signColumn = headers.size() - 1;
rowsByUnion.forEach((unionName, records) -> {
Sheet sheet = workbook.createSheet(unionName);
Row header = sheet.createRow(0);
for (int column = 0; column < headers.size(); column++) {
sheet.setColumnWidth(column, 20 * 256);
Cell cell = header.createCell(column);
cell.setCellValue(headers.get(column));
cell.setCellStyle(headerStyle);
}
Drawing<?> drawing = sheet.createDrawingPatriarch();
for (NutMap record : records) {
Row row = sheet.createRow(sheet.getLastRowNum() + 1);
row.createCell(0).setCellValue(Objects.toString(record.get("loginName"), ""));
row.createCell(1).setCellValue(Objects.toString(record.get("userName"), ""));
Set<String> selectedIds = new HashSet<>(Arrays.asList(
Objects.toString(record.get("selectOptionIds"), "").split(",")));
for (int i = 0; i < optionList.size(); i++) {
row.createCell(i + 2).setCellValue(selectedIds.contains(optionList.get(i).getId()) ? "√" : "");
}
if (record.get("userSign") instanceof byte[] signature) {
row.setHeightInPoints(40);
ClientAnchor anchor = workbook.getCreationHelper().createClientAnchor();
anchor.setCol1(signColumn);
anchor.setCol2(signColumn + 1);
anchor.setRow1(row.getRowNum());
anchor.setRow2(row.getRowNum() + 1);
drawing.createPicture(anchor, workbook.addPicture(signature, Workbook.PICTURE_TYPE_PNG));
}
}
});
CommonDownloadUtil.download("领取表.xls", workbook, response);
@@ -17,6 +17,9 @@ layout("/layouts/platform.html"){
value-format="yyyy"
></el-date-picker>
</search-item>
<template #actions>
<el-button @click="resetSearch">重置</el-button>
</template>
</search>
</el-card>
@@ -115,6 +118,10 @@ layout("/layouts/platform.html"){
"select-view": selectView
},
methods: {
resetSearch() {
this.pageForm.year = moment().format("YYYY")
this.doSearch()
},
async openView(row) {
this.$refs.selectViewRef.onOpen(row.id)
}
@@ -117,6 +117,9 @@ const filterUser = {
<el-option label="否" :value="false"></el-option>
</el-select>
</search-item>
<template #actions>
<el-button @click="resetSearch">重置</el-button>
</template>
</search>
</el-card>
@@ -200,6 +203,11 @@ const filterUser = {
this.pageData()
},
resetSearch() {
this.resetPageForm()
this.doSearch()
},
resetPageForm() {
this.$set(this.pageForm, "userName", null)
this.$set(this.pageForm, "loginName", null)
@@ -21,6 +21,9 @@ layout("/layouts/platform.html"){
<search-item label="项目名称">
<el-input clearable placeholder="请输入项目名称" v-model="pageForm.name"></el-input>
</search-item>
<template #actions>
<el-button @click="resetSearch">重置</el-button>
</template>
</search>
</el-card>
@@ -294,6 +297,11 @@ layout("/layouts/platform.html"){
}
},
methods: {
resetSearch() {
this.pageForm.year = moment().format("YYYY")
this.$set(this.pageForm, "name", null)
this.doSearch()
},
dropdownCommand(command) {
const { type, data } = command
if (type === "edit") {
@@ -22,6 +22,7 @@ layout("/layouts/platform.html"){
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
<el-button @click="resetSearch">重置</el-button>
</div>
</div>
</el-card>
@@ -120,6 +121,10 @@ layout("/layouts/platform.html"){
"option-select": optionSelect
},
methods: {
resetSearch() {
this.$set(this.pageForm, "year", null)
this.doSearch()
},
go_back() {
this.doSearch()
this.$refs.guava.index()
@@ -34,7 +34,7 @@ const optionSelect = {
</div>
<div class="info-item">
<div class="info-label">节日信息</div>
<div class="info-value">{{ projectInfo.festival }} · {{ projectInfo.year }}年</div>
<div class="info-value"><!--{{ projectInfo.festival }} · -->{{ projectInfo.year }}年</div>
</div>
<div class="info-item">
<div class="info-label">选择时间</div>
@@ -48,10 +48,12 @@ const optionSelect = {
projectInfo.provideTimeEnd) }}
</div>
</div>
<!--
<div class="info-item">
<div class="info-label">发放地点</div>
<div class="info-value">{{ projectInfo.provideAddress }}</div>
</div>
-->
</div>
</el-card>
@@ -143,8 +145,15 @@ const optionSelect = {
<div class="confirm-mobile-section">
<div class="confirm-section-title">联系信息</div>
<el-form :model="contactForm" ref="contactForm" :rules="contactRules" label-width="80px">
<el-form-item label="领取方式" v-if="projectInfo.provideMode === 3">
<el-radio-group v-model="deliveryMethod">
<el-radio-button label="pickup">学校自提</el-radio-button>
<el-radio-button label="mail">邮寄</el-radio-button>
</el-radio-group>
<div style="margin-top: 8px; padding: 8px 12px; border-radius: 6px; line-height: 1.5; background: #fff3e8; color: #9c451c">超出江浙沪不包邮,超出部分自理,具体金额联系供应商。</div>
</el-form-item>
<el-row :gutter="10">
<el-col :span="20" v-if="projectInfo.provideMode == 3">
<el-col :span="20" v-if="projectInfo.provideMode === 3 && deliveryMethod === 'mail'">
<el-form-item prop="receiveAddress"
label="收货地址"
:rules="[{ required: true, message: '请选择收货地址', trigger: 'change' }]">
@@ -158,10 +167,10 @@ const optionSelect = {
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" v-if="projectInfo.provideMode == 3">
<el-col :span="4" v-if="projectInfo.provideMode === 3 && deliveryMethod === 'mail'">
<el-button @click="openAddress" type="primary" size="small">添加地址</el-button>
</el-col>
<el-col :span="24" v-if="projectInfo.provideMode == 3">
<el-col :span="24" v-if="projectInfo.provideMode === 3 && deliveryMethod === 'mail'">
<el-form-item prop="userName" label="收货人">
<el-input
v-model="contactForm.userName"
@@ -170,7 +179,7 @@ const optionSelect = {
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="24" v-if="projectInfo.provideMode !== 3 || deliveryMethod === 'mail'">
<el-form-item prop="mobile" label="联系电话">
<el-input
v-model="contactForm.mobile"
@@ -258,6 +267,7 @@ const optionSelect = {
userSelection: [], // 用户选择的选项
selectedRadioId: "", // 单选模式下选中的选项ID
showConfirmDialog: false, // 确认弹窗
deliveryMethod: "",
isSubmitting: false, // 是否正在提交
hasSubmittedBefore: false, // 是否之前提交过
deadlineTime: null, // 选择截止时间
@@ -410,6 +420,7 @@ const optionSelect = {
this.projectId = projectId
this.userId = userId
this.deliveryMethod = ""
this.selectedRadioId = null
this.contactForm = {
mobile: "",
@@ -485,7 +496,9 @@ const optionSelect = {
// 地址回显
if (this.projectInfo.provideMode === 3) {
if (this.userSelection.length > 0 && this.userSelection[0].receiveAddress) {
this.contactForm.receiveAddress = this.userSelection[0].receiveAddress
const receiveAddress = this.userSelection[0].receiveAddress
this.deliveryMethod = receiveAddress === "学校自提" ? "pickup" : "mail"
this.contactForm.receiveAddress = this.deliveryMethod === "mail" ? receiveAddress : ""
// this.contactForm.userName = this.userSelection[0].userName;
// this.contactForm.mobile = this.userSelection[0].mobile;
this.$set(this.contactForm, "userName", this.userSelection[0].userName)
@@ -526,6 +539,10 @@ const optionSelect = {
// 执行提交
doSubmit() {
if (this.projectInfo.provideMode === 3 && !this.deliveryMethod) {
this.$message.warning("请选择领取方式")
return
}
// 验证手机号
this.$refs.contactForm.validate((valid) => {
if (!valid) {
@@ -547,7 +564,7 @@ const optionSelect = {
mobile: this.contactForm.mobile,
userName: this.contactForm.userName,
userSign: this.contactForm.userSign,
receiveAddress: this.contactForm.receiveAddress
receiveAddress: this.deliveryMethod === "pickup" ? "学校自提" : this.contactForm.receiveAddress
}
]
}
@@ -560,7 +577,7 @@ const optionSelect = {
mobile: this.contactForm.mobile,
userName: this.contactForm.userName,
userSign: this.contactForm.userSign,
receiveAddress: this.contactForm.receiveAddress
receiveAddress: this.deliveryMethod === "pickup" ? "学校自提" : this.contactForm.receiveAddress
}))
}
@@ -69,6 +69,9 @@ layout("/layouts/platform.html"){
<dict-select v-model="pageForm.userAttribute" placeholder="请选择人员属性" @change="doSearch"
code="USER_ATTRIBUTE"></dict-select>
</search-item>
<template #actions>
<el-button @click="resetSearch">重置</el-button>
</template>
</search>
</el-card>
@@ -173,6 +176,18 @@ layout("/layouts/platform.html"){
}
},
methods: {
resetSearch() {
this.pageForm.year = new Date().getFullYear().toString()
this.$set(this.pageForm, "welfareOptionId", null)
this.$set(this.pageForm, "userName", null)
this.$set(this.pageForm, "loginName", null)
this.$set(this.pageForm, "unionId", null)
this.$set(this.pageForm, "aidFundMemberUserType", null)
this.$set(this.pageForm, "userAttribute", null)
this.$set(this.pageForm, "isSelect", null)
this.$set(this.pageForm, "unitIds", [])
this.getWelfareList()
},
// 获取福利列表
getWelfareList() {
this.$axios.post("/platform/welfare/common/list", { year: this.pageForm.year }).then((res) => {
@@ -28,6 +28,9 @@ layout("/layouts/platform.html"){
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unionOptions"></el-option>
</el-select>
</search-item>
<template #actions>
<el-button @click="resetSearch">重置</el-button>
</template>
</search>
</el-card>
@@ -110,6 +113,13 @@ layout("/layouts/platform.html"){
}
},
methods: {
resetSearch() {
this.pageForm.year = new Date().getFullYear().toString()
const isBranchChairman = !this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN", "SCHOOL_UNION_WELFARE_ADMIN"]) &&
this.$auth.hasRoleOr(["BRANCH_UNION_CHAIRMAN"])
this.$set(this.pageForm, "unionId", isBranchChairman ? this.$store.state.user.union.id : null)
this.getWelfareProjectList()
},
remindUnSelectedPlaceholder() {
this.$message.info("提醒未选择人员功能待开发")
},
@@ -112,7 +112,15 @@ let CHOOSE_WELFARE = {
</el-row>
</el-form-item>
<template v-if="projectInfo.provideMode===3">
<div v-if="projectInfo.provideMode === 3 && !is_view" style="padding: 8px 16px">
<div>领取方式</div>
<el-radio-group v-model="deliveryMethod">
<el-radio-button label="pickup">学校自提</el-radio-button>
<el-radio-button label="mail">邮寄</el-radio-button>
</el-radio-group>
<div style="margin-top: 8px; padding: 8px; background: #fff3e8; color: #9c451c">超出江浙沪不包邮,超出部分自理,具体金额联系供应商。</div>
</div>
<template v-if="projectInfo.provideMode === 3 && (is_view || deliveryMethod === 'mail')">
<el-row :gutter="20">
<el-col :span="24" v-if="!is_view">
<el-form-item label="收货地址" prop="receiveAddress">
@@ -202,6 +210,7 @@ let CHOOSE_WELFARE = {
data() {
return {
projectInfo: {},
deliveryMethod: "",
addressOptions: [],
welfareProvideMode: [],
welfareSignMode: [],
@@ -295,6 +304,10 @@ let CHOOSE_WELFARE = {
}
},
doChoose() {
if (this.projectInfo.provideMode === 3 && !this.deliveryMethod) {
this.$message.warning("请选择领取方式")
return
}
this.$refs["addForm"].validate(async (valid) => {
if (valid) {
const {
@@ -309,7 +322,7 @@ let CHOOSE_WELFARE = {
return
}
}
if (this.formData.receiveAddress == null || this.formData.receiveAddress === "") {
if (this.projectInfo.provideMode === 3 && this.deliveryMethod === "mail" && !this.formData.receiveAddress) {
this.$message.warning("请填写收货地址")
return
}
@@ -322,7 +335,7 @@ let CHOOSE_WELFARE = {
welfareId: this.projectInfo.id,
subjectId: v.subjectId,
selectOptionId: v.id,
receiveAddress: this.formData.receiveAddress,
receiveAddress: this.deliveryMethod === "pickup" ? "学校自提" : this.formData.receiveAddress,
userSign: this.formData.userSign,
selectNum: v.selectNum
}
@@ -397,12 +410,19 @@ let CHOOSE_WELFARE = {
},
async openChoose(row) {
await this.getProjectInfo(row.id)
this.deliveryMethod = ""
this.$set(this.formData, "receiveAddress", null)
this.$set(this.formData, "addressId", null)
this.$set(this.formData, "userName", this.$store.state.user.username)
this.$set(this.formData, "tel", this.$store.state.user.mobile)
//如果已选择
if (row.isChoose > 0) {
this.$set(this.formData, "receiveAddress", this.userSelection[0].receiveAddress)
const receiveAddress = this.userSelection[0].receiveAddress
if (this.projectInfo.provideMode === 3 && receiveAddress) {
this.deliveryMethod = receiveAddress === "学校自提" ? "pickup" : "mail"
}
this.$set(this.formData, "receiveAddress", this.deliveryMethod === "pickup" && !this.is_view ? null : receiveAddress)
this.$set(this.formData, "addressId", null)
this.$set(this.formData, "userSign", this.userSelection[0].userSign)
} else {
@@ -22,6 +22,7 @@ layout("/layouts/platform.html"){
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
<el-button @click="resetSearch">重置</el-button>
</div>
</div>
</el-card>
@@ -120,6 +121,10 @@ layout("/layouts/platform.html"){
"choose-welfare": CHOOSE_WELFARE
},
methods: {
resetSearch() {
this.$set(this.pageForm, "year", null)
this.doSearch()
},
go_back() {
this.doSearch()
this.$refs.guava.index()
@@ -138,6 +138,9 @@ layout("/layouts/platform.html"){
<!-- <el-option :key="item.id" :label="item.optionName" :value="item.id" v-for="item in pageFormProject"></el-option>-->
<!-- </el-select>-->
<!-- </search-item>-->
<template #actions>
<el-button @click="resetSearch">重置</el-button>
</template>
</search>
</el-card>
@@ -311,6 +314,22 @@ layout("/layouts/platform.html"){
}
},
methods: {
resetSearch() {
this.pageForm.year = new Date().getFullYear().toString()
this.$set(this.pageForm, "userName", null)
this.$set(this.pageForm, "loginName", null)
this.$set(this.pageForm, "sex", null)
this.$set(this.pageForm, "birthday", null)
this.$set(this.pageForm, "unionId", null)
this.$set(this.pageForm, "aidFundMemberUserType", null)
this.$set(this.pageForm, "birthMonths", [])
this.$set(this.pageForm, "unitIds", [])
this.$set(this.pageForm, "personTypes", [])
this.$set(this.pageForm, "userStates", [])
this.$set(this.pageForm, "userAttributes", [])
this.unitIdsChange([])
this.getWelfareList()
},
// 导出名单
openExport() {
this.$downLoad("/platform/welfare/list/mange/exportXlsx", {
@@ -432,6 +451,9 @@ layout("/layouts/platform.html"){
}
try {
const responses = await Promise.all(unitIds.map((unitId) => this.$axios.post("/platform/sys/unit/child", { pid: unitId })))
if (unitIds !== this.pageForm.unitIds) {
return
}
const failedResponse = responses.find((res) => res.code !== 0)
if (failedResponse) {
this.$message.error(failedResponse.msg || "三级单位查询失败")
@@ -174,7 +174,7 @@ layout("/layouts/platform_h5.html"){
display: flex;
min-width: 0;
margin-top: 10px;
padding-top: 2px;
padding-top: 10px;
align-items: center;
border-top: 1px solid #edf1f6;
}
@@ -194,18 +194,22 @@ layout("/layouts/platform_h5.html"){
}
.welfare-list-card__choices .welfare-inline-selection {
width: 82px;
min-width: 82px;
min-height: 112px;
padding: 8px 0;
flex: 0 0 clamp(82px, 31%, 112px);
min-width: 0;
padding: 0;
flex-direction: column;
align-items: stretch;
border-bottom: 0;
overflow: hidden;
border: 0;
border-radius: 8px;
background: #edf4fc;
}
.welfare-list-card__choices .welfare-inline-selection__image {
width: 82px;
height: 64px;
display: block;
width: 100%;
height: auto;
aspect-ratio: 4 / 3;
margin-right: 0;
}
@@ -223,19 +227,22 @@ layout("/layouts/platform_h5.html"){
}
.welfare-list-card__choices .welfare-inline-selection__image--name span {
display: -webkit-box;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
white-space: nowrap;
}
.welfare-list-card__choices .welfare-inline-selection__content {
margin-top: 6px;
width: 100%;
padding: 3px 6px;
box-sizing: border-box;
text-align: center;
}
.welfare-list-card__choices .welfare-inline-selection__name {
font-weight: 400;
line-height: 16px;
}
.welfare-list-card__choices .welfare-inline-selection__meta {
@@ -486,7 +493,7 @@ layout("/layouts/platform_h5.html"){
.welfare-inline-selection__name {
overflow: hidden;
color: #263548;
font-size: 14px;
font-size: 12px;
line-height: 21px;
font-weight: 600;
text-overflow: ellipsis;
File diff suppressed because one or more lines are too long
@@ -227,8 +227,16 @@ layout("/layouts/platform_h5.html"){
></van-card>
</van-cell>
<div v-if="projectInfo.provideMode === 3" style="padding: 8px 16px">
<div>领取方式</div>
<van-radio-group v-model="deliveryMethod" direction="horizontal">
<van-radio name="pickup">学校自提</van-radio>
<van-radio name="mail">邮寄</van-radio>
</van-radio-group>
<div style="margin-top: 8px; padding: 8px; background: #fff3e8; color: #9c451c">超出江浙沪不包邮,超出部分自理,具体金额联系供应商。</div>
</div>
<!--邮寄到家 填写收货地址-->
<van-cell @click="selectAddressPopup = true" class="confirmWelfareCell" is-link v-if="projectInfo.provideMode===3">
<van-cell @click="selectAddressPopup = true" class="confirmWelfareCell" is-link v-if="projectInfo.provideMode === 3 && deliveryMethod === 'mail'">
<van-icon class="van-cell__left-icon" color="red" name="info" slot="icon"></van-icon>
<div slot="title" style="font-weight: bold; font-size: 15px">收货地址</div>
<template #label>
@@ -287,6 +295,7 @@ layout("/layouts/platform_h5.html"){
descPopup: false,
confirmPopup: false,
selectAddressPopup: false,
deliveryMethod: "",
selectAddress: null,
addressList: [],
userSign: ""
@@ -427,7 +436,11 @@ layout("/layouts/platform_h5.html"){
//回显用户的地址
if (this.projectInfo.provideMode === 3 && this.isSelect && this.userSelection) {
this.selectAddress = this.userSelection[0].receiveAddress
const receiveAddress = this.userSelection[0].receiveAddress
if (receiveAddress) {
this.deliveryMethod = receiveAddress === "学校自提" ? "pickup" : "mail"
}
this.selectAddress = this.deliveryMethod === "mail" ? receiveAddress : null
}
//回显用户签名
@@ -466,8 +479,12 @@ layout("/layouts/platform_h5.html"){
},
//提交选择
async submitSelect() {
if (this.projectInfo.provideMode === 3 && !this.deliveryMethod) {
this.$toast("请选择领取方式")
return
}
if (this.projectInfo.provideMode === 3) {
if (this.selectAddress == null || this.selectAddress === "") {
if (this.deliveryMethod === "mail" && !this.selectAddress) {
this.$toast("请填写您的收货地址")
return
}
@@ -491,7 +508,7 @@ layout("/layouts/platform_h5.html"){
welfareId: this.projectInfo.id,
subjectId: v.subjectId,
selectOptionId: v.id,
receiveAddress: this.selectAddress,
receiveAddress: this.deliveryMethod === "pickup" ? "学校自提" : this.selectAddress,
selectNum: v.selectNum,
userSign: this.userSign
}