<template>
  <div class="basic-main" >
    <criteria-paged :model="model"  v-ref:paged>
      <criteria partial='criteria' class="search_area" @condition-changed='search'  v-ref:criteria>
        <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
          <div class="row" style="margin-top: 20px">
            <div class="col-sm-4" style="width: 20%">
              <label class="font_normal_body">反馈名称</label>
              <input type="text" class="input_search"
                     style="width: 60%" placeholder="反馈名称" v-model="model.fk_name"
                     condition="  fk_name like '%{}%'">
            </div>
            <div class="col-sm-4" style="width: 20%">
              <label class="font_normal_body">反馈人编号</label>
              <input type="text" class="input_search"
                     style="width: 60%" placeholder="反馈人编号" v-model="model.fk_id"
                     condition="  fk_id='{}'">
            </div>
            <div class="col-sm-4" style="width: 20%">
              <label for="startDate" class="font_normal_body">开始日期</label>
              <datepicker id="startDate" placeholder="开始日期" style="width:60%"
                          v-model="model.startDate"
                          :value.sync="model.startDate"
                          :format="'yyyy-MM-dd'"
                          :show-reset-button="true"
                          condition="fk_date >= '{} 00:00:00'">
              </datepicker>

          </div>
            <div class="col-sm-4" style="width: 20%">
              <label for="endDate" class="font_normal_body">结束日期</label>
              <datepicker id="endDate" placeholder="结束日期" style="width:60%"
                          v-model="model.endDate"
                          :value.sync="model.endDate"
                          :format="'yyyy-MM-dd'"
                          :show-reset-button="true"
                          condition="fk_date <='{} 23:59:59'">
              </datepicker>
            </div>
            <div class="col-sm-4" style="width: 20%">
              <label class="font_normal_body">反馈类型</label>
              <v-select
                placeholder="按反馈类型查询"
                :value.sync= "model.fk_type"
                :options='$parent.$parent.option'
                :value-single="true"
                v-model="model.fk_type"
                close-on-select
                condition=" fk_type='{}'">
              </v-select>
            </div>
          <div class="col-sm-4" style="width: 20%;margin-top: 10px ;">
            <label class="font_normal_body">公司类型</label>
            <v-select
              placeholder="按公司类型查询"
              :value.sync="model.fk_firm"
              :options='$parent.$parent.option2'
              :value-single="true"
              v-model="model.fk_firm"
              close-on-select
              condition="  fk_firm='{}'">
            </v-select>
          </div>

        </div>
            <div class="col-sm-4" style="width: auto;margin-top:5px;margin-right:20px; float: right">
              <button class="button_spacing button_search" @click="search()">查询</button>
            </div>
          </div>
      </criteria>
      <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid >
        <template partial='head'>
          <tr>
            <th>id</th>
            <th>反馈人编号</th>
            <th>反馈人名称</th>
            <th>反馈类型</th>
            <th>反馈内容</th>
            <th>反馈时间</th>
            <th>反馈公司</th>
            <th>具体操作</th>
          </tr>
        </template>
        <template partial='body'>
          <td style="text-align:center">{{$index+1}}</td>
          <td style="text-align: center">{{row.id}}</td>
          <td style="text-align: center">{{row.fk_name}}</td>
          <td style="text-align: center">{{row.fk_type}}</td>
          <td style="text-align: center">{{row.fk_content}}</td>
          <td style="text-align: center">{{row.fk_date}}</td>
          <td style="text-align: center">{{row.fk_firm}}</td>
          <td class="flex-around">
            <button type="button" name="button" class="btn btn-link"
                    @click.stop="$parent.$parent.$parent.modifyParam(row)">修改</button>
            <button type="button" name="button" class="btn btn-link"
                     @click.stop="$parent.$parent.$parent.deleteItem(row)">删除</button>
          </td>
        </template>
      </data-grid>
    </criteria-paged>
  </div>
</template>

<script>
  import {PagedList} from 'vue-client'

  export default {
    title: "反馈人查询",
    data() {
      let model = new PagedList('/rs/sql/query_feedback', 20)
      return {
        option: [{label: "反馈类型一", value: "反馈类型一"},{label: "反馈类型二", value: "反馈类型二"}],
        option2: [{label: "公司一", value: "公司一"},{label: "公司二", value: "公司二"}],
        model: model,
        checkInfo: {},
        //控制模态
        show: false,
        // curorgid: [this.$login.f.orgid]
      }
    },
    ready() {

    },
    methods: {

      //关闭模态窗口
      close () {
        this.show = false
        this.from = ''
      },
      //条件查询
      refresh() {
        this.$refs.paged.$refs.criteria.search()
      },
    },
    watch:
      {
        'condition'(val) {
          console.log("99999999999");
        }
      }
  }



</script>

<style scoped>

</style>
