diff --git a/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareUserSelection.java b/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareUserSelection.java index e258a36..0ae808c 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareUserSelection.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareUserSelection.java @@ -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) diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java index d088751..4eb3737 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java @@ -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 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 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()); diff --git a/src/main/resources/views/platform/zhgh/welfare/select/optionSelect.js b/src/main/resources/views/platform/zhgh/welfare/select/optionSelect.js index 943691a..e413531 100644 --- a/src/main/resources/views/platform/zhgh/welfare/select/optionSelect.js +++ b/src/main/resources/views/platform/zhgh/welfare/select/optionSelect.js @@ -143,6 +143,32 @@ const optionSelect = {
联系信息
+ + + + + + + + + + 添加地址 + + + + + + + - - - - - - + + + - - 添加地址 - @@ -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 })) } diff --git a/src/main/resources/views/platform/zhghh5/activity/sports/eventList.html b/src/main/resources/views/platform/zhghh5/activity/sports/eventList.html index ab38f62..660100d 100644 --- a/src/main/resources/views/platform/zhghh5/activity/sports/eventList.html +++ b/src/main/resources/views/platform/zhghh5/activity/sports/eventList.html @@ -53,12 +53,18 @@ layout("/layouts/platform_h5.html"){ 暂无 - + + + + + + + + + diff --git a/src/main/resources/views/platform/zhghh5/welfare/select/index.html b/src/main/resources/views/platform/zhghh5/welfare/select/index.html index 0f7b462..9df06b0 100644 --- a/src/main/resources/views/platform/zhghh5/welfare/select/index.html +++ b/src/main/resources/views/platform/zhghh5/welfare/select/index.html @@ -686,6 +686,27 @@ layout("/layouts/platform_h5.html"){
+ + + - -
@@ -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 },