增加OA的文号功能
This commit is contained in:
parent
d5d36fc543
commit
82b87ae6e4
@ -1,5 +1,6 @@
|
||||
package ink.wgink.module.activiti.pojo.bos.oa;
|
||||
|
||||
import ink.wgink.module.activiti.pojo.vos.oa.OaDocNoVO;
|
||||
import ink.wgink.module.activiti.pojo.vos.oa.OaFormReportRecordFieldVO;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -38,6 +39,10 @@ public class OaFormReportUnWantedValueBO {
|
||||
* 抄送列表
|
||||
*/
|
||||
private List<String> ccs;
|
||||
/**
|
||||
* 文号列表
|
||||
*/
|
||||
private List<OaDocNoVO> oaDocNos;
|
||||
|
||||
public List<String> getAssignees() {
|
||||
return assignees == null ? new ArrayList() : assignees;
|
||||
@ -86,4 +91,12 @@ public class OaFormReportUnWantedValueBO {
|
||||
public void setCcs(List<String> ccs) {
|
||||
this.ccs = ccs;
|
||||
}
|
||||
|
||||
public List<OaDocNoVO> getOaDocNos() {
|
||||
return oaDocNos == null ? new ArrayList() : oaDocNos;
|
||||
}
|
||||
|
||||
public void setOaDocNos(List<OaDocNoVO> oaDocNos) {
|
||||
this.oaDocNos = oaDocNos;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,42 @@
|
||||
package ink.wgink.module.activiti.pojo.vos.oa;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: OaDocNoVO
|
||||
* @Description: oa文号
|
||||
* @Author: wanggeng
|
||||
* @Date: 2022/7/5 15:34
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class OaDocNoVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4605522411547509429L;
|
||||
private String fieldName;
|
||||
private String docNoId;
|
||||
private String docNoText;
|
||||
|
||||
public String getFieldName() {
|
||||
return fieldName == null ? "" : fieldName.trim();
|
||||
}
|
||||
|
||||
public void setFieldName(String fieldName) {
|
||||
this.fieldName = fieldName;
|
||||
}
|
||||
|
||||
public String getDocNoId() {
|
||||
return docNoId == null ? "" : docNoId.trim();
|
||||
}
|
||||
|
||||
public void setDocNoId(String docNoId) {
|
||||
this.docNoId = docNoId;
|
||||
}
|
||||
|
||||
public String getDocNoText() {
|
||||
return docNoText == null ? "" : docNoText.trim();
|
||||
}
|
||||
|
||||
public void setDocNoText(String docNoText) {
|
||||
this.docNoText = docNoText;
|
||||
}
|
||||
}
|
@ -31,6 +31,10 @@ public interface IOaFormReportService {
|
||||
* 抄送
|
||||
*/
|
||||
String KEY_CCS = "ccs";
|
||||
/**
|
||||
* 文号列表
|
||||
*/
|
||||
String KEY_DOC_NOS = "docNos";
|
||||
String KEY_REASON = "reason";
|
||||
/**
|
||||
* 签批关键字后缀
|
||||
@ -187,6 +191,7 @@ public interface IOaFormReportService {
|
||||
|
||||
/**
|
||||
* 更新任务
|
||||
*
|
||||
* @param token
|
||||
* @param processInstanceId
|
||||
* @param taskId
|
||||
@ -196,6 +201,7 @@ public interface IOaFormReportService {
|
||||
|
||||
/**
|
||||
* 更新任务
|
||||
*
|
||||
* @param userId
|
||||
* @param userName
|
||||
* @param processInstanceId
|
||||
|
@ -12,13 +12,17 @@ import ink.wgink.module.activiti.enums.oa.TaskCommentTypeEnum;
|
||||
import ink.wgink.module.activiti.enums.oa.field.FieldEditRecordEnum;
|
||||
import ink.wgink.module.activiti.pojo.bos.oa.OaFormReportUnWantedValueBO;
|
||||
import ink.wgink.module.activiti.pojo.bos.oa.TaskCommentBO;
|
||||
import ink.wgink.module.activiti.pojo.vos.oa.OaDocNoVO;
|
||||
import ink.wgink.module.activiti.pojo.vos.oa.OaFormReportRecordFieldVO;
|
||||
import ink.wgink.module.activiti.pojo.vos.oa.UpdateTaskAssigneeVO;
|
||||
import ink.wgink.module.activiti.service.activiti.IActivitiModelService;
|
||||
import ink.wgink.module.activiti.service.oa.IOaCcService;
|
||||
import ink.wgink.module.activiti.service.oa.IOaFormReportService;
|
||||
import ink.wgink.module.form.enums.docno.DocNoTypeEnum;
|
||||
import ink.wgink.module.form.pojo.pos.docno.DocNoPO;
|
||||
import ink.wgink.module.form.service.design.IFormDesignService;
|
||||
import ink.wgink.module.form.service.design.IFormFieldService;
|
||||
import ink.wgink.module.form.service.docno.IDocNoService;
|
||||
import ink.wgink.module.form.service.report.IFormReportService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.app.AppTokenUser;
|
||||
@ -68,6 +72,8 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
private IActivitiModelService activitiModelService;
|
||||
@Autowired
|
||||
private IOaCcService formCcService;
|
||||
@Autowired
|
||||
private IDocNoService docNoService;
|
||||
|
||||
@Override
|
||||
public void save(String processDefinitionId, String formCode, Integer formVersion, Map<String, Object> params) {
|
||||
@ -84,7 +90,8 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
@Override
|
||||
public void saveByUserIdAndUserName(String userId, String userName, String processDefinitionId, String formCode, Integer formVersion, Map<String, Object> params) {
|
||||
OaFormReportUnWantedValueBO oaFormReportUnWantedValueBO = getOaFormReportUnWantedValue(params);
|
||||
|
||||
LOG.debug("设置文号");
|
||||
setDocNo(oaFormReportUnWantedValueBO.getOaDocNos(), formCode, formVersion, params);
|
||||
LOG.debug("保存表单");
|
||||
String uid = formReportService.saveByUserIdAndReturnId(userId, formCode, formVersion, params);
|
||||
LOG.debug("定义流程发起人");
|
||||
@ -136,6 +143,8 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
throw new SearchException("任务不存在或已被处理");
|
||||
}
|
||||
OaFormReportUnWantedValueBO oaFormReportUnWantedValueBO = getOaFormReportUnWantedValue(params);
|
||||
LOG.debug("设置文号");
|
||||
setDocNo(oaFormReportUnWantedValueBO.getOaDocNos(), formCode, formVersion, params);
|
||||
formReportService.updateByUserId(userId, formCode, formVersion, uid, params);
|
||||
if (isNeedClaim == 1) {
|
||||
LOG.debug("认领任务");
|
||||
@ -394,6 +403,28 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
taskService.addComment(taskId, processInstanceId, TaskCommentTypeEnum.TRANSFER.getValue(), JSONObject.toJSONString(taskCommentBO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置文号
|
||||
*
|
||||
* @param oaDocNos
|
||||
* @param reportParams
|
||||
*/
|
||||
private void setDocNo(List<OaDocNoVO> oaDocNos, String formCode, Integer formVersion, Map<String, Object> reportParams) {
|
||||
if (oaDocNos.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
oaDocNos.forEach(oaDocNoVO -> {
|
||||
DocNoPO docNoPO = docNoService.getPO(oaDocNoVO.getDocNoId());
|
||||
if (StringUtils.equals(DocNoTypeEnum.MANUAL.getValue(), docNoPO.getType())) {
|
||||
LOG.debug("文号类型为手动生成");
|
||||
reportParams.put(oaDocNoVO.getFieldName() + IFormDesignService.SUFFIX_DOC_NO, oaDocNoVO.getDocNoText());
|
||||
} else {
|
||||
String latestDocNo = docNoService.saveAndReturnLatestDocNo(oaDocNoVO.getDocNoId(), String.format("df_%s_v%d", formCode, formVersion));
|
||||
reportParams.put(oaDocNoVO.getFieldName() + IFormDesignService.SUFFIX_DOC_NO, latestDocNo);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存记录的字段列表
|
||||
*
|
||||
@ -408,14 +439,14 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
if (oaFormReportRecordFieldVOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
String currentTime = DateUtil.getTime();
|
||||
String currentDay = DateUtil.getDay();
|
||||
for (OaFormReportRecordFieldVO oaFormReportRecordFieldVO : oaFormReportRecordFieldVOs) {
|
||||
Object reportRecordObject = reportParams.get(oaFormReportRecordFieldVO.getFieldName());
|
||||
String reportRecordValue = reportRecordObject == null ? "" : reportRecordObject.toString();
|
||||
// 创建批注
|
||||
if (StringUtils.equals(oaFormReportRecordFieldVO.getEditHistory(), FieldEditRecordEnum.LATEST.getValue())) {
|
||||
// 签批批注,存入流程变量
|
||||
reportParams.put(oaFormReportRecordFieldVO.getFieldName() + EDIT_SIGN_KEY_SUFFIX, String.format("姓名:%s。 内容:%s。 时间:%s。", userName, reportRecordValue, currentTime));
|
||||
// 签批批注,存入流程变量, 内容、姓名、时间
|
||||
reportParams.put(oaFormReportRecordFieldVO.getFieldName() + EDIT_SIGN_KEY_SUFFIX, String.format("%s。 %s。 %s。", reportRecordValue, userName, currentDay));
|
||||
continue;
|
||||
}
|
||||
if (StringUtils.equals(oaFormReportRecordFieldVO.getEditHistory(), FieldEditRecordEnum.ALL.getValue())) {
|
||||
@ -424,7 +455,7 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
taskCommentBO.setUserId(userId);
|
||||
taskCommentBO.setUserName(userName);
|
||||
taskCommentBO.setContent(reportRecordValue);
|
||||
taskCommentBO.setTime(currentTime);
|
||||
taskCommentBO.setTime(currentDay);
|
||||
taskCommentBO.setFieldName(oaFormReportRecordFieldVO.getFieldName());
|
||||
taskCommentBO.setFieldExplain(oaFormReportRecordFieldVO.getFieldExplain());
|
||||
taskCommentBO.setType(TaskCommentTypeEnum.JOINTLY_SIGN);
|
||||
@ -448,6 +479,7 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
Object excObj = reportParams.get(IActivitiModelService.EXCLUSIVE_GATEWAY_CONDITION_KEY);
|
||||
List<OaFormReportRecordFieldVO> oaFormReportRecordFieldVOs = JSONArray.parseArray(JSON.toJSONString(reportParams.get(IOaFormReportService.KEY_RECORD_FIELDS)), OaFormReportRecordFieldVO.class);
|
||||
List<String> ccVOs = (List<String>) reportParams.get(IOaFormReportService.KEY_CCS);
|
||||
List<OaDocNoVO> docNoVOS = JSONArray.parseArray(JSONArray.toJSONString(reportParams.get(IOaFormReportService.KEY_DOC_NOS)), OaDocNoVO.class);
|
||||
// 移除无效的内容
|
||||
reportParams.remove(IOaFormReportService.KEY_ASSIGNEES);
|
||||
reportParams.remove(IOaFormReportService.KEY_SELECT_TYPE);
|
||||
@ -455,6 +487,7 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
reportParams.remove(IOaFormReportService.KEY_RECORD_FIELDS);
|
||||
reportParams.remove(IActivitiModelService.EXCLUSIVE_GATEWAY_CONDITION_KEY);
|
||||
reportParams.remove(IOaFormReportService.KEY_CCS);
|
||||
reportParams.remove(IOaFormReportService.KEY_DOC_NOS);
|
||||
// 归类到对象
|
||||
OaFormReportUnWantedValueBO oaFormReportUnWantedValueBO = new OaFormReportUnWantedValueBO();
|
||||
oaFormReportUnWantedValueBO.setAssignees(assignees);
|
||||
@ -463,6 +496,7 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
oaFormReportUnWantedValueBO.setExc(excObj == null ? "" : excObj.toString());
|
||||
oaFormReportUnWantedValueBO.setRecordFields(oaFormReportRecordFieldVOs);
|
||||
oaFormReportUnWantedValueBO.setCcs(ccVOs);
|
||||
oaFormReportUnWantedValueBO.setOaDocNos(docNoVOS);
|
||||
return oaFormReportUnWantedValueBO;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,9 @@ package ink.wgink.module.form.controller.api.docno;
|
||||
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.exceptions.ParamsException;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.form.enums.docno.DocNoTypeEnum;
|
||||
import ink.wgink.module.form.pojo.bos.docno.DocNoBO;
|
||||
import ink.wgink.module.form.pojo.dtos.docno.DocNoDTO;
|
||||
import ink.wgink.module.form.pojo.vos.docno.DocNoVO;
|
||||
@ -13,6 +15,7 @@ import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -40,6 +43,7 @@ public class DocNoController extends DefaultBaseController {
|
||||
@PostMapping("save")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult save(@RequestBody DocNoVO docNoVO) {
|
||||
checkField(docNoVO);
|
||||
docNoService.save(docNoVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
@ -63,6 +67,7 @@ public class DocNoController extends DefaultBaseController {
|
||||
@PutMapping("update/{docNoId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult update(@PathVariable("docNoId") String docNoId, @RequestBody DocNoVO docNoVO) {
|
||||
checkField(docNoVO);
|
||||
docNoService.update(docNoId, docNoVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
@ -114,9 +119,9 @@ public class DocNoController extends DefaultBaseController {
|
||||
@ApiImplicitParam(name = "docNoId", value = "文号ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get-latest-doc-no/{docNoId}")
|
||||
public SuccessResultData<String> getLatestDocNo(@PathVariable("docNoId") String docNoId) {
|
||||
DocNoBO latestNewDocNoBO = docNoService.getLatestNewDocNoBO(docNoId);
|
||||
@GetMapping("get-latest-doc-no/{docNoId}/{docNoUsedId}")
|
||||
public SuccessResultData<String> getLatestDocNo(@PathVariable("docNoId") String docNoId, @PathVariable("docNoUsedId") String docNoUsedId) {
|
||||
DocNoBO latestNewDocNoBO = docNoService.getLatestNewDocNoBO(docNoId, docNoUsedId);
|
||||
String latestDocNo;
|
||||
if (latestNewDocNoBO == null) {
|
||||
latestDocNo = "";
|
||||
@ -126,4 +131,18 @@ public class DocNoController extends DefaultBaseController {
|
||||
return new SuccessResultData<>(latestDocNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证模板
|
||||
*
|
||||
* @param docNoVO
|
||||
*/
|
||||
private void checkField(DocNoVO docNoVO) {
|
||||
if (StringUtils.equals(docNoVO.getType(), DocNoTypeEnum.MANUAL.getValue())) {
|
||||
return;
|
||||
}
|
||||
if (StringUtils.isBlank(docNoVO.getTemplate())) {
|
||||
throw new ParamsException("模板不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -35,4 +35,9 @@ public class DocNoRouteController extends DefaultBaseController {
|
||||
return new ModelAndView("doc-no/list");
|
||||
}
|
||||
|
||||
@GetMapping("select/list")
|
||||
public ModelAndView selectList() {
|
||||
return new ModelAndView("doc-no/select/list");
|
||||
}
|
||||
|
||||
}
|
@ -33,7 +33,8 @@ public enum FormFieldTypeEnum {
|
||||
UPLOAD_AUDIO("uploadAudio", "上传音频"),
|
||||
TEXTAREA("textarea", "多行文本"),
|
||||
EDITOR("editor", "编辑器"),
|
||||
GRID("grid", "布局网格");
|
||||
GRID("grid", "布局网格"),
|
||||
DOC_NO("docno", "文号");
|
||||
|
||||
private String type;
|
||||
private String label;
|
||||
|
@ -28,8 +28,6 @@ public class DocNoDTO {
|
||||
private Integer startNu;
|
||||
@ApiModelProperty(name = "nuLength", value = "编号长度")
|
||||
private Integer nuLength;
|
||||
@ApiModelProperty(name = "latestDocNo", value = "最新文号")
|
||||
private String latestDocNo;
|
||||
@ApiModelProperty(name = "isActive", value = "是否激活")
|
||||
private Integer isActive;
|
||||
@ApiModelProperty(name = "gmtCreate", value = "创建时间")
|
||||
@ -95,14 +93,6 @@ public class DocNoDTO {
|
||||
this.nuLength = nuLength;
|
||||
}
|
||||
|
||||
public String getLatestDocNo() {
|
||||
return latestDocNo == null ? "" : latestDocNo.trim();
|
||||
}
|
||||
|
||||
public void setLatestDocNo(String latestDocNo) {
|
||||
this.latestDocNo = latestDocNo;
|
||||
}
|
||||
|
||||
public Integer getIsActive() {
|
||||
return isActive == null ? 0 : isActive;
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ public class DocNoVO {
|
||||
@CheckEmptyAnnotation(name = "类型", types = {"always", "year", "month", "day", "manual"})
|
||||
private String type;
|
||||
@ApiModelProperty(name = "template", value = "模板")
|
||||
@CheckEmptyAnnotation(name = "模板")
|
||||
private String template;
|
||||
@ApiModelProperty(name = "startNu", value = "开始编号")
|
||||
@CheckNumberAnnotation(name = "开始编号")
|
||||
|
@ -31,6 +31,7 @@ public interface IFormDesignService {
|
||||
String PARAM_INSERTS = "inserts";
|
||||
String PARAM_VALUES = "values";
|
||||
String PARAM_KV_LIST = "kvList";
|
||||
String SUFFIX_DOC_NO = "_text";
|
||||
|
||||
/**
|
||||
* 保存表单
|
||||
|
@ -322,7 +322,12 @@ public class FormDesignServiceImpl extends DefaultBaseService implements IFormDe
|
||||
}
|
||||
} else {
|
||||
FormFieldVO formField = new FormFieldVO();
|
||||
formField.setFieldName(id);
|
||||
// 文号,加后后缀保存
|
||||
if (StringUtils.equals(FormFieldTypeEnum.DOC_NO.getType(), tag)) {
|
||||
formField.setFieldName(id + SUFFIX_DOC_NO);
|
||||
} else {
|
||||
formField.setFieldName(id);
|
||||
}
|
||||
formField.setFieldTag(tag);
|
||||
formField.setFieldExplain(label);
|
||||
formField.setFieldType(getSingleFieldType(tag));
|
||||
@ -377,6 +382,8 @@ public class FormDesignServiceImpl extends DefaultBaseService implements IFormDe
|
||||
return "LONGTEXT";
|
||||
} else if (StringUtils.equals(FormFieldTypeEnum.SIGN.getType(), fieldTag)) {
|
||||
return "VARCHAR(255)";
|
||||
} else if (StringUtils.equals(FormFieldTypeEnum.DOC_NO.getType(), fieldTag)) {
|
||||
return "VARCHAR(255)";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -165,15 +165,25 @@ public interface IDocNoService {
|
||||
* 获取最新文号
|
||||
*
|
||||
* @param docNoId
|
||||
* @param docNoUsedId 使用ID
|
||||
* @return
|
||||
*/
|
||||
DocNoBO getLatestNewDocNoBO(String docNoId);
|
||||
DocNoBO getLatestNewDocNoBO(String docNoId, String docNoUsedId);
|
||||
|
||||
/**
|
||||
* 获取最新文号
|
||||
*
|
||||
* @param docNoPO
|
||||
* @param docNoUsedId 使用ID
|
||||
* @return
|
||||
*/
|
||||
DocNoBO getLatestNewDocNoBO(DocNoPO docNoPO, String docNoUsedId);
|
||||
|
||||
/**
|
||||
* 保存并返回新的文号
|
||||
*
|
||||
* @param docNoId
|
||||
* @param docNoUsedId
|
||||
* @param docNoUsedId 文号的使用ID,由调用方确定(每种文号确定唯一,动态表单用表名处理)
|
||||
* @return
|
||||
*/
|
||||
String saveAndReturnLatestDocNo(String docNoId, String docNoUsedId);
|
||||
|
@ -161,7 +161,7 @@ public class DocNoServiceImpl extends DefaultBaseService implements IDocNoServic
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocNoBO getLatestNewDocNoBO(String docNoId) {
|
||||
public DocNoBO getLatestNewDocNoBO(String docNoId, String docNoUsedId) {
|
||||
DocNoPO docNoPO = getPO(docNoId);
|
||||
if (docNoPO == null) {
|
||||
throw new SearchException("文号不存在");
|
||||
@ -170,12 +170,17 @@ public class DocNoServiceImpl extends DefaultBaseService implements IDocNoServic
|
||||
LOG.debug("文号类型为手动生成");
|
||||
return null;
|
||||
}
|
||||
return getLatestNewDocNoBO(docNoPO, docNoUsedId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocNoBO getLatestNewDocNoBO(DocNoPO docNoPO, String docNoUsedId) {
|
||||
int startNu = docNoPO.getStartNu();
|
||||
int nuLength = docNoPO.getNuLength();
|
||||
// 文号模板
|
||||
String template = docNoPO.getTemplate();
|
||||
// 获取最新的文号
|
||||
DocNoLogPO latestDocNoLogPO = docNoLogService.getLatestPOByDocNoId(docNoId);
|
||||
DocNoLogPO latestDocNoLogPO = docNoLogService.getLatestPOByDocNoIdAndUsedId(docNoPO.getDocNoId(), docNoUsedId);
|
||||
DateTime dateTime = DateTime.now();
|
||||
|
||||
int fullYearIndex = template.indexOf("yyyy");
|
||||
@ -224,13 +229,13 @@ public class DocNoServiceImpl extends DefaultBaseService implements IDocNoServic
|
||||
}
|
||||
}
|
||||
docNoBO.setDocNoNu(currentDocNoNu);
|
||||
docNoBO.setDocNoFull(generateDocNo(template, dateTime, String.format("%0" + nuLength + "d", currentDocNoNu)));
|
||||
docNoBO.setDocNoFull(docNoPO.getTitle() + generateDocNo(template, dateTime, String.format("%0" + nuLength + "d", currentDocNoNu)));
|
||||
return docNoBO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized String saveAndReturnLatestDocNo(String docNoId, String docNoUsedId) {
|
||||
DocNoBO latestNewDocNoBO = getLatestNewDocNoBO(docNoId);
|
||||
DocNoBO latestNewDocNoBO = getLatestNewDocNoBO(docNoId, docNoUsedId);
|
||||
if (latestNewDocNoBO == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -77,9 +77,10 @@ public interface IDocNoLogService {
|
||||
* 获取最新的文号日志
|
||||
*
|
||||
* @param docNoId
|
||||
* @param docNoUsedId
|
||||
* @return
|
||||
*/
|
||||
DocNoLogPO getLatestPOByDocNoId(String docNoId);
|
||||
DocNoLogPO getLatestPOByDocNoIdAndUsedId(String docNoId, String docNoUsedId);
|
||||
|
||||
/**
|
||||
* 文号日志列表
|
||||
|
@ -78,9 +78,10 @@ public class DocNoLogServiceImpl extends DefaultBaseService implements IDocNoLog
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocNoLogPO getLatestPOByDocNoId(String docNoId) {
|
||||
public DocNoLogPO getLatestPOByDocNoIdAndUsedId(String docNoId, String docNoUsedId) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("docNoId", docNoId);
|
||||
params.put("docNoUsedId", docNoUsedId);
|
||||
return docNoLogDao.getLatestPO(params);
|
||||
}
|
||||
|
||||
|
@ -250,6 +250,10 @@
|
||||
<if test="docNoId != null and docNoId != ''">
|
||||
t1.doc_no_id = #{docNoId}
|
||||
</if>
|
||||
<if test="docNoUsedId != null and docNoUsedId != ''">
|
||||
AND
|
||||
t1.doc_no_used_id = #{docNoUsedId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
t1.gmt_create DESC
|
||||
|
@ -70,15 +70,22 @@ function DocNo($, form) {
|
||||
},
|
||||
addSelect: function() {
|
||||
var self = this;
|
||||
form.on('select(typeSelect)', function(data){
|
||||
form.on('select(typeSelect)', function(data) {
|
||||
var options = $(data.elem).children();
|
||||
var isManual = true;
|
||||
for(var i = 0, option; option = options[i++];) {
|
||||
if(option.value == data.value) {
|
||||
$('#template').val(option.dataset.template)
|
||||
if(option.value != 'manual') {
|
||||
isManual = false;
|
||||
}
|
||||
$('#template').val(option.dataset.template);
|
||||
break;
|
||||
}
|
||||
}
|
||||
self.refreshDocNoDemo();
|
||||
if(isManual) {
|
||||
$('#template').removeAttr('lay-verify');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,97 @@
|
||||
layui.define(['jquery', 'laydate', 'formUtils'], function(exports) {
|
||||
var $ = layui.jquery;
|
||||
var form = layui.form;
|
||||
var laydate = layui.laydate;
|
||||
var utils = layui.formUtils;
|
||||
var formField = layui.formField;
|
||||
|
||||
var HTML_ARRAY = [
|
||||
'<div id="{0}Box" class="layui-form-item {2} docno" data-id="{0}" data-tag="{1}" data-index="{3}">',
|
||||
' <label class="layui-form-label" style="width: {1}px;"><span style="color:red;">*</span>{0}:</label>',
|
||||
' <div id="{0}Block" class="layui-input-block layui-form" lay-filter="{0}" style="margin-left: {1}px">',
|
||||
' <div class="layui-col-xs6 select">',
|
||||
' <select id="{0}" name="{0}" lay-filter="{0}Filter">',
|
||||
' </select>',
|
||||
' </div>',
|
||||
' <div class="layui-col-xs6">',
|
||||
' <input id="{0}Text" name="{0}_text" class="layui-input" readonly lay-verify="required" placeholder="请选择或输入文号">',
|
||||
' </div>',
|
||||
' </div>',
|
||||
'</div>'
|
||||
];
|
||||
|
||||
var docno = {
|
||||
/**
|
||||
* 根据json对象生成html对象
|
||||
* @param {object} json
|
||||
* @param {boolean} selected true 表示选择当前
|
||||
* */
|
||||
render: function (json, selected) {
|
||||
if (selected === undefined) {
|
||||
selected = false;
|
||||
}
|
||||
var _html = HTML_ARRAY[0].format(json.id, json.tag, selected ? 'active' : '', json.index);
|
||||
_html += HTML_ARRAY[1].format(json.label, json.labelWidth);
|
||||
_html += HTML_ARRAY[2].format(json.id, json.labelWidth);
|
||||
_html += HTML_ARRAY[3];
|
||||
_html += HTML_ARRAY[4].format(json.id);
|
||||
_html += '<option value="">请选择</option>';
|
||||
// 渲染列表
|
||||
for (var i = 0, item; item = json.docNoOptions[i++];) {
|
||||
_html += '<option value="{0}" data-type="{1}" data-template="{2}" {4}>{3} {2}</option>'.format(item.value, item.type, item.template, item.text, item.checked ? 'checked="checked"' : '');
|
||||
}
|
||||
_html += HTML_ARRAY[5];
|
||||
_html += HTML_ARRAY[6];
|
||||
_html += HTML_ARRAY[7];
|
||||
_html += HTML_ARRAY[8].format(json.id);
|
||||
_html += HTML_ARRAY[9];
|
||||
_html += HTML_ARRAY[10];
|
||||
_html += HTML_ARRAY[11];
|
||||
return _html;
|
||||
},
|
||||
update: function (json) {
|
||||
var $select = $('#' + json.id + 'Box .layui-input-block .select');
|
||||
var $label = $('#' + json.id + 'Box .layui-form-label');
|
||||
$select.empty();
|
||||
$label.empty();
|
||||
var _html = '';
|
||||
_html += '<select name="{0}">'.format(json.id);
|
||||
_html += '<option value="">请选择</option>';
|
||||
for (var i = 0, item; item = json.docNoOptions[i++];) {
|
||||
_html += '<option value="{0}" data-type="{1}" data-template="{2}" {4}>{3} {2}</option>'.format(item.value, item.type, item.template, item.text, item.checked ? 'checked="checked"' : '');
|
||||
}
|
||||
_html += '</select>';
|
||||
$select.append(_html);
|
||||
$('#'+ json.id +'Block').css("margin-left", json.labelWidth);
|
||||
$label.css("width", json.labelWidth);
|
||||
$label.append(json.label + ":");
|
||||
form.render('select', json.id);
|
||||
$('#' + json.id + 'Box .layui-input-block div.layui-unselect.layui-form-select').css({
|
||||
width: '{0}'.format(json.width)
|
||||
});
|
||||
},
|
||||
/* 获取对象 */
|
||||
jsonData: function (id, index, columncount) {
|
||||
//分配一个新的ID
|
||||
var _json = JSON.parse(JSON.stringify(formField.docno));
|
||||
_json.id = id == undefined ? utils.guid() : id;
|
||||
_json.index = index;
|
||||
return _json;
|
||||
},
|
||||
/* 根据 json 对象显示对应的属性 */
|
||||
property: function (json) {
|
||||
$('#columnProperty').empty();
|
||||
var _html = '';
|
||||
_html = utils.renderCommonProperty(json); //获取通用属性HTML字符串
|
||||
//处理特殊字符串
|
||||
for (var key in json) {
|
||||
if (key === 'index') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$('#columnProperty').append(_html);
|
||||
},
|
||||
};
|
||||
|
||||
exports('docno', docno);
|
||||
});
|
@ -91,7 +91,8 @@ layui.define([], function (exports) {
|
||||
uploadVideo: '视频上传',
|
||||
uploadAudio: '音频上传',
|
||||
listShow: '列表显示',
|
||||
count: '总数'
|
||||
count: '总数',
|
||||
docno: '文号',
|
||||
};
|
||||
var expressions = [
|
||||
{
|
||||
|
@ -19,12 +19,13 @@ layui.config({
|
||||
uploadVideo: 'components/uploadVideo',
|
||||
uploadAudio: 'components/uploadAudio',
|
||||
laySign: 'components/laySign',
|
||||
docno: 'components/docno',
|
||||
}).define(["layer", "laytpl", "element", "form", "slider", "laydate", "rate", "colorpicker", "layedit", "carousel", "upload", "formField", "iconPicker", "cron", "labelGeneration",
|
||||
'consts',
|
||||
'input', 'numberInput', 'password', 'grid', 'textarea',
|
||||
'select', 'radio', 'checkbox', 'laySwitch', 'laySlider', 'date', 'layRate', 'layCarousel',
|
||||
'uploadImage', 'uploadFile', 'uploadVideo', 'uploadAudio',
|
||||
'laySign'
|
||||
'laySign', 'docno'
|
||||
], function (exports) {
|
||||
var $ = layui.jquery,
|
||||
layer = layui.layer,
|
||||
@ -54,6 +55,7 @@ layui.config({
|
||||
uploadVideo = layui.uploadVideo,
|
||||
uploadAudio = layui.uploadAudio,
|
||||
laySign = layui.laySign,
|
||||
docno = layui.docno,
|
||||
consts = layui.consts,
|
||||
lang = consts.lang,
|
||||
|
||||
@ -308,6 +310,8 @@ layui.config({
|
||||
grid: grid,
|
||||
|
||||
laySign: laySign,
|
||||
|
||||
docno: docno,
|
||||
};
|
||||
/* 如果是grid布局控件 就显示不一样的样式 */
|
||||
Class.prototype.addClick = function (evt) {
|
||||
@ -682,8 +686,8 @@ layui.config({
|
||||
//同步到设计视图radio
|
||||
_html += '<input type="radio" name="{0}" title="{1}" >'.format(_json.tag, 'option');
|
||||
$('#' + _json.id + 'Box .layui-input-block').append(_html);
|
||||
} else if (_json.tag === 'carousel') {
|
||||
}
|
||||
} else if (_json.tag === 'carousel') {}
|
||||
|
||||
if (_json.tag === 'checkbox') {
|
||||
form.render('checkbox');
|
||||
} else if (_json.tag === 'radio') {
|
||||
@ -773,6 +777,48 @@ layui.config({
|
||||
//向 .option .layui-inline 添加drag事件并且必须设在 select-option-drag 中才能拖动
|
||||
});
|
||||
}
|
||||
// 文号
|
||||
if(_json.hasOwnProperty('docNoOptions')) {
|
||||
$('.select-doc-no-btn').on('click', function() {
|
||||
var id = this.dataset.id;
|
||||
var boxId = '#'+ id +'OptionsBox';
|
||||
top.dialog.open({
|
||||
// 打开页面,指定选择框类型
|
||||
url: 'route/doc-no/select/list?selectType=checkbox',
|
||||
title: '选择文号选项',
|
||||
width: '800px',
|
||||
height: '400px',
|
||||
onClose: function() {
|
||||
$(boxId).empty();
|
||||
// 获取选择后的列表
|
||||
var newSelectedArray = top.dialog.dialogData.newSelectedArray;
|
||||
if(newSelectedArray && newSelectedArray.length != 0) {
|
||||
// 处理选择结果
|
||||
var _htmloption = '';
|
||||
var docNoOptions = [];
|
||||
for(var i = 0, item; item = newSelectedArray[i++];) {
|
||||
docNoOptions.push({
|
||||
text: item.title,
|
||||
value: item.docNoId,
|
||||
template: item.template,
|
||||
type: item.type,
|
||||
checked: i == 1 ? true : false
|
||||
});
|
||||
_htmloption += '<div class="layui-form-item option select-options" data-index="{0}">'.format(i - 1);
|
||||
_htmloption += ' <div class="layui-inline" style="margin-right: 0px;width:314px;">';
|
||||
_htmloption += ' <input type="text" name="{0}-text" autocomplete="off" value="{1}" class="layui-input" readonly>'.format(_json.tag, item.title + item.template);
|
||||
_htmloption += ' </div>';
|
||||
_htmloption += '</div>';
|
||||
}
|
||||
$(boxId).append(_htmloption);
|
||||
form.render('radio');
|
||||
_json.docNoOptions = docNoOptions;
|
||||
that.components[_json.tag].update(_json);
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
$(document).off('click', '.select-options input[type=checkbox]').on('click', '.select-options input[type=checkbox]', function (e) {
|
||||
// console.log(e);
|
||||
//判断是否选中
|
||||
|
@ -431,6 +431,19 @@ layui.define(['layer'], function (exports) {
|
||||
document: '',
|
||||
listShow: true
|
||||
},
|
||||
docno: {
|
||||
id: '-1',
|
||||
index: '-1',
|
||||
label: "文号",
|
||||
tag: "docno",
|
||||
tagIcon: 'docno',
|
||||
labelWidth: 110,
|
||||
width: "100%",
|
||||
document: '',
|
||||
docNoUrl: 'api/doc-no/list',
|
||||
docNoOptions: [],
|
||||
listShow: true
|
||||
},
|
||||
grid: {
|
||||
id: '-1',
|
||||
index: '-1',
|
||||
@ -462,7 +475,7 @@ layui.define(['layer'], function (exports) {
|
||||
},
|
||||
c5: {
|
||||
name: "扩展组件",
|
||||
list: [/*'laySign'*/]
|
||||
list: ['docno', /*'laySign'*/]
|
||||
}
|
||||
};
|
||||
exports('formField', field);
|
||||
|
@ -374,6 +374,21 @@ layui.define(['form', 'laytpl', 'restajax', 'dialog', 'consts'], function (expor
|
||||
_html += '<div id="{0}" class="layui-input icon-date widget-date" style="line-height: 40px;"></div>'.format(json.tag + json.id + "property");
|
||||
_html += '</div>';
|
||||
_html += '</div>';
|
||||
} else if(key === 'docNoOptions') {
|
||||
_html += '<div id="{0}" class="layui-form-item">'.format(key + json.id);
|
||||
_html += '<label class="layui-form-label">添加选项</label>';
|
||||
_html += '<div class="layui-input-block">';
|
||||
_html += '<button type="button" class="layui-btn select-doc-no-btn" data-id="{0}">添加</button>'.format(key + json.id);
|
||||
_html += '</div>';
|
||||
_html += '<div id="{0}OptionsBox" class="layui-form-item option select-options">'.format(key + json.id);
|
||||
for(var i = 0, item; item = json.docNoOptions[i++];) {
|
||||
_html += '<div class="layui-form-item option select-options" data-index="{0}">'.format(i - 1);
|
||||
_html += ' <div class="layui-inline" style="margin-right: 0px;width:314px;">';
|
||||
_html += ' <input type="text" name="{0}-text" autocomplete="off" value="{1}" class="layui-input" readonly>'.format(json.tag, item.text + item.template);
|
||||
_html += ' </div>';
|
||||
_html += '</div>';
|
||||
}
|
||||
_html += '</div>';
|
||||
}
|
||||
}
|
||||
return _html;
|
||||
|
129
module-form/src/main/resources/static/form/js/oa-docno.js
Normal file
129
module-form/src/main/resources/static/form/js/oa-docno.js
Normal file
@ -0,0 +1,129 @@
|
||||
function OaDocNo(layui) {
|
||||
var $ = layui.$;
|
||||
var layer = layui.layer;
|
||||
var form = layui.form
|
||||
var restAjax = layui.restajax;
|
||||
|
||||
/**
|
||||
* 获取option
|
||||
* @param select
|
||||
* @param selectedValue
|
||||
* @return {null|*}
|
||||
*/
|
||||
function getSelectOption(select, selectedValue) {
|
||||
if (!selectedValue) {
|
||||
return null;
|
||||
}
|
||||
var options = $(select).find('option');
|
||||
for (var i = 0, option; option = options[i++];) {
|
||||
if (option.value === selectedValue) {
|
||||
return option;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最新文号
|
||||
* @param selectId
|
||||
* @param docnoId
|
||||
* @param isApp
|
||||
* @param token
|
||||
*/
|
||||
function getLatestDocNo(selectId, docNoId, isApp, headers) {
|
||||
var url;
|
||||
if (!isApp) {
|
||||
url = 'api/doc-no/get-latest-doc-no/{docNoId}/{docNoUsedId}';
|
||||
} else {
|
||||
url = 'app/doc-no/get-latest-doc-no/{docNoId}/{docNoUsedId}';
|
||||
}
|
||||
restAjax.get(restAjax.path(url, [docNoId, 'df_'+ $('#formCode').val() +'_v'+ $('#formVersion').val()]), {}, {
|
||||
headers: headers
|
||||
}, function (code, data) {
|
||||
$('#' + selectId + 'Text').val(data.data);
|
||||
}, function (code, data) {
|
||||
layer.msg(data.msg);
|
||||
})
|
||||
}
|
||||
|
||||
// 初始化
|
||||
this.init = function (opt) {
|
||||
var isApp = opt && opt.isApp ? opt.isApp : false;
|
||||
var headers = opt && opt.headers ? opt.headers : {};
|
||||
// 获取全部的文号组件
|
||||
var docnos = $('.docno');
|
||||
if (docnos.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 添加监听事件
|
||||
$.each(docnos, function (index, item) {
|
||||
var selects = $(item).find('select');
|
||||
var select = selects[0];
|
||||
var selectId = select.id;
|
||||
form.on('select(' + selectId + 'Filter)', function (data) {
|
||||
$('#' + selectId + 'Text').val('');
|
||||
var docNoId = data.value;
|
||||
var option = getSelectOption(data.elem, docNoId);
|
||||
if (!option) {
|
||||
return;
|
||||
}
|
||||
var type = option.dataset.type;
|
||||
if (type === 'manual') {
|
||||
$('#' + selectId + 'Text').removeAttr('readonly');
|
||||
return;
|
||||
}
|
||||
getLatestDocNo(data.elem.id, docNoId, isApp, headers);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置文号字段
|
||||
* @param data
|
||||
*/
|
||||
this.initDocNo = function (data) {
|
||||
var docnos = $('.docno');
|
||||
if (docnos.length == 0) {
|
||||
return;
|
||||
}
|
||||
$.each(docnos, function (index, item) {
|
||||
var selects = $(item).find('select');
|
||||
var select = selects[0];
|
||||
var docNoField = select.id;
|
||||
for(var key in data) {
|
||||
if(key == docNoField) {
|
||||
docNoField[key +'Text'] = docNoField[key];
|
||||
delete docNoField[key];
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置文号
|
||||
* @param formData
|
||||
*/
|
||||
this.setDocNo = function (formData) {
|
||||
var docnos = $('.docno');
|
||||
if (docnos.length == 0) {
|
||||
return;
|
||||
}
|
||||
var docNoArray = [];
|
||||
$.each(docnos, function (index, item) {
|
||||
var selects = $(item).find('select');
|
||||
var select = selects[0];
|
||||
var docNoId = select.value;
|
||||
docNoArray.push({
|
||||
fieldName: select.id,
|
||||
docNoId: docNoId,
|
||||
docNoText: $('#' + select.id + 'Text').val()
|
||||
})
|
||||
delete formData.field[select.id];
|
||||
delete formData.field[select.id + 'Text'];
|
||||
});
|
||||
formData.field.docNos = docNoArray;
|
||||
}
|
||||
|
||||
}
|
@ -6,6 +6,11 @@ function OaFormUtil(layui) {
|
||||
var form = layui.form;
|
||||
var restAjax = layui.restajax;
|
||||
var processImageEnlargeScale = 0;
|
||||
// 全屏
|
||||
function fullPage() {
|
||||
$('.layui-card-body').css('height', (win.height() - 75) +'px');
|
||||
}
|
||||
fullPage();
|
||||
|
||||
// 消息位置
|
||||
function getMsgOffset(isApp) {
|
||||
@ -391,13 +396,29 @@ function OaFormUtil(layui) {
|
||||
this.disableFields = function (fields) {
|
||||
for (var i = 0, item; item = fields[i++];) {
|
||||
if (parseInt(item.isEditable) === 0) {
|
||||
// 普通控件
|
||||
var boxId = '#' + item.fieldName + 'Box';
|
||||
$(boxId).css('position', 'relative');
|
||||
$(boxId).append('<div style="width: 100%; height: 100%; background-color: #fff0; position: absolute; top: 0; left: 0; cursor: not-allowed;"></div>');
|
||||
var doms = $(boxId).find('input,button,textarea,select');
|
||||
doms.removeAttr('name');
|
||||
doms.attr('disabled', 'disabled');
|
||||
doms.attr('lay-verify', '');
|
||||
var blockId = '#'+ item.fieldName + 'Block';
|
||||
// 文号控件
|
||||
if($(boxId).hasClass('docno')) {
|
||||
// 移除文号标识
|
||||
$(boxId).removeClass('docno');
|
||||
// 获取文本输入框
|
||||
var docNoTextInput = $('#'+ item.fieldName +'Text');
|
||||
docNoTextInput.removeAttr('name');
|
||||
docNoTextInput.attr('disabled', 'disabled');
|
||||
docNoTextInput.attr('lay-verify', '');
|
||||
// 重新添加文本
|
||||
$(blockId).empty();
|
||||
$(blockId).append(docNoTextInput)
|
||||
} else {
|
||||
$(boxId).css('position', 'relative');
|
||||
$(boxId).append('<div style="width: 100%; height: 100%; background-color: #fff0; position: absolute; top: 0; left: 0; cursor: not-allowed;"></div>');
|
||||
var doms = $(boxId).find('input,button,textarea,select');
|
||||
doms.removeAttr('name');
|
||||
doms.attr('disabled', 'disabled');
|
||||
doms.attr('lay-verify', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
295
module-form/src/main/resources/templates/doc-no/select/list.html
Normal file
295
module-form/src/main/resources/templates/doc-no/select/list.html
Normal file
@ -0,0 +1,295 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'}">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item search-item-width-100" placeholder="输入关键字">
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
<!-- 确定按钮 -->
|
||||
<button type="button" class="layui-btn layui-btn-sm layui-btn-normal" id="confirm" style="float:right;">确定</button>
|
||||
<!-- 确定按钮 -->
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var selectType = top.restAjax.params(window.location.href).selectType;
|
||||
selectType = selectType ? selectType : 'radio';
|
||||
|
||||
// 已经选择的列表
|
||||
var selectedIdArray = top.dialog.dialogData.selectedIdArray ? top.dialog.dialogData.selectedIdArray : [];
|
||||
// 将新的选择列表置空
|
||||
top.dialog.dialogData.newSelectedArray = null;
|
||||
// 正在选择
|
||||
var selectMap = {};
|
||||
var tableData = [];
|
||||
|
||||
var tableUrl = 'api/doc-no/listpage';
|
||||
|
||||
// 初始化已选择的列表
|
||||
function initSelectMap() {
|
||||
for(var i = 0, item; item = selectedIdArray[i++];) {
|
||||
selectMap[item] = {
|
||||
docNoId: item
|
||||
}
|
||||
}
|
||||
}
|
||||
initSelectMap();
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
// 设置选择类型
|
||||
$.extend(table, {config: {checkName: 'checked'}});
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 60,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
toolbar: false,
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'title', width: 180, title: '标题', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'summary', width: 180, title: '描述', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'type', width: 100, title: '类型', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(rowData === 'always') {
|
||||
return '一直累加';
|
||||
}
|
||||
if(rowData === 'year') {
|
||||
return '按年累加';
|
||||
}
|
||||
if(rowData === 'month') {
|
||||
return '按月累加';
|
||||
}
|
||||
if(rowData === 'day') {
|
||||
return '按日累加';
|
||||
}
|
||||
if(rowData === 'manual') {
|
||||
return '手动';
|
||||
}
|
||||
return '错误';
|
||||
}
|
||||
},
|
||||
{field: 'template', width: 180, title: '模板', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'startNu', width: 120, title: '开始编号', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'nuLength', width: 120, title: '编号长度', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isActive', width: 100, title: '是否激活', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(rowData === 0) {
|
||||
return '<span class="layui-badge">否</span>';
|
||||
}
|
||||
if(rowData === 1) {
|
||||
return '<span class="layui-badge layui-bg-green">是</span>';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gmtCreate', width: 180, title: '创建时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
// 默认勾选
|
||||
for(var i = 0, item; item = data.rows[i++];) {
|
||||
if(selectMap[item.docNoId]) {
|
||||
item.checked = true;
|
||||
// 重新赋值:在打开界面后直接确定关闭页面时回显正常
|
||||
selectMap[item.docNoId] = item;
|
||||
} else {
|
||||
item.checked = false;
|
||||
}
|
||||
}
|
||||
tableData = data.rows;
|
||||
// 默认勾选
|
||||
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
// 关闭
|
||||
function close() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空选择
|
||||
*/
|
||||
function clearSelect() {
|
||||
selectMap = {};
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加选择
|
||||
* @param item
|
||||
*/
|
||||
function addSelect(item) {
|
||||
selectMap[item.docNoId] = item;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除选择
|
||||
* @param item
|
||||
*/
|
||||
function removeSelect(item) {
|
||||
delete selectMap[item.docNoId];
|
||||
}
|
||||
|
||||
// 勾选事件
|
||||
table.on('checkbox(dataTable)', function(obj) {
|
||||
if(obj.type === 'all') {
|
||||
if(obj.checked) {
|
||||
// 添加全部
|
||||
for(var i = 0, item; item = tableData[i++];) {
|
||||
addSelect(item);
|
||||
}
|
||||
} else {
|
||||
// 删除全部
|
||||
for(var i = 0, item; item = tableData[i++];) {
|
||||
removeSelect(item);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(obj.checked) {
|
||||
addSelect(obj.data);
|
||||
} else {
|
||||
removeSelect(obj.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 勾选事件
|
||||
table.on('radio(dataTable)', function(obj) {
|
||||
clearSelect()
|
||||
addSelect(obj.data);
|
||||
});
|
||||
|
||||
// 事件 - 确定
|
||||
$(document).on('click', '#confirm', function() {
|
||||
top.dialog.dialogData.newSelectedArray = [];
|
||||
for(var key in selectMap) {
|
||||
top.dialog.dialogData.newSelectedArray.push(selectMap[key]);
|
||||
}
|
||||
close();
|
||||
});
|
||||
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -12,6 +12,9 @@
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/codemirror.css">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/theme/dracula.css">
|
||||
<style>
|
||||
.CodeMirror {font-size : 13px;line-height: 150%;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
@ -65,6 +68,8 @@
|
||||
theme: 'dracula',
|
||||
matchBrackets: true,
|
||||
indentUnit: 4,
|
||||
indentWithTabs: 4,
|
||||
flattenSpans: false,
|
||||
tabSize: 4,
|
||||
smartIndent: true,
|
||||
extraKeys: {
|
||||
|
@ -11,6 +11,9 @@
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/codemirror.css">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/theme/dracula.css">
|
||||
<style>
|
||||
.CodeMirror {font-size : 13px;line-height: 150%;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
@ -64,6 +67,8 @@
|
||||
theme: 'dracula',
|
||||
matchBrackets: true,
|
||||
indentUnit : 4,
|
||||
indentWithTabs: 4,
|
||||
flattenSpans: false,
|
||||
tabSize : 4,
|
||||
smartIndent: true,
|
||||
extraKeys: {
|
||||
|
@ -11,6 +11,9 @@
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/codemirror.css">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/theme/dracula.css">
|
||||
<style>
|
||||
.CodeMirror {font-size : 13px;line-height: 150%;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
@ -64,6 +67,8 @@
|
||||
theme: 'dracula',
|
||||
matchBrackets: true,
|
||||
indentUnit : 4,
|
||||
indentWithTabs: 4,
|
||||
flattenSpans: false,
|
||||
tabSize : 4,
|
||||
smartIndent: true,
|
||||
extraKeys: {
|
||||
|
@ -11,6 +11,9 @@
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/codemirror.css">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/theme/dracula.css">
|
||||
<style>
|
||||
.CodeMirror {font-size : 13px;line-height: 150%;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
@ -48,6 +51,8 @@
|
||||
matchBrackets: true,
|
||||
readOnly: true,
|
||||
indentUnit : 4,
|
||||
indentWithTabs: 4,
|
||||
flattenSpans: false,
|
||||
tabSize : 4,
|
||||
smartIndent: true,
|
||||
mode: 'application/json',
|
||||
|
@ -11,6 +11,9 @@
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/codemirror.css">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/theme/dracula.css">
|
||||
<style>
|
||||
.CodeMirror {font-size : 13px;line-height: 150%;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
@ -64,6 +67,8 @@
|
||||
theme: 'dracula',
|
||||
matchBrackets: true,
|
||||
indentUnit : 4,
|
||||
indentWithTabs: 4,
|
||||
flattenSpans: false,
|
||||
tabSize : 4,
|
||||
smartIndent: true,
|
||||
extraKeys: {
|
||||
|
@ -11,6 +11,9 @@
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/codemirror.css">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/theme/dracula.css">
|
||||
<style>
|
||||
.CodeMirror {font-size : 13px;line-height: 150%;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
@ -39,6 +42,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/codemirror/codemirror.js"></script>
|
||||
<script src="assets/js/vendor/codemirror/mode/xml/xml.js"></script>
|
||||
<script src="assets/js/vendor/codemirror/mode/css/css.js"></script>
|
||||
<script src="assets/js/vendor/codemirror/mode/javascript/javascript.js"></script>
|
||||
<script src="assets/js/vendor/codemirror/mode/htmlmixed/htmlmixed.js"></script>
|
||||
@ -64,8 +68,11 @@
|
||||
theme: 'dracula',
|
||||
matchBrackets: true,
|
||||
indentUnit : 4,
|
||||
indentWithTabs: 4,
|
||||
flattenSpans: false,
|
||||
tabSize : 4,
|
||||
smartIndent: true,
|
||||
mode: 'text/html',
|
||||
extraKeys: {
|
||||
'Shift-Tab': function (cm) {
|
||||
if (cm.somethingSelected()) {
|
||||
|
@ -11,6 +11,9 @@
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/codemirror.css">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/theme/dracula.css">
|
||||
<style>
|
||||
.CodeMirror {font-size : 13px;line-height: 150%;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
@ -64,6 +67,8 @@
|
||||
theme: 'dracula',
|
||||
matchBrackets: true,
|
||||
indentUnit : 4,
|
||||
indentWithTabs: 4,
|
||||
flattenSpans: false,
|
||||
tabSize : 4,
|
||||
smartIndent: true,
|
||||
extraKeys: {
|
||||
|
@ -11,6 +11,9 @@
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/codemirror.css">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/theme/dracula.css">
|
||||
<style>
|
||||
.CodeMirror {font-size : 13px;line-height: 150%;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
@ -64,6 +67,8 @@
|
||||
theme: 'dracula',
|
||||
matchBrackets: true,
|
||||
indentUnit : 4,
|
||||
indentWithTabs: 4,
|
||||
flattenSpans: false,
|
||||
tabSize : 4,
|
||||
smartIndent: true,
|
||||
extraKeys: {
|
||||
|
@ -20,9 +20,13 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<!-- 表单字段 start -->
|
||||
<#list fields as field>
|
||||
<!-- ${field.data.id}:${field.data.label} start -->
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} end -->
|
||||
</#list>
|
||||
<!-- 表单字段 end -->
|
||||
<div class="layui-layout-admin">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" id="submitFormBtn" class="layui-btn" lay-submit lay-filter="submitForm">提交</button>
|
||||
|
@ -20,9 +20,13 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<!-- 表单字段 start -->
|
||||
<#list fields as field>
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} start -->
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} end -->
|
||||
</#list>
|
||||
<!-- 表单字段 end -->
|
||||
<div class="layui-layout-admin">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回</button>
|
||||
|
@ -20,9 +20,13 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<!-- 表单字段 start -->
|
||||
<#list fields as field>
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} start -->
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} end -->
|
||||
</#list>
|
||||
<!-- 表单字段 end -->
|
||||
<div class="layui-layout-admin">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" id="submitFormBtn" class="layui-btn" lay-submit lay-filter="submitForm">提交</button>
|
||||
|
@ -21,18 +21,28 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<!-- 底部工具栏 start -->
|
||||
<div class="layui-row oa-form-footer-tool-bar" style="display: none;">
|
||||
<!-- 左侧按钮组 start -->
|
||||
<div class="layui-col-xs5 tool-bar-left layui-layout-admin">
|
||||
<div id="submitBtnGroup" class="layui-btn-group"></div>
|
||||
</div>
|
||||
<!-- 左侧按钮组 end -->
|
||||
<!-- 右侧按钮组 start -->
|
||||
<div class="layui-col-xs7 tool-bar-right">
|
||||
<div id="formButtonGroup"></div>
|
||||
</div>
|
||||
<!-- 右侧按钮组 end -->
|
||||
</div>
|
||||
<!-- 底部工具栏 end -->
|
||||
<div id="reportForm" class="save-report-form">
|
||||
<!-- 表单字段 start -->
|
||||
<#list fields as field>
|
||||
<!-- ${field.data.id}:${field.data.label} start -->
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} end -->
|
||||
</#list>
|
||||
<!-- 表单字段 end -->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -21,16 +21,26 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<!-- 底部工具栏 start -->
|
||||
<div class="layui-row oa-form-footer-tool-bar" style="display: none;">
|
||||
<!-- 左侧按钮组 start -->
|
||||
<div class="layui-col-xs5 tool-bar-left"></div>
|
||||
<!-- 左侧按钮组 end -->
|
||||
<!-- 右侧按钮组 start -->
|
||||
<div class="layui-col-xs7 tool-bar-right">
|
||||
<div id="formButtonGroup"></div>
|
||||
</div>
|
||||
<!-- 右侧按钮组 end -->
|
||||
</div>
|
||||
<!-- 底部工具栏 end -->
|
||||
<div id="reportForm" class="layui-tab-item layui-show">
|
||||
<!-- 表单字段 start -->
|
||||
<#list fields as field>
|
||||
<!-- ${field.data.id}:${field.data.label} start -->
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} end -->
|
||||
</#list>
|
||||
<!-- 表单字段 end -->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -22,18 +22,28 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<!-- 底部工具栏 start -->
|
||||
<div class="layui-row oa-form-footer-tool-bar" style="display: none;">
|
||||
<!-- 左侧按钮组 start -->
|
||||
<div class="layui-col-xs5 tool-bar-left layui-layout-admin">
|
||||
<div id="submitBtnGroup" class="layui-btn-group"></div>
|
||||
</div>
|
||||
<!-- 左侧按钮组 end -->
|
||||
<!-- 右侧按钮组 start -->
|
||||
<div class="layui-col-xs7 tool-bar-right">
|
||||
<div id="formButtonGroup"></div>
|
||||
</div>
|
||||
<!-- 右侧按钮组 end -->
|
||||
</div>
|
||||
<!-- 底部工具栏 end -->
|
||||
<div id="reportForm" class="layui-tab-item layui-show">
|
||||
<!-- 表单字段 start -->
|
||||
<#list fields as field>
|
||||
<!-- ${field.data.id}:${field.data.label} start -->
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} end -->
|
||||
</#list>
|
||||
<!-- 表单字段 end -->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -19,15 +19,21 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<!-- 表单字段 start -->
|
||||
<#list fields as field>
|
||||
<!-- ${field.data.id}:${field.data.label} start -->
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} end -->
|
||||
</#list>
|
||||
<!-- 表单字段 end -->
|
||||
<!-- 按钮 start -->
|
||||
<div class="layui-layout-admin">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" id="submitFormBtn" class="layui-btn" lay-submit lay-filter="submitForm">提交</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 按钮 end -->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@ -60,7 +66,7 @@
|
||||
formUtil.initUploadFile('${field.data.id}', ${field.data.count});
|
||||
<#elseif field.data.tag == 'uploadVideo'>
|
||||
formUtil.initUploadVideo('${field.data.id}', ${field.data.count});
|
||||
<#elseif field.data.tag == 'uploadAudio'>
|
||||
<#elseif field.data.tag == 'uploadAudio'>
|
||||
formUtil.initUploadAudio('${field.data.id}', ${field.data.count});
|
||||
<#elseif field.data.tag == 'date'>
|
||||
formUtil.initDate({
|
||||
|
@ -19,14 +19,20 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<!-- 表单字段 start -->
|
||||
<#list fields as field>
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} start -->
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} end -->
|
||||
</#list>
|
||||
<!-- 表单字段 end -->
|
||||
<!-- 按钮 start -->
|
||||
<div class="layui-layout-admin">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 按钮 end -->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -19,15 +19,21 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<!-- 表单字段 start -->
|
||||
<#list fields as field>
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} start -->
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} end -->
|
||||
</#list>
|
||||
<!-- 表单字段 end -->
|
||||
<!-- 按钮 start -->
|
||||
<div class="layui-layout-admin">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" id="submitFormBtn" class="layui-btn" lay-submit lay-filter="submitForm">提交</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 按钮 end -->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -21,18 +21,28 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<!-- 头部工具栏 start -->
|
||||
<div class="layui-row oa-form-header-tool-bar">
|
||||
<!-- 左侧按钮组 start -->
|
||||
<div class="layui-col-xs7 tool-bar-left layui-layout-admin">
|
||||
<div id="submitBtnGroup" class="layui-btn-group"></div>
|
||||
</div>
|
||||
<!-- 左侧按钮组 end -->
|
||||
<!-- 右侧按钮组 start -->
|
||||
<div class="layui-col-xs5 tool-bar-right">
|
||||
<div id="formButtonGroup"></div>
|
||||
</div>
|
||||
<!-- 右侧按钮组 end -->
|
||||
</div>
|
||||
<!-- 头部工具栏 end -->
|
||||
<div id="reportForm" class="save-report-form">
|
||||
<!-- 表单字段 start -->
|
||||
<#list fields as field>
|
||||
<!-- ${field.data.id}:${field.data.label} start -->
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} end -->
|
||||
</#list>
|
||||
<!-- 表单字段 end -->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -44,6 +54,7 @@
|
||||
<script src="static/form/js/form-util.js?v=1"></script>
|
||||
<script src="static/form/js/oa-user-select.js?v=1"></script>
|
||||
<script src="static/form/js/oa-form-util.js?v=1"></script>
|
||||
<script src="static/form/js/oa-docno.js?v=1"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
@ -60,6 +71,7 @@
|
||||
var restAjax = layui.restajax;
|
||||
var formUtil = new FormUtil(layui, Viewer);
|
||||
var oaFormUtil = new OaFormUtil(layui);
|
||||
var oaDocNo = new OaDocNo(layui);
|
||||
// 调试可先设置为空对象
|
||||
var confirmAssignees = ${r"${confirmAssignees}"};
|
||||
var fields = ${r"${fields}"};
|
||||
@ -80,6 +92,8 @@
|
||||
formUtil.initUploadVideo('${field.data.id}', ${field.data.count});
|
||||
<#elseif field.data.tag == 'uploadAudio'>
|
||||
formUtil.initUploadAudio('${field.data.id}', ${field.data.count});
|
||||
<#elseif field.data.tag == 'docno'>
|
||||
oaDocNo.init();
|
||||
<#elseif field.data.tag == 'date'>
|
||||
formUtil.initDate({
|
||||
id: '${field.data.id}',
|
||||
@ -115,6 +129,8 @@
|
||||
oaFormUtil.setEditHistoryFields(formData, fields);
|
||||
// 抄送列表
|
||||
oaFormUtil.setCcs(formData);
|
||||
// 文号
|
||||
oaDocNo.setDocNo(formData);
|
||||
|
||||
var loadLayerIndex;
|
||||
restAjax.post(restAjax.path('api/oa-form-report/save/definition-id/{processDefinitionId}/code/{formCode}/version/{formVersion}', [
|
||||
|
@ -20,24 +20,36 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<!-- 头部工具栏 start -->
|
||||
<div class="layui-row oa-form-header-tool-bar">
|
||||
<!-- 左侧按钮组 start -->
|
||||
<div class="layui-col-xs7 tool-bar-left"></div>
|
||||
<!-- 左侧按钮组 end -->
|
||||
<!-- 右侧按钮组 start -->
|
||||
<div class="layui-col-xs5 tool-bar-right">
|
||||
<div id="formButtonGroup"></div>
|
||||
</div>
|
||||
<!-- 右侧按钮组 end -->
|
||||
</div>
|
||||
<!-- 头部工具栏 end -->
|
||||
<div class="layui-tab">
|
||||
<!-- 选项卡 start -->
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">详情</li>
|
||||
<li>流转日志</li>
|
||||
<li>流转图</li>
|
||||
</ul>
|
||||
<!-- 选项卡 end -->
|
||||
<div class="layui-tab-content">
|
||||
<!-- 表单字段 start -->
|
||||
<div id="reportForm" class="layui-tab-item layui-show">
|
||||
<#list fields as field>
|
||||
<!-- ${field.data.id}:${field.data.label} start -->
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} end -->
|
||||
</#list>
|
||||
</div>
|
||||
<!-- 表单字段 end -->
|
||||
<div id="processLog" class="layui-tab-item"></div>
|
||||
<div id="processImage" class="layui-tab-item"></div>
|
||||
</div>
|
||||
|
@ -21,27 +21,38 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<!-- 头部工具栏 start -->
|
||||
<div class="layui-row oa-form-header-tool-bar">
|
||||
<!-- 左侧按钮组 start -->
|
||||
<div class="layui-col-xs7 tool-bar-left layui-layout-admin">
|
||||
<div id="submitBtnGroup" class="layui-btn-group"></div>
|
||||
</div>
|
||||
<!-- 左侧按钮组 end -->
|
||||
<!-- 右侧按钮组 start -->
|
||||
<div class="layui-col-xs5 tool-bar-right">
|
||||
<div id="formButtonGroup"></div>
|
||||
</div>
|
||||
<!-- 右侧按钮组 end -->
|
||||
</div>
|
||||
|
||||
<!-- 头部工具栏 end -->
|
||||
<div class="layui-tab">
|
||||
<!-- 选项卡 start -->
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">详情</li>
|
||||
<li>流转日志</li>
|
||||
<li>流转图</li>
|
||||
</ul>
|
||||
<!-- 选项卡 end -->
|
||||
<div class="layui-tab-content">
|
||||
<!-- 表单字段 start -->
|
||||
<div id="reportForm" class="layui-tab-item layui-show">
|
||||
<#list fields as field>
|
||||
<!-- ${field.data.id}:${field.data.label} start -->
|
||||
${field.html}
|
||||
<!-- ${field.data.id}:${field.data.label} end -->
|
||||
</#list>
|
||||
</div>
|
||||
<!-- 表单字段 end -->
|
||||
<div id="processLog" class="layui-tab-item"></div>
|
||||
<div id="processImage" class="layui-tab-item"></div>
|
||||
</div>
|
||||
@ -58,6 +69,7 @@
|
||||
<script src="static/form/js/form-util.js?v=1"></script>
|
||||
<script src="static/form/js/oa-user-select.js?v=1"></script>
|
||||
<script src="static/form/js/oa-form-util.js?v=1"></script>
|
||||
<script src="static/form/js/oa-docno.js?v=1"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
@ -76,6 +88,7 @@
|
||||
var uid = queryParams.uid;
|
||||
var formUtil = new FormUtil(layui, Viewer);
|
||||
var oaFormUtil = new OaFormUtil(layui);
|
||||
var oaDocNo = new OaDocNo(layui);
|
||||
// 调试可先设置为空对象
|
||||
var confirmAssignees = ${r"${confirmAssignees}"};
|
||||
var fields = ${r"${fields}"};
|
||||
@ -107,6 +120,7 @@
|
||||
uid
|
||||
]), {}, null, function(code, data) {
|
||||
oaFormUtil.initSignList(data);
|
||||
oaDocNo.initDocNo(data)
|
||||
|
||||
var dataFormData = {};
|
||||
for(var i in data) {
|
||||
@ -125,6 +139,8 @@
|
||||
formUtil.initUploadVideo('${field.data.id}', ${field.data.count});
|
||||
<#elseif field.data.tag == 'uploadAudio'>
|
||||
formUtil.initUploadAudio('${field.data.id}', ${field.data.count});
|
||||
<#elseif field.data.tag == 'docno'>
|
||||
oaDocNo.init();
|
||||
<#elseif field.data.tag == 'date'>
|
||||
formUtil.initDate({
|
||||
id: '${field.data.id}',
|
||||
@ -170,6 +186,8 @@
|
||||
oaFormUtil.setEditHistoryFields(formData, fields);
|
||||
// 抄送列表
|
||||
oaFormUtil.setCcs(formData);
|
||||
// 文号
|
||||
oaDocNo.setDocNo(formData);
|
||||
|
||||
var loadLayerIndex;
|
||||
restAjax.put(restAjax.path('api/oa-form-report/update/task-id/{taskId}/code/{formCode}/version/{formVersion}/is-need-claim/{isNeedClaim}/uid/{uid}', [
|
||||
|
Loading…
Reference in New Issue
Block a user