<style scoped>
  .bg {
    background-color: blue;
    height: 1px;
    border: 0;
  }
  .app-row {
    background-color: white;
    padding: 10px 10px 0 10px;
    border-bottom: 1px solid rgba(235, 235, 235, 0.5);
  }
  .search_input {
    border: 0;
    outline: none;
  }
  .font{
    font: 15px PingFang-SC-Medium;
    color: #666666;
  }
  .input-font{
    font: 15px PingFang-SC-Medium;
    color: #333333;
  }
  .btn-font{
    font:600 16px PingFang-SC-Bold;
    color: #499EDF;
  }
  .btn-color{
    background-color: #FFFFFF;
    border-radius: 10px ;
    border: 1px solid #499EDF;
  }
  .app-text {
    font-size: 12px;
  }
  .panel-self{
    border-radius: 10px;
    border:1px solid #499EDF;
    background-color: #F8F8F8;
  }
  .yybtn-color{
    background-color:#499edf;
    border-radius: 4px ;
    border: 1px solid #499EDF;
    color: #FFFFFF;
    font: 14px PingFang-SC-Bold;
  }
  .qxbtn-color{
    background-color: #FFFFFF;
    border-radius: 4px ;
    color: #499edf;
    font: 14px PingFang-SC-Bold;
    border: 1px solid #499EDF;
  }
</style>

<template>
  <div class="auto">
    <criteria-paged :model="model" v-ref:paged>
      <criteria partial='criteria' @condition-changed='search' v-ref:cri>
        <div partial>
          <form>
            <div class="auto repair-info-content compatible">
              <div class="row app-row" >
                <div class="col-xs-6 col-sm-6 col-md-6 form-input-group mg8">
                  <input type="text" class="form-control"
                         placeholder="请输入用户id" v-model="model.f_userinfo_id" condition="  b.f_userinfo_id = '{}'"
                  />
                </div>
                <div class="col-xs-6  col-sm-6 col-md-6 form-input-group mg8">
                  <input type="text" class="form-control"
                         placeholder="请输入用户名称" v-model="model.f_user_name" condition="  b.f_user_name like '%{}%'"
                  />
                </div>
              </div>
              <div class="row app-row" >
                <div class="col-xs-8 col-sm-8 col-md-8 form-input-group mg8">
                  <datepicker id="startDate" placeholder="开始日期" style="width:60%"
                              v-model="model.startDate"
                              :value.sync="model.startDate"
                              :format="'yyyy-MM-dd'"
                              :show-reset-button="true"
                              condition="a.f_operate_date >='{} 00:00:00'">
                  </datepicker>
                </div>
                <div class="col-xs-8 col-sm-8 col-md-8 form-input-group mg8">
                  <datepicker id="endDate" placeholder="结束日期" style="width:60%"
                              v-model="model.endDate"
                              :value.sync="model.endDate"
                              :format="'yyyy-MM-dd'"
                              :show-reset-button="true"
                              condition="a.f_operate_date <='{} 23:59:59'">
                  </datepicker>
                </div>
              </div>
              <div class="row text-center" style="margin-top: 20px;">
                <button type="button" class="btn btn-lg btn-font btn-color" style="width: 45%;" @click="$parent.$parent.selfSearch">查询</button>
              </div>
              <div style="height:30px;"></div>
            </div>
          </form>
        </div>
      </criteria>
      <list :model="model" partial='list'>
        <div partial>
          <div  class="auto app-text" style="margin-top: 5px;">
            <div class="panel" style="padding: 10px 10px 5px 10px;">
              <div class="panel-body panel-self">
                <div class="row">
                  <p class="panel-title col-xs-4 text-left font">用户编号</p>
                  <p class="panel-title col-xs-8 text-left input-font">{{ row.f_userinfo_id }}</p>
                </div>
                <div class="row">
                  <p class="panel-title col-xs-4 text-left font">用户名称</p>
                  <p class="panel-title col-xs-8 text-left input-font">{{ row.f_user_name }}</p>
                </div>
                <div class="row">
                  <p class="panel-title col-xs-4 text-left font">上次金额</p>
                  <p class="panel-title col-xs-8 text-left input-font">{{ row.f_balance }}
                  </p>
                </div>
                <div class="row">
                  <p class="panel-title col-xs-4 text-left font">实收金额</p>
                  <p class="panel-title col-xs-8 text-left input-font">{{ row.f_collection }}
                  </p>
                </div>
                <div class="row">
                  <p class="panel-title col-xs-4 text-left font">本次金额</p>
                  <p class="panel-title col-xs-8 text-left input-font">{{ row.f_curbalance }}
                  </p>
                </div>
                <div class="row">
                  <p class="panel-title col-xs-4 text-left font">缴费方式</p>
                  <p class="panel-title col-xs-8 text-left input-font">{{ row.f_cost_type }}
                  </p>
                </div>
                <div class="row">
                  <p class="panel-title col-xs-4 text-left font">缴费日期</p>
                  <p class="panel-title col-xs-8 text-left input-font">{{ row.f_operate_date }}
                  </p>
                </div>

              </div>
            </div>
          </div>
        </div>
      </list>
    </criteria-paged>

  </div>
</template>

<script>

  import Vue from 'vue'
  import { PagedList } from 'vue-client'


  export default {
    title: '缴费查询',
    data() {
      return {

        model:  new PagedList( 'rs/sql/payment_query',3,{condition:'this.condition'}),
        showModal: false,
        param: null,
      }
    },
    ready(){
      //   this.selfSearch()
    },
    methods: {
      search(args) {
        this.model.rows = []
        this.model.search(args.condition, args.model)
      },
      selfSearch () {
        let condition = "1=1"
        if(this.$refs.paged.$refs.cri.model.f_userinfo_id)
          condition += " and b.f_userinfo_id = '"+this.$refs.paged.$refs.cri.model.f_userinfo_id+"'"
        if(this.$refs.paged.$refs.cri.model.f_user_name)
          condition += " and b.f_user_name like  '%"+this.$refs.paged.$refs.cri.model.f_user_name+"%'"
        if(this.$refs.paged.$refs.cri.model.f_operate_date)
          condition += " and a.f_operate_date  >='"+this.$refs.paged.$refs.cri.model.startDate+"' and a.f_operate_date <='"+this.$refs.paged.$refs.cri.model.endDate+"'"
        this.model.search(condition);
      },
    }
  }
</script>
