Commit 5c8f8386 by yukang

自动排产

parent dad2c8e1
......@@ -135,15 +135,26 @@ $(function () {
* e.preventDefault 阻止事件发生
*/
beforeAdd: function (e) {
var lv = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId.lv;
var logic = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId ? false : true;
if (logic) { // 通过业务逻辑判断, 控制是否进行新增
if (lv === 3) {
IPLAT.alert({
message: '<b>请选择项目列表</b>',
message: '<b>不能在零件下进行新增</b>',
okFn: function (e) {
},
title: '提示'
});
e.preventDefault();
} else {
if (logic) { // 通过业务逻辑判断, 控制是否进行新增
IPLAT.alert({
message: '<b>请选择项目列表</b>',
okFn: function (e) {
},
title: '提示'
});
e.preventDefault();
}
}
},
/**
......
......@@ -135,87 +135,87 @@ function showUploadFile(id) {
});
}
function check(id, auditStatus,planInfoNo) {
// const inEiInfo = new EiInfo();
// inEiInfo.set("id", id);
// inEiInfo.set("planInfoNo",planInfoNo);
// //先判断本身是否填写
// EiCommunicator.send('HPSC003', 'getInfo', inEiInfo, {
// onSuccess(ei) {
// var model=ei.get("model");
// if(!(model.planCompletionDate).trim()) {
// NotificationUtil("提交失败!原因:基本信息中计划完成日期未填写", "error");
// return;
// } else {
// //提交
// //提交前先判断明细信息中的计划开始和计划结束时间是否都已经填写,只有填写了之后才能进行提交
// if (auditStatus == 1) {
// EiCommunicator.send('HPSC004', 'inspectDetail', inEiInfo, {
// onSuccess(ei) {
// var list=ei.get("list");
// if(list) {
// var count = list[0];
// if (count > 0) {
// NotificationUtil("提交失败!原因:明细信息中有未填写的计划开始时间或计划结束时间", "error");
// } else {
// EiCommunicator.send('HPSC004','queryDetail',inEiInfo,{
// onSuccess(ei){
// var rows = ei.blocks.detail.rows;
// var res = check_time(model,rows);
// if (!res){
// NotificationUtil("计划结束时间应该大于计划开始时间!", "error");
// }
// else {
// // 提交通过,生成
// EiCommunicator.send('HPSC003', 'submitPlan', inEiInfo, {
// onSuccess(response) {
// NotificationUtil(response.msg);
// console.log(response)
// autoProductionschedul(response.get('planInfoNo'));
// resultGrid.dataSource.page(1);
// },
// onFail(errorMessage, status, e) {
// NotificationUtil("执行失败!", "error");
// }
// },
// {
// async: false
// }
// );
// }
//
//
// }
// })
//
// }
// } else {
// NotificationUtil("提交失败!未找到明细信息", "error");
// }
// },
// onFail(errorMessage, status, e) {
// NotificationUtil("执行失败!", "error");
// }
// },
// {
// async: false
// }
// );
// } else {
// // 撤回
//
// }
// }
// },
// onFail(errorMessage, status, e) {
// NotificationUtil("执行失败!", "error");
// }
// },
// {
// async: false
// }
// );
const inEiInfo = new EiInfo();
inEiInfo.set("id", id);
inEiInfo.set("planInfoNo",planInfoNo);
//先判断本身是否填写
EiCommunicator.send('HPSC003', 'getInfo', inEiInfo, {
onSuccess(ei) {
var model=ei.get("model");
if(!(model.planCompletionDate).trim()) {
NotificationUtil("提交失败!原因:基本信息中计划完成日期未填写", "error");
return;
} else {
//提交
//提交前先判断明细信息中的计划开始和计划结束时间是否都已经填写,只有填写了之后才能进行提交
if (auditStatus == 1) {
EiCommunicator.send('HPSC004', 'inspectDetail', inEiInfo, {
onSuccess(ei) {
var list=ei.get("list");
if(list) {
var count = list[0];
if (count > 0) {
NotificationUtil("提交失败!原因:明细信息中有未填写的计划开始时间或计划结束时间", "error");
} else {
EiCommunicator.send('HPSC004','queryDetail',inEiInfo,{
onSuccess(ei){
var rows = ei.blocks.detail.rows;
var res = check_time(model,rows);
if (!res){
NotificationUtil("计划结束时间应该大于计划开始时间!", "error");
}
else {
// 提交通过,生成
EiCommunicator.send('HPSC003', 'submitPlan', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
console.log(response)
autoProductionschedul(response.get('planInfoNo'));
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
autoProductionschedul('SCJH24030700006');
}
})
}
} else {
NotificationUtil("提交失败!未找到明细信息", "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
} else {
// 撤回
}
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
// autoProductionschedul('SCJH24030700006');
}
/**
......@@ -305,6 +305,7 @@ function saveResult(btn) {
JSUtils.submitGridsData("result", "HPSC003", "update", true);
//释放禁用按钮
btn.attr("disabled", false);
query();
}
});
}
......
......@@ -43,14 +43,14 @@
<EF:EFInput ename="productionOrderNo" type="hidden"/>
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="actualCompletionDate" editType="date" cname="完成日期" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" />
<EF:EFColumn ename="actualCompletionDate" editType="date" required="true" cname="完成日期" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" />
<EF:EFColumn ename="hpsc006Id" cname="生产下料ID" hidden="true"/>
<EF:EFComboColumn ename="userId" cname="完成人" width="100" align="center"
filter="contains" readonly="true">
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="worker_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="userName" cname="完成名称" hidden="true"/>
<EF:EFColumn ename="actualCompletionNum" cname="完成数量" format="{0:N3}" maxLength="12" displayType="0.000"
<EF:EFColumn ename="actualCompletionNum" cname="完成数量" required="true" format="{0:N3}" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}$/"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="actualCompletionTotalWt" cname="完成重量(T)" enable="false" format="{0:N3}" maxLength="12" displayType="0.000"
......
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