Commit 1471df14 by 江和松

详情取消增加功能,增加选择功能,点击选择弹窗显示存货的库存明细

parent d1321201
...@@ -43,6 +43,18 @@ public class HgKcSqlConst { ...@@ -43,6 +43,18 @@ public class HgKcSqlConst {
} }
/** /**
* HGKC013A SQL 定义
*
* @author:jhs
* @date:2024/10/30,16:45
*/
public class HgKc013A {
// 锁
public static final String LOCK = "HGKC013A.lock";
}
/**
* HGKC014 SQL 定义 * HGKC014 SQL 定义
* *
* @author:songx * @author:songx
......
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGKC013B extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "综合库存", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("inventTypeDetails", InventTypeDetailEnum.getInentTypeTwo());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BLOCK_ID), paramMap);
// CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), paramMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
EiInfoUtils.addBlock(inInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC010().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "综合库存", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
// inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "inventTypeDetails", InventTypeDetailEnum.getInentTypeTwo());
queryRow.put("isInvQty", CommonConstant.YesNo.YES_1);
inInfo = super.query(inInfo, HGSqlConstant.HgKc010.QUERY_LY, new HGKC010());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 确认操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "实时库存", operType = "查询", operDesc = "确认")
public EiInfo confirm(EiInfo inInfo) {
try {
String parentId = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,
HGKC013A.FIELD_PARENT_ID);
List<HGKC010B> fKc010Bs = MapUtils.toDaoEPBases(inInfo, HGKC010B.class);
// db数据
Map<Long, HGKC010> dbKc010Map = HGKCUtils.HgKc010.lockGetDataEp(fKc010Bs);
// 调拨单明细
List<HGKC013A> dbKc013As = HGKCUtils.HgKc013A.listByPrimaryId(parentId);
// 调拨单主信息
HGKC013 hgkc013 = HGKCUtils.HgKc013.get(parentId);
// 数据校验
this.checkConfirmData(fKc010Bs, dbKc013As, dbKc010Map, hgkc013);
// 保存数据
this.confirmData(fKc010Bs, dbKc010Map, hgkc013);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fKc010Bs.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 确认数量
*
* @param fKc010Bs
* @param dbKc010Map
* @param dbKc013
*/
private void confirmData(List<HGKC010B> fKc010Bs, Map<Long, HGKC010> dbKc010Map, HGKC013 dbKc013) {
for (HGKC010B fKc010B : fKc010Bs) {
Long id = fKc010B.getId();
HGKC010 dbKc010 = dbKc010Map.get(id);
HGKC013A newKc013A = BeanUtils.copy(dbKc010, HGKC013A.class);
newKc013A.setParentId(dbKc013.getId());
newKc013A.setCalloutWhCode(dbKc013.getCalloutWhCode());
newKc013A.setCalloutWhName(dbKc013.getCalloutWhName());
newKc013A.setCallinWhCode(dbKc013.getCallinWhCode());
newKc013A.setCallinWhName(dbKc013.getCallinWhName());
//存货ID
newKc013A.setInventRecordId(dbKc010.getId());
newKc013A.setQuantity(fKc010B.getApplyQty());
newKc013A.setUnitWeight(fKc010B.getInvUnitWeight());
newKc013A.setWeight(fKc010B.getInvWeight());
newKc013A.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
DaoUtils.insert(HGKC013A.INSERT, newKc013A);
}
}
/**
* 数据校验
*
* @param fKc010Bs
* @param dbKc013As
* @param dbKc010Map
* @param dbKc013
*/
private void checkConfirmData(List<HGKC010B> fKc010Bs, List<HGKC013A> dbKc013As, Map<Long, HGKC010> dbKc010Map,
HGKC013 dbKc013) {
AssertUtils.isEquals(dbKc013.getStatus(), HGConstant.ProductStatus.YTJ, "调拨单已提交,不可修改");
for (HGKC013A dbKc013A : dbKc013As) {
for (Map.Entry<Long, HGKC010> dbKc010MapEntry : dbKc010Map.entrySet()) {
HGKC010 dbKc010 = dbKc010MapEntry.getValue();
AssertUtils.isEquals(dbKc010.getInventCode(), dbKc013A.getInventCode(),
String.format("此调拨单已选择存货:%s", dbKc010.getInventCode()));
}
}
for (HGKC010B fKc010B : fKc010Bs) {
AssertUtils.isGe(BigDecimal.ZERO, fKc010B.getApplyQty(), String.format("库存【%s】申请数量必须大于0",
fKc010B.getInventCode()));
// 查询已申请未提交的明细数量
BigDecimal applyQtySum = CollectionUtils.isEmpty(dbKc013As) ? BigDecimal.ZERO
: dbKc013As.stream().filter(o->o.getCalloutWhCode().equals(fKc010B.getWhCode()))
.map(HGKC013A::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal totalApplyQty = applyQtySum.add(fKc010B.getApplyQty());
HGKC010 dbKc010 = dbKc010Map.get(fKc010B.getId());
AssertUtils.isGt(totalApplyQty, dbKc010.getInvQty(), String.format("存货【%s(%s)】累计申请数量【%s】超过库存数量【%s】",
fKc010B.getInventCode(), fKc010B.getInventName(),
totalApplyQty.stripTrailingZeros().toPlainString(), dbKc010.getInvQty()));
}
}
}
...@@ -156,6 +156,15 @@ ...@@ -156,6 +156,15 @@
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 --> UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
</sql> </sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGKC013A"> <select id="query" parameterClass="java.util.HashMap" resultClass="HGKC013A">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
...@@ -340,4 +349,12 @@ ...@@ -340,4 +349,12 @@
ID = #id# ID = #id#
</update> </update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGKC013A
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
</sqlMap> </sqlMap>
...@@ -1493,6 +1493,113 @@ public class HGKCTools { ...@@ -1493,6 +1493,113 @@ public class HGKCTools {
} }
/** /**
* HGKC013A 定义
*
* @author:jhs
* @date:2024/9/29,10:47
*/
public static class HgKc013A {
/**
* 锁
*
* @param ids
* @return
*/
public static void lockEx(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("ids", ids);
DaoBase.getInstance().update(HgKcSqlConst.HgKc008A.LOCK, paramMap);
}
/**
* 锁
*
* @param ids
* @return
*/
public static void lock(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("ids", ids);
DaoBase.getInstance().update(HgKcSqlConst.HgKc013A.LOCK, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static List<HGKC013A> listEx(List<Long> ids) {
AssertUtils.isEmpty(ids, "ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGKC013A.QUERY, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static Map<Long, HGKC013A> mapEx(List<Long> ids) {
List<HGKC013A> results = listEx(ids);
return results.stream().collect(Collectors.toMap(HGKC013A::getId, item -> item));
}
/**
* 查询
*
* @param ids
* @return
*/
public static List<HGKC013A> list(List<Long> ids) {
AssertUtils.isEmpty(ids, "调拨明细id不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGKC013A.QUERY, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static Map<Long, HGKC013A> map(List<Long> ids) {
List<HGKC013A> results = list(ids);
return results.stream().collect(Collectors.toMap(HGKC013A::getId, item -> item));
}
/**
* 查询
*
* @param parentId
* @param whCode
* @param inventCode
* @return
*/
public static List<HGKC013A> listByInv(Long parentId,String whCode, String inventCode) {
if (Objects.isNull(parentId) || StringUtils.isBlank(whCode) || StringUtils.isBlank(inventCode)) {
return null;
}
Map<String, Object> paramMap = new HashMap();
paramMap.put(HGKC013A.FIELD_PARENT_ID, parentId);
paramMap.put(HGKC013A.FIELD_CALLOUT_WH_CODE, whCode);
paramMap.put(HGKC013A.FIELD_INVENT_CODE, inventCode);
return DaoBase.getInstance().query(HGKC013A.QUERY, paramMap);
}
}
/**
* HGKC014 定义 * HGKC014 定义
* *
* @author:songx * @author:songx
......
...@@ -5,18 +5,7 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -5,18 +5,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum; import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.domain.HGCG003B; import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC001; import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.domain.HGKC002;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.domain.HGKC007;
import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC010A;
import com.baosight.hggp.hg.kc.domain.HGKC011;
import com.baosight.hggp.hg.kc.domain.HGKC014;
import com.baosight.hggp.hg.kc.domain.HGKC014A;
import com.baosight.hggp.hg.kc.tools.HGKCTools; import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ005; import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools; import com.baosight.hggp.hg.pz.tools.HGPZTools;
...@@ -690,6 +679,78 @@ public class HGKCUtils { ...@@ -690,6 +679,78 @@ public class HGKCUtils {
} }
/** /**
* HGKC013 定义
*
* @author:jhs
* @date:2024/10/30,10:02
*/
public static class HgKc013 {
/**
* 查询
*
* @param parentId
* @return
*/
public static HGKC013 get(String parentId) {
AssertUtils.isNull(parentId, "调拨单id不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("id", parentId);
List<HGKC013> hgkc013List = DaoBase.getInstance().query(HGKC013.QUERY, paramMap);
return hgkc013List.get(0);
}
}
/**
* @author:jhs
* @date:2024/10/30,10:30
*/
public static class HgKc013A {
/**
* 锁并且获取数据
*
* @param kc013As
* @return
*/
public static Map<Long, HGKC013A> lockGetDataEp(List<? extends HGKC013A> kc013As) {
return lockGetData(ObjectUtils.listEpKey(kc013As, HGKC013A.FIELD_ID));
}
/**
* 锁并且获取数据
*
* @param ids
* @return
*/
public static Map<Long, HGKC013A> lockGetData(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return null;
}
// 锁
HGKCTools.HgKc013A.lock(ids);
// db数据
return HGKCTools.HgKc013A.map(ids);
}
/**
* 查询
*
* @param parentId
* @return
*/
public static List<HGKC013A> listByPrimaryId(String parentId) {
AssertUtils.isEmpty(parentId, "调拨单id不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("parentId", parentId);
return DaoBase.getInstance().query(HGKC013A.QUERY, paramMap);
}
}
/**
* HGKC014 工具类 * HGKC014 工具类
* *
* @author:songx * @author:songx
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false"> <EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="left"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="180" align="left"/>
<EF:EFComboColumn cname="类型" ename="receiveType" width="80" align="center" required="false" enable="false"> <EF:EFComboColumn cname="类型" ename="receiveType" width="80" align="center" required="false" enable="false">
<EF:EFCodeOption codeName="hggp.receiveType"/> <EF:EFCodeOption codeName="hggp.receiveType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
......
...@@ -21,9 +21,9 @@ $(function (){ ...@@ -21,9 +21,9 @@ $(function (){
}, },
toolbarConfig: { toolbarConfig: {
// hidden: false, // true时,不显示功能按钮,但保留setting导出按钮 // hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
add: receiveDataSource === 2 ? false : true, // 不显示新增按钮 add: receiveDataSource == 2 ? false : true, // 不显示新增按钮
add: receiveDataSource === 2 ? false : true, // 不显示取消按钮 save: receiveDataSource == 2 ? false : true, // 不显示保存按钮
save: receiveDataSource === 2 ? false : true // 不显示保存按钮 cancel: receiveDataSource == 2 ? false : true // 不显示取消按钮
// delete: false, // 显示删除按钮 // delete: false, // 显示删除按钮
}, },
beforeEdit: function (e) { beforeEdit: function (e) {
......
...@@ -13,6 +13,12 @@ $(function() { ...@@ -13,6 +13,12 @@ $(function() {
pageSize: 10, pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200] pageSizes: [10, 20, 30, 50, 100, 200]
}, },
toolbarConfig: {
// hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
add: false, // 不显示新增按钮
cancel : false
// delete: false, // 显示删除按钮
},
columns: [{ columns: [{
field: "inventType", field: "inventType",
filter: function (options) { filter: function (options) {
...@@ -23,73 +29,6 @@ $(function() { ...@@ -23,73 +29,6 @@ $(function() {
editor: function (container, options) { editor: function (container, options) {
this.filter(options); this.filter(options);
} }
}, {
field: "inventCode",
title: "存货名称",
filter: function (options) {
let inventType = options.model["inventType"];
/*if (inventType){
return _.filter(inventCodedBox, function (item) {
return item["param1Field"] === inventType;
})
}*/
return options.values;
},
template: function (dataItem) {
for (let i = 0; i < inventCodedBox.length; i++) {
if (inventCodedBox[i]['valueField'] === dataItem['inventCode']){
dataItem['inventName'] = inventCodedBox[i]['textField']
dataItem['inventRecordId'] = inventCodedBox[i]['param2Field'];
return inventCodedBox[i]['textField'];
}
}
return dataItem["inventCode"];
},
editor: function (container, options) {
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: inventCodedBox,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
optionLabelTemplate: "#:valueField#-#:textField#-#:param3Field#",
valueTemplate: "#:valueField#-#:textField#-#:param3Field#",
template: "#:valueField#-#:textField#-#:param3Field#",
filter: "contains"
});
}
}, {
field: "spec",
filter: function (options) {
let specId = options.model["inventRecordId"];
if (specId){
return _.filter(specIdBox, function (item) {
return item["param7Field"] === specId;
})
}
return options.values;
},
template: function (item) {
return $.trim(item.spec) == "" ? "" : item.spec;
}
}, {
field: "length",
template: function (item) {
return item.length == 0 ? "-" : item.length;
}
}, {
field: "width",
template: function (item) {
return item.width == 0 ? "-" : item.width;
}
}, {
field: "thick",
template: function (item) {
return item.thick == 0 ? "-" : item.thick;
}
}/*, { }/*, {
field: "unitWeight", field: "unitWeight",
format: "{0:n3}", format: "{0:n3}",
...@@ -171,6 +110,8 @@ $(function() { ...@@ -171,6 +110,8 @@ $(function() {
//deleteFunc(); //deleteFunc();
} }
} }
// 选择存货
$("#SELECT_INVENT").on("click", selectInvent);
downKeyUp(); downKeyUp();
}); });
...@@ -262,3 +203,32 @@ let deleteFunc = function () { ...@@ -262,3 +203,32 @@ let deleteFunc = function () {
} }
}); });
} }
/**
* 选择
*/
let selectInvent = function () {
let params = {
"inqu_status-0-parentId": $("#inqu_status-0-parentId").val(),
"inqu_status-0-companyCode": $("#inqu_status-0-calloutCompanyCode").val(),
"inqu_status-0-whCode": $("#inqu_status-0-calloutWhCode").val()
}
JSColorbox.open({
href: "HGKC013B",
title: "<div style='text-align: center;'>综合实时库存</div>",
width: "90%",
height: "90%",
params: params,
callbackName: selectInventCallback
});
}
/**
* 选择回调
*/
let selectInventCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
<EF:EFInput blockId="inqu_status" row="0" ename="callinWhName" cname="调入仓库名称" colWidth="3" readonly="true"/> <EF:EFInput blockId="inqu_status" row="0" ename="callinWhName" cname="调入仓库名称" colWidth="3" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="calloutWhCode" cname="调出仓库编码" colWidth="3" type="hidden" readonly="true"/> <EF:EFInput blockId="inqu_status" row="0" ename="calloutWhCode" cname="调出仓库编码" colWidth="3" type="hidden" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="callinWhCode" cname="调入仓库编码" colWidth="3" type="hidden" readonly="true"/> <EF:EFInput blockId="inqu_status" row="0" ename="callinWhCode" cname="调入仓库编码" colWidth="3" type="hidden" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="calloutCompanyCode" cname="调出公司编码" colWidth="3" type="hidden" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="callinCompanyCode" cname="调入公司编码" colWidth="3" type="hidden" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inventName" cname="存货名称" colWidth="3" placeholder="模糊查询"/> <EF:EFInput blockId="inqu_status" row="0" ename="inventName" cname="存货名称" colWidth="3" placeholder="模糊查询"/>
<EF:EFInput blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" type="hidden"/> <EF:EFInput blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/> <EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/>
...@@ -33,23 +35,24 @@ ...@@ -33,23 +35,24 @@
<%--<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="true" width="120" align="center" <%--<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="true" width="120" align="center"
blockName="invent_code_box_block_id" textField="textField" valueField="valueField" blockName="invent_code_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" filter="contains" />--%> columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" filter="contains" />--%>
<EF:EFColumn ename="inventCode" cname="存货名称" enable="true" required="true" readonly="false" width="200" align="center"/> <EF:EFColumn ename="inventCode" cname="存货编码" enable="false" required="false" readonly="true" width="120" align="center"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="true" width="120" align="center" required="true" <EF:EFColumn ename="inventName" cname="存货名称" enable="false" required="false" readonly="true" width="200" align="center"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="120" align="center" required="false"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField" blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/> <EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true" <EF:EFComboColumn ename="spec" cname="规格" enable="false" width="120" align="center" required="false"
blockName="spec_box_block_id" textField="textField" valueField="valueField" blockName="spec_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<%--defaultValue="0"--%> <%--defaultValue="0"--%>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" enable="true" readonly="true" align="center" hidden="true" maxLength="50"/> <EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" enable="false" readonly="true" align="center" hidden="true" maxLength="50"/>
<EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/> <EF:EFColumn ename="length" cname="长度(MM)" enable="false" readonly="true" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/> <EF:EFColumn ename="width" cname="宽度(MM)" enable="false" readonly="true" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/> <EF:EFColumn ename="thick" cname="厚度(MM)" enable="false" readonly="true" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" enable="true" format="{0:N3}" editType="text" <EF:EFColumn ename="quantity" cname="数量" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,20}([.][0-9]{1,3})?$/" maxLength="20" required="true" data-regex="/^-?[0-9]{1,20}([.][0-9]{1,3})?$/" maxLength="20" required="true"
......
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
columns: []
},
};
// 查询
$("#QUERY").on("click", query);
// 确认
$("#CONFIRM").on("click", confirm);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
//存货编号查询条件
// initInventCode();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
}
/**
* 选择
*/
let confirm = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let applyQty = rows[i]['applyQty'];
let invQty = rows[i]['invQty'];
if (!isPositiveNumber(applyQty)) {
message("勾选的第" + (i + 1) + "行申请数量必须大于0");
return;
}
if (parseFloat(invQty) < parseFloat(applyQty)) {
message("勾选的第" + (i + 1) + "行申请数量不能大于库存数量");
return;
}
}
JSUtils.confirm("确定对勾选的[" + rows.length + "]条数据进行\"调拨\"操作吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC013B", "confirm",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
/**
* 存货编号
*/
let initInventCode = function () {
//物料信息下拉
var inInfo=new EiInfo();
EiCommunicator.send("HGPZ005", "queryComboBox", inInfo, {
onSuccess: function (ei) {
let dataSource;
var input=$("#inqu_status-0-inventCode");
dataSource=ei.getBlock("invent_record_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataSource,
template: "[#:valueField#]#:textField#|#:param2Field#",
filter: "contains"
});
}, onFail: function (ei) {
}
}, {async: false});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ 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="查询条件">
<EF:EFInput ename="inqu_status-0-companyCode" cname="公司编号" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-parentId" cname="领料单id" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFSelect cname="仓库" ename="whCode" blockId="inqu_status" row="0" colWidth="3"
optionLabel="全部" defultValue="" readonly="true">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货类型" ename="inventType" blockId="inqu_status" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="存货编码" ename="inventCode" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="存货名称" ename="inventName" blockId="inqu_status" row="0" 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="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center" hidden="true"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center"
blockName="invent_type_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="applyQty" cname="申请数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invUnitWeight" cname="单重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="库存总重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
<EF:EFColumn ename="updatedName" cname="更新人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="updatedTime" cname="更新时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</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