|
@@ -24,11 +24,10 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<div class="top">
|
|
|
- <el-input placeholder="用户名" class="input-demo" style="margin: 0;" v-model="customerName"></el-input>
|
|
|
<el-input placeholder="用户所在公司" class="input-demo" v-model="companyName"></el-input>
|
|
|
<el-input placeholder="批次号" class="input-demo" v-model="batchNum"></el-input>
|
|
|
<el-button style="margin-left: 1%;" @click="DownloadTemplate">下载模板</el-button>
|
|
|
- <el-button type="success" style="margin-left: 1%;" @click="loadData">查询</el-button>
|
|
|
+ <el-button type="success" style="margin-left: 1%;" @click="firstLoadData">查询</el-button>
|
|
|
<!-- <el-button type="info" style="margin-left: 1%;">重置</el-button> -->
|
|
|
</div>
|
|
|
</el-col>
|
|
@@ -99,6 +98,7 @@
|
|
|
<el-dialog
|
|
|
@close="handleEditDialogClose"
|
|
|
:visible.sync="addList"
|
|
|
+ class="ttt"
|
|
|
style="font-size: 0px;">
|
|
|
<template>
|
|
|
<div class="tou">运单历史列表</div>
|
|
@@ -107,7 +107,17 @@
|
|
|
<el-input placeholder="运单编号" class="theinput" v-model="billNum"></el-input>
|
|
|
<el-input placeholder="车牌号" class="theinput" v-model="plateNum"></el-input>
|
|
|
<el-input placeholder="税号" class="theinput" v-model="taxPlayerCode"></el-input>
|
|
|
- <el-button type="success" style="margin-left: 1%;" @click="firstLoadData">查询</el-button>
|
|
|
+ <el-select v-model="success" placeholder="是否成功">
|
|
|
+ <el-option
|
|
|
+ v-for="item in optionone"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ <el-button type="success" style="margin-left: 1%;" @click="twoLoadData">查询</el-button>
|
|
|
+ <el-button type="success" style="margin-left: 1%;" @click="exportExcel">导出</el-button>
|
|
|
<!-- <el-button type="info" style="margin-left: 1%;">重置</el-button> -->
|
|
|
</div>
|
|
|
<el-table
|
|
@@ -164,14 +174,26 @@
|
|
|
label="运单状态"
|
|
|
show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.billwayStatus == 1" style="color: green">未结束</span>
|
|
|
+ <span v-if="scope.row.billwayStatus == 1" style="color: green">未结束</span>
|
|
|
+ <span v-else-if="scope.row.billwayStatus == -2" style="color: red">失败</span>
|
|
|
+ <span v-else-if="scope.row.billwayStatus == -3" style="color: red">指令上传失败</span>
|
|
|
<span v-else-if="scope.row.billwayStatus == 2" style="color: green">开票中</span>
|
|
|
<span v-else-if="scope.row.billwayStatus == 3" style="color: green">开票完成</span>
|
|
|
<span v-else-if="scope.row.billwayStatus == 4" style="color: red">超时运单</span>
|
|
|
- <span v-else-if="scope.row.billwayStatus == -2" style="color: red">导入失败</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
+ label="是否成功"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+
|
|
|
+ <span v-if="scope.row.billwayStatus == -2 || scope.row.billwayStatus == -3" style="color: red">失败</span>
|
|
|
+ <span v-else-if="scope.row.billwayStatus != -2 && scope.row.billwayStatus != -3" style="color: green">成功</span>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
prop="failReason"
|
|
|
label="失败原因"
|
|
|
show-overflow-tooltip>
|
|
@@ -196,6 +218,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import FileSaver from "file-saver";
|
|
|
+import XLSX from "xlsx";
|
|
|
export default{
|
|
|
data() {
|
|
|
return {
|
|
@@ -205,7 +229,8 @@ export default{
|
|
|
customerName: '',
|
|
|
companyName: '',
|
|
|
billNum: '',
|
|
|
- plateNumber: '',
|
|
|
+ plateNum: '',
|
|
|
+ success:'',
|
|
|
taxPlayerCode: '',
|
|
|
hightt:'0px',
|
|
|
status: '',
|
|
@@ -253,7 +278,7 @@ export default{
|
|
|
formData.append('size', this.pagesize);
|
|
|
formData.append('customerName',this.formUserList.customerName);
|
|
|
formData.append('company', this.companyName);
|
|
|
- formData.append('batchNumer', this.batchNum);
|
|
|
+ formData.append('batchNumber', this.batchNum);
|
|
|
formData.append('operType', 3);
|
|
|
const response = await this.$http.post(`noCar/findBatchList`, formData);
|
|
|
if (response.data.code === 0) {
|
|
@@ -295,6 +320,11 @@ export default{
|
|
|
this.batchNumberQ = id;
|
|
|
this.loadDataCar();
|
|
|
},
|
|
|
+ twoLoadData(){
|
|
|
+ this.currenttwo = 1;
|
|
|
+ this.pagesizetwo = 8;
|
|
|
+ this.loadDataCar();
|
|
|
+ },
|
|
|
// 查看历史数据
|
|
|
async loadDataCar() {
|
|
|
const formData = new FormData();
|
|
@@ -302,8 +332,10 @@ export default{
|
|
|
formData.append('size', this.pagesizetwo);
|
|
|
formData.append('customerName', this.formUserList.customerName);
|
|
|
formData.append('batchNum', this.batchNumberQ);
|
|
|
- formData.append('plateNumber', this.plateNumber);
|
|
|
- formData.append('taxPlayerCode', this.taxPlayerCode);
|
|
|
+ formData.append('billNum', this.billNum);
|
|
|
+ formData.append('success', this.success);
|
|
|
+ formData.append('plateNum', this.plateNum);
|
|
|
+ formData.append('taxplayerCode', this.taxPlayerCode);
|
|
|
formData.append('hisFlag', 1);
|
|
|
const response = await this.$http.post(`noCar/findImportBillWay`, formData);
|
|
|
if (response.data.code === 0) {
|
|
@@ -312,7 +344,43 @@ export default{
|
|
|
this.totaltwo = response.data.data.total;
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ async exportExcel() {
|
|
|
+ let curr = this.currenttwo;
|
|
|
+ let pagesize1 = this.pagesizetwo;
|
|
|
+ this.currenttwo = 1;
|
|
|
+ this.pagesizetwo = this.totaltwo;
|
|
|
+ await this.loadDataCar();
|
|
|
+ // 设置当前日期
|
|
|
+ let time = new Date();
|
|
|
+ //console.log(time);
|
|
|
+ let year = time.getFullYear();
|
|
|
+ let month = time.getMonth() + 1;
|
|
|
+ let day = time.getDate();
|
|
|
+ let name = "历史运单上传列表_"+year + "" + month + "" + day;
|
|
|
+ // console.log(name)
|
|
|
+ /* generate workbook object from table */
|
|
|
+ // .table要导出的是哪一个表格
|
|
|
+ var wb = XLSX.utils.table_to_book(document.querySelector(".ttt"),{ raw: true });
|
|
|
+ /* 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.currenttwo = curr;
|
|
|
+ this.pagesizetwo = pagesize1;
|
|
|
+ this.loadDataCar();
|
|
|
+ return wbout;
|
|
|
+ },
|
|
|
// 清空表单数据
|
|
|
handleEditDialogClose() {
|
|
|
this.num = '';
|