<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改产品供应商')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-supplier-edit" th:object="${wmsSupplier}">
            <input name="supplierId" th:field="*{supplierId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">名称：</label>
                <div class="col-sm-8">
                    <input name="supplierName" th:field="*{supplierName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">简称：</label>
                <div class="col-sm-8">
                    <input name="nameShort" th:field="*{nameShort}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">负责人：</label>
                <div class="col-sm-8">
                    <input name="leader" th:field="*{leader}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">职务：</label>
                <div class="col-sm-8">
                    <input name="duty" th:field="*{duty}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">地址：</label>
                <div class="col-sm-8">
                    <input name="address" th:field="*{address}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label ">固定电话：</label>
                <div class="col-sm-8">
                    <input name="telephone" th:field="*{telephone}" class="form-control" type="text" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label ">手机：</label>
                <div class="col-sm-8">
                    <input name="mobile" th:field="*{mobile}" class="form-control" type="text" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">用户邮箱：</label>
                <div class="col-sm-8">
                    <input name="email" th:field="*{email}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">传真：</label>
                <div class="col-sm-8">
                    <input name="fax" th:field="*{fax}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">网址：</label>
                <div class="col-sm-8">
                    <input name="website" th:field="*{website}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">邮编：</label>
                <div class="col-sm-8">
                    <input name="zip" th:field="*{zip}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">所属行业：</label>
                <div class="col-sm-8">
                    <select name="industry" class="form-control m-b" th:with="type=${@dict.getType('industry')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{industry}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">主营产品：</label>
                <div class="col-sm-8">
                    <input name="products"  th:field="*{products}" class="form-control" type="text" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('supplier_status')}">
                        <input type="radio" th:id="${'supplierStatus_' + dict.dictCode}" name="supplierStatus" th:value="${dict.dictValue}" th:field="*{supplierStatus}" required>
                        <label th:for="${'supplierStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">等级：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('supplier_degree')}">
                        <input type="radio" th:id="${'supplierDegree_' + dict.dictCode}" name="supplierDegree" th:value="${dict.dictValue}" th:field="*{supplierDegree}" required>
                        <label th:for="${'supplierDegree_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">信誉度：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('supplier_credit')}">
                        <input type="radio" th:id="${'supplierCredit_' + dict.dictCode}" name="supplierCredit" th:value="${dict.dictValue}" th:field="*{supplierCredit}" required>
                        <label th:for="${'supplierCredit_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "crm/supplier";
        $("#form-supplier-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-supplier-edit').serialize());
            }
        }
    </script>
</body>
</html>