<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="sec" uri="/WEB-INF/tags/shiro.tld"%>
<%@taglib prefix="pt6" uri="/WEB-INF/tags/platform6.tld"%>
<%@ page import="avicit.platform6.commons.utils.ViewUtil"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- ControllerPath = "mms/mes/mesworkorder/mesWorkOrderController/operation/Add/null" -->
<title>编辑</title>
<base href="<%=ViewUtil.getRequestPath(request)%>">
<jsp:include page="/avicit/mms/commoninclude/CommonInclude.jsp"></jsp:include>
<jsp:include page="/avicit/platform6/modules/system/commonpopup/commonSelectionHead.jsp"></jsp:include>
<script src="static/js/platform/component/common/exteasyui.js" type="text/javascript"></script>
<script type="text/javascript">
$.extend($.fn.validatebox.defaults.rules, {
maxLength : {
validator : function(value, param) {
if (param[0] == 0) {
param[0] = 13;
}
return param[0] >= value.replace(/[^\x00-\xff]/g, "**").length; //计算字符串长度(可同时字母和汉,字母占一个字符,汉字占两个字符)
},
message : '请输入最多 {0} 字符.'
},
extendsIsNull : {
validator : function(value) {
return value != "请选择";
},
message : '该输入项为必输项.'
}
});
$(function() {
//选择部门
var deptCommonSelector = new CommonSelector("dept", "deptSelectCommonDialog", "fromDeptId", "fromDeptName");
deptCommonSelector.init();
$('#mdsWorkUnitId').combotree({
multiple : false,
checkbox : true,
required : true,
editable : false,
onlyLeafCheck : true,//只能叶子节点才能勾选
url : 'platform/mms/mds/mdsprocess/mdsProcessController/operation/getMdsWorkUnit',
onLoadSuccess : function() {
$('#mdsWorkCenterId').combobox('setValue', '${mesWorkOrderDTO.mdsWorkCenterId}');
},
onSelect : function(node) {
$('#mdsWorkCenterId').combobox('setValue', '');
$('#mdsWorkCenterId').combobox({
url : '${surl}' + "getMdsWorkCenter/" + node.id,
valueField : 'id',
textField : 'centerName',
method : 'get',
editable : false,
onSelect : function(record) {
$("#mdsWorkCenterId").val(record.ID);
}
});
}
});
$('#dutyManId').combobox({
url : 'platform/mms/mes/mesworkpackage/mesWorkPackageController/operation/getdutyManList',
valueField : 'id',
textField : 'userName',
method : 'get',
mode : 'local',
editable : true,
filter : function(q, row) {
var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) == 0;
}
});
$('#mdsWorkLineId').combotree({
multiple : false,
checkbox : true,
editable : false,
onlyLeafCheck : true,//只能叶子节点才能勾选
url : 'platform/mms/mds/mdsworkline/mdsWorkLineController/operation/getMdsWorkLineList',
onClick : function(node) {
$('#mdsWorkLineId').val(node.id);
$('#mdsWorkLineName').combotree('setValue', node.text);
}
});
$('#mdsWearhouseId').combobox({
url : 'platform/mms/mds/mdswarehouse/mdsWarehouseController/operation/getMdsWarehouseList',
valueField : 'id',
textField : 'whName',
editable : false
});
$('#reqDate').datebox('setValue', '${reqDateStr}');
$('#dutyManId').combobox('setValue', '${mesWorkOrderDTO.dutyManId}');
$('#mdsWearhouseId').combobox('setValue', '${mesWorkOrderDTO.mdsWearhouseId}');
$('#mdsWorkUnitId').combotree('setValue', '${mesWorkOrderDTO.mdsWorkUnitId}');
$('#workOrderType').combobox('setValue', '${mesWorkOrderDTO.workOrderType}');
var singleFlag = '${mesWorkOrderDTO.singleFlag}';
if (singleFlag == 'Y') {
$("#singleFlag").attr("checked", "checked");
}
});
function selectMdsItemConfig() {
CommonSelectorUtil.init();
$(this).commonSelect({
"title" : "物料配置项选择",
"replaceLabel" : {},
"hideSearchCondition" : [],
"hideColumn" : [],
"url" : "platform/mms/mds/mdsitemconfigdefault/mdsItemConfigDefaultController/toMdsItemConfigDefaultSelect",
"width" : "800",
"height" : "500",
"allowedUnSelected" : true,
"canSearchAll" : true,
"param" : {},
"callBackFunc" : function(resultData) {
if (resultData) {
$("#itemNo").val(resultData.itemNo + resultData.itemName + '(' + resultData.itemStage + '/' + resultData.itemVersion + ")");
$("#mdsItemId").val(resultData.mdsItemId);
$("#mdsItemConfigId").val(resultData.id);
//取生产令号
} else {
$.messager.alert('提示', '请重新选择物料!', 'warning');
return false;
}
}
});
}
function closeForm() {
parent.mesWorkOrderTemp.closeDialog("#tempEdit");
}
function saveForm() {
var textareaElement = $('#form').find("textarea");
var hasvalidate = true;
if (textareaElement.length > 0) {
$.each(textareaElement, function(i, item) {
var dataSize = $(item).data('size');
var textareaValue = $(item).val();
if (textareaValue != null && textareaValue != "" && textareaValue.replace(/[^\x00-\xff]/g, "**").length > dataSize) {
$.messager.alert('提示', '文本域输入数据长度超过预设长度' + dataSize, 'info', function() {
document.getElementById(item.id).focus();
});
hasvalidate = false;
return;
}
});
}
var tdLabel = $('#form').find('[data-isnull="false"]');
var textareaId = "";
$.each(tdLabel, function(i, item) {
var dataIsNull = $(item).data('isnull');
var hasChecked = false;
$(item).find("input").each(function(i, obj) {
if ($(obj).is(':checked')) {
hasChecked = true;
}
});
$(item).find("textarea").each(function(i, obj) {
if ($(obj).val().length > 0) {
hasChecked = true;
} else {
textareaId = obj.id;
}
});
if (!hasChecked) {
$.messager.alert('提示', '请输入必填项', 'info', function() {
if (textareaId != "") {
document.getElementById(textareaId).focus();
}
});
hasvalidate = false;
return false;
}
});
//checkbox字段长度验证
var checkboxElement = $('#form').find('[data-type="checkbox"]');
$.each(checkboxElement, function(i, item) {
var datasize = $(item).data('length');
var hasLength = true;
var lgth = 0;
$(item).find("input[type=checkbox]").each(function(i, obj) {
if ($(obj).is(':checked')) {
lgth = lgth + 1;
}
if (2 * lgth - 1 > datasize) {
hasLength = false;
}
});
if (!hasLength) {
$.messager.alert('提示', '多选输入数据长度超过预设长度' + datasize, 'info');
hasvalidate = false;
return;
}
});
if ($('#form').form('validate') == false) {
return;
}
if (hasvalidate) {
$('#saveButton').linkbutton('disable').unbind("click");
setTimeout(function() {
$('#saveButton').linkbutton({
disabled : false
});
}, 1000);
parent.mesWorkOrderTemp.save(serializeObject($('#form')), "#tempEdit");
}
}
document.ready = function() {
document.body.style.visibility = 'visible';
}
</script>
</head>
<body class="easyui-layout" fit="true" style="visibility: hidden;">
<div data-options="region:'center',split:true,border:false">
<form id='form'>
<input type="hidden" name="id" value="${mesWorkOrderDTO.id}"/>
<input type="hidden" name="mesWorkPackageId" id="mesWorkPackageId" value="${mesWorkOrderDTO.mesWorkPackageId}" />
<input type="hidden" name="mdsProductProjectId" id="mdsProductProjectId" value="${mesWorkOrderDTO.mdsProductProjectId}" />
<input type="hidden" name="checkInvStatus" id="checkInvStatus" value="${mesWorkOrderDTO.checkInvStatus}" />
<input type="hidden" name="isFinishedWo" id="isFinishedWo" value="${mesWorkOrderDTO.isFinishedWo}" />
<input type="hidden" name="status" id="status" value="${mesWorkOrderDTO.status}" />
<input type="hidden" name="workOrderClasse" id="workOrderClasse" value="${mesWorkOrderDTO.workOrderClasse}" />
<input type="hidden" name="mdsItemNo" id="mdsItemNo" value="${mdsItemConfigDTO.itemNo}" />
<table class="form_commonTable">
<tr>
<th width="13%" style="word-break: break-all; word-warp: break-word;"><span class="remind">*</span> 物料代号:</th>
<td width="37%">
<div class="selector-div">
<input title="物料代号 物料名称(阶段/版本)" class="easyui-validatebox" data-options="required:true,validType:'maxLength[64]'"
style="width: 99%;" type="text" name="itemNo" id="itemNo" readonly="readonly" value="${displayItemNo}" />
<input type="hidden" name="mdsItemConfigId" id="mdsItemConfigId" value="${mesWorkOrderDTO.mdsItemConfigId}" />
<input type="hidden" name="mdsItemId" id="mdsItemId" value="${mesWorkOrderDTO.mdsItemId}" />
<span class="input-right-icon" onclick="selectMdsItemConfig()"></span>
</div>
</td>
<th width="13%" style="word-break: break-all; word-warp: break-word;">来源部门:</th>
<td width="37%"><input title="来源部门ID" class="inputbox easyui-validatebox" readonly="readonly" value="${mesWorkOrderDTO.fromDeptName}"
data-options="validType:'maxLength[50]'" style="width: 99%;" type="text" name="fromDeptName" id="fromDeptName" />
<input type="hidden" name="fromDeptId" id="fromDeptId" value="${mesWorkOrderDTO.fromDeptId}" /></td>
</tr>
<tr>
<th style="word-break: break-all; word-warp: break-word;"><span class="remind">*</span> 生产单元:</th>
<td><input title="生产单元ID" class="easyui-validatebox" data-options="validType:'maxLength[64]'"
style="width: 99%;" type="text" name="mdsWorkUnitId" id="mdsWorkUnitId" /></td>
<th style="word-break: break-all; word-warp: break-word;">工作中心:</th>
<td><input title="工作中心ID" class="easyui-combobox common-combobox" style="width: 99%;" type="text"
data-options="editable : false,validType:'maxLength[64]'" name="mdsWorkCenterId" id="mdsWorkCenterId" /></td>
</tr>
<tr>
<th style="word-break: break-all; word-warp: break-word;">(批/架)次:</th>
<td><input title="批/架次" class="inputbox easyui-validatebox" data-options="validType:'maxLength[20]'"
style="width: 99%;" type="text" name="shiftCode" id="shiftCode" value="${mesWorkOrderDTO.shiftCode}"/></td>
<th style="word-break: break-all; word-warp: break-word;"><span class="remind">*</span> 投产数量:</th>
<td><input title="需求数量/投产数量/投入数量" class="easyui-numberbox easyui-validatebox" value="${mesWorkOrderDTO.reqQty}"
data-options="required:true,validType:['numbervalidation','maxLength[12]']" style="width: 99%;" type="text" name="reqQty" id="reqQty" />
</td>
</tr>
<tr>
<th style="word-break: break-all; word-warp: break-word;"><span class="remind">*</span> 要求节点:</th>
<td><input title="需求时间" class="easyui-datebox " editable="false" data-options="required:true"
style="width: 99%;" type="text" name="reqDate" id="reqDate" /></td>
<th style="word-break: break-all; word-warp: break-word;">来源类型:</th>
<td><pt6:syslookup name="fromType" id="fromType" title="来源类型,通用代码WORK_ORDER_FROM_TYPE" isNull="true"
lookupCode="MES_WORK_ORDER_FROM_TYPE" defaultValue="${mesWorkOrderDTO.fromType}"
dataOptions="editable:false,panelHeight:'auto',onShowPanel:comboboxOnShowPanel">
</pt6:syslookup></td>
</tr>
<tr>
<th style="word-break: break-all; word-warp: break-word;">负责人:</th>
<td><input type="text" class="easyui-validatebox" data-options="validType:'maxLength[64]'" name="dutyManId"
id="dutyManId" /></td>
<th style="word-break: break-all; word-warp: break-word;">军种:</th>
<td><pt6:syslookup name="armyType" id="armyType" title="军种,通用代码ARMY_TYPE" isNull="true"
lookupCode="ARMY_TYPE" defaultValue="${mesWorkOrderDTO.armyType}"
dataOptions="editable:false,panelHeight:'auto',onShowPanel:comboboxOnShowPanel">
</pt6:syslookup></td>
</tr>
<tr>
<th style="word-break: break-all; word-warp: break-word;">库房:</th>
<td><input title="库房ID" class="inputbox easyui-validatebox" data-options="validType:'maxLength[64]'"
style="width: 99%;" type="text" name="mdsWearhouseId" id="mdsWearhouseId" /></td>
<th style="word-break: break-all; word-warp: break-word;"><span class="remind">*</span> 单件工时:</th>
<td><input title="单件工时" class="easyui-numberbox easyui-validatebox" data-options="required:true,validType:'maxLength[13]',precision:'6',min:0"
style="width: 99%;" type="text" name="planRunTime" id="planRunTime" value="${mesWorkOrderDTO.planRunTime}"/></td>
</tr>
<tr>
<th style="word-break: break-all; word-warp: break-word;"><span class="remind">*</span> 工序号:</th>
<td><input title="当前工序号" class="easyui-numberbox easyui-validatebox"
data-options="required:true,validType:['numbervalidation','maxLength[4]']" style="width: 99%;" type="text"
name="currentRouteNo" id="currentRouteNo" value="${mesWorkOrderDTO.currentRouteNo}"/>
</td>
<th style="word-break: break-all; word-warp: break-word;"><span class="remind">*</span> 工序名称:</th>
<td><input title="当前工序名称" class="inputbox easyui-validatebox"
data-options="required:true,validType:'maxLength[50]'" style="width: 99%;" type="text" name="currentRouteName"
id="currentRouteName" value="${mesWorkOrderDTO.currentRouteName}"/></td>
</tr>
<tr>
<td colspan=4>
<table class="form_commonTable">
<tr>
<th width="13%" style="word-break: break-all; word-warp: break-word;">选项:</th>
<td width="87%"><input type="checkbox" id="singleFlag" name="singleFlag"
style="vertical-align: middle; width: 17px; height: 17px;" checked value="Y">单件生产</input></td>
</tr>
</table>
</td>
</tr>
<tr>
<th style="word-break: break-all; word-warp: break-word;">产品编号:</th>
<td colspan=3><textarea title="产品编号" class="easyui-validatebox textareabox"
data-options="validType:'length[0,100]'" style="height: 60px !important;" type="text" name="woSnInfo"
id="woSnInfo">${mesWorkOrderDTO.woSnInfo}</textarea></td>
</tr>
<tr>
<th style="word-break: break-all; word-warp: break-word;">备注:</th>
<td colspan=3><textarea title="备注" class="easyui-validatebox textareabox"
data-options="validType:'length[0,100]'" style="height: 60px !important;" type="text" name="note" id="note" >${mesWorkOrderDTO.note}</textarea></td>
</tr>
</table>
</form>
</div>
<div data-options="region:'south',border:false" style="height: 40px;">
<div id="toolbar" class="datagrid-toolbar datagrid-toolbar-extend foot-formopera">
<table class="tableForm" border="0" cellspacing="1" width='100%'>
<tr>
<td width="50%" align="right"><a title="保存" id="saveButton" class="easyui-linkbutton primary-btn"
onclick="saveForm();" href="javascript:void(0);">保存</a> <a title="返回" id="returnButton" class="easyui-linkbutton"
onclick="closeForm();" href="javascript:void(0);">返回</a></td>
</tr>
</table>
</div>
</div>
</body>
</html>
关联树
最新推荐文章于 2022-01-28 11:39:56 发布