量化考核

This commit is contained in:
=
2025-11-27 14:19:00 +08:00
parent 89cf3445fe
commit c57957ac3a
33 changed files with 4930 additions and 0 deletions
@@ -0,0 +1,207 @@
package com.budwk.app.zhgh.dayofficework.ghkh.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_record;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zb;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zp;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhzpService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/27/20:19
* @Description:自评
*/
@At("/platform/ghkh/zp")
@Ok("json:full")
@IocBean
public class GhKhZpController {
@At("")
@Ok("beetl:/platform/zhgh/dayofficework/ghkh/zp.html")
@SaCheckPermission("ghkh.zp")
public void index() {
}
@Inject
private KhzpService khzpService;
@Inject
private GhkhGhzbController ghkhGhzbController;
@At
@SaCheckPermission("ghkh.zp")
public Result pageData(@Param(value = "annual") String annual,
@Param(value = "assessment") String assessment, int pageNumber, int pageSize) {
Sql sql = Sqls.create("SELECT * from kh_zb zb left join kh_record re on zb.id = re.zb_id and re.union_id = @unionid $condition").setParam("unionid", SecurityUtil.getUnionId());
Cnd cnd = Cnd.NEW();
// if (ShiroUtil.hasRole("H04")) {
// cnd.and("zp.flatid", "=", sys_user.getUnion().getId());
// }
cnd.and("zb.disabled", "=", true);
if (Strings.isNotBlank(annual) && Strings.isNotBlank(annual)) {
cnd.and("zb.annual", "=", annual);
}
cnd.and("zb.assessment", "!=", "模板V1.0(分工会工作量化考核评分请勿修改)");
if (Strings.isNotBlank(assessment) && Strings.isNotBlank(assessment)) {
cnd.where().andLike("zb.assessment", assessment);
} else {
cnd.desc("annual");
}
cnd.groupBy("zb.id");
sql.setCondition(cnd);
return Result.success(khzpService.listPage(pageNumber, pageSize, sql));
}
@Inject
private BaseService baseService;
@At
@POST
@SaCheckPermission("ghkh.zp")
public Result doHandler(@Param(value = "zp") Kh_zp[] zp, @Param(value = "handletype") String handletype) {
if (zp.length == 0) {
return null;
}
int score = 0;
for (Kh_zp kh_zp : zp) {
kh_zp.setFlatid(SecurityUtil.getUnionId());
khzpService.dao().insertOrUpdate(kh_zp);
score += kh_zp.getZpf() != null ? kh_zp.getZpf() : 0;
}
//查询自评记录
Kh_record record = baseService.dao().fetch(Kh_record.class, Cnd.where("zb_id", "=", zp[0].getZb_id()).and("union_id", "=", SecurityUtil.getUnionId()));
if (null == record) {
record = new Kh_record();
record.setZb_id(zp[0].getZb_id());
record.setUnion_id(SecurityUtil.getUnionId());
record.setZp_score(score);
record.setXgh_score(0);
record.setState(handletype.equals("submit") ? 2 : 1);
} else {
record.setZp_score(score);
if (handletype.equals("submit")) {
record.setState(2);
}
}
baseService.dao().insertOrUpdate(record);
return Result.success();
}
@Inject
private KhZbService khZbService;
@At
public Result openView(String id) {
Kh_zb khzb = khZbService.khzb(id);
List<Kh_zp> list = khzpService.query(Cnd.where("zb_id", "=", id).and("flatid", "=", SecurityUtil.getUnionId()));
khzb.getNrs().forEach(nr -> {
nr.getBzs().forEach(bz -> {
Kh_zp zp = list.stream().filter(v -> v.getBz_id().equals(bz.getId())).findFirst().orElse(null);
if (zp != null) {
bz.setZp(zp);
}
});
});
return Result.success(khzb);
}
@At
@SaCheckPermission("ghkh.zp")
public Result doEdit(@Param(value = "zb") Kh_zb zb) {
Kh_record record = baseService.dao().fetch(Kh_record.class, Cnd.where("zb_id", "=", zb.getId()).and("union_id", "=", SecurityUtil.getUnionId()));
if (record == null) {
throw new RuntimeException("缺少record信息");
}
AtomicInteger score = new AtomicInteger();
zb.getNrs().forEach(nr -> {
nr.getBzs().forEach(bz -> {
khzpService.update(bz.getZp());
score.addAndGet(bz.getZp().getZpf() != null ? bz.getZp().getZpf() : 0);
});
});
record.setZp_score(score.get());
baseService.dao().update(record);
return Result.success();
}
/**
* 提交到校工会
*
* @param zb
* @return
*/
@At
@SaCheckPermission("ghkh.zp")
public Result subXgh(@Param(value = "zb") Kh_zb zb) {
Kh_record record = baseService.dao().fetch(Kh_record.class, Cnd.where("zb_id", "=", zb.getId()).and("union_id", "=", SecurityUtil.getUnionId()));
AtomicInteger score = new AtomicInteger();
zb.getNrs().forEach(nr -> {
nr.getBzs().forEach(bz -> {
Kh_zp zp = bz.getZp();
zp.setFlatid(SecurityUtil.getUnionId());
khzpService.insertOrUpdate(zp);
score.addAndGet(zp.getZpf() != null ? zp.getZpf() : 0);
});
});
if (record == null) {
record = new Kh_record();
record.setZb_id(zb.getId());
record.setUnion_id(SecurityUtil.getUnionId());
record.setZp_score(score.get());
record.setXgh_score(0);
record.setState(2);
baseService.dao().insert(record);
return Result.success();
}
record.setState(2);
record.setZp_score(score.get());
baseService.dao().update(record);
return Result.success();
}
}
@@ -0,0 +1,145 @@
package com.budwk.app.zhgh.dayofficework.ghkh.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.result.Result;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zb;
import com.budwk.app.zhgh.dayofficework.ghkh.model.kh_nr;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhBzService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhNrService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
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.IocBean;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;
import java.util.List;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/8:48
* @Description:考核指标
*/
@At("/platform/ghkh/khzb")
@IocBean
@Ok("json:full")
public class GhkhGhzbController {
@Inject
private KhZbService khZbService;
@Inject
private KhNrService khNrService;
@Inject
private KhBzService khBzService;
@At("")
@Ok("beetl:/platform/zhgh/dayofficework/ghkh/khzb.html")
@SaCheckPermission("ghkh.khzb")
public void index() {
}
@At
@SaCheckPermission("ghkh.khzb")
public Result pageData(@Param(value = "annual") String annual,
@Param(value = "assessment") String assessment,
int pageNumber, int pageSize) {
Sql sql = Sqls.create("SELECT * FROM `kh_zb` $condition");
Cnd cnd = Cnd.NEW();
if (Strings.isNotBlank(annual) && Strings.isNotBlank(annual)) {
cnd.and("annual", "=", annual);
}
if (Strings.isNotBlank(assessment) && Strings.isNotBlank(assessment)) {
cnd.where().andLike("assessment", assessment);
} else {
cnd.desc("annual");
}
sql.setCondition(cnd);
return Result.success(khZbService.listPage(pageNumber, pageSize, sql));
}
@At
public Result getZb(String id) {
return Result.success(khZbService.khzb(id)) ;
}
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("ghkh.khzb")
public Result delete(String id) {
khZbService.delete(id);
List<kh_nr> query = khNrService.query(Cnd.where("zb_id", "=", id));
for (kh_nr kh_nr : query) {
khBzService.clear(Cnd.where("nr_id", "=", kh_nr.getId()));
}
khNrService.clear(Cnd.where("zb_id", "=", id));
return Result.success();
}
@At
public Result edit(String id) {
return getZb(id);
}
@At
@POST
@SaCheckPermission("ghkh.khzb")
@Aop(TransAop.READ_COMMITTED)
public Result doEdit(@Param(value = "kh_zb") Kh_zb kh_zb) {
khZbService.updateIgnoreNull(kh_zb);
List<kh_nr> query = khNrService.query(Cnd.where("zb_id", "=", kh_zb.getId()));
for (kh_nr kh_nr : query) {
System.err.println(kh_nr.getZb_id());
khBzService.clear(Cnd.where("nr_id", "=", kh_nr.getId()));
}
khNrService.clear(Cnd.where("zb_id", "=", kh_zb.getId()));
for (kh_nr nr : kh_zb.getNrs()) {
nr.setZb_id(kh_zb.getId());
khNrService.insertWith(nr, "bzs");
}
return Result.success();
}
@At
@POST
@SaCheckPermission("ghkh.khzb")
public Result toggleEnable(@Param("id") String id, @Param("enable") boolean enable) {
if (Strings.isBlank(id)) {
return Result.error("参数错误");
}
Kh_zb khZb = khZbService.fetch(id);
if (khZb == null) {
return Result.error("未找到对应的考核指标");
}
khZb.setDisabled(enable);
khZbService.updateIgnoreNull(khZb);
return Result.success("操作成功");
}
}
@@ -0,0 +1,68 @@
package com.budwk.app.zhgh.dayofficework.ghkh.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.result.Result;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhXghshService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/10/09/14:27
* @Description:考核排行
*/
@At("/platform/ghkh/khph")
@Ok("json:full")
@IocBean
public class GhkhKhphController {
@Inject
private KhXghshService khXghshService;
@Inject
private KhZbService khZbService;
@At("")
@Ok("beetl:/platform/zhgh/dayofficework/ghkh/khph.html")
@SaCheckPermission("ghkh.khph")
public void index() {}
@At
@SaCheckPermission("ghkh.khph")
public Result pageData(int pageNumber, int pageSize,
@Param(value = "khid") String khid,
@Param(value = "annual")Integer annual) {
Sql sql = Sqls.create("""
SELECT zb.annual,zb.assessment,un.unionname,re.* FROM `kh_record` re
LEFT JOIN `vw_user` un ON re.union_id = un.unionId
LEFT JOIN kh_zb zb ON zb.id = re.zb_id
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("re.zb_id ", "=", khid);
cnd.and("re.state", "=", 3);
cnd.andEX("zb.`annual`","=",annual);
cnd.desc("re.xgh_score");
cnd.groupBy("re.union_id");
sql.setCondition(cnd);
return Result.success(khXghshService.listPage(pageNumber, pageSize, sql));
}
@At
public Result getKh(String annual) {
Sql sql = Sqls.create("SELECT id,assessment FROM `kh_zb` WHERE annual= @annual ORDER BY addtime DESC").setParam("annual", annual);
return Result.success(khZbService.list(sql));
}
}
@@ -0,0 +1,143 @@
package com.budwk.app.zhgh.dayofficework.ghkh.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.result.Result;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_record;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_xghsh;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zb;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zp;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhXghshService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhzpService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.ArrayList;
import java.util.List;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/10/09/11:28
* @Description:
*/
@At("/platform/ghkh/lssjcx")
@Ok("json:full")
@IocBean
public class GhkhLssjcxController {
@Inject
private KhzpService khzpService;
@Inject
private KhXghshService khXghshService;
@At("")
@Ok("beetl:/platform/zhgh/dayofficework/ghkh/lssjcx.html")
@SaCheckPermission("ghkh.lssjcx")
public void index() {
}
@At
@SaCheckPermission("ghkh.lssjcx")
public Result pageData(@Param(value = "annual") String annual,
@Param(value = "unitId")String unitId,
@Param(value = "unionId")String unionId, int pageNumber, int pageSize) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
re.*,
zb.assessment,
zb.annual,
un.unionname,
un.unioncode,
(
SELECT
sum( score )
FROM
kh_bz
WHERE
nr_id IN ( SELECT id FROM kh_nr WHERE zb_id = zb.id )) bzf
FROM
kh_record re
LEFT JOIN kh_zb zb ON re.zb_id = zb.id
LEFT JOIN `vw_user` un ON re.union_id = un.unionId
$condition
""");
cnd.and("re.state", "=", 3);
if (AuthUtil.hasRole(RoleConstant.SYSADMIN.name())&& AuthUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) {
cnd.and("info.unionId", "=", SecurityUtil.getUnionId());
}
cnd.andEX("re.union_id", "=", unionId);
cnd.andEX( "zb.annual", "=", annual);
sql.setCondition(cnd);
return Result.success(khzpService.listPage(pageNumber, pageSize, sql));
}
@Inject
private KhZbService khZbService;
@At
@SaCheckPermission("ghkh.lssjcx")
public Result getData(String zb_id, String union_id) {
Kh_zb khzb = khZbService.khzb(zb_id);
List<Kh_zp> list = khzpService.query(Cnd.where("zb_id", "=", zb_id).and("flatid", "=", union_id));
List<Kh_xghsh> xghsh = khXghshService.query(Cnd.where("zb_id", "=", zb_id).and("flatid", "=", union_id));
khzb.getNrs().forEach(nr -> {
nr.getBzs().forEach(bz -> {
Kh_xghsh sh = xghsh.stream().filter(v -> v.getBz_id().equals(bz.getId())).findFirst().orElse(null);
Kh_zp zp = list.stream().filter(v -> v.getBz_id().equals(bz.getId())).findFirst().orElse(null);
if (zp != null) {
bz.setZp(zp);
}
if (sh != null) {
bz.setSh(sh);
}
});
});
return Result.success(khzb);
}
@At
public Result getAgenda() {
final String title = "【工会考核】";
List<NutMap> result = new ArrayList<>();
if (AuthUtil.hasRole(RoleConstant.SYSADMIN.name())&& AuthUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) {
// result.add(new NutMap().setv("title", title).setv("url", "/platform/ghkh/xghsh").setv("iconClass", vi.getIconByPath("/platform/ghkh/xghsh")).setv("label", "校工会审核").setv("number", getXghCount()));
}
return Result.success(result);
}
private Result getXghCount() {
// return kh_recordViService.count(Cnd.where("state", "=", 2));
return Result.success();
}
}
@@ -0,0 +1,157 @@
package com.budwk.app.zhgh.dayofficework.ghkh.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_record;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_xghsh;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zb;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zp;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhXghshService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhzpService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;
import java.util.List;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/10:52
* @Description:
*/
@At("/platform/ghkh/xghsh")
@Ok("json:full")
@IocBean
public class GhkhXghshController {
@Inject
private KhXghshService khXghshService;
@At("")
@Ok("beetl:/platform/zhgh/dayofficework/ghkh/xghsh.html")
@SaCheckPermission("ghkh.xghsh")
public void index() {
}
@At
@SaCheckPermission("ghkh.xghsh")
public Result pageData(@Param(value = "annual") String annual,
@Param(value = "isAudit") Integer isAudit,
@Param(value = "unionid") String unionid, int pageNumber, int pageSize,
@Param(value = "pageOrderName") String pageOrderName,
@Param(value = "pageOrderBy") String pageOrderBy) {
Sql sql = Sqls.create("""
SELECT
zb.assessment,
zb.annual,
un.unionName,
un.unionCode,(
SELECT
sum( score )
FROM
kh_bz
WHERE
nr_id IN ( SELECT id FROM kh_nr WHERE zb_id = zb.id )) bzf,
re.*
FROM
kh_record re
LEFT JOIN kh_zb zb ON re.zb_id = zb.id
LEFT JOIN `vw_user` un ON re.union_id = un.unionId
$condition
""");
Cnd cnd = Cnd.NEW();
/*cnd.and("re.state", "=", 2);*/
cnd.and("zb.disabled", "=", true);
if (isAudit == 1) {
cnd.and("re.state", ">=", 2);
} else {
cnd.and("re.state", isAudit == 2 ? ">" : "=", 2);
}
cnd.andEX( "zb.annual", "=", annual);
cnd.andEX("re.union_id", "=", unionid);
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderBy)) {
cnd.orderBy(pageOrderName, pageOrderBy);
}
cnd.groupBy("re.union_id");
sql.setCondition(cnd);
return Result.success(khXghshService.listPage(pageNumber, pageSize, sql));
}
@Inject
private KhZbService khZbService;
@Inject
private KhzpService khzpService;
@At
@SaCheckPermission("ghkh.xghsh")
public Result getData(String zb_id, String union_id) {
Kh_zb khzb = khZbService.khzb(zb_id);
List<Kh_zp> list = khzpService.query(Cnd.where("zb_id", "=", zb_id).and("flatid", "=", union_id));
khzb.getNrs().forEach(nr -> {
nr.getBzs().forEach(bz -> {
Kh_zp zp = list.stream().filter(v -> v.getBz_id().equals(bz.getId())).findFirst().orElse(null);
if (zp != null) {
bz.setZp(zp);
}
});
});
return Result.success(khzb);
}
@At
public Result xghCheck(String id) {
return Result.success();
}
@Inject
private BaseService baseService;
@At
@POST
@SaCheckPermission("ghkh.xghsh")
public Result marking(@Param(value = "pf") Kh_xghsh[] pf) {
if (pf.length == 0) {
return null;
}
int score = 0;
// Sys_user sys_user = (Sys_user) ShiroUtil.getPrincipal();
for (Kh_xghsh p : pf) {
khzpService.dao().insert(p);
score += p.getSchools() != null ? p.getSchools() : 0;
}
Kh_record record = baseService.dao().fetch(Kh_record.class, Cnd.where("zb_id", "=", pf[0].getZb_id()).and("union_id", "=", pf[0].getFlatid()));
if (record != null) {
record.setXgh_score(score);
record.setState(3);
baseService.dao().update(record);
}
return Result.success();
}
}
@@ -0,0 +1,70 @@
package com.budwk.app.zhgh.dayofficework.ghkh.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.result.Result;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zb;
import com.budwk.app.zhgh.dayofficework.ghkh.model.kh_nr;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhBzService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhNrService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/27/9:23
* @Description:
*/
@At("/platform/ghkh/Xjkhzb")
@Ok("json:full")
@IocBean
public class GhkhXjkhzbController {
@Inject
private KhZbService khZbService;
@Inject
private KhNrService khNrService;
@Inject
private KhBzService khBzService;
@At("")
@Ok("beetl:/platform/zhgh/dayofficework/ghkh/xjkhzb.html")
@SaCheckPermission("ghkh.Xjkhzb")
public void index() {
}
@At
@POST
@SaCheckPermission("ghkh.Xjkhzb")
public Result doAdd(@Param(value = "kh_zb") Kh_zb kh_zb) {
kh_zb.setCreateUserId(SecurityUtil.getUserId());
kh_zb.setCreateUserName(SecurityUtil.getUserUsername());
kh_zb.setCreateTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); Kh_zb zb = khZbService.insert(kh_zb);
for (kh_nr nr : kh_zb.getNrs()) {
nr.setZb_id(zb.getId());
khNrService.insertWith(nr, "bzs");
}
return Result.success();
}
@At
public Result getZbList() {
return Result.success(khZbService.query());
}
}
@@ -0,0 +1,198 @@
package com.budwk.app.zhgh.dayofficework.ghkh.controller;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
@IocBean
@At("/platform/TradeUnionAssessmentCalcScore")
@Ok("json:full")
public class TradeUnionAssessmentCalcScoreController {
private static final Log log = Logs.get();
@Inject
private BaseService baseService;
/**
* 赵欣雨
*
* @param relation_id 标准关联标识
* @return
*/
@At
public Result CalcScore(@Param("bz_relation_id") String relation_id, @Param("year") String year) {
switch (relation_id) {
case "proposal":
return Result.success().addData(getProposalScore(year));
case "secteameet":
return Result.success().addData(getSecTeaMeetingScore(year));
case "ConandDif":
return Result.success().addData(getConAndDifScore(year));
case "Performance":
return Result.success().addData(getPerformanceScore(year));
default:
return Result.success().addData(null);
}
}
@At
public Result getPerformanceScore(String year) {
Sql sql = Sqls.create("""
SELECT
school.`name` activityName,
ev.allName eventName,
ar.ranking,
ar.integral,
ar.numberOfPeople
FROM
activity_results ar
LEFT JOIN activity_school school ON school.id = ar.activityId
LEFT JOIN activity_event ev ON ev.id = ar.eventId
WHERE
ev.projectType = 2
AND YEAR ( school.startTime )= @year
AND ar.unionId=@unionId
ORDER BY
school.startTime,
ranking
""").setParam("unionId", SecurityUtil.getUnionId()).setParam("year", year);
return Result.success(baseService.listMap(sql));
}
/**
* 双代会得分记录
*
* @param year
* @return
*/
public Result getProposalScore(String year) {
String query = """
SELECT
pi.proposalCode,
pi.proposalName,
u.`username`,
pi.createTime,
jdh.jdhallname
FROM
proposal_info pi
LEFT JOIN `user` u ON u.id = pi.createUser
LEFT JOIN jdh_jdhxx jdh ON jdh.id = pi.teacherMeetingId
WHERE
u.unionid = @unionid
AND YEAR ( pi.createTime ) = @year
AND pi.stateCode != '100'
ORDER BY pi.createTime DESC
""";
Sql sql = Sqls.create(query).setParam("year", year).setParam("unionid", SecurityUtil.getUnionId());
return Result.success(baseService.listMap(sql));
}
/**
* 二级教代会得分记录
*
* @param year
* @return
*/
@At
public Result getSecTeaMeetingScore(String year) {
String query = """
SELECT
j2.meeting_name,
j2.meeting_time,
jdh.jdhallname,
u.username
FROM
`jdh_level2` j2
LEFT JOIN sys_unit dw ON dw.id = j2.unit_id
LEFT JOIN sys_union gh ON gh.id = dw.unionid
LEFT JOIN jdh_jdhxx jdh ON jdh.id = j2.session_id
LEFT JOIN `user` u ON u.id = j2.founder
WHERE
u.unionid = @unionid
AND YEAR ( j2.meeting_time ) = @year
ORDER BY
j2.meeting_time DESC
""";
Sql sql = Sqls.create(query).setParam("unionid", SecurityUtil.getUnionId()).setParam("year", year);
return Result.success(baseService.list(sql));
}
/**
* 慰问得分记录 AND 困难补助得分记录
*
* @param year
* @return
*/
@At
public Result getConAndDifScore(String year) {
String query = """
SELECT
bu.username be_username,
bu.loginname be_loginname,
con.apply_time,
ct.`name` typename,
'慰问' AS querytype\s
FROM
condolence con
LEFT JOIN `user` man ON man.id = con.manager
LEFT JOIN `user` bu ON bu.id = con.be_user
LEFT JOIN condolence_type ct ON ct.id = con.type\s
WHERE
bu.unionid = @unionid
AND con.state_id != 3100\s
AND YEAR ( con.apply_time ) = @year
UNION ALL
SELECT
bu.username be_username,
bu.loginname be_loginname,
bf.sqsj AS apply_time,
CASE
bf.sq_knlx\s
WHEN 1 THEN
'会员因病住院'\s
WHEN 2 THEN
'家庭重大意外事故'\s
WHEN 3 THEN
'会员去世'\s
WHEN 4 THEN
'重大疾病(癌症)'\s
WHEN 5 THEN
'困难家庭'\s
WHEN 6 THEN
'精神疾病'\s
WHEN 7 THEN
'长期病休'\s
WHEN 8 THEN
'其它' ELSE '无'\s
END 'typename',
'困难补助' AS querytype\s
FROM
zgfw_knbf bf
LEFT JOIN `user` man ON man.id = bf.sqr
LEFT JOIN `user` bu ON bu.id = bf.bbzrusername\s
WHERE
bu.unionid = @unionid
AND bf.zt = 500\s
AND YEAR ( bf.sqsj ) = @year
""";
Sql sql = Sqls.create(query).setParam("unionid", SecurityUtil.getUnionId()).setParam("year", year);
return Result.success(baseService.list(sql));
}
}
@@ -0,0 +1,99 @@
package com.budwk.app.zhgh.dayofficework.ghkh.model;
import lombok.Data;
import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*;
import com.budwk.app.base.model.BaseModel;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/13:37
* @Description:考核标准
*/
@Data
@Table("Kh_bz")
public class Kh_bz extends BaseModel {
@Column
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("Kh_nr表的id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String nr_id;
@Column
@Comment("考核标准")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String inspection;
@Column
@Comment("是否启用佐证材料")
@ColDefine(type = ColType.BOOLEAN)
private boolean isEvidence;
@Column
@Comment("标准分")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String score;
@Column
@Comment("单项得分")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String single_score;
@Column
@Comment("自评能否超过最高分")
@ColDefine(type = ColType.BOOLEAN)
private boolean beyond_highestscore;
@Column
@Comment("备注")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String remark;
@Column
@Comment("关联模块")
@ColDefine(type = ColType.VARCHAR,width = 100)
private String associatedmodule;
@Column
@Comment("标准标识")
@ColDefine(type = ColType.VARCHAR,width = 100)
private String bz_relation_id;
@Column
@Comment("Kh_zb表的id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String zb_id;
@Column
@Comment("排序字段")
@Prev({
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM Kh_bz"),
})
private Integer location;
@Column
@Comment("能否删除该项")
@ColDefine(type = ColType.BOOLEAN)
private boolean canDelete;
@One(field = "nr_id",key = "id")
private kh_nr nr;
private Kh_zp zp;
private Kh_xghsh sh;
}
@@ -0,0 +1,94 @@
package com.budwk.app.zhgh.dayofficework.ghkh.model;
import org.nutz.dao.entity.annotation.*;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/10/12/16:43
* @Description: 考核记录
*/
@Table("Kh_record")
public class Kh_record {
@Column
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String record_id;
@Column
@Comment("指标id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String zb_id;
@Column
@Comment("分工会id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String union_id;
@Column
@Comment("考核状态( 1 自评成功 2 待校工会评分 3 考核完成 )")
@ColDefine(type = ColType.INT, width = 1)
private Integer state;
@Column
@Comment("自评得分")
@ColDefine(type = ColType.INT, width = 4)
private Integer zp_score;
@Column
@Comment("校工会评分")
@ColDefine(type = ColType.INT, width = 4)
private Integer xgh_score;
public String getRecord_id() {
return record_id;
}
public void setRecord_id(String record_id) {
this.record_id = record_id;
}
public String getZb_id() {
return zb_id;
}
public void setZb_id(String zb_id) {
this.zb_id = zb_id;
}
public String getUnion_id() {
return union_id;
}
public void setUnion_id(String union_id) {
this.union_id = union_id;
}
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
}
public Integer getZp_score() {
return zp_score;
}
public void setZp_score(Integer zp_score) {
this.zp_score = zp_score;
}
public Integer getXgh_score() {
return xgh_score;
}
public void setXgh_score(Integer xgh_score) {
this.xgh_score = xgh_score;
}
}
@@ -0,0 +1,137 @@
package com.budwk.app.zhgh.dayofficework.ghkh.model;
import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*;
import com.budwk.app.base.model.BaseModel;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/11:59
* @Description:校工会审核
*/
@Table("Kh_xghsh")
public class Kh_xghsh extends BaseModel {
@Column
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("校工会评分")
@ColDefine(type = ColType.INT, width = 4)
private Integer schools;
@Column
@Comment("加、减原因")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String addition;
@Column
@Comment("分工会id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String flatid;
@Column
@Comment("标准id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String bz_id;
@Column
@Comment("指标id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String zb_id;
@Column
@Comment("内容id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String nr_id;
@One(field = "id")
private Kh_bz bz;
@Column
@Comment("排序字段")
@Prev({
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM Kh_xghsh"),
})
private Integer location;
public String getZb_id() {
return zb_id;
}
public void setZb_id(String zb_id) {
this.zb_id = zb_id;
}
public String getNr_id() {
return nr_id;
}
public void setNr_id(String nr_id) {
this.nr_id = nr_id;
}
public Integer getLocation() {
return location;
}
public void setLocation(Integer location) {
this.location = location;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getSchools() {
return schools;
}
public void setSchools(Integer schools) {
this.schools = schools;
}
public String getAddition() {
return addition;
}
public void setAddition(String addition) {
this.addition = addition;
}
public String getFlatid() {
return flatid;
}
public void setFlatid(String flatid) {
this.flatid = flatid;
}
public String getBz_id() {
return bz_id;
}
public void setBz_id(String bz_id) {
this.bz_id = bz_id;
}
public Kh_bz getBz() {
return bz;
}
public void setBz(Kh_bz bz) {
this.bz = bz;
}
}
@@ -0,0 +1,189 @@
package com.budwk.app.zhgh.dayofficework.ghkh.model;
import lombok.Data;
import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*;
import com.budwk.app.base.model.BaseModel;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/11:46
* @Description:考核指标
*/
@Table("Kh_zb")
@Data
public class Kh_zb 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 createUserId;
@Column
@Comment("创建人姓名")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String createUserName;
@Column
@Comment("填报人id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userId;
@Column
@Comment("填报人姓名")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userName;
@Column
@Comment("填报人工号")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String loginName;
@Column
@Comment("填报人电话")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String mobile;
@Column
@Comment("填报人单位")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String unitName;
@Column
@Comment("填报人单位id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unitId;
@Column
@Comment("填报人工会")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String unionName;
@Column
@Comment("填报人工会id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionId;
@Column
@Comment("年度")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String annual;
@Column
@Comment("考核名称")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String assessment;
@Column
@Comment("填报开始时间")
@ColDefine(type = ColType.DATETIME)
@NotNull(message = "活动开始时间不能为空")
private Date startDateTime;
@Column
@Comment("填报结束时间")
@ColDefine(type = ColType.DATETIME)
@NotNull(message = "活动结束时间不能为空")
private Date endDateTime;
@Column
@Comment("申诉开始时间")
@ColDefine(type = ColType.DATETIME)
@NotNull(message = "活动开始时间不能为空")
private Date startApplyTime;
@Column
@Comment("申诉结束时间")
@ColDefine(type = ColType.DATETIME)
@NotNull(message = "活动结束时间不能为空")
private Date endApplyTime;
@Column
@Comment("创建时间")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String createTime;
@Column
@Comment("是否开启")
@ColDefine(type = ColType.BOOLEAN)
private boolean disabled;
@Column
@Comment("添加时间")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String addtime;
@Many(field = "zb_id")
private List<kh_nr> nrs;
@Column
@Comment("排序字段")
@Prev({
@SQL(db= DB.MYSQL,value = "SELECT IFNULL(MAX(location),0)+1 FROM Kh_zb"),
})
private Integer location;
public Integer getLocation() {
return location;
}
public void setLocation(Integer location) {
this.location = location;
}
public List<kh_nr> getNrs() {
return nrs;
}
public void setNrs(List<kh_nr> nrs) {
this.nrs = nrs;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getAnnual() {
return annual;
}
public void setAnnual(String annual) {
this.annual = annual;
}
public String getAssessment() {
return assessment;
}
public void setAssessment(String assessment) {
this.assessment = assessment;
}
public String getAddtime() {
return addtime;
}
public void setAddtime(String addtime) {
this.addtime = addtime;
}
}
@@ -0,0 +1,143 @@
package com.budwk.app.zhgh.dayofficework.ghkh.model;
import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*;
import java.util.List;
import java.util.Map;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf考核分工会自评
* @Date: 2020/09/27/20:13
* @Description:
*/
@Table("Kh_zp")
public class Kh_zp {
@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 bz_id;
@Column
@Comment("指标id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String zb_id;
@Column
@Comment("内容id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String nr_id;
@Column
@Comment("材料内容")
@ColDefine(type = ColType.TEXT)
private String clnr;
@Column
@Comment("自评分")
@ColDefine(type = ColType.INT, width = 6)
private Integer zpf;
@Column
@Comment("分工会id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String flatid;
@Column
@Comment("文件")
@ColDefine(type = ColType.MYSQL_JSON)
private List<Map> files;
@Column
@Comment("排序字段")
@Prev({
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM Kh_zp"),
})
private Integer location;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getBz_id() {
return bz_id;
}
public void setBz_id(String bz_id) {
this.bz_id = bz_id;
}
public String getZb_id() {
return zb_id;
}
public void setZb_id(String zb_id) {
this.zb_id = zb_id;
}
public String getNr_id() {
return nr_id;
}
public void setNr_id(String nr_id) {
this.nr_id = nr_id;
}
public String getClnr() {
return clnr;
}
public void setClnr(String clnr) {
this.clnr = clnr;
}
public Integer getZpf() {
return zpf;
}
public void setZpf(Integer zpf) {
this.zpf = zpf;
}
public String getFlatid() {
return flatid;
}
public void setFlatid(String flatid) {
this.flatid = flatid;
}
public List<Map> getFiles() {
return files;
}
public void setFiles(List<Map> files) {
this.files = files;
}
public Integer getLocation() {
return location;
}
public void setLocation(Integer location) {
this.location = location;
}
}
@@ -0,0 +1,58 @@
package com.budwk.app.zhgh.dayofficework.ghkh.model;
import lombok.Data;
import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*;
import com.budwk.app.base.model.BaseModel;
import java.util.List;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/13:34
* @Description:考核内容
*/
@Data
@Table("kh_nr")
public class kh_nr extends BaseModel {
@Column
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("考核内容")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String content;
@Column
@Comment("题号")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String contentNumber;
@Column
@Comment("Kh_zb表的id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String zb_id;
@One(field = "zb_id",key = "id")
private Kh_zb zb;
@Many(field = "nr_id")
private List<Kh_bz> bzs;
@Column
@Comment("排序字段")
@Prev({
@SQL(db= DB.MYSQL,value = "SELECT IFNULL(MAX(location),0)+1 FROM kh_nr"),
})
private Integer location;
}
@@ -0,0 +1,15 @@
package com.budwk.app.zhgh.dayofficework.ghkh.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_bz;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/13:51
* @Description:考核标准
*/
public interface KhBzService extends BaseService<Kh_bz> {
}
@@ -0,0 +1,15 @@
package com.budwk.app.zhgh.dayofficework.ghkh.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.dayofficework.ghkh.model.kh_nr;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/13:48
* @Description:考核内容
*/
public interface KhNrService extends BaseService<kh_nr> {
}
@@ -0,0 +1,15 @@
package com.budwk.app.zhgh.dayofficework.ghkh.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_xghsh;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/13:46
* @Description:校工会审核
*/
public interface KhXghshService extends BaseService<Kh_xghsh> {
}
@@ -0,0 +1,21 @@
package com.budwk.app.zhgh.dayofficework.ghkh.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zb;
import java.util.List;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/13:43
* @Description:考核指标
*/
public interface KhZbService extends BaseService<Kh_zb> {
List<Kh_zb> khzbs();
Kh_zb khzb(String zbid);
}
@@ -0,0 +1,15 @@
package com.budwk.app.zhgh.dayofficework.ghkh.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zp;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/10/10/17:44
* @Description:
*/
public interface KhzpService extends BaseService<Kh_zp> {
}
@@ -0,0 +1,22 @@
package com.budwk.app.zhgh.dayofficework.ghkh.service.impl;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_bz;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhBzService;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/13:52
* @Description:
*/
@IocBean(args = {"refer:dao"})
public class KhBzServiceImpl extends BaseServiceImpl<Kh_bz> implements KhBzService {
public KhBzServiceImpl(Dao dao) {
super(dao);
}
}
@@ -0,0 +1,22 @@
package com.budwk.app.zhgh.dayofficework.ghkh.service.impl;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.zhgh.dayofficework.ghkh.model.kh_nr;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhNrService;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/13:50
* @Description:
*/
@IocBean(args = {"refer:dao"})
public class KhNrServiceImpl extends BaseServiceImpl<kh_nr> implements KhNrService {
public KhNrServiceImpl(Dao dao) {
super(dao);
}
}
@@ -0,0 +1,22 @@
package com.budwk.app.zhgh.dayofficework.ghkh.service.impl;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_xghsh;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhXghshService;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/13:47
* @Description:
*/
@IocBean(args = {"refer:dao"})
public class KhXghshServiceImpl extends BaseServiceImpl<Kh_xghsh> implements KhXghshService {
public KhXghshServiceImpl(Dao dao) {
super(dao);
}
}
@@ -0,0 +1,55 @@
package com.budwk.app.zhgh.dayofficework.ghkh.service.impl;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zb;
import com.budwk.app.zhgh.dayofficework.ghkh.model.kh_nr;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhNrService;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhZbService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import java.util.List;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/09/25/13:44
* @Description:
*/
@IocBean(args = {"refer:dao"})
public class KhZbServiceImpl extends BaseServiceImpl<Kh_zb> implements KhZbService {
public KhZbServiceImpl(Dao dao) {
super(dao);
}
@Inject
private KhNrService khNrService;
private void setNrBz(List<kh_nr> nrs) {
for (kh_nr nr : nrs) {
nr = khNrService.fetchLinks(nr, "bzs", Cnd.NEW().asc("location"));
}
}
@Override
public List<Kh_zb> khzbs() {
List<Kh_zb> zbs = query(Cnd.NEW().asc("location"), "nrs");
for (Kh_zb zb : zbs) {
setNrBz(zb.getNrs());
}
return zbs;
}
@Override
public Kh_zb khzb(String zbid) {
Kh_zb zb = fetchLinks(fetch(zbid), "nrs",Cnd.NEW().asc("location"));
setNrBz(zb.getNrs());
return zb;
}
}
@@ -0,0 +1,22 @@
package com.budwk.app.zhgh.dayofficework.ghkh.service.impl;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.zhgh.dayofficework.ghkh.model.Kh_zp;
import com.budwk.app.zhgh.dayofficework.ghkh.service.KhzpService;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhf
* @Date: 2020/10/10/17:45
* @Description:
*/
@IocBean(args = {"refer:dao"})
public class KhzpServiceImpl extends BaseServiceImpl<Kh_zp> implements KhzpService {
public KhzpServiceImpl(Dao dao) {
super(dao);
}
}
@@ -0,0 +1,150 @@
<template>
<div>
<el-dialog title="自动计算得分" :visible.sync="show_modal" :close-on-click-modal="false">
<el-table :data="tableData" v-loading="loading" element-loading-text="智能查分中"
element-loading-spinner="el-icon-loading text-primary"
element-loading-background="rgba(0, 0, 0, 0.8)">
<el-table-column type="index"></el-table-column>
<el-table-column v-for="column in tableColumn"
:key="column.prop"
:label="column.label"
:prop="column.prop"
show-overflow-tooltip
header-align="center"
align="center">
</el-table-column>
</el-table>
<template #footer>
<el-button @click="closeCalcTable"> </el-button>
<el-button type="primary" @click="autoFillTab" :disabled="loading">自动计算填入</el-button>
</template>
</el-dialog>
</div>
</template>
<script>
module.exports = {
props: {
relation_year: {
type: Object,
default: {}
},
show_modal: {
type: Boolean,
default: false
}
},
data() {
return {
loading: false,
tableData: [],
tableColumn: [],
proposalTableColumn: [
{label: '提案编号', prop: 'proposalCode'},
{label: '提案名称', prop: 'proposalName'},
{label: '提案人', prop: 'username'},
{label: '提案时间', prop: 'createTime'},
{label: '教代会届次', prop: 'jdhallname'}
],
secTeaMeetTableColumn: [
{label: '会议名称', prop: 'meeting_name'},
{label: '会议时间', prop: 'meeting_time'},
{label: '届次', prop: 'jdhallname'},
{label: '申请人', prop: 'username'},
],
ConTableColumn: [
{label: '被慰问/补助人', prop: 'be_username'},
{label: '被慰问/补助人', prop: 'be_loginname'},
{label: '申请时间', prop: 'apply_time'},
{label: '慰问/补助类型', prop: 'typename'},
{label: '类型', prop: 'querytype'},
],
PerformanceTableColumn: [
{label: '获奖活动', prop: 'activityName'},
{label: '获奖项目', prop: 'eventName'},
{label: '获奖名次', prop: 'ranking'},
{label: '获奖积分', prop: 'integral'},
{label: '参加人数', prop: 'numberOfPeople'},
]
}
},
watch: {
relation_year: {
async handler(v) {
switch (v.bz_relation_id) {
case 'proposal':
this.tableColumn = this.proposalTableColumn
break
case 'secteameet':
this.tableColumn = this.secTeaMeetTableColumn
break
case 'ConandDif':
this.tableColumn = this.ConTableColumn
break
case 'Performance':
this.tableColumn = this.PerformanceTableColumn
break
default:
this.tableColumn = []
}
this.tableData = []
this.loading = true
const res = await $.get('/platform/TradeUnionAssessmentCalcScore/CalcScore', v)
if (res.code === 0) {
setTimeout(() => {
this.loading = false
this.tableData = res.data == null ? [] : res.data
}, 1000)
}
},
immediate: false
}
},
methods: {
autoFillTab() {
// this.$emit('get_score_item_num', this.tableData.length)
this.$emit('get_table_data', this.tableData)
this.$emit('update:show_modal', false)
},
closeCalcTable() {
this.$emit('update:show_modal', false)
}
}
}
</script>
<style>
/**
修改el-dialog样式
*/
.el-dialog__wrapper {
overflow: unset;
}
.el-dialog {
margin-top: 5vh !important;
/*height: 90vh;*/
max-height: 90vh;
overflow: hidden;
}
.el-dialog .el-dialog__header {
height: 54px;
max-height: 54px;
}
/**
header + footer
(54 + 70) = 124px
*/
.el-dialog .el-dialog__body {
overflow-y: auto !important;
max-height: calc(90vh - 124px) !important;
}
.el-dialog .el-dialog__footer {
height: 70px;
max-height: 70px;
}
</style>
@@ -0,0 +1,394 @@
<template>
<el-form class="el_form" :model="formData" ref="addForm" :rules="formRules" label-width="100px">
<table-tool label="指标信息"></table-tool>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item prop="annual" label="年&emsp;&emsp;度">
<el-date-picker
style="width: 100%"
v-if="!is_view"
:picker-options="pickerOptions"
v-model="formData.annual"
type="year"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
<el-input v-else style="color: #F6F7FA;" disabled v-model="formData.annual"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="assessment" label="考核名称">
<el-input maxlength="30" v-if="!is_view" v-model="formData.assessment" placeholder="请填写考核名称"
type="text">
</el-input>
<el-input v-else style="color: #F6F7FA;" disabled v-model="formData.assessment"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="assessment" label="">
<el-checkbox v-model="formData.isEvaluationIndex">是否采用往年考核指标</el-checkbox>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="zbId" label="" v-if="formData.isEvaluationIndex">
<el-select v-model="formData.zbId" placeholder="请选择指标" filterable clearable
style="width: 100%" @change="getByZbData">
<el-option
v-for="item in zbList"
:key="item.id"
:label="item.annual+item.assessment"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item prop="fillTime" label="考核时间">
<el-date-picker
style="width: 100%"
v-if="!is_view"
v-model="formData.fillTimeRange"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始时间"
end-placeholder="结束时间">
</el-date-picker>
<div v-else>
<div v-if="formData.startDateTime && formData.endDateTime">
{{ formData.startDateTime }} {{ formData.endDateTime }}
</div>
<div v-else>未设置</div>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="appealTime" label="申诉时间">
<el-date-picker
style="width: 100%"
v-if="!is_view"
v-model="formData.appealTimeRange"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始时间"
end-placeholder="结束时间">
</el-date-picker>
<div v-else>
<div v-if="formData.startApplyTime && formData.appealEndTime">
{{ formData.startApplyTime }} {{ formData.endApplyTime }}
</div>
<div v-else>未设置</div>
</div>
</el-form-item>
</el-col>
</el-row>
<table-tool label="考核内容"></table-tool>
<el-form-item label="" label-width="0" v-for="(nr,idx) in formData.nrs" :key="idx">
<el-row type="flex" justify="space-between">
<el-input v-model="nr.content" v-if="!is_view" maxlength="30" style="width: 50%" placeholder="请填写考核内容">
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
</el-input>
<span style="background-color: #F6F7FA;" v-else>{{ idx + 1 }}&nbsp;&nbsp;{{ nr.content }}</span>
<div style="display: flex; gap: 10px;">
<el-button v-if="!is_view" size="small" icon="el-icon-plus" type="primary"
@click="formData.nrs.push({bzs:[{}]})">
添加内容
</el-button>
<el-button v-if="!is_view" size="medium" :disabled="formData.nrs.length<=1" type="danger"
@click="formData.nrs.splice(idx,1)" icon="el-icon-delete">
</el-button>
</div>
</el-row>
<el-row style="margin-top: 20px">
<el-table :data="nr.bzs" style="width: 100%" border show-summary :summary-method="getSummaries" size="small">
<el-table-column label="序号" type="index" width="50px">
</el-table-column>
<el-table-column label="考核标准" prop="inspection" >
<template v-slot="{row}">
<el-input v-if="!is_view" v-model="row.inspection" placeholder="请填写考核标准"></el-input>
<span v-else>{{ row.inspection }}</span>
</template>
</el-table-column>
<el-table-column label="单项分" prop="single_score" width="100px">
<template v-slot="{row}">
<el-input v-if="!is_view" v-model="row.single_score" placeholder="请填写单项分"></el-input>
<span v-else>{{ row.single_score }}</span>
</template>
</el-table-column>
<el-table-column label="标准分" prop="score" width="100px">
<template v-slot="{row}">
<el-input v-if="!is_view" v-model.number="row.score" maxlength="4" placeholder="请填写标准分"></el-input>
<span v-else>{{ row.score }}</span>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark" width="100px">
<template v-slot="{row}">
<el-input v-if="!is_view" v-model.number="row.remark" maxlength="4" placeholder="请填写备注"></el-input>
<span v-else>{{ row.remark }}</span>
</template>
</el-table-column>
<el-table-column label="能否超过标准分" prop="beyond_highestscore" width="120px">
<template v-slot="{row}">
<el-switch
v-if="!is_view"
v-model="row.beyond_highestscore"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
<el-switch
v-else
disabled
v-model="row.beyond_highestscore">
</el-switch>
</template>
</el-table-column>
<el-table-column label="是否提供佐证材料" prop="isEvidence" width="120px">
<template v-slot="{row}">
<el-switch
v-if="!is_view"
v-model="row.isEvidence"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
<el-switch
v-else
disabled
v-model="row.isEvidence">
</el-switch>
</template>
</el-table-column>
<el-table-column label="关联模块" prop="associatedmodule" width="200px">
<template v-slot="{row}">
<el-input v-if="!is_view" v-model="row.associatedmodule" maxlength="10" placeholder="请填写关联模块"></el-input>
<span v-else>{{ row.associatedmodule }}</span>
</template>
</el-table-column>
<el-table-column label="关联标识" prop="bz_relation_id" width="100px">
<template v-slot="{row}">
<el-input v-if="!is_view" v-model="row.bz_relation_id" maxlength="20" placeholder="请填写关联标识,该标识唯一"></el-input>
<span v-else>{{ row.bz_relation_id }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="能否删除" prop="canDelete" width="100px">-->
<!-- <template v-slot="{row}">-->
<!-- <el-switch-->
<!-- v-if="!is_view"-->
<!-- :disabled="row.canDelete==false"-->
<!-- v-model="row.canDelete"-->
<!-- active-color="#13ce66"-->
<!-- inactive-color="#ff4949">-->
<!-- </el-switch>-->
<!-- <el-switch-->
<!-- v-else-->
<!-- :disabled="!row.canDelete && row.id"-->
<!-- v-model="row.canDelete">-->
<!-- </el-switch>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column v-if="!is_view" label="操作" width="100px">
<template v-slot="{row,$index}">
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id)" type="danger" icon="el-icon-delete"
@click="nr.bzs.splice($index,1)"></el-button>
</template>
</el-table-column>
</el-table>
<el-button v-if="!is_view" type="primary" plain style="width: 100%" size="mini" icon="el-icon-plus"
@click="nr.bzs.push({})">
添加考核标准
</el-button>
<el-divider></el-divider>
</el-row>
</el-form-item>
</el-form>
</template>
<script>
const METHOD_NAME = "change"
module.exports = {
props: {
is_view: {
type: Boolean,
default: false
},
form_data: {
type: Object,
default: function() {
return {
nrs: [{
bzs: [{}]
}],
};
}
}
},
watch: {
formData: {
deep: true,
handler(val) {
this.$emit(METHOD_NAME, val)
}
}
},
data() {
return {
isEvaluationIndex: false,
zbList: [],
formRules: {
xxx: [{required: true, message: '请填写年度', trigger: ['blur', 'change']}],
},
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
relationData:[
{moduleName:'提案系统模块',id:'proposal'},
{moduleName:'二级教代会',id:'secteameet'},
{moduleName:'慰问/补助',id:'ConandDif'},
],
formData:{}
}
},
methods: {
async getByZbData() {
this.$axios.post('/platform/ghkh/khzb/edit', {id: this.formData.zbId}).then(res => {
if (res.code === 0) {
this.$set(this.formData, "nrs", res.data.nrs)
}
})
},
async getZbList() {
this.$axios.post("/platform/ghkh/Xjkhzb/getZbList").then(res => {
if (res.code === 0) {
this.zbList = res.data
}
})
},
async getKh() {
this.$axios.post("/platform/ghkh/khph/getKh", {"annual": this.formData.annual}).then(res => {
if (res.code === 0) {
if (res.data.length != 0) {
this.kh = res.data
this.data.khid = this.kh[0].id
} else {
this.kh = []
this.pageForm.khid = ""
}
}
})
},
async khSearch() {
await this.getKh()
},
getSummaries(param) {
const {columns, data} = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '小计';
return;
} else if ([1,4,5,6,7].includes(index)) {
sums[index] = '';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += ' 分';
} else {
sums[index] = '';
}
});
return sums;
}
},
created() {
this.getZbList()
if (!this.form_data || !Object.keys(this.form_data).length) {
this.formData = {
nrs: [{
bzs: [{}]
}],
}
}else{
this.formData=this.form_data
// 初始化时间范围数据用于编辑
if (this.formData.startDateTime && this.formData.endDateTime) {
this.$set(this.formData, 'fillTimeRange', [this.formData.startDateTime, this.formData.endDateTime]);
}
if (this.formData.startApplyTime && this.formData.endApplyTime) {
this.$set(this.formData, 'appealTimeRange', [this.formData.startApplyTime, this.formData.endApplyTime]);
}
}
}
}
</script>
<style>
.fixedBox {
position: fixed;
top: 200px;
right: 10px;
z-index: 100;
}
.el-divider {
background-color: #409EFF;
}
.el_form {
position: relative;
}
.el-input-group__prepend {
background-color: #419BF8;
color: white;
}
</style>
@@ -0,0 +1,74 @@
<template>
<el-form :model="data" ref="form" :rules="formRules" label-width="100px">
<el-form-item label="&emsp;" label-width="110px" class="view-header"></el-form-item>
<el-form-item prop="nr" label="考核内容">
<el-input disabled v-model="data.nr" type="text"></el-input>
</el-form-item>
<el-form-item prop="bz" label="考核标准">
<el-input disabled v-model="data.bz" type="text"></el-input>
</el-form-item>
<el-form-item prop="clnr" label="材料内容">
<el-input v-model="data.clnr" type="textarea" :autosize="{ minRows: 2, maxRows: 10}"
placeholder="暂无" :disabled="is_view"></el-input>
</el-form-item>
<el-form-item label="&emsp;" label-width="110px" class="view-header"></el-form-item>
<el-form-item label="佐证材料1">
<span v-if="is_view&&!data.files">暂无</span>
<!-- <file-upload :files.sync="data.files" :view="is_view" card v-else></file-upload>-->
<file-upload
v-model="data.files"
:upload_number="5"
upload_mode="drag"
upload_result_category="array"
complete_result
:accept="'.pdf,.doc,.docx,.jpg,.png'"
></file-upload>
</el-form-item>
</el-form>
</template>
<script>
const METHOD_NAME = "change"
module.exports = {
props: {
is_view: {
type: Boolean,
default: false
},
width: "200px",
data: {
type: Object,
default: {
files: () => [],
}
},
},
// components: {
// 'file-upload': httpVueLoader('/components/plugins/FileUpload.vue')
// },
data() {
return {
formRules: {
xxx: [{required: true, message: '', trigger: ['blur', 'change']}]
}
}
},
methods: {},
watch: {},
created() {
}
}
</script>
<style>
</style>
@@ -0,0 +1,282 @@
<template>
<el-form class="el_form" :model="data" ref="addForm" :rules="formRules" label-width="100px">
<vi-title title="指标信息"></vi-title>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item prop="annual" label="年&emsp;&emsp;度">
<el-date-picker
style="width: 100%"
v-if="!is_view"
:picker-options="pickerOptions"
v-model="data.annual"
type="year"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
<el-input v-else style="color: #F6F7FA;" disabled v-model="data.annual"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="assessment" label="考核名称">
<el-input maxlength="30" v-if="!is_view" v-model="data.assessment" placeholder="请填写考核名称"
type="text">
</el-input>
<el-input v-else style="color: #F6F7FA;" disabled v-model="data.assessment"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="assessment" label="" v-if="!is_view">
<el-checkbox v-model="data.isEvaluationIndex">是否采用往年考核指标</el-checkbox>
</el-form-item>
<el-form-item prop="zbId" label="往年指标" v-show="data.isEvaluationIndex">
<el-select v-model="data.zbId" placeholder="请选择指标" filterable clearable
style="width: 100%" @change="getByZbData">
<el-option
v-for="item in zbList"
:key="item.id"
:label="item.annual+item.assessment"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<vi-title2 title="考核项目">
<template #func>
<el-button v-if="!is_view" size="small" style="float: right" icon="el-icon-plus" type="primary"
@click="data.nrs.push({bzs:[{}]})">
添加内容
</el-button>
</template>
</vi-title2>
<el-form-item label="" label-width="0" v-for="nr,idx in data.nrs">
<el-row type="flex" align="middle" justify="space-between">
<el-input v-model="nr.content" v-if="!is_view" maxlength="30" style="width: 50%" placeholder="请填写考核项目">
<template slot="prepend"><span v-model="nr.contentNumber">{{ nr.contentNumber = idx + 1 }}</span></template>
</el-input>
<span style="background-color: #F6F7FA;" v-else>{{ idx + 1 }}&nbsp;&nbsp;{{ nr.content }}</span>
<el-button v-if="!is_view" size="medium" :disabled="data.nrs.length<=1" type="danger"
@click="data.nrs.splice(idx,1)"
icon="el-icon-delete"></el-button>
</el-row>
<el-row style="margin-top: 20px">
<el-table :data="nr.bzs" style="width: 100%" border show-summary :summary-method="getSummaries" size="small">
<el-table-column align="center" header-align="center" label="序号" type="index" width="70px">
</el-table-column>
<el-table-column label="考评内容" prop="inspection" header-align="center" align="center">
<template scope="{row}">
<el-input v-if="!is_view" v-model="row.inspection" placeholder="请填写考核标准"
maxlength="500" type="textarea" autosize></el-input>
<span v-else>{{ row.inspection }}</span>
</template>
</el-table-column>
<el-table-column label="评分标准" prop="scoringCriteria" header-align="center" align="center" width="300px"
min-width="200">
<template scope="{row}">
<el-input v-if="!is_view" v-model="row.scoringCriteria" placeholder="请填写评分标准"
maxlength="250" type="textarea" autosize></el-input>
<span v-else>{{ row.scoringCriteria }}</span>
</template>
</el-table-column>
<el-table-column label="项目自评(分数)" prop="score" header-align="center" align="center" width="120px">
<template scope="{row}">
<el-input v-if="!is_view" type="number" v-model.number="row.score" maxlength="4"
placeholder="请填写项目自评"></el-input>
<span v-else>{{ row.score }}</span>
</template>
</el-table-column>
<el-table-column label="考核办法" prop="assessmentMethod" header-align="center" align="center" width="300px">
<template scope="{row}">
<el-input v-if="!is_view" v-model="row.assessmentMethod" maxlength="50"
placeholder="请填写考核办法"></el-input>
<span v-else>{{ row.assessmentMethod }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="是否提供佐证材料" prop="isEvidence" header-align="center" align="center"-->
<!-- width="120px">-->
<!-- <template scope="{row}">-->
<!-- <el-switch-->
<!-- v-if="!is_view"-->
<!-- v-model="row.isEvidence"-->
<!-- active-color="#13ce66"-->
<!-- inactive-color="#ff4949">-->
<!-- </el-switch>-->
<!-- <el-switch-->
<!-- v-else-->
<!-- disabled-->
<!-- v-model="row.isEvidence">-->
<!-- </el-switch>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column v-if="!is_view" label="操作" header-align="center" align="center" width="100px">
<template slot="header" scope="{row,$index}">
<el-button size="mini" icon="el-icon-plus" type="primary" @click="nr.bzs.push({})" title="添加考评内容"></el-button>
</template>
<template scope="{row,$index}">
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id)" type="danger"
icon="el-icon-delete"
@click="nr.bzs.splice($index,1)"></el-button>
</template>
</el-table-column>
</el-table>
<!-- <el-button v-if="!is_view" type="primary" plain style="width: 100%" size="mini" icon="el-icon-plus"-->
<!-- @click="nr.bzs.push({})">-->
<!-- 添加考核标准-->
<!-- </el-button>-->
<!-- <el-divider></el-divider>-->
</el-row>
</el-form-item>
</el-form>
</template>
<script>
const METHOD_NAME = "change"
module.exports = {
props: {
is_view: {
type: Boolean,
default: false
},
data: {
type: Object,
default: {
nrs: [{
bzs: [{}]
}],
}
}
},
watch: {
data: {
deep: true,
handler(val) {
this.$emit(METHOD_NAME, val)
}
}
},
data() {
return {
isEvaluationIndex: false,
zbList: [],
formRules: {
xxx: [{required: true, message: '请填写年度', trigger: ['blur', 'change']}],
},
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
relationData: [
{moduleName: '提案系统模块', id: 'proposal'},
{moduleName: '二级教代会', id: 'secteameet'},
{moduleName: '慰问/补助', id: 'ConandDif'},
]
}
},
methods: {
async getByZbData() {
const {code, data, msg} = await $.get('/platform/xhkh/khzb/edit', {id: this.data.zbId})
this.$set(this.data, "nrs", data.nrs)
},
async getZbList() {
await $.get("/platform/xhkh/Xjkhzb/getZbList").then(res => {
this.zbList = res.data
})
},
async getKh() {
await $.get("/platform/xhkh/khph/getKh", {"annual": this.data.annual}).then(res => {
if (res.data.length != 0) {
this.kh = res.data
this.data.khid = this.kh[0].id
} else {
this.kh = []
this.pageForm.khid = ""
}
})
},
async khSearch() {
await this.getKh()
},
getSummaries(param) {
const {columns, data} = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '小计';
return;
} else if ([1, 4, 5, 6, 7].includes(index)) {
sums[index] = '';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += ' 分';
} else {
sums[index] = '';
}
});
return sums;
}
},
created() {
this.getZbList()
if (!this.data || !Object.keys(this.data).length) {
this.data = {
nrs: [{
bzs: [{}]
}],
}
}
}
}
</script>
<style scoped>
.fixedBox {
position: fixed;
top: 200px;
right: 10px;
z-index: 100;
}
.el-divider {
background-color: #409EFF;
}
.el_form {
position: relative;
}
</style>
@@ -0,0 +1,130 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度">
<el-date-picker v-model="pageForm.annual" type="annual" value-format="yyyy" placeholder="请选择"
style="width: 100%"></el-date-picker>
</search-item>
<search-item label="考核名称">
<el-select v-model="pageForm.khid"
@change="doSearch"
placeholder="请选择考核">
<el-option
v-for="item in kh"
:key="item.id"
:label="item.assessment"
:value="item.id">
</el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card shadow="never" class="mt20">
<el-table :data="tableData" style="width: 100%" row-key="id"
v-loading="tabLoading">
<el-table-column align="center" header-align="center" label="序号" width="100px">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="年度" prop="annual" header-align="center" width="300px"
align="center">
</el-table-column>
<el-table-column label="分工会名称" prop="unionname" header-align="center"
show-overflow-tooltip
align="center" sortable></el-table-column>
<el-table-column label="最终考核得分" prop="xgh_score" header-align="center"
show-overflow-tooltip
align="center" sortable></el-table-column>
<!-- <el-table-column label="名次" prop="Ranking" header-align="center" show-overflow-tooltip-->
<!-- align="center"></el-table-column>-->
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
tabLoading: false,
tableData: [],
kh: [],
pageForm: {
khid: "",
annual: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
},
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
}
},
methods: {
async getKh() {
this.$axios.post("/platform/ghkh/khph/getKh", {"annual": this.pageForm.annual}).then(res => {
if (res.code === 0) {
if (res.data.length != 0) {
this.kh = res.data
this.pageForm.khid = this.kh[0].id
} else {
this.kh = []
this.pageForm.khid = ""
}
}
})
},
async khSearch() {
await this.getKh()
this.pageData();
},
pageData() {
this.$axios.post(base + "/platform/ghkh/khph/pageData", this.pageForm).then(res => {
this.tabLoading = false
if (res.code == 0) {
this.tableData = res.data.list;
this.pageForm.totalCount = res.data.totalCount;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
}).catch(error => {
this.tabLoading = false
});
this.tabLoading = true
},
},
async created() {
this.pageForm.annual = new Date().getFullYear() + ""
await this.getKh()
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,250 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
#app {
overflow-y: unset !important;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度">
<el-date-picker
@change="khSearch"
:picker-options="pickerOptions"
v-model="pageForm.annual"
type="year"
value-format="yyyy"
placeholder="选择年度"
style="width: 100%">
</el-date-picker>
</search-item>
<search-item label="考核名称">
<el-input
v-model="pageForm.assessment"
placeholder="根据考核名称关键字查询"
clearable
style="width: 100%">
</el-input>
</search-item>
</search>
</el-card>
<el-card shadow="never" class="mt20">
<el-table :data="tableData" style="width: 100%" row-key="id"
v-loading="tabLoading">
<el-table-column align="center" header-align="center" label="序号" width="100px">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="年度" prop="annual" header-align="center" width="300px"
sortable
align="center">
<template scope="scope">
{{scope.row.annual}}
</template>
</el-table-column>
<el-table-column label="考核名称" prop="assessment" header-align="center"
show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="填报时间" width="300px" header-align="center" show-overflow-tooltip align="center">
<template scope="scope">
<span>{{scope.row.startdatetime}} - {{scope.row.enddatetime}}</span>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createtime" header-align="center"
show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="创建人" prop="createusername" header-align="center"
show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="是否开启" header-align="center" align="center">
<template scope="scope">
<el-switch
v-model="scope.row.disabled"
active-color="#13ce66"
inactive-color="#ff4949"
@change="(val) => toggleEnable(val, scope.row.id)">
</el-switch>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right"
width="250px">
<template scope="scope">
<el-button size="mini" type="primary" @click="openView(scope.row.id)">查看</el-button>
<el-button size="mini" type="primary" @click="openEdit(scope.row.id)">
编辑
</el-button>
<el-button size="mini" type="danger" @click="doDelete(scope.row.id)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<template #edit_func>
<el-button type="primary" style="float: right;margin-top: 5px"
@click="doEdit()">提交
</el-button>
</template>
<template #edit>
<kh-zb :form_data="formData" @change="v=>{this.formData=v}"></kh-zb>
</template>
<template #view>
<kh-zb :form_data="viewData" :is_view="true"></kh-zb>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
tabLoading: false,
loading: true,
activeName: '1',
tableData: [],
formData: {},
viewData: {
nrs: [{
bzs: [{}]
}],
},
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
},
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
pageDataUrl: "/platform/ghkh/khzb/pageData"
}
},
components: {
'kh-zb': httpVueLoader('/components/module/kh/KhZb.vue')
},
methods: {
toggleEnable(enable, id) {
this.$axios.post("/platform/ghkh/khzb/toggleEnable", {id, enable}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg);
} else {
this.$message.error(res.msg);
const row = this.tableData.find(item => item.id === id);
if (row) {
row.disabled = !enable;
}
}
})
},
async getKh() {
this.$axios.post("/platform/ghkh/khph/getKh", {"annual": this.pageForm.annual}).then(res => {
if (res.code === 0) {
if (res.data.length != 0) {
this.kh = res.data
this.pageForm.khid = this.kh[0].id
} else {
this.kh = []
this.pageForm.khid = ""
}
}
})
},
async khSearch() {
await this.getKh()
},
async openEdit(id) {
this.$axios.post('/platform/ghkh/khzb/edit', {id}).then(res => {
if (res.code === 0) {
this.formData = res.data;
this.$refs.guava.edit();
}
})
},
doEdit() {
this.$axios.post(base + "/platform/ghkh/khzb/doEdit", {kh_zb: JSON.stringify(this.formData)}).then(res => {
if (res.code === 0) {
this.$message({
message: res.msg,
type: 'success'
});
}
this.$refs.guava.index()
this.pageData()
})
},
doDelete(id) {
this.$confirm('您确定要删除吗!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: (a, b) => {
if ("confirm" == a) {//确认后再执行
this.$axios.post("/platform/ghkh/khzb/delete", {id: id}).then(res => {
if (res.code === 0) {
this.$message({
message: res.msg,
type: 'success'
});
this.pageData();
}
})
}
}
});
},
openView(id) {
this.loading = true;
this.$axios.post('/platform/ghkh/khzb/edit', {id}).then(res => {
if (res.code === 0) {
this.viewData = res.data;
this.$refs.guava.view(); // 数据设置完成后再调用view方法
}
this.loading = false;
}).catch(error => {
this.loading = false;
});
}
},
async created() {
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,349 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-date-picker
@change="khSearch"
:picker-options="pickerOptions"
v-model="pageForm.annual"
type="year"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
</div>
<div class="btn-group tool-button mt5">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<el-table :data="tableData" style="width: 100%" row-key="id"
v-loading="tabLoading">
<el-table-column align="center" header-align="center" label="序号" width="100px">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="年度" prop="annual" header-align="center" width="300px" sortable
align="center">
<template scope="scope">
{{scope.row.annual}}
</template>
</el-table-column>
<el-table-column label="考核名称" prop="assessment" header-align="center" show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="基层工会名称" prop="unionname" header-align="center" show-overflow-tooltip
align="center">
<template scope="{row}">
({{row.unioncode}}){{row.unionname}}
</template>
</el-table-column>
<el-table-column label="标准总分" prop="bzf" header-align="center" show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="自评得分" prop="zp_score" header-align="center" show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="总部工会得分" prop="xgh_score" header-align="center" show-overflow-tooltip
align="center"></el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="250px">
<template scope="scope">
<el-button size="mini" type="primary" @click="openView(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<el-form :model="formData" ref="form" label-width="100px"
style="height: calc(100vh - 50px);overflow-y: scroll;padding: 10px 15px">
<vi-title title="指标信息"></vi-title>
<el-row gutter="20">
<el-col :span="8">
<el-form-item prop="annual" label="年&emsp;&emsp;度">
<el-date-picker
readonly
v-model="formData.annual"
type="year"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="flatname" label="分工会名称">
<el-input maxlength="30" value="" readonly v-model="formData.flatname"
placeholder="请填写分工会名称"
type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="assessment" label="考核名称">
<el-input maxlength="30" readonly v-model="formData.assessment" placeholder="请填写考核名称"
type="text"></el-input>
</el-form-item>
</el-col>
</el-row>
<vi-title title="考核内容"></vi-title>
<el-form-item label="" label-width="0" v-for="nr,idx in formData.nrs">
<el-row type="flex" align="middle" justify="space-between">
<el-input v-model="nr.content" readonly maxlength="30" style="width: 50%"
placeholder="请填写考核内容">
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
</el-input>
</el-row>
<el-row style="margin-top: 20px">
<el-table :data="nr.bzs" style="width: 100%" border show-summary
:summary-method="getSummaries">
<el-table-column align="center" header-align="center" label="序号" type="index">
</el-table-column>
<el-table-column label="考核标准" disabled prop="inspection" header-align="center"
align="center">
<template scope="{row}">
<el-input v-model="row.inspection"
readonly placeholder="请填写考核标准"></el-input>
</template>
</el-table-column>
<el-table-column label="标准分" prop="score" header-align="center" align="center"
width="150px">
<template scope="{row}">
<el-input v-model.number="row.score" readonly maxlength="4"
placeholder="请填写标准分"></el-input>
</template>
</el-table-column>
<el-table-column label="自评得分" prop="zpf" header-align="center" align="center"
width="150px">
<template scope="{row}">
<el-input v-if="row.zpf" v-model.number="row.zpf" maxlength="4"
readonly placeholder="请填写自评分"></el-input>
<el-input v-else value="暂无" maxlength="4"
readonly></el-input>
</template>
</el-table-column>
<el-table-column label="总部工会评分" prop="schools" header-align="center" align="center"
width="150px">
<template scope="{row}">
<el-input v-model.number="row.schools" readonly maxlength="4"
placeholder="请填写评分"></el-input>
</template>
</el-table-column>
<el-table-column label="加、减原因" prop="addition" header-align="center" align="center"
width="250px">
<template scope="{row}">
<el-input v-model.number="row.addition" readonly maxlength="50"
placeholder="请填写加、减原因"></el-input>
</template>
</el-table-column>
<el-table-column label="有关佐证材料" header-align="center" align="center"
width="250px">
<template scope="{row}">
<el-button type="primary" :disabled="!row.isEvidence" plain
@click="doView(nr.content,row.inspection,row)">
查看佐证材料
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</el-form-item>
</el-form>
</template>
</guava>
<el-drawer
:visible.sync="dialog"
direction="rtl" size="40%"
custom-class="demo-drawer"
ref="drawer">
<div class="demo-drawer__content" style="padding: 0 15px">
<upload-materials :data="data" :is_view="true"></upload-materials>
</div>
</el-drawer>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unions: [],
units: [],
data: {},
row: {},
dialog: false,
loading: false,
formData: {},
tabLoading: false,
tableData: [],
pageForm: {
annual: moment().format('YYYY'),
pageNumber: 1,
pageSize: 10,
totalCount: 0,
},
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
}
},
components: {
'upload-materials': httpVueLoader('/components/module/kh/UploadMaterials.vue')
},
methods: {
async getKh() {
this.$axios.post("/platform/ghkh/khph/getKh", {"annual": this.pageForm.annual}).then(res => {
if (res.code === 0) {
if (res.data.length != 0) {
this.kh = res.data
this.pageForm.khid = this.kh[0].id
} else {
this.kh = []
this.pageForm.khid = ""
}
}
})
},
async khSearch() {
await this.getKh()
},
openView(row) {
this.$axios.post(base + "/platform/ghkh/lssjcx/getData", {zb_id: row.zb_id, union_id: row.union_id}).then(res => {
if (res.code === 0) {
res.data.nrs.forEach(nr => {
nr.bzs.forEach(bz => {
if (bz.zp) {
bz.zpf = bz.zp.zpf
}
if (bz.sh) {
bz.addition = bz.sh.addition
bz.schools = bz.sh.schools
}
})
})
res.data.union_id = row.union_id
res.data.flatname = row.unionname
this.formData = res.data
this.$refs.guava.edit()
}
})
},
doView(nr, bz, row) {
this.dialog = true
this.data = {nr, bz, ...row.zp}
},
getSummaries(param) {
const {columns, data} = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '小计';
return;
} else if (index === 5) {
sums[index] = '';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
if (sums[2]) {
sums[2] = sums[2]
}
if (sums[3]) {
sums[3] = sums[3]
}
if (sums[4]) {
sums[4] = sums[4]
}
} else {
sums[index] = '';
}
});
return sums;
},
pageData() {
this.tabLoading = true
this.$axios.post(base + "/platform/ghkh/lssjcx/pageData", this.pageForm).then(res => {
this.tabLoading = false
if (res.code == 0) {
this.tableData = res.data.list;
this.pageForm.totalCount = res.data.totalCount;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
}).catch(error => {
this.tabLoading = false
});
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
},
async created() {
this.pageData();
this.unions = await getUnions()
this.flushUnits()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,439 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度">
<el-date-picker v-model="pageForm.annual" type="annual" value-format="yyyy" placeholder="请选择"
style="width: 100%"></el-date-picker>
</search-item>
<search-item label="所属工会">
<el-select v-model="pageForm.unionid" @change="doSearch" style="width: 100%"
placeholder="请选择所属工会" clearable>
<el-option v-for="item in unionOptions"
:value="item.id"
:key="item.id"
:label="item.name"
></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card shadow="never" class="mt20">
<table-tool>
<el-radio-group v-model="pageForm.isAudit" size="small" @change="doSearch">
<el-radio-button :label="1">全部</el-radio-button>
<el-radio-button :label="2">已审核</el-radio-button>
<el-radio-button :label="3">未审核</el-radio-button>
</el-radio-group>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id"
@sort-change="pageOrder"
v-loading="tabLoading">
<el-table-column align="center" header-align="center" label="序号"
width="100px">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="年度" prop="annual" header-align="center"
width="300px" sortable
align="center">
<template scope="scope">
{{scope.row.annual}}
</template>
</el-table-column>
<el-table-column label="基层工会名称" prop="unionname" header-align="center"
show-overflow-tooltip
align="center">
<template scope="{row}">
({{row.unioncode}}){{row.unionname}}
</template>
</el-table-column>
<el-table-column label="考核名称" prop="assessment" header-align="center"
show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="标准分" prop="bzf" sortable header-align="center"
show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="自评得分" sortable prop="zp_score" header-align="center"
show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="校工会评分" sortable prop="xgh_score"
header-align="center"
show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="状态" prop="name" header-align="center"
align="center">
<template scope="scope">
<span class="text-warning" v-if="scope.row.state==2">待评分</span>
<span class="text-success"
v-else-if="scope.row.state==3">考核成功</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作"
fixed="right" width="120px">
<template scope="scope">
<el-button size="mini" :disabled="scope.row.state==3" type="primary"
@click="openShGh(scope.row)">评分
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit_func>
<el-button type="primary" style="float: right;margin-top: 5px"
@click="doEdit()">提交
</el-button>
</template>
<template #edit>
<el-form :model="formData" ref="form" label-width="100px" :rules="formRules"
style="height: calc(100vh - 50px);overflow-y: scroll;padding: 10px 15px">
<vi-title title="指标信息"></vi-title>
</el-form-item>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item prop="annual" label="年&emsp;&emsp;度">
<el-date-picker
:picker-options="pickerOptions"
v-model="formData.annual"
type="year"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="flatname" label="分工会名称">
<el-input maxlength="30" value="" readonly
v-model="formData.flatname"
placeholder="请填写分工会名称"
type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="assessment" label="考核名称">
<el-input maxlength="30" readonly v-model="formData.assessment"
placeholder="请填写考核名称"
type="text"></el-input>
</el-form-item>
</el-col>
</el-row>
<vi-title title="考核内容"></vi-title>
</el-form-item>
<el-form-item label="" label-width="0" v-for="nr,idx in formData.nrs">
<el-row type="flex" align="middle" justify="space-between">
<el-input v-model="nr.content" readonly maxlength="30"
style="width: 50%"
placeholder="请填写考核内容">
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
</el-input>
</el-row>
<el-row style="margin-top: 20px">
<el-table :data="nr.bzs" style="width: 100%" border show-summary
:summary-method="getSummaries">
<el-table-column align="center" header-align="center" label="序号"
type="index">
</el-table-column>
<el-table-column label="考核标准" disabled prop="inspection"
header-align="center"
width="250px" align="center">
<template scope="{row}">
<el-input v-model="row.inspection"
readonly placeholder="请填写考核标准"></el-input>
</template>
</el-table-column>
<el-table-column label="标准分" prop="score" header-align="center"
align="center"
width="250px">
<template scope="{row}">
<el-input v-model.number="row.score" readonly maxlength="4"
placeholder="请填写标准分"></el-input>
</template>
</el-table-column>
<el-table-column label="自评得分" prop="zpf" header-align="center"
align="center"
width="250px">
<template scope="{row}">
<el-input v-if="row.zpf" v-model.number="row.zpf"
maxlength="4"
readonly placeholder="请填写自评分"></el-input>
<el-input v-else value="暂无" maxlength="4"
readonly></el-input>
</template>
</el-table-column>
<el-table-column label="校工会评分" prop="schools" header-align="center"
align="center"
width="250px">
<template scope="{row}">
<el-input v-model.number="row.schools" maxlength="4"
placeholder="请填写评分"></el-input>
</template>
</el-table-column>
<el-table-column label="加、减原因" prop="addition" header-align="center"
align="center"
width="250px">
<template scope="{row}">
<el-input v-model.number="row.addition" maxlength="50"
placeholder="请填写加、减原因"></el-input>
</template>
</el-table-column>
<el-table-column label="有关佐证材料" header-align="center" align="center"
width="250px">
<template scope="{row}">
<el-button type="primary" plain
@click="doView(nr.content,row.inspection,row)">
查看佐证材料
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</el-form-item>
</el-form>
</template>
</guava>
<el-drawer
:visible.sync="dialog"
direction="rtl" size="40%"
custom-class="demo-drawer"
ref="drawer">
<div class="demo-drawer__content" style="padding: 0 15px">
<upload-materials :data="data" :is_view="true"></upload-materials>
</div>
</el-drawer>
</div>
<script>
window.vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unions: [],
unionOptions: [],
ghPageForm: {},
v: 'index',
tabLoading: false,
tableData: [],
showGh: true,
formData: {},
dialog: false,
loading: false,
pageForm: {
annual: moment().format('YYYY'),
isAudit: 3,
pageNumber: 1,
pageSize: 10,
totalCount: 0,
year: new Date().getFullYear() + ""
},
formRules: {
schools: [{required: true, message: '请填写分数', trigger: ['blur', 'change']}],
addition: [{required: true, message: '请填写原因', trigger: ['blur', 'change']}],
},
data: {},
row: {},
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
}
},
components: {
'upload-materials': httpVueLoader('/components/module/kh/UploadMaterials.vue')
},
methods: {
async getKh() {
this.$axios.post("/platform/ghkh/khph/getKh", {"annual": this.pageForm.annual}).then(res => {
if (res.code === 0) {
if (res.data.length != 0) {
this.kh = res.data
this.pageForm.khid = this.kh[0].id
} else {
this.kh = []
this.pageForm.khid = ""
}
}
})
},
async khSearch() {
await this.getKh()
},
doEdit() {
let arr = []
this.formData.nrs.forEach(n => {
let zp
n.bzs.forEach(b => {
if (b.zp) {
zp = {
"zb_id": this.formData.id,
"nr_id": n.id,
"bz_id": b.id,
"flatid": this.formData.union_id,
"schools": b.schools,
"addition": b.addition
}
} else {
zp = {
"zb_id": this.formData.id,
"nr_id": n.id,
"bz_id": b.id,
"flatid": this.formData.union_id
}
}
arr.push(zp)
})
})
const loading = this.$loading({
lock: true,
text: '数据提交中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
this.$axios.post(base + "/platform/ghkh/xghsh/marking", {pf: JSON.stringify(arr)}).then(res => {
if (res.code == 0) {
this.$refs.guava.index()
this.pageData()
this.$message.success(res.msg)
} else {
this.$message({
message: "请给总部工会评分",
type: 'error'
});
}
loading.close()
}).catch(error => {
loading.close()
})
},
doView(nr, bz, row) {
this.dialog = true
this.data = {nr, bz, ...row.zp}
},
getSummaries(param) {
const {columns, data} = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '小计';
return;
} else if (index === 5) {
sums[index] = '';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += ' 分';
} else {
sums[index] = '';
}
});
return sums;
},
openShGh(row) {
this.$axios.post(base + "/platform/ghkh/xghsh/getData", {
zb_id: row.zb_id,
union_id: row.union_id
}).then(res => {
if (res.code === 0) {
res.data.nrs.forEach(nr => {
nr.bzs.forEach(bz => {
if (bz.zp) {
bz.zpf = bz.zp.zpf
}
})
})
res.data.union_id = row.union_id
res.data.flatname = row.unionname
this.formData = res.data
}
})
this.$refs.guava.edit()
},
pageData() {
this.tabLoading = true
this.$axios.post(base + "/platform/ghkh/xghsh/pageData", this.pageForm).then(res => {
this.tabLoading = false
if (res.code == 0) {
this.tableData = res.data.list;
this.pageForm.totalCount = res.data.totalCount;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
}).catch(error => {
this.tabLoading = false
});
},
},
async created() {
this.pageData();
//工会查询
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,111 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-card__header {
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<template #header>
<div>
<h3 style="color: #1867b0">新建考核指标</h3>
</div>
<div>
<el-button type="primary" @click="doAdd()">
提交
</el-button>
</div>
</template>
<template>
<kh-zb :form_data="formData" @change="v=>{this.formData=v}"></kh-zb>
</template>
</el-card>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
data() {
return {
v: 'index',
formData: {},
}
},
components: {
'kh-zb': httpVueLoader('/components/module/kh/KhZb.vue?v=' + moment(new Date()).unix()),
},
methods: {
doAdd() {
let flag = true
if (!this.formData.annual) {
this.$message({
message: "年度不能为空",
type: 'error'
})
return
}
if (!this.formData.assessment) {
this.$message({
message: "考核名称不能为空",
type: 'error'
})
return
}
this.formData.nrs.forEach(nr => {
nr.bzs.forEach(bz => {
if (!nr.content) {
this.$message({
message: "考核内容不能为空",
type: 'error'
})
flag = false;
throw Error()
} else if (!bz.inspection) {
this.$message({
message: "考核标准不能为空",
type: 'error'
})
flag = false;
throw Error()
}
})
})
if (this.formData.fillTimeRange && this.formData.fillTimeRange.length === 2) {
this.formData.startDateTime = this.formData.fillTimeRange[0];
this.formData.endDateTime = this.formData.fillTimeRange[1];
}
if (this.formData.appealTimeRange && this.formData.appealTimeRange.length === 2) {
this.formData.startApplyTime = this.formData.appealTimeRange[0];
this.formData.endApplyTime = this.formData.appealTimeRange[1];
}
if (flag) {
this.$axios.post(base + "/platform/ghkh/Xjkhzb/doAdd", {kh_zb: JSON.stringify(this.formData)}).then(res => {
if (res.code === 0) {
sublime.jumpPagePjax('/platform/ghkh/khzb')
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
}
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,819 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
/* #app {
height: 100%;
overflow-y: unset !important;
}
.el-form {
height: calc(100vh - 100px) !important;
}*/
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度">
<el-date-picker
@change="khSearch"
:picker-options="pickerOptions"
v-model="pageForm.annual"
type="year"
value-format="yyyy"
placeholder="选择年度"
style="width: 100%">
</el-date-picker>
</search-item>
<search-item label="考核名称">
<el-input
v-model="pageForm.assessment"
placeholder="根据考核名称关键字查询"
clearable
style="width: 100%">
</el-input>
</search-item>
</search>
</el-card>
<el-card shadow="never" class="mt20">
<el-table :data="tableData" style="width: 100%" row-key="id"
v-loading="tabLoading">
<el-table-column align="center" header-align="center" label="序号" width="100px">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="年度" prop="annual" header-align="center" width="300px" sortable
align="center">
<template scope="scope">
{{scope.row.annual}}
</template>
</el-table-column>
<el-table-column label="考核名称" prop="assessment" header-align="center" show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="填报时间" width="300px" header-align="center" show-overflow-tooltip align="center">
<template scope="scope">
<span>{{scope.row.startdatetime}} - {{scope.row.enddatetime}}</span>
</template>
</el-table-column>
<el-table-column label="状态" prop="name" header-align="center"
align="center">
<template scope="scope">
<span class="text-info" v-if="!scope.row.state">未自评</span>
<span class="text-success" v-if="scope.row.state==1">自评中</span>
<span class="text-warning" v-if="scope.row.state==2">待总部工会评分</span>
<span class="text-success" v-if="scope.row.state==3">考核成功</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="250px">
<template scope="scope">
<el-button size="mini" type="primary" v-if="scope.row.state" @click="openView(scope.row)">查看
</el-button>
<el-button size="mini" type="primary" @click="openAdd(scope.row)"
v-if="!scope.row.state">
自评
</el-button>
<el-button size="mini" type="primary" @click="openEdit(scope.row)"
v-if="scope.row.state==1||scope.row.state==2">
修改
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit_func>
<el-button type="primary"
style="float: right;margin-top: 5px;margin-left: 10px;"
@click="doSaveOrSubmit('submit')">提交
</el-button>
<el-button type="primary" plain style="float: right;margin-top: 5px"
@click="doSaveOrSubmit('save')">
保存
</el-button>
</template>
<template #edit>
<el-form :model="formData" ref="form" label-width="100px"
style="height: calc(100vh - 50px);overflow-y: scroll;padding: 10px 15px">
<table-tool label="联系信息"></table-tool>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item prop="userName" label="填报人">
<el-input maxlength="30" readonly v-model="formData.userName" placeholder="填报人"
type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="mobile" label="联系方式">
<el-input maxlength="30" readonly v-model="formData.mobile" placeholder="联系方式"
type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="fillTime" label="填报时间">
<el-date-picker style="width: 100%"
v-model="formData.fillTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择填报时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<table-tool label="指标信息"></table-tool>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item prop="annual" label="年&emsp;&emsp;度">
<el-date-picker
style="width: 100%"
@change="khSearch"
:picker-options="pickerOptions"
v-model="formData.annual"
type="year"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="assessment" label="考核名称">
<el-input maxlength="30" readonly v-model="formData.assessment" placeholder="请填写考核名称"
type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="unionName" label="分工会名称">
<el-input maxlength="30" readonly v-model="formData.unionName" placeholder="请填写分工会名称"
type="text"></el-input>
</el-form-item>
</el-col>
</el-row>
<table-tool label="考核内容"></table-tool>
<el-form-item label="" label-width="0" v-for="nr,idx in formData.nrs" :key="nr.id">
<el-row type="flex" align="middle" justify="space-between">
<el-input v-model="nr.content" readonly maxlength="30" style="width: 50%">
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
</el-input>
</el-row>
<el-row style="margin-top: 20px">
<el-table :data="nr.bzs" style="width: 100%" border show-summary
:summary-method="getSummaries">
<el-table-column align="center" header-align="center" label="序号" type="index"
width="100px">
</el-table-column>
<el-table-column label="考核标准" disabled prop="inspection" header-align="center"
align="center">
<template scope="{row}">
<el-input v-model="row.inspection"
readonly></el-input>
</template>
</el-table-column>
<el-table-column label="单项分" prop="single_score" header-align="center" align="center"
width="250px">
<template scope="{row}">
<el-input v-model.number="row.single_score" readonly maxlength="4"></el-input>
</template>
</el-table-column>
<el-table-column label="标准分" prop="score" header-align="center" align="center"
width="250px">
<template scope="{row}">
<el-input v-model.number="row.score" readonly maxlength="4"></el-input>
</template>
</el-table-column>
<el-table-column label="自评得分" prop="zp.zpf" header-align="center" align="center"
width="250px">
<template slot-scope="{row}">
<el-input v-model.number="row.zp.zpf" maxlength="4"
@input="(val)=>{onInputZpf(val,row)}"
placeholder="请填写自评分">
<template #append v-if="row.bz_relation_id">
<el-button @click="calcScore(row)" icon="el-icon-paperclip"></el-button>
</template>
</el-input>
</template>
</el-table-column>
<!-- <el-table-column label="能否超过标准分" prop="beyond_highestscore" header-align="center" align="center"-->
<!-- width="200px">-->
<!-- <template scope="{row}">-->
<!-- <span v-if="row.beyond_highestscore" class="text-primary">能</span>-->
<!-- <span v-else class="text-danger">否</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="上传有关佐证材料" header-align="center" align="center"
width="250px">
<template scope="props">
<el-button type="primary" plain :disabled="!props.row.isEvidence"
@click="upload(nr.content,props.row.inspection,props.row,props.$index,idx)">
上传佐证材料
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</el-form-item>
</el-form>
</template>
<template #view>
<el-form :model="formData" ref="form" label-width="100px"
style="height: calc(100vh - 50px);overflow-y: scroll;padding: 10px 15px">
<vi-title title="指标信息"></vi-title>
</el-form-item>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item prop="annual" label="年&emsp;&emsp;度">
<el-date-picker
@change="khSearch"
:picker-options="pickerOptions"
v-model="formData.annual"
type="year"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="assessment" label="考核名称">
<el-input maxlength="30" readonly v-model="formData.assessment" placeholder="请填写考核名称"
type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="unionId" label="分工会名称">
<el-input maxlength="30" readonly v-model="formData.unionId" placeholder="请填写分工会名称"
type="text"></el-input>
</el-form-item>
</el-col>
</el-row>
<vi-title title="考核内容"></vi-title>
</el-form-item>
<el-form-item label="" label-width="0" v-for="nr,idx in formData.nrs" :key="nr.id">
<el-row type="flex" align="middle" justify="space-between">
<el-input v-model="nr.content" readonly maxlength="30" style="width: 50%"
placeholder="请填写考核内容">
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
</el-input>
</el-row>
<el-row style="margin-top: 20px">
<el-table :data="nr.bzs" style="width: 100%" border show-summary
:summary-method="getSummaries">
<el-table-column align="center" header-align="center" label="序号" type="index">
</el-table-column>
<el-table-column label="考核标准" disabled prop="inspection" header-align="center"
align="center">
<template scope="{row}">
<el-input v-model="row.inspection"
readonly placeholder="请填写考核标准"></el-input>
</template>
</el-table-column>
<el-table-column label="标准分" prop="score" header-align="center" align="center"
width="250px">
<template scope="{row}">
<el-input v-model.number="row.score" readonly maxlength="4"
placeholder="请填写标准分"></el-input>
</template>
</el-table-column>
<el-table-column label="自评得分" prop="zpf" header-align="center" align="center"
width="250px">
<template scope="{row}">
<el-input v-if="row.zpf" v-model.number="row.zpf" maxlength="4"
readonly placeholder="请填写自评分"></el-input>
<el-input v-else value="暂无" maxlength="4"
readonly></el-input>
</template>
</el-table-column>
<el-table-column label="有关佐证材料" header-align="center" align="center"
width="250px">
<template scope="{row}">
<el-button type="primary" :disabled="!row.zp||!row.zp.zpf||!row.isEvidence"
plain
@click="viewUpload(nr.content,row.inspection,row)">
查看佐证材料
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</el-form-item>
</el-form>
</template>
</guava>
<el-drawer
:visible.sync="dialog"
:show-close="false"
direction="rtl" size="40%"
custom-class="demo-drawer" :before-close="()=>{addForm()}"
ref="drawer">
<div class="demo-drawer__content" style="padding: 0 15px">
<upload-materials :data="data"></upload-materials>
<div class="demo-drawer__footer" style="float: right">
<el-popover
placement="top"
width="160"
v-model="visible">
<p>您确定要返回吗?返回将不能保存!</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="cancelForm">确定</el-button>
</div>
<el-button slot="reference">返 回</el-button>
</el-popover>
<!-- <el-button @click="cancelForm">取 消</el-button>-->
<el-button type="primary" @click="addForm">确 定</el-button>
</div>
</div>
</el-drawer>
<el-drawer
:visible.sync="dialog_view"
direction="rtl" size="40%"
custom-class="demo-drawer"
ref="drawer">
<div class="demo-drawer__content" style="padding: 0 15px">
<upload-materials :data="data" :is_view="true"></upload-materials>
</div>
</el-drawer>
<calcscore-table :relation_year="relationYear"
:show_modal.sync="calcSoreTableModal"
@get_table_data="autoFillScore">
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
visible: false,
fileList: [],
v: 'index',
tableData: [],
formData: {},
dialog: false,
dialog_view: false,
loading: false,
pageForm: {
annual: moment().format('YYYY'),
pageNumber: 1,
pageSize: 10,
totalCount: 0,
},
data: {bz: '', clnrs: null, nr: ''},
row: {},
index: "",
idx: "",
addFormData: [],
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
relationYear: {},
calcSoreTableModal: false,
current_bz_id: ''
}
},
filters: {
none2str(val) {
return val ? val : '暂无'
}
},
components: {
'upload-materials': httpVueLoader('/components/module/kh/UploadMaterials.vue'),
'calcscore-table': httpVueLoader('/components/module/kh/CalcScoreTab.vue?ver=' + Math.random()),
},
methods: {
goBack() {
this.pageData()
this.$refs.guava.index()
},
//计算得分
async calcScore(row) {
this.current_bz_id = row.id
this.calcSoreTableModal = true
this.relationYear = {year: this.formData.annual, bz_relation_id: row.bz_relation_id}
},
autoFillScore(scoreTable) {
this.formData.nrs.some(nr => {
nr.bzs.some(v => {
if (v.id === this.current_bz_id) {
this.$set(v, 'clnr', this.renderScoreTable(v.bz_relation_id, scoreTable))
if (scoreTable.length * v.single_score > Number(v.score) && !v.beyond_highestscore) {
this.$message.warning('自评得分不能超过标准分!')
this.$set(v.zp, 'zpf', v.score)
return true
}
if (this.relationYear.bz_relation_id === "Performance") {
let single_score = 0
scoreTable.map(v => {
single_score += v.integral
})
this.$set(v.zp, 'zpf', single_score)
}else if(['proposal','ConandDif'].includes(this.relationYear.bz_relation_id)){
let single_score = 0
if(Number(v.single_score)!==0&&scoreTable.length!==0){
single_score=Number(v.single_score)*scoreTable.length
}
this.$set(v.zp, 'zpf', single_score)
} else {
this.$set(v.zp, 'zpf', scoreTable.length * v.single_score)
}
return true
}
})
})
},
//自定义材料内容
renderScoreTable(relation_id, score_data) {
if (score_data) {
let res = ''
switch (relation_id) {
case 'proposal':
score_data.map((v, i) => {
res += (i + 1) + ' .提案人:' + v.username + ',提案名称:' + v.proposalName + ';\n'
})
return res
case 'secteameet':
score_data.map((v, i) => {
res += (i + 1) + ' .申请人:' + v.username + ',会议名称:' + v.meeting_name + ';\n'
})
return res
case 'ConandDif':
score_data.map((v, i) => {
res += (i + 1) + ' .被慰问/补助人:' + v.be_username + ',慰问/补助类型:' + v.typename + ';\n'
})
return res
case 'Performance':
score_data.map((v, i) => {
res += (i + 1) + ' .在:' + v.activityName + '届运动会中,' + v.eventName + '项目获得了地' + v.ranking + '名;\n'
})
return res
default:
return ''
}
}
return ''
},
onInputZpf(v, row) {
if (Number(v) > Number(row.score) && !row.beyond_highestscore) {
row.zp.zpf = Number(row.score)
this.$message.warning('自评得分不能超过标准分!')
}
},
async doSaveOrSubmit(v) {
const params = []
this.formData.nrs.forEach(n => {
n.bzs.forEach(b => {
params.push({
"zb_id": this.formData.id, "nr_id": n.id,
"bz_id": b.id, "clnr": b.zp.clnr, "zpf": b.zp.zpf, "files": b.zp.files,
"id": b.zp.id ? b.zp.id : null
})
})
})
const loading = this.$loading({
lock: true,
text: '数据提交中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
this.$axios.post(base + "/platform/ghkh/zp/doHandler", {
zp: JSON.stringify(params),
handletype: v
}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
} else {
this.$message.error(res.msg)
}
loading.close()
if (v === 'submit') {
this.$refs.guava.index()
return
}
this.$axios.post(base + '/platform/ghkh/zp/openView', {id: this.formData.id}).then(resa => {
this.$nextTick(() => {
this.formData = resa.data
})
})
}).catch(error => {
loading.close()
})
},
async getKh() {
this.$axios.post("/platform/ghkh/khph/getKh", {"annual": this.pageForm.annual}).then(res => {
if (res.code === 0) {
if (res.data.length != 0) {
this.kh = res.data
this.pageForm.khid = this.kh[0].id
} else {
this.kh = []
this.pageForm.khid = ""
}
}
})
},
async khSearch() {
await this.getKh()
},
viewUpload(nr, bz, row) {
this.data = {nr, bz, clnr: row.clnr, ...row.zp}
this.dialog_view = true
},
upload(nr, bz, row, index, idx) {
this.dialog = true
if (row.zp) {
this.data = {nr, bz, clnr: row.clnr, ...row.zp}
} else {
this.data = {nr, bz, clnr: row.clnr, ...row.zp}
}
this.row = row
this.index = index
this.idx = idx
},
addForm() {
this.formData.nrs[this.idx].bzs[this.index].zp = this.data
this.dialog = false
},
cancelForm() {
this.visible = false
this.loading = false;
this.dialog = false;
},
getSummaries(param) {
const {columns, data} = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '小计';
return;
} else if ([1, 2, 5].includes(index)) {
sums[index] = '';
return;
} else if (index === 4) {
const zpfs = data.map(v => v['zp']['zpf'])
sums[index] = zpfs.reduce((a, b) => {
return a + b;
})
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += ' 分';
} else {
sums[index] = null;
}
});
return sums;
},
pageData() {
this.tabLoading = true
this.$axios.post(base + "/platform/ghkh/zp/pageData", this.pageForm).then(res => {
this.tabLoading = false
if (res.code == 0) {
this.tableData = res.data.list;
this.pageForm.totalCount = res.data.totalCount;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
}).catch(error => {
this.tabLoading = false
});
},
async openAdd(row) {
this.$axios.post(base + "/platform/ghkh/khzb/getZb", {id: row.id}).then(data => {
if (data.code === 0) {
data.data.nrs.forEach(v => {
v.bzs.forEach(x => {
if (!x.zp) {
x.zp = {zpf: 0}
}
})
})
this.formData = data.data
this.formData.userName = this.$store.state.user.username
this.formData.mobile = this.$store.user.mobile
this.formData.unionName = this.$store.state.user.union.name
this.$refs.guava.edit()
}
})
},
async openEdit(row) {
this.$axios.post(base + '/platform/ghkh/zp/openView', {id: row.id}).then(resa => {
if (resa.code === 0) {
this.formData = resa.data
this.$refs.guava.edit()
}
})
},
async doAdd() {
this.addFormData = []
this.formData.nrs.forEach(n => {
let zp = {}
n.bzs.forEach(b => {
if (b.zp) {
zp = {
"zb_id": this.formData.id, "nr_id": n.id,
"bz_id": b.id, "clnr": b.zp.clnr, "zpf": b.zpf, "files": b.zp.files
}
} else {
zp = {"zb_id": this.formData.id, "nr_id": n.id, "bz_id": b.id, "zpf": b.zpf}
}
this.addFormData.push(zp)
})
})
const loading = this.$loading({
lock: true,
text: '数据提交中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
const res = await $.post(base + "/platform/ghkh/zp/doAdd", {zp: JSON.stringify(this.addFormData)})
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
} else {
this.$message.error(res.msg)
}
loading.close()
const resa = await this.$axios.post(base + '/platform/ghkh/zp/openView', {id: this.formData.id})
await this.$nextTick()
this.formData = resa.data
},
doEdit() {
this.formData.nrs.forEach(nr => {
nr.bzs.forEach(bz => {
if (bz.zp) {
bz.zp = {
...bz.zp, "zpf": bz.zpf,
}
}
})
})
const loading = this.$loading({
lock: true,
text: '数据提交中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
this.$axios.post(base + "/platform/ghkh/zp/doEdit", {zb: JSON.stringify(this.formData)}).then(data => {
if (data.code == 0) {
this.pageData()
this.$message.success(data.msg)
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
loading.close()
}).catch(error => {
loading.close()
})
},
subXgh() {
this.formData.nrs.forEach(nr => {
nr.bzs.forEach(bz => {
if (bz.zp) {
bz.zp = {
"bz": bz.zp.bz,
"files": bz.zp.files,
"clnr": bz.zp.clnr,
"zb_id": this.formData.id,
"nr_id": nr.id,
"bz_id": bz.id,
"zpf": bz.zpf
}
} else {
bz.zp = {"zb_id": this.formData.id, "nr_id": nr.id, "bz_id": bz.id, "zpf": bz.zpf}
}
})
})
const loading = this.$loading({
lock: true,
text: '数据提交中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
this.$axios.post(base + "/platform/ghkh/zp/subXgh", {zb: JSON.stringify(this.formData)}).then(data => {
if (data.code == 0) {
this.$refs.guava.index()
this.pageData()
this.$message.success(data.msg)
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
loading.close()
}).catch(error => {
loading.close()
})
},
openView(row) {
this.$axios.post(base + "/platform/ghkh/zp/openView", {id: row.id}).then(res => {
if (res.code === 0) {
res.data.nrs.forEach(nr => {
nr.bzs.forEach(bz => {
if (bz.zp) {
bz.zpf = bz.zp.zpf
bz.clnr = bz.zp.clnr
}
})
})
this.formData = res.data;
}
this.$refs.guava.view()
})
},
},
async created() {
this.pageData();
}
})
</script>
<!--#
}
#-->