Commit 340de7a7 by liuyang

Merge branch 'dev' of http://git.pseer.com/platform/hp-smart into dev-ly

parents 2afb21b7 eb7463c2
......@@ -56,6 +56,7 @@ public class HPCG002 extends DaoEPBase {
public static final String INSERT = "HPCG002.insert";
public static final String UPDATE = "HPCG002.update";
public static final String DELETE = "HPCG002.delete";
public static final String CHECK = "HPCG002.check";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 公司编码*/
......@@ -66,11 +67,11 @@ public class HPCG002 extends DaoEPBase {
private String updatedBy = " "; /* 修改人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/
private Integer deleteFlag = 0; /* 是否删除 0-否1-是*/
private Integer deleteFlag; /* 是否删除 0-否1-是*/
private String proPlanDate = " "; /* 采购计划日期*/
private String proPlanNo = " "; /* 采购计划单号*/
private String inventType = " "; /* 存货类型*/
private Integer proPlanStatus = 0; /* 提交状态 0-未提交 1-部分提交 2-全部提交*/
private Integer proPlanStatus; /* 提交状态 0-未提交 1-部分提交 2-全部提交*/
/**
* initialize the metadata.
......
......@@ -4,6 +4,7 @@ import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.cg.domain.HPCG002;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.xs.domain.HPXS006;
import com.baosight.hpjx.util.CommonMethod;
......@@ -28,17 +29,10 @@ public class ServiceHPCG002 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "售后维修",operType = "查询",operDesc = "初始化")
@OperationLogAnnotation(operModul = "采购计划",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
/*inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0, "userId",UserSessionUtils.getFactoryCode().get(0));*/
inInfo = super.query(inInfo, HPXS006.QUERY, new HPXS006());
Map map = new HashMap();
map.put("companyCode", UserSessionUtils.getCompanyCode());
map.put("factoryCodes", getFactoryCode(inInfo));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.REP_USER_ID_BLOCK_ID), map,true);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
inInfo = super.query(inInfo, HPCG002.QUERY, new HPCG002());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -50,150 +44,15 @@ public class ServiceHPCG002 extends ServiceBase {
* 查询操作.
*/
@Override
@OperationLogAnnotation(operModul = "售后维修",operType = "查询")
@OperationLogAnnotation(operModul = "采购计划",operType = "查询")
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS006.FIELD_REP_DATE,
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS006.FIELD_REP_DATE)));
EiInfo outInfo = super.query(inInfo, HPXS006.QUERY, new HPXS006());
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "createdDateFrom",
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "createdDateFrom")));
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "createdDateTo",
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "createdDateTo")));
EiInfo outInfo = super.query(inInfo, HPCG002.QUERY, new HPCG002());
return outInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "售后维修",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPXS006 hpsc006 = new HPXS006();
hpsc006.fromMap(resultRows.get(i));
hpsc006.setRepDate(DateUtils.formatShort(hpsc006.getRepDate()));
/* HPPZ003 fPz003 = new HPPZ003();
if (hpsc001.getPrinc2().trim().isEmpty()) {
fPz003.setCustCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPPZ003_CUST_CODE));
fPz003.setCustType(CompanyTypeEnum.GQ.getCode());
fPz003.setCustName(resultRows.get(i).get("princ2Name").toString());
fPz003.setCompanyName(resultRows.get(i).get("princ2Name").toString());
DaoUtils.insert("HPPZ003.insert", fPz003);
hpsc001.setPrinc2(fPz003.getCustCode());
}*/
if (hpsc006.getId() == null || hpsc006.getId() == 0) {
this.add(hpsc006);
} else {
this.modify(hpsc006);
}
}
//inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param hpxs006
* @throws Exception
*/
private void add(HPXS006 hpxs006) throws Exception {
hpxs006.setRepOrderNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPXS006_PROD_NO));
DaoUtils.insert(HPXS006.INSERT, hpxs006);
}
/**
* 修改数据
*
* @param hpxs006
*/
private void modify(HPXS006 hpxs006) {
DaoUtils.update(HPXS006.UPDATE, hpxs006);
}
/**
* 删除操作.
*/
@OperationLogAnnotation(operModul = "售后维修",operType = "删除")
public EiInfo delete(EiInfo eiInfo) {
HPXS006 hpxs006 = new HPXS006();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs006.fromMap(map);
this.dao.delete(HPXS006.DELETE, hpxs006.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return query(eiInfo);
}
/**
*审核
*/
@OperationLogAnnotation(operModul = "售后维修",operType = "审核")
public EiInfo check(EiInfo eiInfo) {
HPXS006 hpxs006 = new HPXS006();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs006.fromMap(map);
DaoUtils.update(HPXS006.CHECK, hpxs006.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("审核失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("审核失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("审核成功!");
return eiInfo;
}
/**
* @param inInfo
* @return
*/
public List<String> getFactoryCode(EiInfo inInfo) {
List<String> factorycodes = new ArrayList();
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "userId", UserSessionUtils.getUserId());
inInfo = super.query(inInfo, HPXS006.QUERYFACTORY);
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
List rows = new ArrayList();
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
String factory = (String) map.get("factoryCode");
factorycodes.add(factory);
}
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询组失败");
}
return factorycodes;
}
}
package com.baosight.hpjx.hp.cg.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.cg.domain.HPCG002;
import com.baosight.hpjx.hp.cg.domain.HPCG002A;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC001;
import com.baosight.hpjx.hp.xs.domain.HPXS006;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.LogUtils;
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.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*;
/**
*
*/
public class ServiceHPCG002A extends ServiceBase {
// 指定存货类型
private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.RAW.getCode(),
InventTypeEnum.CONSUMABLE.getCode()};
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "采购计划详情",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPCG002A.QUERY, new HPCG002A());
Map queryMap = new HashMap();
queryMap.put("inventTypes", DEFAULT_INVENT_CODE);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_ALL_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUPPLIER_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPCG002A().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
@OperationLogAnnotation(operModul = "采购计划详情",operType = "查询")
public EiInfo query(EiInfo inInfo) {
EiInfo outInfo = super.query(inInfo, HPCG002A.QUERY, new HPCG002A());
return outInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购计划详情",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPCG002A hpcg002A = new HPCG002A();
hpcg002A.fromMap(resultRows.get(i));
if (hpcg002A.getId() == null || hpcg002A.getId() == 0) {
this.add(hpcg002A);
} else {
this.modify(hpcg002A);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param hpcg002A
* @throws Exception
*/
private void add(HPCG002A hpcg002A) throws Exception {
DaoUtils.insert(HPCG002A.INSERT, hpcg002A);
}
/**
* 修改数据
*
* @param hpcg002A
*/
private void modify(HPCG002A hpcg002A) {
DaoUtils.update(HPCG002A.UPDATE, hpcg002A);
}
/**
* 删除操作.
*/
@OperationLogAnnotation(operModul = "采购计划详情",operType = "删除")
public EiInfo delete(EiInfo eiInfo) {
HPCG002A hpcg002A = new HPCG002A();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpcg002A.fromMap(map);
this.dao.delete(HPXS006.DELETE, hpcg002A.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return query(eiInfo);
}
/**
*审核
*/
@OperationLogAnnotation(operModul = "采购计划详情",operType = "提交")
public EiInfo check(EiInfo eiInfo) {
HPCG002A hpcg002A = new HPCG002A();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
EiInfo inInfo = new EiInfo();
HPCG002 hpcg002 = new HPCG002();
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpcg002A.fromMap(map);
hpcg002.setId(hpcg002A.getParentId());
hpcg002.setProPlanStatus(hpcg002A.getProPlanStatus());
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0, HPCG002A.FIELD_PARENT_ID,hpcg002A.getParentId());
DaoUtils.update(HPCG002A.CHECK, hpcg002A.toMap());
}
EiInfo outInfo = super.query(inInfo, HPCG002A.QUERY, new HPCG002A());
EiBlock outBlock = outInfo.getBlock(EiConstant.resultBlock);
Integer num = 0;
for (int i = 0; i < outBlock.getRowCount(); i++) {
Map<?, ?> map = outBlock.getRow(i);
hpcg002A.fromMap(map);
if(hpcg002A.getProApplyStatus()==1){
num = num+1;
}
DaoUtils.update(HPCG002A.CHECK, hpcg002A.toMap());
}
if(num==outBlock.getRowCount()&&hpcg002.getProPlanStatus()!=2){
hpcg002.setProPlanStatus(2);
DaoUtils.update(HPCG002.CHECK, hpcg002.toMap());
}else if(num!=outBlock.getRowCount()&&hpcg002.getProPlanStatus()!=1){
hpcg002.setProPlanStatus(1);
DaoUtils.update(HPCG002.CHECK, hpcg002.toMap());
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("提交成功!");
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("提交失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("提交失败!", e.getMessage());
return eiInfo;
}
return eiInfo;
}
/**
* @param inInfo
* @return
*/
public List<String> getFactoryCode(EiInfo inInfo) {
List<String> factorycodes = new ArrayList();
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "userId", UserSessionUtils.getUserId());
inInfo = super.query(inInfo, HPXS006.QUERYFACTORY);
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
List rows = new ArrayList();
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
String factory = (String) map.get("factoryCode");
factorycodes.add(factory);
}
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询组失败");
}
return factorycodes;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-04-26 17:16:55
Generate time : 2024-04-26 16:24:58
Version : 1.0
schema : hpjx
tableName : T_HPCG002
......@@ -21,34 +21,22 @@
-->
<sqlMap namespace="HPCG002">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
......@@ -64,12 +52,6 @@
<isNotEmpty prepend=" AND " property="proPlanStatus">
PRO_PLAN_STATUS = #proPlanStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom">
PRO_PLAN_DATE &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
PRO_PLAN_DATE &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -91,6 +73,7 @@
PRO_PLAN_STATUS as "proPlanStatus" <!-- 提交状态 0-未提交 1-部分提交 2-全部提交 -->
FROM ${hpjxSchema}.T_HPCG002 WHERE 1=1
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -104,7 +87,8 @@
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCG002 WHERE 1=1
<include refid="condition" />
<include refid="condition" />
<include refid="authCondition" />
</select>
<!--
......@@ -196,4 +180,12 @@
ID = #id#
</update>
<update id="check">
UPDATE ${hpjxSchema}.T_HPCG002
SET
PRO_PLAN_STATUS = #proPlanStatus# <!-- 提交状态 0-未提交 1-部分提交 2-全部提交 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -233,6 +233,12 @@
SELECT NODE_ENAME as "memberId",TREE_ENAME as "parentId" FROM ${platSchema}.TEDPI10 WHERE NODE_ENAME = #memberId#
</select>
<!-- 更新图片地址 -->
<update id="updateImage">
UPDATE ${platSchema}.TEDPI10
SET NODE_IMAGE_PATH = #nodeImagePath#
WHERE 1=1
AND NODE_ENAME = #nodeEname#
</update>
</sqlMap>
......@@ -5,7 +5,10 @@
package com.baosight.iplat4j.ef.service;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -15,6 +18,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -61,4 +65,27 @@ public class ServiceEF0000 extends ServiceEPBase {
return outInfo;
}
/**
* 上传图标
*
* @param inInfo
* @return
*/
public EiInfo uploadIcon(EiInfo inInfo) {
try {
String nodeEname = inInfo.getString("nodeEname");
String docId = inInfo.getString("docId");
AssertUtils.isEmpty(nodeEname, "请选择菜单");
AssertUtils.isEmpty(docId, "请上传图标");
Map updateMap = new HashMap();
updateMap.put("nodeEname", nodeEname);
updateMap.put("nodeImagePath", docId);
dao.update("EDPI10.updateImage", updateMap);
inInfo.setMsg("上传图标成功");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "上传图标失败");
}
return inInfo;
}
}
......@@ -75,6 +75,8 @@ $(function () {
resultGrid.dataSource.page(1);
});
$("#UPLOAD_ICON").on("click", uploadIcon);
IPLATUI.EFGrid = {
"result": {
loadComplete:function (e){
......@@ -128,3 +130,46 @@ $(function () {
}
});
/**
* 上传图标
*/
let uploadIcon = function () {
let rows = resultGrid.getCheckedRows()
if (rows.length != 1) {
message("请选择一条菜单数据");
return;
}
JSColorbox.open({
href: "HPSC099?methodName=initLoad",
title: "<div style='text-align: center;'>图标上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(docId) {
let rows = resultGrid.getCheckedRows();
let inEiInfo = new EiInfo();
inEiInfo.set("nodeEname", rows[0]['node_ename']);
inEiInfo.set("docId", docId);
EiCommunicator.send('EF0000', 'uploadIcon', inEiInfo, {
onSuccess(res) {
message(res.msg);
if (res.status > -1) {
resultGrid.dataSource.page(1);
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
......@@ -2,10 +2,33 @@ $(function () {
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="jump(' + item.id + ')" >计划详情</a>';
return template;
}
}
],
}
});
let query = function () { resultGrid.dataSource.page(1);}
function jump(id) {
var herf = ctx + "\\web\\" + "HPCG002A?inqu_status-0-parentId=" + id + "&efParentFormEname=HPCG002";
window.open(herf);
}
......@@ -11,7 +11,9 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="采购计划">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
......@@ -23,12 +25,11 @@
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="proPlanStatus" cname="提交状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpcg.proPlanStatus"/>
</EF:EFSelect>
</div>
<EF:EFSelect blockId="inqu_status" row="0" ename="proPlanStatus" cname="提交状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpxs.repStatus"/>
</EF:EFSelect>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
......@@ -43,8 +44,8 @@
readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="repStatus" cname="维修状态" width="80" align="center" readonly="true" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpxs.repStatus"/>
<EF:EFComboColumn ename="proPlanStatus" cname="提交状态" width="80" align="center" readonly="true" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpcg.proPlanStatus"/>
</EF:EFComboColumn>
<%-- <EF:EFColumn cname="创建人" ename="createdName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
......
let whNameGlobalData = [];
let inventNameGlobalData = [];
let inventAllGlobalData = [];
$(function () {
$("#QUERY").on("click", query);
......@@ -11,18 +14,19 @@ $(function () {
columns: [{
field: "operator",
template: function (item) {
let auditStatus = item.repStatus;
let auditStatus = item.proApplyStatus;
let template = '';
if (auditStatus) {
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',1)" >审核</a>';
'onclick="check(' + item.id + ',1, \''+ item.custCode + '\',\''+ item.parentId + '\',\''+ item.proPlanStatus + '\')" >提交</a>';
}
}
return template;
}
}],
loadComplete: function(grid) {
loadComplete: function (grid) {
},
onSave: function (e) {
......@@ -45,19 +49,43 @@ $(function () {
}
}
downKeyUp();
// 规格
initSpec();
});
let query = function () { resultGrid.dataSource.page(1);}
/**
* 初始化规格
*/
let initSpec = function () {
let inInfo = new EiInfo();
// 1.原料,2.耗材
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ006", "queryComboBoxAll", inInfo, {
onSuccess: function (ei) {
inventAllGlobalData = ei.getBlock("invent_all_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
function check(id, auditStatus) {
function check(id, auditStatus,custCode,parentid,proPlanStatus) {
if (isBlank(custCode)) {
message("行供应商不能为空");
return;
}
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-repStatus", auditStatus);
EiCommunicator.send('HPXS006', 'check', inEiInfo, {
inEiInfo.set("result-0-parentId", parentid);
inEiInfo.set("result-0-proApplyStatus", auditStatus);
inEiInfo.set("result-0-proPlanStatus", proPlanStatus);
EiCommunicator.send('HPCG002A', 'check', inEiInfo, {
onSuccess(response) {
//NotificationUtil(response.msg);
message("审核成功");
message("提交成功");
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
......@@ -94,30 +122,26 @@ function save() {
return;
}
for (let i = 0; i < rows.length; i++) {
if (rows[i]['repStatus']==1) {
message("勾选的第" + (i + 1) + "行已维修不允许修改!");
if (rows[i]['proApplyStatus']==1) {
message("勾选的第" + (i + 1) + "行已提交不允许修改!");
return;
}
if (isBlank(rows[i]['repDate'])) {
message("勾选的第" + (i + 1) + "行维修日期不能为空");
if (isBlank(rows[i]['custCode'])) {
message("勾选的第" + (i + 1) + "行供应商不能为空");
return;
}
if (isBlank(rows[i]['repCustomId'])) {
message("勾选的第" + (i + 1) + "行客户名称不能为空");
if (!isPositiveInteger(rows[i]['planAmount'])) {
message("勾选的第" + (index + 1) + "行\"计划数量\"必须是大于0的整数");
return;
}
if (isBlank(rows[i]['repUserId'])) {
message("勾选的第" + (i + 1) + "行维修人员不能为空");
return;
}
if (isBlank(rows[i]['repStatus'])) {
message("勾选的第" + (i + 1) + "行维修状态不能为空");
return;
if(!isPositiveNumber(rows[i]['planWeight'])){
message("选中的第"+(index+1)+"行\"计划重量\"必须是大于0的数");
return ;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPXS006", "save", true);
JSUtils.submitGridsData("result", "HPCG002A", "save", true);
}
})
}
......
......@@ -16,6 +16,10 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="采购申请单号" ename="inqu_status-0-proApplyNo" colWidth="3"/>
<EF:EFSelect cname="供应商名称" ename="inqu_status-0-repCustomId" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="supplier_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
......@@ -26,15 +30,15 @@
<EF:EFColumn ename="companyCode" cname="公司编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="custCode" cname="供应商名称" width="120" align="center" required="true"
blockName="customer_record_block_id" textField="textField" valueField="valueField"
blockName="supplier_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="proApplyDate" cname="采购申请单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="proApplyDate" cname="采购申请日期" width="100" align="center" editType="date" readonly="false"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="proApplyNo" cname="采购申请单号" enable="false" width="140" align="center" readonly="true"/>
<EF:EFColumn ename="proApplyDate" cname="采购申请日期" width="100" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" />
<EF:EFComboColumn ename="factoryCode" required="true" cname="厂区" width="110" align="center" defaultValue=""
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue=""
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
......@@ -42,9 +46,9 @@
readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="150" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="150" align="center" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" align="center" readonly="true" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
......@@ -54,16 +58,17 @@
<EF:EFColumn ename="material" cname="材质" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="unit" cname="单位" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="applyAmount" cname="申请数量" format="{0:N0}" maxLength="20" width="100" align="right"
required="true" readonly="true"/>
readonly="true"/>
<EF:EFColumn ename="applyWeight" cname="申请重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="applyAmount" cname="现有库存数量" format="{0:N0}" maxLength="20" width="100" align="right"
required="true" readonly="true"/>
<EF:EFColumn ename="applyWeight" cname="现有库存重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invAmount" cname="现有库存数量" format="{0:N0}" maxLength="20" width="100" align="right"
readonly="true"/>
<EF:EFColumn ename="invWeight" cname="现有库存重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="planAmount" cname="计划数量" format="{0:N0}" maxLength="20" width="100" align="right"
required="true" readonly="true"/>
<EF:EFColumn ename="planWeight" cname="计划重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="proApplyStatus" cname="提交状态" width="80" align="center" readonly="true" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpxs.repStatus"/>
enable="false"/>
<EF:EFColumn ename="planWeight" cname="计划重量(T)" width="120" align="right" format="{0:N3}"
required="true"/>
<EF:EFComboColumn ename="proApplyStatus" cname="提交状态" width="80" align="center" readonly="true" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpcg.proApplyStatus"/>
</EF:EFComboColumn>
<%-- <EF:EFColumn cname="创建人" ename="createdName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
......
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