<template>
  <div class="app-container">
    <div v-if="showPage == 1">
      <el-radio-group v-model="examine" size="">
        <el-radio-button label="全部"></el-radio-button>
        <el-radio-button label="待审核"></el-radio-button>
        <el-radio-button label="审核通过"></el-radio-button>
        <el-radio-button label="审核驳回"></el-radio-button>
      </el-radio-group>
      <br /><br />
      <!-- 筛选条件 -->
      <div>
        <el-form
          ref="searchForm"
          :model="searchForm"
          label-width="100px"
          size="small"
          label-position="left"
        >
          <el-row :gutter="20">
            <el-col :xs="24" :sm="12" :lg="6">
              <el-form-item label="工程押金" prop="">
                <el-select class="selectStyle" placeholder="请选择">
                  <el-option> </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :lg="6">
              <el-form-item label="单据编号" prop="">
                <el-input placeholder="请输入"></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :lg="6">
              <el-form-item label="往来单位" prop="">
                <el-input placeholder="请输入"></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :lg="6">
              <el-form-item label="申请部门" prop="">
                <el-input placeholder="请输入"></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :lg="6">
              <el-form-item label="业务日期" prop="">
                <el-input placeholder="请输入"></el-input>
              </el-form-item>
            </el-col>

            <el-col :xs="24" :sm="24" :lg="18">
              <el-form-item label="" class="fr">
                <el-button size="small">清空</el-button>
                <el-button size="small" type="primary">搜索</el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <!-- 按钮 -->
      <div class="btn-group clearfix">
        <div class="fl">
          <el-button type="primary" size="small" @click="addFn">新建</el-button>
          <el-button type="primary" size="small">删除</el-button>
          <el-button type="primary" size="small" @click="approvalFn"
            >审批</el-button
          >
          <el-button type="primary" size="small" @click="detailFn"
            >详情</el-button
          >
        </div>
        <div class="fr">
          <el-button type="primary" size="small">导出</el-button>
        </div>
      </div>
      <!-- 列表 -->
      <div class="mymain-container">
        <div class="table">
          <el-table
            v-loading="listLoading"
            :data="dataList"
            element-loading-text="Loading"
            border
            fit
            highlight-current-row
            stripe
          >
            <el-table-column align="center" type="selection" width="100">
            </el-table-column>
            <el-table-column
              align="center"
              label="单据类型"
              prop=""
              min-width="160"
              show-overflow-tooltip
            ></el-table-column>
            <el-table-column
              align="center"
              label="单据来源"
              prop=""
              min-width="160"
              show-overflow-tooltip
            ></el-table-column>
            <el-table-column
              align="center"
              label="单据编码"
              prop=""
              min-width="160"
              show-overflow-tooltip
            ></el-table-column>
            <el-table-column
              align="center"
              label="业务日期"
              prop=""
              min-width="160"
              show-overflow-tooltip
            ></el-table-column>
            <el-table-column
              align="center"
              label="往来单位类型"
              prop=""
              min-width="160"
              show-overflow-tooltip
            ></el-table-column>
            <el-table-column
              align="center"
              label="往来单位"
              prop=""
              min-width="160"
              show-overflow-tooltip
            ></el-table-column>
            <el-table-column
              align="center"
              label="币别"
              prop=""
              min-width="160"
              show-overflow-tooltip
            ></el-table-column>
            <el-table-column
              align="center"
              label="总金额"
              prop=""
              min-width="160"
              show-overflow-tooltip
            ></el-table-column>
            <el-table-column
              align="center"
              label="单据状态"
              prop=""
              min-width="160"
              show-overflow-tooltip
            ></el-table-column>

            <el-table-column
              align="center"
              label="操作"
              min-width="160"
              show-overflow-tooltip
              fixed="right"
            >
              <template slot-scope="">
                <el-button type="text" class="textColor" slot="reference"
                  >审批</el-button
                >
                <el-button type="text" class="textColor" slot="reference"
                  >详情</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!-- 分页 -->
        <div class="fr">
          <el-pagination
            :current-page="currentPage"
            :page-sizes="[10, 20, 30, 50]"
            :page-size="10"
            layout="total, sizes, prev, pager, next, jumper"
            :total="listTotal"
          >
          </el-pagination>
        </div>
      </div>
    </div>
    <ReceivableListAdd v-else-if="showPage == 2" />
    <ReceivableListApproval v-else-if="showPage == 3" />
    <ReceivableListDetail v-else-if="showPage == 4" />
  </div>
</template>

<script>
import { getFinanceOtherReceAdd } from "@/api/finance/receivable_list";
import ReceivableListAdd from "./components/receivable_list-add";
import ReceivableListApproval from "./components/receivable_list-approval";
import ReceivableListDetail from "./components/receivable_list-detail";
export default {
  components: {
    ReceivableListAdd,
    ReceivableListApproval,
    ReceivableListDetail,
  },
  data() {
    return {
      currentPage: 1, // 当前页码
      pageSize: 10, // 每页数量
      listTotal: 0, // 列表总数
      dataList: [], // 列表数据
      searchForm: {}, //搜索表单
      listLoading: false, // 列表加载loading
      examine: "全部",
      showPage: 1,
    };
  },
  methods: {
    //详情
    detailFn() {
      this.showPage = 4;
    },
    //审批
    approvalFn() {
      this.showPage = 3;
    },
    //新建
    addFn() {
      this.showPage = 2;
    },
  },
};
</script>
<style lang="scss" scoped>
.selectStyle {
  width: 100%;
}
</style>