155 lines
4.7 KiB
Plaintext
155 lines
4.7 KiB
Plaintext
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
|
<html>
|
|
<head>
|
|
<title></title>
|
|
<jsp:include page="../inc.jsp"></jsp:include>
|
|
<script type="text/javascript">
|
|
function dosave(dialog,grid) {
|
|
if ($(".form").form('validate')) {
|
|
$.post(ext.contextPath + "/material/materialinfo/save.do", $(".form").serialize(), function(data) {
|
|
if (data.res == 1) {
|
|
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
|
//刷新列表
|
|
grid.datagrid('reload');
|
|
dialog.dialog('destroy');
|
|
});
|
|
}else if(data.res == 0){
|
|
top.$.messager.alert('提示', "保存失败", 'info');
|
|
}else{
|
|
top.$.messager.alert('提示', data.res, 'info');
|
|
}
|
|
},'json');
|
|
}
|
|
}
|
|
|
|
function selectDrawing(){
|
|
var dialog = parent.ext.modalDialog({
|
|
title : '选择图纸',
|
|
width : 800,
|
|
height : 480,
|
|
closeOnEscape:true,
|
|
url : ext.contextPath + '/document/selectDrawing.do?productcode=${productcode}',
|
|
buttons : [{
|
|
text : '确定',
|
|
iconCls:'icon-ok',
|
|
handler : function() {
|
|
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
|
if(res!=null){
|
|
dialog.dialog('destroy');
|
|
$("#figurenumberid").val((res.id== 'undefined')?'':res.id);
|
|
$("#figurenumber").textbox('setValue',(res.number == 'undefined')?'':res.number);
|
|
$("#figurename").text((res.docname == 'undefined')?'':res.docname);
|
|
}
|
|
}
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
$(function() {
|
|
$('#unit').combobox({
|
|
url:ext.contextPath + '/material/materialunit/getJsonUnit.do',
|
|
valueField:'unit',
|
|
textField:'unit',
|
|
editable:false,
|
|
panelHeight:'auto',
|
|
});
|
|
|
|
$('#tname').combotree({
|
|
url : ext.contextPath + '/material/materialtype/getMenusJsonActive.do?random=' + Math.random(),
|
|
parentField : 'pid',
|
|
method:'get',
|
|
required:true,
|
|
onBeforeSelect:function(node){
|
|
if(node.id=="-1"){
|
|
$("#tname").tree("unselect");
|
|
}
|
|
},
|
|
onClick : function(node) {
|
|
$("#typeid").val(node.id);
|
|
var materialcode=$("#materialcode").textbox('getValue');
|
|
var oldmaterialcode=$("#mtypetemp").val();//删除旧的物料编码前缀
|
|
if(oldmaterialcode!=null && oldmaterialcode!=""){
|
|
materialcode=materialcode.substring(oldmaterialcode.length,materialcode.length);
|
|
}
|
|
materialcode=node.attributes.typecode+materialcode;
|
|
$("#mtypetemp").val(node.attributes.typecode);
|
|
$("#materialcode").textbox('setValue',materialcode);
|
|
}
|
|
});
|
|
|
|
$("#figurenumber").textbox("textbox").bind("click",function(){
|
|
selectDrawing();
|
|
});
|
|
});
|
|
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<form method="post" class="form">
|
|
<input id="mtypetemp" type="hidden" value=""/>
|
|
<table class="table">
|
|
<tr>
|
|
<th>物料代码</th>
|
|
<td><input id="materialcode" name="materialcode" class="easyui-textbox"
|
|
data-options="required:true,validType:'isBlank'" value="" /></td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<th>物料名称</th>
|
|
<td><input name="materialname" class="easyui-textbox"
|
|
data-options="required:true,validType:'isBlank'" value="" /></td>
|
|
</tr>
|
|
<tr>
|
|
<th>物料型号</th>
|
|
<td><input name="materialmodel" class="easyui-textbox"
|
|
data-options="required:true,validType:'isBlank'" value="" /></td>
|
|
</tr>
|
|
<tr>
|
|
<th>物料属性</th>
|
|
<td ><select id="materialproperties" name="materialproperties" class="easyui-combobox" data-options="panelHeight:'auto'">
|
|
<option value="自制" selected>自制</option>
|
|
<option value="外购">外购</option>
|
|
</select></td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<th>辅助属性</th>
|
|
<td><input name="secondaryattribute" class="easyui-textbox"
|
|
data-options="required:true,validType:'isBlank'" value="" /></td>
|
|
</tr>
|
|
<tr>
|
|
<th>基本单位用量</th>
|
|
<td><input name="unituse" class="easyui-textbox"
|
|
data-options="required:true,validType:'isBlank'" value="" /></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>单位</th>
|
|
<td>
|
|
<input id="unit" name="unit" class="easyui-combobox" value="" />
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<th>良率(%)</th>
|
|
<td><input name="materialmodel" class="easyui-textbox"
|
|
data-options="required:true,validType:'isBlank'" value="" /></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>备注</th>
|
|
<td>
|
|
<input name="remark" class="easyui-textbox" style="width:100%;height:100px"
|
|
value=""data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</body>
|
|
</html>
|
|
|