This commit is contained in:
linfso 2025-03-16 11:35:38 +08:00
parent b5a7ff4830
commit fdaee0d06b

View File

@ -0,0 +1,615 @@
<template>
<XdPageContainer class="app-container">
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="small" :maxShow="20" label-width="68px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
<el-form-item label="运单号" prop="billCode">
<el-input
type="textarea"
rows="2"
v-model="queryParams.billCode"
:placeholder="$t('运单号')"
clearable
/>
</el-form-item>
<el-form-item label="提成类型" prop="feeType">
<el-select v-model="queryParams.feeType" placeholder="提成费用类型" clearable filterable >
<el-option
v-for="item in dict.type.emis_commission_fee_type"
v-bind:key="item.value"
v-bind:label="item.label"
v-bind:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="账单月份" prop="billMonth">
<el-date-picker size="mini" style="width:100%" v-model="queryParams.billMonth" type="month" placeholder="账单月份" value-format="yyyy-MM"></el-date-picker>
</el-form-item>
<!-- <el-form-item label="" prop="empCode">
<el-input
v-model="queryParams.empCode"
:placeholder="$t('员工编号')"
clearable
/>
</el-form-item> -->
<el-form-item label="员工名称" prop="empName">
<PayeePicker :placeholder="$t('提成员工')" v-model="queryParams.empName" ></PayeePicker>
</el-form-item>
</SearchForm>
<XdTable
slot="pageContent"
slot-scope="slotProps"
:height="(slotProps.contentHeight)+'px'"
v-loading="loading"
border stripe
size="mini"
:data="emisCommissionDtlList"
:showSearch.sync="showSearch"
ref="refTable"
storageName="emisCommissionDtl_main_240702"
:queryParams="queryParams"
:total="total"
@queryTable="getList"
@selection-change="handleSelectionChange"
@sort-change="handleSortChange"
>
<div slot="toolbar">
<el-row :gutter="10" class="mb8">
<!--
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
@click="handleBatchReCalc"
v-hasPermi="['emis:emisCommissionDtl:add']"
>批量重算</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="empName" min-width="120" >
<template slot-scope="scope">
<span>{{ scope.row.empName }}</span>
</template>
</el-table-column>
<!-- <span>{{ scope.row.empName }}</span><span v-if="scope.row.empCode!=-1">({{ scope.row.empCode }})</span> -->
<!-- <el-table-column :label="$t('员工编号')" align="center" prop="empCode" min-width="100" /> -->
<el-table-column :label="$t('月份')" align="center" prop="billMonth" min-width="100" />
<el-table-column :label="$t('提成类型')" align="center" prop="feeType" min-width="120" >
<template slot-scope="scope">
<dict-tag :options="dict.type.emis_commission_fee_type" :value="scope.row.feeType"/>
</template>
</el-table-column>
<el-table-column :label="$t('提成金额')" align="center" prop="money" min-width="100" />
<el-table-column :label="$t('提成配置名称')" align="center" prop="quoteName" min-width="130" :show-overflow-tooltip="true"/>
<!-- <el-table-column :label="$t('计算表达式')" align="center" prop="calcExpr" min-width="100" :show-overflow-tooltip="true"/> -->
<el-table-column :label="$t('提成备注')" align="center" prop="feeRemark" min-width="100" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('批次号')" align="center" prop="billCode" min-width="130" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('批次名称')" align="center" prop="batchDetail.batchName" min-width="130" :show-overflow-tooltip="true" />
<el-table-column :label="$t('批次类型')" align="center" prop="batchDetail.batchType" min-width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.emis_big_batch_type" :value="scope.row.batchDetail.batchType"/>
</template>
</el-table-column>
<el-table-column :label="$t('运输方式')" align="center" prop="batchDetail.transType" min-width="80">
<template slot-scope="scope">
<dict-tag :options="dict.type.emis_biz_shipping_method" :value="scope.row.batchDetail.transType"/>
</template>
</el-table-column>
<el-table-column :label="$t('运输号')" align="center" prop="batchDetail.carNo" min-width="170">
<template slot-scope="scope">
{{scope.row.batchDetail.carNo}}
</template>
</el-table-column>
<el-table-column :label="$t('承运重量')" align="center" prop="batchDetail.transWeight" min-width="100" />
<el-table-column :label="$t('包裹数')" align="center" prop="batchDetail.packNum" min-width="100" />
<el-table-column :label="$t('发出时间')" align="center" prop="batchDetail.etd" min-width="100" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.batchDetail.etd, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('起始网点')" align="center" prop="batchDetail.startSiteName" min-width="150" />
<el-table-column :label="$t('下一网点')" align="center" prop="batchDetail.nextSiteName" min-width="150" />
<el-table-column :label="$t('目的国家')" align="center" prop="batchDetail.destCountryName" min-width="100"/>
<el-table-column :label="$t('供应商')" align="center" prop="batchDetail.supplierName" min-width="150"/>
<el-table-column :label="$t('总票数')" align="center" prop="batchDetail.totalWaybillQty" min-width="100" />
<el-table-column :label="$t('总件数')" align="center" prop="batchDetail.totalParcelQty" min-width="100" />
<el-table-column :label="$t('总重量(kg)')" align="center" prop="batchDetail.totalWeight" min-width="100" />
<el-table-column :label="$t('创建日期')" align="center" prop="createTime" min-width="170" />
</XdTable>
<el-dialog :title="titleForm" :visible.sync="openForm" width="50%" :destroy-on-close="true" v-dialogDrag append-to-body>
<emisCommissionDtlForm :id="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisCommissionDtlForm>
</el-dialog>
<el-dialog :title="titleBatch" :visible.sync="openBatch" width="50%" v-dialogDrag :close-on-click-modal="false" append-to-body>
<el-form ref="formBatch" :model="formBatch" size="mini" label-width="60px">
<el-row>
<el-col :span="24">
<el-form-item :label="$t('批次号')" prop="billCode">
<el-input v-model="formBatch.billCode" type="textarea" :rows="8" placeholder="运单号" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align:center">
<el-button type="primary" @click="submitFormBatch">确 定</el-button>
<el-button @click="cancelBatch">取 消</el-button>
</div>
</el-dialog>
</XdPageContainer>
</template>
<script>
import { batchReCalcProfitByBillCode } from "@/api/emis/emisCommissionProfit";
import PayeePicker from '@/views/emis/EmisBaseTools/PayeePicker.vue';
import { listBatchEmisCommissionDtl, getEmisCommissionDtl, delEmisCommissionDtl, addEmisCommissionDtl, updateEmisCommissionDtl } from "@/api/emis/emisCommissionDtl";
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
import emisCommissionDtlForm from '@/views/emis/emisCommissionDtl/emisCommissionDtlForm';
import EmisUserSimplePicker0 from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
export default {
name: "BatchCommissionDtlList",
components: { elDateSimplePicker,emisCommissionDtlForm,EmisUserSimplePicker0,PayeePicker },
dicts: ['emis_commission_fee_type','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,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 创建时间搜索
dateTimeRange:[],
// 总条数
total: 0,
// 员工提成明细表表格数据
emisCommissionDtlList: [],
selectBillList:[],
currentId:null,
openForm: false,
titleForm: "",
titleBatch:"",
openBatch: false,
// 弹出展示层
id:null,
titleView:"",
openView: false,
// 更新站点时间范围
daterangeConfirmCenterDate: [],
// 更新站点时间范围
daterangeConfirmSiteDate: [],
// 更新站点时间范围
daterangeCreateTime: [],
// 更新站点时间范围
daterangeUpdateTime: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
feeType: null,
money: null,
billMonth: null,
billType:"1",
billCode: null,
feeRemark: null,
empCode: null,
empCodeTmp: null,
empName: null,
blConfirmCenter: null,
confirmCenterDate: null,
confirmCenterNote: null,
confirmCenterManCode: null,
confirmCenterCode: null,
blConfirmSite: null,
confirmSiteDate: null,
confirmSiteManCode: null,
confirmSiteNote: null,
confirmSiteCode: null,
remark: null,
delFlag: null,
},
formBatch:{
billCode:null,
}
};
},
created() {
this.getList();
},
methods: {
/** 查询批次提成明细表列表 */
getList() {
this.loading = true;
listBatchEmisCommissionDtl(this.queryParams).then(response => {
this.emisCommissionDtlList = response.rows;
this.total = response.total;
this.loading = false;
});
},
onSelectUser(item){
this.queryParams.empCode=null;
this.queryParams.empName=item.empName;
},
/** 搜索按钮操作 */
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.emisCommissionDtlList = this.emisCommissionDtlList.sort(
this.sortFun(column.prop, column.order === 'ascending')
);
},
/** 新增按钮操作 */
handleAdd(row) {
this.currentId=null;
this.openForm= true;
this.titleForm = "新增";
},
handleShowMoreInput(){
this.moreInputVisible = !this.moreInputVisible;
},
handleBatchReCalc(){
this.formBatch.billCode=null;
this.titleBatch="批量重算";
this.openBatch=true;
},
cancelBatch(){
this.openBatch=false;
},
async submitFormBatch(){
if(this.formBatch.billCode==null || this.formBatch.billCode==''){
this.$modal.msgError("输入单号后回车");
return;
}
this.loading = true;
let res=await batchReCalcProfitByBillCode(this.formBatch.billCode);
this.loading = false;
this.openBatch=false;
this.getList();
},
/** 修改按钮操作 */
handleUpdate(row) {
this.currentId= row.id||this.ids;
this.openForm = true;
this.titleForm = "修改";
},
handleView(row) {
this.id=row.id;
this.titleView="查看";
this.openView=true;
// this.router.push({ path: '/emis/emisCommissionDtl/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 delEmisCommissionDtl(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.queryParams};
qExportParam.pageNum=1;
qExportParam.pageSize=10000;
listBatchEmisCommissionDtl(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 => {
console.log("===>1111===>",v);
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.sendCountryName') {
return v['waybillDetail']['sendCountryName'];
}
if (j === 'waybillDetail.receiveCountryName') {
return v['waybillDetail']['receiveCountryName'];
}
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.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.dispatchMethod') {
if(v['waybillDetail']['dispatchMethod'] == 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']);
}
return v[j]
}))
},
/** 列索引函数 */
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>