645 lines
22 KiB
Vue
645 lines
22 KiB
Vue
<template>
|
||
<XdPageContainer id="BillPaybackSumQuery1" >
|
||
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="mini" :maxShow="20" label-width="90px" label-position="left" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
|
||
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
||
<!-- 查询条件:客户名称、寄件公司、销售联系人、回款联系人、运单号、账单号、账期月、收款时间、收款登记人、 -->
|
||
<el-col :span="6">
|
||
<el-form-item label="寄件时间" prop="createTime" label-width="68px">
|
||
<elDateAdvPicker v-model="dateTimeRange" style="z-index:9999;width:260px" ></elDateAdvPicker>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="18">
|
||
<el-form-item label="客户名称" prop="custNo">
|
||
<AllMonthpayAccountPicker v-model="queryParams.custNo" style="width:100%" ></AllMonthpayAccountPicker>
|
||
</el-form-item>
|
||
<el-form-item label="寄件国家" prop="sendCountry">
|
||
<CountryPicker1 v-model="queryParams.sendCountry" :placeholder="$t('寄件国家')" ></CountryPicker1>
|
||
</el-form-item>
|
||
<el-form-item label="目的国家" prop="receiveCountry">
|
||
<CountryPicker2 v-model="queryParams.receiveCountry" :placeholder="$t('目的国家')" ></CountryPicker2>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="销售主管" prop="salesExecutive" >
|
||
<EmpNamePicker1 :placeholder="$t('销售主管')" v-model="queryParams.salesExecutive" ></EmpNamePicker1>
|
||
</el-form-item>
|
||
<el-form-item label="销售联系人" prop="salesmen" >
|
||
<EmpNamePicker2 :placeholder="$t('销售联系人')" v-model="queryParams.salesmen" ></EmpNamePicker2>
|
||
</el-form-item>
|
||
<el-form-item label="销售支持" prop="salesSupport" >
|
||
<EmpNamePicker3 :placeholder="$t('销售支持')" v-model="queryParams.salesSupport" ></EmpNamePicker3>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
</SearchForm>
|
||
<div slot="pageContent">
|
||
<xd-table
|
||
height="calc(100vh - 20rem)"
|
||
|
||
ref="refTable"
|
||
|
||
v-loading="loading"
|
||
border
|
||
size="mini"
|
||
|
||
storageName="PayBackStatList_main_2505_05"
|
||
|
||
:data="emisStatList"
|
||
:showSearch.sync="showSearch"
|
||
:queryParams="queryParams"
|
||
:total="total"
|
||
|
||
@queryTable="getList"
|
||
@selection-change="handleSelectionChange"
|
||
@sort-change="handleSortChange"
|
||
show-summary
|
||
:summary-method="getSummaries"
|
||
|
||
highlight-current-row
|
||
>
|
||
<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="customerName" width="200" :show-overflow-tooltip="true"/>
|
||
<el-table-column :label="$t('总票数')" align="center" prop="totalTickets" width="80">
|
||
<template slot-scope="scope">
|
||
<span @click="handleShowBillList(scope.row,null)">{{ scope.row.totalTickets }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('总重量')" align="center" prop="totalWeight" min-width="100" />
|
||
<el-table-column :label="$t('销售联系人')" align="center" prop="salesmen" min-width="120" />
|
||
<el-table-column :label="$t('越南')" align="center" prop="express" min-width="120" >
|
||
<el-table-column :label="$t('票数')" align="center" prop="expressTickets" min-width="120" >
|
||
<template slot-scope="scope">
|
||
<span @click="handleShowBillList(scope.row,1)">{{ scope.row.expressTickets }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('实际重量')" align="center" prop="expressWeight" min-width="120" />
|
||
</el-table-column>
|
||
<el-table-column :label="$t('空运')" align="center" prop="air" width="100" >
|
||
<el-table-column :label="$t('票数')" align="center" prop="airTickets" min-width="120" >
|
||
<template slot-scope="scope">
|
||
<span @click="handleShowBillList(scope.row,2)">{{ scope.row.airTickets }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('实际重量')" align="center" prop="airWeight" min-width="120" />
|
||
</el-table-column>
|
||
<el-table-column :label="$t('陆运')" align="center" prop="land" width="100" >
|
||
<el-table-column :label="$t('票数')" align="center" prop="landTickets" min-width="120" >
|
||
<template slot-scope="scope">
|
||
<span @click="handleShowBillList(scope.row,'3,5')">{{ scope.row.landTickets }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('实际重量')" align="center" prop="landWeight" min-width="120" />
|
||
</el-table-column>
|
||
<el-table-column :label="$t('进口')" align="center" prop="import" width="100" >
|
||
<el-table-column :label="$t('票数')" align="center" prop="importTickets" min-width="120" >
|
||
<template slot-scope="scope">
|
||
<span @click="handleShowBillList(scope.row,'import')">{{ scope.row.importTickets }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('实际重量')" align="center" prop="importWeight" min-width="120" />
|
||
</el-table-column>
|
||
<el-table-column :label="$t('海运')" align="center" prop="sea" width="100" >
|
||
<el-table-column :label="$t('票数')" align="center" prop="seaTickets" min-width="120" >
|
||
<template slot-scope="scope">
|
||
<span @click="handleShowBillList(scope.row,4)">{{ scope.row.seaTickets }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('实际重量')" align="center" prop="seaWeight" min-width="120" />
|
||
</el-table-column>
|
||
<el-table-column :label="$t('其他')" align="center" prop="other" width="100" >
|
||
<el-table-column :label="$t('票数')" align="center" prop="otherTickets" min-width="120" >
|
||
<template slot-scope="scope">
|
||
<span @click="handleShowBillList(scope.row,'other')">{{ scope.row.otherTickets }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('实际重量')" align="center" prop="otherWeight" min-width="120" />
|
||
</el-table-column>
|
||
|
||
</xd-table>
|
||
</div>
|
||
|
||
</XdPageContainer>
|
||
</template>
|
||
|
||
<script>
|
||
|
||
|
||
import { monthlyShipmentStat } from "@/api/emis/emisCustomerUser";
|
||
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
|
||
import AllMonthpayAccountPicker from '@/views/emis/EmisBaseTools/AllMonthpayAccountPicker.vue';
|
||
import EmpNamePicker1 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
||
import EmpNamePicker2 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
||
import EmpNamePicker3 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
||
import CountryPicker1 from '@/views/emis/EmisBaseTools/CountryPicker.vue';
|
||
import CountryPicker2 from '@/views/emis/EmisBaseTools/CountryPicker.vue';
|
||
import { timeFormat } from '@/utils/dateUtils';
|
||
export default {
|
||
name: "MonthlyShipmentStatReceiveCountryQuery",
|
||
components: { EmpNamePicker1,EmpNamePicker2,EmpNamePicker3,elDateAdvPicker,AllMonthpayAccountPicker,CountryPicker1,CountryPicker2 },
|
||
dicts: ['emis_payment_status'],
|
||
data() {
|
||
return {
|
||
// 调整表格的高度,不允许滚动
|
||
tableHeight: 200,
|
||
// 遮罩层
|
||
loading: false,
|
||
// 选中数组
|
||
ids: [],
|
||
// 非单个禁用
|
||
single: true,
|
||
// 非多个禁用
|
||
multiple: true,
|
||
// 显示搜索条件
|
||
showSearch: true,
|
||
// 创建时间搜索
|
||
dateTimeRange:[],
|
||
|
||
// 总条数
|
||
total: 0,
|
||
recordTotal:0,
|
||
|
||
emisStatList: [],
|
||
emisStatRecordList:[],
|
||
selectionList:[],
|
||
|
||
// 弹出层标题
|
||
title: "",
|
||
// 是否显示弹出层
|
||
open: false,
|
||
|
||
activeName: 'first',
|
||
|
||
openForm: false,
|
||
titleForm: "",
|
||
|
||
queryOrderType:null,
|
||
|
||
queryStatInfoMap:null,
|
||
|
||
titleEmisElectronicPagApply: "",
|
||
openEmisElectronicPagApply: false,
|
||
|
||
// 显示编辑框更多
|
||
moreInputVisible: false,
|
||
|
||
dataMap:new Map(),
|
||
|
||
// 弹出展示层
|
||
currentId:null,
|
||
id:null,
|
||
titleView:"",
|
||
openView: false,
|
||
|
||
// 查询参数
|
||
queryParams: {
|
||
pageNum: 1,
|
||
pageSize: 10,
|
||
custNo: null,
|
||
sendCountry: null,
|
||
receiveCountry: null,
|
||
salesExecutive: null, // 销售支持
|
||
salesmen: null, // 销售联系人
|
||
salesSupport: null, // 销售支持
|
||
params: {
|
||
beginSendDate: null,
|
||
endSendDate: null,
|
||
}
|
||
},
|
||
// 表单参数
|
||
form: {},
|
||
// 表单校验
|
||
rules: {
|
||
id: [
|
||
{ required: true, message: "id不能为空", trigger: "blur" }
|
||
],
|
||
}
|
||
};
|
||
},
|
||
created() {
|
||
let start = new Date()
|
||
start.setDate(1)
|
||
start.setHours(0, 0, 0, 0)
|
||
let end = new Date()
|
||
var currentMonth = end.getMonth()
|
||
var nextMonth = ++currentMonth
|
||
var nextMonthFirstDay = new Date(end.getFullYear(), nextMonth, 1)
|
||
var oneDay = 1000 * 60 * 60 * 24
|
||
end = new Date(nextMonthFirstDay - oneDay)
|
||
end.setHours(23, 59, 59, 0)
|
||
this.dateTimeRange = [timeFormat(start), timeFormat(end)]
|
||
// this.getList();
|
||
},
|
||
methods: {
|
||
initQueryParams(){
|
||
let thisQueryParams = {...this.queryParams};
|
||
thisQueryParams = this.addDateRange(thisQueryParams, this.dateTimeRange,"SendDate");
|
||
return thisQueryParams;
|
||
},
|
||
|
||
handleShowBillList(row, transType) {
|
||
let params = {
|
||
...this.queryParams,
|
||
transType: transType,
|
||
custNo: row.custNo,
|
||
};
|
||
console.log("====>params====>", params);
|
||
this.$router.push(
|
||
{
|
||
path: '/BIStatData/monthlyShipmentDetail',
|
||
query: {
|
||
query: JSON.stringify(params)
|
||
}
|
||
}
|
||
);
|
||
},
|
||
/** 查询统计信息 */
|
||
getList() {
|
||
this.loading = true;
|
||
let tempQueryParams = this.initQueryParams();
|
||
|
||
monthlyShipmentStat(tempQueryParams).then(response => {
|
||
this.emisStatList = response.rows;
|
||
this.total = response.total;
|
||
this.loading = false;
|
||
});
|
||
|
||
|
||
},
|
||
handleQuery(){
|
||
this.getList();
|
||
},
|
||
|
||
/** 重置按钮操作 */
|
||
resetQuery() {
|
||
this.resetForm("queryForm");
|
||
this.handleQuery();
|
||
},
|
||
// 多选框选中数据
|
||
handleSelectionChange(selection) {
|
||
this.selectionList=selection;
|
||
this.ids = selection.map(item => item.id)
|
||
this.single = selection.length!==1
|
||
this.multiple = !selection.length
|
||
},
|
||
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
||
getProperty(obj, str) {
|
||
str = str.replace(/\[(\w+)\]/g, ".$1"); // 处理数组下标
|
||
let arr = str.split(".");
|
||
for (let i in arr) {
|
||
obj = obj[arr[i]] || "";
|
||
}
|
||
return obj;
|
||
},
|
||
sortFun: function (attr, rev) {
|
||
//第一个参数传入info里的prop表示排的是哪一列,第二个参数是升还是降排序
|
||
if (rev == undefined||rev==null) {
|
||
rev = 1;
|
||
} else {
|
||
rev = (rev) ? 1 : -1;
|
||
}
|
||
let that=this;
|
||
return function (a, b) {
|
||
a = that.getProperty(a,attr);
|
||
b = that.getProperty(b,attr);
|
||
if (a < b) {
|
||
return rev * -1;
|
||
}
|
||
if (a > b) {
|
||
return rev * 1;
|
||
}
|
||
return 0;
|
||
}
|
||
},
|
||
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
||
handleSortChange(column) {
|
||
this.emisStatList = this.emisStatList.sort(
|
||
this.sortFun(column.prop, column.order === 'ascending')
|
||
);
|
||
},
|
||
//指定列求和
|
||
getSummaries(param) {
|
||
const { columns, data } = param;
|
||
const sums = [];
|
||
columns.forEach((column, index) => {
|
||
if (index === 0) {
|
||
sums[index] = '合计';
|
||
return;
|
||
}
|
||
if (
|
||
column.property === 'totalTickets'
|
||
) {
|
||
const values = data.map(item => Number(item.totalTickets));
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(0);
|
||
}
|
||
|
||
else if (
|
||
column.property === 'totalWeight'
|
||
|
||
) {
|
||
const values = data.map(item => Number(item.totalWeight));
|
||
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(2);
|
||
}
|
||
else if (
|
||
column.property === 'expressTickets'
|
||
|
||
) {
|
||
const values = data.map(item => Number(item.expressTickets));
|
||
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(0);
|
||
}
|
||
|
||
else if (
|
||
column.property === 'expressWeight'
|
||
) {
|
||
const values = data.map(item => Number(item.expressWeight));
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(2);
|
||
} else if (
|
||
column.property === 'airTickets'
|
||
){
|
||
const values = data.map(item => Number(item.airTickets));
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(0);
|
||
} else if(
|
||
column.property === 'airWeight'
|
||
){
|
||
const values = data.map(item => Number(item.airWeight));
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(2);
|
||
}else if(
|
||
column.property === 'landTickets'
|
||
){
|
||
const values = data.map(item => Number(item.landTickets));
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(0);
|
||
}else if(
|
||
column.property === 'landWeight'
|
||
){
|
||
const values = data.map(item => Number(item.landWeight));
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(2);
|
||
}else if(
|
||
column.property === 'importTickets'
|
||
){
|
||
const values = data.map(item => Number(item.importTickets));
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(0);
|
||
}else if(
|
||
column.property === 'importWeight'
|
||
){
|
||
const values = data.map(item => Number(item.importWeight));
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(2);
|
||
}else if(
|
||
column.property === 'seaTickets'
|
||
){
|
||
const values = data.map(item => Number(item.seaTickets));
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(0);
|
||
}else if(
|
||
column.property === 'seaWeight'
|
||
){
|
||
const values = data.map(item => Number(item.seaWeight));
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(2);
|
||
}else if(
|
||
column.property === 'otherTickets'
|
||
){
|
||
const values = data.map(item => Number(item.otherTickets));
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(0);
|
||
}else if(
|
||
column.property === 'otherWeight'
|
||
){
|
||
const values = data.map(item => Number(item.otherWeight));
|
||
sums[index] = values.reduce((prev, curr) => {
|
||
const value = Number(curr);
|
||
if (!isNaN(value)) {
|
||
return prev + curr;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0);
|
||
sums[index] = sums[index].toFixed(2);
|
||
}
|
||
});
|
||
return sums
|
||
},
|
||
handleExportDtl(){
|
||
|
||
},
|
||
/** 导出按钮操作 */
|
||
handleExport() {
|
||
const loadingInstance = this.$loading({
|
||
text: '正在导出...'
|
||
})
|
||
|
||
|
||
const $e = this.$refs['refTable'].$el
|
||
let $table = $e.querySelector('.el-table__fixed')
|
||
if(!$table) {
|
||
$table = $e
|
||
}
|
||
import('@/vendor/Export2Excel').then(excel => {
|
||
excel.table_to_book($table,"月结客户出货统计.xlsx");
|
||
loadingInstance.close()
|
||
})
|
||
|
||
loadingInstance.close();
|
||
// let qExportParam = this.initQueryParams();;
|
||
// qExportParam.pageNum=1;
|
||
// qExportParam.pageSize=20000;
|
||
|
||
// monthlyShipmentStat(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 === 'paymentStatus') {
|
||
return this.selectDictLabel(this.dict.type.emis_payment_status,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{
|
||
return '/';
|
||
}
|
||
}
|
||
if (j === 'settleType') {
|
||
if(v[j] == 1){
|
||
return '现金';
|
||
}
|
||
else if(v[j] == 2){
|
||
return '月结';
|
||
}
|
||
|
||
}
|
||
|
||
return v[j]
|
||
}))
|
||
},
|
||
|
||
|
||
}
|
||
};
|
||
</script>
|
||
|
||
<style scoped>
|
||
.el-divider{
|
||
margin-top: 0px;
|
||
background: 0 0;
|
||
border-top: 1px solid #E6EBF5;
|
||
}
|
||
.el-divider__text {
|
||
color: #0955ee;
|
||
cursor: pointer;
|
||
}
|
||
.ellipsis {
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
vertical-align: top;
|
||
white-space: nowrap;
|
||
}
|
||
</style>
|