963 lines
36 KiB
Vue
963 lines
36 KiB
Vue
<template>
|
||
<XdPageContainer class="app-container">
|
||
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="small" :maxShow="30" label-width="100px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
|
||
<el-form-item label="运单号" prop="billCode">
|
||
<XdTextareaInput
|
||
v-model="queryParams.billCode"
|
||
:placeholder="$t('多个流水号逗号或换行隔开')"
|
||
clearable
|
||
:rows="1"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="寄件日期" prop="dateTimeRange">
|
||
<elDateAdvPicker v-model="dateTimeRange" ></elDateAdvPicker>
|
||
</el-form-item>
|
||
<el-form-item label="寄件网点" prop="params.sendSiteCode">
|
||
<EmisSiteSimplePicker1 v-model="queryParams.params.sendSiteCode" ></EmisSiteSimplePicker1>
|
||
</el-form-item>
|
||
<el-form-item label="目的网点" prop="params.dispatchUnderlingSiteCode">
|
||
<EmisSiteSimplePicker2 v-model="queryParams.params.dispatchUnderlingSiteCode" ></EmisSiteSimplePicker2>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="回款联系人" prop="payee" label-width="100px">
|
||
<EmpNamePicker1 :placeholder="$t('回款联系人')" v-model="queryParams.params.payee" ></EmpNamePicker1>
|
||
</el-form-item>
|
||
<el-form-item label="销售联系人" prop="salesmen" label-width="100px">
|
||
<EmpNamePicker2 :placeholder="$t('销售联系人')" v-model="queryParams.params.salesmen" ></EmpNamePicker2>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="是否特殊报价" prop="params.blSpecialQuote">
|
||
<el-select clearable v-model="queryParams.params.blSpecialQuote" placeholder="">
|
||
<el-option key="1" label="是" value="1"></el-option>
|
||
<el-option key="0" label="否" value="0"></el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="线路" prop="params.transLineType">
|
||
<TransLinePicker v-model="queryParams.params.transLineType" isInitiated="true" ></TransLinePicker>
|
||
</el-form-item>
|
||
<el-form-item label="产品类型" prop="productType">
|
||
<TransProductPicker placeholder="产品类型" v-model="queryParams.params.productType" :transLineCode="queryParams.params.transLineType" @onChange="handleQuery"></TransProductPicker>
|
||
</el-form-item>
|
||
<el-form-item label="计费方式" prop="params.calcFeeType">
|
||
<el-select clearable v-model="queryParams.params.calcFeeType" placeholder="请选择">
|
||
<el-option
|
||
v-for="dict in dict.type.emis_calc_fee_type"
|
||
:key="dict.value"
|
||
:label="dict.label"
|
||
:value="dict.value"
|
||
></el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="月结客户" prop="params.custNo">
|
||
<AllMonthpayAccountPicker v-model="queryParams.params.custNo" ></AllMonthpayAccountPicker>
|
||
</el-form-item>
|
||
<el-form-item label="付款方式" prop="params.paymentType" >
|
||
<el-select clearable v-model="queryParams.params.paymentType" placeholder="请选择">
|
||
<el-option
|
||
v-for="dict in dict.type.emis_payment_type"
|
||
:key="dict.value"
|
||
:label="dict.label"
|
||
:value="dict.value"
|
||
></el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="寄件公司" prop="params.sendCompany">
|
||
<el-input
|
||
v-model="queryParams.params.sendCompany"
|
||
:placeholder="$t('寄件公司')"
|
||
clearable
|
||
/>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="收件公司" prop="params.receiveCompany">
|
||
<el-input
|
||
v-model="queryParams.params.receiveCompany"
|
||
:placeholder="$t('收件公司')"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
|
||
|
||
<el-form-item label="批次状态" prop="params.batchStatus" label-width="120px">
|
||
<el-select clearable v-model="queryParams.params.batchStatus" placeholder="请选择">
|
||
<el-option :key="1" label="已完成" value="1">已完成</el-option>
|
||
<el-option :key="2" label="未完成" value="2">未完成</el-option>
|
||
<el-option :key="3" label="部分完成" value="3">部分完成</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item label="成本状态" prop="params.costStatus" label-width="120px">
|
||
<el-select clearable v-model="queryParams.params.costStatus" placeholder="请选择">
|
||
<el-option :key="1" label="已完成" value="1">已完成</el-option>
|
||
<el-option :key="2" label="未完成" value="2">未完成</el-option>
|
||
<el-option :key="3" label="部分完成" value="3">部分完成</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
</SearchForm>
|
||
<XdTable
|
||
|
||
slot="pageContent"
|
||
slot-scope="slotProps"
|
||
:height="(slotProps.contentHeight)+'px'"
|
||
|
||
v-loading="loading"
|
||
border stripe
|
||
|
||
ref="refTable"
|
||
|
||
size="small"
|
||
:data="emisTmsCostProfitList"
|
||
|
||
storageName="emisTmsCostProfitList_main2"
|
||
|
||
|
||
:showSearch.sync="showSearch"
|
||
:queryParams="queryParams"
|
||
:total="total"
|
||
@queryTable="getList"
|
||
@selection-change="handleSelectionChange"
|
||
@sort-change="handleSortChange"
|
||
@row-dblclick="handleShowTraceInfo"
|
||
>
|
||
|
||
<div slot="toolbar">
|
||
<el-row :gutter="10" class="mb8">
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="primary"
|
||
plain
|
||
size="mini"
|
||
:disabled="multiple"
|
||
@click="handleReCalcProfitByBillCode"
|
||
>利润重算</el-button>
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="primary"
|
||
plain
|
||
size="mini"
|
||
@click="handleBatchReCalc"
|
||
>批量重算</el-button>
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="danger"
|
||
plain
|
||
icon="el-icon-delete"
|
||
size="mini"
|
||
:disabled="multiple"
|
||
@click="handleDelete"
|
||
v-hasPermi="['emis:emisTmsCostFee:remove']"
|
||
>删除</el-button>
|
||
</el-col>
|
||
<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="center" prop="billCode" min-width="130" />
|
||
<!-- <el-table-column :label="$t('标准费')" align="center" prop="standardFee" min-width="100" /> -->
|
||
<el-table-column :label="$t('运单费用')" align="center" prop="billFee" min-width="110" :sortable="true"/>
|
||
<el-table-column :label="$t('运输成本')" align="center" prop="costFee" min-width="110" :sortable="true"/>
|
||
<el-table-column :label="$t('理赔金额')" align="center" prop="satisfyMoney" min-width="110" :sortable="true"/>
|
||
<el-table-column :label="$t('折让金额')" align="center" prop="allowanceMoney" min-width="110" :sortable="true"/>
|
||
<el-table-column :label="$t('抵扣金额')" align="center" prop="deductionMoney" min-width="110" :sortable="true"/>
|
||
<el-table-column :label="$t('其他金额')" align="center" prop="otherMoney" min-width="110" :sortable="true"/>
|
||
<el-table-column :label="$t('运单毛利润')" align="center" prop="billProfit" min-width="150" :sortable="true"/>
|
||
<!-- <el-table-column :label="$t('运单号')" align="center" prop="billCode" min-width="130" :sortable="true" /> -->
|
||
<el-table-column :label="$t('快件类型')" align="center" prop="kjlx" width="180" :show-overflow-tooltip="true">
|
||
<template slot-scope="scope">
|
||
<span>{{ scope.row.waybillDetail.sendSiteName }}--{{ scope.row.waybillDetail.dispatchUnderlingSiteName }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('支付类型')" align="center" prop="waybillDetail.paymentType" min-width="80" :show-overflow-tooltip="true" >
|
||
<template slot-scope="scope">
|
||
<dict-tag :options="dict.type.emis_payment_type" :value="scope.row.waybillDetail.paymentType" />
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('月结客户')" align="center" prop="waybillDetail.custName" min-width="150" :sortable="true" :show-overflow-tooltip="true">
|
||
<template slot-scope="scope">
|
||
<span v-if="['2','4','5'].includes(scope.row.waybillDetail.paymentType)" type="normal">{{ scope.row.waybillDetail.custName }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
<el-table-column :label="$t('特殊报价')" align="center" prop="waybillDetail.blSpecialQuote" width="80" :show-overflow-tooltip="true">
|
||
<template slot-scope="scope">
|
||
<span v-if="scope.row.waybillDetail.blSpecialQuote==1">是</span>
|
||
<span v-else>否</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('计费方式')" align="center" prop="waybillDetail.calcFeeType" width="80" :show-overflow-tooltip="true">
|
||
<template slot-scope="scope">
|
||
<dict-tag :options="dict.type.emis_calc_fee_type" :value="scope.row.waybillDetail.calcFeeType"/>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('寄件日期')" align="center" prop="waybillDetail.sendDate" min-width="170" :sortable="true" :show-overflow-tooltip="true"/>
|
||
<el-table-column :label="$t('寄件网点')" align="center" prop="waybillDetail.sendSiteName" min-width="150" :show-overflow-tooltip="true"/>
|
||
<el-table-column :label="$t('寄件公司')" align="center" prop="waybillDetail.sendCompany" min-width="150" :sortable="true" :show-overflow-tooltip="true"/>
|
||
<el-table-column :label="$t('线路')" align="center" prop="waybillDetail.transLineTypeName" min-width="80" :sortable="true" :show-overflow-tooltip="true"/>
|
||
<el-table-column :label="$t('产品类型')" align="center" prop="waybillDetail.productTypeName" min-width="120" :sortable="true" :show-overflow-tooltip="true">
|
||
<template slot-scope="scope">
|
||
<span >{{scope.row.waybillDetail.productTypeName}}({{scope.row.waybillDetail.timeType}})</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('寄件人')" align="center" prop="waybillDetail.sendName" min-width="80" :show-overflow-tooltip="true"/>
|
||
<el-table-column :label="$t('件数')" align="center" prop="waybillDetail.parcelQty" min-width="80" />
|
||
<el-table-column :label="$t('实际重量')" align="center" prop="waybillDetail.billWeight" min-width="80" />
|
||
<el-table-column :label="$t('体积')" align="center" prop="waybillDetail.totalVolume" min-width="80" />
|
||
<el-table-column :label="$t('体积重量')" align="center" prop="waybillDetail.volumeWeight" min-width="80" />
|
||
<el-table-column :label="$t('结算重量')" align="center" prop="waybillDetail.settlementWeight" min-width="120" :sortable="true" />
|
||
<el-table-column :label="$t('运费')" align="center" prop="waybillDetail.freight" min-width="80" >
|
||
<template slot-scope="scope">
|
||
<span style="color: red;font-weight: 500" v-if="scope.row.waybillDetail.realFee!=scope.row.waybillDetail.freight">{{scope.row.waybillDetail.freight}}</span>
|
||
<span v-else>{{scope.row.waybillDetail.freight}}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('是否特殊报价')" align="center" prop="blSpecialQuote" min-width="120" >
|
||
<template slot-scope="scope">
|
||
<span v-if="scope.row.waybillDetail.blSpecialQuote=='0'" >否</span>
|
||
<el-tag v-if="scope.row.waybillDetail.blSpecialQuote=='1'" type="error">是</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
<el-table-column :label="$t('标准报价')" align="center" prop="waybillDetail.realFee" min-width="80" />
|
||
<el-table-column :label="$t('费用备注')" align="center" prop="waybillDetail.feeRemark" min-width="80" :show-overflow-tooltip="true" />
|
||
|
||
<el-table-column :label="$t('录单备注')" align="center" prop="waybillDetail.remark" min-width="80" :show-overflow-tooltip="true" />
|
||
<el-table-column :label="$t('回款联系人')" align="center" prop="waybillDetail.payee" min-width="120" :sortable="true" />
|
||
<el-table-column :label="$t('销售联系人')" align="center" prop="waybillDetail.salesmen" min-width="120" :sortable="true" />
|
||
<!-- <el-table-column :label="$t('是否定制账单')" align="center" prop="blMerge" min-width="120" >
|
||
<template slot-scope="scope">
|
||
<span v-if="scope.row.blMerge=='0'" >否</span>
|
||
<el-tag v-if="scope.row.blMerge=='1'" type="success">是</el-tag>
|
||
</template>
|
||
</el-table-column> -->
|
||
<el-table-column :label="$t('问题件')" align="center" prop="waybillDetail.blIsQuestion" min-width="150" >
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="scope.row.waybillDetail.blIsQuestion==1" type="danger">是</el-tag>
|
||
<span v-else >/</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('问题件类型')" align="center" prop="waybillDetail.problemTypeName" width="150" :show-overflow-tooltip="true" :sortable="true" />
|
||
<el-table-column :label="$t('问题件原因')" align="center" prop="waybillDetail.problemCause" width="150" :show-overflow-tooltip="true" />
|
||
<el-table-column :label="$t('批次状态')" align="center" prop="batchStatus" width="150" :show-overflow-tooltip="true" >
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="scope.row.batchStatus=='1'" type="success">已完成</el-tag>
|
||
<el-tag v-if="scope.row.batchStatus=='2'" type="info">未完成</el-tag>
|
||
<el-tag v-if="scope.row.batchStatus=='3'" type="warning">部分完成</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('成本状态')" align="center" prop="costStatus" width="150" :show-overflow-tooltip="true" >
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="scope.row.costStatus=='1'" type="success">已完成</el-tag>
|
||
<el-tag v-if="scope.row.costStatus=='2'" type="info">未完成</el-tag>
|
||
<el-tag v-if="scope.row.costStatus=='3'" type="warning">部分完成</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
</XdTable>
|
||
|
||
<el-dialog :title="openTraceInfoTitle" :visible.sync="openTraceInfo" width="95%" :close-on-click-modal="false" :destroy-on-close="true" v-dialogDrag append-to-body>
|
||
<TmsCostProfitDetail :key="currentId" :id="currentId" ></TmsCostProfitDetail>
|
||
</el-dialog>
|
||
|
||
<el-dialog :loading="isDoing" :title="titleBatch" :visible.sync="openBatch" width="50%" v-dialogDrag :close-on-click-modal="false" append-to-body>
|
||
<el-form ref="formBatch" size="mini" label-width="60px">
|
||
<el-row>
|
||
<el-col :span="24">
|
||
<el-form-item :label="$t('运单号')" prop="batchBillList">
|
||
<el-input v-model="batchBillList" type="textarea" :rows="8" placeholder="运单号" />
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
</el-form>
|
||
<!-- :loading="isDoing" -->
|
||
<div slot="footer" class="dialog-footer" style="text-align:center">
|
||
<el-button type="primary" :loading="isDoing" @click="doReCalcBatch">确定</el-button>
|
||
<el-button @click="openBatch=false">关闭</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
|
||
</XdPageContainer>
|
||
</template>
|
||
|
||
<script>
|
||
import { listEmisTmsCostProfit, getEmisTmsCostProfit, delEmisTmsCostProfit, addEmisTmsCostProfit, updateEmisTmsCostProfit } from "@/api/emis/emisTmsCostProfit";
|
||
import { reCalcSplitCostFeeByBillCode } from "@/api/emis/emisTmsCostFee";
|
||
|
||
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
|
||
|
||
import CountryPicker1 from '@/views/emis/EmisBaseTools/CountryPicker.vue';
|
||
import CountryPicker2 from '@/views/emis/EmisBaseTools/CountryPicker.vue';
|
||
import ProvincePicker2 from '@/views/emis/EmisBaseTools/ProvincePicker.vue';
|
||
|
||
import TransLinePicker from '@/views/emis/EmisBaseTools/TransLinePicker.vue';
|
||
import TransProductPicker from '@/views/emis/EmisBaseTools/TransProductPicker.vue';
|
||
|
||
import EmpNamePicker1 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
||
import EmpNamePicker2 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
||
|
||
import EmisUserSimplePicker0 from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
|
||
import EmisUserSimplePicker1 from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
|
||
import EmisUserSimplePicker2 from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
|
||
|
||
import EmisSiteSimplePicker1 from '@/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue';
|
||
import EmisSiteSimplePicker2 from '@/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue';
|
||
|
||
import ProblemTypeMultiplePicker from '@/views/emis/EmisBaseTools/ProblemTypeMultiplePicker.vue';
|
||
|
||
import AllMonthpayAccountPicker from '@/views/emis/EmisBaseTools/AllMonthpayAccountPicker.vue';
|
||
import TraceWaybillDetailView from '@/views/emis/customerService/traceWaybillDetailView.vue';
|
||
import TmsCostProfitDetail from '@/views/emis/emisTmsCostProfit/TmsCostProfitDetail.vue';
|
||
|
||
export default {
|
||
name: "EmisTmsCostProfit",
|
||
components: {
|
||
elDateAdvPicker,
|
||
CountryPicker1,
|
||
CountryPicker2,ProvincePicker2,
|
||
TransLinePicker,TransProductPicker,
|
||
EmpNamePicker1,
|
||
EmpNamePicker2,
|
||
EmisUserSimplePicker0,
|
||
EmisUserSimplePicker1,
|
||
EmisUserSimplePicker2,
|
||
|
||
EmisSiteSimplePicker1,
|
||
EmisSiteSimplePicker2,
|
||
ProblemTypeMultiplePicker,
|
||
|
||
TmsCostProfitDetail,
|
||
AllMonthpayAccountPicker
|
||
},
|
||
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: true,
|
||
isDoing:false,
|
||
// 选中数组
|
||
ids: [],
|
||
// 非单个禁用
|
||
single: true,
|
||
// 非多个禁用
|
||
multiple: true,
|
||
// 显示搜索条件
|
||
showSearch: true,
|
||
// 创建时间搜索
|
||
dateTimeRange:[],
|
||
// 总条数
|
||
total: 0,
|
||
// 运输运单利润统计表表格数据
|
||
emisTmsCostProfitList: [],
|
||
|
||
selectBillList:[],
|
||
|
||
currentId:null,
|
||
openForm: false,
|
||
titleForm: "",
|
||
|
||
openBatch:false,
|
||
titleBatch:null,
|
||
batchBillList:null,
|
||
|
||
openTraceInfoTitle:"",
|
||
openTraceInfo:false,
|
||
currentTraceBillCode:null,
|
||
currentTraceBillItem:null,
|
||
|
||
|
||
// 弹出展示层
|
||
id:null,
|
||
titleView:"",
|
||
openView: false,
|
||
// 更新网点时间范围
|
||
daterangeCreateTime: [],
|
||
// 更新网点时间范围
|
||
daterangeUpdateTime: [],
|
||
// 查询参数
|
||
queryParams: {
|
||
pageNum: 1,
|
||
pageSize: 20,
|
||
billCode: null,
|
||
standardFee: null,
|
||
billFee: null,
|
||
costFee: null,
|
||
billProfit: null,
|
||
remark: null,
|
||
delFlag: null,
|
||
params:{
|
||
batchStatus:null,
|
||
costStatus:null,
|
||
}
|
||
},
|
||
};
|
||
},
|
||
created() {
|
||
this.getList();
|
||
},
|
||
methods: {
|
||
/** 查询运输运单利润统计表列表 */
|
||
getList() {
|
||
this.loading = true;
|
||
listEmisTmsCostProfit(this.addDateRange(this.queryParams, this.dateTimeRange,"sendDate")).then(response => {
|
||
this.emisTmsCostProfitList = response.rows;
|
||
this.total = response.total;
|
||
this.loading = false;
|
||
});
|
||
},
|
||
handleShowTraceInfo(row){
|
||
this.openTraceInfoTitle="查看【"+row.billCode+"】";
|
||
// this.currentTraceBillCode=row.billCode;
|
||
// this.currentTraceBillItem=row.waybillDetail;
|
||
this.currentId=row.id;
|
||
this.openTraceInfo=true;
|
||
},
|
||
async handleReCalcProfitByBillCode(){
|
||
if(this.selectBillList&&this.selectBillList.length>0){
|
||
this.loading = true;
|
||
for(let i=0;i<this.selectBillList.length;i++){
|
||
let item=this.selectBillList[i];
|
||
let res=await reCalcSplitCostFeeByBillCode(item.billCode);
|
||
}
|
||
this.loading = false;
|
||
this.$modal.msgSuccess("重算成功");
|
||
}else{
|
||
this.$modal.msgError("请先选择数据");
|
||
}
|
||
},
|
||
handleBatchReCalc(){
|
||
this.batchBillList="";
|
||
this.titleBatch="请输入单号进行批量重算";
|
||
this.openBatch=true;
|
||
},
|
||
async doReCalcBatch(){
|
||
if(this.batchBillList==null || this.batchBillList==''){
|
||
this.$modal.msgError("请输入单号");
|
||
return;
|
||
}
|
||
|
||
let waitDoList=this.batchBillList.trim().split(/[;\;\,\,\n]/)||[];
|
||
if(waitDoList&&waitDoList.length>0){
|
||
this.loading = true;
|
||
this.isDoing=true;
|
||
for(let i=0;i<waitDoList.length;i++){
|
||
let item=waitDoList[i];
|
||
let res=await reCalcSplitCostFeeByBillCode(item);
|
||
}
|
||
this.loading = false;
|
||
this.isDoing=false;
|
||
this.$modal.msgSuccess("重算成功");
|
||
this.openBatch=true;
|
||
}
|
||
},
|
||
|
||
/** 搜索按钮操作 */
|
||
handleQuery() {
|
||
this.queryParams.pageNum = 1;
|
||
this.getList();
|
||
},
|
||
/** 重置按钮操作 */
|
||
resetQuery() {
|
||
this.resetForm("queryForm");
|
||
this.handleQuery();
|
||
},
|
||
// 多选框选中数据
|
||
handleSelectionChange(selection) {
|
||
this.selectBillList=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.emisTmsCostProfitList = this.emisTmsCostProfitList.sort(
|
||
this.sortFun(column.prop, column.order === 'ascending')
|
||
);
|
||
},
|
||
/** 新增按钮操作 */
|
||
handleAdd(row) {
|
||
this.currentId=null;
|
||
this.openForm= true;
|
||
this.titleForm = "新增";
|
||
},
|
||
handleShowMoreInput(){
|
||
this.moreInputVisible = !this.moreInputVisible;
|
||
},
|
||
/** 修改按钮操作 */
|
||
handleUpdate(row) {
|
||
this.currentId= row.id;
|
||
this.openForm = true;
|
||
this.titleForm = "修改";
|
||
},
|
||
handleView(row) {
|
||
this.id=row.id;
|
||
this.titleView="查看";
|
||
this.openView=true;
|
||
// this.router.push({ path: '/emis/emisTmsCostProfit/viewDetail', query: { id: row.id }})
|
||
},
|
||
handleFormChanged(){
|
||
this.openForm = false;
|
||
this.getList();
|
||
},
|
||
cancelForm(){
|
||
this.openForm = false;
|
||
},
|
||
/** 删除按钮操作 */
|
||
handleDelete(row) {
|
||
const ids = row.id || this.ids;
|
||
this.$modal.confirm('是否确认删除').then(function() {
|
||
return delEmisTmsCostProfit(ids);
|
||
}).then(() => {
|
||
this.getList();
|
||
this.$modal.msgSuccess("删除成功");
|
||
}).catch(() => {});
|
||
},
|
||
/** 导出按钮操作 */
|
||
handleExport() {
|
||
const loadingInstance = this.$loading({
|
||
text: '正在导出...'
|
||
})
|
||
|
||
if(this.selectBillList&&this.selectBillList.length>0){
|
||
this.exportData(this.selectBillList,loadingInstance);
|
||
}
|
||
else{
|
||
let qExportParam=this.deepClone(this.queryParams);
|
||
qExportParam.pageNum=1;
|
||
qExportParam.pageSize=200000;
|
||
qExportParam=this.addQueryParam(qExportParam, "blZExport","T");
|
||
listEmisTmsCostProfit(this.addDateRange(qExportParam, this.dateTimeRange,"sendDate")).then(response => {
|
||
if (response.code === 200) {
|
||
let rows=this.unzipToJson(response.rows[0]);
|
||
this.exportData(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['waybillDetail']['sendSiteName']+'--'+v['waybillDetail']['dispatchUnderlingSiteName'];
|
||
}
|
||
if (j === 'fjr') {
|
||
return v['sendName']+'--'+v['receiveName'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.sendSiteName') {
|
||
return v['waybillDetail']['sendSiteName'];
|
||
}
|
||
|
||
|
||
if (j === 'waybillDetail.sendDate') {
|
||
return v['waybillDetail']['sendDate'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.sendCompany') {
|
||
return v['waybillDetail']['sendCompany'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.transLineTypeName') {
|
||
return v['waybillDetail']['transLineTypeName'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.productTypeName') {
|
||
return v['waybillDetail']['productTypeName'];
|
||
}
|
||
|
||
|
||
if (j === 'waybillDetail.sendName') {
|
||
return v['waybillDetail']['sendName'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.parcelQty') {
|
||
return v['waybillDetail']['parcelQty'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.billWeight') {
|
||
return v['waybillDetail']['billWeight'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.volumeWeight') {
|
||
return v['waybillDetail']['volumeWeight'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.totalVolume') {
|
||
return v['waybillDetail']['totalVolume'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.settlementWeight') {
|
||
return v['waybillDetail']['settlementWeight'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.freight') {
|
||
return v['waybillDetail']['freight'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.realFee') {
|
||
return v['waybillDetail']['realFee'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.remark') {
|
||
return v['waybillDetail']['remark'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.feeRemark') {
|
||
return v['waybillDetail']['feeRemark'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.salesmen') {
|
||
return v['waybillDetail']['salesmen'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.payee') {
|
||
return v['waybillDetail']['payee'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.payee') {
|
||
return v['waybillDetail']['payee'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.problemTypeName') {
|
||
return v['waybillDetail']['problemTypeName'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.problemCause') {
|
||
return v['waybillDetail']['problemCause'];
|
||
}
|
||
|
||
if (j === 'waybillDetail.custName') {
|
||
let paymentType=v['waybillDetail']['paymentType']
|
||
if(['2','4','5'].includes(paymentType)){
|
||
return v['waybillDetail']['custName'];
|
||
}
|
||
else{
|
||
return '';
|
||
}
|
||
}
|
||
|
||
|
||
if (j === 'waybillDetail.sendMobile') {
|
||
return "";
|
||
}
|
||
|
||
|
||
|
||
if (j === 'waybillDetail.calcFeeType') {
|
||
return this.selectDictLabel(this.dict.type.emis_calc_fee_type,v['waybillDetail']['calcFeeType']);
|
||
}
|
||
|
||
if (j === 'waybillDetail.paymentStatus') {
|
||
return this.selectDictLabel(this.dict.type.emis_payment_status,v['waybillDetail']['paymentStatus']);
|
||
}
|
||
|
||
if (j === 'waybillDetail.pickupMethod') {
|
||
return this.selectDictLabel(this.dict.type.emis_qujian_fangshi,v['waybillDetail']['pickupMethod']);
|
||
}
|
||
if (j === 'waybillDetail.customsEclaration') {
|
||
return this.selectDictLabel(this.dict.type.emis_declare_mode,v['waybillDetail']['customsEclaration']);
|
||
}
|
||
if (j === 'waybillDetail.customsClear') {
|
||
return this.selectDictLabel(this.dict.type.emis_customs_clear,v['waybillDetail']['customsClear']);
|
||
}
|
||
if (j === 'waybillDetail.packType') {
|
||
return this.selectDictLabels(this.dict.type.emis_tab_packing_type,v['waybillDetail']['packType']);
|
||
}
|
||
|
||
if (j === 'waybillDetail.blSpecialQuote') {
|
||
if(v['waybillDetail']['blSpecialQuote'] == 1){
|
||
return '是';
|
||
}else{
|
||
return '否';
|
||
}
|
||
}
|
||
|
||
if (j === 'waybillDetail.dispatchMethod') {
|
||
if(v['waybillDetail']['dispatchMethod'] == 1){
|
||
return '派送';
|
||
}else{
|
||
return '自提';
|
||
}
|
||
}
|
||
|
||
|
||
if (j === 'paymentStatus') {
|
||
if(v['paymentStatus'] == 0){
|
||
return '未收款';
|
||
}
|
||
else if(v['paymentStatus'] == 1){
|
||
return '已收款';
|
||
}
|
||
else if(v['paymentStatus'] == 2){
|
||
return '部分收款';
|
||
}
|
||
}
|
||
|
||
if (j === 'openBillStatus') {
|
||
if(v['openBillStatus'] == 0){
|
||
return '未开票';
|
||
}
|
||
else if(v['openBillStatus'] == 1){
|
||
return '已开票';
|
||
}
|
||
else if(v['openBillStatus'] == 2){
|
||
return '部分开票';
|
||
}
|
||
else if(v['openBillStatus'] == 3){
|
||
return '不开票';
|
||
}
|
||
else if(v['openBillStatus'] == 4){
|
||
return '已完成';
|
||
}
|
||
}
|
||
|
||
if (j === 'blSpecialQuote') {
|
||
if(v['blSpecialQuote'] == 0){
|
||
return '否';
|
||
}
|
||
else if(v['paymentStatus'] == 1){
|
||
return '是';
|
||
}
|
||
}
|
||
|
||
if (j === 'blMerge') {
|
||
if(v['blMerge'] == 0){
|
||
return '否';
|
||
}
|
||
else if(v['blMerge'] == 1){
|
||
return '是';
|
||
}
|
||
}
|
||
|
||
|
||
if (j === 'blConfirmCenter') {
|
||
if(v['blConfirmCenter'] == 0){
|
||
return '未确认';
|
||
}
|
||
else if(v['blConfirmCenter'] == 1){
|
||
return '已确认';
|
||
}
|
||
else if(v['blConfirmCenter'] == 2){
|
||
return '确认不出账';
|
||
}
|
||
else if(v['blConfirmCenter'] == 3){
|
||
return '账单异常';
|
||
}
|
||
}
|
||
|
||
if (j === 'blConfirmSite') {
|
||
if(v['blConfirmSite'] == 0){
|
||
return '未确认';
|
||
}
|
||
else if(v['blConfirmSite'] == 1){
|
||
return '已确认';
|
||
}
|
||
else if(v['blConfirmSite'] == 2){
|
||
return '确认不出账';
|
||
}
|
||
else if(v['blConfirmSite'] == 3){
|
||
return '账单异常';
|
||
}
|
||
}
|
||
|
||
|
||
if (j === 'waybillDetail.blIsQuestion') {
|
||
if(v['waybillDetail']['blIsQuestion'] == 1){
|
||
return '是';
|
||
}else{
|
||
return '否';
|
||
}
|
||
}
|
||
|
||
if (j === 'waybillDetail.blMessage') {
|
||
if(v['waybillDetail']['blMessage'] == 1){
|
||
return '发送';
|
||
}else{
|
||
return '不发送';
|
||
}
|
||
}
|
||
if (j === 'waybillDetail.blAcceptMessage') {
|
||
if(v['waybillDetail']['blAcceptMessage'] == 1){
|
||
return '发送';
|
||
}else{
|
||
return '不发送';
|
||
}
|
||
}
|
||
if (j === 'waybillDetail.blSign') {
|
||
if(v['waybillDetail']['blSign'] == 1){
|
||
return '已签收';
|
||
}else{
|
||
return '未签收';
|
||
}
|
||
}
|
||
if (j === 'waybillDetail.paymentType') {
|
||
return this.selectDictLabel(this.dict.type.emis_payment_type,v['waybillDetail']['paymentType']);
|
||
}
|
||
if (j === 'batchStatus') {
|
||
if (v['batchStatus'] == '1') {
|
||
return '已完成';
|
||
}
|
||
else if (v['batchStatus'] == '2') {
|
||
return '未完成';
|
||
} else if (v['batchStatus'] === '3') {
|
||
return '部分完成';
|
||
}
|
||
}
|
||
if (j === 'costStatus') {
|
||
if (v['costStatus'] == '1') {
|
||
return '已完成';
|
||
}
|
||
else if (v['costStatus'] == '2') {
|
||
return '未完成';
|
||
} else if (v['costStatus'] === '3') {
|
||
return '部分完成';
|
||
}
|
||
}
|
||
return v[j]
|
||
}))
|
||
},
|
||
//指定列求和
|
||
getSummaries(param) {
|
||
const { columns, data } = param;
|
||
// console.log("===>getSummaries==>",param)
|
||
const sums = [];
|
||
columns.forEach((column, index) => {
|
||
if (index === 0) {
|
||
sums[index] = '合计';
|
||
return;
|
||
}
|
||
|
||
|
||
if (
|
||
column.property === 'billFee'
|
||
) {
|
||
const values = data.map(item => Number(item.billFee));
|
||
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 === 'costFee'
|
||
) {
|
||
const values = data.map(item => Number(item.costFee));
|
||
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 === 'billProfit'
|
||
) {
|
||
const values = data.map(item => Number(item.billProfit));
|
||
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
|
||
},
|
||
/** 列索引函数 */
|
||
getIndex($index) {
|
||
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
||
},
|
||
/** 时间搜索响应函数 */
|
||
dateTimeChange(value){
|
||
this.dateTimeRange=value;
|
||
},
|
||
}
|
||
};
|
||
</script>
|
||
|
||
<style scoped>
|
||
.el-divider{
|
||
margin-top: 0px;
|
||
background: 0 0;
|
||
border-top: 1px solid #E6EBF5;
|
||
}
|
||
.el-divider__text {
|
||
color: #0955ee;
|
||
cursor: pointer;
|
||
}
|
||
</style>
|