<!DOCTYPE html>
<html lang=zh-cn>
<head>
    <meta charset=utf-8>
    <title>纵横计量支付系统</title>
    <meta name=description content=计量支付>
    <meta name=copyright content=smartcost.com.cn>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
    <link rel=stylesheet href="{{rootUrl}}global/css/app/bootstrap.css">
    <link rel=stylesheet href="{{rootUrl}}global/css/app/style.css">
    <script src="{{rootUrl}}global/js/jquery-1.9.1.min.js"></script>
    <script src="{{rootUrl}}global/js/app/bootstrap.js"></script>
    <script src="{{rootUrl}}global/js/app/global.js"></script>
    <script src="{{rootUrl}}global/js/app/echarts.min.js"></script>
</head>
<body>
    <div class="wrapContent">
        <div class="wrapNav">
            <ul class="nav nav-tabs" role="tablist">
                <li role="presentation" <!-- if !zhisset({{approval}}) -->class="active"<!-- endif -->><a href="#home" aria-controls="home" role="tab" data-toggle="tab">标段概况</a></li>
                <li role="presentation" <!-- if zhisset({{approval}}) -->class="active"<!-- endif -->><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">审批</a></li>
            </ul>
        </div>
        <div class="tab-content">
          <div role="tabpanel" class="tab-pane <!-- if !zhisset({{approval}}) -->active<!-- endif -->" id="home">
            <div class="project">
                <div class="proSection">
                    <!--图表4-->
                    <div id="chartContainer4" style="height: 350px; width: 100%;">
                    </div>
                    <!--图表5-->
                    <div id="chartContainer5" style="height: 300px; width: 100%;">
                    </div>
                </div>
                <div class="projectSeList">
                    <!-- loop MeasureArray3 -->
                    <dl class="projectTable">
                      <dt>第{{ToChinaseNum(MeasureArray3' value.numpname)}}期（上报：{{formatDate(MeasureArray3' value.intime,'Y-m-d')}} <!-- if {{MeasureArray3' value.audittime}}!='0' -->；通过：{{formatDate(MeasureArray3' value.audittime,'Y-m-d')}}<!-- endif -->）</dt>
                      <dd>
                        <table class="table table-hover">
                          <tr>
                            <td>
                              <p>本期合同计量</p>
                              <b>￥{{MeasureArray3' value.currcontractval}}</b>
                            </td>
                            <td>
                              <p>本期数量变更计量</p>
                              <b>￥{{MeasureArray3' value.currchangeval}}</b>
                            </td>
                          </tr>
                          <tr>
                            <td>
                              <p>截止上期完成</p>
                              <b>￥{{MeasureArray3' value.stopnowtotal}}</b>
                            </td>
                            <td>
                              <p>本期完成计量</p>
                              <b>￥{{MeasureArray3' value.currdone}}</b>
                            </td>
                          </tr>
                          <tr>
                            <td>
                              <p>截止本期完成</p>
                              <b>￥{{MeasureArray3' value.curralltotal}}</b>
                            </td>
                            <td></td>
                          </tr>
                        </table>
                      </dd>
                    </dl>
                    <!-- endloop -->
                </div>
            </div>
          </div>
          <div role="tabpanel" class="tab-pane <!-- if zhisset({{approval}}) -->active<!-- endif -->" id="profile">
            <div class="project">
              <div class="projectSeList mT2">
                <!-- loop MeasureArray2 -->
                <dl class="projectTable">
                  <dt>第{{ToChinaseNum(MeasureArray2' value.numpname)}}期（上报：{{formatDate(MeasureArray2' value.intime,'Y-m-d')}} <!-- if {{MeasureArray2' value.audittime}}!='0' -->；通过：{{formatDate(MeasureArray2' value.audittime,'Y-m-d')}}<!-- endif -->）</dt>
                  <dd>
                    <table class="table table-hover">
                      <tr>
                        <td>
                          <p>本期合同计量</p>
                          <b>￥{{MeasureArray2' value.currcontractval}}</b>
                        </td>
                        <td>
                          <p>本期数量变更计量</p>
                          <b>￥{{MeasureArray2' value.currchangeval}}</b>
                        </td>
                      </tr>
                      <tr>
                        <td>
                          <p>截止上期累计完成</p>
                          <b>￥{{MeasureArray2' value.stopnowtotal}}</b>
                        </td>
                        <td>
                          <p>本期完成计量</p>
                          <b>￥{{MeasureArray2' value.currdone}}</b>
                        </td>
                      </tr>
                      <tr>
                        <td>
                          <p>累计完成计量</p>
                          <b>￥{{MeasureArray2' value.curralltotal}}</b>
                        </td>
                        <td></td>
                      </tr>
                    </table>
                  </dd>
                </dl>
                <!-- endloop -->
              </div>
            </div>
            <div class="approvalList">
              <ul>
                <!-- if {{orginArray.time}} != '1970-01-01' -->
                <li>
                    {{orginArray.statushtml}}
                    <div class="approvalView"></div>
                </li>
                <!-- endif -->
                <!-- loop auditArray -->
                <li>
                  {{auditArray' value.statushtml}}
                  <div class="approvalView">{{auditArray' value.auditcontent}}</div>
                </li>
                <!-- endloop -->
              </ul>
            </div>
            <!-- if {{mastatus}}=='checking' -->
            <div class="bottomToolsbar">
              <div class="bottomView">
                <form>
                  <div class="form-group">
                    <label>审批意见</label>
                    <textarea class="form-control" rows="3"></textarea>
                  </div>
                </form> 
              </div>
              <ul>
                <li><button type="button" class="submit btn-danger" data-toggle="modal" data-target="#myModalUnpass">审批不通过</button></li>
                <li><button type="button" class="submit btn-success" data-toggle="modal" data-target="#myModalPass">审批通过</button></li>
              </ul>
            </div>
            <div class="modal fade modalWrap" id="myModalUnpass" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
              <div class="modal-dialog" role="document">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">审批意见</h4>
                  </div>
                  <div class="modal-body">
                    <!-- <h4><p>审批意见</p></h4> -->
                      <form>
                    <textarea  name="content" id="content" class="form-control" rows="3" placeholder="填写审批意见"></textarea>
                      </form>
                  </div>
                  <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-danger auditclass" act="np" maid="{{maid}}" pmid="{{pmid}}" numpname="{{numpname}}" times="{{times}}">确认审批不通过</button>
                  </div>
                </div>
              </div>
            </div>
            <div class="modal fade modalWrap" id="myModalPass" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
              <div class="modal-dialog" role="document">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">审批意见</h4>
                  </div>
                  <div class="modal-body">
                    <!-- <h4><p>审批意见</p></h4> -->
                      <form>
                          <textarea  name="content" id="content2" class="form-control" rows="3" placeholder="填写审批意见"></textarea>
                      </form>
                  </div>
                  <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-success auditclass" act="p" maid="{{maid}}" pmid="{{pmid}}" numpname="{{numpname}}"
                            times="{{times}}" id="pass">确认审批通过</button>
                  </div>
                </div>
              </div>
            </div>
            <!-- endif -->
          </div>
        </div>
    </div>

    <script type="text/javascript">
        $(function(){
            $('#chartContainer4').css('width',(parseInt($(window).width())-36+'px'));
            $('#chartContainer5').css('width',(parseInt($(window).width())-36+'px'));
            //4 标段期数计量进度//
            var myChart = echarts.init(document.getElementById('chartContainer4'));
            var option = {
                color: ['#e9af68', '#57b7b6', '#e4575a', '#959eac', '#6699FF',
                    '#d38b70', '#8fb7cf', '#cd5c5c', '#ffa500', '#40e0d0',
                    '#1e90ff', '#ff6347', '#7b68ee', '#00fa9a', '#ffd700',
                    '#5c616b', '#ff6666', '#3cb371', '#b8860b', '#30e0e0'],
                tooltip: {
                    trigger: 'axis'
                },
                calculable: true,
                legend: {
                    data: ['本期合同计量', '本期数量变更计量', '截止上期完成', '本期完成计量', '完成度']
                },
                dataZoom : {
                    show : true,
                    start :0,
                    end : 100
                },
                xAxis: [
                    {
                        type: 'category',
                        splitLine: {show: true},
                        data: [
                            <!-- loop MeasureArray -->
                            "第{{ToChinaseNum(MeasureArray' value.numpname)}}期",
                            <!-- endloop -->
                        ]
                    }
                ],
                grid:[
                    {
                        x2:'40',
                        top:'25%',
                        bottom:'20%',
                        left:'13%'
                    }
                ],
                yAxis: [
                    {
                        type: 'value',
                        position: 'left',
                        splitArea: {show: true}
                    },
                    {
                        type: 'value',
                        name: '完成度',
                        axisLabel: {
                            formatter: '{value} %'
                        },
                        position: 'right',
                        splitArea: {show: false},
                        splitLine: {show: false}
                    }
                ],
                series: [
                    {
                        name: '本期合同计量',
                        type: 'bar',
                        tooltip: {trigger: 'item', formatter: "{b}  <br/>{a}：{c}元"},
                        stack: '合同',
                        data: [
                            <!-- loop MeasureArray -->
                            {{MeasureArray' value.currcontractval}},
                            <!-- endloop -->
                        ]
                    },
                    {
                        name: '本期数量变更计量',
                        type: 'bar',
                        tooltip: {trigger: 'item', formatter: "{b}  <br/>{a}：{c}元"},
                        stack: '合同',
                        data: [
                            <!-- loop MeasureArray -->
                            {{MeasureArray' value.currchangeval}},
                            <!-- endloop -->
                        ]
                    },
                    {
                        name: '截止上期完成',
                        type: 'bar',
                        tooltip: {trigger: 'item', formatter: "{b}  <br/>{a}：{c}元"},
                        stack: '完成',
                        data: [
                            <!-- loop MeasureArray -->
                            {{MeasureArray' value.stopnowtotal}},
                            <!-- endloop -->
                        ]
                    },
                    {
                        name: '本期完成计量',
                        type: 'bar',
                        tooltip: {trigger: 'item', formatter: "{b}  <br/>{a}：{c}元"},
                        stack: '完成',
                        data: [
                            <!-- loop MeasureArray -->
                            {{MeasureArray' value.currdone}},
                            <!-- endloop -->

                        ]
                    },
                    {
                        name: '完成度',
                        type: 'line',
                        tooltip: {trigger: 'axis', formatter: "{b}占总标段<br/>{a}：{c} %"},
                        yAxisIndex: 1,
                        data: [
                            <!-- loop MeasureArray -->
                            {{MeasureArray' value.lessTotal}},
                            <!-- endloop -->

                        ]
                    },
                ]
            };

            // 为echarts对象加载数据
            myChart.setOption(option);
            //4 标段期数计量进度//
            //5 期数组成//
            var myChart2 = echarts.init(document.getElementById('chartContainer5'));
            var option2 = {
                color: ['#e9af68','#57b7b6','#e4575a','#959eac','#6699FF',
                    '#d38b70','#8fb7cf','#cd5c5c','#ffa500','#40e0d0',
                    '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',
                    '#5c616b','#ff6666','#3cb371','#b8860b','#30e0e0'],
                title : {
                    text: '期数计量组成',
                    x:'left'
                },

                tooltip : {
                    trigger: 'item',
                    formatter: "{a} <br/>{b}：{c} 元<br>占标段：{d} %"
                },
                calculable : true,
                series : [
                    {
                        name:'标段计量分布',
                        type:'pie',
//                          roseType: 'angle',
                        radius : '40%',
                        center: ['50%', 155],
                        data:[
                            <!-- loop MeasureArray -->{value: {{MeasureArray' value.currdone}}, name: '第{{ToChinaseNum(MeasureArray' value.numpname)}}期'},
                            <!-- endloop -->]
                    }
                ]
            };
            // 为echarts对象加载数据
            myChart2.setOption(option2);
            //5 期数组成//
        });
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(".auditclass").click(function () {
                var pmid = $(this).attr('pmid');
                var numpname = $(this).attr('numpname');
                var times = $(this).attr('times');
                var content = $(this).parent().parent().find("textarea").val();
                var act = $(this).attr('act');
                var maid = $(this).attr('maid');
                $.ajax({
                    type: "POST",
                    dataType: "json",
                    cache: false,
                    data: {"act": act, "pmid": pmid, "numpname": numpname, "times": times, "content": content},
                    url: "/app/rproject/{{pid}}/section/{{pmid}}/detail?uid={{uid}}",
                    success: function (data) {
                        if (data['status'] == 1) {
                            window.location.href = "{{rootUrl}}app/rproject/{{pid}}/section/{{pmid}}/detail?uid={{uid}}&approval=1";
                        }
                    }
                });
            });
        })
    </script>
</body>