体育活动-福利

This commit is contained in:
=
2025-12-17 18:26:01 +08:00
parent 6351aaba48
commit 58dc4a0d85
5 changed files with 129 additions and 43 deletions
@@ -50,6 +50,11 @@ public class WelfareUserSelection extends BaseModel implements Serializable {
@ColDefine(type = ColType.VARCHAR, width = 32)
private String selectUserId;
@Column
@Comment("选择用户")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userName;
@Column
@Comment("选择时间")
@ColDefine(type = ColType.DATETIME)
@@ -16,6 +16,7 @@ import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.sys.models.Sys_union;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
@@ -392,7 +393,7 @@ public class WelfareListServiceImpl extends BaseServiceImpl<WelfareList> impleme
t2.birthday
FROM
`welfare_list` t1
LEFT JOIN sys_user t2 ON t2.id = t1.userId
LEFT JOIN `vw_user` t2 ON t2.id = t1.userId
$condition
""");
Cnd cnd = Cnd.NEW();
@@ -408,6 +409,9 @@ public class WelfareListServiceImpl extends BaseServiceImpl<WelfareList> impleme
if (pageForm.getBirthMonths() != null && pageForm.getBirthMonths().length > 0) {
cnd.andEX("MONTH(t2.birthday)", "in", pageForm.getBirthMonths());
}
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name()) && AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
cnd.and("t2.unionId", "=", SecurityUtil.getUnionId());
}
cnd.andEX("t1.welfareUnitId", "in", pageForm.getUnitIds());
cnd.andEX("t1.welfareUnionId", "=", pageForm.getUnionId());
cnd.andEX("t1.personType", "in", pageForm.getPersonTypes());
@@ -143,6 +143,32 @@ const optionSelect = {
<div class="confirm-section-title">联系信息</div>
<el-form :model="contactForm" ref="contactForm" :rules="contactRules" label-width="80px">
<el-row :gutter="10">
<el-col :span="20">
<el-form-item v-if="projectInfo.provideMode == 3" prop="receiveAddress"
label="收货地址"
:rules="[{ required: true, message: '请选择收货地址', trigger: 'change' }]">
<el-select v-model="contactForm.receiveAddress" placeholder="请选择收货地址"
style="width: 100%" @change="onAddressChange">
<el-option v-for="item in addressOptions"
:key="item.id"
:label="item.province+ item.city+ item.county+ item.addressDetail"
:value="item.province + item.city + item.county + item.addressDetail">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-button @click="openAddress" type="primary">添加地址</el-button>
</el-col>
<el-col :span="24">
<el-form-item prop="userName" label="收货人">
<el-input
v-model="contactForm.userName"
placeholder="请输入收货人"
clearable>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item prop="mobile" label="联系电话">
<el-input
@@ -153,23 +179,11 @@ const optionSelect = {
</el-input>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item v-if="projectInfo.provideMode == 3" prop="receiveAddress"
label="收货地址"
:rules="[{ required: true, message: '请选择收货地址', trigger: 'change' }]">
<el-select v-model="contactForm.receiveAddress" placeholder="请选择收货地址"
style="width: 100%">
<el-option v-for="item in addressOptions"
:key="item.id"
:label="'收货人:'+item.userName + ',联系电话:' + item.tel + ',收货地址:' + item.province+ item.city+ item.county+ item.addressDetail"
:value="'收货人:'+item.userName + ',联系电话:' + item.tel + ',收货地址:' + item.province+ item.city+ item.county+ item.addressDetail">
</el-option>
</el-select>
<el-col :span="24">
<el-form-item prop="sign" label="签字">
<pc-signature v-model="contactForm.userSign"></pc-signature>
</el-form-item>
</el-col>
<el-col :span="4">
<el-button @click="openAddress" type="primary">添加地址</el-button>
</el-col>
</el-row>
@@ -249,10 +263,15 @@ const optionSelect = {
showOptionDetailDialog: false, // 选项详情弹窗
selectedOption: null, // 当前选中的选项
contactForm: {
mobile: "", // 联系电话,
receiveAddress: ""
mobile: "", // 联系电话
receiveAddress: "",
userName: "", // 收货人
userSign: ""
},
contactRules: {
userName: [
{required: true, message: "请输入收货人", trigger: "blur"}
],
mobile: [
{required: true, message: "请输入联系电话", trigger: "blur"},
{
@@ -341,6 +360,22 @@ const optionSelect = {
}
},
methods: {
// 地址选择变更处理
onAddressChange(value) {
if (value) {
const selectedAddress = this.addressOptions.find(item =>
(item.province + item.city + item.county + item.addressDetail) === value
);
if (selectedAddress) {
// 自动填充收货人和电话
this.contactForm.userName = selectedAddress.userName;
this.contactForm.mobile = selectedAddress.tel;
// const data = selectedAddress.province + selectedAddress.city + selectedAddress.county + selectedAddress.addressDetail
// debugger
// this.$set(this.contactForm, "receiveAddress", data)
}
}
},
openAddress() {
this.$refs.addressDialog.dialogVisible = true
this.$refs.addressDialog.formData = {userId: this.userId}
@@ -420,6 +455,8 @@ const optionSelect = {
if (this.projectInfo.provideMode === 3) {
if (this.userSelection.length > 0 && this.userSelection[0].receiveAddress) {
this.contactForm.receiveAddress = this.userSelection[0].receiveAddress
this.contactForm.userName = this.userSelection[0].userName;
this.contactForm.mobile = this.userSelection[0].mobile;
}
}
@@ -470,6 +507,7 @@ const optionSelect = {
selectOptionId: this.selectedRadioId,
selectNum: 1,
mobile: this.contactForm.mobile,
userName: this.contactForm.userName,
receiveAddress: this.contactForm.receiveAddress
}
]
@@ -481,6 +519,7 @@ const optionSelect = {
selectOptionId: option.id,
selectNum: option.selectNum,
mobile: this.contactForm.mobile,
userName: this.contactForm.userName,
receiveAddress: this.contactForm.receiveAddress
}))
}
@@ -53,12 +53,18 @@ layout("/layouts/platform_h5.html"){
<span v-else>暂无</span>
</template>
</van-cell>
<van-cell title="已报名总人数">
<!-- <van-cell title="已报名总人数">-->
<!-- <template #right-icon>-->
<!-- <span v-if="row.successUserApply>0&&row.applyType!==3">{{ row.successUserApply }}人</span>-->
<!-- <span v-else-if="JSON.parse(row.applyWay).length===2&&row.applyWay.includes(1)">{{row.totalApplyNum}}人</span>-->
<!-- <span v-else-if="row.totalApplyNum>0&&row.applyType===3">{{ row.totalApplyNum }}人</span>-->
<!-- <span v-else>0人</span>-->
<!-- </template>-->
<!-- </van-cell>-->
<van-cell title="暂保存人数">
<template #right-icon>
<span v-if="row.successUserApply>0&&row.applyType!==3">{{ row.successUserApply }}人</span>
<span v-else-if="JSON.parse(row.applyWay).length===2&&row.applyWay.includes(1)">{{row.totalApplyNum}}人</span>
<span v-else-if="row.totalApplyNum>0&&row.applyType===3">{{ row.totalApplyNum }}人</span>
<span v-else>0人</span>
<span v-if="row.apply_num_bc>0">已保存({{row.apply_num_bc}}</span>
<span v-else>暂无已保存人数</span>
</template>
</van-cell>
<van-cell title="已报名人员" v-if="JSON.parse(row.applyWay).length===1">
@@ -686,6 +686,27 @@ layout("/layouts/platform_h5.html"){
<div class="confirm-content-scroll">
<!-- 手机号输入 -->
<div class="mobile-input-section">
<!--收货地址-->
<van-field
v-if="projectInfo.provideMode == 3"
v-model="formData.receiveAddress"
label="收货地址"
rows="2"
type="textarea"
placeholder="请选择收货地址"
readonly
is-link
@click="showAddressSheet = true"
required
></van-field>
<van-field
v-model="formData.userName"
label="收货人"
placeholder="请输入收货人"
:error="userNameError"
@focus="userNameError = false"
required
></van-field>
<van-field
v-model="formData.mobile"
label="联系电话"
@@ -695,19 +716,6 @@ layout("/layouts/platform_h5.html"){
maxlength="11"
required
></van-field>
<!--收货地址-->
<van-field
v-if="projectInfo.provideMode == 3"
v-model="formData.receiveAddress"
label="收货地址"
rows="4"
type="textarea"
placeholder="请选择收货地址"
readonly
is-link
@click="showAddressSheet = true"
required
></van-field>
</div>
<!-- 选择内容 -->
@@ -813,10 +821,12 @@ layout("/layouts/platform_h5.html"){
showOptionDetailDialog: false, // 选项详情弹窗
selectedOption: null, // 当前选中的选项
mobileError: false, // 手机号错误标记
userNameError: false, // 收货人错误标记
formData: {
userSign: "", // 用户签名
mobile: "", // 手机号码
address: "" // 收货地址
address: "",// 收货地址
userName: "",//收货人
},
addressOptions: [],
@@ -941,14 +951,17 @@ layout("/layouts/platform_h5.html"){
// 如果有用户选择数据,从中获取手机号
if (this.userSelection && this.userSelection.length > 0 && this.userSelection[0].mobile) {
this.formData.mobile = this.userSelection[0].mobile
this.formData.userName = this.userSelection[0].userName
// 获取签名信息(如果有)
if (this.userSelection[0].userSign) {
this.formData.userSign = this.userSelection[0].userSign
}
} else if (this.$store.user && this.$store.user.mobile) {
} else if (this.$store.state.user && this.$store.state.user.mobile) {
// 如果没有选择过,使用store中的默认手机号
this.formData.mobile = this.$store.user.mobile
this.formData.mobile = this.$store.state.user.mobile
}else if (this.$store.state.user && this.$store.state.user.username){
this.formData.userName = this.$store.state.user.username
}
// 地址回显
@@ -995,6 +1008,11 @@ layout("/layouts/platform_h5.html"){
return
}
// 验证收货人
if (!this.validateUserName()) {
return;
}
// 验证手机号
if (!this.validateMobile()) {
return
@@ -1030,7 +1048,8 @@ layout("/layouts/platform_h5.html"){
{
selectOptionId: this.selectedRadioId,
selectNum: 1,
mobile: this.formData.mobile
mobile: this.formData.mobile,
userName: this.formData.userName
}
]
}
@@ -1040,7 +1059,8 @@ layout("/layouts/platform_h5.html"){
selections = this.selectedOptions.map((option) => ({
selectOptionId: option.id,
selectNum: option.selectNum,
mobile: this.formData.mobile
mobile: this.formData.mobile,
userName: this.formData.userName
}))
}
@@ -1101,6 +1121,16 @@ layout("/layouts/platform_h5.html"){
return true
},
// 验证收货人
validateUserName() {
if (!this.formData.userName) {
this.userNameError = true;
this.$toast.fail("请输入收货人姓名");
return false;
}
return true;
},
// 格式化时间范围
formatTimeRange(start, end) {
if (!start || !end) return "未设置"
@@ -1198,8 +1228,10 @@ layout("/layouts/platform_h5.html"){
// 选择收货地址
selectAddress(address) {
this.formData.receiveAddress =
"收货人:" + address.userName + ",联系电话:" + address.tel + ",收货地址:" + address.province + address.city + address.county + address.addressDetail
// "收货人:" + address.userName + ",联系电话:" + address.tel + ",收货地址:" +
this.formData.userName = address.userName
this.formData.mobile = address.tel
this.formData.receiveAddress = address.province + address.city + address.county + address.addressDetail
this.showAddressSheet = false
},