Commit 51684653 by YG8429

车辆维保,会议室管理功能开发

parent a419e009
...@@ -127,6 +127,10 @@ public class HPConstant { ...@@ -127,6 +127,10 @@ public class HPConstant {
public static final String HPBG002_DEPOSIT_CODE = "HPBG002_DEPOSIT_CODE"; public static final String HPBG002_DEPOSIT_CODE = "HPBG002_DEPOSIT_CODE";
//办公用品领用单号 //办公用品领用单号
public static final String HPBG003_RECEIVE_CODE = "HPBG003_RECEIVE_CODE"; public static final String HPBG003_RECEIVE_CODE = "HPBG003_RECEIVE_CODE";
// 维保单号
public static final String MAINTENANCE_NUMBER = "MAINTENANCE_NUMBER";
//会议室管理申请单号
public static final String CONFERENCE_APPLY_NO = "CONFERENCE_APPLY_NO";
} }
/** /**
......
...@@ -163,14 +163,18 @@ public class ServiceHPXT001 extends ServiceEPBase { ...@@ -163,14 +163,18 @@ public class ServiceHPXT001 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "车辆申请",operType = "返还",operDesc = "返还操作") @OperationLogAnnotation(operModul = "车辆申请",operType = "返还",operDesc = "返还操作")
public EiInfo returnStatus(EiInfo inInfo){ public EiInfo returnStatus(EiInfo inInfo){
int i = 0;
try { try {
String id = String.valueOf(inInfo.getAttr().get("id")); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPXT001 hpxt001 = new HPXT001(); HPXT001 hpxt001 = new HPXT001();
hpxt001.setId(Long.parseLong(id)); hpxt001.fromMap(resultRow);
hpxt001.setStatus(CommonConstant.YesNo.YES_1); hpxt001.setStatus(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPXT001.UPDATE_STATUS, hpxt001); DaoUtils.update(HPXT001.UPDATE_STATUS, hpxt001);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.returnStatus", "返还")});
} catch (PlatException e) { } catch (PlatException e) {
e.printStackTrace(); e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE); inInfo.setStatus(EiConstant.STATUS_FAILURE);
......
package com.baosight.hpjx.hp.xt.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.xt.domain.HPXT003;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.List;
import java.util.Map;
/**
*
*/
public class ServiceHPXT003 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXT003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HPXT003.QUERY, new HPXT003());
// List sum = dao.query(HPSqlConstant.HPKC001.QUERY_SUM, queryRow);
// inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "车辆维保",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPXT003 hpxt003 = new HPXT003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxt003.fromMap(map);
hpxt003.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPXT003.DELETE_FLAG, hpxt003);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "车辆维保",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HPXT003 hpxt003 = new HPXT003();
hpxt003.fromMap(resultRow);
if (hpxt003.getId() == null || hpxt003.getId() == 0) {
this.add(hpxt003);
} else {
this.modify(hpxt003);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HPXT003 hpxt003) {
this.setBaseInfo(hpxt003);
DaoUtils.insert(HPXT003.INSERT, hpxt003);
}
/**
* 设置基础信息
*
* @param hpxt003
*/
private void setBaseInfo(HPXT003 hpxt003) {
// 去除日期字符串中的-
hpxt003.setMaintenanceDate(StringUtil.removeHorizontalLine(hpxt003.getMaintenanceDate()));
//生成维保单号
hpxt003.setMaintenanceNumber(SequenceGenerator.getNextSequence(HPConstant.SequenceId.MAINTENANCE_NUMBER));
}
/**
* 修改操作
*/
public void modify(HPXT003 hpxt003) {
DaoUtils.update(HPXT003.UPDATE, hpxt003);
}
}
package com.baosight.hpjx.hp.xt.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.xt.domain.HPXT001;
import com.baosight.hpjx.hp.xt.domain.HPXT004;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.List;
import java.util.Map;
/**
*
*/
public class ServiceHPXT004 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXT004.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HPXT004.QUERY, new HPXT004());
// List sum = dao.query(HPSqlConstant.HPKC001.QUERY_SUM, queryRow);
// inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "会议室管理",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPXT004 hpxt004 = new HPXT004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxt004.fromMap(map);
hpxt004.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPXT004.DELETE_FLAG, hpxt004);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "会议室管理",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HPXT004 hpxt004 = new HPXT004();
hpxt004.fromMap(resultRow);
if (hpxt004.getId() == null || hpxt004.getId() == 0) {
this.add(hpxt004);
} else {
this.modify(hpxt004);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HPXT004 hpxt004) {
this.setBaseInfo(hpxt004);
//生成会议室管理申请
hpxt004.setApplyNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.CONFERENCE_APPLY_NO));
DaoUtils.insert(HPXT004.INSERT, hpxt004);
}
/**
* 设置基础信息
*
* @param hpxt004
*/
private void setBaseInfo(HPXT004 hpxt004) {
// 去除日期字符串中的-
hpxt004.setApplyDate(StringUtil.removeHorizontalLine(hpxt004.getApplyDate()));
hpxt004.setStartTime(StringUtil.removeHorizontalLine(hpxt004.getStartTime()));
hpxt004.setEndTime(StringUtil.removeHorizontalLine(hpxt004.getEndTime()));
}
/**
* 修改操作
*/
public void modify(HPXT004 hpxt004) {
DaoUtils.update(HPXT004.UPDATE, hpxt004);
}
@OperationLogAnnotation(operModul = "会议室管理",operType = "提交",operDesc = "提交审批操作")
public EiInfo approve(EiInfo inInfo){
int i = 0;
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPXT004 hpxt004 = new HPXT004();
hpxt004.fromMap(resultRow);
hpxt004.setProApplyStatus(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPXT004.UPDATE_PRO_APPLY_STATUS,hpxt004);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.approve", "提交")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("提交失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "会议室管理",operType = "返还",operDesc = "返还操作")
public EiInfo returnStatus(EiInfo inInfo){
int i = 0;
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPXT004 hpxt004 = new HPXT004();
hpxt004.fromMap(resultRow);
hpxt004.setStatus(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPXT004.UPDATE_STATUS, hpxt004);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.returnStatus", "返还")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
logError("返还失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
...@@ -411,7 +411,7 @@ function deleteFunc() { ...@@ -411,7 +411,7 @@ function deleteFunc() {
if(flag){ if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HPCG001", "delete", true, JSUtils.submitGridsData("result", "HPXT001", "delete", true,
function (e) { function (e) {
query(); query();
}); });
......
...@@ -24,8 +24,8 @@ $(function () { ...@@ -24,8 +24,8 @@ $(function () {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>'; + 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>';
} }
if (item.status==0){ if (item.status==0 && item.id){
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="approveFunc(' + item.id + ')" >返还</a>'; 'onclick="approveFunc(' + item.id + ')" >返还</a>';
} }
return template; return template;
...@@ -205,20 +205,12 @@ function approveFunc(id) { ...@@ -205,20 +205,12 @@ function approveFunc(id) {
message("请选择数据"); message("请选择数据");
return; return;
} }
let inEiInfo = new EiInfo(); JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"返还\"操作? ", {
inEiInfo.set("id", id); ok: function () {
EiCommunicator.send('HPXT001', 'returnStatus', inEiInfo, { JSUtils.submitGridsData("result", "HPXT001", "returnStatus", true);
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
} }
); });
} }
/** /**
* 显示附件清单 * 显示附件清单
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="130" align="center"/>
<EF:EFColumn ename="applyDate" cname="申请日期" width="110" align="center" editType="date" <EF:EFColumn ename="applyDate" cname="申请日期" width="110" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/>
<EF:EFColumn ename="applyNo" cname="申请单号" enable="false" width="130" align="center"/> <EF:EFColumn ename="applyNo" cname="申请单号" enable="false" width="130" align="center"/>
......
$(function () {
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
/*pageable: {
input: true,
numeric: false,
pageSizes: [10, 50 , 100 , 200]
}*/
}
});
IPLATUI.EFGrid= {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '';
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>';
}
return template;
}
}, {
field: "maintenanceDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}],
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete'
|| e.eiInfo.extAttr.methodName == 'approve'){
query();
}
}
}
}
// $("#APPROVE").on("click",function () {
// approveFuncs();
// })
downKeyUp();
})
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let maintenanceType= item.get("maintenanceType");
if(isBlank(maintenanceType)){
message("选中的第"+(index+1)+"行\"维保类型\",不能为空!");
flag = false;
return false;
}
let licensePlate= item.get("licensePlate");
if(isBlank(licensePlate)){
message("选中的第"+(index+1)+"行\"车牌号\",不能为空!");
flag = false;
return false;
}
let maintenanceCost= item.get("maintenanceCost");
if(isBlank(maintenanceCost)){
message("选中的第"+(index+1)+"行\"维保费用\",不能为空!");
flag = false;
return false;
}
let maintenanceReason= item.get("maintenanceReason");
if(isBlank(maintenanceReason)){
message("选中的第"+(index+1)+"行\"维保原因\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPXT003", "save", true,
function (e) {
query();
});
btnNode.attr("disabled", false);
}
});
}
}
/**
* 提交
*/
// function approveFuncs() {
// let rows = resultGrid.getCheckedRows();
// if (rows.length < 1) {
// message("请选择数据");
// return;
// }
// let flag = true;
// $.each(rows, function(index, item) {
// let proApplyStatus= item.get("proApplyStatus");
// if(proApplyStatus=="1"){
// message("选中的第"+(index+1)+"行\"数据已提交\",不能再次选中提交!");
// flag = false;
// return false;
// }
// });
// if(flag) {
// JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
// ok: function () {
// JSUtils.submitGridsData("result", "HPXT001", "approve", true);
// }
// });
// }
// }
/**
* 删除明细
*/
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let status= item.get("proApplyStatus");
if(status=="1"){
message("选中的第"+(index+1)+"行记录已提交,不能删除!");
flag = false;
return false;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPXT003", "delete", true,
function (e) {
query();
});
}
});
}
}
/**
* 显示附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HPXT001A?methodName=initLoad&inqu_status-0-bizType=CLWB&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/4/26
Time: 17:09
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="车辆维保">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="车牌号" ename="inqu_status-0-licensePlateCode" colWidth="3"/>
<EF:EFSelect cname="维保类型" ename="inqu_status-0-maintenanceType" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpxt.maintenanceType"/>
</EF:EFSelect>
<EF:EFInput cname="经办人" ename="inqu_status-0-applyPersonnel" colWidth="3"/>
</div>
<%--<div class="row">
<EF:EFSelect cname="存货名称" ename="inqu_status-0-inventCode" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" ename="inqu_status-0-spec" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="创建日期(从)" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>--%>
<%--<div class="row">
<EF:EFInput cname="采购单号" ename="inqu_status-0-proApplyNo" colWidth="3"/>
<EF:EFSelect ename="inqu_status-0-factoryCode" cname="厂区" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="是否删除" ename="inqu_status-0-deleteFlag" colWidth="3" defaultValue="0">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/>
</EF:EFSelect>
</div>--%>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="maintenanceDate" cname="维护日期" width="110" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/>
<EF:EFColumn ename="maintenanceNumber" cname="维保单号" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="maintenanceType" cname="维保类型" width="80" align="center" enable="true" required="true">
<EF:EFCodeOption codeName="hpjx.hpxt.maintenanceType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="licensePlate" cname="车牌号" enable="true" width="130" align="center" required="true"/>
<EF:EFColumn ename="handler" cname="经办人" enable="true" width="130" align="center" required="true"/>
<EF:EFColumn ename="maintenanceCost" cname="维保费用"
width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="maintenanceReason" cname="维保原因" width="80" align="center" enable="true" required="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
/*pageable: {
input: true,
numeric: false,
pageSizes: [10, 50 , 100 , 200]
}*/
}
});
IPLATUI.EFGrid= {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '';
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>';
}
if (item.id && item.status==0){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="approveFunc(' + item.id + ')" >返还</a>';
}
return template;
}
}, {
field: "applyDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}],
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete'
|| e.eiInfo.extAttr.methodName == 'approve'){
query();
}
}
}
}
$("#APPROVE").on("click",function () {
approveFuncs();
})
downKeyUp();
})
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let applyPersonnel= item.get("applyPersonnel");
if(isBlank(applyPersonnel)){
message("选中的第"+(index+1)+"行\"申请时人\",不能为空!");
flag = false;
return false;
}
let meetingRoom= item.get("meetingRoom");
if(isBlank(meetingRoom)){
message("选中的第"+(index+1)+"行\"会议室\",不能为空!");
flag = false;
return false;
}
let meetingSubject= item.get("meetingSubject");
if(isBlank(meetingSubject)){
message("选中的第"+(index+1)+"行\"会议主题\",不能为空!");
flag = false;
return false;
}
let startTime= item.get("startTime");
let endTime= item.get("endTime");
if (new Date(startTime) > new Date(endTime)){
message("开始时间\"不能大于\"\"结束时间\"!");
flag = false;
return false;
}
let meetingNature= item.get("meetingNature");
if(isBlank(meetingNature)){
message("选中的第"+(index+1)+"行\"会议性质\",不能为空!");
flag = false;
return false;
}
let importanceLevel= item.get("importanceLevel");
if(isBlank(importanceLevel)){
message("选中的第"+(index+1)+"行\"重要程度\",不能为空!");
flag = false;
return false;
}
let status= item.get("proApplyStatus");
if(status=="1"){
message("选中的第"+(index+1)+"行记录已提交,不能修改!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPXT004", "save", true,
function (e) {
query();
});
btnNode.attr("disabled", false);
}
});
}
}
/**
* 提交
*/
function approveFuncs() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let proApplyStatus= item.get("proApplyStatus");
if(proApplyStatus=="1"){
message("选中的第"+(index+1)+"行\"数据已提交\",不能再次选中提交!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPXT004", "approve", true);
}
});
}
}
/**
* 删除明细
*/
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPXT004", "delete", true,
function (e) {
query();
});
}
});
}
}
function approveFunc(id) {
let rows = resultGrid.getDataItems();
if (rows.length < 1) {
message("请选择数据");
return;
}
let inEiInfo = new EiInfo();
JSUtils.confirm("确定对勾选中的数据做\"返还\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPXT004", "returnStatus", true,
function (e) {
query();
});
}
});
}
/**
* 显示附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HPXT001A?methodName=initLoad&inqu_status-0-bizType=HYSGL&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/4/26
Time: 17:09
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="会议室管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDateSpan startCname="申请日期(从)" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan>
<EF:EFInput cname="申请人" ename="inqu_status-0-applyPersonnel" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="130" align="center"/>
<EF:EFColumn ename="applyDate" cname="申请日期" width="110" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/>
<EF:EFColumn ename="applyNo" cname="申请单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="applyPersonnel" cname="申请人" enable="true" width="130" align="center" required="true"/>
<EF:EFColumn ename="meetingRoom" cname="会议室" enable="true" width="130" align="center" required="true"/>
<EF:EFColumn ename="meetingSubject" cname="会议主题" enable="true" width="130" align="center" required="true"/>
<EF:EFComboColumn ename="meetingNature" cname="会议性质" width="130" align="center" enable="true" required="true">
<EF:EFCodeOption codeName="hpjx.hpxt.meetingNature"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="importanceLevel" cname="重要程度" width="130" align="center" enable="true" required="true">
<EF:EFCodeOption codeName="hpjx.hpxt.importanceLevel"/>
</EF:EFComboColumn>
<EF:EFColumn ename="startTime" cname="开始时间" width="110" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="endTime" cname="结束时间" width="110" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="proApplyStatus" cname="提交状态" width="80" align="center" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpcg.proApplyStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="status" cname="返还状态" width="80" align="center"
textField="textField" valueField="valueField" readonly="true" >
<EF:EFOption label="未返还" value="0"/>
<EF:EFOption label="已返还" value="1"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment