commit
This commit is contained in:
@@ -8,6 +8,7 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
|
||||
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.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -100,12 +101,13 @@ public class WelfareListController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
CASE
|
||||
|
||||
|
||||
WHEN
|
||||
wus.selectUserId IS NOT NULL THEN
|
||||
1 ELSE 0
|
||||
END AS isChoose,
|
||||
wl.id,
|
||||
wl.unionid,
|
||||
wl.username,
|
||||
wl.loginname,
|
||||
wl.personType,
|
||||
@@ -115,8 +117,13 @@ public class WelfareListController {
|
||||
wl.listId,
|
||||
wus.userSign,
|
||||
wus.courierNumber,
|
||||
wus.receiveAddress,
|
||||
GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.receiveAddress, ')' ) AS receiveAddress2,
|
||||
GROUP_CONCAT(
|
||||
DISTINCT
|
||||
CONCAT(
|
||||
wuso.optionName,
|
||||
IF(wus.receiveAddress IS NOT NULL AND wus.receiveAddress != '', CONCAT('(', wus.receiveAddress, ')'), '')
|
||||
)
|
||||
) AS receiveAddress,
|
||||
GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.selectNum, '份)' ) AS gist_list
|
||||
FROM
|
||||
view_welfare_list wl
|
||||
@@ -161,11 +168,15 @@ public class WelfareListController {
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = welfareListService.list(pageForm, sql);
|
||||
List<NutMap> mapList = pagination.getList();
|
||||
if (provideMode != 3) {
|
||||
mapList.forEach(v -> {
|
||||
v.put("receiveAddress",v.getString("receiveAddress2"));
|
||||
});
|
||||
}
|
||||
List<WelfareMemberUnionConfirm> confirms = projectService.dao().query(WelfareMemberUnionConfirm.class, Cnd.where("projectId", "=", projectId));
|
||||
|
||||
mapList.forEach(v -> {
|
||||
if (StrUtil.isNotBlank(v.getString("unionid"))) {
|
||||
WelfareMemberUnionConfirm confirm = confirms.stream().filter(o -> o.getUnionId().equals(v.getString("unionid"))).findFirst().orElse(null);
|
||||
v.setv("isAudit", confirm != null ? confirm.getIsAudit() : "");
|
||||
v.setv("auditTime", confirm != null ? confirm.getAuditTime() : "");
|
||||
}
|
||||
});
|
||||
pagination.setList(mapList);
|
||||
return pagination;
|
||||
}
|
||||
@@ -514,7 +525,7 @@ public class WelfareListController {
|
||||
WHERE
|
||||
wpus.welfareId = @welfareId
|
||||
AND wpus.selectOptionId = @selectOptionId and wpus.selectNum!=0
|
||||
|
||||
|
||||
""").setParam("welfareId", projectId).setParam("selectOptionId", optionId);
|
||||
|
||||
// GROUP BY wpus.selectUserId,wpus.selectOptionId ORDER BY un.unioncode
|
||||
@@ -652,4 +663,23 @@ public class WelfareListController {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("welfare.list.mange")
|
||||
public Object doAuditUser(@Param(value = "projectId", required = false) String projectId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "flag") Boolean flag) {
|
||||
if (flag) {
|
||||
welfareListService.dao().update(WelfareMemberUnionConfirm.class, Chain.make("isAudit", true)
|
||||
.add("auditTime", DateUtil.date()).add("auditUser", ShiroUtil.getUserId()),
|
||||
Cnd.where("projectId", "=", projectId).and("unionId", "=", unionId));
|
||||
} else {
|
||||
welfareListService.dao().update(WelfareMemberUnionConfirm.class, Chain.make("isAudit", null)
|
||||
.add("auditTime", null).add("auditUser", null),
|
||||
Cnd.where("projectId", "=", projectId).and("unionId", "=", unionId));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,15 +9,13 @@ import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_home_activity;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.sys.services.SysTaskService;
|
||||
import io.v.nutz.task.services.TaskPlatformService;
|
||||
import io.v.nutz.zhgh.data.model.MatchConditionStructure;
|
||||
import io.v.nutz.zhgh.data.service.MatchConditionStructureService;
|
||||
import io.v.nutz.zhgh.mobileHome.service.MobileHomeService;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareProject;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareProjectSubject;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareProjectSubjectOption;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareUserSelection;
|
||||
import io.v.nutz.zhgh.welfare.model.*;
|
||||
import io.v.nutz.zhgh.welfare.service.WelfareListService;
|
||||
import io.v.nutz.zhgh.welfare.service.WelfareProjectService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
@@ -39,6 +37,7 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -237,6 +236,21 @@ public class WelfareProjectMangeController {
|
||||
dao.update(project);
|
||||
|
||||
}
|
||||
|
||||
dao.clear(WelfareMemberUnionConfirm.class, Cnd.where("projectId","=",project.getId()));
|
||||
List<Sys_union> unionList = dao.query(Sys_union.class, Cnd.NEW());
|
||||
List<WelfareMemberUnionConfirm> confirmList = new ArrayList<>();
|
||||
for (Sys_union union : unionList) {
|
||||
WelfareMemberUnionConfirm confirm = new WelfareMemberUnionConfirm();
|
||||
confirm.setId(R.UU32());
|
||||
confirm.setProjectId(project.getId());
|
||||
confirm.setUnionId(union.getId());
|
||||
confirm.setIsAudit(false);
|
||||
confirmList.add(confirm);
|
||||
}
|
||||
dao.fastInsert(confirmList);
|
||||
|
||||
|
||||
Sys_home_activity sysHomeActivity = project.covertToSysHomeActivity();
|
||||
sysHomeActivity.setEnable(true);
|
||||
dao.insertOrUpdate(sysHomeActivity);
|
||||
|
||||
@@ -128,6 +128,12 @@ public class WelfareUserChooseController {
|
||||
@RequiresPermissions("welfare.user.choose")
|
||||
public Result confirmSelect(@Param("welfareUserSelections") WelfareUserSelection[] welfareUserSelections,
|
||||
String projectId) {
|
||||
|
||||
int count = simpleService.dao().count(WelfareList.class, Cnd.where("projectId", "=", projectId).and("userId", "=", ShiroUtil.getUserId()));
|
||||
if (count == 0) {
|
||||
return Result.error("您暂无权限!");
|
||||
}
|
||||
|
||||
//删除上次选择的
|
||||
simpleService.dao().clear(WelfareUserSelection.class,
|
||||
Cnd.where("welfareId", "=", projectId)
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package io.v.nutz.zhgh.welfare.model;
|
||||
|
||||
|
||||
import io.v.nutz.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@Table
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WelfareMemberUnionConfirm extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("所属项目")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String projectId;
|
||||
|
||||
@Column
|
||||
@Comment("工会id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("是否确认")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isAudit;
|
||||
|
||||
@Column
|
||||
@Comment("确认时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date auditTime;
|
||||
|
||||
@Column
|
||||
@Comment("操作人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String auditUser;
|
||||
}
|
||||
@@ -203,11 +203,14 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
boolean isThreeUnit = Globals.MyConfig.getBoolean("isThreeUnit");
|
||||
Sql welfareUnitSql = Sqls.create("""
|
||||
SELECT
|
||||
unit.*
|
||||
unit.*,
|
||||
wmuc.isAudit
|
||||
FROM
|
||||
welfare_unit unit
|
||||
LEFT JOIN welfare_member_union_confirm wmuc ON wmuc.projectId = @projectId
|
||||
AND wmuc.unionId = unit.welfareUnitId
|
||||
$condition
|
||||
""");
|
||||
""").setParam("projectId", projectId);
|
||||
CndPlus cnd = CndPlus.create();
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionWelfareAdmin")) {
|
||||
|
||||
@@ -486,8 +486,8 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
methods: {
|
||||
addShopping(address) {
|
||||
this.$set(this.projectInfo.welfareProjectSubjects[0].options[this.optionIndex], "receiveAddress", address)
|
||||
this.projectInfo.welfareProjectSubjects[0].options[this.optionIndex].receiveAddress = address
|
||||
this.$set(this.selectedOptions[this.optionIndex], "receiveAddress", address)
|
||||
this.selectedOptions[this.optionIndex].receiveAddress = address
|
||||
this.shoppingPopup = false
|
||||
},
|
||||
async onSearchShoppingAddress() {
|
||||
|
||||
@@ -106,7 +106,7 @@ let commonColumns = [
|
||||
{prop: 'loginname', label: '工号', width: "100"},
|
||||
{prop: 'username', label: '姓名', width: "80"},
|
||||
{prop: 'sex', label: '性别', sortable: true, width: '100px', checked: 0},
|
||||
{prop: 'personType', label: '人员类型', sortable: true, width: "100"},
|
||||
// {prop: 'personType', label: '人员类型', sortable: true, width: "100"},
|
||||
{prop: 'userState', label: '在职状态', sortable: true, width: "100"},
|
||||
{prop: 'unionname', label: '所属工会', sortable: true},
|
||||
{prop: 'unitname', label: '所属单位', sortable: true},
|
||||
|
||||
@@ -271,7 +271,13 @@ layout("/layouts/platform.html"){
|
||||
一键全部领取
|
||||
</el-button>
|
||||
|
||||
|
||||
<el-button :disabled="moment(projectInfo.choiceTimeEnd).valueOf()<moment().valueOf()" type="primary" size="small"
|
||||
@click="doAudit(true)">确认名单
|
||||
</el-button>
|
||||
<!-- 取消确认 -->
|
||||
<el-button :disabled="moment(projectInfo.choiceTimeEnd).valueOf()<moment().valueOf()" type="danger" size="small"
|
||||
@click="doAudit(false)">取消确认
|
||||
</el-button>
|
||||
<!-- <el-button :disabled="!pageForm.projectId" type="primary" size="small"
|
||||
icon="el-icon-download"
|
||||
@click="openExportWelFareList(pageForm.projectId)">导出签字表
|
||||
@@ -280,12 +286,12 @@ layout("/layouts/platform.html"){
|
||||
icon="el-icon-download"
|
||||
@click="doExportWelfare(pageForm.projectId)">导出名单
|
||||
</el-button>-->
|
||||
<el-button :disabled="!pageForm.projectId" @click="openAdd"
|
||||
icon="el-icon-plus"
|
||||
size="small"
|
||||
type="primary"
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H05')}">添加
|
||||
</el-button>
|
||||
<!-- <el-button :disabled="!pageForm.projectId" @click="openAdd"
|
||||
icon="el-icon-plus"
|
||||
size="small"
|
||||
type="primary"
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H05')}">添加
|
||||
</el-button>-->
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
@@ -329,21 +335,9 @@ layout("/layouts/platform.html"){
|
||||
style="height: 60px" v-if="row.userSign"></el-image>
|
||||
<el-tag type="warning" v-else>暂无</el-tag>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='realWelfareUnitId'">
|
||||
<span v-if="!row.editWelfareUnit">{{row.realWelfareUnitName}}</span>
|
||||
<div v-else>
|
||||
<el-select clearable filterable
|
||||
placeholder="请选择" size="small"
|
||||
style="width: 160px"
|
||||
v-model="row.modifiedWelfareUnitId">
|
||||
<el-option
|
||||
:key="item.welfareUnitId"
|
||||
:label="item.welfareUnitName"
|
||||
:value="item.welfareUnitId"
|
||||
v-for="item in welfareUnits">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<template v-else-if="column.prop=='isAudit'" scope="{row}">
|
||||
<el-tag type="success" v-if="row.isAudit">已确认</el-tag>
|
||||
<el-tag type="info" v-else>未确认</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="快递单号" prop="courierNumber" show-overflow-tooltip
|
||||
@@ -364,7 +358,7 @@ layout("/layouts/platform.html"){
|
||||
<!-- 领取-->
|
||||
<!-- </el-button>-->
|
||||
<el-button @click="openEditWelfare(row)" size="mini" type="primary"
|
||||
v-if="pageFormSignMode!==1">
|
||||
:disabled="moment(projectInfo.choiceTimeEnd).valueOf()<moment().valueOf()">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row)" size="mini" type="danger"
|
||||
@@ -637,7 +631,9 @@ layout("/layouts/platform.html"){
|
||||
{prop: 'isChoose', label: '是否选择', width: "100px", sortable: true},
|
||||
{prop: 'gist_list', label: '所选福利', width: "100px"},
|
||||
{prop: 'receiveAddress', label: '地址', width: "100px"},
|
||||
{prop: 'userSign', label: '签字', width: "100px"},
|
||||
{prop: 'userSign', label: '签字', width: "100px", checked: 0},
|
||||
{prop: 'isAudit', label: '是否确认'},
|
||||
{prop: 'auditTime', label: '确认时间', checked: 0},
|
||||
]),
|
||||
formRules: {},
|
||||
welfare,
|
||||
@@ -675,6 +671,35 @@ layout("/layouts/platform.html"){
|
||||
'courier-number-info': httpVueLoader('/components/welfare/CourierNumberInfo.vue?v=' + new Date().getTime())
|
||||
},
|
||||
methods: {
|
||||
async doAudit(flag) {
|
||||
// flag true,确认 false,取消
|
||||
if ("${@shiro.hasRole('sysadmin')}" === "true" && !this.pageForm.welfareUnit) {
|
||||
this.notifyWarning("请选择需要提交的分工会")
|
||||
return
|
||||
}
|
||||
if (this.pageForm.totalCount === 0) {
|
||||
this.notifyWarning("当前分工会没有名单,暂不需要提交")
|
||||
return
|
||||
}
|
||||
const confirm = await this.$confirm('您确定名单都已核实,准确无误?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post("/platform/welfare/list/mange/doAuditUser", {
|
||||
projectId: this.pageForm.projectId,
|
||||
unionId: this.pageForm.welfareUnit,
|
||||
flag: flag
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
doExcelByOptionId() {
|
||||
if (!this.pageForm.optionId) {
|
||||
this.$message.warning('请选择要导出的套餐')
|
||||
@@ -1117,6 +1142,7 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
})
|
||||
this.welfareOptions = resp.data
|
||||
this.projectInfo = this.projectSelectOptions.find(v => v.value === this.pageForm.projectId)?.v
|
||||
},
|
||||
async changeWelfareUnit() {
|
||||
this.$set(this.pageForm, 'unit', '')
|
||||
|
||||
@@ -212,6 +212,10 @@ layout("/layouts/platform.html"){
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop=='welfareUnitName'">{{row.welfareUnitName}}</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='isAudit'">
|
||||
<span v-if="row.isAudit"><el-tag>已提交</el-tag></span>
|
||||
<span v-else><el-tag type="danger">未提交</el-tag></span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='unselectedTeacherSum'">
|
||||
<el-link @click="openUnclaimed(row.welfareUnitCode)" type="primary">{{row.unselectedTeacherSum}}</el-link>
|
||||
</template>
|
||||
@@ -589,6 +593,7 @@ layout("/layouts/platform.html"){
|
||||
label: welfare.welfareUnitModeName
|
||||
}
|
||||
].concat(resp.data.tableColumn)
|
||||
this.tableColumns.push({prop: "isAudit", label: "是否核对"})
|
||||
this.tableData = resp.data.tableList
|
||||
}
|
||||
loading.close()
|
||||
|
||||
@@ -56,12 +56,12 @@ layout("/layouts/platform.html"){
|
||||
<div class="search-item-label">年  度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
@change="doSearch"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
@@ -77,34 +77,34 @@ layout("/layouts/platform.html"){
|
||||
</table-tool>
|
||||
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:size="tableSize"
|
||||
@sort-change="pageOrder"
|
||||
ref="table"
|
||||
row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading"
|
||||
:data="tableData"
|
||||
:size="tableSize"
|
||||
@sort-change="pageOrder"
|
||||
ref="table"
|
||||
row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading"
|
||||
>
|
||||
<el-table-column
|
||||
:index="indexMethod"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
:index="indexMethod"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop=='choiceTime'">
|
||||
<i class="el-icon-time"></i>
|
||||
@@ -130,7 +130,9 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作" prop="userOnline" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-button type="primary" size="mini" @click="openChoose(row)">{{confirmButtonInfo(row).text}}</el-button>
|
||||
<el-button type="primary" size="mini" @click="openChoose(row)">
|
||||
{{confirmButtonInfo(row).text}}
|
||||
</el-button>
|
||||
|
||||
<!-- <el-button @click="openChoose(row)" size="mini" type="primary"-->
|
||||
<!-- v-if="new Date().getTime()>moment(row.choiceTimeStart).valueOf()-->
|
||||
@@ -165,7 +167,8 @@ layout("/layouts/platform.html"){
|
||||
<el-form-item label="福利礼品">{{projectInfo.gift}}</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="8">
|
||||
<el-form-item label="选择形式">{{projectInfo.isCheckBox==='checkBox'?'多选':'单选'}}</el-form-item>
|
||||
<el-form-item label="选择形式">{{projectInfo.isCheckBox==='checkBox'?'多选':'单选'}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="8" v-if="projectInfo.isCheckBox==='checkBox'">
|
||||
<el-form-item label="最多选几个">{{projectInfo.multiSelectNum}}个</el-form-item>
|
||||
@@ -187,7 +190,9 @@ layout("/layouts/platform.html"){
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="8">
|
||||
<el-form-item label="选择时间">{{projectInfo.choiceTimeStart}}至{{projectInfo.choiceTimeEnd}}</el-form-item>
|
||||
<el-form-item label="选择时间">
|
||||
{{projectInfo.choiceTimeStart}}至{{projectInfo.choiceTimeEnd}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -199,16 +204,17 @@ layout("/layouts/platform.html"){
|
||||
<div slot="header" style="display: flex; justify-content: space-between">
|
||||
<div style="color: #000; font-size: 18px">{{option.optionName}}</div>
|
||||
<div>
|
||||
<el-button @click.stop="viewDesc(option)" type="text">套餐详情</el-button>
|
||||
<el-button @click.stop="viewDesc(option)" type="text">套餐详情
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: grid; grid-template-rows: auto 1fr auto; height: 200px">
|
||||
<div style="display: flex">
|
||||
<el-image
|
||||
style="width: 150px; height: 150px"
|
||||
:src="CREATE_PREVIEW_URL(option.imgUrl)"
|
||||
fit="contain"
|
||||
style="width: 150px; height: 150px"
|
||||
:src="CREATE_PREVIEW_URL(option.imgUrl)"
|
||||
fit="contain"
|
||||
></el-image>
|
||||
|
||||
<div style="width: calc(100% - 150px); padding-left: 20px; position: relative">
|
||||
@@ -216,8 +222,8 @@ layout("/layouts/platform.html"){
|
||||
<span class="desc_label"></span>
|
||||
<el-tooltip placement="top" :content="option.supplier">
|
||||
<span
|
||||
class="desc_value"
|
||||
style="width: calc(100% - 80px); text-overflow: ellipsis; overflow: hidden"
|
||||
class="desc_value"
|
||||
style="width: calc(100% - 80px); text-overflow: ellipsis; overflow: hidden"
|
||||
>
|
||||
{{ option.supplier }}
|
||||
</span>
|
||||
@@ -229,30 +235,30 @@ layout("/layouts/platform.html"){
|
||||
</div>
|
||||
<div>
|
||||
<el-input-number
|
||||
:disabled="isView"
|
||||
:max="option.maxNum"
|
||||
:min="0"
|
||||
@keydown.native="onKeydown"
|
||||
@change="numChange(option.selectNum, option, oidx)"
|
||||
style="width: 150px; position: absolute; right: 0; bottom: 0"
|
||||
v-model="option.selectNum"
|
||||
:disabled="isView"
|
||||
:max="option.maxNum"
|
||||
:min="0"
|
||||
@keydown.native="onKeydown"
|
||||
@change="numChange(option.selectNum, option, oidx)"
|
||||
style="width: 150px; position: absolute; right: 0; bottom: 0"
|
||||
v-model="option.selectNum"
|
||||
></el-input-number>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 17px">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
clearable
|
||||
:disabled="option.selectNum == 0"
|
||||
placeholder="请选择取货门店"
|
||||
v-model="option.receiveAddress"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
:disabled="option.selectNum == 0"
|
||||
placeholder="请选择取货门店"
|
||||
v-model="option.receiveAddress"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in option.receiveAddressList"
|
||||
:key="item.address"
|
||||
:label="item.address"
|
||||
:value="item.address"
|
||||
v-for="item in option.receiveAddressList"
|
||||
:key="item.address"
|
||||
:label="item.address"
|
||||
:value="item.address"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -270,17 +276,17 @@ layout("/layouts/platform.html"){
|
||||
<div style="display: flex; column-gap: 10px">
|
||||
<div style="flex: 1">
|
||||
<el-select
|
||||
@change="addressChange"
|
||||
filterable
|
||||
placeholder="请选择收货地址"
|
||||
style="width: 100%"
|
||||
v-model="formData.addressId"
|
||||
@change="addressChange"
|
||||
filterable
|
||||
placeholder="请选择收货地址"
|
||||
style="width: 100%"
|
||||
v-model="formData.addressId"
|
||||
>
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name+' '+item.defaultName"
|
||||
:value="item.id"
|
||||
v-for="item in addressOptions"
|
||||
:key="item.id"
|
||||
:label="item.name+' '+item.defaultName"
|
||||
:value="item.id"
|
||||
v-for="item in addressOptions"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -296,17 +302,17 @@ layout("/layouts/platform.html"){
|
||||
</el-col>
|
||||
<el-col span="24">
|
||||
<el-form-item
|
||||
:rules="{required:true,message: '请确认收货地址', trigger: 'blur'}"
|
||||
label="请确认收货地址"
|
||||
prop="receiveAddress"
|
||||
:rules="{required:true,message: '请确认收货地址', trigger: 'blur'}"
|
||||
label="请确认收货地址"
|
||||
prop="receiveAddress"
|
||||
>
|
||||
<el-input
|
||||
:rows="4"
|
||||
disabled
|
||||
maxlength="100"
|
||||
placeholder="选择收货地址联动"
|
||||
type="textarea"
|
||||
v-model="formData.receiveAddress"
|
||||
:rows="4"
|
||||
disabled
|
||||
maxlength="100"
|
||||
placeholder="选择收货地址联动"
|
||||
type="textarea"
|
||||
v-model="formData.receiveAddress"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -314,20 +320,20 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
|
||||
<el-form-item
|
||||
:rules="{required:true,message: '请签字', trigger: 'blur'}"
|
||||
label="签字"
|
||||
prop="sign"
|
||||
v-if="projectInfo.signMode===2"
|
||||
:rules="{required:true,message: '请签字', trigger: 'blur'}"
|
||||
label="签字"
|
||||
prop="sign"
|
||||
v-if="projectInfo.signMode===2"
|
||||
>
|
||||
<template v-if="isChoice===0||!isView">
|
||||
<sign :is_value_base64="false" :qz.sync="formData.sign" prefix="welfare" ref="sign"></sign>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-image
|
||||
:src="'/signature/getSignData?path=' +formData.imageUrl"
|
||||
fit="contain"
|
||||
style="height: 100px; width: 100%"
|
||||
v-if="formData.imageUrl"
|
||||
:src="'/signature/getSignData?path=' +formData.imageUrl"
|
||||
fit="contain"
|
||||
style="height: 100px; width: 100%"
|
||||
v-if="formData.imageUrl"
|
||||
></el-image>
|
||||
<span v-else>暂无</span>
|
||||
</template>
|
||||
@@ -349,30 +355,31 @@ layout("/layouts/platform.html"){
|
||||
</el-drawer>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="addressDialogVisible" title="收货地址" width="40%">
|
||||
<el-form :model="formData" label-position="right" :rules="formRules" label-suffix=":" label-width="120px" ref="addForm">
|
||||
<el-form :model="formData" label-position="right" :rules="formRules" label-suffix=":" label-width="120px"
|
||||
ref="addForm">
|
||||
<el-row :gutter="60">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="地址信息" prop="addressList">
|
||||
<el-cascader
|
||||
:options="dzOptions"
|
||||
:props="{ expandTrigger: 'hover' }"
|
||||
@change="handleChange"
|
||||
clearable
|
||||
placeholder="请选择地址信息"
|
||||
style="width: 100%"
|
||||
v-model="formData.addressList"
|
||||
:options="dzOptions"
|
||||
:props="{ expandTrigger: 'hover' }"
|
||||
@change="handleChange"
|
||||
clearable
|
||||
placeholder="请选择地址信息"
|
||||
style="width: 100%"
|
||||
v-model="formData.addressList"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="详细地址" prop="addressDetail">
|
||||
<el-input
|
||||
maxlength="100"
|
||||
placeholder="请输入详细地址信息,如道路、门牌号、小区、楼栋号、单元等信息"
|
||||
rows="3"
|
||||
show-word-limit
|
||||
type="textarea"
|
||||
v-model="formData.addressDetail"
|
||||
maxlength="100"
|
||||
placeholder="请输入详细地址信息,如道路、门牌号、小区、楼栋号、单元等信息"
|
||||
rows="3"
|
||||
show-word-limit
|
||||
type="textarea"
|
||||
v-model="formData.addressDetail"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -383,20 +390,21 @@ layout("/layouts/platform.html"){
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="手机号码" prop="tel">
|
||||
<el-input maxlength="11" placeholder="请填写手机号码" clearable v-model="formData.tel"></el-input>
|
||||
<el-input maxlength="11" placeholder="请填写手机号码" clearable
|
||||
v-model="formData.tel"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="是否默认" prop="isDefault">
|
||||
<el-switch
|
||||
v-model="formData.isDefault"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
v-model="formData.isDefault"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -432,12 +440,12 @@ layout("/layouts/platform.html"){
|
||||
year: moment().format("YYYY")
|
||||
},
|
||||
tableColumns: [
|
||||
{ prop: "year", label: "年度" },
|
||||
{ prop: "name", label: "项目名称" },
|
||||
{ prop: "choiceTime", label: "选择时间" },
|
||||
{ prop: "isChoose", label: "是否选择" },
|
||||
{ prop: "gist_list", label: "所选福利" },
|
||||
{ prop: "receiveAddress", label: "收货地址" }
|
||||
{prop: "year", label: "年度"},
|
||||
{prop: "name", label: "项目名称"},
|
||||
{prop: "choiceTime", label: "选择时间"},
|
||||
{prop: "isChoose", label: "是否选择"},
|
||||
{prop: "gist_list", label: "所选福利"},
|
||||
{prop: "receiveAddress", label: "收货地址"}
|
||||
],
|
||||
isView: false,
|
||||
isChoice: false,
|
||||
@@ -445,12 +453,12 @@ layout("/layouts/platform.html"){
|
||||
addressDialogVisible: false,
|
||||
|
||||
formRules: {
|
||||
addressList: [{ required: true, message: "请选择地址信息", trigger: ["blur", "change"] }],
|
||||
addressDetail: [{ required: true, message: "请填写您的详细地址", trigger: ["blur", "change"] }],
|
||||
userName: [{ required: true, message: "请填写收货人姓名", trigger: ["blur", "change"] }],
|
||||
addressList: [{required: true, message: "请选择地址信息", trigger: ["blur", "change"]}],
|
||||
addressDetail: [{required: true, message: "请填写您的详细地址", trigger: ["blur", "change"]}],
|
||||
userName: [{required: true, message: "请填写收货人姓名", trigger: ["blur", "change"]}],
|
||||
tel: [
|
||||
{ required: true, message: "必填", trigger: ["blur", "change"] },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号" }
|
||||
{required: true, message: "必填", trigger: ["blur", "change"]},
|
||||
{pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号"}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -477,30 +485,30 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
confirmButtonInfo(row) {
|
||||
const { choiceTimeEnd, choiceTimeStart, overdueChoiceTimeEnd, isChoose, selectTime } = row
|
||||
const {choiceTimeEnd, choiceTimeStart, overdueChoiceTimeEnd, isChoose, selectTime} = row
|
||||
const now = moment().valueOf()
|
||||
if (overdueChoiceTimeEnd == null || overdueChoiceTimeEnd === "") {
|
||||
if (now > moment(choiceTimeStart).valueOf() && now < moment(choiceTimeEnd).valueOf()) {
|
||||
return { text: isChoose ? "修改" : "选择", disabled: false }
|
||||
return {text: isChoose ? "修改" : "选择", disabled: false}
|
||||
} else if (now > moment(choiceTimeEnd).valueOf()) {
|
||||
return { text: "选择已结束", disabled: true }
|
||||
return {text: "选择已结束", disabled: true}
|
||||
} else if (now < moment(choiceTimeStart).valueOf()) {
|
||||
return { text: "选择未开始", disabled: true }
|
||||
return {text: "选择未开始", disabled: true}
|
||||
}
|
||||
} else {
|
||||
//已选择了不能再动了
|
||||
if (isChoose) {
|
||||
if (moment(selectTime).valueOf() > moment(choiceTimeEnd).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()) {
|
||||
return { text: "修改", disabled: false }
|
||||
return {text: "修改", disabled: false}
|
||||
}
|
||||
return { text: "选择已结束", disabled: true }
|
||||
return {text: "选择已结束", disabled: true}
|
||||
} else {
|
||||
if (now > moment(choiceTimeStart).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()) {
|
||||
return { text: isChoose ? "修改" : "选择", disabled: false }
|
||||
return {text: isChoose ? "修改" : "选择", disabled: false}
|
||||
} else if (now > moment(overdueChoiceTimeEnd).valueOf()) {
|
||||
return { text: "选择已结束", disabled: true }
|
||||
return {text: "选择已结束", disabled: true}
|
||||
} else if (now < moment(choiceTimeStart).valueOf()) {
|
||||
return { text: "选择未开始", disabled: true }
|
||||
return {text: "选择未开始", disabled: true}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -560,7 +568,7 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
},
|
||||
handlePlusButtonClick(value, option, optionIndex) {
|
||||
const { isCheckBox, multiSelectNum, singleOptionSupportMultipleSelection } = this.projectInfo
|
||||
const {isCheckBox, multiSelectNum, singleOptionSupportMultipleSelection} = this.projectInfo
|
||||
if (isCheckBox === "checkBox") {
|
||||
//判断是否支持单个多选
|
||||
if (!singleOptionSupportMultipleSelection && value > 1) {
|
||||
@@ -580,7 +588,7 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
|
||||
async getProjectInfo(id) {
|
||||
const resp = await $.get("/platform/welfare/common/findOne", { projectId: id })
|
||||
const resp = await $.get("/platform/welfare/common/findOne", {projectId: id})
|
||||
if (resp.code === 0) {
|
||||
resp.data.multiSelectNum = resp.data.multiSelectNum ? resp.data.multiSelectNum : 1
|
||||
this.projectInfo = resp.data
|
||||
@@ -611,7 +619,7 @@ layout("/layouts/platform.html"){
|
||||
doChoose() {
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const { isCheckBox, multiSelectNum, singleOptionSupportMultipleSelection } = this.projectInfo
|
||||
const {isCheckBox, multiSelectNum, singleOptionSupportMultipleSelection} = this.projectInfo
|
||||
if (isCheckBox === "checkBox") {
|
||||
if (this.sumSelectNum < multiSelectNum) {
|
||||
//用户没有选择完
|
||||
@@ -627,10 +635,15 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
|
||||
// 判断门店是否选择
|
||||
console.log(this.projectInfo.welfareProjectSubjects[0])
|
||||
const chooseOptions = this.projectInfo.welfareProjectSubjects[0].options
|
||||
.filter((v) => v.selectNum > 0)
|
||||
.filter((v) => v.selectNum > 0 && v.shoppingId)
|
||||
.map((item) => {
|
||||
return { optionName: item.optionName, selectNum: item.selectNum, receiveAddress: item.receiveAddress }
|
||||
return {
|
||||
optionName: item.optionName,
|
||||
selectNum: item.selectNum,
|
||||
receiveAddress: item.receiveAddress
|
||||
}
|
||||
})
|
||||
let isReceiveAddress = true
|
||||
for (const item of chooseOptions) {
|
||||
@@ -670,7 +683,7 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
})
|
||||
console.log(formData)
|
||||
const { code, msg, data } = await $.post("/platform/welfare/userChoose/confirmSelect", {
|
||||
const {code, msg, data} = await $.post("/platform/welfare/userChoose/confirmSelect", {
|
||||
welfareUserSelections: JSON.stringify(formData),
|
||||
projectId: this.projectInfo.id
|
||||
})
|
||||
@@ -719,7 +732,7 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
//获取用户选择的数据
|
||||
async getUserSelection(projectId) {
|
||||
const resp = await $.get("/platform/welfare/mine/getUserSelection", { projectId: projectId })
|
||||
const resp = await $.get("/platform/welfare/mine/getUserSelection", {projectId: projectId})
|
||||
this.userSelection = resp.data
|
||||
this.echoUserSelection()
|
||||
},
|
||||
@@ -738,7 +751,7 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
},
|
||||
async getChoice() {
|
||||
const resp = await $.get("/mobile/welfare/mine/isChoice", { projectId: this.projectInfo.id })
|
||||
const resp = await $.get("/mobile/welfare/mine/isChoice", {projectId: this.projectInfo.id})
|
||||
this.isChoice = resp.data
|
||||
},
|
||||
async selectUserAddress() {
|
||||
@@ -759,9 +772,9 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
// 获取供应商
|
||||
async getShoppingType() {
|
||||
const { data } = await $.get("/platform/shoppingType/apply/getShoppingType")
|
||||
const {data} = await $.get("/platform/shoppingType/apply/getShoppingType")
|
||||
this.projectInfo.welfareProjectSubjects[0].options.forEach((item) => {
|
||||
item.receiveAddressList = data.find((v) => v.id === item.shoppingId).offlineStores
|
||||
item.receiveAddressList = data.find((v) => v.id === item.shoppingId)?.offlineStores
|
||||
})
|
||||
|
||||
console.log(this.projectInfo.welfareProjectSubjects[0])
|
||||
|
||||
Reference in New Issue
Block a user