|
@@ -5,14 +5,15 @@
|
|
|
<el-form :inline="true" :model="queryForm">
|
|
|
<el-form-item label="年份">
|
|
|
<el-date-picker
|
|
|
- v-model="queryForm.aa"
|
|
|
+ v-model="queryForm.time"
|
|
|
type="year"
|
|
|
placeholder="请选择"
|
|
|
+ @change="onQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="业务员">
|
|
|
<el-select
|
|
|
- v-model="queryForm.countryId"
|
|
|
+ v-model="queryForm.userId"
|
|
|
placeholder="请选择"
|
|
|
@change="onQuery"
|
|
|
>
|
|
@@ -97,44 +98,34 @@
|
|
|
/>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="提成">
|
|
|
- <el-table-column label="售后" prop="totalIncome" width="120" />
|
|
|
- <el-table-column label="公共" prop="totalExpenses" width="120" />
|
|
|
- <el-table-column label="总办" prop="grossProfit" width="120" />
|
|
|
+ <el-table-column label="售后" prop="afterSalesAmount" width="120" />
|
|
|
+ <el-table-column label="公共" prop="publicAmount" width="120" />
|
|
|
+ <el-table-column
|
|
|
+ label="总办"
|
|
|
+ prop="haveOverallAmount"
|
|
|
+ width="120"
|
|
|
+ />
|
|
|
<el-table-column
|
|
|
label="部门提成"
|
|
|
- prop="grossProfitMargin"
|
|
|
+ prop="departmentalCommission"
|
|
|
width="120"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
label="个人提成"
|
|
|
- prop="grossProfitMargin"
|
|
|
+ prop="personalCommission"
|
|
|
width="120"
|
|
|
/>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
label="操作"
|
|
|
align="center"
|
|
|
- width="170"
|
|
|
+ width="100"
|
|
|
fixed="right"
|
|
|
>
|
|
|
<template #default="{ row }">
|
|
|
<div>
|
|
|
<el-button type="primary" @click="changeExchangeRate(row)" link
|
|
|
- >调整汇率</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="clickSettlement(row)"
|
|
|
- v-if="row.settlementStatus === 0"
|
|
|
- link
|
|
|
- >结算</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="clickCancelSettlement(row)"
|
|
|
- v-else
|
|
|
- link
|
|
|
- >取消结算</el-button
|
|
|
+ >调整</el-button
|
|
|
>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -154,65 +145,7 @@
|
|
|
</el-row>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog
|
|
|
- title="默认汇率"
|
|
|
- v-if="dialogVisible"
|
|
|
- v-model="dialogVisible"
|
|
|
- width="600"
|
|
|
- >
|
|
|
- <byForm
|
|
|
- :formConfig="formConfig"
|
|
|
- :formOption="formOption"
|
|
|
- v-model="formData.data"
|
|
|
- :rules="rules"
|
|
|
- ref="submit"
|
|
|
- >
|
|
|
- <template #currencyList>
|
|
|
- <el-table
|
|
|
- :data="formData.data.list"
|
|
|
- style="width: 100%"
|
|
|
- v-loading="loadingDialog"
|
|
|
- >
|
|
|
- <el-table-column label="币种">
|
|
|
- <template #default="{ row }">
|
|
|
- <div>{{ dictValueLabel(row.type, accountCurrency) }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="兑 CHY 汇率">
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'list.' + $index + '.rate'"
|
|
|
- :rules="rules.rate"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-input-number
|
|
|
- v-model="row.rate"
|
|
|
- placeholder="请输入兑 CHY 汇率"
|
|
|
- style="width: 100%"
|
|
|
- :precision="6"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </template>
|
|
|
- </byForm>
|
|
|
- <template #footer>
|
|
|
- <el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm()" size="large"
|
|
|
- >确 定</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <el-dialog
|
|
|
- title="调整汇率"
|
|
|
- v-if="openChange"
|
|
|
- v-model="openChange"
|
|
|
- width="600"
|
|
|
- >
|
|
|
+ <el-dialog title="调整" v-if="openChange" v-model="openChange" width="700">
|
|
|
<byForm
|
|
|
:formConfig="formChangeConfig"
|
|
|
:formOption="formOption"
|
|
@@ -220,36 +153,106 @@
|
|
|
:rules="rules"
|
|
|
ref="change"
|
|
|
>
|
|
|
- <template #currencyList>
|
|
|
- <el-table
|
|
|
- :data="formChangeData.data.list"
|
|
|
- style="width: 100%"
|
|
|
- v-loading="loadingDialog"
|
|
|
- >
|
|
|
- <el-table-column label="币种">
|
|
|
- <template #default="{ row }">
|
|
|
- <div>{{ dictValueLabel(row.type, accountCurrency) }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="兑 CHY 汇率">
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'list.' + $index + '.rate'"
|
|
|
- :rules="rules.rate"
|
|
|
- :inline-message="true"
|
|
|
+ <template #afterSalesRatioSlot>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-input
|
|
|
+ v-model="formChangeData.data.afterSalesRatio"
|
|
|
+ placeholder="请输入"
|
|
|
+ :formatter="(val) => val.replace(/[^\d]/g, '')"
|
|
|
+ :parser="(val) => val.replace(/[^\d]/g, '')"
|
|
|
+ >
|
|
|
+ <template #suffix>
|
|
|
+ <span> % </span>
|
|
|
+ </template></el-input
|
|
|
>
|
|
|
- <el-input-number
|
|
|
- v-model="row.rate"
|
|
|
- placeholder="请输入兑 CHY 汇率"
|
|
|
- style="width: 100%"
|
|
|
- :precision="6"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ </el-col>
|
|
|
+ <el-co :span="20" style="padding-left: 10px"> 默认 4% </el-co>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #publicRatioSlot>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-input
|
|
|
+ v-model="formChangeData.data.publicRatio"
|
|
|
+ placeholder="请输入"
|
|
|
+ :formatter="(val) => val.replace(/[^\d]/g, '')"
|
|
|
+ :parser="(val) => val.replace(/[^\d]/g, '')"
|
|
|
+ >
|
|
|
+ <template #suffix>
|
|
|
+ <span> % </span>
|
|
|
+ </template></el-input
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
+ <el-co :span="20" style="padding-left: 10px"> 默认 6% </el-co>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #haveOverallRatioSlot>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-input
|
|
|
+ v-model="formChangeData.data.haveOverallRatio"
|
|
|
+ placeholder="请输入"
|
|
|
+ :formatter="(val) => val.replace(/[^\d]/g, '')"
|
|
|
+ :parser="(val) => val.replace(/[^\d]/g, '')"
|
|
|
+ >
|
|
|
+ <template #suffix>
|
|
|
+ <span> % </span>
|
|
|
+ </template></el-input
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
+ <el-co :span="20" style="padding-left: 10px"> 默认 5% </el-co>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #departmentalRatioSlot>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-input
|
|
|
+ v-model="formChangeData.data.departmentalRatio"
|
|
|
+ placeholder="请输入"
|
|
|
+ :formatter="(val) => val.replace(/[^\d]/g, '')"
|
|
|
+ :parser="(val) => val.replace(/[^\d]/g, '')"
|
|
|
+ >
|
|
|
+ <template #suffix>
|
|
|
+ <span> % </span>
|
|
|
+ </template></el-input
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
+ <el-co :span="20" style="padding-left: 10px">
|
|
|
+ 默认 33%。即:部门提成 = (总收入 - 总支出 - 售后 - 公共 -
|
|
|
+ 总办) * 部门占比
|
|
|
+ </el-co>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #personalRatioSlot>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-input
|
|
|
+ v-model="formChangeData.data.personalRatio"
|
|
|
+ placeholder="请输入"
|
|
|
+ :formatter="(val) => val.replace(/[^\d]/g, '')"
|
|
|
+ :parser="(val) => val.replace(/[^\d]/g, '')"
|
|
|
+ >
|
|
|
+ <template #suffix>
|
|
|
+ <span> % </span>
|
|
|
+ </template></el-input
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
+ <el-co :span="20" style="padding-left: 10px">
|
|
|
+ 默认 17%。即:个人提成 = (总收入 - 总支出 - 售后 - 公共 -
|
|
|
+ 总办)* 个人占比
|
|
|
+ </el-co>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
@@ -273,10 +276,8 @@ const { proxy } = getCurrentInstance();
|
|
|
const accountCurrency = ref([]);
|
|
|
const userList = ref([]);
|
|
|
const queryForm = reactive({
|
|
|
- countryId: "",
|
|
|
- beginTime: "",
|
|
|
- endTime: "",
|
|
|
- timeArr: "",
|
|
|
+ userId: "",
|
|
|
+ time: "",
|
|
|
});
|
|
|
const settlementStatus = ref([
|
|
|
{
|
|
@@ -364,6 +365,11 @@ const getList = async (req) => {
|
|
|
}, 200);
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+const onQuery = () => {
|
|
|
+ getList();
|
|
|
+};
|
|
|
+
|
|
|
const rateStatus = ref(false);
|
|
|
const judgeRate = () => {
|
|
|
proxy.post("/currencyRate/list", {}).then(
|
|
@@ -412,66 +418,10 @@ const formOption = reactive({
|
|
|
itemWidth: 100,
|
|
|
rules: [],
|
|
|
});
|
|
|
-const formData = reactive({
|
|
|
- data: {
|
|
|
- list: [],
|
|
|
- },
|
|
|
-});
|
|
|
-const formConfig = computed(() => {
|
|
|
- return [
|
|
|
- {
|
|
|
- type: "slot",
|
|
|
- prop: "currencyList",
|
|
|
- slotName: "currencyList",
|
|
|
- label: "",
|
|
|
- },
|
|
|
- ];
|
|
|
-});
|
|
|
const rules = ref({
|
|
|
rate: [{ required: true, message: "请输入兑 CHY 汇率", trigger: "blur" }],
|
|
|
});
|
|
|
-const openModal = () => {
|
|
|
- if (accountCurrency.value && accountCurrency.value.length > 0) {
|
|
|
- formData.data = {
|
|
|
- list: accountCurrency.value.map((item) => {
|
|
|
- return {
|
|
|
- id: "",
|
|
|
- type: item.value,
|
|
|
- rate: 1,
|
|
|
- };
|
|
|
- }),
|
|
|
- };
|
|
|
- } else {
|
|
|
- formData.data = {
|
|
|
- list: [],
|
|
|
- };
|
|
|
- }
|
|
|
- loadingDialog.value = true;
|
|
|
- dialogVisible.value = true;
|
|
|
- proxy.post("/currencyRate/list", {}).then(
|
|
|
- (res) => {
|
|
|
- if (res && res.length > 0 && formData.data.list.length > 0) {
|
|
|
- formData.data.list = formData.data.list.map((item) => {
|
|
|
- for (let i = 0; i < res.length; i++) {
|
|
|
- if (item.type === res[i].type) {
|
|
|
- item.id = res[i].id;
|
|
|
- item.rate = res[i].rate;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
- loadingDialog.value = false;
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- console.log(err);
|
|
|
- loadingDialog.value = false;
|
|
|
- }
|
|
|
- );
|
|
|
-};
|
|
|
+
|
|
|
const submitForm = () => {
|
|
|
submit.value.handleSubmit(() => {
|
|
|
loadingDialog.value = true;
|
|
@@ -495,118 +445,87 @@ const submitForm = () => {
|
|
|
const openChange = ref(false);
|
|
|
const change = ref(null);
|
|
|
const formChangeData = reactive({
|
|
|
- data: {
|
|
|
- list: [],
|
|
|
- },
|
|
|
+ data: {},
|
|
|
});
|
|
|
const formChangeConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
type: "slot",
|
|
|
- prop: "currencyList",
|
|
|
- slotName: "currencyList",
|
|
|
- label: "",
|
|
|
+ prop: "afterSalesRatio",
|
|
|
+ slotName: "afterSalesRatioSlot",
|
|
|
+ label: "售后占比",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ prop: "publicRatio",
|
|
|
+ slotName: "publicRatioSlot",
|
|
|
+ label: "公共占比",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ prop: "haveOverallRatio",
|
|
|
+ slotName: "haveOverallRatioSlot",
|
|
|
+ label: "总办占比",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ prop: "departmentalRatio",
|
|
|
+ slotName: "departmentalRatioSlot",
|
|
|
+ label: "部门占比",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ prop: "personalRatio",
|
|
|
+ slotName: "personalRatioSlot",
|
|
|
+ label: "个人占比",
|
|
|
},
|
|
|
];
|
|
|
});
|
|
|
+const rowData = ref({});
|
|
|
const changeExchangeRate = (row) => {
|
|
|
- formChangeData.data = {
|
|
|
- id: row.contractId,
|
|
|
- list: [],
|
|
|
- };
|
|
|
- if (accountCurrency.value && accountCurrency.value.length > 0) {
|
|
|
- formChangeData.data.list = accountCurrency.value.map((item) => {
|
|
|
- return {
|
|
|
- type: item.value,
|
|
|
- rate: 1,
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
- loadingDialog.value = true;
|
|
|
- openChange.value = true;
|
|
|
- if (row.currencyRateJson) {
|
|
|
- let currencyRateJson = JSON.parse(row.currencyRateJson);
|
|
|
- formChangeData.data.list = formChangeData.data.list.map((item) => {
|
|
|
- for (let i = 0; i < currencyRateJson.length; i++) {
|
|
|
- if (item.type === currencyRateJson[i].type) {
|
|
|
- item.rate = currencyRateJson[i].rate;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- };
|
|
|
- });
|
|
|
- loadingDialog.value = false;
|
|
|
- } else {
|
|
|
- proxy.post("/currencyRate/list", {}).then(
|
|
|
- (res) => {
|
|
|
- if (res && res.length > 0 && formChangeData.data.list.length > 0) {
|
|
|
- formChangeData.data.list = formChangeData.data.list.map((item) => {
|
|
|
- for (let i = 0; i < res.length; i++) {
|
|
|
- if (item.type === res[i].type) {
|
|
|
- item.rate = res[i].rate;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
- loadingDialog.value = false;
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- console.log(err);
|
|
|
- loadingDialog.value = false;
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
+ rowData.value = row;
|
|
|
+ proxy.post("/commissionRule/detail", { id: row.id }).then((res) => {
|
|
|
+ openChange.value = true;
|
|
|
+ formChangeData.data = res;
|
|
|
+ });
|
|
|
};
|
|
|
+
|
|
|
const submitChangeForm = () => {
|
|
|
change.value.handleSubmit(() => {
|
|
|
- loadingDialog.value = true;
|
|
|
- let data = {};
|
|
|
- data.id = formChangeData.data.id;
|
|
|
- data.currencyRateJson = JSON.stringify(formChangeData.data.list);
|
|
|
- proxy.post("/saleStatement/update", data).then(
|
|
|
- () => {
|
|
|
- ElMessage({
|
|
|
- message: "保存成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- openChange.value = false;
|
|
|
- getList();
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- console.log(err);
|
|
|
- loadingDialog.value = false;
|
|
|
- }
|
|
|
- );
|
|
|
+ const {
|
|
|
+ afterSalesRatio,
|
|
|
+ publicRatio,
|
|
|
+ haveOverallRatio,
|
|
|
+ departmentalRatio,
|
|
|
+ personalRatio,
|
|
|
+ } = formChangeData.data;
|
|
|
+ let sum =
|
|
|
+ Number(afterSalesRatio) +
|
|
|
+ Number(publicRatio) +
|
|
|
+ Number(haveOverallRatio) +
|
|
|
+ Number(departmentalRatio) +
|
|
|
+ Number(personalRatio);
|
|
|
+ if (sum > 100) return this.msgInfo("全部占比不可大于100%");
|
|
|
+ proxy
|
|
|
+ .post("/commission/add", {
|
|
|
+ commissionRule: formChangeData.data,
|
|
|
+ ...rowData.value,
|
|
|
+ })
|
|
|
+ .then(
|
|
|
+ () => {
|
|
|
+ ElMessage({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ openChange.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log(err);
|
|
|
+ }
|
|
|
+ );
|
|
|
});
|
|
|
};
|
|
|
-const clickSettlement = (row) => {
|
|
|
- proxy
|
|
|
- .post("/saleStatement/update", { id: row.contractId, settlementStatus: 1 })
|
|
|
- .then(() => {
|
|
|
- ElMessage({
|
|
|
- message: "保存成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- getList();
|
|
|
- });
|
|
|
-};
|
|
|
-const clickCancelSettlement = (row) => {
|
|
|
- proxy
|
|
|
- .post("/saleStatement/update", { id: row.contractId, settlementStatus: 0 })
|
|
|
- .then(() => {
|
|
|
- ElMessage({
|
|
|
- message: "保存成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- getList();
|
|
|
- });
|
|
|
-};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|