543 lines
19 KiB
Vue
543 lines
19 KiB
Vue
<template>
|
|
<XdPageContainer >
|
|
<div slot="pageContent" style="height:calc(100vh - 3rem)">
|
|
<XdTable
|
|
slot="pageContent"
|
|
|
|
height="calc(100vh - 20rem)"
|
|
|
|
v-loading="loading"
|
|
border stripe
|
|
size="mini"
|
|
|
|
ref="refTable"
|
|
|
|
storageName="waringEmisSettleBillList_custbill_query_main"
|
|
:data="emisSettleBillList"
|
|
:showSearch.sync="showSearch"
|
|
:queryParams="queryParams"
|
|
:total="total"
|
|
@queryTable="getList"
|
|
@selection-change="handleSelectionChange"
|
|
@sort-change="handleSortChange"
|
|
@row-dblclick="handleSendDbClick"
|
|
show-summary
|
|
: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"/>
|
|
<el-table-column :label="$t('账单月份')" align="center" prop="billMonth" width="80" />
|
|
<el-table-column :label="$t('账单期间')" align="center" prop="billMonthRange" width="200" :show-overflow-tooltip="true">
|
|
<template slot-scope="scope">
|
|
<div >{{scope.row.settleStartDate}}~{{scope.row.settleEndDate}}</div>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('收款状态')" align="center" prop="paymentStatus" width="100" >
|
|
<template slot-scope="scope">
|
|
<el-tag v-if="scope.row.paymentStatus=='0'" type="error">未收款</el-tag>
|
|
<el-tag v-if="scope.row.paymentStatus=='1'" type="success">已收款</el-tag>
|
|
<el-tag v-if="scope.row.paymentStatus=='2'" type="warning">部分收款</el-tag>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('开票状态')" align="center" prop="openBillStatus" width="100" >
|
|
<template slot-scope="scope">
|
|
<el-tag v-if="scope.row.openBillStatus=='0'" type="error">未开票</el-tag>
|
|
<el-tag v-if="scope.row.openBillStatus=='1'" type="success">已开票</el-tag>
|
|
<el-tag v-if="scope.row.openBillStatus=='2'" type="warning">部分开票</el-tag>
|
|
<el-tag v-if="scope.row.openBillStatus=='3'" type="warning">不开票</el-tag>
|
|
<el-tag v-if="scope.row.openBillStatus=='4'" type="success">已完成</el-tag>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column :label="$t('核销状态')" align="center" prop="chargeStatus" width="100" >
|
|
<template slot-scope="scope">
|
|
<el-tag v-if="scope.row.chargeStatus=='0'" type="error">未核销</el-tag>
|
|
<el-tag v-if="scope.row.chargeStatus=='1'" type="success">已核销</el-tag>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('月结客户')" align="center" prop="custName" min-width="150" :show-overflow-tooltip="true">
|
|
<template slot-scope="scope">
|
|
<span type="normal">{{ scope.row.custName }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('总票数')" align="center" prop="sendPieceSum" width="80" />
|
|
<el-table-column :label="$t('总件数')" align="center" prop="pieceNumber" width="80" />
|
|
<el-table-column :label="$t('结算重量')" align="center" prop="feeWeight" width="80" />
|
|
<el-table-column :label="$t('账单应收金额')" align="center" prop="recMoney" width="150" />
|
|
<el-table-column :label="$t('账单已收金额')" align="center" prop="recedMoney" width="150" />
|
|
<el-table-column :label="$t('账单退款金额')" align="center" prop="refundMoney" width="150" />
|
|
<el-table-column :label="$t('理赔金额')" align="center" prop="satisfyMoney" width="80" :show-overflow-tooltip="true"/>
|
|
<el-table-column :label="$t('折让金额')" align="center" prop="allowanceMoney" width="80" :show-overflow-tooltip="true"/>
|
|
<el-table-column :label="$t('抵扣金额')" align="center" prop="deductionMoney" width="80" :show-overflow-tooltip="true"/>
|
|
<el-table-column :label="$t('其他收费')" align="center" prop="otherMoney" width="80" :show-overflow-tooltip="true"/>
|
|
|
|
<el-table-column :label="$t('理赔原因')" align="center" prop="satisfyMoney" width="100" :show-overflow-tooltip="true" />
|
|
<el-table-column :label="$t('折让原因')" align="center" prop="allowanceReason" width="100" :show-overflow-tooltip="true"/>
|
|
<el-table-column :label="$t('抵扣原因')" align="center" prop="deductionReason" width="100" :show-overflow-tooltip="true"/>
|
|
<el-table-column :label="$t('其他原因')" align="center" prop="otherReason" width="100" :show-overflow-tooltip="true" />
|
|
<el-table-column :label="$t('回款联系人')" align="center" prop="payee" width="100" />
|
|
<el-table-column :label="$t('销售联系人')" align="center" prop="salesmen" width="100" />
|
|
|
|
<el-table-column :label="$t('账期(天)')" align="center" prop="creditPeriod" min-width="100" />
|
|
<el-table-column :label="$t('账单日')" align="center" prop="settleDay" min-width="100" />
|
|
<el-table-column :label="$t('最后回款日')" align="center" prop="paymentDueDate" min-width="170" />
|
|
|
|
|
|
<el-table-column :label="$t('账单生成时间')" align="center" prop="createTime" width="170" :show-overflow-tooltip="true"/>
|
|
|
|
<el-table-column :label="$t('业务确认状态')" align="center" prop="blConfirmSite" min-width="120" >
|
|
<template slot-scope="scope">
|
|
<span v-if="scope.row.blConfirmSite=='0'" >未确认</span>
|
|
<el-tag v-if="scope.row.blConfirmSite=='1'" type="success">已确认</el-tag>
|
|
<el-tag v-if="scope.row.blConfirmSite=='2'" type="error">确认不出账</el-tag>
|
|
<el-tag v-if="scope.row.blConfirmSite=='3'" type="error">账单异常</el-tag>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('业务确认时间')" align="center" prop="confirmSiteDate" min-width="170" />
|
|
<el-table-column :label="$t('业务确认人')" align="center" prop="confirmSiteManName" min-width="100" />
|
|
<el-table-column :label="$t('业务备注')" align="center" prop="confirmSiteNote" min-width="100" />
|
|
|
|
<el-table-column label="创建人" align="center" prop="createByName" width="80" :show-overflow-tooltip="true"/>
|
|
<el-table-column label="创建网点" align="center" prop="createSiteName" width="80" :show-overflow-tooltip="true"/>
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="170"/>
|
|
<el-table-column label="修改人" align="center" prop="updateByName" width="80" :show-overflow-tooltip="true"/>
|
|
<el-table-column label="修改网点" align="center" prop="updateSiteName" width="80" :show-overflow-tooltip="true"/>
|
|
<el-table-column label="修改时间" align="center" prop="updateTime" width="170"/>
|
|
|
|
</XdTable>
|
|
|
|
</div>
|
|
</XdPageContainer>
|
|
</template>
|
|
|
|
<script>
|
|
import { listEmisSettleBill } from "@/api/emis/emisSettleBill";
|
|
|
|
|
|
export default {
|
|
name: "EmisSettleBillQuery",
|
|
props:{
|
|
queryInfo:{
|
|
type:Object
|
|
},
|
|
queryType:{
|
|
type:Number
|
|
}
|
|
|
|
},
|
|
components: { },
|
|
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 {
|
|
// 遮罩层
|
|
loading: false,
|
|
// 选中数组
|
|
ids: [],
|
|
// 非单个禁用
|
|
single: true,
|
|
// 非多个禁用
|
|
multiple: true,
|
|
// 显示搜索条件
|
|
showSearch: true,
|
|
// 创建时间搜索
|
|
dateTimeRange:[],
|
|
// 总条数
|
|
total: 0,
|
|
// 结算总账单表格数据
|
|
emisSettleBillList: [],
|
|
selectList: [],
|
|
|
|
currentId:null,
|
|
openForm: false,
|
|
titleForm: "",
|
|
|
|
subBillTotal: 0,
|
|
// 结算子账单表格数据
|
|
emisSettleSubBillList: [],
|
|
|
|
currentSettleBillNo:null,
|
|
|
|
queryOrderType:null,
|
|
|
|
// 弹出展示层
|
|
id:null,
|
|
titleView:"",
|
|
openView: false,
|
|
// 更新站点时间范围
|
|
daterangeSettleStartDate: [],
|
|
// 更新站点时间范围
|
|
daterangeSettleEndDate: [],
|
|
// 更新站点时间范围
|
|
daterangeCreateTime: [],
|
|
// 更新站点时间范围
|
|
daterangeUpdateTime: [],
|
|
// 查询参数
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageSize: 500,
|
|
|
|
billMonth: null,
|
|
custNo: null,
|
|
openBillStatus: null,
|
|
paymentStatus: null,
|
|
chargeStatus: null,
|
|
|
|
payee: null,
|
|
salesmen: null,
|
|
|
|
params:{
|
|
noPayBill:null,
|
|
canOpenBill:null
|
|
}
|
|
},
|
|
};
|
|
},
|
|
watch: {
|
|
"queryInfo": {
|
|
handler (newValue, oldValue) {
|
|
console.log("====>queryInfo====>",this.queryInfo);
|
|
this.getList();
|
|
},
|
|
deep: true
|
|
}
|
|
},
|
|
created() {
|
|
},
|
|
methods: {
|
|
/** 查询结算总账单列表 */
|
|
getList() {
|
|
this.loading = true;
|
|
this.emisSettleBillList=[];
|
|
console.log("====>queryInfo====>",this.queryInfo);
|
|
this.queryParams.salesmen=this.queryInfo.salesmen;
|
|
this.queryParams.billMonth=this.queryInfo.billMonth;
|
|
if(this.queryType==1){
|
|
this.queryParams.params.noPayBill=1;
|
|
this.queryParams.params.canOpenBill=null;
|
|
this.queryParams.openBillStatus=null;
|
|
}
|
|
else if(this.queryType==2){
|
|
this.queryParams.params.noPayBill=null;
|
|
this.queryParams.params.canOpenBill=1;
|
|
this.queryParams.openBillStatus=0;
|
|
}
|
|
|
|
listEmisSettleBill(this.queryParams).then(response => {
|
|
this.emisSettleBillList = response.rows;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
});
|
|
|
|
},
|
|
|
|
handleSendDbClick(row){
|
|
this.$emit("onSelect",row);
|
|
},
|
|
|
|
//指定列求和
|
|
getSummaries(param) {
|
|
const { columns, data } = param;
|
|
const sums = [];
|
|
columns.forEach((column, index) => {
|
|
if (index === 0) {
|
|
sums[index] = '合计';
|
|
return;
|
|
}
|
|
if (
|
|
column.property === 'sendPieceSum'
|
|
) {
|
|
const values = data.map(item => Number(item.sendPieceSum));
|
|
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); //保留0位小数
|
|
}
|
|
|
|
else if (
|
|
column.property === 'pieceNumber'
|
|
|
|
) {
|
|
const values = data.map(item => Number(item.pieceNumber));
|
|
|
|
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); //保留0位小数
|
|
}
|
|
else if (
|
|
column.property === 'feeWeight'
|
|
|
|
) {
|
|
const values = data.map(item => Number(item.feeWeight));
|
|
|
|
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); //保留2位小数
|
|
}
|
|
|
|
else if (
|
|
column.property === 'recMoney'
|
|
) {
|
|
const values = data.map(item => Number(item.recMoney));
|
|
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); //保留2位小数
|
|
}
|
|
else if(
|
|
column.property === 'recedMoney'
|
|
){
|
|
const values = data.map(item => Number(item.recedMoney));
|
|
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); //保留2位小数
|
|
}
|
|
else if(
|
|
column.property === 'refundMoney'
|
|
){
|
|
const values = data.map(item => Number(item.refundMoney));
|
|
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); //保留2位小数
|
|
}
|
|
});
|
|
console.log(sums);
|
|
return sums
|
|
},
|
|
/** 搜索按钮操作 */
|
|
handleQuery() {
|
|
this.queryParams.pageNum = 1;
|
|
this.getList();
|
|
},
|
|
/** 重置按钮操作 */
|
|
resetQuery() {
|
|
this.resetForm("queryForm");
|
|
this.handleQuery();
|
|
},
|
|
// 多选框选中数据
|
|
handleSelectionChange(selection) {
|
|
|
|
this.selectList=selection;
|
|
|
|
this.ids = selection.map(item => item.id)
|
|
this.single = selection.length!==1
|
|
this.multiple = !selection.length
|
|
|
|
if(selection&&selection.length>0){
|
|
this.currentSettleBillNo=selection[0].settleBillNo;
|
|
}
|
|
|
|
},
|
|
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
|
handleSortChange(column) {
|
|
this.queryParams.orderByColumn = column.prop;
|
|
this.queryParams.isAsc = column.order;
|
|
this.getList();
|
|
},
|
|
|
|
handleFormChanged(){
|
|
this.openForm = false;
|
|
this.getList();
|
|
},
|
|
cancelForm(){
|
|
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
|
|
},
|
|
/** 时间搜索响应函数 */
|
|
dateTimeChange(value){
|
|
this.dateTimeRange=value;
|
|
},
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.el-divider{
|
|
margin-top: 0px;
|
|
background: 0 0;
|
|
border-top: 1px solid #E6EBF5;
|
|
}
|
|
.el-divider__text {
|
|
color: #0955ee;
|
|
cursor: pointer;
|
|
}
|
|
.query-label {
|
|
.el-radio{
|
|
display: block;
|
|
line-height: 23px;
|
|
white-space: normal;
|
|
margin-right: 0;
|
|
}
|
|
}
|
|
</style>
|