|
@@ -32,10 +32,21 @@
|
|
|
<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}">${list.produceName}</option>
|
|
|
+ <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>
|
|
@@ -44,44 +55,16 @@
|
|
|
</div>
|
|
|
<div class="input-box">
|
|
|
<span class="input-dic spanhidth">批次:</span>
|
|
|
- <select class="my-select" name="batchId" id="batchId">
|
|
|
- <#if (listptsBatch ?size > 0)>
|
|
|
- <#list listptsBatch as list>
|
|
|
- <option value ="${list.batchId}">${list.batchNo}</option>
|
|
|
- </#list>
|
|
|
- <#else >
|
|
|
- <option value ="">暂无批次,请先添加批次</option>
|
|
|
- </#if>
|
|
|
- </select><br>
|
|
|
+ <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%">请对照生产计划部给到的纸制生产计划信息。</span>
|
|
|
</div>
|
|
|
<div class="input-box">
|
|
|
<span class="input-dic spanhidth">软件版本:</span>
|
|
|
- <select class="my-select" name="versionId" id="versionId">
|
|
|
- <#if (listVersion ?size > 0)>
|
|
|
- <#list listVersion as list>
|
|
|
- <option value ="${list.machineVersionId}">${list.machineVersionName}</option>
|
|
|
- </#list>
|
|
|
- <#else >
|
|
|
- <option value ="">暂无软件版本,请先添加软件版本</option>
|
|
|
- </#if>
|
|
|
- </select>
|
|
|
+ <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>
|
|
|
- <select class="my-select" name="bomId" id="bomId">
|
|
|
- <#if listBom??>
|
|
|
- <#if (listBom ?size > 0)>
|
|
|
- <#list listBom as list>
|
|
|
- <option value ="${list.bomId}">${list.bomName}</option>
|
|
|
- </#list>
|
|
|
- <#else >
|
|
|
- <option value ="">暂无Bom,请先添加Bom单</option>
|
|
|
- </#if>
|
|
|
- <#else >
|
|
|
- <option value ="">暂无Bom,请先添加Bom单</option>
|
|
|
- </#if>
|
|
|
- </select>
|
|
|
+ <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>
|
|
@@ -107,26 +90,46 @@
|
|
|
<#--<script type="text/javascript" src="${path}/common/admin/js/tips.js"></script>-->
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
- /*监听批次修改Bom bom单*/
|
|
|
- $("#batchId").change(function(){
|
|
|
- var batchId = $(this).val();
|
|
|
- getBom(batchId);
|
|
|
- });
|
|
|
- /*监听产品修改批次 bom单*/
|
|
|
+ $(function(){
|
|
|
+ setHtml();
|
|
|
+ })
|
|
|
+
|
|
|
+ /*监听产品修改*/
|
|
|
$("#produceId").change(function(){
|
|
|
- var produceId = $(this).val();
|
|
|
- getProduce(produceId);
|
|
|
+ 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",
|
|
|
+ /* 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) {
|
|
@@ -145,10 +148,10 @@
|
|
|
});
|
|
|
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
/*获取批次信息,赋值在页面上*/
|
|
|
- function getProduce(produceId){
|
|
|
+ /* function getProduce(produceId){
|
|
|
var listptsBatch = new Object();
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
@@ -178,27 +181,14 @@
|
|
|
});
|
|
|
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
function dataCharm() {
|
|
|
|
|
|
var batchId = $("#batchId").val();
|
|
|
if(batchId == null || batchId == "" || typeof(batchId)=="undefined"){
|
|
|
- layer.msg("必须选择一个批次,没有批次请到批次列表添加批次",{icon: 5,time:3000});
|
|
|
+ layer.msg("该产品没有可用的批次,请联系生产部门添加批次信息!",{icon: 5,time:5000});
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
- var versionId = $("#versionId").val();
|
|
|
- if(versionId == null || versionId == "" || typeof(versionId)=="undefined"){
|
|
|
- layer.msg("必须选择一个软件版本,没有软件版本请到产品列表中添加软件版本",{icon: 5,time:3000});
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- var bomId = $("#bomId").val();
|
|
|
- if(bomId == null || bomId == "" || typeof(bomId)=="undefined"){
|
|
|
- layer.msg("必须选择一个Bom单,没有Bom单请到Bom单列表添加Bom单",{icon: 5,time:3000});
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
var machineLine = $("#machineLine").val();
|
|
|
if(machineLine == null || machineLine == "" || typeof(machineLine)=="undefined"){
|
|
|
layer.msg("拉线不能为空",{icon: 5,time:3000});
|