<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改配送单')" />
</head>
<body>
<div class="main-content">
    <form class="form-horizontal" id="form-server-edit" th:object="${cold}">
        <h4 class="form-header h4">配送信息</h4>
        <input type="hidden" id="id" name="id" th:value="${id}">
        <div class="row">
            <div class="col-sm-3">
                <label class="col-sm-4 control-label">预计配送时间</label>
                <div class="form-group">
                    <input type="text" class="styled-input time-input-new" id="expectedDeliveryTime"  name="expectedDeliveryTime" placeholder="预计配送时间" th:value="${expectedDeliveryTime}"/>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="form-group">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">实际配送时间</label>
                        <input type="text" class="styled-input time-input-new" id="actualDeliveryTime" placeholder="实际配送时间" name="actualDeliveryTime" th:value="${expectedDeliveryTime}"/>
                    </div>
                </div>
            </div>

            <div class="col-sm-3">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">所属连锁：</label>
                    <div class="col-sm-8">
                        <div class="input-group">
                            <input name="chainName" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择门店" class="form-control" th:value="${chainName}">
                            <span class="input-group-addon">
                        <i class="fa fa-search"></i>
                    </span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">所属门店：</label>
                    <div class="col-sm-8">
                        <select name="storeName" class="form-control" th:with="type=${@dict.getType('sys_select_store')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${storeName}"
                            ></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-3">
                <div class="form-group">
                    <label class="col-sm-6 control-label">是否线上签收：</label>
                    <div class="col-sm-4">
                        <select name="isOnlineSignature" class="form-control" th:with="type=${@dict.getType('sys_yes_no')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${isOnlineSignature}"
                            ></option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="col-sm-3">
                <div class="form-group">
                    <label class="col-sm-4 control-label">配送状态：</label>
                    <div class="col-sm-4">
                        <select name="deliveryStatus"  class="form-control"  th:with="type=${@dict.getType('sys_select_pszt')}">
                            <option value="">全部</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${deliveryStatus}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="form-group">
                    <label class="col-sm-4 control-label">冷链类型：</label>
                    <div class="col-sm-4">
                        <select name="coldChainType"  class="form-control"  th:with="type=${@dict.getType('sys_select_cold_type')}">
                            <option value="">全部</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${coldChainType}"
                            ></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="form-group">
                    <label class="col-sm-4 control-label">订单来源：</label>
                    <div class="col-sm-4">
                        <select name="orderSource"  class="form-control"  th:with="type=${@dict.getType('sys_select_order_sources')}">
                            <option value="">全部</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${orderSource}"
                            ></option>
                        </select>
                    </div>
                </div>
            </div>

        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-4 control-label">收货人：</label>
                    <div class="col-sm-8">
                        <input id="recipientName" name="recipientName"  type="text" maxlength="100"  class="form-control" placeholder="请输入收货人" th:value="${recipientName}">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-4 control-label">收货电话：</label>
                    <div class="col-sm-8">
                        <input id="recipientPhone" name="recipientPhone"  type="number" maxlength="11"  class="form-control" placeholder="请输入收货电话" th:value="${recipientPhone}">
                    </div>
                </div>
            </div>

            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-4 control-label">冰排编号：</label>

                    <div class="col-sm-8">
                        <input id="icePackNumber" name="icePackNumber" placeholder="请输入冰排编号" class="form-control" type="text" maxlength="50" th:value="${icePackNumber}">
                    </div>
                </div>
            </div>


        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-4 control-label">收货地址：</label>
                    <div class="col-sm-8">
                        <input id="recipientAddress" name="recipientAddress"  type="text" maxlength="1000"  class="form-control" placeholder="请输入收货地址" th:value="${recipientAddress}">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-4 control-label">出发温度：</label>
                    <div class="col-sm-8">
                        <input id="departureTemperature" name="departureTemperature"  type="text" maxlength="10"  class="form-control" placeholder="请输入出发温度" th:value="${departureTemperature}">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-4 control-label">送达温度：</label>
                    <div class="col-sm-8">
                        <input id="arrivalTemperature" name="arrivalTemperature"  type="text" maxlength="10"  class="form-control" placeholder="请输入送达温度" th:value="${arrivalTemperature}">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-4 control-label">签收照片：</label>
                    <div class="col-sm-8">
                        <input id="signaturePhoto" name="signaturePhoto"  type="text" maxlength="1000"  class="form-control" placeholder="签收照片" th:value="${signaturePhoto}">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-4 control-label">配送员：</label>
                    <div class="col-sm-8">
                        <input id="deliveryPerson" name="deliveryPerson" placeholder="请输入配送员" class="form-control" type="text" maxlength="50"  th:value="${deliveryPerson}">
                    </div>
                </div>
            </div>


            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-4 control-label">配送箱编号：</label>
                    <div class="col-sm-8">
                        <input id="deliveryBoxNumber" name="deliveryBoxNumber"  type="text" maxlength="25"  class="form-control" placeholder="配送箱编号" th:value="${deliveryBoxNumber}">
                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4">其他信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">付款顺序：</label>
                    <div class="col-sm-8">
                        <select name="paymentSequence" class="form-control" th:with="type=${@dict.getType('sys_select_payment_sequence')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${paymentSequence}"
                            ></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<div class="main-content">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
    </div>
</div>
<th:block th:include="include :: footer" />
</body>
</html>

<script>

    /* 用户管理-新增-选择门店树 */
    function selectDeptTree() {
        var treeId = $("#treeId").val();
        var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
        var url = ctx + "system/user/selectDeptTree/" + deptId;
        var options = {
            title: '选择门店',
            width: "380",
            url: url,
            callBack: doSubmit
        };
        $.modal.openOptions(options);
    }

    function doSubmit(index, layero){
        var body = $.modal.getChildFrame(index);
        $("#treeId").val(body.find('#treeId').val());
        $("#treeName").val(body.find('#treeName').val());
        $.modal.close(index);
    }


    function submitHandler() {
        var prefix = ctx + "dtp/cold";
        if ($.validate.form()) {
            var data = $("#form-server-edit").serializeArray();
            /*var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
            var roleIds = $.form.selectCheckeds("role");
            var postIds = $.form.selectSelects("post");
            data.push({"name": "status", "value": status});
            data.push({"name": "roleIds", "value": roleIds});
            data.push({"name": "postIds", "value": postIds});*/
            $.operate.saveTab(prefix + "/edit", data);
        }
    }
</script>
