|
@@ -0,0 +1,684 @@
|
|
|
+<template>
|
|
|
+ <div class="invoice_container">
|
|
|
+ <div class="title">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <div class="top" >
|
|
|
+ <el-upload style="margin-left: 10px;" :action="url" :http-request="importExcel" list-type="text" :show-file-list="false" >
|
|
|
+ <el-button type="primary">导入参数</el-button>
|
|
|
+ </el-upload>
|
|
|
+
|
|
|
+ <div class="demo-input-suffix" style="margin-top: 5px;">
|
|
|
+ <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="运单编号" class="input-demo" v-model="formCondition.waybillNum"></el-input>
|
|
|
+ <el-input placeholder="税号" class="input-demo" v-model="formCondition.buyerTaxpayerCode"></el-input>
|
|
|
+ <el-select class="input-demo" v-model="formCondition.invoiceStatus" placeholder="发票状态">
|
|
|
+
|
|
|
+ <el-option
|
|
|
+ v-for="item in invoiceStatusA"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="demo-input-suffix" style="margin-top: 5px;margin-left: 10px;">
|
|
|
+ <el-input placeholder="车牌号" class="input-demo" v-model="formCondition.plateNum"></el-input>
|
|
|
+ <el-date-picker v-model="formCondition.invoiceMakeTime" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开票时间始" end-placeholder="开票时间止"></el-date-picker>
|
|
|
+ <el-date-picker v-model="formCondition.calculateTime" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="扣费时间始" end-placeholder="扣费时间止"></el-date-picker>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="demo-input-suffix" style="margin-top: 5px;margin-right: 10px;">
|
|
|
+ <el-input placeholder="发票代码" class="input-demo" v-model="formCondition.invoiceCode"></el-input>
|
|
|
+ <el-input placeholder="发票号码" class="input-demo" v-model="formCondition.invoiceNum"></el-input>
|
|
|
+ <el-button type="success" style="margin-right: 1%;" @click="firstLoadData">查询</el-button>
|
|
|
+ <el-button style="margin-left: 1%;" @click="DownloadTemplate">查询模板下载</el-button>
|
|
|
+
|
|
|
+ <el-button type="primary" style="margin-right: 1%;" @click="exportExcel">导出报表</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <!-- 表格部分 -->
|
|
|
+ <template>
|
|
|
+ <el-table
|
|
|
+ class="table"
|
|
|
+ v-loading="loading"
|
|
|
+ ref="multipleTable"
|
|
|
+ :data="invoiceTable"
|
|
|
+ :height="heightt"
|
|
|
+ border
|
|
|
+ tooltip-effect="dark">
|
|
|
+ <el-table-column
|
|
|
+ label="客户名称"
|
|
|
+ prop="customerName"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="企业编号"
|
|
|
+ prop="companyNum"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="buyerName"
|
|
|
+ label="公司名称"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="waybillNum"
|
|
|
+ label="运单号"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="waybillNumAct"
|
|
|
+ label="拆分运单号"
|
|
|
+ width="100"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="buyerTaxpayerCode"
|
|
|
+ label="购方税号"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="plateNum"
|
|
|
+ label="车牌号"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="waybillStartTime"
|
|
|
+ label="运单开始时间"
|
|
|
+ width="120"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="waybillEndTime"
|
|
|
+ label="运单结束时间"
|
|
|
+ width="120"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="sellerTaxpayerCode"
|
|
|
+ label="销方税号"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="sellerName"
|
|
|
+ label="销方名称"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="enStation"
|
|
|
+ label="入口收费站"
|
|
|
+ width="100"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="exStation"
|
|
|
+ label="出口收费站"
|
|
|
+ width="100"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="invoiceCode"
|
|
|
+ label="发票代码"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="invoiceNum"
|
|
|
+ label="发票号码"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="transactionId"
|
|
|
+ label="交易Id"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="invoiceMakeTime"
|
|
|
+ label="开票时间"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="exTime"
|
|
|
+ label="交易时间"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="fee"
|
|
|
+ label="交易金额"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.fee/100| rounding}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="totalAmount"
|
|
|
+ label="价税合计"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.totalAmount/100| rounding}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="totalTaxAmount"
|
|
|
+ label="税额"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.totalTaxAmount/100| rounding}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="amount"
|
|
|
+ label="金额"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.amount/100| rounding}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="taxRate"
|
|
|
+ label="税率"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.taxRate| rounding}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="invoiceHtmlUrl"
|
|
|
+ label="预览地址"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <a :href="scope.row.invoiceHtmlUrl" target="_blank">{{scope.row.invoiceHtmlUrl}}</a>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="invoiceUrl"
|
|
|
+ label="下载地址"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <a :href="scope.row.invoiceUrl" target="_blank">{{scope.row.invoiceUrl}}</a>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="calculateTime"
|
|
|
+ label="扣费时间"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="billStatus"
|
|
|
+ label="运单状态"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.billStatus == 1" style="color: green">未结束</span>
|
|
|
+ <span v-else-if="scope.row.billStatus == 2" style="color: green">开票中</span>
|
|
|
+ <span v-else-if="scope.row.billStatus == 3" style="color: green">开票完成</span>
|
|
|
+ <span v-else-if="scope.row.billStatus == 4" style="color: red">超时运单</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="invoiceStatus"
|
|
|
+ label="发票状态"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.invoiceStatus == 1" style="color: green">待开票</span>
|
|
|
+ <span v-else-if="scope.row.invoiceStatus == 2" style="color: green">开票中</span>
|
|
|
+ <span v-else-if="scope.row.invoiceStatus == 3" style="color: green">开票完成</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="msg"
|
|
|
+ label="发票状态信息"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="interType"
|
|
|
+ label="对接方式"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.interType == 0">接口</span>
|
|
|
+ <span v-if="scope.row.interType == 1">平台</span>
|
|
|
+ <span v-if="scope.row.interType == 3">迁移数据</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </template>
|
|
|
+ <!-- 分页 -->
|
|
|
+ <div class="block">
|
|
|
+ <el-pagination
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="current"
|
|
|
+ :page-sizes="[6, 8, 10, 20, 50, 100]"
|
|
|
+ :page-size="pagesize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script type="text/javascript">
|
|
|
+import CsvExportor from 'csv-exportor';
|
|
|
+import XLSX from 'xlsx';
|
|
|
+ export default {
|
|
|
+ data(){
|
|
|
+ return{
|
|
|
+ formCondition: {
|
|
|
+ invoiceCode: '',
|
|
|
+ invoiceNum: '',
|
|
|
+ waybillNum: '',
|
|
|
+ plateNum: ''
|
|
|
+ },
|
|
|
+ invoiceStatusA: [
|
|
|
+ {'label': '待开票', 'value': '1'},
|
|
|
+ {'label': '开票中', 'value': '2'},
|
|
|
+ {'label': '开票完成', 'value': '3'}
|
|
|
+ ],
|
|
|
+ formUserList: {
|
|
|
+ 'file': ''
|
|
|
+ },
|
|
|
+ invoiceTable: [],
|
|
|
+ hightt: '0px',
|
|
|
+ current: 1,
|
|
|
+ pagesize: 8,
|
|
|
+ total: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.heightt = tableHeight-110;// eslint-disable-line
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ filters: {
|
|
|
+ rounding (value) {
|
|
|
+ return value.toFixed(2)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ firstLoadData(){
|
|
|
+ this.current = 1;
|
|
|
+ this.pagesize = 8;
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ // 列表展示
|
|
|
+ async loadData() {
|
|
|
+ const formData = new FormData();
|
|
|
+ formData.append('current', this.current);
|
|
|
+ formData.append('size', this.pagesize);
|
|
|
+ for(var i in this.formCondition){
|
|
|
+ formData.append(i, this.formCondition[i]);
|
|
|
+ }
|
|
|
+ const response = await this.$http.post('noCar/findNocarInvoicesHis', formData);
|
|
|
+ if (response.data.code == 0) {
|
|
|
+ this.invoiceTable = response.data.data.records;
|
|
|
+ this.total = response.data.data.total;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ importExcel (content) {
|
|
|
+ const file = content.file
|
|
|
+ // let file = file.files[0] // 使用传统的input方法需要加上这一步
|
|
|
+ const filename = file.name
|
|
|
+ if(!filename||typeof filename != 'string'){
|
|
|
+ this.$message('格式错误!请按照模板中格式')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let a = filename.split('').reverse().join('');
|
|
|
+ let types = a.substring(0, a.search(/\./)).split('').reverse().join('');
|
|
|
+
|
|
|
+ const fileType = ['xlsx', 'xlc', 'xlm', 'xls', 'xlt', 'xlw', 'csv'].some((item) => item === types) // eslint-disable-line
|
|
|
+ if (!fileType) {
|
|
|
+ this.$message(types+'格式错误!请按照模板中格式')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.file2Xce(file).then((tabJson) => {
|
|
|
+ var billNums = '';
|
|
|
+ var invoiceCodes = '';
|
|
|
+ var invoiceNums = '';
|
|
|
+ var carNums = '';
|
|
|
+ if (tabJson && tabJson.length > 0) {
|
|
|
+ this.xlsxJson = tabJson;
|
|
|
+ this.fileList = this.xlsxJson[0].sheet;
|
|
|
+ this.fileList.forEach((item, index, arr) => {
|
|
|
+ if(item['运单编号'] != null && item['运单编号'] != '' && typeof item['运单编号'] != 'undefined'){
|
|
|
+ billNums+= item['运单编号'].trim()+',';
|
|
|
+ }
|
|
|
+ if(item['发票号码'] != null && item['发票号码'] != '' && typeof item['发票号码'] != 'undefined'){
|
|
|
+ invoiceNums+= (item['发票号码']+'').trim()+',';
|
|
|
+ }else{
|
|
|
+ invoiceNums+= '#,';
|
|
|
+ }
|
|
|
+ if(item['发票代码']!=null && item['发票代码']!='' && typeof item['发票代码']!='undefined'){
|
|
|
+ invoiceCodes+= (item['发票代码']+'').trim()+',';
|
|
|
+ }else{
|
|
|
+ invoiceNums+= '#,';
|
|
|
+ }
|
|
|
+ if(item['车牌号']!=null && item['车牌号']!='' && typeof item['车牌号']!='undefined'){
|
|
|
+ carNums+= item['车牌号'].trim()+',';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if(billNums != '') {
|
|
|
+ this.formCondition.waybillNum =billNums.substring(0, billNums.length-1);
|
|
|
+ }
|
|
|
+ if(invoiceNums!=null || invoiceNums!='') {
|
|
|
+ this.formCondition.invoiceCode =invoiceCodes.substring(0, invoiceCodes.length-1);
|
|
|
+ }
|
|
|
+ if(invoiceCodes!='') {
|
|
|
+ this.formCondition.invoiceNum =invoiceNums.substring(0, invoiceNums.length-1);
|
|
|
+ }
|
|
|
+ if(carNums != null || carNums != '') {
|
|
|
+ this.formCondition.plateNum = carNums.substring(0, carNums.length-1);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ file2Xce(file) {
|
|
|
+ return new Promise(function(resolve, reject) {
|
|
|
+ const reader = new FileReader()
|
|
|
+ reader.onload = function(e) {
|
|
|
+ const data = e.target.result
|
|
|
+ this.wb = XLSX.read(data, {
|
|
|
+ type: 'binary'
|
|
|
+ })
|
|
|
+ const result = []
|
|
|
+ var are = (this.wb.Sheets.Sheet1)['!ref'];
|
|
|
+ var areRe = are.replace('A1', 'A2');
|
|
|
+ (this.wb.Sheets.Sheet1)['!ref'] = areRe;
|
|
|
+ this.wb.SheetNames.forEach((sheetName) => {
|
|
|
+ result.push({
|
|
|
+ sheetName: sheetName,
|
|
|
+ sheet: XLSX.utils.sheet_to_json(this.wb.Sheets[sheetName])
|
|
|
+ })
|
|
|
+ })
|
|
|
+ resolve(result)
|
|
|
+ }
|
|
|
+ // reader.readAsBinaryString(file.raw)
|
|
|
+ reader.readAsBinaryString(file) // 传统input方法
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 下载模板
|
|
|
+ DownloadTemplate() {
|
|
|
+ var url = hostUrl + "noCar/templateDownload?fileName=4"// eslint-disable-line
|
|
|
+ window.location.href = url;
|
|
|
+ },
|
|
|
+ handleRemove(file, fileList) {
|
|
|
+ },
|
|
|
+ handlePreview(file) {
|
|
|
+ },
|
|
|
+ handleSuccess(a) {
|
|
|
+ this.formUserList.file = a.raw;
|
|
|
+ },
|
|
|
+ // 批量上传模板信息
|
|
|
+ async batchUpload() {
|
|
|
+ const isLt50M = this.formUserList.file.size / 1024 / 1024 < 50;
|
|
|
+ let extName = this.formUserList.file.name.substring(this.formUserList.file.name.lastIndexOf('.')).toLowerCase();
|
|
|
+ let AllUpExt = '.xlsx';
|
|
|
+ if (extName != AllUpExt) {
|
|
|
+ this.$message.error('格式错误!请重新选择');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!isLt50M) {
|
|
|
+ this.$message.error('上传文件大小不能超过50MB!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '系统正在努力接收中,过程大概需要几分钟的时间,请您耐心等待...',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ const formData = new FormData();
|
|
|
+ formData.append('file', this.formUserList.file);
|
|
|
+ const response = await this.$http.post(`noCar/batchImportNocarInvoices`, formData);
|
|
|
+ var {data: { code, msg, data }} = response;
|
|
|
+ if (code == 0 && msg =='1') {
|
|
|
+ loading.close();
|
|
|
+ this.invoiceTable = response.data.data;
|
|
|
+ this.total = response.data.data.length;
|
|
|
+ } else {
|
|
|
+ loading.close();
|
|
|
+ this.$message.error('数据存在错误,请检查文件中数据');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 分页方法
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.pagesize = val;
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.current = val;
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ formartNum(wb) {
|
|
|
+ var sheet = wb['Sheets']['Sheet1'];
|
|
|
+ var replaceTemp = [];
|
|
|
+
|
|
|
+ for(var i in sheet) {
|
|
|
+ if(sheet[i]['v'] == '交易金额' || sheet[i]['v'] == '价税合计' || sheet[i]['v'] == '税额' || sheet[i]['v'] == '金额' || sheet[i]['v'] == '税率') {
|
|
|
+ replaceTemp.push(i.replace(/[0-9]/g, ''));
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (replaceTemp.includes(i.replace(/[0-9]/g, ''))) {
|
|
|
+ sheet[i]['t'] = 'n';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // async exportExcel() {
|
|
|
+ // const loading = this.$loading({
|
|
|
+ // lock: true,
|
|
|
+ // text: '系统正在努力接收中,过程大概需要几分钟的时间,请您耐心等待...',
|
|
|
+ // spinner: 'el-icon-loading',
|
|
|
+ // background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ // });
|
|
|
+ // let curr = this.current;
|
|
|
+ // let pagesize1 = this.pagesize;
|
|
|
+ // this.current = 1;
|
|
|
+ // this.pagesize = this.total;
|
|
|
+ // await this.loadData();
|
|
|
+ // // 设置当前日期
|
|
|
+ // let time = new Date();
|
|
|
+ // let year = time.getFullYear();
|
|
|
+ // let month = time.getMonth() + 1;
|
|
|
+ // let day = time.getDate();
|
|
|
+ // let name = "无车发票查询列表_"+year + "" + month + "" + day;
|
|
|
+ // /* generate workbook object from table */
|
|
|
+ // // .table要导出的是哪一个表格
|
|
|
+ // var wb = XLSX.utils.table_to_book(document.querySelector(".table"),{ raw: true });
|
|
|
+ // this.formartNum(wb);
|
|
|
+ // /* get binary string as output */
|
|
|
+ // var wbout = XLSX.write(wb, {
|
|
|
+ // bookType: "xlsx",
|
|
|
+ // bookSST: true,
|
|
|
+ // type: "array"
|
|
|
+ // });
|
|
|
+ // try {
|
|
|
+ // // name+'.xlsx'表示导出的excel表格名字
|
|
|
+ // FileSaver.saveAs(
|
|
|
+ // new Blob([wbout], { type: "application/octet-stream" }),
|
|
|
+ // name + ".xlsx"
|
|
|
+ // );
|
|
|
+ // } catch (e) {
|
|
|
+ // if (typeof console != "undefined") console.log(e, wbout);
|
|
|
+ // }
|
|
|
+ // this.current = curr;
|
|
|
+ // this.pagesize = pagesize1;
|
|
|
+ // this.loadData();
|
|
|
+ // loading.close();
|
|
|
+ // return wbout;
|
|
|
+ // },
|
|
|
+ async exportExcel() {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '系统正在努力接收中,过程大概需要几分钟的时间,请您耐心等待...',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ var recodes = [];
|
|
|
+ for(var j = 1; j<=this.total/10000+1; j++){
|
|
|
+ const formData = new FormData();
|
|
|
+ formData.append('current', j);
|
|
|
+ formData.append('size', 10000);
|
|
|
+ for(var i in this.formCondition){
|
|
|
+ formData.append(i, this.formCondition[i]);
|
|
|
+ }
|
|
|
+ const response = await this.$http.post('noCar/findNocarInvoicesHis', formData);
|
|
|
+ if (response.data.code == 0) {
|
|
|
+ recodes = recodes.concat(response.data.data.records);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 设置当前日期
|
|
|
+ let time = new Date();
|
|
|
+ let year = time.getFullYear();
|
|
|
+ let month = time.getMonth() + 1;
|
|
|
+ let day = time.getDate();
|
|
|
+ let name = '无车发票查询列表_'+year + '' + month + '' + day;
|
|
|
+ let cloums = [
|
|
|
+ {'title': '企业编号', 'key': 'companyNum'},
|
|
|
+ {'title': '公司名称', 'key': 'buyerName'},
|
|
|
+ {'title': '运单号', 'key': 'waybillNum'},
|
|
|
+ {'title': '拆分运单号', 'key': 'waybillNumAct'},
|
|
|
+ {'title': '购方税号', 'key': 'buyerTaxpayerCode'},
|
|
|
+ {'title': '车牌号码', 'key': 'plateNum'},
|
|
|
+ {'title': '运单开始时间', 'key': 'waybillStartTime'},
|
|
|
+ {'title': '运单结束时间', 'key': 'waybillEndTime'},
|
|
|
+ {'title': '销方税号', 'key': 'sellerTaxpayerCode'},
|
|
|
+ {'title': '销方名称', 'key': 'sellerName'},
|
|
|
+ {'title': '入口收费站', 'key': 'enStation'},
|
|
|
+ {'title': '出口收费站', 'key': 'exStation'},
|
|
|
+ {'title': '发票代码', 'key': 'invoiceCode'},
|
|
|
+ {'title': '发票号码', 'key': 'invoiceNum'},
|
|
|
+ {'title': '交易Id', 'key': 'transactionId'},
|
|
|
+ {'title': '开票时间', 'key': 'invoiceMakeTime'},
|
|
|
+ {'title': '交易时间', 'key': 'exTime'},
|
|
|
+ {'title': '交易金额(元)', 'key': 'fee'},
|
|
|
+ {'title': '价税合计(元)', 'key': 'totalAmount'},
|
|
|
+ {'title': '税额(元)', 'key': 'totalTaxAmount'},
|
|
|
+ {'title': '金额(元)', 'key': 'amount'},
|
|
|
+ {'title': '税率', 'key': 'taxRate'},
|
|
|
+ {'title': '扣费时间', 'key': 'calculateTime'},
|
|
|
+ {'title': '运单状态', 'key': 'billStatus'},
|
|
|
+ {'title': '发票状态', 'key': 'invoiceStatus'},
|
|
|
+ {'title': '发票状态信息', 'key': 'msg'},
|
|
|
+ {'title': '预览地址', 'key': 'invoiceHtmlUrl'},
|
|
|
+ {'title': '下载地址', 'key': 'invoiceUrl'}
|
|
|
+ ];
|
|
|
+ this.exportExcelComm(cloums, recodes, name, loading)
|
|
|
+ },
|
|
|
+ formatJson (filterVal, jsonData) {
|
|
|
+ return jsonData.map(v => filterVal.map((j) => { // eslint-disable-line
|
|
|
+ if(j == 'billStatus'){
|
|
|
+ if(v[j] == 1){
|
|
|
+ return '未结束';
|
|
|
+ } else if(v[j] == -2){
|
|
|
+ return '上传失败';
|
|
|
+ }else if(v[j] == -3){
|
|
|
+ return '指令结束上传失败';
|
|
|
+ }else if(v[j] == 2){
|
|
|
+ return '开票中';
|
|
|
+ }else if(v[j] == 3){
|
|
|
+ return '开票完成';
|
|
|
+ }else {
|
|
|
+ return '超时运单';
|
|
|
+ }
|
|
|
+ } else if(j == 'invoiceStatus'){
|
|
|
+ if(v[j] == 1){
|
|
|
+ return '待开票';
|
|
|
+ } else if(v[j] == 2){
|
|
|
+ return '开票中';
|
|
|
+ }else{
|
|
|
+ return '开票完成';
|
|
|
+ }
|
|
|
+ }else if(j == 'fee'){
|
|
|
+ return v[j]/100;
|
|
|
+ }else if(j == 'totalAmount'){
|
|
|
+ return v[j]/100;
|
|
|
+ }else if(j == 'totalTaxAmount'){
|
|
|
+ return v[j]/100;
|
|
|
+ }else if(j == 'amount'){
|
|
|
+ return v[j]/100;
|
|
|
+ }else if(j == 'waybillNum' || j == 'invoiceCode' || j == 'invoiceNum'){
|
|
|
+ return v[j]+'\t';
|
|
|
+ }else{
|
|
|
+ return v[j];
|
|
|
+ }
|
|
|
+ }));
|
|
|
+ },
|
|
|
+ // 导出Excel
|
|
|
+ exportExcelComm(columns, list, excelName, loading){
|
|
|
+ let tHeader = []
|
|
|
+ let filterVal = []
|
|
|
+ columns.forEach((item) => {
|
|
|
+ tHeader.push (item.title)// eslint-disable-line
|
|
|
+ filterVal.push (item.key)// eslint-disable-line
|
|
|
+ });
|
|
|
+ const data = this.formatJson(filterVal, list);
|
|
|
+ data.unshift(tHeader);
|
|
|
+ CsvExportor.downloadCsv(data, { tHeader }, excelName+'.csv');
|
|
|
+ loading.close();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+</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: 15%;
|
|
|
+ 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>
|