|
@@ -30,9 +30,9 @@
|
|
|
<body>
|
|
|
<article class="page-container">
|
|
|
<form class="form form-horizontal" id="form-admin-add">
|
|
|
- <div class="row cl">
|
|
|
- <div class="formControls col-12 col-sm-12">
|
|
|
- <strong>寄回状态</strong>
|
|
|
+ <div class="row cl" >
|
|
|
+ <label class="form-label col-xs-3 col-sm-3" style="text-align: right;">寄回状态:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-8">
|
|
|
<div class="radio-box">
|
|
|
<input type="radio" id="tel-ot-b1" name="operationType" value="1" <#if operationType == 1>checked</#if>>
|
|
|
<label for="tel-ot-b1">出库</label>
|
|
@@ -43,9 +43,10 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="row cl">
|
|
|
- <div class="formControls col-12 col-sm-12">
|
|
|
- <strong>质量类型</strong>
|
|
|
+
|
|
|
+ <div class="row cl" >
|
|
|
+ <label class="form-label col-xs-3 col-sm-3" style="text-align: right;">质量类型:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-8">
|
|
|
<div class="radio-box">
|
|
|
<input type="radio" id="tel-b1" name="qualityType" checked value="1">
|
|
|
<label for="tel-b1">正常机器</label>
|
|
@@ -56,37 +57,39 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="row cl">
|
|
|
- <div class="formControls col-12 col-sm-12">
|
|
|
- <strong>操作产品</strong>
|
|
|
- <div class="radio-box">
|
|
|
- <span>${inventoryInfo.inventoryProductName!''}(${inventoryInfo.productColorName!''})</span><br>
|
|
|
- </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="row cl" >
|
|
|
+ <label class="form-label col-xs-3 col-sm-3" style="text-align: right;">操作产品:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-8">
|
|
|
+ <span>${inventoryInfo.inventoryProductName!''}(${inventoryInfo.productColorName!''})</span><br>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="row cl">
|
|
|
- <div class="formControls col-12 col-sm-12">
|
|
|
- <strong> </strong>
|
|
|
- <div class="radio-box" style="color: #6d6d72;">
|
|
|
- <span id="inventoryGoodProductNumId">良品库存剩余:${inventoryInfo.inventoryGoodProductNum!''}</span>
|
|
|
- <span id="inventoryDefectiveProductNumId">不良品库存剩余:${inventoryInfo.inventoryDefectiveProductNum!''}</span>
|
|
|
- </div>
|
|
|
+
|
|
|
+ <div class="row cl" >
|
|
|
+ <label class="form-label col-xs-3 col-sm-3" style="text-align: right;"></label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-8">
|
|
|
+ <span id="inventoryGoodProductNumId">良品库存剩余:${inventoryInfo.inventoryGoodProductNum!''}</span>
|
|
|
+ <span id="inventoryDefectiveProductNumId">不良品库存剩余:${inventoryInfo.inventoryDefectiveProductNum!''}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="row cl" style="position: relative;" >
|
|
|
- <div class="formControls col-12 col-sm-12">
|
|
|
- <strong>操作数量</strong>
|
|
|
- <div class="radio-box">
|
|
|
- <input type="text" style="width: 244px;" class="input-text" value="" placeholder="请输入本次入库、出库数量" id="operationNum" name="operationNum">
|
|
|
- </div>
|
|
|
+
|
|
|
+ <div class="row cl" >
|
|
|
+ <label class="form-label col-xs-3 col-sm-3" style="text-align: right;">操作数量:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-8">
|
|
|
+ <input type="text" style="" class="input-text" value="" placeholder="请输入本次入库、出库数量" id="operationNum" name="operationNum">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl" >
|
|
|
+ <label class="form-label col-xs-3 col-sm-3" style="text-align: right;">变更后库存数量:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-8">
|
|
|
+ <input type="text" style="" class="input-text" value="" placeholder="变更后库存数量" id="remainingInventory" name="">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row cl">
|
|
|
- <div class="formControls col-12 col-sm-12">
|
|
|
- <strong>操作备注</strong>
|
|
|
- <div class="radio-box">
|
|
|
- <textarea type="text" placeholder="" id="inventoryDesc" name="inventoryDesc" style="width: 244px;height: 80px;"></textarea>
|
|
|
- </div>
|
|
|
+ <label class="form-label col-xs-3 col-sm-3" style="text-align: right;">操作备注:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-8">
|
|
|
+ <textarea type="text" placeholder="" id="inventoryDesc" name="inventoryDesc" style="width: 100%;height: 50px;">调整库存</textarea>
|
|
|
</div>
|
|
|
</div>
|
|
|
<input type="hidden" value="${inventoryInfo.inventoryId!''}" id="inventoryId" name="inventoryId">
|
|
@@ -137,6 +140,73 @@
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ $(function () {
|
|
|
+ /*监听出库/入库*/
|
|
|
+ $("[name='operationType']").change(function(){
|
|
|
+ changeNum(1);
|
|
|
+ });
|
|
|
+
|
|
|
+ /*监听质量类型 正常机器/维修机器*/
|
|
|
+ $("[name='qualityType']").change(function(){
|
|
|
+ changeNum(1);
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ /*实时操作数量*/
|
|
|
+ document.getElementById("operationNum").addEventListener("input", function(){
|
|
|
+ changeNum(1);
|
|
|
+ });
|
|
|
+ /*实时操作数量*/
|
|
|
+ document.getElementById("remainingInventory").addEventListener("input", function(){
|
|
|
+ changeNum(2);
|
|
|
+ });
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 调整数量
|
|
|
+ * type : 1.调整变更后库存 2.调整操作数量
|
|
|
+ * @returns {boolean}
|
|
|
+ */
|
|
|
+ function changeNum(type) {
|
|
|
+ var oldig = ${inventoryInfo.inventoryGoodProductNum!''}
|
|
|
+ var oldid = ${inventoryInfo.inventoryDefectiveProductNum!''}
|
|
|
+
|
|
|
+ var processNum = 0; //以前的库存
|
|
|
+ var qualityType = $("[name='qualityType']:checked").val() //1:正常 2:维修
|
|
|
+ if(qualityType == 1){ //1:正常
|
|
|
+ processNum = oldig;
|
|
|
+ }else{ // 2:维修
|
|
|
+ processNum = oldid;
|
|
|
+ }
|
|
|
+
|
|
|
+ var operationType = $("[name='operationType']:checked").val() //2入库/1出库
|
|
|
+
|
|
|
+ if(type == 1){
|
|
|
+ var value = $("#operationNum").val(); //操作数量
|
|
|
+ value = value.replace(/[^\d]/g, '');
|
|
|
+ if(operationType == 1){ //1出库
|
|
|
+ $("#remainingInventory").val(accAdd(processNum,-value));
|
|
|
+ }else if(operationType == 2){//2入库
|
|
|
+ $("#remainingInventory").val(accAdd(processNum,value));
|
|
|
+ }
|
|
|
+ $("#operationNum").val(value);
|
|
|
+ }else if(type == 2){
|
|
|
+
|
|
|
+ var remainingInventory = $("#remainingInventory").val() //变更后库存数量
|
|
|
+ remainingInventory = remainingInventory.replace(/[^\d]/g, '');
|
|
|
+ $("#remainingInventory").val(remainingInventory);
|
|
|
+
|
|
|
+ if(remainingInventory >= processNum){
|
|
|
+ $("[name='operationType']").get(1).checked = true; // 2入库
|
|
|
+ $("#operationNum").val(accSub(remainingInventory,processNum));
|
|
|
+ }else{
|
|
|
+ $("[name='operationType']").get(0).checked = true; // 1出库
|
|
|
+ $("#operationNum").val(accSub(processNum,remainingInventory));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
</script>
|
|
|
</body>
|