<!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="storeCode" id="storeCode" 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="storeName" id="storeName" 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="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="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="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="unit" id="unit" 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="batchNumber" id="batchNumber" 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="batch" id="batch" 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="storageArea" id="storageArea" 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="isDispensed" id="isDispensed" 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="dispenseFactor" id="dispenseFactor" 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="sourceDocumentNumber" id="sourceDocumentNumber" 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="documentNumber" id="documentNumber" 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="documentType" id="documentType" 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="inventoryChangeQuantity" id="inventoryChangeQuantity" 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="inventoryBeforeChange" id="inventoryBeforeChange" 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="costUnitPrice" id="costUnitPrice" 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="costAmount" id="costAmount" 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="instantRemainingInventory" id="instantRemainingInventory" 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="documentTime" id="documentTime" 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="inventoryChangeTime" id="inventoryChangeTime" 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 storeCode = $("input[name='storeCode']").val();
           var storeName = $("input[name='storeName']").val();
           var productCode = $("input[name='productCode']").val();
           var productName = $("input[name='productName']").val();
           var dosageForm = $("input[name='dosageForm']").val();
           var specification = $("input[name='specification']").val();
           var unit = $("input[name='unit']").val();
           var manufacturer = $("input[name='manufacturer']").val();
           var batchNumber = $("input[name='batchNumber']").val();
           var batch = $("input[name='batch']").val();
           var storageArea = $("input[name='storageArea']").val();
           var isDispensed = $("input[name='isDispensed']").val();
           var dispenseFactor = $("input[name='dispenseFactor']").val();
           var sourceDocumentNumber = $("input[name='sourceDocumentNumber']").val();
           var documentNumber = $("input[name='documentNumber']").val();
           var documentType = $("input[name='documentType']").val();
           var inventoryChangeQuantity = $("input[name='inventoryChangeQuantity']").val();
           var inventoryBeforeChange = $("input[name='inventoryBeforeChange']").val();
           var costUnitPrice = $("input[name='costUnitPrice']").val();
           var costAmount = $("input[name='costAmount']").val();
           var instantRemainingInventory = $("input[name='instantRemainingInventory']").val();
           var documentTime = $("input[name='documentTime']").val();
           var inventoryChangeTime = $("input[name='inventoryChangeTime']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "kc/skcbbjxcspmxstoreinventorychanges/sKcBbJxcspmxStoreinventorychangesAdd",
            data : {
                "storeCode": storeCode,
                "storeName": storeName,
                "productCode": productCode,
                "productName": productName,
                "dosageForm": dosageForm,
                "specification": specification,
                "unit": unit,
                "manufacturer": manufacturer,
                "batchNumber": batchNumber,
                "batch": batch,
                "storageArea": storageArea,
                "isDispensed": isDispensed,
                "dispenseFactor": dispenseFactor,
                "sourceDocumentNumber": sourceDocumentNumber,
                "documentNumber": documentNumber,
                "documentType": documentType,
                "inventoryChangeQuantity": inventoryChangeQuantity,
                "inventoryBeforeChange": inventoryBeforeChange,
                "costUnitPrice": costUnitPrice,
                "costAmount": costAmount,
                "instantRemainingInventory": instantRemainingInventory,
                "documentTime": documentTime,
                "inventoryChangeTime": inventoryChangeTime,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
