This commit is contained in:
linfso 2025-03-16 20:51:17 +08:00
parent 196937a7b1
commit f4b4b56850
3 changed files with 131 additions and 26 deletions

View File

@ -45,10 +45,41 @@ export function delEmisCommissionProfit(id) {
// 批量计算员工提成
export function batchReCalcProfitByBillCode(billCode) {
export function reCalcByBillCode(billCode) {
return request({
url: '/emis/emisCommissionProfit/batchReCalcProfitByBillCode',
url: '/emis/emisCommissionProfit/reCalcByBillCode',
method: 'get',
params: {billCode: billCode},
})
}
// 按发货月份计算提成
export function reCalcByBillMonth(billMonth) {
return request({
url: '/emis/emisCommissionProfit/reCalcByBillMonth',
method: 'get',
params: {billMonth: billMonth},
})
}
// 按批次号计算提成
export function reCalcByBatchNo(batchNo) {
return request({
url: '/emis/emisCommissionProfit/reCalcByBatchNo',
method: 'get',
params: {batchNo: batchNo},
})
}
// 按批次月份计算提成
export function reCalcByBatchMonth(billMonth) {
return request({
url: '/emis/emisCommissionProfit/reCalcByBatchMonth',
method: 'get',
params: {billMonth: billMonth},
})
}

View File

@ -150,13 +150,27 @@
</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-form ref="formBatch" :model="formBatch" size="mini" label-width="100px">
<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 :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="billCode">
<el-input v-model="formBatch.batchNo" type="textarea" :rows="8" placeholder="批次号" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align:center">
@ -169,7 +183,7 @@
</template>
<script>
import { batchReCalcProfitByBillCode } from "@/api/emis/emisCommissionProfit";
import { reCalcByBatchNo,reCalcByBatchMonth } from "@/api/emis/emisCommissionProfit";
import EmpNamePicker from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
import { listBatchEmisCommissionDtl, getEmisCommissionDtl, delEmisCommissionDtl, addEmisCommissionDtl, updateEmisCommissionDtl } from "@/api/emis/emisCommissionDtl";
@ -251,7 +265,9 @@ export default {
delFlag: null,
},
formBatch:{
billCode:null,
batchNo:null,
calcType:null,
billMonth:null
}
};
},
@ -341,16 +357,34 @@ export default {
this.openBatch=false;
},
async submitFormBatch(){
if(this.formBatch.billCode==null || this.formBatch.billCode==''){
this.$modal.msgError("输入单号后回车");
return;
}
if(this.formBatch.calcType==1){
if(this.formBatch.batchNo==null || this.formBatch.batchNo==''){
this.$modal.msgError("批次号不能为空");
return;
}
this.loading = true;
let res=await batchReCalcProfitByBillCode(this.formBatch.billCode);
this.loading = false;
this.openBatch=false;
this.getList();
this.loading = true;
reCalcByBatchNo(this.formBatch.batchNo).then(response => {
this.loading = false;
this.openBatch=false;
this.getList();
});
}
else if(this.formBatch.calcType==2){
if(this.formBatch.billMonth==null || this.formBatch.billMonth==''){
this.$modal.msgError("月份不能为空");
return;
}
this.loading = true;
reCalcByBatchMonth(this.formBatch.billMonth).then(response => {
this.loading = false;
this.openBatch=false;
this.getList();
});
}
},
/** 修改按钮操作 */

View File

@ -213,13 +213,27 @@
</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-form ref="formBatch" :model="formBatch" size="mini" label-width="100px">
<el-row>
<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="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">
@ -232,7 +246,7 @@
</template>
<script>
import { batchReCalcProfitByBillCode } from "@/api/emis/emisCommissionProfit";
import { reCalcByBillCode,reCalcByBillMonth } from "@/api/emis/emisCommissionProfit";
import EmpNamePicker from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
@ -317,10 +331,14 @@ export default {
},
formBatch:{
billCode:null,
calcType:null,
billMonth:null
}
};
},
created() {
this.formBatch.calcType='1';
this.getList();
},
methods: {
@ -406,16 +424,38 @@ export default {
this.openBatch=false;
},
async submitFormBatch(){
if(this.formBatch.billCode==null || this.formBatch.billCode==''){
this.$modal.msgError("输入单号后回车");
return;
if(this.formBatch.calcType==1){
if(this.formBatch.billCode==null || this.formBatch.billCode==''){
this.$modal.msgError("单号不能为空");
return;
}
this.loading = true;
reCalcByBillCode(this.formBatch.billCode).then(response => {
this.loading = false;
this.openBatch=false;
this.getList();
});
}
else if(this.formBatch.calcType==2){
if(this.formBatch.billMonth==null || this.formBatch.billMonth==''){
this.$modal.msgError("月份不能为空");
return;
}
this.loading = true;
reCalcByBillMonth(this.formBatch.billMonth).then(response => {
this.loading = false;
this.openBatch=false;
this.getList();
});
}
this.loading = true;
let res=await batchReCalcProfitByBillCode(this.formBatch.billCode);
this.loading = false;
this.openBatch=false;
this.getList();
},
/** 修改按钮操作 */