Commit 9a3d0464 by liuyang

2024-04-19 生产计划:基本信息栏(部件)增加生产厂区字段(必填),后续生成生产订单派工时不需要选择厂区,默认生产计划中的厂区

parent 3499e141
......@@ -42,8 +42,8 @@ public class HPSC003 extends DaoEPBase {
public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_SCHEDULE = "schedule";
public static final String FIELD_DELIVERY_DATE = "deliveryDate";
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId";
public static final String FIELD_FACTORY_CODE = "factoryCode";
public static final String COL_ID = "ID";
......@@ -65,6 +65,7 @@ public class HPSC003 extends DaoEPBase {
public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID";
public static final String COL_DELIVERY_DATE = "DELIVERY_DATE";
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 工厂代码*/
public static final String QUERY = "HPSC003.query";
public static final String COUNT = "HPSC003.count";
......@@ -101,6 +102,7 @@ public class HPSC003 extends DaoEPBase {
private BigDecimal length = new BigDecimal(0.00); /* 长*/
private BigDecimal width = new BigDecimal(0.00); /* 宽*/
private BigDecimal thick = new BigDecimal(0.00); /* 厚*/
private String factoryCode = " "; /* 工厂代码*/
/**
......@@ -219,6 +221,9 @@ public class HPSC003 extends DaoEPBase {
eiColumn.setDescName("交货日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("工厂代码");
eiMetadata.addMeta(eiColumn);
}
......@@ -590,6 +595,14 @@ public class HPSC003 extends DaoEPBase {
this.deliveryDate = deliveryDate;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the value from Map.
*
......@@ -623,7 +636,7 @@ public class HPSC003 extends DaoEPBase {
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get("thick")), thick));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get("matId")), matId));
setDeliveryDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_DATE)), deliveryDate));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
}
/**
......@@ -658,6 +671,7 @@ public class HPSC003 extends DaoEPBase {
map.put("thick", StringUtils.toString(thick, eiMetadata.getMeta("thick")));
map.put("matId", StringUtils.toString(matId, eiMetadata.getMeta("matId")));
map.put(FIELD_DELIVERY_DATE, StringUtils.toString(deliveryDate, eiMetadata.getMeta(FIELD_DELIVERY_DATE)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
return map;
}
......
......@@ -67,6 +67,7 @@ public class HPSC004 extends DaoEPBase {
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DEL_STATUS = "delStatus"; /* 状态:0未删除,1已删除*/
public static final String FIELD_DELIVERY_DATE = "deliveryDate";
public static final String FIELD_FACTORY_CODE = "factoryCode";
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
......@@ -113,6 +114,7 @@ public class HPSC004 extends DaoEPBase {
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DEL_STATUS = "DEL_STATUS"; /* 状态:0未删除,1已删除*/
public static final String COL_DELIVERY_DATE = "DELIVERY_DATE";
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 工厂代码*/
public static final String QUERY = "HPSC004.query";
public static final String COUNT = "HPSC004.count";
......@@ -165,6 +167,7 @@ public class HPSC004 extends DaoEPBase {
private String updatedTime = " "; /* 更新时间*/
private Integer delStatus; /* 状态:0未删除,1已删除*/
private String deliveryDate = " ";
private String factoryCode = " "; /* 工厂代码*/
/**
* initialize the metadata.
......@@ -376,8 +379,10 @@ public class HPSC004 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_DELIVERY_DATE);
eiColumn.setDescName("交货日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("工厂代码");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -1099,6 +1104,15 @@ public class HPSC004 extends DaoEPBase {
public void setDeliveryDate(String deliveryDate) {
this.deliveryDate = deliveryDate;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the value from Map.
*
......@@ -1152,6 +1166,7 @@ public class HPSC004 extends DaoEPBase {
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDelStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DEL_STATUS)), delStatus));
setDeliveryDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_DATE)), deliveryDate));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
}
/**
......@@ -1206,6 +1221,7 @@ public class HPSC004 extends DaoEPBase {
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DEL_STATUS, StringUtils.toString(delStatus, eiMetadata.getMeta(FIELD_DEL_STATUS)));
map.put(FIELD_DELIVERY_DATE, StringUtils.toString(deliveryDate, eiMetadata.getMeta(FIELD_DELIVERY_DATE)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
return map;
}
......
......@@ -117,14 +117,21 @@ public class ServiceHPSC003 extends ServiceBase {
@OperationLogAnnotation(operModul = "生产计划",operType = "修改",operDesc = "修改")
public EiInfo update(EiInfo inInfo) {
try {
HPSC003 HPSC003 = new HPSC003();
HPSC003 hpsc003 = new HPSC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
if (eiBlock != null) {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC003.fromMap(map);
HPSC003.setPlanCompletionDate(DateUtils.formatShort(HPSC003.getPlanCompletionDate()));
DaoUtils.update("HPSC003.update", HPSC003.toMap());
hpsc003.fromMap(map);
hpsc003.setPlanCompletionDate(DateUtils.formatShort(hpsc003.getPlanCompletionDate()));
DaoUtils.update("HPSC003.update", hpsc003.toMap());
HashMap params = new HashMap();
params.put(HPSC004.FIELD_PARENT_ID,hpsc003.getPlanInfoNo());
List<HPSC004> list = dao.query("HPSC004.queryDetail",params,0,-999999);
for (HPSC004 hpsc004:list) {
hpsc004.setFactoryCode(hpsc003.getFactoryCode());
DaoUtils.update(HPSC004.UPDATE, hpsc004);
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
......@@ -256,6 +263,7 @@ public class ServiceHPSC003 extends ServiceBase {
newSc005.setStatus(CommonConstant.YesNo.NO_0);
newSc005.setDeliveryDate(dbSc003.getDeliveryDate());
newSc005.setDepCode(dbSc004.getDepCode());
newSc005.setFactoryCode(dbSc003.getFactoryCode());
DaoUtils.insert(HPSC005.INSERT, newSc005);
return newSc005;
}
......
......@@ -14,9 +14,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.MapUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author:songx
......@@ -33,6 +31,8 @@ public class ServiceHPSC005 extends ServiceBase {
@OperationLogAnnotation(operModul = "生产订单",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID),
new HashMap<String,Object>(){});
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005().eiMetadata);
} catch (Exception e) {
inInfo.setStatus(500);
......
......@@ -23,6 +23,7 @@ import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -47,7 +48,8 @@ public class ServiceHPSC005A extends ServiceBase {
String prodOrderNo = MapUtils.getString(queryMap, CommonConstant.Field.PROD_ORDER_NO);
HPSC005 dbSc005 = HPSCTools.HpSc005.get(prodOrderNo);
inInfo.addBlock(CommonConstant.Field.DETAIL).addRow(dbSc005);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,DdynamicEnum.GROUP_PRO_BLOCK_ID),
new HashMap<String,Object>(){{put(HPSC005.FIELD_FACTORY_CODE,dbSc005.getFactoryCode());}}, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005A().eiMetadata);
} catch (Exception e) {
inInfo.setStatus(500);
......@@ -100,7 +102,7 @@ public class ServiceHPSC005A extends ServiceBase {
for (Map resultRow : resultRows) {
HPSC005A fSc005a = new HPSC005A();
fSc005a.fromMap(resultRow);
fSc005a.setFactoryCode(dbSc005.getFactoryCode());
if (fSc005a.getId() == null || fSc005a.getId() == 0) {
this.add(dbSc005, fSc005a);
} else {
......
......@@ -127,6 +127,7 @@ public class ServiceHPSC006 extends ServiceBase {
String projCode = inInfo.getString("projCode");
String projName = inInfo.getString("projName");
String deliveryDate = inInfo.getString("deliveryDate");
String factoryCode = inInfo.getString("factoryCode");
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPSC006 hpsc006 = new HPSC006();
......@@ -141,6 +142,7 @@ public class ServiceHPSC006 extends ServiceBase {
hpsc006.setProjName(projName);
hpsc006.setDeliveryDate(deliveryDate);
hpsc006.setProductionOrderNo(productionOrderNo);
hpsc006.setFactoryCode(factoryCode);
hpsc006.setTotalWt(totalWt);
hpsc006.setInventCode(HPPZTools.checkAndSavePZ04(hpsc006.getInventType(),hpsc006.getInventName()));
// 去除日期字符串中的-
......
......@@ -30,10 +30,16 @@ public class ServiceHPSC098 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
String orgType = inInfo.getString("inqu_status-0-orgType");
String factoryCode = inInfo.getString("inqu_status-0-factoryCode");
Map queryMap = new HashMap();
queryMap.put("orgType", orgType);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID),
new HashMap<String,Object>(){{put("orgId",factoryCode);}});
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),
new HashMap<String,Object>(){{
put("parentOrgId",factoryCode);
put("orgType",orgType);
}});
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC098().eiMetadata);
inInfo.set("inqu_status-0-orgType", orgType);
} catch (PlatException e) {
......
......@@ -58,6 +58,9 @@
<isNotEmpty prepend=" AND " property="deliveryDate">
DELIVERY_DATE = #deliveryDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
</sql>
<sql id="authCondition">
......@@ -105,6 +108,7 @@
THICK as "thick", <!-- 厚 -->
MAT_ID AS "matId",
DELIVERY_DATE as "deliveryDate",
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
CONCAT((
SELECT
format((ifnull( SUM( ACTUAL_COMPLETION_NUM ), 0 ) / ifnull( SUM( NUM ), 0 ) * 100),2)
......@@ -155,12 +159,13 @@
DEP_CODE, <!-- 部门编码 -->
REMARK, <!-- 备注 -->
MAT_ID,
DELIVERY_DATE
DELIVERY_DATE,
FACTORY_CODE <!-- 工厂代码 -->
)
VALUES (#id#, #companyCode#, #projType#, #projCode#, #projName#, #planInfoNo#,#inventRecordId#,
#spec#, #length#, #width#, #thick#, #prdtType#, #prdtCode#, #prdtName#, #planCompletionDate#, #status#,
#createdBy#,
#createdTime#, #updatedBy#, #updatedTime#, #depCode#, #remark#,#matId#, #deliveryDate#)
#createdTime#, #updatedBy#, #updatedTime#, #depCode#, #remark#,#matId#, #deliveryDate#,#factoryCode#)
</insert>
<delete id="delete">
......@@ -195,7 +200,8 @@
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
REMARK = #remark#, <!-- 备注 -->
DELIVERY_DATE = #deliveryDate#
DELIVERY_DATE = #deliveryDate#,
FACTORY_CODE = #factoryCode#
WHERE
ID = #id#
</update>
......
......@@ -46,7 +46,8 @@
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEL_STATUS as "delStatus", <!-- 状态:0未删除,1已删除 -->
DELIVERY_DATE as "deliveryDate"
DELIVERY_DATE as "deliveryDate",
FACTORY_CODE as "factoryCode" <!-- 工厂代码 -->
</sql>
<sql id="condition">
......@@ -177,6 +178,9 @@
<isNotEmpty prepend=" AND " property="deliveryDate">
DELIVERY_DATE = #deliveryDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
</sql>
<sql id="authCondition">
......@@ -264,14 +268,15 @@
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DEL_STATUS, <!-- 状态:0未删除,1已删除 -->
DELIVERY_DATE
DELIVERY_DATE,
FACTORY_CODE <!-- 工厂代码 -->
) VALUES (
#companyCode#, #depCode#, #projCode#, #projName#, #matId#, #parentId#, #parentPrdtName#,
#prodOrderNo#, #type#, #leaf#, #sort#, #icon#, #prdtType#, #prdtCode#,
#prdtName#, #length#, #width#, #thick#, #spec#, #num#, #unitWt#, #totalWt#, #filePath1#,
#filePath2#, #filePath3#, #filePath4#, #filePath5#, #planCommentDate#, #planCompletionDate#,
#actualCompletionDate#, #actualCompletionNum#, #actualCompletionUnitWt#, #inventRecordId#,
#status#, #remark#, #createdBy#, #createdName#, #createdTime#, #delStatus#, #deliveryDate#
#status#, #remark#, #createdBy#, #createdName#, #createdTime#, #delStatus#, #deliveryDate#, #factoryCode#
)
</insert>
......@@ -321,7 +326,8 @@
LENGTH = #length#, <!-- 长 -->
WIDTH = #width#, <!-- 宽 -->
THICK = #thick#, <!-- 厚 -->
DELIVERY_DATE = #deliveryDate#
DELIVERY_DATE = #deliveryDate#,
FACTORY_CODE = #factoryCode#
WHERE ID = #id#
</update>
......
......@@ -153,7 +153,7 @@
$order$
</isNotEmpty>
<isEmpty property="order">
STATUS,CREATED_TIME desc
STATUS,CREATED_TIME desc,FACTORY_CODE
</isEmpty>
</dynamic>
</sql>
......
......@@ -21,7 +21,7 @@ $(function () {
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+
'onclick="check(' + item.id + ',1, \'' + item.planInfoNo + '\')" >提交</a>';
'onclick="check(' + item.id + ',1, \'' + item.planInfoNo + '\',\'' + item.factoryCode + '\')" >提交</a>';
}
/*else {
template += '<a hidden="hidden" style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
......@@ -153,10 +153,14 @@ function showUploadFile(id) {
height: "80%",
});
}
function check(id, auditStatus,planInfoNo) {
function check(id, auditStatus,planInfoNo,factoryCode) {
const inEiInfo = new EiInfo();
inEiInfo.set("id", id);
inEiInfo.set("planInfoNo",planInfoNo);
if (isBlank(factoryCode)) {
message("工厂不能为空,请选择工厂");
return;
}
//先判断本身是否填写
EiCommunicator.send('HPSC003', 'getInfo', inEiInfo, {
onSuccess(ei) {
......@@ -189,7 +193,7 @@ function check(id, auditStatus,planInfoNo) {
onSuccess(response) {
NotificationUtil(response.msg);
console.log(response)
autoProductionschedul(response.get('planInfoNo'));
autoProductionschedulCallback(factoryCode,response.get('planInfoNo'));
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
......@@ -254,7 +258,7 @@ let autoProductionschedul = function (planInfoNo) {
});
}
function autoProductionschedulCallback (factoryCode,planInfoNo) {
JSColorbox.close();
//JSColorbox.close();
if (factoryCode) {
if (planInfoNo) {
JSColorbox.open({
......
......@@ -32,6 +32,12 @@
<EF:EFColumn enable="false" ename="projCode" cname="项目号" readonly="true" hidden="true"/>
<EF:EFColumn enable="false" ename="planInfoNo" cname="生产计划单号" readonly="true" hidden="true" width="100"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称" width="120" readonly="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="prdtType" cname="部件类型" hidden = 'true' width="90" align="center" enable="false">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
......
......@@ -112,41 +112,59 @@ function assign() {
message("请至少选择一条需要分派的数据");
return;
}
let factoryCodes = null;
rows.forEach(function (element) {
ids.push(element.id)
ids.push(element.id);
factoryCodes = element.factoryCode;
});
// groupType=1:仅查询生产组
JSColorbox.open({
href: "HPSC098?methodName=initLoad&inqu_status-0-orgType=prodGroup",
title: "<div style='text-align: center;'>选择组织</div>",
width: "70%",
height: "70%",
callbackName: function (row) {
var info = new EiInfo()
info.set("ids",ids.join(','));
info.set("factoryCode",row.factoryCode);
info.set("factoryName",row.factoryName);
info.set("groupCode",row.groupCode);
info.set("groupName",row.groupName);
EiCommunicator.send("HPSC005A", "assign", info, {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: ei.msg
});
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}, onFail: function (ei) {
}
}, {async: false});
let flag = true;
$.each(rows, function(index, item) {
let factoryCode= item.get("factoryCode");
if(factoryCode != factoryCodes){
IPLAT.alert({
message : "选中的生产订单不上同一个工厂,无法分派!",
okFn : function(e) {
},
title : '错误'
});
flag = false;
return false;
}
});
if(flag) {
// groupType=1:仅查询生产组
JSColorbox.open({
href: "HPSC098?methodName=initLoad&inqu_status-0-orgType=prodGroup&inqu_status-0-factoryCode="+factoryCodes,
title: "<div style='text-align: center;'>选择组织</div>",
width: "70%",
height: "70%",
callbackName: function (row) {
var info = new EiInfo()
info.set("ids",ids.join(','));
info.set("factoryCode",row.factoryCode);
info.set("factoryName",row.factoryName);
info.set("groupCode",row.groupCode);
info.set("groupName",row.groupName);
EiCommunicator.send("HPSC005A", "assign", info, {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: ei.msg
});
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}, onFail: function (ei) {
}
}, {async: false});
}
});
}
}
/**
......
......@@ -37,6 +37,12 @@
<EF:EFOption label="全部派工" value="2"/>
</EF:EFComboColumn>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<%--<EF:EFColumn ename="prdtSpec" cname="部件规格" enable="false" width="120" align="center"/>--%>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
......
......@@ -100,10 +100,10 @@ let save = function () {
return;
}
for (let i = 0; i < rows.length; i++) {
if (isBlank(rows[i]['factoryCode'])) {
/*if (isBlank(rows[i]['factoryCode'])) {
message("勾选的第" + (i + 1) + "行\"厂区\",不能为空");
return;
}
}*/
if (isBlank(rows[i]['orgNo'])) {
message("勾选的第" + (i + 1) + "行\"生产组\",不能为空");
return;
......
......@@ -32,18 +32,26 @@
<EF:EFOption label="全部派工" value="2"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect ename="detail-0-factoryCode" cname="厂区" colWidth="4" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="任务ID" enable="false" width="80" align="center"/>
<EF:EFColumn ename="prodTaskNo" cname="任务单号" enable="false" hidden="true"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue="" required="true"
<%--<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue="" required="true"
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="orgNo" cname="生产组" width="110" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" align="center" hidden="true"/>--%>
<EF:EFComboColumn ename="orgNo" cname="生产组" width="110" align="center" defaultValue="" required="true"
filter="contains" readonly="true">
<EF:EFOptions blockId="group_pro_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="workDate" cname="派工时间" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
......@@ -16,6 +16,7 @@ $(function () {
return;
}
let flag = true;
let factoryCodes = null;
$.each(rows, function(index, item) {
let id = item.get("id");
if (isBlank(id)) {
......@@ -49,10 +50,24 @@ $(function () {
flag = false;
return false;
}
factoryCodes = item.get("factoryCode");
});
$.each(rows, function(index, item) {
let factoryCode= item.get("factoryCode");
if(factoryCode != factoryCodes){
IPLAT.alert({
message : "选中的生产订单不上同一个工厂,无法分派!",
okFn : function(e) {
},
title : '错误'
});
flag = false;
return false;
}
});
if(flag) {
JSColorbox.open({
href: "HPSC098?methodName=initLoad&inqu_status-0-orgType=cutGroup",
href: "HPSC098?methodName=initLoad&inqu_status-0-orgType=cutGroup&inqu_status-0-factoryCode="+factoryCodes,
title: "<div style='text-align: center;'>选择组织</div>",
width: "70%",
height: "70%",
......@@ -98,6 +113,7 @@ $(function () {
var projCode = e.model['projCode'];
var projName = e.model['projName'];
var deliveryDate = e.model['deliveryDate'];
let factoryCode = e.model['factoryCode'];
info.set("productionOrderNo",productionOrderNo);
EiCommunicator.send("HPSC006","queryDetail",info,{
......@@ -107,6 +123,7 @@ $(function () {
$('#projCode').val(projCode)
$('#projName').val(projName)
$('#deliveryDate').val(deliveryDate)
$('#factoryCode').val(factoryCode);
},onFail:function(ei){}
},{async:false});
},
......@@ -239,8 +256,22 @@ $(function () {
return template
}
},
{
field: "factoryCode",
defaultValue: function () {
return $("#factoryCode").val();
}
}
],
onAdd:function (e) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
e.preventDefault();
message("请选中一条需要下料的生产任务");
return;
}
},
/* onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
......@@ -438,6 +469,7 @@ assignCallback = function (row) {
info.set("factoryName",row.factoryName);
info.set("groupCode",row.groupCode);
info.set("groupName",row.groupName);
info.set("factoryCode",$("#factoryCode").val())
EiCommunicator.send("HPSC006","assign",info,{
onSuccess:function(ei){//返回结果集
if (ei["status"] == -1) {
......
......@@ -51,6 +51,7 @@
<EF:EFInput ename="projName" type="hidden"/>
<EF:EFInput ename="productionOrderNo" type="hidden"/>
<EF:EFInput ename="deliveryDate" type="hidden"/>
<EF:EFInput ename="factoryCode" type="hidden"/>
<EF:EFGrid blockId="detail" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/>
......
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