Commit 613d75b7 by 江和松

其他入库功能提交

parent 587098e1
...@@ -115,6 +115,14 @@ public enum DdynamicEnum { ...@@ -115,6 +115,14 @@ public enum DdynamicEnum {
INVENT_ALL_BOX_BLOCK_ID("invent_all_box_block_id", "id", "spec", "material", "unit", "length", "width", "thick", INVENT_ALL_BOX_BLOCK_ID("invent_all_box_block_id", "id", "spec", "material", "unit", "length", "width", "thick",
"coefficient","status", "HGPZ005.queryInventBoxAll"), "coefficient","status", "HGPZ005.queryInventBoxAll"),
/**
* 模块:规格下拉框
* 用途:入库下拉框
* 编写:jhs
*/
INVENT_SPEC_BOX_BLOCK_ID("invent_spec_box_block_id", "spec", "spec","length", "width","thick","coefficient","id","status", "HGPZ005.queryInventBoxAll"),
/** /**
* 模块:存货档案(ALL 不默认状态) * 模块:存货档案(ALL 不默认状态)
......
...@@ -62,11 +62,12 @@ public class HGKC006A extends DaoEPBase { ...@@ -62,11 +62,12 @@ public class HGKC006A extends DaoEPBase {
public static final String FIELD_PART_TYPE = "partType"; /* 零件类型*/ public static final String FIELD_PART_TYPE = "partType"; /* 零件类型*/
public static final String FIELD_PART_CODE = "partCode"; /* 零件编码*/ public static final String FIELD_PART_CODE = "partCode"; /* 零件编码*/
public static final String FIELD_PART_NAME = "partName"; /* 零件名称*/ public static final String FIELD_PART_NAME = "partName"; /* 零件名称*/
public static final String FIELD_PART_LENGTH = "partLength"; /* 零件-长*/ public static final String FIELD_PART_LENGTH = "partLength"; /* 零件-长*/
public static final String FIELD_PART_WIDTH = "partWidth"; /* 零件-宽*/ public static final String FIELD_PART_WIDTH = "partWidth"; /* 零件-宽*/
public static final String FIELD_PART_THICK = "partThick"; /* 零件-厚*/ public static final String FIELD_PART_THICK = "partThick"; /* 零件-厚*/
public static final String FIELD_PART_SPEC = "partSpec"; /* 零件规格*/ public static final String FIELD_PART_SPEC = "partSpec"; /* 零件规格*/
public static final String FIELD_PART_SPEC_ID = "partSpecId"; /* 零件规格ID*/ public static final String FIELD_PART_SPEC_ID = "partSpecId"; /* 零件规格ID*/
public static final String FIELD_PART_COEFFICIENT = "partCoefficient"; /* 零件系数*/
public static final String FIELD_PRIMARY_ID = "primaryId"; /* 主表id*/ public static final String FIELD_PRIMARY_ID = "primaryId"; /* 主表id*/
public static final String FIELD_PRICE = "price"; /* 单价*/ public static final String FIELD_PRICE = "price"; /* 单价*/
...@@ -118,6 +119,7 @@ public class HGKC006A extends DaoEPBase { ...@@ -118,6 +119,7 @@ public class HGKC006A extends DaoEPBase {
public static final String COL_PART_THICK = "PART_THICK"; /* 零件-厚*/ public static final String COL_PART_THICK = "PART_THICK"; /* 零件-厚*/
public static final String COL_PART_SPEC = "PART_SPEC"; /* 零件规格*/ public static final String COL_PART_SPEC = "PART_SPEC"; /* 零件规格*/
public static final String COL_PART_SPEC_ID = "PART_SPEC_ID"; /* 零件规格ID*/ public static final String COL_PART_SPEC_ID = "PART_SPEC_ID"; /* 零件规格ID*/
public static final String COL_PART_COEFFICIENT = "PART_COEFFICIENT"; /* 零件系数*/
public static final String COL_PRIMARY_ID = "PRIMARY_ID"; /* 主表id*/ public static final String COL_PRIMARY_ID = "PRIMARY_ID"; /* 主表id*/
public static final String COL_PRICE = "PRICE"; /* 单价*/ public static final String COL_PRICE = "PRICE"; /* 单价*/
public static final String COL_AMOUNT = "AMOUNT"; /* 金额*/ public static final String COL_AMOUNT = "AMOUNT"; /* 金额*/
...@@ -173,6 +175,7 @@ public class HGKC006A extends DaoEPBase { ...@@ -173,6 +175,7 @@ public class HGKC006A extends DaoEPBase {
private BigDecimal partWidth = new BigDecimal(0.000); /* 零件-宽*/ private BigDecimal partWidth = new BigDecimal(0.000); /* 零件-宽*/
private BigDecimal partThick = new BigDecimal(0.000); /* 零件-厚*/ private BigDecimal partThick = new BigDecimal(0.000); /* 零件-厚*/
private String partSpec = " "; /* 零件规格*/ private String partSpec = " "; /* 零件规格*/
private BigDecimal partCoefficient = new BigDecimal(0.000); /* 零件-系数*/
private Long partSpecId = new Long(0); /* 规格id*/ private Long partSpecId = new Long(0); /* 规格id*/
private Long primaryId = new Long(0); /* 主表id*/ private Long primaryId = new Long(0); /* 主表id*/
private BigDecimal price = new BigDecimal("0"); /* 单价*/ private BigDecimal price = new BigDecimal("0"); /* 单价*/
...@@ -385,6 +388,14 @@ public class HGKC006A extends DaoEPBase { ...@@ -385,6 +388,14 @@ public class HGKC006A extends DaoEPBase {
eiColumn.setDescName("零件-厚"); eiColumn.setDescName("零件-厚");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PART_COEFFICIENT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("零件-系数");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PART_SPEC); eiColumn = new EiColumn(FIELD_PART_SPEC);
eiColumn.setDescName("零件规格"); eiColumn.setDescName("零件规格");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -1202,6 +1213,14 @@ public class HGKC006A extends DaoEPBase { ...@@ -1202,6 +1213,14 @@ public class HGKC006A extends DaoEPBase {
this.partSpecId = partSpecId; this.partSpecId = partSpecId;
} }
public BigDecimal getPartCoefficient() {
return partCoefficient;
}
public void setPartCoefficient(BigDecimal partCoefficient) {
this.partCoefficient = partCoefficient;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -1253,6 +1272,7 @@ public class HGKC006A extends DaoEPBase { ...@@ -1253,6 +1272,7 @@ public class HGKC006A extends DaoEPBase {
setPartLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_LENGTH)), partLength)); setPartLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_LENGTH)), partLength));
setPartWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_WIDTH)), partWidth)); setPartWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_WIDTH)), partWidth));
setPartThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_THICK)), partThick)); setPartThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_THICK)), partThick));
setPartCoefficient(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_COEFFICIENT)), partCoefficient));
setPartSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PART_SPEC)), partSpec)); setPartSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PART_SPEC)), partSpec));
setPartSpecId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PART_SPEC_ID)), partSpecId)); setPartSpecId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PART_SPEC_ID)), partSpecId));
setPrimaryId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PRIMARY_ID)), primaryId)); setPrimaryId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PRIMARY_ID)), primaryId));
...@@ -1311,6 +1331,7 @@ public class HGKC006A extends DaoEPBase { ...@@ -1311,6 +1331,7 @@ public class HGKC006A extends DaoEPBase {
map.put(FIELD_PART_LENGTH, StringUtils.toString(partLength, eiMetadata.getMeta(FIELD_PART_LENGTH))); map.put(FIELD_PART_LENGTH, StringUtils.toString(partLength, eiMetadata.getMeta(FIELD_PART_LENGTH)));
map.put(FIELD_PART_WIDTH, StringUtils.toString(partWidth, eiMetadata.getMeta(FIELD_PART_WIDTH))); map.put(FIELD_PART_WIDTH, StringUtils.toString(partWidth, eiMetadata.getMeta(FIELD_PART_WIDTH)));
map.put(FIELD_PART_THICK, StringUtils.toString(partThick, eiMetadata.getMeta(FIELD_PART_THICK))); map.put(FIELD_PART_THICK, StringUtils.toString(partThick, eiMetadata.getMeta(FIELD_PART_THICK)));
map.put(FIELD_PART_COEFFICIENT, StringUtils.toString(partCoefficient, eiMetadata.getMeta(FIELD_PART_COEFFICIENT)));
map.put(FIELD_PART_SPEC, StringUtils.toString(partSpec, eiMetadata.getMeta(FIELD_PART_SPEC))); map.put(FIELD_PART_SPEC, StringUtils.toString(partSpec, eiMetadata.getMeta(FIELD_PART_SPEC)));
map.put(FIELD_PART_SPEC_ID, StringUtils.toString(partSpecId, eiMetadata.getMeta(FIELD_PART_SPEC_ID))); map.put(FIELD_PART_SPEC_ID, StringUtils.toString(partSpecId, eiMetadata.getMeta(FIELD_PART_SPEC_ID)));
map.put(FIELD_PRIMARY_ID, StringUtils.toString(primaryId, eiMetadata.getMeta(FIELD_PRIMARY_ID))); map.put(FIELD_PRIMARY_ID, StringUtils.toString(primaryId, eiMetadata.getMeta(FIELD_PRIMARY_ID)));
......
...@@ -41,7 +41,7 @@ public class ServiceHGKC006A extends ServiceBase { ...@@ -41,7 +41,7 @@ public class ServiceHGKC006A extends ServiceBase {
map.put(HGKC006A.FIELD_WH_CODE, whCode); map.put(HGKC006A.FIELD_WH_CODE, whCode);
map.put(HGKC006A.FIELD_COMPANY_CODE, companyCode); map.put(HGKC006A.FIELD_COMPANY_CODE, companyCode);
CommonMethod.initBlock(inInfo, CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,DdynamicEnum.SPEC_BOX_BLOCK_ID),map,false Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,DdynamicEnum.INVENT_RECORD_BLOCK_ID,DdynamicEnum.INVENT_SPEC_BOX_BLOCK_ID),map,false
); );
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC006A().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC006A().eiMetadata);
} catch (PlatException e) { } catch (PlatException e) {
...@@ -68,7 +68,7 @@ public class ServiceHGKC006A extends ServiceBase { ...@@ -68,7 +68,7 @@ public class ServiceHGKC006A extends ServiceBase {
map.put(HGKC006A.FIELD_WH_CODE, whCode); map.put(HGKC006A.FIELD_WH_CODE, whCode);
map.put(HGKC006A.FIELD_COMPANY_CODE, companyCode); map.put(HGKC006A.FIELD_COMPANY_CODE, companyCode);
CommonMethod.initBlock(inInfo, CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,DdynamicEnum.SPEC_BOX_BLOCK_ID),map,false Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,DdynamicEnum.INVENT_RECORD_BLOCK_ID,DdynamicEnum.INVENT_SPEC_BOX_BLOCK_ID),map,false
); );
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -126,15 +126,6 @@ public class ServiceHGKC006A extends ServiceBase { ...@@ -126,15 +126,6 @@ public class ServiceHGKC006A extends ServiceBase {
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isNull(hgkc006a.getPrimaryId(), "未获取到其他入库单ID信息"); AssertUtils.isNull(hgkc006a.getPrimaryId(), "未获取到其他入库单ID信息");
HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgkc006a.getCompanyCode(),hgkc006a.getWhCode(),hgkc006a.getPartSpecId());
if (hgkc010==null){
throw new PlatException("实时库存不存在!");
}
int result = hgkc006a.getInvQty().compareTo(hgkc010.getInvQty());
if ( result > 0){
throw new PlatException("实时库存数量不够,无法保存!");
}
} }
/** /**
......
...@@ -132,6 +132,9 @@ ...@@ -132,6 +132,9 @@
<isNotEmpty prepend=" AND " property="partThick"> <isNotEmpty prepend=" AND " property="partThick">
PART_THICK = #partThick# PART_THICK = #partThick#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="partCoefficient">
PART_COEFFICIENT = #partCoefficient#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partSpec"> <isNotEmpty prepend=" AND " property="partSpec">
PART_SPEC = #partSpec# PART_SPEC = #partSpec#
</isNotEmpty> </isNotEmpty>
...@@ -198,6 +201,7 @@ ...@@ -198,6 +201,7 @@
PART_LENGTH as "partLength", <!-- 零件-长 --> PART_LENGTH as "partLength", <!-- 零件-长 -->
PART_WIDTH as "partWidth", <!-- 零件-宽 --> PART_WIDTH as "partWidth", <!-- 零件-宽 -->
PART_THICK as "partThick", <!-- 零件-厚 --> PART_THICK as "partThick", <!-- 零件-厚 -->
PART_COEFFICIENT as "partCoefficient", <!-- 零件-系数 -->
PART_SPEC as "partSpec", <!-- 零件规格 --> PART_SPEC as "partSpec", <!-- 零件规格 -->
PART_SPEC_ID as "partSpecId", <!-- 零件规格id --> PART_SPEC_ID as "partSpecId", <!-- 零件规格id -->
PRIMARY_ID as "primaryId", <!-- 主表id --> PRIMARY_ID as "primaryId", <!-- 主表id -->
...@@ -267,6 +271,7 @@ ...@@ -267,6 +271,7 @@
PART_LENGTH, <!-- 零件-长 --> PART_LENGTH, <!-- 零件-长 -->
PART_WIDTH, <!-- 零件-宽 --> PART_WIDTH, <!-- 零件-宽 -->
PART_THICK, <!-- 零件-厚 --> PART_THICK, <!-- 零件-厚 -->
PART_COEFFICIENT, <!-- 零件系数 -->
PART_SPEC, <!-- 零件规格 --> PART_SPEC, <!-- 零件规格 -->
PART_SPEC_ID, <!-- 零件规格id --> PART_SPEC_ID, <!-- 零件规格id -->
PRIMARY_ID, <!-- 主表id --> PRIMARY_ID, <!-- 主表id -->
...@@ -274,7 +279,7 @@ ...@@ -274,7 +279,7 @@
AMOUNT, <!-- 金额 --> AMOUNT, <!-- 金额 -->
SOURCE <!-- 数据来源 --> SOURCE <!-- 数据来源 -->
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #otherEnterDate#, #otherEnterNo#, #whCode#, #whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invQty#, #invUnitWeight#, #invWeight#, #otherEnterNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#,#partSpecId#, #primaryId#, #price#, #amount#, #source#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #otherEnterDate#, #otherEnterNo#, #whCode#, #whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invQty#, #invUnitWeight#, #invWeight#, #otherEnterNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partCoefficient#, #partSpec#,#partSpecId#, #primaryId#, #price#, #amount#, #source#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -326,6 +331,7 @@ ...@@ -326,6 +331,7 @@
PART_LENGTH = #partLength#, <!-- 零件-长 --> PART_LENGTH = #partLength#, <!-- 零件-长 -->
PART_WIDTH = #partWidth#, <!-- 零件-宽 --> PART_WIDTH = #partWidth#, <!-- 零件-宽 -->
PART_THICK = #partThick#, <!-- 零件-厚 --> PART_THICK = #partThick#, <!-- 零件-厚 -->
PART_COEFFICIENT = #partCoefficient#, <!-- 零件-系数 -->
PART_SPEC = #partSpec#, <!-- 零件规格 --> PART_SPEC = #partSpec#, <!-- 零件规格 -->
PART_SPEC_ID = #partSpecId#, <!-- 零件规格id --> PART_SPEC_ID = #partSpecId#, <!-- 零件规格id -->
PRIMARY_ID = #primaryId#, <!-- 主表id --> PRIMARY_ID = #primaryId#, <!-- 主表id -->
......
...@@ -37,7 +37,7 @@ import java.util.*; ...@@ -37,7 +37,7 @@ import java.util.*;
* @date:2024/1/15,11:20 * @date:2024/1/15,11:20
*/ */
public class ServiceHGPZ005 extends ServiceBase { public class ServiceHGPZ005 extends ServiceBase {
/** /**
* 画面初始化 * 画面初始化
* *
...@@ -55,7 +55,7 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -55,7 +55,7 @@ public class ServiceHGPZ005 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 查询数据列表 * 查询数据列表
* *
...@@ -72,7 +72,7 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -72,7 +72,7 @@ public class ServiceHGPZ005 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 保存操作. * 保存操作.
* *
...@@ -110,7 +110,7 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -110,7 +110,7 @@ public class ServiceHGPZ005 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 校验保存的数据 * 校验保存的数据
* *
...@@ -124,7 +124,7 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -124,7 +124,7 @@ public class ServiceHGPZ005 extends ServiceBase {
AssertUtils.isNull(hgpz005.getStatus(), "是否启用不能为空"); AssertUtils.isNull(hgpz005.getStatus(), "是否启用不能为空");
} }
} }
/** /**
* 新增企业信息 * 新增企业信息
* *
...@@ -135,7 +135,7 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -135,7 +135,7 @@ public class ServiceHGPZ005 extends ServiceBase {
hgpz005.setInventCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INVENT_CODE)); hgpz005.setInventCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INVENT_CODE));
DaoUtils.insert(HGPZ005.INSERT, hgpz005); DaoUtils.insert(HGPZ005.INSERT, hgpz005);
} }
/** /**
* 修改数据 * 修改数据
* *
...@@ -144,7 +144,7 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -144,7 +144,7 @@ public class ServiceHGPZ005 extends ServiceBase {
private void modify(HGPZ005 hgpz005) { private void modify(HGPZ005 hgpz005) {
DaoUtils.update(HGPZ005.UPDATE, hgpz005); DaoUtils.update(HGPZ005.UPDATE, hgpz005);
} }
/** /**
* 新增操作. * 新增操作.
* *
...@@ -173,7 +173,7 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -173,7 +173,7 @@ public class ServiceHGPZ005 extends ServiceBase {
return inInfo; return inInfo;
} }
/** /**
* 修改操作 * 修改操作
* *
...@@ -199,7 +199,7 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -199,7 +199,7 @@ public class ServiceHGPZ005 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 删除操作 * 删除操作
* *
...@@ -301,6 +301,24 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -301,6 +301,24 @@ public class ServiceHGPZ005 extends ServiceBase {
return inInfo; return inInfo;
} }
/**
* 下拉框
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "存货档案规格下拉框",operType = "查询",operDesc = "下拉框(不默认状态)")
public EiInfo queryInventSpecBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_SPEC_BOX_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询规格失败");
}
return inInfo;
}
public EiInfo queryInventNameBox(EiInfo inInfo) { public EiInfo queryInventNameBox(EiInfo inInfo) {
try { try {
......
let whNameGlobalData = [];
$(function () { $(function () {
var companyCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows(); var companyCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
IPLATUI.EFGrid.result = { IPLATUI.EFGrid.result = {
......
...@@ -2,8 +2,8 @@ $(function () { ...@@ -2,8 +2,8 @@ $(function () {
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
var inventRecordBoxBlocks = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows(); var inventRecordBoxBlocks = __eiInfo.getBlock("invent_record_block_id").getMappedRows();
var specBoxBlocks = __eiInfo.getBlock("spec_box_block_id").getMappedRows(); var specBoxBlocks = __eiInfo.getBlock("invent_spec_box_block_id").getMappedRows();
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
...@@ -58,26 +58,12 @@ $(function () { ...@@ -58,26 +58,12 @@ $(function () {
return template; return template;
}, },
editor: function (container, options) { editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-whCode", options.model["whCode"]);
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
inInfo.set("field", options.field);
let dataSource;
EiCommunicator.send("HGKC010", "querySpecBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("spec_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
var input = $('<input />'); var input = $('<input />');
input.attr("name", options.field); input.attr("name", options.field);
input.attr("id", options.field); input.attr("id", options.field);
input.appendTo(container); input.appendTo(container);
input.kendoDropDownList({ input.kendoDropDownList({
dataSource: dataSource, dataSource: specBoxBlocks,
minLength: 0, minLength: 0,
dataTextField: "textField", dataTextField: "textField",
dataValueField: "valueField", dataValueField: "valueField",
...@@ -89,6 +75,13 @@ $(function () { ...@@ -89,6 +75,13 @@ $(function () {
} }
}, },
{ {
field: "invQty",
template: function (item) {
calUnitWeight(item,item.partLength,item.partWidth,item.partThick,item.partCoefficient);
return item.invQty == 0 ? "-" : item.invQty;
}
},
{
field: "primaryId", field: "primaryId",
template: function (item) { template: function (item) {
item['primaryId'] =$("#inqu_status-0-primaryId").val(); item['primaryId'] =$("#inqu_status-0-primaryId").val();
...@@ -98,11 +91,10 @@ $(function () { ...@@ -98,11 +91,10 @@ $(function () {
{ {
field: "whCode", field: "whCode",
template: function (item) { template: function (item) {
item['whCode'] =$("#inqu_status-0-whCode").val(); item['whCode'] = $("#inqu_status-0-whCode").val();
return $("#inqu_status-0-whCode").val(); return $("#inqu_status-0-whCode").val();
} }
} },
,
{ {
field: "companyCode", field: "companyCode",
template: function (item) { template: function (item) {
...@@ -125,6 +117,7 @@ $(function () { ...@@ -125,6 +117,7 @@ $(function () {
let totalAmount = item.price * item.invQty; let totalAmount = item.price * item.invQty;
resultGrid.setCellValue(item, 'amount', totalAmount) resultGrid.setCellValue(item, 'amount', totalAmount)
} }
calUnitWeight(item,item.partLength,item.partWidth,item.partThick,item.partCoefficient);
loadChange(grid,e,"price"); loadChange(grid,e,"price");
} }
//单价计算 //单价计算
...@@ -137,12 +130,10 @@ $(function () { ...@@ -137,12 +130,10 @@ $(function () {
if (e.field == "inventType") { if (e.field == "inventType") {
//选择后,先加载此方法,再加载属性中的方法,所以存货类型加载时,先修改存货编号下拉框的查询 //选择后,先加载此方法,再加载属性中的方法,所以存货类型加载时,先修改存货编号下拉框的查询
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-whCode",item.whCode);
inInfo.set("inqu_status-0-companyCode",item.companyCode);
inInfo.set("inqu_status-0-inventType",item.inventType); inInfo.set("inqu_status-0-inventType",item.inventType);
EiCommunicator.send("HGKC010", "queryInventCodeBox", inInfo, { EiCommunicator.send("HGPZ005", "queryComboBox", inInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
inventRecordBoxBlocks = ei.getBlock("invent_code_box_block_id").getMappedRows(); inventRecordBoxBlocks = ei.getBlock("invent_record_block_id").getMappedRows();
}, },
onFail: function (ei) { onFail: function (ei) {
} }
...@@ -166,6 +157,16 @@ $(function () { ...@@ -166,6 +157,16 @@ $(function () {
resultGrid.setCellValue(item, 'inventName', inventRecordBoxBlocks[i]['textField']) resultGrid.setCellValue(item, 'inventName', inventRecordBoxBlocks[i]['textField'])
} }
} }
let specInInfo = new EiInfo();
specInInfo.set("inqu_status-0-inventType", item.inventType);
specInInfo.set("inqu_status-0-inventCode", item.inventCode);
EiCommunicator.send("HGPZ005", "queryInventSpecBox", specInInfo, {
onSuccess: function (ei) {
specBoxBlocks = ei.getBlock("invent_spec_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
resultGrid.setCellValue(item, 'partSpecId', "") resultGrid.setCellValue(item, 'partSpecId', "")
resultGrid.setCellValue(item, 'partSpec', "") resultGrid.setCellValue(item, 'partSpec', "")
resultGrid.setCellValue(item, 'partLength', "") resultGrid.setCellValue(item, 'partLength', "")
...@@ -182,10 +183,9 @@ $(function () { ...@@ -182,10 +183,9 @@ $(function () {
resultGrid.setCellValue(item, 'partLength', specBoxBlocks[i]['param1Field']) resultGrid.setCellValue(item, 'partLength', specBoxBlocks[i]['param1Field'])
resultGrid.setCellValue(item, 'partWidth', specBoxBlocks[i]['param2Field']) resultGrid.setCellValue(item, 'partWidth', specBoxBlocks[i]['param2Field'])
resultGrid.setCellValue(item, 'partThick', specBoxBlocks[i]['param3Field']) resultGrid.setCellValue(item, 'partThick', specBoxBlocks[i]['param3Field'])
resultGrid.setCellValue(item, 'invQty', specBoxBlocks[i]['param4Field']) resultGrid.setCellValue(item, 'partCoefficient', specBoxBlocks[i]['param4Field'])
resultGrid.setCellValue(item, 'invUnitWeight', specBoxBlocks[i]['param5Field']) resultGrid.setCellValue(item, 'partSpecId', specBoxBlocks[i]['param5Field'])
resultGrid.setCellValue(item, 'invWeight', specBoxBlocks[i]['param6Field']) calUnitWeight(item,item.partLength,item.partWidth,item.partThick,item.partCoefficient);
resultGrid.setCellValue(item, 'partSpecId', specBoxBlocks[i]['param7Field'])
} }
} }
resultGrid.setCellValue(item, 'price', "") resultGrid.setCellValue(item, 'price', "")
...@@ -236,6 +236,13 @@ let query = function () { ...@@ -236,6 +236,13 @@ let query = function () {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
} }
let calUnitWeight = function (item,length,width,thick,coefficient) {
if(length && width && thick && coefficient){
let amount = length * width * thick * coefficient/1000000;
//item['amount'] = amount.toString();
resultGrid.setCellValue(item, 'invUnitWeight', amount);
}
}
/** /**
* 保存 * 保存
*/ */
......
...@@ -43,15 +43,15 @@ ...@@ -43,15 +43,15 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="inventCode" cname="存货编码" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" hidden="true"/> <EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true" enable="false"/>
<EF:EFColumn ename="partSpec" cname="规格" width="120" align="center" required="true" enable="true"/> <EF:EFColumn ename="partSpec" cname="规格" width="120" align="center" required="true" enable="true"/>
<EF:EFColumn ename="partSpecId" cname="规格id" hidden="true"/> <EF:EFColumn ename="partSpecId" cname="规格id" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="存货档案id" width="120" align="center" required="true" enable="false" hidden="true"/> <EF:EFColumn ename="inventRecordId" cname="存货档案id" width="120" align="center" required="true" enable="false" hidden="true"/>
<EF:EFColumn ename="partLength" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="partLength" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partWidth" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="partWidth" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partThick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="partThick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="coefficient" cname="系数" width="80" align="right" format="{0:N2}" maxLength="10" enable="false" hidden="true"/> <EF:EFColumn ename="partCoefficient" cname="系数" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invQty" cname="数量" width="120" align="right" format="{0:N0}" <EF:EFColumn ename="invQty" cname="数量" width="120" align="right" format="{0:N0}"
defaultValue="0" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/" data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
...@@ -60,10 +60,9 @@ ...@@ -60,10 +60,9 @@
<EF:EFColumn ename="invUnitWeight" cname="单重" width="120" align="right" format="{0:N3}" <EF:EFColumn ename="invUnitWeight" cname="单重" width="120" align="right" format="{0:N3}"
defaultValue="0" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/" data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/> data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
enable="false"/>
<EF:EFColumn ename="invWeight" cname="总重" width="120" align="right" enable="false" format="{0:N3}"/> <EF:EFColumn ename="invWeight" cname="总重" width="120" align="right" enable="false" format="{0:N3}"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:N3}" <EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:N3}"
defaultValue="0" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/" data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
......
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="inventCode" cname="存货编码" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" hidden="true"/> <EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true" enable="false"/>
<EF:EFColumn ename="partSpec" cname="规格" width="120" align="center" enable="true" required="true"/> <EF:EFColumn ename="partSpec" cname="规格" width="120" align="center" enable="true" required="true"/>
<EF:EFColumn ename="partSpecId" cname="规格id" hidden="true"/> <EF:EFColumn ename="partSpecId" cname="规格id" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格id" width="120" align="center" required="true" enable="false" hidden="true"/> <EF:EFColumn ename="inventRecordId" cname="规格id" width="120" align="center" required="true" enable="false" hidden="true"/>
......
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