 <template>
  <div id='app' >
    <criteria-paged :model="model" :pager='false'>
      <criteria partial='criteria' @condition-changed='search'>
        <div novalidate class="form-inline auto" partial>
          <div class="form-group">
          分公司:
          <v-select :value.sync="model.fengongsi"
              :options='$parent.$parent.fengongsi' placeholder='请选择'
              close-on-select clear-button
              v-model="model.fengongsi"></v-select>
          营业网点:
          <v-select :value.sync="model.network"
              :options='$parent.$parent.network' placeholder='请选择'
              close-on-select clear-button
              v-model="model.network"></v-select>
          <label for="startDate">开始日期:</label>
          <datepicker id="startDate" placeholder="开始日期"
            v-model="model.startDate"
            :value.sync="model.startDate"
            :disabled-days-of-Week="[]"
            :format="'yyyy-MM-dd'"
            :show-reset-button="reset">
          </datepicker>
          <label for="endDate">结束日期:</label>
          <datepicker id="endDate" placeholder="结束日期"
            v-model="model.endDate"
            :value.sync="model.endDate"
            :disabled-days-of-Week="[]"
            :format="'yyyy-MM-dd'"
            :show-reset-button="reset">
          </datepicker>
          <button class="btn btn-default" @click="search()">查询</button>
          <report-print id='selltype' top='1cm' left='1cm' width='100%' height='100%'></report-print>
          <report-excel id='selltype'></report-excel>
          </div>
        </div>
      </criteria>
      <div partial='list' id='selltype'>
        <table class='tableprint' style="margin: 0px auto">
          <thead>
            <tr>
              <th colspan='6' style="font-weight: normal; text-align: left;">
                <h3 style="text-align: center">营业分项汇总报表</h3>
              </th>
            </tr>
            <tr>
              <th colspan='6' style="font-weight: normal; text-align: center;">
                开始时间：{{model.model.startDate}}&nbsp;&nbsp;&nbsp;
                结束时间：{{ model.model.endDate }}
              </th>
            </tr>
          </thead>
            <tr>
              <th  colspan='6' style="font-weight: normal;">
              {{{ model.data.substring(26,model.data.length-8) }}}
              </th>
            </tr>
          <tfoot>
            <tr style="text-align: left">
              <th colspan="3">财务审核：</th>
              <th colspan="3">制表：</th>
            </tr>
          </tfoot>
        </table>
       </div>
    </criteria-paged>
  </div>
</template>

<script>
import { DataModel } from 'vue-client'
export default {
  title: 'selltype',
  data () {
    return {
      model: new DataModel('rs/report/selltype', {startDate: 'this.model.startDate', endDate: 'this.model.endDate', fengongsi: 'this.model.fengongsi[0]', network: 'this.model.network[0]'})
    }
  },
  computed: {
    fengongsi () {
      return this.$getParams('分公司查询用', [{label: '全部', value: ''}])
    },
    network () {
      return this.$getParams('网点查询用', [{label: '全部', value: ''}])
    }
  }
}
</script>
