md
This commit is contained in:
parent
b2bea8a035
commit
7d0e8bf1a9
@ -5,6 +5,9 @@
|
||||
v-loading="loading"
|
||||
border stripe
|
||||
size="mini"
|
||||
|
||||
ref="refTable"
|
||||
|
||||
storageName="waringEmisSettleBillList_custbill_query_main"
|
||||
:data="emisSettleBillList"
|
||||
:showSearch.sync="showSearch"
|
||||
@ -18,6 +21,21 @@
|
||||
:summary-method="getSummaries"
|
||||
>
|
||||
|
||||
<div slot="toolbar">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="$t('账单名称')" align="left" prop="settleBillName" width="200" :show-overflow-tooltip="true"/>
|
||||
<el-table-column :label="$t('账单编号')" align="center" prop="settleBillNo" width="170" :show-overflow-tooltip="true"/>
|
||||
@ -121,7 +139,9 @@ export default {
|
||||
|
||||
},
|
||||
components: { },
|
||||
dicts: [
|
||||
dicts: ['emis_qujian_fangshi','emis_declare_mode','emis_customs_clear',
|
||||
'emis_tab_packing_type','emis_tab_dispatch_mode','emis_payment_type',
|
||||
'emis_calc_fee_type','emis_print_type','emis_payment_status','emis_waybill_status','emis_tab_dispatch_mode'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
@ -141,6 +161,7 @@ export default {
|
||||
total: 0,
|
||||
// 结算总账单表格数据
|
||||
emisSettleBillList: [],
|
||||
selectList: [],
|
||||
|
||||
currentId:null,
|
||||
openForm: false,
|
||||
@ -343,6 +364,8 @@ export default {
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
|
||||
this.selectList=selection;
|
||||
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
@ -367,6 +390,119 @@ export default {
|
||||
this.openForm = false;
|
||||
},
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const loadingInstance = this.$loading({
|
||||
text: '正在导出...'
|
||||
})
|
||||
|
||||
if(this.selectList&&this.selectList.length>0){
|
||||
this.exportData(this.selectList,loadingInstance);
|
||||
}
|
||||
else{
|
||||
|
||||
let qExportParam={...this.queryParams};
|
||||
qExportParam.pageNum=1;
|
||||
qExportParam.pageSize=20000;
|
||||
|
||||
listEmisSettleBill(qExportParam).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.exportData(response.rows,loadingInstance);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
exportData(selData,loadingInstance){
|
||||
const curList =selData
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const exportParam=this.$refs.refTable.getExportParam();
|
||||
const tHeader = exportParam.header;
|
||||
const filterVal = exportParam.filter;
|
||||
const data = this.formatJson(filterVal, curList, selData)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: '账单列表',
|
||||
autoWidth: true
|
||||
})
|
||||
loadingInstance.close()
|
||||
})
|
||||
},
|
||||
formatJson(filterVal, jsonData, resData) {
|
||||
let index = 0
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
|
||||
if (j === 'index') {
|
||||
return ++index
|
||||
}
|
||||
if (j === 'kjlx') {
|
||||
return v['sendSiteName']+'--'+v['dispatchUnderlingSiteName'];
|
||||
}
|
||||
if (j === 'fjr') {
|
||||
return v['sendName']+'--'+v['receiveName'];
|
||||
}
|
||||
if (j === 'custName') {
|
||||
let paymentType=v['paymentType'];
|
||||
if(paymentType==2 || paymentType==4 || paymentType==5 ){
|
||||
return v['custName'];
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
if (j === 'sendMobile') {
|
||||
return "";
|
||||
}
|
||||
if (j === 'paymentStatus') {
|
||||
return this.selectDictLabel(this.dict.type.emis_payment_status,v[j]);
|
||||
}
|
||||
|
||||
if (j === 'pickupMethod') {
|
||||
return this.selectDictLabel(this.dict.type.emis_qujian_fangshi,v[j]);
|
||||
}
|
||||
if (j === 'customsEclaration') {
|
||||
return this.selectDictLabel(this.dict.type.emis_declare_mode,v[j]);
|
||||
}
|
||||
if (j === 'customsClear') {
|
||||
return this.selectDictLabel(this.dict.type.emis_customs_clear,v[j]);
|
||||
}
|
||||
if (j === 'packType') {
|
||||
return this.selectDictLabels(this.dict.type.emis_tab_packing_type,v[j]);
|
||||
}
|
||||
if (j === 'openBillStatus') {
|
||||
if(v[j] == 0){
|
||||
return '未开票';
|
||||
}
|
||||
else if(v[j] == 1){
|
||||
return '已开票';
|
||||
}
|
||||
else if(v[j] == 2){
|
||||
return '部分开票';
|
||||
}
|
||||
else if(v[j] == 3){
|
||||
return '不开票';
|
||||
}
|
||||
else if(v[j] == 4){
|
||||
return '已完成';
|
||||
}
|
||||
else{
|
||||
return '/';
|
||||
}
|
||||
}
|
||||
if (j === 'chargeStatus') {
|
||||
if(v[j] == 0){
|
||||
return '未核销';
|
||||
}else{
|
||||
return '已核销';
|
||||
}
|
||||
}
|
||||
if (j === 'paymentType') {
|
||||
return this.selectDictLabel(this.dict.type.emis_payment_type,v[j]);
|
||||
}
|
||||
return v[j]
|
||||
}))
|
||||
},
|
||||
|
||||
/** 列索引函数 */
|
||||
getIndex($index) {
|
||||
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user