<template>
  <div id="unit" class="flex-row">
    <div class="basic-main" @keyup.enter="search">
      <div class="flex" v-if="!show">
        <criteria-paged :model="model" v-ref:paged>
          <criteria partial="criteria" v-ref:cri>
            <div
              novalidate
              class="form-horizontal select-overspread container-fluid auto"
              partial
            >
              <div class="row">
                <div class="col-sm-2 form-group">
                  <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 HH:mm:ss'"
                    :show-reset-button="true"
                  >
                  </datepicker>
                </div>
                <div class="col-sm-2 form-group">
                  <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 HH:mm:ss'"
                    :show-reset-button="true"
                  >
                  </datepicker>
                </div>
                <div class="col-sm-2 form-group">
                  <label class="font_normal_body">客户编号</label>
                  <input
                    type="text"
                    style="width: 60%"
                    class="input_search"
                    v-model="model.f_userinfo_code"
                    placeholder="客户编号"
                  />
                </div>
                <div class="col-sm-2 form-group">
                  <label class="font_normal_body">客户名称</label>
                  <input
                    type="text"
                    style="width: 60%"
                    class="input_search"
                    v-model="model.f_user_name"
                    placeholder="客户名称"
                  />
                </div>

                <div class="span" style="float: right">
                  <button
                    class="button_search button_spacing"
                    @click="$parent.$parent.search"
                  >
                    查询
                  </button>
                  <button
                    class="button_clear button_spacing"
                    @click="$parent.$parent.clear()"
                  >
                    清空
                  </button>
                  <!--<button class="btn btn-default" @click="$parent.$parent.stamp()">打印</button>-->

                  <export-excel
                    :field="$parent.$parent.getfield"
                    :footer="$parent.$parent.footer"
                    :header="$parent.$parent.other"
                    sqlurl="rs/logic/exportfile"
                    sql-name="fillGasQuery"
                    template-name="充值记录导出"
                    :choose-col="true"
                  ></export-excel>
                  <print-data
                    :sum-field="$parent.$parent.getfield"
                    :model="$parent.model"
                    :field="$parent.$parent.getfield"
                    :defaultfield="$parent.$parent.defaultfield"
                    titletable="加气记录"
                    :sumsmodel="$parent.$parent.sumsmodel"
                  ></print-data>
                  <div
                    style="float: right"
                    class="button_spacing"
                    :class="{
                      button_shrink_top: $parent.$parent.criteriaShow,
                      button_shrink_bottom: !$parent.$parent.criteriaShow,
                    }"
                    @click="$parent.$parent.hidden()"
                  ></div>
                </div>
              </div>
            </div>
          </criteria>

          <data-grid
            :model="model"
            partial="list"
            class="list_area table_sy"
            v-ref:grid
          >
            <template partial="head">
              <tr>
                <th>
                  <nobr>客户编号</nobr>
                </th>
                <th>
                  <nobr>客户名称</nobr>
                </th>
                <th>
                  <nobr>客户状态</nobr>
                </th>
                <th>
                  <nobr>上期余额</nobr>
                </th>
                <th>
                  <nobr>本期余额</nobr>
                </th>
                <th>
                  <nobr>充值金额</nobr>
                </th>
                <th>
                  <nobr>充值方式</nobr>
                </th>
                <th>
                  <nobr>充值日期</nobr>
                </th>
              </tr>
            </template>
            <template partial="body">
              <td style="text-align: center">
                <nobr>
                  <span @click="$parent.$parent.$parent.dealmsg(row)"
                    ><a>{{ row.f_userinfo_code }}</a></span
                  ></nobr
                >
              </td>
              <td style="text-align: center">
                <nobr>{{ row.username }}</nobr>
              </td>
              <td style="text-align: center">
                <nobr>{{ row.f_user_state }}</nobr>
              </td>
              <td style="text-align: center">
                <nobr>{{ row.f_balance }}</nobr>
              </td>
              <td style="text-align: center">
                <nobr>{{ row.f_curbalance }}</nobr>
              </td>
              <td style="text-align: center">
                <nobr>{{ row.f_collection }}</nobr>
              </td>
              <td style="text-align: center">
                <nobr>{{ row.f_payment }}</nobr>
              </td>
              <td style="text-align: center">
                <nobr>{{ row.f_operate_date }}</nobr>
              </td>
            </template>
            <template partial="foot"></template>
          </data-grid>
        </criteria-paged>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "充值记录查询",
  data() {
    return {
      model: {
        rows: [],
      },
    };
  },
  methods: {
    search() {
      let param = {
        orgid: this.$login.f.orgid,
      };
      this.$resetpost("rs/logic/rechargeRecordQuery", param).then((res) => {
        this.model.rows = res.data;
      });
      console.log(this.model);
    },
  },
};
</script>

<style scoped></style>
