<template>
    <div class="invoice_container">
      <div class="title">
        <el-row>
          <el-col :span="24">
            <div class="top">
              <el-input  placeholder="客户" class="input-demo" v-model="formCondition.customerName"></el-input>
              <el-input  placeholder="企业" class="input-demo" v-model="formCondition.companyName"></el-input>
              <el-input  placeholder="月份 2021-07" class="input-demo" v-model="formCondition.month"></el-input>
               <el-button type="success" style="margin-left: 1%;" @click="loadData">查询</el-button>
            </div>
          </el-col>
        </el-row>
      </div>
      <!-- 表格部分 -->
        <template>
        <el-table
          v-loading="loading"
          ref="multipleTable"
          :data="invoiceTable"
           height="370px"
          border
          tooltip-effect="dark">
          <el-table-column
            prop="sellerName"
            label="销方名称"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="sellerTaxpayerCode"
            label="销方税号"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="buyerName"
            label="购方名称"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="buyerTaxpayerCode"
            label="购方税号"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="amount"
            label="金额"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="rawInvoiceId"
            label="原票id"
             width="120"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="rawInvoiceCode"
            label="原票发票代码"
             width="140"
            show-overflow-tooltip>
          </el-table-column>
          <el-table-column
            prop="rawInvoiceNum"
            label="原票发票号码"
            show-overflow-tooltip>
          </el-table-column>
        </el-table>
      </template> 
    </div>
</template>
<script type="text/javascript">
      export default {
        data(){
          return{
            formCondition:{
              companyName:'',
              customerName:'',
              month:''
            },
           invoiceTable:[],
          }
        },
        created() {
          
        },
        methods:{
          // 列表展示
          async loadData() {
            const formData = new FormData();
            formData.append('current', this.current);
            formData.append('size', this.pagesize);

            const response = await this.$http.post('noCarService/hCVoiceQuery', this.formCondition);
            if (response.data.code === 0) {
              this.invoiceTable = response.data.data.records;
            }else{
              this.$message({
                              type: 'error',
                              message: ''+response.data.msg
                          });
            }
          },
          // 分页方法
          handleSizeChange(val) {
            this.pagesize = val;
            this.loadData();
            console.log(`每页 ${val} 条`);
          },
          handleCurrentChange(val) {
            this.current = val;
              this.loadData();
            // console.log(`当前页: ${val}`);
          }
        }
      };
</script>
<style>
.invoice_container {
  border: 1px solid #d9d9d9;
  border-radius: 10px;
}
.invoice_container .title {
  font-size: 5px;
  margin-bottom: 20px;
}
.invoice_container .top {
  padding-top: 20px;
  padding-left: 20px;
}
.invoice_container .text {
  display: inline-block;
  color: #000;
  font-size: 16px ;
  margin-left: 1%;
}
.invoice_container .input-demo {
  display: inline-block;
  width: 20%;
  margin-left: 1%;
}
.invoice_container .block {
  font-size: 5px;
  text-align: center;
  margin-top: 25px;
  margin-bottom: 25px;
}
.invoice_container .el-dialog {
  width: 60%;
}
.invoice_container .el-dialog__header, .el-dialog__body {
  padding: 0 20px;
}
.invoice_container .tou {
  font-size: 20px;
  height: 30px;
  line-height: 30px;
  padding-top: 15px;
}
.invoice_container .line {
  margin-top: 15px;
  margin-bottom: 15px;
  width: 100%;
  height: 2px;
  background-color: #d9d9d9;
}
.invoice_container .xinxi {
  text-align: center;
  margin: 15px auto;
  font-size: 18px;
}
</style>