Merge pull request '运单利润按月批量重算' (#198) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-frontend/pulls/198
This commit is contained in:
wuteng 2026-01-28 16:58:07 +08:00
commit fc57c895a7
2 changed files with 56 additions and 12 deletions

View File

@ -73,3 +73,14 @@ export function delEmisTmsCostFee(id) {
method: 'delete'
})
}
// 按月份重新计算运单利润
export function reCalcCostFeeByBillMonth(billMonth) {
return request({
url: '/emis/common/reCalcCostFeeByBillMonth',
method: 'get',
params:{
billMonth:billMonth
}
})
}

View File

@ -274,7 +274,20 @@
<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-col :span="24">
<el-form-item :label="$t('计算类型')" prop="calcType">
<el-radio-group v-model="formBatch.calcType">
<el-radio label="1" key="1">按单号</el-radio>
<el-radio label="2" key="2">按月份</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8" v-if="formBatch.calcType==2">
<el-form-item label="寄件月份" prop="billMonth">
<el-date-picker style="width:100%" v-model="formBatch.billMonth" type="month" placeholder="月份" value-format="yyyy-MM"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" v-if="formBatch.calcType==1">
<el-form-item :label="$t('运单号')" prop="batchBillList">
<el-input v-model="batchBillList" type="textarea" :rows="8" placeholder="运单号" />
</el-form-item>
@ -293,7 +306,7 @@
<script>
import { listEmisTmsCostProfit, getEmisTmsCostProfit, delEmisTmsCostProfit, addEmisTmsCostProfit, updateEmisTmsCostProfit } from "@/api/emis/emisTmsCostProfit";
import { reCalcSplitCostFeeByBillCode } from "@/api/emis/emisTmsCostFee";
import { reCalcSplitCostFeeByBillCode, reCalcCostFeeByBillMonth } from "@/api/emis/emisTmsCostFee";
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
@ -404,6 +417,12 @@ export default {
costStatus:null,
}
},
// 批量重算参数
formBatch: {
calcType: '1',
billMonth: null,
batchBillList: null,
},
};
},
created() {
@ -444,25 +463,39 @@ export default {
this.titleBatch="请输入单号进行批量重算";
this.openBatch=true;
},
async doReCalcBatch(){
if(this.batchBillList==null || this.batchBillList==''){
async doReCalcBatch() {
if (this.formBatch.calcType == 1) {
if (this.batchBillList == null || this.batchBillList == '') {
this.$modal.msgError("请输入单号");
return;
}
let waitDoList=this.batchBillList.trim().split(/[;\;\,\,\n]/)||[];
if(waitDoList&&waitDoList.length>0){
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.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.isDoing = false;
this.$modal.msgSuccess("重算成功");
this.openBatch=true;
this.openBatch = true;
}
} else if (this.formBatch.calcType == 2) {
if (this.formBatch.billMonth == null || this.formBatch.billMonth == '') {
this.$modal.msgError("请选择月份");
return;
}
this.loading = true;
let res = await reCalcCostFeeByBillMonth(this.formBatch.billMonth).then(response => {
this.loading = false;
this.openBatch = false;
this.getList();
});
}
},
/** 搜索按钮操作 */