commit
This commit is contained in:
@@ -7,6 +7,7 @@ import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.FileService;
|
||||
import io.v.nutz.hd.models.Hd_wm_sbxx;
|
||||
import io.v.nutz.hd.models.Hd_wm_xx;
|
||||
import io.v.nutz.hd.services.HdWmLbService;
|
||||
import io.v.nutz.hd.services.HdWmZplbService;
|
||||
import io.v.nutz.hd.services.HdWmsbxxService;
|
||||
@@ -21,6 +22,7 @@ import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.AdaptBy;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
@@ -69,17 +71,27 @@ public class HdJzgAddZpController {
|
||||
public Object doSubmit(@Param("data") String data, @Param(value = "file", required = false) TempFile[] files, boolean flag) {
|
||||
try {
|
||||
Hd_wm_sbxx sbxx = Json.fromJson(Hd_wm_sbxx.class, data);
|
||||
Result checkResult = checkActivityTime(sbxx);
|
||||
if (checkResult != null) {
|
||||
return checkResult;
|
||||
}
|
||||
sbxx.setHdsbrid(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
sbxx.setHdsbsj(DateUtil.getDateTime());
|
||||
sbxx.setAuditState(flag ? "4400" : "3999");
|
||||
sbxx.setAuditState("4400");
|
||||
Hd_wm_sbxx insert = hdWmsbxxService.insert(sbxx);
|
||||
|
||||
for (TempFile file : files) {
|
||||
fileService.upload(file, insert.getId(), "/hd/hdwm/");
|
||||
if (files != null) {
|
||||
for (TempFile file : files) {
|
||||
if (file != null) {
|
||||
fileService.upload(file, insert.getId(), "/hd/hdwm/");
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.success().addMsg("上传成功!");
|
||||
} catch (Exception e) {
|
||||
return Result.error().addMsg("上传失败!");
|
||||
e.printStackTrace();
|
||||
String message = Strings.isBlank(e.getMessage()) ? e.getClass().getSimpleName() : e.getMessage();
|
||||
return Result.error("上传失败:" + message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,22 +101,72 @@ public class HdJzgAddZpController {
|
||||
public Object doEdit(@Param("data") String data, String readytodelfile, @Param(value = "file", required = false) TempFile[] files, boolean flag) {
|
||||
try {
|
||||
Hd_wm_sbxx sbxx = Json.fromJson(Hd_wm_sbxx.class, data);
|
||||
sbxx.setAuditState(flag ? "4400" : "3999");
|
||||
Result checkResult = checkActivityTime(sbxx);
|
||||
if (checkResult != null) {
|
||||
return checkResult;
|
||||
}
|
||||
sbxx.setAuditState("4400");
|
||||
hdWmsbxxService.updateIgnoreNull(sbxx);
|
||||
|
||||
List<String> dellist = Json.fromJsonAsList(String.class, readytodelfile);
|
||||
for (String f : dellist) {
|
||||
fileService.delete(f, f);
|
||||
if (Strings.isNotBlank(readytodelfile)) {
|
||||
List<String> dellist = Json.fromJsonAsList(String.class, readytodelfile);
|
||||
for (String f : dellist) {
|
||||
fileService.delete(f, f);
|
||||
}
|
||||
}
|
||||
for (TempFile file : files) {
|
||||
fileService.upload(file, sbxx.getId(), "/hd/hdwm/");
|
||||
if (files != null) {
|
||||
for (TempFile file : files) {
|
||||
if (file != null) {
|
||||
fileService.upload(file, sbxx.getId(), "/hd/hdwm/");
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.success().addMsg("修改成功!");
|
||||
} catch (Exception e) {
|
||||
return Result.error().addMsg("上传失败!");
|
||||
e.printStackTrace();
|
||||
String message = Strings.isBlank(e.getMessage()) ? e.getClass().getSimpleName() : e.getMessage();
|
||||
return Result.error("上传失败:" + message);
|
||||
}
|
||||
}
|
||||
|
||||
private Result checkActivityTime(Hd_wm_sbxx sbxx) throws Exception {
|
||||
if (sbxx == null) {
|
||||
return Result.error("操作失败:未接收到作品信息,请重新填写后提交!");
|
||||
}
|
||||
String hdid = sbxx.getHdid();
|
||||
if (Strings.isBlank(hdid) && Strings.isNotBlank(sbxx.getId())) {
|
||||
Hd_wm_sbxx old = hdWmsbxxService.fetch(sbxx.getId());
|
||||
hdid = old == null ? null : old.getHdid();
|
||||
}
|
||||
if (Strings.isBlank(hdid)) {
|
||||
return Result.error("操作失败:缺少活动信息,请重新进入活动页面提交!");
|
||||
}
|
||||
Hd_wm_xx hd = baseService.dao().fetch(Hd_wm_xx.class, hdid);
|
||||
if (hd == null) {
|
||||
return Result.error("操作失败:活动不存在,请刷新后重试!");
|
||||
}
|
||||
if (!Boolean.TRUE.equals(hd.getHdflag())) {
|
||||
return Result.error("操作失败:当前活动未开启!");
|
||||
}
|
||||
Date startTime = parseActivityTime(hd.getHdkssj());
|
||||
Date endTime = parseActivityTime(hd.getHdjssj());
|
||||
Date now = new Date();
|
||||
if (startTime == null || endTime == null || now.before(startTime) || now.after(endTime)) {
|
||||
return Result.error("操作失败:不在活动时间范围内!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Date parseActivityTime(String time) throws Exception {
|
||||
if (Strings.isBlank(time)) {
|
||||
return null;
|
||||
}
|
||||
String pattern = time.trim().length() <= 10 ? "yyyy-MM-dd" : "yyyy-MM-dd HH:mm:ss";
|
||||
SimpleDateFormat format = new SimpleDateFormat(pattern);
|
||||
format.setLenient(false);
|
||||
return format.parse(time.trim());
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@@ -120,6 +182,7 @@ public class HdJzgAddZpController {
|
||||
sbr.username AS sbrname,
|
||||
sbr.loginname,
|
||||
hd.hdname,
|
||||
hd.hdflag,
|
||||
hd.hdkssj,
|
||||
hd.hdjssj,
|
||||
dw.name as dwname,
|
||||
|
||||
@@ -11,6 +11,7 @@ import io.v.nutz.base.utils.Office2Pdf;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.hd.models.Hd_wm_sbxx;
|
||||
import io.v.nutz.hd.models.Hd_wm_xx;
|
||||
import io.v.nutz.hd.services.HdWmLbService;
|
||||
import io.v.nutz.hd.services.HdWmZplbService;
|
||||
import io.v.nutz.hd.services.HdWmsbxxService;
|
||||
@@ -55,6 +56,7 @@ import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -350,7 +352,7 @@ public class HdWmInfoController {
|
||||
cnd.andEX("xx.hdzplx2", "=", zplb);
|
||||
cnd.andEX("u.unionid", "=", union);
|
||||
cnd.andEX("u.unitid", "=", unit);
|
||||
cnd.andEX("xx.auditState", "=", 4400);
|
||||
cnd.andEX("xx.auditState", "=", stateId);
|
||||
cnd.andEX("xx.isExcellent", "=", isExcellent);
|
||||
if (!ShiroUtil.hasRole("A06") && !ShiroUtil.hasRole("sysadmin")) {
|
||||
if (ShiroUtil.hasRole("H04")) {
|
||||
@@ -690,12 +692,50 @@ public class HdWmInfoController {
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
public Object doDelete(String id) {
|
||||
public Object doDelete(String id) throws Exception {
|
||||
Result checkResult = checkActivityTimeByWorkId(id);
|
||||
if (checkResult != null) {
|
||||
return checkResult;
|
||||
}
|
||||
dao.clear(Hd_wm_sbxx.class, Cnd.where("id", "=", id));
|
||||
dao.clear(Sys_file.class, Cnd.where("reid", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
private Result checkActivityTimeByWorkId(String id) throws Exception {
|
||||
if (Strings.isBlank(id)) {
|
||||
return Result.error("删除失败:缺少作品信息!");
|
||||
}
|
||||
Hd_wm_sbxx sbxx = dao.fetch(Hd_wm_sbxx.class, id);
|
||||
if (sbxx == null) {
|
||||
return Result.error("删除失败:作品不存在或已删除!");
|
||||
}
|
||||
Hd_wm_xx hd = dao.fetch(Hd_wm_xx.class, sbxx.getHdid());
|
||||
if (hd == null) {
|
||||
return Result.error("删除失败:活动不存在,请刷新后重试!");
|
||||
}
|
||||
if (!Boolean.TRUE.equals(hd.getHdflag())) {
|
||||
return Result.error("删除失败:当前活动未开启!");
|
||||
}
|
||||
Date startTime = parseActivityTime(hd.getHdkssj());
|
||||
Date endTime = parseActivityTime(hd.getHdjssj());
|
||||
Date now = new Date();
|
||||
if (startTime == null || endTime == null || now.before(startTime) || now.after(endTime)) {
|
||||
return Result.error("删除失败:不在活动时间范围内!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Date parseActivityTime(String time) throws Exception {
|
||||
if (Strings.isBlank(time)) {
|
||||
return null;
|
||||
}
|
||||
String pattern = time.trim().length() <= 10 ? "yyyy-MM-dd" : "yyyy-MM-dd HH:mm:ss";
|
||||
SimpleDateFormat format = new SimpleDateFormat(pattern);
|
||||
format.setLenient(false);
|
||||
return format.parse(time.trim());
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("hd.wmhd.zpxx1")
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.v.nutz.hd.controller.wmhd.mobile;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.utils.FileService;
|
||||
import io.v.nutz.hd.models.Hd_wm_sbxx;
|
||||
import io.v.nutz.hd.models.Hd_wm_xx;
|
||||
import io.v.nutz.hd.services.HdWmsbxxService;
|
||||
import io.v.nutz.hd.services.HdWmsbxxfjService;
|
||||
import io.v.nutz.sys.services.SysUserService;
|
||||
@@ -13,6 +14,7 @@ import org.nutz.dao.entity.Record;
|
||||
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.AdaptBy;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
@@ -21,7 +23,8 @@ import org.nutz.mvc.upload.TempFile;
|
||||
import org.nutz.mvc.upload.UploadAdaptor;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -81,21 +84,70 @@ public class StaffActivitiesCon {
|
||||
@RequiresAuthentication
|
||||
public Object doSubmit(@Param("..") Hd_wm_sbxx sbxx, @Param("files") TempFile[] files, boolean flag) {
|
||||
try {
|
||||
String path = new File("").getCanonicalPath();
|
||||
sbxx.setAuditState(flag ? "4400" : "3999");
|
||||
// 上传入口先校验核心参数,避免主表未落库时前端只能看到笼统失败提示。
|
||||
if (sbxx == null) {
|
||||
return Result.error("上传失败:未接收到作品信息,请重新填写后提交!");
|
||||
}
|
||||
if (Strings.isBlank(sbxx.getHdid())) {
|
||||
return Result.error("上传失败:缺少活动信息,请重新进入活动页面提交!");
|
||||
}
|
||||
if (Strings.isBlank(sbxx.getHdsbrid())) {
|
||||
return Result.error("上传失败:缺少上传人信息,请重新登录后提交!");
|
||||
}
|
||||
Result checkResult = checkActivityTime(sbxx.getHdid());
|
||||
if (checkResult != null) {
|
||||
return checkResult;
|
||||
}
|
||||
sbxx.setAuditState("4400");
|
||||
Hd_wm_sbxx insert = hdWmsbxxService.insert(sbxx);
|
||||
if (insert == null || Strings.isBlank(insert.getId())) {
|
||||
return Result.error("上传失败:作品信息保存失败,请重新提交!");
|
||||
}
|
||||
|
||||
// 保存时可能没有上传附件,避免空文件数组导致提交接口异常。
|
||||
if (files != null) {
|
||||
for (TempFile file : files) {
|
||||
fileService.upload(file, insert.getId(), "/hd/hdwm/");
|
||||
if (file != null) {
|
||||
fileService.upload(file, insert.getId(), "/hd/hdwm/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Result.success().addMsg("上传成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error().addMsg("上传失败!");
|
||||
String message = Strings.isBlank(e.getMessage()) ? e.getClass().getSimpleName() : e.getMessage();
|
||||
return Result.error("上传失败:" + message);
|
||||
}
|
||||
}
|
||||
|
||||
private Result checkActivityTime(String hdid) throws Exception {
|
||||
if (Strings.isBlank(hdid)) {
|
||||
return Result.error("上传失败:缺少活动信息,请重新进入活动页面提交!");
|
||||
}
|
||||
Hd_wm_xx hd = hdWmsbxxService.dao().fetch(Hd_wm_xx.class, hdid);
|
||||
if (hd == null) {
|
||||
return Result.error("上传失败:活动不存在,请刷新后重试!");
|
||||
}
|
||||
if (!Boolean.TRUE.equals(hd.getHdflag())) {
|
||||
return Result.error("上传失败:当前活动未开启!");
|
||||
}
|
||||
Date startTime = parseActivityTime(hd.getHdkssj());
|
||||
Date endTime = parseActivityTime(hd.getHdjssj());
|
||||
Date now = new Date();
|
||||
if (startTime == null || endTime == null || now.before(startTime) || now.after(endTime)) {
|
||||
return Result.error("上传失败:不在活动时间范围内!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Date parseActivityTime(String time) throws Exception {
|
||||
if (Strings.isBlank(time)) {
|
||||
return null;
|
||||
}
|
||||
String pattern = time.trim().length() <= 10 ? "yyyy-MM-dd" : "yyyy-MM-dd HH:mm:ss";
|
||||
SimpleDateFormat format = new SimpleDateFormat(pattern);
|
||||
format.setLenient(false);
|
||||
return format.parse(time.trim());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,11 +38,11 @@ layout("/mobile/platform.html"){
|
||||
v-model="mLoading">
|
||||
|
||||
<div @click.stop="openView(o)" class="list-card" v-for="o in tableData">
|
||||
<van-swipe-cell :disabled="o.auditstate!=='3999'">
|
||||
<van-swipe-cell :disabled="!isActivityTime(o)">
|
||||
<van-cell-group inset>
|
||||
<image @click.stop="openEdit(o.id,o.hdid)" class="register-icon"
|
||||
src="/assets/mobile/svg/wmhd/bianji.svg"
|
||||
v-if="o.auditstate==='3999'||o.auditstate==='4100'||o.auditstate==='4250'"></image>
|
||||
v-if="isActivityTime(o)"></image>
|
||||
<van-cell :border="false" title="姓名">{{o.sbrname}}</van-cell>
|
||||
<van-cell :border="false" title="工号">{{o.loginname}}</van-cell>
|
||||
<van-cell :border="false" title="单位">{{o.dwname}}</van-cell>
|
||||
@@ -60,7 +60,7 @@ layout("/mobile/platform.html"){
|
||||
</van-cell>-->
|
||||
</van-cell-group>
|
||||
<template #right>
|
||||
<van-button @click="doDelete(o.id)" square style="height: 100%;" text="删除"
|
||||
<van-button @click="doDelete(o)" square style="height: 100%;" text="删除"
|
||||
type="danger"></van-button>
|
||||
</template>
|
||||
</van-swipe-cell>
|
||||
@@ -116,19 +116,34 @@ layout("/mobile/platform.html"){
|
||||
'mobile-wmhd-info': httpVueLoader('/components/mobile/wmhd/info.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
isActivityTime(o) {
|
||||
if (!o || !o.hdflag || !o.hdkssj || !o.hdjssj) {
|
||||
return false
|
||||
}
|
||||
const startTime = new Date(o.hdkssj.replace(/-/g, '/')).getTime()
|
||||
const endTime = new Date(o.hdjssj.replace(/-/g, '/')).getTime()
|
||||
const nowTime = new Date().getTime()
|
||||
return startTime <= nowTime && nowTime <= endTime
|
||||
},
|
||||
openEdit(id, hdid) {
|
||||
window.location.href = '/platform/staffActivities?client=mobile&id=' + hdid + '&zpid=' + id
|
||||
},
|
||||
async doDelete(id) {
|
||||
async doDelete(o) {
|
||||
if (!this.isActivityTime(o)) {
|
||||
vant.Toast('不在活动时间范围内,不能删除')
|
||||
return
|
||||
}
|
||||
const confirm = await vant.Dialog.confirm({
|
||||
title: '提示',
|
||||
message: '确定要删除此次作品吗?',
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const data = await $.post("/platform/hd/wmhd/dodelete", {id: id})
|
||||
const data = await $.post("/platform/hd/wmhd/dodelete", {id: o.id})
|
||||
if (data.code == 0) {
|
||||
await this.yearChange()
|
||||
vant.Toast.success('删除成功');
|
||||
} else {
|
||||
vant.Toast(data.msg || '删除失败')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -481,28 +481,12 @@
|
||||
</van-tabs>
|
||||
|
||||
<div style="margin: 16px;">
|
||||
<van-row gutter="20">
|
||||
<van-col span="12">
|
||||
<van-button :color="boxData.hdcolor" :disabled="subDis"
|
||||
@click="doSubmit(false)" block
|
||||
plain
|
||||
round
|
||||
type="info">
|
||||
保存
|
||||
</van-button>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<van-button :color="boxData.hdcolor" :disabled="subDis"
|
||||
@click="doSubmit(true)" block
|
||||
round
|
||||
type="info">
|
||||
提交
|
||||
</van-button>
|
||||
</van-col>
|
||||
|
||||
</van-row>
|
||||
|
||||
|
||||
<van-button :color="boxData.hdcolor" :disabled="subDis"
|
||||
@click="doSubmit(true)" block
|
||||
round
|
||||
type="info">
|
||||
提交
|
||||
</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
</div>
|
||||
@@ -699,7 +683,7 @@
|
||||
}*/
|
||||
}
|
||||
|
||||
const msg = '您当前选择的是“' + this.boxData.lbs[i].lname + '”,是否确认上传?' + (flag ? '上传后您将不能对已上传的作品进行更改' : '保存后如需提交请到我的作品进行提交')
|
||||
const msg = '您当前选择的是“' + this.boxData.lbs[i].lname + '”,是否确认提交?活动时间内可编辑或删除已提交作品'
|
||||
const confirm = await this.$dialog.confirm({
|
||||
title: '提醒',
|
||||
message: msg
|
||||
@@ -709,6 +693,7 @@
|
||||
this.showMsg = true
|
||||
this.showPlan = true
|
||||
this.percent = 0
|
||||
this.$set(this, 'flag', false)
|
||||
this.msg = ''
|
||||
|
||||
let formData1 = {}
|
||||
@@ -792,22 +777,22 @@
|
||||
Cookies.remove('sa_formData');
|
||||
|
||||
|
||||
vue.msg = '<p class="weui-msg__desc">我们已收到您的作品!<br/>非常感谢您的支持!</p>'
|
||||
this.flag = true
|
||||
vue.$set(vue, 'msg', '<p class="weui-msg__desc">我们已收到您的作品!<br/>非常感谢您的支持!</p>')
|
||||
vue.$set(vue, 'flag', true)
|
||||
location.href = '/mobile/wmhd/list'
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
vue.msg = '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>'
|
||||
this.flag = false
|
||||
vue.$set(vue, 'msg', '<p class="weui-msg__desc">' + (data.msg || '非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!') + '</p>')
|
||||
vue.$set(vue, 'flag', false)
|
||||
}
|
||||
vue.showPlan = false
|
||||
location.href = '/mobile/wmhd/list'
|
||||
vue.$set(vue, 'showPlan', false)
|
||||
},
|
||||
error: function (data) {
|
||||
vue.msg = '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>'
|
||||
this.flag = false
|
||||
vue.showPlan = false
|
||||
vue.$set(vue, 'msg', '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>')
|
||||
vue.$set(vue, 'flag', false)
|
||||
vue.$set(vue, 'showPlan', false)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@@ -842,20 +827,19 @@
|
||||
Cookies.remove('sa_formData');
|
||||
|
||||
|
||||
vue.msg = '<p class="weui-msg__desc">我们已收到您的作品!<br/>非常感谢您的支持!</p>'
|
||||
|
||||
this.flag = true
|
||||
vue.$set(vue, 'msg', '<p class="weui-msg__desc">我们已收到您的作品!<br/>非常感谢您的支持!</p>')
|
||||
vue.$set(vue, 'flag', true)
|
||||
} else {
|
||||
|
||||
vue.msg = '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>'
|
||||
this.flag = false
|
||||
vue.$set(vue, 'msg', '<p class="weui-msg__desc">' + (data.msg || '非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!') + '</p>')
|
||||
vue.$set(vue, 'flag', false)
|
||||
}
|
||||
vue.showPlan = false
|
||||
vue.$set(vue, 'showPlan', false)
|
||||
},
|
||||
error: function (data) {
|
||||
vue.msg = '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>'
|
||||
this.flag = false
|
||||
vue.showPlan = false
|
||||
vue.$set(vue, 'msg', '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>')
|
||||
vue.$set(vue, 'flag', false)
|
||||
vue.$set(vue, 'showPlan', false)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -282,13 +282,13 @@ layout("/layouts/platform.html"){
|
||||
<el-button @click="viewInfo(scope)" size="mini" type="primary">查看
|
||||
</el-button>
|
||||
<!-- v-if="scope.row.auditstate==='3999'||scope.row.auditstate==='4100'||scope.row.auditstate==='4250'"-->
|
||||
<el-button :disabled="scope.row.auditstate!=='3999'"
|
||||
<el-button :disabled="!isActivityTime(scope.row)"
|
||||
@click="openEdit(scope)" size="mini"
|
||||
type="primary">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button :disabled="scope.row.auditstate!=='3999'"
|
||||
@click="dodelete(scope.row.id)"
|
||||
<el-button :disabled="!isActivityTime(scope.row)"
|
||||
@click="dodelete(scope.row)"
|
||||
size="mini"
|
||||
type="danger">删除
|
||||
</el-button>
|
||||
@@ -413,8 +413,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
</el-form>
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="doAdd(false)">保 存</el-button>
|
||||
<el-button @click="doAdd(true)" type="primary">提 交</el-button>
|
||||
<el-button @click="doAdd" type="primary">提 交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -525,8 +524,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
</el-form>
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="doEdit(false)">保 存</el-button>
|
||||
<el-button @click="doEdit(true)" type="primary">提 交</el-button>
|
||||
<el-button @click="doEdit" type="primary">提 交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -616,6 +614,15 @@ layout("/layouts/platform.html"){
|
||||
changeHdzplx2(id) {
|
||||
this.zplb2Config = this.formhdzplblist.find(v => v.zid === id)
|
||||
},
|
||||
isActivityTime(row) {
|
||||
if (!row || !row.hdkssj || !row.hdjssj) {
|
||||
return false;
|
||||
}
|
||||
const startTime = new Date(row.hdkssj.replace(/-/g, '/')).getTime();
|
||||
const endTime = new Date(row.hdjssj.replace(/-/g, '/')).getTime();
|
||||
const nowTime = new Date().getTime();
|
||||
return startTime <= nowTime && nowTime <= endTime;
|
||||
},
|
||||
yearChange(val) {
|
||||
let activityList = []
|
||||
if (val === null) {
|
||||
@@ -743,10 +750,10 @@ layout("/layouts/platform.html"){
|
||||
this.$refs['AddForm'].resetFields();
|
||||
}
|
||||
},
|
||||
doAdd(flag) {
|
||||
doAdd() {
|
||||
this.$refs['AddForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (flag && ((this.zplb2Config.isUploadPhoto && this.picturelist.length === 0) ||
|
||||
if (((this.zplb2Config.isUploadPhoto && this.picturelist.length === 0) ||
|
||||
(this.zplb2Config.isUploadOther && this.vadlist.length === 0) ||
|
||||
(this.zplb2Config.isUploadZip && this.ziplist.length === 0))) {
|
||||
this.$message.warning('请上传您的作品');
|
||||
@@ -759,7 +766,7 @@ layout("/layouts/platform.html"){
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
let formdata = new FormData();
|
||||
formdata.append("flag", flag);
|
||||
formdata.append("flag", true);
|
||||
formdata.append("data", JSON.stringify(this.AddFormData));
|
||||
if(this.picturelist && this.picturelist.length > 0) {
|
||||
this.picturelist.forEach(val => {
|
||||
@@ -789,7 +796,7 @@ layout("/layouts/platform.html"){
|
||||
this.$refs.guava.index()
|
||||
this.$message.success('上传成功');
|
||||
} else {
|
||||
this.$message.error('上传失败');
|
||||
this.$message.error(res.msg || '上传失败');
|
||||
}
|
||||
loading.close();
|
||||
})
|
||||
@@ -797,6 +804,10 @@ layout("/layouts/platform.html"){
|
||||
});
|
||||
},
|
||||
openEdit(scope) {
|
||||
if (!this.isActivityTime(scope.row)) {
|
||||
this.$message.warning('不在活动时间范围内,不能编辑');
|
||||
return;
|
||||
}
|
||||
this.readytodelfile = [];
|
||||
this.picturelist = [];
|
||||
this.vadlist = [];
|
||||
@@ -821,10 +832,10 @@ layout("/layouts/platform.html"){
|
||||
|
||||
|
||||
},
|
||||
doEdit(flag) {
|
||||
doEdit() {
|
||||
this.$refs['EditForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (flag && ((this.zplb2Config.isUploadPhoto && this.picturelist.length === 0) ||
|
||||
if (((this.zplb2Config.isUploadPhoto && this.picturelist.length === 0) ||
|
||||
(this.zplb2Config.isUploadOther && this.vadlist.length === 0) ||
|
||||
(this.zplb2Config.isUploadZip && this.ziplist.length === 0))) {
|
||||
this.$message.warning('请上传您的作品');
|
||||
@@ -838,7 +849,7 @@ layout("/layouts/platform.html"){
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
let formdata = new FormData();
|
||||
formdata.append("flag", flag);
|
||||
formdata.append("flag", true);
|
||||
formdata.append("data", JSON.stringify(this.EditFormData));
|
||||
formdata.append("readytodelfile", JSON.stringify(this.readytodelfile));
|
||||
if(this.picturelist && this.picturelist.length > 0) {
|
||||
@@ -877,7 +888,7 @@ layout("/layouts/platform.html"){
|
||||
this.$refs.guava.index()
|
||||
this.$message.success('上传成功');
|
||||
} else {
|
||||
this.$message.error('上传失败');
|
||||
this.$message.error(res.msg || '上传失败');
|
||||
}
|
||||
loading.close();
|
||||
|
||||
@@ -971,16 +982,22 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
});
|
||||
},
|
||||
dodelete(id) {
|
||||
dodelete(row) {
|
||||
if (!this.isActivityTime(row)) {
|
||||
this.$message.warning('不在活动时间范围内,不能删除');
|
||||
return;
|
||||
}
|
||||
this.$confirm('此操作将永久删除该记录, 确定吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.post('/platform/hd/wmhd/doDelete', {id: id}).then(data => {
|
||||
$.post('/platform/hd/wmhd/doDelete', {id: row.id}).then(data => {
|
||||
if (data.code == 0) {
|
||||
this.doSearch();
|
||||
this.$message.success(data.msg);
|
||||
} else {
|
||||
this.$message.error(data.msg || '删除失败');
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
|
||||
Reference in New Issue
Block a user