..
This commit is contained in:
+10
@@ -14,6 +14,7 @@ import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareList;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareProject;
|
||||
import com.budwk.app.zhgh.welfare.param.WelfareSelectionSituationPageForm;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareSelectionSituationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -47,6 +48,7 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
|
||||
t1.welfareUnitName,
|
||||
GROUP_CONCAT(DISTINCT t3.optionName) AS selectedOptions,
|
||||
GROUP_CONCAT(DISTINCT t2.mobile) AS mobile,
|
||||
GROUP_CONCAT(DISTINCT t2.receiveAddress) AS receiveAddress,
|
||||
t4.username AS userName,
|
||||
t4.loginname AS loginName,
|
||||
t4.sex,
|
||||
@@ -105,6 +107,7 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
|
||||
t1.welfareUnitName,
|
||||
GROUP_CONCAT(DISTINCT t3.optionName) AS selectedOptions,
|
||||
GROUP_CONCAT(DISTINCT t2.mobile) AS mobile,
|
||||
GROUP_CONCAT(DISTINCT t2.receiveAddress) AS receiveAddress,
|
||||
t4.username AS userName,
|
||||
t4.loginname AS loginName,
|
||||
t4.sex
|
||||
@@ -152,6 +155,9 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = listMap(sql);
|
||||
|
||||
// 项目
|
||||
WelfareProject project = dao().fetch(WelfareProject.class, pageForm.getProjectId());
|
||||
|
||||
|
||||
// excel列
|
||||
List<ExcelExportEntity> entities = new ArrayList<>();
|
||||
@@ -163,6 +169,10 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
|
||||
entities.add(new ExcelExportEntity("所选福利", "selectedOptions", 20));
|
||||
entities.add(new ExcelExportEntity("联系电话", "mobile", 20));
|
||||
|
||||
if(project.getProvideMode() == 3){
|
||||
entities.add(new ExcelExportEntity("收货地址", "receiveAddress", 40));
|
||||
}
|
||||
|
||||
// 设置导出参数
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
|
||||
+1
@@ -76,6 +76,7 @@ public class WelfareStatisticsServiceImpl extends BaseServiceImpl<WelfareProject
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t1.projectId", "=", projectId);
|
||||
cnd.andEX("t1.welfareUnionId", "=", unionId);
|
||||
cnd.groupBy("t1.userId");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> welfareSelectionList = listMap(sql);
|
||||
|
||||
|
||||
@@ -99,6 +99,9 @@ layout("/layouts/platform.html"){
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column label="收货地址" prop="receiveAddress" v-if="provideMode===3"></el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="100px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="proxySelect(row)">代选</el-button>
|
||||
@@ -152,6 +155,9 @@ layout("/layouts/platform.html"){
|
||||
return this.projectOptions.find((item) => item.id === this.pageForm.projectId).options
|
||||
}
|
||||
return []
|
||||
},
|
||||
provideMode() {
|
||||
return this.projectOptions.find((item) => item.id === this.pageForm.projectId).provideMode
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -74,11 +74,7 @@ layout("/layouts/platform_h5.html"){
|
||||
}, 500)
|
||||
},
|
||||
back() {
|
||||
if (this.projectId) {
|
||||
this.$pjaxReplace("/platform/h5/welfare/userChoose/index?id=" + this.projectId)
|
||||
} else {
|
||||
this.$pjaxReplace("/platform/h5/home")
|
||||
}
|
||||
this.historyBack()
|
||||
},
|
||||
onEdit(row) {
|
||||
this.title = "编辑地址"
|
||||
|
||||
@@ -56,6 +56,10 @@ const selectView = {
|
||||
<div class="info-row__label">联系电话</div>
|
||||
<div class="info-row__value">{{ mergedSelections[0]?.mobile || '暂无' }}</div>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<div class="info-row__label">收货地址</div>
|
||||
<div class="info-row__value">{{ mergedSelections[0]?.receiveAddress || '暂无' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -73,7 +77,7 @@ const selectView = {
|
||||
:key="item.id"
|
||||
@click="showOptionDetail(item)">
|
||||
<div class="selection-item__image">
|
||||
<img :src="item.imgUrl || '/static/images/default-welfare.png'"
|
||||
<img :src="item.imgUrl"
|
||||
alt="福利图片"
|
||||
@error="handleImageError">
|
||||
</div>
|
||||
|
||||
@@ -678,18 +678,17 @@ layout("/layouts/platform_h5.html"){
|
||||
maxlength="11"
|
||||
required
|
||||
></van-field>
|
||||
<!--
|
||||
收货地址字段预留位置
|
||||
<!--收货地址-->
|
||||
<van-field
|
||||
v-if="projectInfo.needAddress"
|
||||
v-model="formData.address"
|
||||
v-if="projectInfo.provideMode == 3"
|
||||
v-model="formData.receiveAddress"
|
||||
label="收货地址"
|
||||
placeholder="请输入收货地址"
|
||||
type="textarea"
|
||||
rows="2"
|
||||
placeholder="请选择收货地址"
|
||||
readonly
|
||||
is-link
|
||||
@click="showAddressSheet = true"
|
||||
required
|
||||
></van-field>
|
||||
-->
|
||||
></van-field>
|
||||
</div>
|
||||
|
||||
<!-- 选择内容 -->
|
||||
@@ -733,6 +732,35 @@ layout("/layouts/platform_h5.html"){
|
||||
<div class="welfare-detail-content" v-html="selectedOption.description"></div>
|
||||
</div>
|
||||
</van-popup>
|
||||
|
||||
<!-- 收货地址选择弹窗 -->
|
||||
<van-action-sheet v-model="showAddressSheet" title="选择收货地址" :round="true">
|
||||
<div style="padding: 16px 0 0">
|
||||
<div
|
||||
v-for="address in addressOptions"
|
||||
:key="address.id"
|
||||
class="address-item"
|
||||
@click="selectAddress(address)"
|
||||
style="padding: 12px 16px; border-bottom: 1px solid #f0f0f0; cursor: pointer"
|
||||
>
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start">
|
||||
<div style="flex: 1">
|
||||
<div style="font-size: 16px; font-weight: 500; color: #323233; margin-bottom: 4px">
|
||||
{{ address.userName }} {{ address.tel }}
|
||||
</div>
|
||||
<div style="font-size: 14px; color: #646566; line-height: 1.4">
|
||||
{{ address.province }}{{ address.city }}{{ address.county }}{{ address.addressDetail }}
|
||||
</div>
|
||||
</div>
|
||||
<van-tag v-if="address.isDefault" type="primary" size="mini" style="margin-left: 8px">默认</van-tag>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="addressOptions.length === 0" style="text-align: center; padding: 40px 16px; color: #969799">暂无收货地址</div>
|
||||
</div>
|
||||
<div style="padding: 16px; border-top: 1px solid #f0f0f0; background: #fafafa">
|
||||
<van-button type="info" block round @click="goToAddressManage">收货地址管理</van-button>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -757,8 +785,12 @@ layout("/layouts/platform_h5.html"){
|
||||
formData: {
|
||||
userSign: "", // 用户签名
|
||||
mobile: "", // 手机号码
|
||||
address: "" // 收货地址(预留)
|
||||
}
|
||||
address: "" // 收货地址
|
||||
},
|
||||
|
||||
addressOptions: [],
|
||||
showAddressSheet: false, // 收货地址选择弹窗
|
||||
selectedAddressText: "" // 选中的收货地址显示文本
|
||||
}
|
||||
},
|
||||
|
||||
@@ -815,6 +847,11 @@ layout("/layouts/platform_h5.html"){
|
||||
if (res.code === 0) {
|
||||
this.projectInfo = res.data
|
||||
|
||||
// 获取收货地址
|
||||
if (this.projectInfo.provideMode === 3) {
|
||||
this.getAddress()
|
||||
}
|
||||
|
||||
// 初始化选项的selectNum为0
|
||||
if (this.projectInfo.options) {
|
||||
this.projectInfo.options.forEach((option) => {
|
||||
@@ -846,10 +883,16 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
} else if (this.$store.user && this.$store.user.mobile) {
|
||||
// 如果没有选择过,使用store中的默认手机号
|
||||
debugger
|
||||
this.formData.mobile = this.$store.user.mobile
|
||||
}
|
||||
|
||||
// 地址回显
|
||||
if (this.projectInfo.provideMode === 3) {
|
||||
if (this.userSelection && this.userSelection[0].receiveAddress) {
|
||||
this.formData.receiveAddress = this.userSelection[0].receiveAddress
|
||||
}
|
||||
}
|
||||
|
||||
// 设置已选择的选项
|
||||
if (this.projectInfo.options && this.userSelection.length > 0) {
|
||||
// 单选模式
|
||||
@@ -898,6 +941,12 @@ layout("/layouts/platform_h5.html"){
|
||||
return
|
||||
}
|
||||
|
||||
// 如果需要邮寄
|
||||
if (this.projectInfo.provideMode === 3 && !this.formData.receiveAddress) {
|
||||
this.$toast.fail("请填写邮寄地址")
|
||||
return
|
||||
}
|
||||
|
||||
if (this.isSubmitting) return
|
||||
this.isSubmitting = true
|
||||
|
||||
@@ -937,10 +986,10 @@ layout("/layouts/platform_h5.html"){
|
||||
})
|
||||
}
|
||||
|
||||
// 未来可扩展添加收货地址
|
||||
if (this.formData.address) {
|
||||
// 收货地址
|
||||
if (this.projectInfo.provideMode === 3 && this.formData.receiveAddress) {
|
||||
selections.forEach((selection) => {
|
||||
selection.address = this.formData.address
|
||||
selection.receiveAddress = this.formData.receiveAddress
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1082,6 +1131,18 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
},
|
||||
|
||||
// 选择收货地址
|
||||
selectAddress(address) {
|
||||
this.formData.receiveAddress =
|
||||
address.userName + " " + address.tel + " " + address.province + address.city + address.county + address.addressDetail
|
||||
this.showAddressSheet = false
|
||||
},
|
||||
|
||||
// 跳转到地址管理页面
|
||||
goToAddressManage() {
|
||||
this.$pjaxReplace("/platform/h5/welfare/address/list")
|
||||
},
|
||||
|
||||
// 切换选项选中状态
|
||||
toggleOption(option) {
|
||||
if (this.projectInfo.isCheckBox === "radio") {
|
||||
@@ -1120,6 +1181,14 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 获取收货地址
|
||||
async getAddress() {
|
||||
const resp = await this.$axios.post("/platform/welfare/addressManage/selectUserAddress")
|
||||
if (resp.code === 0) {
|
||||
this.addressOptions = resp.data
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user