@using PageAdmin.Common;
@{
    dynamic data = (dynamic)Model;
    dynamic WorkFlowNodeData = ViewBag.WorkFlowNodeData;

}
<div class="main">
    <form class="form-horizontal form form-group-sm ui-validForm" action="@Url.Action()" method="post" id="_form">
        <div class="control-group">
            <label class="control-label">当前节点</label>
            <div class="controls">
                <select id="workflow_node_id" name="workflow_node_id" class="ui-selectBind"></select>
                <span class="help-block"></span>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">操作</label>
            <div class="controls">
                @if (WorkFlowNodeData.can_finalpass == 1)
                {
                    <span class="radio-inline">
                        <input type="radio" id="issue_act" name="issue_act" value="finalpass" data-validate="dataType:'*" nullMsg:'请选择一个操作类型！" onclick="SetRemark('终审通过！')" />终审
                    </span>
                }

                <span class="radio-inline">
                    <input type="radio" id="issue_act" name="issue_act" value="pass" data-validate="dataType:'*" nullMsg:'请选择一个操作类型！" onclick="SetRemark('通过！')" />通过
                </span>
                <span class="radio-inline">
                    <input type="radio" id="issue_act" name="issue_act" value="return" data-validate="dataType:'*" nullMsg:'请选择一个操作类型！" onclick="SetRemark('')" />退回
                </span>
                @if (WorkFlowNodeData.can_delete == 1)
                {
                    <span class="radio-inline">
                        <input type="radio" id="issue_act" name="issue_act" value="delete" data-validate="dataType:'*" nullMsg:'请选择一个操作类型！" onclick="SetRemark('删除！')" />删除
                    </span>
                }
                <span class="help-block"></span>
            </div>
        </div>


        <div class="control-group">
            <label class="control-label">备注</label>
            <div class="controls">
                <input type="text" maxlength="150" value="" class="form-control" id="issue_remark" name="issue_remark" dataType="*" nullMsg:'请填写备注!"  />
                <span class="help-block">建议填写详细备注信息，方便后期的信息状态跟踪。</span>
            </div>
        </div>
        @if (data.state == 0)
        {
            <div class="control-group">
                <label class="control-label"></label>
                <div class="controls form-inline">
                        <input type="hidden" id="id" name="id" value="@Request.QueryString["id"]" />
                        <input type="hidden" id="ids" name="ids" value="@Request.QueryString["ids"]" />
                        <button type="button" class="btn btn-primary btn-sm ui-pagePost" data-custom-params="url:'@Url.Action()',callBack:'PostRefreshBack'" id="bt_submit">确定</button>
                        <button type="button" class="btn btn-default btn-sm ui-closeDialog">关闭</button>
                    <span class="help-block"></span>
                </div>
            </div>
        }
        else
        {
            <div class="control-group">
                <label class="control-label"></label>
                <div class="controls form-inline">
                    <span class="help-block ui-pagePost">已签发！</span>
                </div>
            </div>
        }
        </form>
    </div>
    <script type="text/javascript">
        var nodeData = CallAjax("get", false, "@Url.Action("ListData","WorkFlowNode")?workflow_id=@data.workflow_id");
        var nodeParam = { valueField: "id", textField: "name" };
        $("#workflow_node_id").FillSelect(nodeData, nodeParam);
        var state=@data.state;
        if(state==1)
        {
            var data =@Html.Raw((JsonHelper.JsonParse(data))??null);
            $("#_form").FormBind(data,false);
        }
        else
        {
            SetSelected("@data.workflow_node_id",$("#workflow_node_id"))
        }
        function SetRemark(remark) {
            $("#issue_remark").val(remark);
        }
    </script>