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' method: 'delete'
}) })
} }
// 按月份重新计算运单利润
export function reCalcCostFeeByBillMonth(billMonth) {
return request({
url: '/emis/common/reCalcCostFeeByBillMonth',
method: 'get',
params:{
billMonth:billMonth
}
})
}

View File

@ -275,6 +275,19 @@
<el-form ref="formBatch" size="mini" label-width="60px"> <el-form ref="formBatch" size="mini" label-width="60px">
<el-row> <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-form-item :label="$t('运单号')" prop="batchBillList">
<el-input v-model="batchBillList" type="textarea" :rows="8" placeholder="运单号" /> <el-input v-model="batchBillList" type="textarea" :rows="8" placeholder="运单号" />
</el-form-item> </el-form-item>
@ -293,7 +306,7 @@
<script> <script>
import { listEmisTmsCostProfit, getEmisTmsCostProfit, delEmisTmsCostProfit, addEmisTmsCostProfit, updateEmisTmsCostProfit } from "@/api/emis/emisTmsCostProfit"; 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'; import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
@ -404,6 +417,12 @@ export default {
costStatus:null, costStatus:null,
} }
}, },
// 批量重算参数
formBatch: {
calcType: '1',
billMonth: null,
batchBillList: null,
},
}; };
}, },
created() { created() {
@ -444,24 +463,38 @@ export default {
this.titleBatch="请输入单号进行批量重算"; this.titleBatch="请输入单号进行批量重算";
this.openBatch=true; this.openBatch=true;
}, },
async doReCalcBatch(){ async doReCalcBatch() {
if(this.batchBillList==null || this.batchBillList==''){ if (this.formBatch.calcType == 1) {
if (this.batchBillList == null || this.batchBillList == '') {
this.$modal.msgError("请输入单号"); this.$modal.msgError("请输入单号");
return; return;
} }
let waitDoList=this.batchBillList.trim().split(/[;\;\,\,\n]/)||[]; let waitDoList = this.batchBillList.trim().split(/[;\;\,\,\n]/) || [];
if(waitDoList&&waitDoList.length>0){ if (waitDoList && waitDoList.length > 0) {
this.loading = true; this.loading = true;
this.isDoing=true; this.isDoing = true;
for(let i=0;i<waitDoList.length;i++){ for (let i = 0; i < waitDoList.length; i++) {
let item=waitDoList[i]; let item = waitDoList[i];
let res=await reCalcSplitCostFeeByBillCode(item); let res = await reCalcSplitCostFeeByBillCode(item);
} }
this.loading = false; this.loading = false;
this.isDoing=false; this.isDoing = false;
this.$modal.msgSuccess("重算成功"); 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();
});
} }
}, },