|
@@ -0,0 +1,263 @@
|
|
|
|
+<!--_meta 作为公共模版分离出去-->
|
|
|
|
+<!DOCTYPE HTML>
|
|
|
|
+<html>
|
|
|
|
+<head>
|
|
|
|
+<meta charset="utf-8">
|
|
|
|
+<meta name="renderer" content="webkit|ie-comp|ie-stand">
|
|
|
|
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
|
+<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
|
|
|
+<meta http-equiv="Cache-Control" content="no-siteapp" />
|
|
|
|
+<link rel="Bookmark" href="/favicon.ico" >
|
|
|
|
+<link rel="Shortcut Icon" href="/favicon.ico" />
|
|
|
|
+<#include "/base/add_base.ftl">
|
|
|
|
+ <link href="${path }/common/kingedit/themes/default/default.css" rel="stylesheet" type="text/css" />
|
|
|
|
+<title>修改机器零件</title>
|
|
|
|
+</head>
|
|
|
|
+<body>
|
|
|
|
+<article class="page-container">
|
|
|
|
+ <form action="" method="post" class="form form-horizontal" id="form-parts-update">
|
|
|
|
+
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3">所属机器:</label>
|
|
|
|
+ <div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
|
|
|
|
+ <select class="select" size="1" name="produceId" id="produceId">
|
|
|
|
+ <#if (produceList ?size > 0)>
|
|
|
|
+ <#list produceList as list>
|
|
|
|
+ <option value ="${list.produceId}" <#if ptsComponents.produceId == list.produceId>selected</#if>>${list.produceName}</option>
|
|
|
|
+ </#list>
|
|
|
|
+ <#else >
|
|
|
|
+ <option value ="">暂无产品,请到生产产品列表添加产品</option>
|
|
|
|
+ </#if>
|
|
|
|
+ </select>
|
|
|
|
+ </span> </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>零件编号:</label>
|
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
|
+ <input type="text" class="input-text" value="${ptsComponents.componentsNo!''}" id="componentsNo" name="componentsNo" placeholder="请输入零件编号,支持数字、字母组合">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>零件名称:</label>
|
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
|
+ <input type="text" class="input-text" value="${ptsComponents.componentsName!''}" id="componentsName" name="componentsName" placeholder="请输入1-30位的名称,支持中文、字母、数字">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3">供应商:</label>
|
|
|
|
+ <div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
|
|
|
|
+ <select class="select" size="1" name="supplierId" id="supplierId">
|
|
|
|
+ <#if (listSupplier ?size > 0)>
|
|
|
|
+ <#list listSupplier as list>
|
|
|
|
+ <option value ="${list.supplierId}"<#if ptsComponents.supplierId == list.supplierId>selected</#if>>${list.supplierName}</option>
|
|
|
|
+ </#list>
|
|
|
|
+ <#else >
|
|
|
|
+ <option value ="">暂无供应商,请到供应商列表添加供应商</option>
|
|
|
|
+ </#if>
|
|
|
|
+ </select>
|
|
|
|
+ </span> </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3">零件图片:</label>
|
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
|
+ <img alt="介绍图" src="${ptsComponents.componentsImg!''}" id="partsImg" width="90" height="80">
|
|
|
|
+ <input type="hidden" id="componentsImg" name="componentsImg" value="${ptsComponents.componentsImg!''}"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>零件状态:</label>
|
|
|
|
+ <div class="formControls col-xs-8 col-sm-9 skin-minimal">
|
|
|
|
+ <div class="radio-box">
|
|
|
|
+ <input name="componentsStatus" type="radio" value="0" id="sex-1" <#if ptsComponents.componentsStatus == 0>checked</#if>>
|
|
|
|
+ <label for="sex-1">停止使用</label>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="radio-box">
|
|
|
|
+ <input type="radio" id="sex-2" value="1" name="componentsStatus" <#if ptsComponents.componentsStatus == 1>checked</#if>>
|
|
|
|
+ <label for="sex-2">正常使用</label>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>零件成本:</label>
|
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
|
+ <input type="text" class="input-text" value="${ptsComponents.componentsCost!''}" id="componentsCost" name="componentsCost" placeholder="请输入零件成本,单位为元">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>零件重量:</label>
|
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
|
+ <input type="text" class="input-text" value="${ptsComponents.componentsWeight!''}" id="componentsWeight" name="componentsWeight" placeholder="请输入零件重量,单位为克">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>零件材料:</label>
|
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
|
+ <input type="text" class="input-text" value="${ptsComponents.componentsMaterial!''}" id="componentsMaterial" name="componentsMaterial" placeholder="请输入1-30位的材料,支持中文、字母、数字">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>材料类型:</label>
|
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
|
+ <select class="select" size="1" name="componentsType" id="componentsType">
|
|
|
|
+ <option value ="1"<#if ptsComponents.componentsType == 1>selected</#if>>塑胶件</option>
|
|
|
|
+ <option value ="2"<#if ptsComponents.componentsType == 2>selected</#if>>五金件</option>
|
|
|
|
+ <option value ="3"<#if ptsComponents.componentsType == 3>selected</#if>>其他</option>
|
|
|
|
+ </select>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>MBSC:</label>
|
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
|
+ <input type="text" class="input-text" value="${ptsComponents.componentsMbsc!''}" id="componentsMbsc" name="componentsMbsc" placeholder="请输入MBSC">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>规格:</label>
|
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
|
+ <input type="text" class="input-text" value="${ptsComponents.componentsSpecification!''}" id="componentsSpecification" name="componentsSpecification" placeholder="请输入材料规格(允许为空)">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3">备注:</label>
|
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
|
+ <textarea name="componentsDesc" id="componentsDesc" cols="" rows="" class="textarea" placeholder="请输入零件的备注(允许为空)" onKeyUp="$.Huitextarealength(this,100)">${ptsComponents.componentsDesc!''}</textarea>
|
|
|
|
+ <p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <label class="form-label col-xs-4 col-sm-3"></label>
|
|
|
|
+ <span class="c-red">*提示</span><span>:新增的零件,如果在机器生产有使用,请更新Bom单。</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="row cl">
|
|
|
|
+ <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
|
|
|
|
+ <input type="hidden" value="${ptsComponents.componentsId!''}" name="componentsId">
|
|
|
|
+ <input class="btn btn-primary radius" type="submit" value=" 提交 ">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </form>
|
|
|
|
+</article>
|
|
|
|
+<script type="text/javascript" src="${path}/common/kingedit/kindeditor.js"></script>
|
|
|
|
+<script type="text/javascript" src="${path}/common/kingedit/lang/zh_CN.js"></script>
|
|
|
|
+<script type="text/javascript">
|
|
|
|
+
|
|
|
|
+ KindEditor.ready(function(K) {
|
|
|
|
+ var editor = K.editor({
|
|
|
|
+ fileManagerJson : '${path}/common/kingedit/jsp/file_manager_json.jsp',
|
|
|
|
+ uploadJson : '${path}/common/kingedit/jsp/upload_json.jsp',
|
|
|
|
+ allowFileManager : true
|
|
|
|
+ });
|
|
|
|
+ K('#partsImg').click(function() {
|
|
|
|
+ var imgid = $(this).attr("id");//获取当前ID
|
|
|
|
+ editor.loadPlugin('image', function() {
|
|
|
|
+ editor.plugin.imageDialog({
|
|
|
|
+ showRemote : false,
|
|
|
|
+ imageUrl : K('#componentsImg').val(),
|
|
|
|
+ clickFn : function(url, title, width, height, border, align) {
|
|
|
|
+ K('#partsImg').attr("src",url);
|
|
|
|
+ K('#componentsImg').val(url);
|
|
|
|
+ editor.hideDialog();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $(function(){
|
|
|
|
+ $('.skin-minimal input').iCheck({
|
|
|
|
+ checkboxClass: 'icheckbox-blue',
|
|
|
|
+ radioClass: 'iradio-blue',
|
|
|
|
+ increaseArea: '20%'
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $("#form-parts-update").validate({
|
|
|
|
+ rules:{
|
|
|
|
+ produceId:{
|
|
|
|
+ required:true
|
|
|
|
+ },
|
|
|
|
+ componentsNo:{
|
|
|
|
+ required:true,
|
|
|
|
+ minlength:2,
|
|
|
|
+ maxlength:11
|
|
|
|
+ },
|
|
|
|
+ componentsName:{
|
|
|
|
+ required:true,
|
|
|
|
+ minlength:2,
|
|
|
|
+ maxlength:30
|
|
|
|
+ },
|
|
|
|
+ componentsCost:{
|
|
|
|
+ required:true,
|
|
|
|
+ minlength:1,
|
|
|
|
+ maxlength:11
|
|
|
|
+ },
|
|
|
|
+ componentsWeight:{
|
|
|
|
+ required:true,
|
|
|
|
+ minlength:1,
|
|
|
|
+ maxlength:11
|
|
|
|
+ },
|
|
|
|
+ componentsMaterial:{
|
|
|
|
+ required:true,
|
|
|
|
+ minlength:1,
|
|
|
|
+ maxlength:30
|
|
|
|
+ },
|
|
|
|
+ componentsMbsc:{
|
|
|
|
+ required:true,
|
|
|
|
+ minlength:1,
|
|
|
|
+ maxlength:1
|
|
|
|
+ },
|
|
|
|
+ componentsSpecification:{
|
|
|
|
+ required:true,
|
|
|
|
+ minlength:1,
|
|
|
|
+ maxlength:50
|
|
|
|
+ },
|
|
|
|
+ componentsImg:{
|
|
|
|
+ required:true,
|
|
|
|
+ minlength:1,
|
|
|
|
+ maxlength:100
|
|
|
|
+ },
|
|
|
|
+ componentsDesc:{
|
|
|
|
+ minlength:1,
|
|
|
|
+ maxlength:100
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onkeyup:false,
|
|
|
|
+ focusCleanup:true,
|
|
|
|
+ success:"valid",
|
|
|
|
+ submitHandler:function(form){
|
|
|
|
+
|
|
|
|
+ //$(form).ajaxSubmit();
|
|
|
|
+ //var index = parent.layer.getFrameIndex(window.name);
|
|
|
|
+ //parent.$('.btn-refresh').click();
|
|
|
|
+ //parent.layer.close(index);
|
|
|
|
+ $.ajax({
|
|
|
|
+ cache: true,
|
|
|
|
+ type: "POST",
|
|
|
|
+ data: $("#form-parts-update").serialize(),
|
|
|
|
+ url: "${path}/admin/machineParts/update_machineParts",
|
|
|
|
+ async: false,
|
|
|
|
+ success: function(data){
|
|
|
|
+ if (data.returnCode == 200) {
|
|
|
|
+ layer.msg('修改成功!', {icon: 1, time: 2000});
|
|
|
|
+ window.location.href = '${path}/admin/machineParts/_parts_list'
|
|
|
|
+ }else if(data.returnCode == 501){
|
|
|
|
+ layer.msg('该零件已保存,不能重复!', {icon: 2, time: 2000});
|
|
|
|
+ }else{
|
|
|
|
+ layer.msg('修改失败!', {icon: 2, time: 2000});
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
|
+ layer.msg('修改失败!', {icon: 2, time: 2000});
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+});
|
|
|
|
+</script>
|
|
|
|
+<!--/请在上方写此页面业务相关的脚本-->
|
|
|
|
+</body>
|
|
|
|
+</html>
|