Commit 48db1503 by liuyang

工序质检单

parent 3fb1220f
......@@ -143,14 +143,14 @@ public class HPZL003 extends DaoEPBase {
private String processName = " "; /* 工序名称*/
private String workCode = " "; /* 报工单编码*/
private String checkCode = " "; /* 质检单编码*/
private Boolean prdtType; /* 产品类型*/
private Integer prdtType = new Integer(0); /* 产品类型*/
private String prdtCode = " "; /* 产品编码*/
private String prdtName = " "; /* 产品名称*/
private BigDecimal prdtLength = new BigDecimal("0"); /* 产品-长*/
private BigDecimal prdtWidth = new BigDecimal("0"); /* 产品-宽*/
private BigDecimal prdtThick = new BigDecimal("0"); /* 产品-厚*/
private String prdtSpec = " "; /* 产品规格*/
private Boolean partType; /* 零件类型*/
private Integer partType = new Integer(0); /* 零件类型*/
private String partCode = " "; /* 零件编码*/
private String partName = " "; /* 零件名称*/
private BigDecimal partLength = new BigDecimal("0"); /* 零件-长*/
......@@ -738,7 +738,7 @@ public class HPZL003 extends DaoEPBase {
* get the prdtType - 产品类型.
* @return the prdtType
*/
public Boolean getPrdtType() {
public Integer getPrdtType() {
return this.prdtType;
}
......@@ -747,7 +747,7 @@ public class HPZL003 extends DaoEPBase {
*
* @param prdtType - 产品类型
*/
public void setPrdtType(Boolean prdtType) {
public void setPrdtType(Integer prdtType) {
this.prdtType = prdtType;
}
/**
......@@ -850,7 +850,7 @@ public class HPZL003 extends DaoEPBase {
* get the partType - 零件类型.
* @return the partType
*/
public Boolean getPartType() {
public Integer getPartType() {
return this.partType;
}
......@@ -859,7 +859,7 @@ public class HPZL003 extends DaoEPBase {
*
* @param partType - 零件类型
*/
public void setPartType(Boolean partType) {
public void setPartType(Integer partType) {
this.partType = partType;
}
/**
......@@ -1147,14 +1147,14 @@ public class HPZL003 extends DaoEPBase {
setProcessName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_process_name)), processName));
setWorkCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_work_code)), workCode));
setCheckCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_check_code)), checkCode));
setPrdtType(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_prdt_type)), prdtType));
setPrdtType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_prdt_type)), prdtType));
setPrdtCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_prdt_code)), prdtCode));
setPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_prdt_name)), prdtName));
setPrdtLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_prdt_length)), prdtLength));
setPrdtWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_prdt_width)), prdtWidth));
setPrdtThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_prdt_thick)), prdtThick));
setPrdtSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_prdt_spec)), prdtSpec));
setPartType(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_part_type)), partType));
setPartType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_part_type)), partType));
setPartCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_part_code)), partCode));
setPartName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_part_name)), partName));
setPartLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_part_length)), partLength));
......@@ -1170,7 +1170,7 @@ public class HPZL003 extends DaoEPBase {
setCheckName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_check_name)), checkName));
setCheckDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_check_date))), checkDate));
setCheckStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_check_status)), checkStatus));
setRegisterDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_register_date)), registerDate));
setRegisterDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_register_date))), registerDate));
}
/**
......
......@@ -38,14 +38,10 @@ public class ServiceHPZL003 extends ServiceEPBase {
DdynamicEnum.PROJ_RECORD_BLOCK_ID,
DdynamicEnum.FACTORY_CODE_BOX_BLOCK_ID,
DdynamicEnum.GROUP_RECORD_BLOCK_ID,
DdynamicEnum.USER_ID_BOX_BLOCK_ID),
DdynamicEnum.USER_ID_BOX_BLOCK_ID,
DdynamicEnum.INVENT_SPEC_ALL_BLOCK_ID),
new HashMap<String,Object>(){}
);
Map<String, Object> map = new HashMap<>();
map.put("itemCode", "ITEM_CODE in ('2','3','4')");
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), map,
false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPZL003().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......
......@@ -160,7 +160,7 @@
process_name = #processName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="workCode">
work_code = #workCode#
work_code like concat('%',#workCode#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkCode">
check_code like concat('%',#checkCode#,'%')
......
......@@ -3,7 +3,7 @@ $(function () {
var projRecordBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var factoryCodeBox_block_id = __eiInfo.getBlock("factoryCodeBox_block_id").getMappedRows();
var groupRecordBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
var inventNameBox = __eiInfo.getBlock("invent_name_block_id").getMappedRows();
var inventNameBox = __eiInfo.getBlock("invent_spec_all_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("userIdBox_block_id").getMappedRows();
IPLATUI.EFGrid = {
......@@ -16,6 +16,18 @@ $(function () {
},
columns: [
{
field: "operator",
template: function (item) {
let factoryCode = item.factoryName;
let template = '';
if (factoryCode) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showFile(\'' + item.checkCode + '\')" >附件清单</a>';
}
return template;
}
},{
field: "orgNo",
filter: function (options) {
var province = options.model['factoryCode'];
......@@ -40,22 +52,20 @@ $(function () {
template: function (dataItem) {
for (let i = 0; i < inventNameBox.length; i++) {
if (inventNameBox[i]['valueField'] === dataItem['prdtCode']) {
return inventNameBox[i]['textField']
return inventNameBox[i]['param1Field']
}
}
return dataItem["prdtCode"];
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-factoryCode", options.model["factoryCode"]);
inInfo.set("inqu_status-0-orgNo", options.model["orgNo"]);
inInfo.set("inqu_status-0-projCode", options.model["projCode"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPSC005B");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "prdtCode_block_id");
inInfo.set("field", options.field);
prdtNameGlobalData = refreshSelect(container, inInfo);
}
}, {
field: "partCode",
template: function (dataItem) {
for (let i = 0; i < inventNameBox.length; i++) {
if (inventNameBox[i]['valueField'] === dataItem['partCode']) {
return inventNameBox[i]['param1Field']
}
}
return dataItem["partCode"];
}
}, {
field: "checkDate",
......@@ -77,7 +87,7 @@ $(function () {
// 此 grid 对象
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
/*if (e.field == "unpassQuantity") {
if (e.field == "unpassQuantity") {
// loadChange(grid,e,"passQuantity");
var passQuantity = parseFloat(e.items[0]['quantity'])
- parseFloat(e.items[0]['unpassQuantity']);
......@@ -88,27 +98,17 @@ $(function () {
var unpassQuantity = parseFloat(e.items[0]['quantity'])
- parseFloat(e.items[0]['passQuantity']);
resultGrid.setCellValue(e.items[0], "unpassQuantity", unpassQuantity);
}*/
/*if (e.field == "prdtCode"){
var item = e.items[0];
for (let i = 0; i < prdtNameGlobalData.length; i++) {
if (prdtNameGlobalData[i]['valueField'] === item["prdtCode"]) {
resultGrid.setCellValue(item, "prdtName", prdtNameGlobalData[i]['textField'].split(']')[1]);
resultGrid.setCellValue(item, "workCode", prdtNameGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, "prdtSpec", prdtNameGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, "partCode", prdtNameGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, "partName", prdtNameGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, "partSpec", prdtNameGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, "registerDate", prdtNameGlobalData[i]['param6Field']);
resultGrid.setCellValue(item, "quantity", prdtNameGlobalData[i]['param7Field']);
resultGrid.setCellValue(item, "unitWt", prdtNameGlobalData[i]['param8Field']);
resultGrid.setCellValue(item, "childId", prdtNameGlobalData[i]['param9Field']);
break
}
}
}*/
}
var item = e.items[0];
if (e.field == "projCode"){
if (e.field == "prdtCode"){
let prdtNameRow = prdtNameGlobalData.filter(row => row.valueField === item['prdtCode'])
resultGrid.setCellValue(item, "prdtName", prdtNameRow['param1Field']);
resultGrid.setCellValue(item, "prdtSpec", prdtNameRow['param2Field']);
}else if (e.field == "partCode"){
let prdtNameRow = prdtNameGlobalData.filter(row => row.valueField === item['partCode'])
resultGrid.setCellValue(item, "partName", prdtNameRow['param1Field']);
resultGrid.setCellValue(item, "partSpec", prdtNameRow['param2Field']);
}else if (e.field == "projCode"){
for (let i = 0; i < projRecordBox.length; i++) {
if (projRecordBox[i]['valueField'] === item['projCode']) {
resultGrid.setCellValue(item, "projName", projRecordBox[i]['textField']);
......@@ -171,31 +171,59 @@ let save = function () {
return;
}
for (let i = 0; i < rows.length; i++) {
let factoryCode = rows[i]['factoryCode'];
let orgNo = rows[i]['orgNo'];
let projCode = rows[i]['projCode'];
let passQuantity = rows[i]['passQuantity'];
let unpassQuantity = rows[i]['unpassQuantity'];
let quantity = rows[i]['quantity'];
let checkBy = rows[i]['checkBy'];
let checkCode = rows[i]['checkCode'];
let checkStatus = rows[i]['checkStatus'];
if (!isNumber(passQuantity)||!isNumber(unpassQuantity)) {
message("质检单号[" + checkCode + "]合格数量与不合格数量必须是大于等于0的数字!");
let workCode = rows[i]['workCode'];
let registerDate = rows[i]['registerDate'];
if (isBlank(factoryCode)) {
message("生产任务单号[" + workCode + "]工厂不能为空!");
return;
}
if (isBlank(orgNo)) {
message("生产任务单号[" + workCode + "]部门不能为空!");
return;
}
/*if (passQuantity > quantity) {
message("质检单号[" + checkCode + "]合格数量不能大于报工数量!");
if (isBlank(projCode)) {
message("生产任务单号[" + workCode + "]项目不能为空!");
return;
}
if (unpassQuantity > quantity) {
message("质检单号[" + checkCode + "]不合格数量不能大于报工数量!");
if (isBlank(workCode)) {
message("生产任务单号[" + workCode + "]不能为空!");
return;
}*/
}
if (!isNumber(quantity)) {
message("生产任务单号[" + workCode + "]派工数量必须是大于等于0的数字!");
return;
}
if (isBlank(registerDate)) {
message("生产任务单号[" + workCode + "]派工日期不能为空!");
return;
}
if (!isNumber(passQuantity) || !isNumber(unpassQuantity)) {
message("生产任务单号[" + workCode + "]合格数量与不合格数量必须是大于等于0的数字!");
return;
}
if (parseFloat(quantity) < parseFloat(passQuantity) ) {
message("生产任务单号[" + workCode + "]合格数量不能大于报工数量!");
return;
}
if (parseFloat(quantity) < parseFloat(unpassQuantity)) {
message("生产任务单号[" + workCode + "]不合格数量不能大于报工数量!");
return;
}
if(!checkBy||checkBy===' '){
message("质检单号[" + checkCode + "]质检人员不能为空!");
message("生产任务单号[" + workCode + "]质检人员不能为空!");
return;
}
if(checkStatus === '1'){
message("质检单号[" + checkCode + "]已经质检完成不能修改!");
message("生产任务单号[" + workCode + "]已经质检完成不能修改!");
return;
}
}
......@@ -233,4 +261,13 @@ function updateStatus() {
});
}
/**
* 附件清单
*
* @param bizId
*/
function showFile(bizId) {
CommonUtils.showFile("ZL03", bizId);
}
......@@ -27,7 +27,11 @@
<EF:EFInput blockId="inqu_status" row="0" ename="checkName" cname="质检员" placeholder="模糊查询" colWidth="3"/>
</div>
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="factoryName" cname="工厂名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect cname="工厂名称" ename="factoryCode" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factoryCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="workCode" cname="生产任务单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect cname="质检状态" ename="checkStatus" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFOption label="质检中" value="0"/>
......@@ -39,6 +43,7 @@
<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="companyCode" cname="企业编码" hidden="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......@@ -64,27 +69,32 @@
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="projName" cname="项目名称" hidden="true"/>
<EF:EFColumn ename="workCode" cname="生产任务单号" width="130" hidden="true"/>
<EF:EFColumn ename="workCode" cname="生产任务单号" width="130" enable="true" required="true" readonly="true" align="center"/>
<EF:EFColumn ename="checkCode" cname="质检单号" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="processName" cname="工序" width="100" hidden="true"/>
<EF:EFComboColumn ename="prdtCode" cname="产品名称"
<EF:EFComboColumn ename="prdtCode" cname="部件名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="invent_spec_all_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="产品名称" hidden="true"/>
<EF:EFColumn ename="prdtSpec" cname="产品规格" enable="true" width="120" align="center" hidden="true"/>
<EF:EFComboColumn ename="partCode" cname="零件名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="invent_spec_all_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="产品名称" width="100" hidden="true"/>
<EF:EFColumn ename="prdtSpec" 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="partName" cname="零件名称" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="quantity" cname="派工数量" width="90" enable="false" readonly="true" align="center" hidden="true"/>
<EF:EFColumn ename="registerDate" cname="派工日期" width="120" enable="true" align="center" editType="date" hidden="true"
<EF:EFColumn ename="partName" cname="零件名称" hidden="true"/>
<EF:EFColumn ename="partSpec" cname="零件规格" hidden="true"/>
<EF:EFColumn ename="registerDate" cname="派工日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="passQuantity" cname="合格数量" format="{0:0.0}" width="90" align="center" required="true"/>
<EF:EFColumn ename="unpassQuantity" cname="不合格数量" format="{0:0.0}" width="100" align="center"
required="true"/>
<EF:EFColumn ename="quantity" cname="派工数量" width="100" enable="true" required="true" readonly="true" align="center" format="{0:N0}"/>
<EF:EFColumn ename="passQuantity" cname="合格数量" width="100" align="center" required="true" format="{0:N0}"/>
<EF:EFColumn ename="unpassQuantity" cname="不合格数量" width="100" align="center" required="true" format="{0:N0}"/>
<EF:EFColumn ename="checkDate" cname="质检日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="checkBy" cname="质检员" columnTemplate="#=textField#" itemTemplate="#=textField#"
......
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