123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <!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" />
- <#include "/base/add_base.ftl">
- <title>添加翻新机</title>
- <style>
- .my-title{font-weight: 500;padding-left: 15px;position: relative;}
- .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
- .my-input{padding: 8px 10px;width: 80%;border:1px solid rgba(0,0,0,.1);}
- .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
- .input-box{margin: 18px 0;}
- .input-dic{float: left;margin:5px 10px 0 0;font-size: 12px;}
- .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
- .add-list>li{margin: 10px 0;}
- .my-textarea{padding: 5px 10px;width: 80%;border:1px solid rgba(0,0,0,.1);}
- .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
- .my-btn-submit{padding: 10px 20px;width: 150px; background-color: #32a3d8;color: #fff;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
- .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;width: 80%; height: 34px; -webkit-appearance:none;appearance:none;background: url(http://s.iamberry.com/images/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
- input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
- input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
- .spanhidth{width: 70px;text-align: right;}
- </style>
- </head>
- <body>
- <div class="pd-20">
- <form class="form form-horizontal" id="form-admin-add">
- <div class="input-box">
- <span class="input-dic spanhidth">产品:</span>
- <input type="hidden" id="batchId" name="batchId" value="">
- <select class="my-select" name="produceId" id="produceId">
- <#if (produceList ?size > 0)>
- <#list produceList as list>
- <option value ="${list.produceId!''}"
- <#if list.ptsBatch?? >
- isBacth="1"
- bacth = "${list.ptsBatch.batchNo!''}"
- batchId = "${list.ptsBatch.batchId!''}"
- softwareVersionNo="${list.ptsBatch.softwareVersionNo!''}"
- bomName="${list.ptsBatch.bomName!''}"
- <#else >
- isBacth="2"
- </#if>
- >${list.produceName!''}</option>
- </#list>
- <#else >
- <option value ="">暂无产品,请先添加产品</option>
- </#if>
- </select>
- </div>
- <div class="input-box">
- <span class="input-dic spanhidth">批次:</span>
- <span class="input-dic spanhidth" id="ptsBatch" style="width: 76%;text-align: left;padding-left: 10px;height: 30px;"></span>
- <span style="margin-left:15.5%;color:#ccc" >请对照生产计划部给到的纸制生产计划信息。</span>
- </div>
- <div class="input-box">
- <span class="input-dic spanhidth">软件版本:</span>
- <span class="input-dic spanhidth" id="softwareVersionNo" style="width: 76%;text-align: left;padding-left: 10px;height: 30px;"></span>
- </div>
- <div class="input-box">
- <span class="input-dic spanhidth">Bom单:</span>
- <span class="input-dic spanhidth" id="bomName" style="width: 76%;text-align: left;padding-left: 10px;height: 30px;"></span>
- </div>
- <div class="input-box">
- <span class="input-dic" style="margin-top: 0">是否翻新机:</span>
- <label for="radio-10">
- <input type="radio" id="radio-10" name="isRefurbishment" value="1" />是
- </label>
- <label for="radio-11" style="margin-left: 50px;">
- <input type="radio" id="radio-11" name="isRefurbishment" value="2" checked />否
- </label>
- </div>
- <#--<div class="input-box">-->
- <#--<span class="input-dic" style="margin-top: 0">产品类型:</span>-->
- <#--<label for="radio-10">-->
- <#--<input type="radio" id="radio-10" name="productType" value="1" checked/>净水机-->
- <#--</label>-->
- <#--<label for="radio-11" style="margin-left: 50px;">-->
- <#--<input type="radio" id="radio-11" name="productType" value="2"/>冲奶机-->
- <#--</label>-->
- <#--<label for="radio-12" style="margin-left: 50px;">-->
- <#--<input type="radio" id="radio-12" name="productType" value="3"/>电动牙刷-->
- <#--</label>-->
- <#--</div>-->
- <div class="input-box"><span class="input-dic spanhidth">拉线:</span><input class="my-input" type="text" style="width: 76%;" name="machineLine" id="machineLine" value="A1"/> </div>
- <div class="input-box"><span class="input-dic spanhidth">机器数量:</span><input class="my-input" type="text" style="width: 76%;" name="number" id="number" value="4" placeholder="每次最少生成一个机器"/> </div>
- <#--<div class="input-box">如果遇到批次,软件版本,BOM不清晰时,请联系POA(刘经理)</div>-->
- <div class="input-box">
- <span class="input-dic spanhidth"></span>
- <input id="sumbit" class="btn btn-primary radius" type="button" value=" 提交 " onclick="admin_add()">
- </div>
- </form>
- </div>
- <#--<script type="text/javascript" src="${path}/common/admin/js/tips.js"></script>-->
- <script type="text/javascript">
- $(function(){
- setHtml();
- })
- /*监听产品修改*/
- $("#produceId").change(function(){
- setHtml();
- });
- function setHtml(){
- var flag = false;
- var isBacth = $("#produceId").find("option:selected").attr("isBacth");
- if(isBacth == 1){
- var ptsBatch = $("#produceId").find("option:selected").attr("bacth");
- var softwareVersionNo = $("#produceId").find("option:selected").attr("softwareVersionNo");
- var bomName = $("#produceId").find("option:selected").attr("bomName");
- var batchId = $("#produceId").find("option:selected").attr("batchId");
- $("#ptsBatch").html(ptsBatch);
- $("#ptsBatch").css("color","#000");
- $("#softwareVersionNo").html(softwareVersionNo);
- $("#bomName").html(bomName);
- $("#batchId").val(batchId);
- }else{
- $("#ptsBatch").css("color","#d00");
- $("#ptsBatch").html("请添加对应产品的正在使用状态的批次!");
- $("#softwareVersionNo").html("");
- $("#bomName").html("");
- $("#batchId").val("");
- }
- }
- /*获取bom信息,赋值在页面上*/
- /* function getBom(batchId){
- var bom = new Object();
- $.ajax({
- type: "POST",
- data: {
- batchId : batchId
- },
- url: "${path}/admin/machine/select_bom",
- async: false,
- success: function(data){
- if (data.returnCode == 200) {
- bom = data.returnMsg.listBom;
- }
- },
- error: function(XmlHttpRequest, textStatus, errorThrown){
- }
- });
- if(bom != null){
- $("#bomId").empty();
- $.each(bom,function(n,value) {
- var appoption = "<option value='"+value.bomId+"'>"+value.bomName+"</option>";
- $("#bomId").append(appoption);
- });
- }
- }*/
- /*获取批次信息,赋值在页面上*/
- /* function getProduce(produceId){
- var listptsBatch = new Object();
- $.ajax({
- type: "POST",
- data: {
- productId : produceId
- },
- url: "${path}/admin/machine/select_Batch",
- async: false,
- success: function(data){
- if (data.returnCode == 200) {
- listptsBatch = data.returnMsg.listptsBatch;
- }
- },
- error: function(XmlHttpRequest, textStatus, errorThrown){
- }
- });
- if(listptsBatch != null){
- $("#bomId").empty();
- $("#batchId").empty();
- $.each(listptsBatch,function(n,value) {
- if(n == 0){
- getBom(value.batchId);
- }
- var appoption = "<option value='"+value.batchId+"'>"+value.batchNo+"</option>";
- $("#batchId").append(appoption);
- });
- }
- }*/
- function dataCharm() {
- var batchId = $("#batchId").val();
- if(batchId == null || batchId == "" || typeof(batchId)=="undefined"){
- layer.msg("该产品没有可用的批次,请联系生产部门添加批次信息!",{icon: 5,time:5000});
- return false;
- }
- var machineLine = $("#machineLine").val();
- if(machineLine == null || machineLine == "" || typeof(machineLine)=="undefined"){
- layer.msg("拉线不能为空",{icon: 5,time:3000});
- return false;
- }
- var number = $("#number").val();
- if(number == null || number == "" || typeof(number)=="undefined"){
- layer.msg("数量不能为空",{icon: 5,time:3000});
- return false;
- }
- if(number == 0){
- layer.msg("数量不能小于1",{icon: 5,time:3000});
- return false;
- }
- if(1 > number.length > 5){
- layer.msg("数量长度为2-10位",{icon: 5,time:3000});
- return false;
- }
- if( number > 500){
- layer.msg("每次最高生产数量为500",{icon: 5,time:3000});
- return false;
- }
- return true;
- }
- /*机器-添加*/
- function admin_add(){
- var msg = dataCharm();
- if(msg){
- $("#submit").attr("disabled","disabled");
- layer.msg('加载中', {icon: 16,time:500000});
- $.ajax({
- url: '${path}/admin/machine/add_renovationMachine',
- type: "POST",
- dataType: "json",
- data: $("#form-admin-add").serialize(),
- success: function(data){
- layer.msg('加载中', {icon: 16});
- $("#submit").removeAttr("disabled");
- if(data.returnCode){
- layer.msg("添加成功",{icon: 1,time:3000});
- window.parent.location.reload();
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index);
- }else{
- layer.msg("添加失败",{icon: 5,time:3000});
- }
- },
- error:function(data){
- layer.msg("添加失败",{icon: 5,time:3000});
- }
- });
- }
- }
- </script>
- </body>
- </html>
|