This commit is contained in:
Paidax
2024-09-19 16:20:46 +08:00
parent ca104cd831
commit 8730a49c37
18 changed files with 591 additions and 126 deletions
@@ -1,5 +1,7 @@
package io.v.nutz.lxy.controller; package io.v.nutz.lxy.controller;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.wizzer.framework.base.service.BaseService; import cn.wizzer.framework.base.service.BaseService;
import io.v.nutz.annontation.ViReturn; import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.PageUtil; import io.v.nutz.base.utils.PageUtil;
@@ -11,21 +13,25 @@ import io.v.nutz.lxy.service.LxyMefpService;
import io.v.nutz.sys.models.Sys_file; import io.v.nutz.sys.models.Sys_file;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.boot.starter.ftp.FtpService; import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record; import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.nutz.lang.random.R; import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.*; import org.nutz.mvc.annotation.*;
import org.nutz.mvc.upload.TempFile; import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor; import org.nutz.mvc.upload.UploadAdaptor;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -91,19 +97,22 @@ public class LxyHdCon {
@At @At
@POST @POST
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("zgfw.lxy.hdmange") @RequiresPermissions("zgfw.lxy.hdmange")
public Object doAdd(Lxy_hd hd, @Param(value = "files",required = false) TempFile[] files, Lxy_mefp[] mefp) throws IOException { @AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Object doAdd(Lxy_hd hd, @Param(value = "files",required = false) TempFile[] files,@Param(value = "mefp") String jsonStr) throws IOException {
hd.setHdcjsj(new Date()); hd.setHdcjsj(new Date());
hd = lxyHdService.insert(hd); hd = lxyHdService.insert(hd);
for (Lxy_mefp lxyMefp : mefp) { lxyMefpService.setMefp(jsonStr, hd.getId());
lxyMefp.setHdid(hd.getId());
lxyMefp.setNumber(lxyMefp.getNumber() == null ? 0 : lxyMefp.getNumber()); // for (Lxy_mefp lxyMefp : mefp) {
lxyMefpService.insert(lxyMefp); // lxyMefp.setHdid(hd.getId());
} // lxyMefp.setNumber(lxyMefp.getNumber() == null ? 0 : lxyMefp.getNumber());
// lxyMefpService.insert(lxyMefp);
// }
for (TempFile file : files) { for (TempFile file : files) {
String rid = R.UU32(); String rid = R.UU32();
@@ -123,19 +132,23 @@ public class LxyHdCon {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("zgfw.lxy.hdmange") @RequiresPermissions("zgfw.lxy.hdmange")
public Object doEditMefp(Lxy_mefp[] mefp) { public Object doEditMefp(@Param("mefp") String jsonStr, String hdId) {
for (Lxy_mefp lxyMefp : mefp) { lxyMefpService.dao().clear(Lxy_mefp.class, Cnd.where("hdid","=",hdId));
baseService.dao().update("lxy_mefp", Chain.make("number", lxyMefp.getNumber()), Cnd.where("ghid", "=", lxyMefp.getGhid()).and("hdid", "=", lxyMefp.getHdid())); lxyMefpService.setMefp(jsonStr, hdId);
} // for (Lxy_mefp lxyMefp : mefp) {
// baseService.dao().update("lxy_mefp", Chain.make("number", lxyMefp.getNumber()), Cnd.where("ghid", "=", lxyMefp.getGhid()).and("hdid", "=", lxyMefp.getHdid()));
// }
return null; return null;
} }
@At @At
@POST @POST
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("zgfw.lxy.hdmange") @RequiresPermissions("zgfw.lxy.hdmange")
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Object doEdit(Lxy_hd hd, @Param(value = "files",required = false) TempFile[] files, String[] delFiles) throws IOException { public Object doEdit(Lxy_hd hd, @Param(value = "files",required = false) TempFile[] files, String[] delFiles) throws IOException {
lxyHdService.updateIgnoreNull(hd); lxyHdService.updateIgnoreNull(hd);
@@ -163,6 +176,7 @@ public class LxyHdCon {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("zgfw.lxy.hdmange") @RequiresPermissions("zgfw.lxy.hdmange")
public Object delete(String id) { public Object delete(String id) {
List<Record> files = baseService.dao().query("sys_file", Cnd.where("reid", "=", id)); List<Record> files = baseService.dao().query("sys_file", Cnd.where("reid", "=", id));
@@ -235,6 +235,7 @@ public class LxyXghshController {
} }
@At @At
@Ok("void")
@RequiresPermissions("zgfw.lxy.xghsh") @RequiresPermissions("zgfw.lxy.xghsh")
public void downLoadAll(@Param(value = "year", required = false) Integer year, public void downLoadAll(@Param(value = "year", required = false) Integer year,
@Param(value = "hdid", required = false) String hdid, @Param(value = "hdid", required = false) String hdid,
@@ -5,4 +5,6 @@ import io.v.nutz.lxy.model.Lxy_mefp;
public interface LxyMefpService extends BaseService<Lxy_mefp> { public interface LxyMefpService extends BaseService<Lxy_mefp> {
void setMefp(String jsonStr, String hdId);
} }
@@ -1,10 +1,16 @@
package io.v.nutz.lxy.service.impl; package io.v.nutz.lxy.service.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.wizzer.framework.base.service.BaseServiceImpl; import cn.wizzer.framework.base.service.BaseServiceImpl;
import io.v.nutz.lxy.model.Lxy_mefp; import io.v.nutz.lxy.model.Lxy_mefp;
import io.v.nutz.lxy.service.LxyMefpService; import io.v.nutz.lxy.service.LxyMefpService;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import java.util.ArrayList;
import java.util.List;
/** /**
* @Author: 1V * @Author: 1V
@@ -16,4 +22,21 @@ public class LxyMefpServiceImpl extends BaseServiceImpl<Lxy_mefp> implements Lxy
public LxyMefpServiceImpl(Dao dao) { public LxyMefpServiceImpl(Dao dao) {
super(dao); super(dao);
} }
@Override
public void setMefp(String jsonStr, String hdId) {
if (StrUtil.isNotBlank(jsonStr)) {
List<NutMap> list = JSONUtil.parseArray(jsonStr).toList(NutMap.class);
List<Lxy_mefp> mefpList = new ArrayList<>();
for (NutMap map : list) {
Lxy_mefp mefp = new Lxy_mefp();
mefp.setGhid(map.getString("id"));
mefp.setHdid(hdId);
mefp.setNumber(map.getInt("limitNum"));
mefpList.add(mefp);
}
dao().insert(mefpList);
}
}
} }
@@ -1,18 +1,26 @@
package io.v.nutz.wakershome.controller.review; package io.v.nutz.wakershome.controller.review;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.annontation.ViReturn; import io.v.nutz.annontation.ViReturn;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.wakershome.model.review.CommentNr; import io.v.nutz.wakershome.model.review.CommentNr;
import io.v.nutz.wakershome.model.review.CommentUnionGrading;
import io.v.nutz.wakershome.model.review.CommentZb; import io.v.nutz.wakershome.model.review.CommentZb;
import io.v.nutz.wakershome.service.review.CommentZbService; import io.v.nutz.wakershome.service.review.CommentZbService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.random.R;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import org.nutz.trans.Trans; import org.nutz.trans.Trans;
import java.util.ArrayList;
import java.util.List;
/** /**
* @ClassName addZbController * @ClassName addZbController
* @Description TODO * @Description TODO
@@ -44,6 +52,7 @@ public class AddZbController {
nr.getBzs().forEach(v->v.setZb_id(zb.getId())); nr.getBzs().forEach(v->v.setZb_id(zb.getId()));
commentZbService.insertWith(nr, "bzs"); commentZbService.insertWith(nr, "bzs");
} }
commentZbService.setGrading(zb);
}); });
return null; return null;
@@ -1,6 +1,7 @@
package io.v.nutz.wakershome.controller.review; package io.v.nutz.wakershome.controller.review;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure; import com.deepoove.poi.config.Configure;
@@ -11,10 +12,7 @@ import io.v.nutz.base.utils.Vi;
import io.v.nutz.modules.models.PageForm; import io.v.nutz.modules.models.PageForm;
import io.v.nutz.sys.models.Sys_file; import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.util.ShiroUtil; import io.v.nutz.util.ShiroUtil;
import io.v.nutz.wakershome.model.review.CommentBz; import io.v.nutz.wakershome.model.review.*;
import io.v.nutz.wakershome.model.review.CommentNr;
import io.v.nutz.wakershome.model.review.CommentPeo;
import io.v.nutz.wakershome.model.review.CommentZb;
import io.v.nutz.wakershome.service.review.CommentPeoService; import io.v.nutz.wakershome.service.review.CommentPeoService;
import io.v.nutz.wakershome.service.review.CommentStatisticsService; import io.v.nutz.wakershome.service.review.CommentStatisticsService;
import io.v.nutz.wakershome.service.review.CommentZbService; import io.v.nutz.wakershome.service.review.CommentZbService;
@@ -24,6 +22,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.ddr.poi.html.HtmlRenderPolicy; import org.ddr.poi.html.HtmlRenderPolicy;
import org.nutz.boot.starter.ftp.FtpService; import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
@@ -91,11 +90,14 @@ public class StatisticsZpController {
SELECT SELECT
un.id, un.id,
un.unionname unionName, un.unionname unionName,
IFNULL(grading.gradingName,'未定级') AS gradingName,
grading.isGrading,
count( peo.id ) num count( peo.id ) num
FROM FROM
sys_union un sys_union un
LEFT JOIN `user` u ON u.unionId = un.id LEFT JOIN `user` u ON u.unionId = un.id
LEFT JOIN comment_peo peo ON peo.userId = u.id AND peo.zbId = @zbId LEFT JOIN comment_peo peo ON peo.userId = u.id AND peo.zbId = @zbId
LEFT JOIN comment_union_grading grading on un.id = grading.unionId AND grading.zbId = @zbId
$condition $condition
""").setParam("zbId", zbId); """).setParam("zbId", zbId);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
@@ -413,4 +415,17 @@ public class StatisticsZpController {
// Map<String, List<CommentPeo>> collect = peoList.stream().collect(Collectors.groupingBy(CommentPeo::getUnionId)); // Map<String, List<CommentPeo>> collect = peoList.stream().collect(Collectors.groupingBy(CommentPeo::getUnionId));
} }
@At
@RequiresPermissions("wakeshome.review.statistics")
public Object doGrading(CommentUnionGrading grading){
if (StrUtil.isAllBlank(grading.getZbId(),grading.getUnionId(),grading.getGradingName())) {
return Result.error("必要参数为空");
}
commentPeoService.dao().update(CommentUnionGrading.class,
Chain.make("isGrading",true).add("gradingName",grading.getGradingName()).add("gradingTime", DateUtil.now()),
Cnd.where("zbId","=",grading.getZbId()).and("unionId","=",grading.getUnionId()));
return Result.success();
}
} }
@@ -151,6 +151,7 @@ public class ViewZbController {
}); });
} }
commentZbService.setGrading(commentZb);
/* for (CommentNr nr : commentZb.getNrs()) { /* for (CommentNr nr : commentZb.getNrs()) {
nr.setZb_id(commentZb.getId()); nr.setZb_id(commentZb.getId());
commentNrService.insertWith(nr, "bzs"); commentNrService.insertWith(nr, "bzs");
@@ -2,6 +2,7 @@ package io.v.nutz.wakershome.model.review;
import cn.wizzer.framework.base.model.BaseModel; import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.DB; import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
@@ -13,6 +14,7 @@ import org.nutz.dao.entity.annotation.*;
*/ */
@Data @Data
@Table @Table
@EqualsAndHashCode(callSuper = true)
public class CommentBz extends BaseModel { public class CommentBz extends BaseModel {
@Column @Column
@@ -2,6 +2,7 @@ package io.v.nutz.wakershome.model.review;
import cn.wizzer.framework.base.model.BaseModel; import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.DB; import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
@@ -15,6 +16,7 @@ import java.util.List;
*/ */
@Data @Data
@Table @Table
@EqualsAndHashCode(callSuper = true)
public class CommentNr extends BaseModel { public class CommentNr extends BaseModel {
@@ -0,0 +1,66 @@
package io.v.nutz.wakershome.model.review;
import io.v.nutz.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import java.util.Date;
/**
* @version 1.0
* @Author zzr
* @name:CommentUnionGrading
* @Date 2024/9/19 8:48
* @注释 校工会给分工会定级
*/
@Data
@Table
@Comment("校工会给分工会定级表")
@EqualsAndHashCode(callSuper = true)
public class CommentUnionGrading extends BaseModel {
@Column
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("考核指标id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String zbId;
@Column
@Comment("定级的分工会id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionId;
@Column
@Comment("分工会名称")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String unionName;
@Column
@Comment("分工会编码")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionCode;
@Column
@Comment("定级的名称")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String gradingName;
@Column
@Default("0")
@Comment("是否定级")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isGrading;
@Column
@Comment("定级时间")
@ColDefine(type = ColType.DATETIME)
private Date gradingTime;
}
@@ -1,9 +1,12 @@
package io.v.nutz.wakershome.service.impl.review; package io.v.nutz.wakershome.service.impl.review;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.service.impl.ViServiceImpl; import io.v.nutz.service.impl.ViServiceImpl;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.wakershome.model.review.CommentBz; import io.v.nutz.wakershome.model.review.CommentBz;
import io.v.nutz.wakershome.model.review.CommentNr; import io.v.nutz.wakershome.model.review.CommentNr;
import io.v.nutz.wakershome.model.review.CommentUnionGrading;
import io.v.nutz.wakershome.model.review.CommentZb; import io.v.nutz.wakershome.model.review.CommentZb;
import io.v.nutz.wakershome.service.review.CommentNrService; import io.v.nutz.wakershome.service.review.CommentNrService;
import io.v.nutz.wakershome.service.review.CommentZbService; import io.v.nutz.wakershome.service.review.CommentZbService;
@@ -11,7 +14,9 @@ import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.random.R;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@@ -44,4 +49,34 @@ public class CommentZbServiceImpl extends ViServiceImpl<CommentZb> implements Co
return zb; return zb;
} }
@Override
public void setGrading(CommentZb commentZb) {
int count = dao().count(CommentUnionGrading.class, Cnd.where("zbId", "=", commentZb.getId()));
if (count > 0) {
dao().clear(CommentUnionGrading.class, Cnd.where("zbId", "=", commentZb.getId()));
}
if (ObjectUtil.isNotNull(commentZb.getCommentTarget()) && commentZb.getCommentTarget() != 1) {
List<Sys_union> query = new ArrayList<>();
if (commentZb.getCommentTarget() == 2) {
query = dao().query(Sys_union.class, Cnd.NEW());
} else if (commentZb.getCommentTarget() == 3) {
query = dao().query(Sys_union.class, Cnd.where("id", "in", commentZb.getUnionIds()));
}
List<CommentUnionGrading> commentUnionGradings = new ArrayList<>();
for (Sys_union union : query) {
CommentUnionGrading unionGrading = new CommentUnionGrading();
unionGrading.setId(R.UU32());
unionGrading.setUnionId(union.getId());
unionGrading.setZbId(commentZb.getId());
unionGrading.setUnionName(union.getUnionname());
unionGrading.setUnionCode(union.getUnioncode());
unionGrading.setIsGrading(false);
unionGrading.setGradingTime(null);
commentUnionGradings.add(unionGrading);
}
dao().insert(commentUnionGradings);
}
}
} }
@@ -8,4 +8,5 @@ public interface CommentZbService extends ViService<CommentZb> {
CommentZb khzb(String zbid); CommentZb khzb(String zbid);
void setGrading(CommentZb zb);
} }
Binary file not shown.
@@ -3,7 +3,7 @@ layout("/mobile/platform.html"){
#--> #-->
<style> <style>
.van-doc-card { .van-doc-card {
margin: 14px; margin: 5px;
padding: 6px; padding: 6px;
background-color: #fff; background-color: #fff;
border-radius: 10px; border-radius: 10px;
@@ -78,7 +78,9 @@ layout("/mobile/platform.html"){
{{item.contentNumber}}、{{item.inspection}} {{item.contentNumber}}、{{item.inspection}}
</div> </div>
<van-row> <van-row>
<div style="font-size: 15px;text-align: right;margin-right: 30px;margin-bottom:-4px">标准分:{{item.score}}</div> <div style="font-size: 15px;text-align: right;margin-right: 30px;margin-bottom:-4px">
标准分:{{item.score}}
</div>
</van-row> </van-row>
<van-field <van-field
v-model="item.resultScore" v-model="item.resultScore"
@@ -98,7 +100,7 @@ layout("/mobile/platform.html"){
<van-field v-model="o.remark" <van-field v-model="o.remark"
name="备注" label="备注" name="备注" label="备注"
required rows="3" type="textarea" required rows="3" type="textarea"
autosize show-word-limit autosize show-word-limit
maxlength="300" maxlength="300"
placeholder="请填写备注" placeholder="请填写备注"
:readonly="isReadOnly" :readonly="isReadOnly"
@@ -107,7 +109,8 @@ layout("/mobile/platform.html"){
</van-collapse-item> </van-collapse-item>
</div> </div>
<div v-if="commentatorData.reviewMode == 1" class="content_div"> <div v-if="commentatorData.reviewMode == 1" class="content_div">
<van-field name="files" label="职工评家总结" required style="flex-flow: column" input-align="left"> <van-field name="files" label="职工评家总结" required style="flex-flow: column"
input-align="left">
<template #label> <template #label>
<div class="mb10">职工评家总结</div> <div class="mb10">职工评家总结</div>
</template> </template>
@@ -120,28 +123,35 @@ layout("/mobile/platform.html"){
<div v-if="commentatorData.scoringMode==2"> <div v-if="commentatorData.scoringMode==2">
<div class="search-fixed"> <div class="search-fixed" style="margin: 0px auto 60px auto" v-if="commentatorData.assessmentMode == 2">
<van-dropdown-menu active-color="#1989fa"> <van-dropdown-menu active-color="#1989fa">
<van-dropdown-item v-model="president" :options="presidentList" <van-dropdown-item v-model="president" :options="presidentList"
@change="presidentChange"></van-dropdown-item> @change="presidentChange"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<div v-for="o in commentatorData.nrs" style="margin: 60px auto 0 auto"> <div>
<div v-for="item in o.bzs"> <div v-for="o in commentatorData.nrs">
<div class="van-doc-card"> <van-collapse-item :title="o.content" :name="o.id" style="margin: 5px">
<div style="font-size: 15px;color: black">{{item.contentNumber}}、{{item.inspection}} <div v-for="item in o.bzs">
<div class="van-doc-card">
<div style="font-size: 15px;color: black">
{{item.contentNumber}}、{{item.inspection}}
</div>
<van-field name="radio" style="padding: 12px 2px;margin: 5px">
<template #input>
<van-radio-group v-model="item.resultScore" :disabled="isReadOnly"
direction="horizontal">
<van-radio name="非常满意">非常满意</van-radio>
<van-radio name="满意">满意</van-radio>
<van-radio name="良好">良好</van-radio>
<van-radio name="一般">一般</van-radio>
</van-radio-group>
</template>
</van-field>
</div>
</div> </div>
<van-field name="radio" label="满意度" style="padding: 12px 2px;margin: 5px"> </van-collapse-item>
<template #input>
<van-radio-group style="margin-left: -20px" v-model="item.resultScore" :disabled="isReadOnly" direction="horizontal">
<van-radio name="满意">满意</van-radio>
<van-radio name="基本满意">基本满意</van-radio>
<van-radio name="不满意">不满意</van-radio>
</van-radio-group>
</template>
</van-field>
</div>
</div> </div>
</div> </div>
<div class="van-doc-card"> <div class="van-doc-card">
@@ -163,8 +173,11 @@ layout("/mobile/platform.html"){
<div> <div>
<van-tabbar> <van-tabbar>
<van-button id="buttonAss" :disabled="isShowSubmit" round block type="info" @click="showAssess">查看测评结果</van-button> <van-button id="buttonAss" :disabled="isShowSubmit" round block type="info" @click="showAssess">
<van-button id="buttonSub" :disabled="isShowSubmit" round block type="info" @click="onSubmit">提交</van-button> 查看测评结果
</van-button>
<van-button id="buttonSub" :disabled="isShowSubmit" round block type="info" @click="onSubmit">提交
</van-button>
</van-tabbar> </van-tabbar>
</div> </div>
@@ -183,10 +196,10 @@ layout("/mobile/platform.html"){
bzList: [], bzList: [],
president: '', president: '',
presidentList: [], presidentList: [],
userList:[], userList: [],
isShowSubmit: false, isShowSubmit: false,
isReadOnly:false, isReadOnly: false,
formData:{ formData: {
id: '', id: '',
reviewResult: '', reviewResult: '',
presidentOpinions: '', presidentOpinions: '',
@@ -201,7 +214,7 @@ layout("/mobile/platform.html"){
assessmentFiles: [], assessmentFiles: [],
assessmentNrs: [], assessmentNrs: [],
assessmentReviewMode: '', assessmentReviewMode: '',
assessmentScoringMode:'', assessmentScoringMode: '',
} }
} }
}, },
@@ -226,7 +239,10 @@ layout("/mobile/platform.html"){
this.bzList = []; this.bzList = [];
this.commentatorData.nrs.forEach(v => { this.commentatorData.nrs.forEach(v => {
v.bzs.forEach(o => { v.bzs.forEach(o => {
if (self.commentatorData.assessmentMode === 1 && v.remark){ if (self.commentatorData.assessmentMode === 1 && v.remark) {
if (!o.resultScore) {
return
}
o.options = v.remark o.options = v.remark
} }
self.bzList.push(o) self.bzList.push(o)
@@ -241,8 +257,8 @@ layout("/mobile/platform.html"){
}) })
await this.assignment(); await this.assignment();
let evaluatedPersonName=null; let evaluatedPersonName = null;
let evaluatedPersonType=null; let evaluatedPersonType = null;
if (this.commentatorData.assessmentMode === 1) { if (this.commentatorData.assessmentMode === 1) {
let source = 0; // 标准分 let source = 0; // 标准分
@@ -272,7 +288,7 @@ layout("/mobile/platform.html"){
this.reviewResult = '不满意' this.reviewResult = '不满意'
} }
const user = this.userList.find(v=> v.id === this.president) const user = this.userList.find(v => v.id === this.president)
evaluatedPersonName = user.username evaluatedPersonName = user.username
evaluatedPersonType = user.evaluatedPersonType evaluatedPersonType = user.evaluatedPersonType
} }
@@ -291,9 +307,9 @@ layout("/mobile/platform.html"){
if (resp.code === 0) { if (resp.code === 0) {
await this.getCommentById(); await this.getCommentById();
vant.Toast.success('操作成功') vant.Toast.success('操作成功')
setTimeout(()=>{ setTimeout(() => {
window.location.href = '/mobile/wakeshome/review/appraisal/mine' window.location.href = '/mobile/wakeshome/review/appraisal/mine'
},500) }, 500)
} }
}) })
}, },
@@ -96,7 +96,7 @@ layout("/layouts/platform.html"){
<template v-if="!scope.row.isReview"> <template v-if="!scope.row.isReview">
<el-tooltip content="评议页面的提交按钮在右上角哦" placement="top"> <el-tooltip content="评议页面的提交按钮在右上角哦" placement="top">
<el-button size="mini" type="primary" @click="doReview(scope.row)"> <el-button size="mini" type="primary" @click="doReview(scope.row)">
去评议 自评
</el-button> </el-button>
</el-tooltip> </el-tooltip>
</template> </template>
@@ -123,7 +123,7 @@ layout("/layouts/platform.html"){
<el-form :model="formData" ref="form" label-width="100px" <el-form :model="formData" ref="form" label-width="100px"
style="height: calc(100vh - 50px);overflow-y: scroll;padding: 10px 15px"> style="height: calc(100vh - 50px);overflow-y: scroll;padding: 10px 15px">
<template v-if="formData.scoringMode==2"> <template v-if="formData.assessmentMode==2">
<vi-title title="评议对象选择"></vi-title> <vi-title title="评议对象选择"></vi-title>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@@ -189,9 +189,10 @@ layout("/layouts/platform.html"){
align="center" width="350px"> align="center" width="350px">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-radio-group v-model="row.resultScore" size="small"> <el-radio-group v-model="row.resultScore" size="small">
<el-radio label="非常满意">非常满意</el-radio>
<el-radio label="满意">满意</el-radio> <el-radio label="满意">满意</el-radio>
<el-radio label="基本满意">基本满意</el-radio> <el-radio label="良好">良好</el-radio>
<el-radio label="不满意">不满意</el-radio> <el-radio label="一般">一般</el-radio>
</el-radio-group> </el-radio-group>
</template> </template>
</el-table-column> </el-table-column>
@@ -76,11 +76,25 @@ layout("/layouts/platform.html"){
:sortable="column.sortable" :sortable="column.sortable"
:label="column.label" :label="column.label"
:prop="column.prop" :width="column.width" min-width="100px"> :prop="column.prop" :width="column.width" min-width="100px">
<template v-if="column.prop=='isGrading'" scope="{row}">
<el-tag v-if="row.isGrading" type="success">是</el-tag>
<el-tag v-else type="danger">否</el-tag>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作" <el-table-column prop="userOnline" align="center" header-align="center" label="操作"
width="240px" fixed="right"> width="380px" fixed="right">
<template scope="{row}"> <template scope="{row}">
<el-button size="mini" @click="openView(row)">查看</el-button> <el-button size="mini" @click="openView(row)">查看</el-button>
<el-button
v-if="!row.isGrading && row.num > 0 && ${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
size="mini" type="primary"
@click="openGrading(row)">定级
</el-button>
<el-button
v-if="row.isGrading && row.num > 0 && ${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
size="mini" type="primary"
@click="editGrading(row)">修改定级
</el-button>
<el-tooltip <el-tooltip
:content="canDownload ? ('导出【'+ row.unionName +'】管理员自我评议的评议结果') : ('导出【'+ row.unionName +'】下所有评议结果的压缩包') " :content="canDownload ? ('导出【'+ row.unionName +'】管理员自我评议的评议结果') : ('导出【'+ row.unionName +'】下所有评议结果的压缩包') "
placement="top"> placement="top">
@@ -185,6 +199,26 @@ layout("/layouts/platform.html"){
<el-dialog title="评议结果" :visible.sync="userDrawer" close-on-press-escape> <el-dialog title="评议结果" :visible.sync="userDrawer" close-on-press-escape>
<wakes-home-review ref="wakesHomeReview"></wakes-home-review> <wakes-home-review ref="wakesHomeReview"></wakes-home-review>
</el-dialog> </el-dialog>
<el-dialog :title="gradingTitle" :visible.sync="gradingDialog" width="40%" :close-on-press-escape="false">
<el-form :model="gradingData" ref="gradingForm" :rules="gradingRules" label-width="120px">
<el-form-item prop="zbName" label="评测名称">
<el-input readonly v-model="gradingData.zbName"></el-input>
</el-form-item>
<el-form-item prop="unionName" label="定级分工会">
<el-input readonly v-model="gradingData.unionName"></el-input>
</el-form-item>
<el-form-item prop="gradingName" label="定级结果">
<dict-select v-model="gradingData.gradingName" style="width: 100%" clearable
placeholder="请选择定级结果" code="GRADING_TYPE"></dict-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="gradingDialog = false">取 消</el-button>
<el-button type="primary" @click="doGrading">确 定</el-button>
</span>
</el-dialog>
</div> </div>
@@ -216,6 +250,8 @@ layout("/layouts/platform.html"){
tableColumns: [ tableColumns: [
{prop: 'unionName', label: '分工会名称'}, {prop: 'unionName', label: '分工会名称'},
{prop: 'num', label: '测评人数'}, {prop: 'num', label: '测评人数'},
{prop: 'isGrading', label: '是否定级'},
{prop: 'gradingName', label: '定级结果'},
], ],
tableData: [], tableData: [],
userTableData: [], userTableData: [],
@@ -235,13 +271,53 @@ layout("/layouts/platform.html"){
pageOrderName: "", pageOrderName: "",
pageOrderBy: "" pageOrderBy: ""
}, },
reviewResultData: {} reviewResultData: {},
gradingDialog: false,
gradingTitle: '',
gradingData: {
unionName: '',
unionId: '',
zbId: '',
zbName: '',
},
gradingRules: {
gradingName: [ {required: true, message: '请选择定级结果', trigger: 'blur'} ]
}
} }
}, },
components: { components: {
'wakes-home-review': httpVueLoader('/components/wakeshome/review/ReviewResult.vue?v=' + moment(new Date()).unix()), 'wakes-home-review': httpVueLoader('/components/wakeshome/review/ReviewResult.vue?v=' + moment(new Date()).unix()),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=' + moment(new Date()).unix()),
}, },
methods: { methods: {
editGrading(row) {
this.gradingData = {...row}
this.$set(this.gradingData, 'zbId', this.pageForm.zbId)
this.$set(this.gradingData, 'zbName', this.zbList.find(v => v.id === this.pageForm.zbId).assessment)
this.gradingDialog = true
},
doGrading() {
this.$refs['gradingForm'].validate(async (valid) => {
if (valid) {
const resp = await $.post(loc() + '/doGrading', this.gradingData)
if (resp.code === 0) {
this.gradingDialog = false
this.pageData()
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
}
})
},
openGrading(row) {
this.$set(this.gradingData, 'unionId', row.id)
this.$set(this.gradingData, 'unionName', row.unionName)
this.$set(this.gradingData, 'zbId', this.pageForm.zbId)
this.$set(this.gradingData, 'zbName', this.zbList.find(v => v.id === this.pageForm.zbId).assessment)
this.gradingDialog = true
},
doDownLoad(row, flag) { doDownLoad(row, flag) {
if (flag) { if (flag) {
// 为true,自我评议 // 为true,自我评议
@@ -271,9 +271,86 @@ layout("/layouts/platform.html"){
</div> </div>
</transition> </transition>
<transition name="el-zoom-in-bottom"> <transition name="el-zoom-in-bottom">
<div class="transition-box" style="margin-top: 20px;" <div class="transition-box" style="margin-top: 20px;" v-show="stepActive==1">
v-show="stepActive==1"> <vi-title2 title="分段设置">
<div class="pull-right offscreen-right mt5"> <template #func>
<el-button size="small" type="primary" @click="unionLimitQuickSetting">
应用分段设置
</el-button>
</template>
</vi-title2>
<el-row v-for="(item,index) in unionUserNumCalc" :gutter="20" class="mb5">
<el-col :span="7">
<el-input-number v-model="item.startNum" :precision="0" :step="1" :min="1"
placeholder="请输入最小人数"
style="width: 100%"></el-input-number>
</el-col>
<el-col :span="7">
<el-input-number v-model="item.endNum" :precision="0" :step="1" :min="1"
placeholder="请输入最大人数"
style="width: 100%"></el-input-number>
</el-col>
<el-col :span="6">
<el-input-number v-model="item.resultNum" :precision="0" :step="1" :min="1"
placeholder="请输入限制人数"
style="width: 100%"></el-input-number>
</el-col>
<el-col :span="4" class="text-right">
<el-button icon="el-icon-plus"
@click="unionUserNumCalc.push({})"></el-button>
<el-button icon="el-icon-minus" @click="unionUserNumCalc.splice(index,1)"
:disabled="unionUserNumCalc.length===1"></el-button>
</el-col>
</el-row>
<el-row class="mt10">
<div v-for="(item,index) in unionUserNumCalcTips" class="text-danger">
<span class="mr10">({{index+1}}).</span> {{item}}
</div>
</el-row>
<vi-title2 title="比例设置" class="mt20">
<template #func>
一键比例:
<el-input-number v-model="unionUserNumOneKeyRatio" :precision="0" :step="1"
:min="0"
placeholder="请输入一键比例"
size="small"
:max="100"></el-input-number>
<el-button size="small" type="primary" @click="applyScaleSettings"
class="ml5">应用比例设置
</el-button>
</template>
</vi-title2>
<el-table :data="unionUserNumberLimit" max-height="500px">
<el-table-column prop="unionname" label="分工会"></el-table-column>
<el-table-column prop="teacherCount" label="人数"></el-table-column>
<el-table-column prop="ratio" label="比例(%)">
<template scope="{row}">
<el-input-number v-model="row.ratio" :precision="0" :step="1" :min="0"
:max="100"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="limitNum" label="限制人数">
<template scope="{row}">
<el-input-number v-model="row.limitNum" :precision="0" :step="1"
:min="0"
:max="row.teacherCount"
@change="calSummaryCount"></el-input-number>
</template>
</el-table-column>
</el-table>
<el-row class="mt20" justify="end" type="flex">
<div class="text-danger"
style="width: 100%;font-size: 18px;display: flex;align-items: center;font-weight: bold">
限制总人数:{{summaryCount}}人
</div>
<el-button @click="clearUnionLimit" type="danger">清空分工会人数限制</el-button>
<!--<el-button @click="setUpUnionLimitDialog=false">取消</el-button>-->
<!--<el-button @click="doConfirmSetUpUnionLimit" type="primary">确定</el-button>-->
</el-row>
<!--<div class="pull-right offscreen-right mt5">
<span style="color:#409EFF">沿用之前活动名额&nbsp;&nbsp;</span> <span style="color:#409EFF">沿用之前活动名额&nbsp;&nbsp;</span>
<el-select @change="mefpChange" class="d-select" clearable <el-select @change="mefpChange" class="d-select" clearable
filterable filterable
@@ -313,7 +390,7 @@ layout("/layouts/platform.html"){
v-model="scope.row.number"></el-input-number> v-model="scope.row.number"></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>-->
<div style="float: right;margin: 20px 0"> <div style="float: right;margin: 20px 0">
<el-button @click="stepActive=0">上一步</el-button> <el-button @click="stepActive=0">上一步</el-button>
@@ -416,59 +493,93 @@ layout("/layouts/platform.html"){
</el-form> </el-form>
<div style="float: right;margin: 20px 0"> <div style="float: right;margin: 20px 0">
<el-button :disabled="subDis" @click="doEdit()" <el-button :disabled="subDis" @click="doEdit()"
type="primary">修 改 type="primary">修改基础数据
</el-button> </el-button>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="名额分配" name="2"> <el-tab-pane label="名额分配" name="2">
<el-form label-width="120px"> <vi-title2 title="分段设置">
<vi-title title="修改名额分配"></vi-title> <template #func>
<div class="pull-right offscreen-right mt5"> <el-button size="small" type="primary" @click="unionLimitQuickSetting">
<span style="color:#409EFF">沿用之前活动名额&nbsp;&nbsp;</span> 应用分段设置
<el-select @change="mefpChange" class="d-select" </el-button>
clearable filterable </template>
placeholder="请选择活动" </vi-title2>
v-model="pastQuota" width="300px"> <el-row v-for="(item,index) in unionUserNumCalc" :gutter="20" class="mb5">
<el-option <el-col :span="7">
:key="item.id" <el-input-number v-model="item.startNum" :precision="0" :step="1" :min="1"
:label="item.name" placeholder="请输入最小人数"
:value="item.id" style="width: 100%"></el-input-number>
v-for="item in lxyHd"> </el-col>
</el-option> <el-col :span="7">
</el-select> <el-input-number v-model="item.endNum" :precision="0" :step="1" :min="1"
placeholder="请输入最大人数"
style="width: 100%"></el-input-number>
</el-col>
<el-col :span="6">
<el-input-number v-model="item.resultNum" :precision="0" :step="1" :min="1"
placeholder="请输入限制人数"
style="width: 100%"></el-input-number>
</el-col>
<el-col :span="4" class="text-right">
<el-button icon="el-icon-plus"
@click="unionUserNumCalc.push({})"></el-button>
<el-button icon="el-icon-minus" @click="unionUserNumCalc.splice(index,1)"
:disabled="unionUserNumCalc.length===1"></el-button>
</el-col>
</el-row>
<el-row class="mt10">
<div v-for="(item,index) in unionUserNumCalcTips" class="text-danger">
<span class="mr10">({{index+1}}).</span> {{item}}
</div> </div>
</el-form> </el-row>
<el-table :data="unions_" height="70vh" size="medium">
<el-table-column align="center" header-align="center"
label="序号"
type="index"></el-table-column>
<el-table-column label="分工会" prop="unionname" sortable> <vi-title2 title="比例设置" class="mt20">
<template #func>
一键比例:
<el-input-number v-model="unionUserNumOneKeyRatio" :precision="0" :step="1"
:min="0"
placeholder="请输入一键比例"
size="small"
:max="100"></el-input-number>
<el-button size="small" type="primary" @click="applyScaleSettings"
class="ml5">应用比例设置
</el-button>
</template>
</vi-title2>
<el-table :data="unionUserNumberLimit" max-height="500px">
<el-table-column prop="unionname" label="分工会"></el-table-column>
<el-table-column prop="teacherCount" label="人数"></el-table-column>
<el-table-column prop="ratio" label="比例(%)">
<template scope="{row}"> <template scope="{row}">
{{isDisPlayCode?'('+row.unioncode+')':null}}{{row.unionname}} <el-input-number v-model="row.ratio" :precision="0" :step="1" :min="0"
:max="100"></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="limitNum" label="限制人数">
<el-table-column label="会员人数" prop="membercount" <template scope="{row}">
sortable></el-table-column> <el-input-number v-model="row.limitNum" :precision="0" :step="1"
<el-table-column align="center" header-align="center"
label="名额" prop="number"
width="200px">
<template scope="scope">
<el-input-number :max="1000"
:min="0" :min="0"
controls-position="right" :max="row.teacherCount"
placeholder="请填写名额数" @change="calSummaryCount"></el-input-number>
v-model="scope.row.number"></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-row class="mt20" justify="end" type="flex">
<div class="text-danger"
style="width: 100%;font-size: 18px;display: flex;align-items: center;font-weight: bold">
限制总人数:{{summaryCount}}人
</div>
<el-button @click="clearUnionLimit" type="danger">清空分工会人数限制</el-button>
<!--<el-button @click="setUpUnionLimitDialog=false">取消</el-button>-->
<!--<el-button @click="doConfirmSetUpUnionLimit" type="primary">确定</el-button>-->
</el-row>
<div style="float: right;margin: 20px 0"> <div style="float: right;margin: 20px 0">
<el-button :disabled="subDis" @click="doEditMefp" <el-button :disabled="subDis" @click="doEditMefp"
type="primary">提 交 type="primary">修改名额分配
</el-button> </el-button>
</div> </div>
</el-tab-pane> </el-tab-pane>
@@ -501,6 +612,10 @@ layout("/layouts/platform.html"){
} }
}; };
return { return {
summaryCount: 0,
unionUserNumCalc: [{}],
unionUserNumOneKeyRatio: null,
unionUserNumberLimit: [],
pastQuota: "", pastQuota: "",
tabs_active: '1', tabs_active: '1',
unions: [], unions: [],
@@ -541,7 +656,7 @@ layout("/layouts/platform.html"){
} }
}, },
methods: { methods: {
mefpChange() { /*mefpChange() {
if (this.pastQuota === '') { if (this.pastQuota === '') {
this.unions_ = this.unions.map(v => { this.unions_ = this.unions.map(v => {
const o = { const o = {
@@ -558,7 +673,7 @@ layout("/layouts/platform.html"){
$.post(base + "/platform/zgfw/lxy/hd/getPastQuota", {pastQuota: this.pastQuota}, res => { $.post(base + "/platform/zgfw/lxy/hd/getPastQuota", {pastQuota: this.pastQuota}, res => {
this.unions_ = res.data this.unions_ = res.data
}) })
}, },*/
doEditMefp() { doEditMefp() {
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
@@ -567,7 +682,10 @@ layout("/layouts/platform.html"){
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
$.post(base + "/platform/zgfw/lxy/hd/doEditMefp", {mefp: JSON.stringify(this.unions_)}, (data) => { $.post(base + "/platform/zgfw/lxy/hd/doEditMefp", {
mefp: JSON.stringify(this.unionUserNumberLimit),
hdId: this.id
}, (data) => {
loading.close() loading.close()
if (data.code == 0) { if (data.code == 0) {
this.v = 'index' this.v = 'index'
@@ -703,7 +821,8 @@ layout("/layouts/platform.html"){
} }
}); });
}, },
openEdit(id) { async openEdit(id) {
this.id = id
this.pastQuota = "" this.pastQuota = ""
this.fileList = [] this.fileList = []
this.delFiles = [] this.delFiles = []
@@ -754,6 +873,20 @@ layout("/layouts/platform.html"){
this.loading = false this.loading = false
}, "json"); }, "json");
this.unionUserNumberLimit = []
this.unionUserNumOneKeyRatio = null
this.unionUserNumCalc = [{}]
// this.summaryCount = 0
await this.getLimitUnionData()
this.unionUserNumberLimit.forEach(v=>{
v.limitNum = this.unions_.find(item=>item.ghid===v.id).number
})
this.summaryCount = this.unionUserNumberLimit.reduce((accumulator, currentObject) => {
return accumulator + currentObject.limitNum;
}, 0);
}, },
doDelete(id) { doDelete(id) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
@@ -798,7 +931,7 @@ layout("/layouts/platform.html"){
formdata.append("files", val.raw, val.raw.name); formdata.append("files", val.raw, val.raw.name);
}); });
//const unions_ = this.unions_.filter(v => v.number) //const unions_ = this.unions_.filter(v => v.number)
formdata.append('mefp', JSON.stringify(this.unions_)) formdata.append('mefp', JSON.stringify(this.unionUserNumberLimit))
this.subDis = true this.subDis = true
const loading = this.$loading({ const loading = this.$loading({
@@ -872,6 +1005,11 @@ layout("/layouts/platform.html"){
if (this.$refs['form']) { if (this.$refs['form']) {
this.$refs['form'].resetFields() this.$refs['form'].resetFields()
} }
this.unionUserNumberLimit = []
this.unionUserNumOneKeyRatio = null
this.unionUserNumCalc = [{}]
this.summaryCount = 0
this.getLimitUnionData()
}, },
doSearch() { doSearch() {
this.tabKey = new Date().getTime() this.tabKey = new Date().getTime()
@@ -908,6 +1046,70 @@ layout("/layouts/platform.html"){
} }
}, "json"); }, "json");
}, },
applyScaleSettings() {
this.unionUserNumberLimit.forEach(v => {
v.limitNum = parseFloat((v.teacherCount * this.unionUserNumOneKeyRatio / 100).toFixed(0))
if (v.ratio) {
v.limitNum = parseFloat((v.teacherCount * v.ratio / 100).toFixed(0))
}
})
this.calSummaryCount()
},
calSummaryCount() {
const array = this.unionUserNumberLimit
if (array) {
this.summaryCount = array.reduce((prev, curr) => {
const value = Number(curr.limitNum);
if (!isNaN(value)) {
return prev + curr.limitNum;
} else {
return prev;
}
}, 0)
}
},
unionLimitQuickSetting() {
this.unionUserNumCalc.forEach((v, i) => {
const startNum = v.startNum
const endNum = v.endNum
const resultNum = v.resultNum
if (startNum > endNum) {
this.$message.warning('第' + (i + 1) + '行设置错误')
} else {
this.unionUserNumberLimit.forEach(x => {
if (x.teacherCount >= startNum && x.teacherCount <= endNum) {
x.limitNum = resultNum
}
})
this.calSummaryCount()
}
})
},
async clearUnionLimit(){
const confirm = await this.$confirm('确定要清空分工会人数限制吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' === confirm) {
this.unionUserNumberLimit = []
this.unionUserNumOneKeyRatio = null
this.unionUserNumCalc = [{}]
this.summaryCount = 0
await this.getLimitUnionData()
}
},
async getLimitUnionData() {
const resp = await $.get('/platform/trainSingUp/manage/activity/getUnionLimit')
this.unionUserNumberLimit = resp.data
}
},
computed: {
unionUserNumCalcTips() {
return this.unionUserNumCalc.map(v => {
return (v.startNum ? v.startNum : '?') + '-' + (v.endNum ? v.endNum : '?') + '人的分工会,限报' + (v.resultNum ? v.resultNum : '?') + '人'
})
},
}, },
async created() { async created() {
const unions_resp = await $.get(loc() + '/getUnions') const unions_resp = await $.get(loc() + '/getUnions')
@@ -470,45 +470,44 @@ display: -webkit-box;
async yjTg() { async yjTg() {
if (this.multipleSelectionGh.length == 0) { if (this.multipleSelectionGh.length == 0) {
this.$message({ this.$message({
message: '请选择工会!', message: '请勾选审核列表的分工会!',
type: 'warning' type: 'warning'
}); });
return return
} }
const confirm = await this.$confirm('确定要给报名人员发送消息吗', '提示', { const confirm = await this.$confirm('确定要一键审核勾选的分工会吗', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) })
if (confirm === "confirm") { if (confirm === "confirm") {
const loading = this.$loading({
} lock: true,
const loading = this.$loading({ text: '数据提交中...',
lock: true, spinner: 'el-icon-loading',
text: '数据提交中...', background: 'rgba(0, 0, 0, 0.7)'
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
let arr = []
this.multipleSelectionGh.map(v => {
arr.push({ghid: v.ghid, hdid: v.hdid})
})
const data = await $.post(base + "/platform/zgfw/lxy/xghsh/yjSh", {maps: JSON.stringify(arr)})
if (data.code == 0) {
this.$message({
message: '提交成功',
type: 'success'
});
this.toggleSelectionGh()
this.openShGh({id: this.pageForm.hdid});
} else {
this.$message({
message: data.msg,
type: 'error'
}); });
let arr = []
this.multipleSelectionGh.map(v => {
arr.push({ghid: v.ghid, hdid: v.hdid})
})
const data = await $.post(base + "/platform/zgfw/lxy/xghsh/yjSh", {maps: JSON.stringify(arr)})
if (data.code === 0) {
this.$message({
message: '提交成功',
type: 'success'
});
this.toggleSelectionGh()
this.openShGh({id: this.pageForm.hdid});
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
loading.close()
} }
loading.close()
}, },
sh(zt) { sh(zt) {
if (this.multipleSelection.length == 0) { if (this.multipleSelection.length == 0) {