<template>
  <div class="eibs-tab">
    <c-col :span="8" class="col-left">
      <c-col :span="24">
        <el-form-item label="申报类型" prop="recp.boptyp">
          <c-select
            v-model="model.recp.boptyp"
            dbCode="boptna"
            style="width: 100%"
            placeholder="请输入申报类型"

          >
          </c-select>
        </el-form-item>
      </c-col>

      <c-col :span="24">
          <el-form-item label="复核日期">
              <c-col :span="11">
                  <c-date-picker type="date" v-model="model.recp.begreldat" value-format="yyyy-MM-dd"></c-date-picker>
              </c-col>
              <c-col :span="2" style="text-align: center">
                  <label style="display: inline-block; width: 100%">-</label>
              </c-col>
              <c-col :span="11">
                  <c-date-picker type="date" v-model="model.recp.endreldat" value-format="yyyy-MM-dd"></c-date-picker>
              </c-col>
          </el-form-item>
      </c-col>
    </c-col>
    <c-col :span="8">
     <c-col :span="24">
        <el-form-item label="员工号" prop="recp.usr">
          <c-input
            v-model="model.recp.usr"
            maxlength="8"
            placeholder="请输入员工号"
          ></c-input>
        </el-form-item>
      </c-col>
       <c-col :span="24">
           <el-form-item label="对账日期">
               <c-col :span="11">
                   <c-date-picker type="date" v-model="model.recp.begchkdat" value-format="yyyy-MM-dd"></c-date-picker>
               </c-col>
               <c-col :span="2" style="text-align: center">
                   <label style="display: inline-block; width: 100%">-</label>
               </c-col>
               <c-col :span="11">
                   <c-date-picker type="date" v-model="model.recp.endchkdat" value-format="yyyy-MM-dd"></c-date-picker>
               </c-col>
           </el-form-item>
       </c-col>
    </c-col>
    <c-col :span="8" class="col-right">
      <c-col :span="24">
        <el-form-item label="申报号码" prop="recp.rptno">
          <c-input
            v-model="model.recp.rptno"
            maxlength="22"
            placeholder="请输入申报号码"
          ></c-input>
        </el-form-item>
      </c-col>
         <c-col :span="24">
            <el-form-item label="机构号" prop="recp.branch">
         <c-select
            v-model="model.recp.branch"
            maxlength="9"
            placeholder="请输入机构号"
          >

            <el-option :key="item.branch" :label="item.branch+' '+item.bchname" :value="item.branch"
                                   v-for="item in model.bchtypList">
                        </el-option>
          </c-select>
        </el-form-item>

       </c-col>
    </c-col>
    <c-col :span="24">
      <c-col :span="24">
          <div style="display: flex;justify-content: flex-end;margin: 5px 0 5px 0;">
              <el-button @click="query" icon="el-icon-search" size="small" type="primary">查询</el-button>
              <el-button @click="reset" size="small" type="primary">重置</el-button>
          </div>
      </c-col>
    </c-col>

    <c-col :span="24">
      <div class="e-table-wrapper">
        <el-table
        :data="model.chklst"
                style="width: 100%"
                >
                <el-table-column
                  prop="objtyp"
                  label="申报类型"
                  sortable
                  :show-overflow-tooltip="true"
                  width="200">
                  <template slot-scope="scope">
                    <span>{{
                      getCodelabel(scope.row.objtyp,"boptnalabels") 
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="rptno"
                  label="申报号码"
                  sortable
                  :show-overflow-tooltip="true"
                  width="200">
                </el-table-column>
                <el-table-column
                  prop="usr"
                  label="员工号"
                  sortable
                  :show-overflow-tooltip="true"
                  width="120">
                </el-table-column>
                <el-table-column
                  prop="branch"
                  label="机构号"
                  sortable
                  :show-overflow-tooltip="true"
                  width="100">
                </el-table-column>
                <el-table-column
                  prop="bchnam"
                  label="机构名称"
                  :show-overflow-tooltip="true"
                  sortable
                  width="300">
                </el-table-column>
                <el-table-column
                  prop="datsrc"
                  label="数据来源"
                  :show-overflow-tooltip="true"
                  sortable
                  width="150">
                  <template slot-scope="scope">
                            <span> {{getCodelabel(scope.row.datsrc,"datsrclabels") }}</span>
                        </template>
                </el-table-column>
                <el-table-column
                  prop="reldat"
                  label="复核日期"
                  :show-overflow-tooltip="true"
                  sortable
                  width="150">
                </el-table-column>
                <el-table-column
                  prop="chkdat"
                  :show-overflow-tooltip="true"
                  label="对账日期"
                  sortable
                  width="150">
                </el-table-column>
                <el-table-column
                  prop="sta"
                  label="数据状态"
                  :show-overflow-tooltip="true"
                  sortable
                  width="200">
                  <!-- <template slot-scope="scope">
                    <span>{{ this.codes.chksta.find(item=>item.value==scope.row.sta).label }}</span>
                  </template> -->
                  <template slot-scope="scope">
                            <span> {{getCodelabel(scope.row.sta,"chkbstlabels") }}</span>
                        </template>
                </el-table-column>
        </el-table>
        <el-pagination
                        :current-page.sync="pagination.pageNum"
                        :page-size="pagination.pageSize"
                        :page-sizes="[10, 20, 50, 100, 500]"
                        :total="pagination.total"
                        @current-change="handleCurrentChange"
                        @size-change="handleSizeChange"
                        layout="total, sizes, prev, pager, next, jumper">
                </el-pagination>
      </div>
    </c-col>
  </div>
</template>
<script>
    import commonProcess from "~/mixin/commonProcess";
    import event from "../event";

    export default {
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [commonProcess, event],
  data() {
    return {
      pagination: {
        pageNum: 1,
        pageSize: 10,
        total: 0,
      },
      dbCodes:{
        boptnalabels:[],
        datsrclabels:[],
        chkbstlabels:[],
      }
    };
  },
  mounted() {
    this.getdbCode("boptna", "CN", "boptnalabels");
    this.getdbCode("datsrc", "CN", "datsrclabels");
    this.getdbCode("chkbst", "CN", "chkbstlabels");
  },
  created: function () {},
   methods: {

        }
};
</script>
<style>
</style>