<rt-form id="{{vm.form.name}}" name="{{vm.form.name}}" novalidate>
    <div class="row rt-margin-bottom-before-box">

        <div class="col-sm-2">
            <button class="btn btn-link" type="button" id="btnClose" ng-click="vm.form.hide()">
                        <i class="fa fa-sign-out"></i> 关闭
                    </button>
        </div>
        <!-- div[.col-sm-2] -->
        <div class="col-sm-10">
            <div class="pull-right">
                <!-- <rt-button id="btnApprove" rt-style="link" rt-title="审核通过" rt-icon="check" ng-click="vm.form.approve()" ng-show="vm.form.data.sales_order_status.Value == 20 && vm.form.type == 'Edit' && vm.form.data.StateCode.Value == 0 && vm.privilege.IsWrite">
                </rt-button>
                <rt-button id="btnReject" rt-style="link" rt-title="审核驳回" rt-icon="ban" ng-click="vm.form.reject()" ng-show="vm.form.data.sales_order_status.Value == 20 && vm.form.type == 'Edit' && vm.form.data.StateCode.Value == 0 && vm.privilege.IsWrite">
                </rt-button> -->
                <!-- <rt-button id="btnSave" rt-style="link" rt-title="提交" rt-icon="floppy-o" ng-click="vm.form.newsave()" ng-show="(vm.form.type === 'Create' && vm.privilege.IsCreate)">
                </rt-button> -->
                <!-- <rt-button id="btnSave" rt-style="link" rt-title="重新提交" rt-icon="floppy-o" ng-click="vm.form.newsave()" ng-show="vm.form.isMoreActionsShow && vm.form.type !== 'Create' && vm.form.isUnApproved">
                </rt-button> -->
                <rt-button id="btnSave" rt-style="link" rt-title="撤销" rt-icon="floppy-o" ng-click="vm.form.flowRecall()" ng-if="vm.form.isFlowSubmitter && vm.form.type !== 'Create' && vm.form.isUnApproved">
                </rt-button>
                <rt-button id="btnSave" rt-style="link" rt-title="同意" rt-icon="floppy-o" ng-click="vm.newflowApprove()" ng-if="vm.form.isFlowApprover && vm.form.type !== 'Create'">
                </rt-button>
                <rt-button id="btnSave" rt-style="link" rt-title="拒绝" rt-icon="floppy-o" ng-click="vm.newflowReject()" ng-if="vm.form.isFlowApprover && vm.form.type !== 'Create'">
                </rt-button>
                <rt-button id="btnSave" rt-style="link" rt-title="转发" rt-icon="floppy-o" ng-click="vm.form.flowTransmit()" ng-if="vm.form.isFlowApprover && vm.form.type !== 'Create'">
                </rt-button>
                <rt-button id="btnPullERP" rt-style="link" rt-title="推送ERP" rt-icon="floppy-o" ng-click="vm.write2erp()" ng-show="vm.form.data.sales_order_status.Value == 50 && vm.form.type == 'Edit' && vm.form.data.StateCode.Value == 0 && vm.privilege.IsWrite">
                </rt-button>
            </div>
        </div>
        <!-- div[.col-sm-10] -->
    </div>
    <div class="nav-tabs-custom">
        <!-- @@表单 -->
        <ul class="nav nav-tabs" ng-if="vm.form.type === 'Edit'">
            <li class="active">
                <a href="#A1{{vm.form.name}}" onclick="return false;" data-toggle="tab">资料</a>
            </li>
            <li>
                <a href="#A2{{vm.form.name}}" onclick="return false;" data-toggle="tab">审核流程</a>
            </li>
        </ul>
        <!-- ui[.nav] -->

        <div class="tab-content">
            <div class="tab-pane active" id="A1{{vm.form.name}}">
                <rt-section rt-title="基本信息">
                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="订单单号" rt-disabled="true" rt-col="4" ng-model="vm.form.data.code"></rt-input>
                        <rt-input rt-type="text" rt-title="订单状态" rt-col="4" rt-disabled="true" ng-model="vm.form.data.sales_order_status.Name"></rt-input>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="客户" rt-col="4" rt-disabled="true" ng-model="vm.form.data.accountid.Name"></rt-input>
                        <rt-input rt-type="text" rt-title="负责人" rt-col="4" rt-disabled="true" ng-model="vm.form.data.OwnerId.Name"></rt-input>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-input rt-type="date" rt-title="交货日期" rt-col="4" rt-disabled="true" ng-model="vm.form.data.demandon"></rt-input>
                        <rt-input rt-type="date" rt-title="付款日期" rt-col="4" rt-disabled="true" ng-model="vm.form.data.paymenton"></rt-input>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-picklist rt-title="运输方式" rt-col="4" ng-model="vm.form.data.transport_type" rt-disabled="true" rt-options="vm.picklist.transport_type"></rt-picklist>
                        <rt-picklist rt-title="运输费用承担" rt-col="4" ng-model="vm.form.data.transport_cost_borneby" rt-disabled="true" rt-options="vm.picklist.transport_cost_borneby"></rt-picklist>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-picklist rt-title="付款方式" rt-col="4" ng-model="vm.form.data.payment_type" rt-disabled="true" rt-options="vm.picklist.payment_type"></rt-picklist>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="验收地点" rt-disabled="true" rt-col="10" ng-model="vm.form.data.receiver_address"></rt-input>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="违约责任" rt-disabled="true" rt-col="10" ng-model="vm.form.data.blame_desc"></rt-input>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-textarea rt-type="text" rt-title="备注" rt-col="10" rt-row="2" rt-disabled="true" ng-model="vm.form.data.remark"></rt-textarea>
                    </rt-section-row>
                </rt-section>
                <rt-section rt-title="产品明细">
                    <div class="listview">
                        <div class="viewlist">
                            <rt-data-grid-no-page rt-rows="vm.form.data.SalesOrderLineList" rt-selected-ids="vm.view.selectedIds1">
                                <table class="table table-condensed table-hover">
                                    <thead>
                                        <tr>
                                            <!-- @@ 视图表头 -->
                                            <th>
                                                <rt-header-checkbox></rt-header-checkbox>
                                            </th>
                                            <th>药品名称</th>
                                            <th style="text-align: right;">标准价格</th>
                                            <th style="text-align: right;">客户价格</th>
                                            <th style="text-align: right;">上次订单价格</th>
                                            <th style="text-align: right;">订单价格</th>
                                            <th style="text-align: right;">数量</th>
                                            <th style="text-align: right;">金额</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr ng-repeat="row in vm.form.data.SalesOrderLineList track by $index">
                                            <!-- @@ 视图列表值 -->
                                            <td>
                                                <rt-data-checkbox value="{{row.Id}}" />
                                            </td>
                                            <td>{{row.productid.Name}}</td>
                                            <td style="text-align: right;">{{row.std_base_price==null?"-":row.std_base_price}}</td>
                                            <td style="text-align: right;">{{row.account_base_price==null?"-":row.account_base_price}}</td>
                                            <td style="text-align: right;" ng-style="{'color':'{{row.lastprice!=-1&&row.lastprice<row.price?'#ff4242':'#666'}}'}">{{row.lastprice==-1?"-":row.lastprice}}</td>
                                            <td style="text-align: right;">{{row.price}}</td>
                                            <td style="text-align: right;">{{row.qty}}</td>
                                            <td style="text-align: right;">{{row.amount}}</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </rt-data-grid-no-page>
                        </div>
                        <div style="float: right;padding-top: 10px;">总金额： <span style="color: #ff4242 !important;">￥{{vm.form.data.sumPrice}}</span></div>
                    </div>
                    <!-- div[.listview] -->
                </rt-section>

                <rt-section rt-title="照片">
                    <rt-section-row>


                        <rt-data-grid-no-page rt-page-record-count="vm.page.recordCount"  rt-page-index="vm.page.index" rt-page-size="vm.page.size" rt-get-data="vm.view.search()"
                            rt-sort-field="vm.view.sortField" rt-rows="vm.data" rt-selected-ids="vm.view.selectedIds" rt-auto-height="vm.view.autoHeight">
                            <table class="table table-hover">
                                <thead>
                                    <tr>
                                        <!-- @@ 视图表头 -->
                                        <th rt-field-code="name">照片名称</th>

                                    </tr>
                                </thead>
                                <tbody>
                                    <tr ng-repeat="row in fjs">
                                        <!-- @@ 视图列表值 -->

                                        <td>
                                            <button type="button" ng-disabled="row.DownFile==false" class="btn btn-link" ng-click="vm.form.downloadfile(row.Id)"> {{row.FileName}}</button>

                                        </td>

                                    </tr>
                                </tbody>
                            </table>
                        </rt-data-grid-no-page>
                        <!-- rt-data-grid  -->


                    </rt-section-row>
                </rt-section>
            </div>
            <!-- div[#1, .tab-pane] -->
            <div class="tab-pane" id="A2{{vm.form.name}}">
                <rt-section rt-title="审核人" ng-show="vm.form.approvalStatus.ApprovalStatus.approval_result.Value!==5">
                    <rt-section-row ng-show="(vm.form.isMoreActionsShow && vm.form.isFlowSubmitter && vm.form.isUnApproved)|| vm.form.type==='Create'">
                        <button class="btn btn-link" ng-click="addApprover()">
                                        <i class="fa fa-plus"></i> 添加审核人
                                    </button>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-data-grid-no-page rt-page-record-count="vm.page.recordCount"  rt-page-index="vm.page.index" rt-page-size="vm.page.size" rt-get-data="vm.view.search()"
                            rt-sort-field="vm.view.sortField" rt-rows="vm.form.approverList" rt-selected-ids="vm.view.selectedapproverIds"
                            rt-auto-height="240">
                            <table class="table table-hover">
                                <thead>
                                    <tr>
                                        <!--<th><rt-header-checkbox></rt-header-checkbox></th>-->
                                        <!-- @@ 视图表头 -->
                                        <th rt-field-code="name">姓名</th>
                                        <th rt-field-code="name">状态</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr ng-repeat="row in vm.form.approverList">
                                        <!--<td>-->
                                        <!--<rt-data-checkbox value="{{row.OwnerId.Id}}" />-->
                                        <!--</td>-->
                                        <!-- @@ 视图列表值 -->
                                        <td>
                                            <!--<a href="javascript:;"-->
                                            <!--style="color:#0099FF"-->
                                            <!--disabled="true"-->
                                            <!--ng-click="vm.form.delApprover($index)">{{row.OwnerId.Name}}</a>-->
                                            <span>{{row.OwnerId.Name}}</span>
                                        </td>

                                        <td ng-show="vm.form.type === 'Edit' && row.approval_status.Value == 2">
                                            审批中
                                        </td>

                                        <td ng-show="vm.form.type === 'Edit'&&row.approval_status.Value == 3 && row.approval_result.Value == 2">
                                            {{row.approval_result.Name}}{{row.remark!=''&&row.remark!=null?"(":""}}{{row.remark}}{{row.remark!=''&&row.remark!=null?")":""}}
                                        </td>

                                        <td ng-show="vm.form.type === 'Edit'&&row.approval_status.Value == 3 && row.approval_result.Value == 3">
                                            {{row.approval_result.Name}}{{row.remark!=''&&row.remark!=null?"(":""}}{{row.remark}}{{row.remark!=''&&row.remark!=null?")":""}}
                                        </td>

                                        <td ng-show="vm.form.type === 'Edit'&&row.approval_status.Value == 3 && row.approval_result.Value == 4">
                                            {{row.approval_result.Name}}{{row.remark!=''&&row.remark!=null?"(":""}}{{row.remark}}{{row.remark!=''&&row.remark!=null?")":""}}
                                        </td>

                                        <td ng-show="vm.form.type === 'Edit'&&row.approval_status.Value == 3 && row.approval_result.Value == 5">
                                            {{row.approval_result.Name}}{{row.remark!=''&&row.remark!=null?"(":""}}{{row.remark}}{{row.remark!=''&&row.remark!=null?")":""}}
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </rt-data-grid-no-page>
                        <!-- rt-data-grid  -->

                    </rt-section-row>
                </rt-section>

            </div>
            <!-- div[#2, .tab-pane] -->
        </div>
        <!-- div[.tab-content] -->


        <!-- 
        <div class="tab-content" ng-show="!(vm.form.type == 'Create' && vm.privilege.IsCreate)">
            
        </div> -->
    </div>
</rt-form>
<!-- rt-form -->