lockingWorkOrder.html 3.72 KB
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body>
    <table width="100%" border="1" cellspacing="0" cellpadding="0"  class="dy-report"  align="center" borderColor="blue">
        <tbody>
        <tr height="30px" align="center" valign="center">
            <th width="70px">库存id</th>
            <th width="120px">存货编码</th>
            <th width="120px">库位编码</th>
            <th width="100px">托盘编码</th>
            <th width="80px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
            <th width="200px">工作令</th>
        </tr>
        </tbody>
        <tbody>
        <tr th:each="row,rowStat : ${inventoryDetails}">
            <td  scope="col" style="text-align:center">
                <input  name="id" th:value="*{row.id}" class="form-control" type="text" style="text-align:center;height:30px;border: none"/>
            </td>
            <td  scope="col" style="text-align:center">
                <input  name="materialCode" th:value="*{row.materialCode}" class="form-control" type="text" style="text-align:center;height:30px;border: none"/>
            </td>
            <td  scope="col" style="text-align:center">
                <input  name="locationCode" th:value="*{row.locationCode}" class="form-control" type="text" style="text-align:center;height:30px;border: none"/>
            </td>
            <td  scope="col" style="text-align:center">
                <input  name="containerCode" th:value="*{row.containerCode}" class="form-control" type="text" style="text-align:center;height:30px;border: none"/>
            </td>
            <td style="text-align:center; padding: 0">
                <input  name="lockingNum" th:value="*{row.qty}" class="form-control" type="text" style="text-align:center;height:30px;border: none"/>
            </td>
            <td style="text-align:center; padding: 0">
                <input  name="workOrder"  class="form-control" type="text" style="text-align:center;height:30px;border: none" placeholder="请输入工作令"  required/>
            </td>
        </tr>
        </tbody>
    </table>
    <div class="btn-group hidden-xs" id="toolbar-detail" role="group" style="padding:20px 0;" float="right">
        <a class="btn btn-outline btn-primary btn-rounded" onclick="yes()" >
            <i class="fa fa-plus"></i> 提交
        </a>
    </div>
<div th:include="include::footer"></div>
<script type="text/javascript">
    function yes() {
        debugger
        var id = [];
        var workOrder = [];
        var lockingNum = [];
        $("input[name='id']").each(function () {
            id.push($(this).val());
        })
        $("input[name='workOrder']").each(function () {
            workOrder.push($(this).val());
        })
        $("input[name='lockingNum']").each(function () {
            lockingNum.push($(this).val());
        })
        no(id,workOrder,lockingNum)
    }
    function no(id,workOrder,lockingNum){
        var list=[];
        console.log(id);
        console.log(id.length);
        for(var i=0;i<id.length;i++){
            let a = id[i];
            let b = workOrder[i];
            let c = lockingNum[i];
            var data= {
                "id":a,
                "moCode":b,
               // "qty":c
            }
            list.push(data);
        }
        var data2 = JSON.stringify(list);
        $.ajax({
            url:ctx + 'inventory/inventoryDetail/lockingWorkOrders',
            type: 'post',
            datatype: "json",
            data:{
                "json":data2
            },
            success : function (value) {
                debugger
                $.operate.saveSuccess(value);
            }
        });
    }
</script>
</body>
</html>