<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 class="col-sm-10">
            <div class="pull-right">
                <rt-button id="btnSave" rt-style="link" rt-title="提交" rt-icon="floppy-o" ng-click="vm.form.showFlowUserList()" ng-show="(vm.form.type === 'Create' && vm.privilege.IsCreate) || (vm.form.type === 'Edit' && vm.privilege.IsWrite)">
                </rt-button>
            </div>
        </div>
    </div>
    <div class="nav-tabs-custom">
        <div class="tab-content">
            <div class="tab-pane active">
                <rt-section rt-title="基本信息">
                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="出差天数" rt-required="false" rt-col="4" ng-model="vm.form.data.total_days"></rt-input>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-textarea rt-type="text" rt-title="出差事由" rt-col="10" rt-row="2" ng-model="vm.form.data.content"></rt-textarea>
                    </rt-section-row>
                </rt-section>
                <rt-section rt-title="行程明细">
                    <rt-section-row>
                        <rt-datetime rt-title="开始时间" rt-type="date" rt-col="4" rt-required="false" ng-model="vm.form.detail.start_date"></rt-datetime>
                        <rt-datetime rt-title="结束时间" rt-type="date" rt-col="4" rt-required="false" ng-model="vm.form.detail.end_date"></rt-datetime>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="出差地点" rt-required="false" rt-col="4" ng-model="vm.form.detail.location"></rt-input>
                        <rt-button rt-type="button" rt-title="添加" rt-col="4" rt-required="false" style="margin-left: 10%" ng-click="addDetail(vm.form.detail)"></rt-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.data.DetailList"
                            rt-selected-ids="vm.view.selectedIds" rt-auto-height="240">
                            <table class="table table-hover">
                                <thead>
                                    <tr>
                                        <th rt-field-code="name">出差地点
                                            <span class="rt-text-weak-02">(点击可删除)</span>
                                        </th>
                                        <th rt-field-code="name">开始时间</th>
                                        <th rt-field-code="name">结束时间</th>

                                    </tr>
                                </thead>
                                <tbody>
                                    <tr ng-repeat="row in vm.form.data.DetailList" ng-click="vm.form.delDetail($index)">
                                        <td>
                                            <span>{{row.location}}</span>
                                        </td>
                                        <td> {{row.start_date | date:'yyyy-MM-dd'}}</td>
                                        <td> {{row.end_date | date:'yyyy-MM-dd'}}</td>
                                    </tr>
                                </tbody>
                            </table>
                        </rt-data-grid-no-page>
                    </rt-section-row>
                </rt-section>
                <rt-section rt-title="附件">
                    <rt-section-row>
                        <button style=" margin-left: 100px;" class="btn btn-default" ng-file-select ng-file-change="vm.form.selectFile($files)" multiple="multiple">选择附件
                        </button>
                        <button type="button" class="btn btn-default" ng-click="vm.form.deletedFile()">删除附件
                        </button>

                        <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-condensed table-hover">
                                <thead>
                                    <tr>
                                        <th>
                                            <rt-header-checkbox></rt-header-checkbox>
                                        </th>
                                        <th rt-field-code="name">附件名称</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr ng-repeat="row in fjs">
                                        <td>
                                            <rt-data-checkbox value="{{row.Id}}" />
                                        </td>
                                        <td>
                                            <button type="button" ng-disabled="true" class="btn btn-link">
                                                {{row.FileName}}
                                            </button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </rt-data-grid-no-page>
                    </rt-section-row>
                </rt-section>
            </div>
        </div>
    </div>
</rt-form>