<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('请货报表新增')" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-add">
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <!--is-required 增加星号 显示为必填-->
                            <label class="col-sm-3 control-label">商品编码:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="productCode" id="productCode" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">门店简称:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="storeShortName" id="storeShortName" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">商品名称:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="productName" id="productName" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">请货单号:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="requisitionOrderNumber" id="requisitionOrderNumber" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">剂型:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="dosageForm" id="dosageForm" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">规格:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="specification" id="specification" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">生产厂商:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="manufacturer" id="manufacturer" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">供货单位:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="supplier" id="supplier" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">数量:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="quantity" id="quantity" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">请货日期:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="requisitionDate" id="requisitionDate" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">产地:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="origin" id="origin" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">请货员（采购员）:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="requisitioner" id="requisitioner" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                </div>
            </div>

        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">

    function submitHandler() {
        if ($.validate.form()) {
            add();
        }
    }

    function add() {
           var productCode = $("input[name='productCode']").val();
           var storeShortName = $("input[name='storeShortName']").val();
           var productName = $("input[name='productName']").val();
           var requisitionOrderNumber = $("input[name='requisitionOrderNumber']").val();
           var dosageForm = $("input[name='dosageForm']").val();
           var specification = $("input[name='specification']").val();
           var manufacturer = $("input[name='manufacturer']").val();
           var supplier = $("input[name='supplier']").val();
           var quantity = $("input[name='quantity']").val();
           var requisitionDate = $("input[name='requisitionDate']").val();
           var origin = $("input[name='origin']").val();
           var requisitioner = $("input[name='requisitioner']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "kc/skcbbrequisitionorderitems/sKcBbRequisitionorderitemsAdd",
            data : {
                "productCode": productCode,
                "storeShortName": storeShortName,
                "productName": productName,
                "requisitionOrderNumber": requisitionOrderNumber,
                "dosageForm": dosageForm,
                "specification": specification,
                "manufacturer": manufacturer,
                "supplier": supplier,
                "quantity": quantity,
                "requisitionDate": requisitionDate,
                "origin": origin,
                "requisitioner": requisitioner,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
