|
@@ -199,56 +199,87 @@
|
|
|
/>
|
|
|
</el-row>
|
|
|
<el-dialog title="提成类型配置" v-model="commissionTypeModal" width="1000">
|
|
|
- <div style="margin-bottom:10px">
|
|
|
+ <div style="margin-bottom: 10px">
|
|
|
<el-button @click="commissionTypeListPush">添加</el-button>
|
|
|
</div>
|
|
|
<el-table :data="commissionTypeList" style="width: 100%">
|
|
|
<el-table-column prop="date" label="类型名称">
|
|
|
- <template #default="{ row,$index }">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-input v-model="commissionTypeList[$index].name" placeholder="类型名称" />
|
|
|
+ <el-input
|
|
|
+ v-model="commissionTypeList[$index].name"
|
|
|
+ placeholder="类型名称"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="afterSalesRatio" label="售后占比">
|
|
|
- <template #default="{ row,$index }">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-input type="number" :min="0" v-model="commissionTypeList[$index].afterSalesRatio" placeholder="售后占比" />
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ v-model="commissionTypeList[$index].afterSalesRatio"
|
|
|
+ placeholder="售后占比"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="afterSalesRatio" label="公共占比">
|
|
|
- <template #default="{ row,$index }">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-input type="number" :min="0" v-model="commissionTypeList[$index].publicRatio" placeholder="公共占比" />
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ v-model="commissionTypeList[$index].publicRatio"
|
|
|
+ placeholder="公共占比"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="afterSalesRatio" label="总办占比">
|
|
|
- <template #default="{ row,$index }">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-input type="number" :min="0" v-model="commissionTypeList[$index].haveOverallRatio" placeholder="总办占比" />
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ v-model="commissionTypeList[$index].haveOverallRatio"
|
|
|
+ placeholder="总办占比"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="afterSalesRatio" label="部门占比">
|
|
|
- <template #default="{ row,$index }">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-input type="number" :min="0" v-model="commissionTypeList[$index].departmentalRatio" placeholder="部门占比" />
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ v-model="commissionTypeList[$index].departmentalRatio"
|
|
|
+ placeholder="部门占比"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="afterSalesRatio" label="个人占比">
|
|
|
- <template #default="{ row,$index }">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-input type="number" :min="0" v-model="commissionTypeList[$index].personalRatio" placeholder="个人占比" />
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ v-model="commissionTypeList[$index].personalRatio"
|
|
|
+ placeholder="个人占比"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" width="100" fixed="right">
|
|
|
- <template #default="{ row,$index }">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
<div>
|
|
|
- <el-button type="primary" @click="deleteCommissionTypeList(row,$index)" link
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="deleteCommissionTypeList(row, $index)"
|
|
|
+ link
|
|
|
>删除</el-button
|
|
|
>
|
|
|
</div>
|
|
@@ -256,7 +287,9 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<template #footer>
|
|
|
- <el-button @click="commissionTypeModal = false" size="large">取 消</el-button>
|
|
|
+ <el-button @click="commissionTypeModal = false" size="large"
|
|
|
+ >取 消</el-button
|
|
|
+ >
|
|
|
<el-button type="primary" @click="submitCommissionType()" size="large"
|
|
|
>确 定</el-button
|
|
|
>
|
|
@@ -273,8 +306,13 @@
|
|
|
<template #commissionType>
|
|
|
<!-- commissionTypeList -->
|
|
|
<div>
|
|
|
- <el-button v-for="i in commissionTypeListShowCopy" :key='i.id' @click="updateFormChangeData(i)">{{ i.name }}</el-button>
|
|
|
- <el-button @click='commissionTypeModal = true'>配置</el-button>
|
|
|
+ <el-button
|
|
|
+ v-for="i in commissionTypeListShowCopy"
|
|
|
+ :key="i.id"
|
|
|
+ @click="updateFormChangeData(i)"
|
|
|
+ >{{ i.name }}</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="commissionTypeModal = true">配置</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #afterSalesRatioSlot>
|
|
@@ -664,7 +702,7 @@ const formChangeData = reactive({
|
|
|
});
|
|
|
const formChangeConfig = computed(() => {
|
|
|
return [
|
|
|
- {
|
|
|
+ {
|
|
|
type: "slot",
|
|
|
prop: "commissionType",
|
|
|
slotName: "commissionType",
|
|
@@ -702,95 +740,96 @@ const formChangeConfig = computed(() => {
|
|
|
},
|
|
|
];
|
|
|
});
|
|
|
-const commissionTypeModal = ref(false)
|
|
|
-let commissionTypeList = ref([])
|
|
|
-let commissionTypeListShowCopy = ref([])
|
|
|
+const commissionTypeModal = ref(false);
|
|
|
+let commissionTypeList = ref([]);
|
|
|
+let commissionTypeListShowCopy = ref([]);
|
|
|
const updateFormChangeData = (row) => {
|
|
|
- formChangeData.data = row
|
|
|
-}
|
|
|
+ const data = { ...row };
|
|
|
+ delete data.id;
|
|
|
+ formChangeData.data = { ...formChangeData.data, ...data };
|
|
|
+};
|
|
|
|
|
|
-const deleteCommissionTypeList = (row,index) => {
|
|
|
- commissionTypeList.value.splice(index,1)
|
|
|
-}
|
|
|
+const deleteCommissionTypeList = (row, index) => {
|
|
|
+ commissionTypeList.value.splice(index, 1);
|
|
|
+};
|
|
|
const getCommissionType = () => {
|
|
|
- proxy.get("/commissionType/list", { }).then((res) => {
|
|
|
- commissionTypeList.value = res.data
|
|
|
- commissionTypeListShowCopy.value = {...res.data}
|
|
|
+ proxy.get("/commissionType/list", {}).then((res) => {
|
|
|
+ commissionTypeList.value = res.data;
|
|
|
+ commissionTypeListShowCopy.value = { ...res.data };
|
|
|
openChange.value = true;
|
|
|
});
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
const submitCommissionType = () => {
|
|
|
//先判断值是否全部填写
|
|
|
- for(let i = 0; i < commissionTypeList.value.length; i++) {
|
|
|
- if(!commissionTypeList.value[i].name) {
|
|
|
+ for (let i = 0; i < commissionTypeList.value.length; i++) {
|
|
|
+ if (!commissionTypeList.value[i].name) {
|
|
|
return ElMessage({
|
|
|
message: "请填写类型名称",
|
|
|
type: "info",
|
|
|
});
|
|
|
}
|
|
|
- if(!commissionTypeList.value[i].afterSalesRatio) {
|
|
|
+ if (!commissionTypeList.value[i].afterSalesRatio) {
|
|
|
return ElMessage({
|
|
|
message: "请填写售后占比",
|
|
|
type: "info",
|
|
|
});
|
|
|
}
|
|
|
- if(!commissionTypeList.value[i].publicRatio) {
|
|
|
+ if (!commissionTypeList.value[i].publicRatio) {
|
|
|
return ElMessage({
|
|
|
message: "请填写公共占比",
|
|
|
type: "info",
|
|
|
});
|
|
|
}
|
|
|
- if(!commissionTypeList.value[i].haveOverallRatio) {
|
|
|
+ if (!commissionTypeList.value[i].haveOverallRatio) {
|
|
|
return ElMessage({
|
|
|
message: "请填写总办占比",
|
|
|
type: "info",
|
|
|
});
|
|
|
}
|
|
|
- if(!commissionTypeList.value[i].departmentalRatio) {
|
|
|
+ if (!commissionTypeList.value[i].departmentalRatio) {
|
|
|
return ElMessage({
|
|
|
message: "请填写部门占比",
|
|
|
type: "info",
|
|
|
});
|
|
|
}
|
|
|
- if(!commissionTypeList.value[i].personalRatio) {
|
|
|
+ if (!commissionTypeList.value[i].personalRatio) {
|
|
|
return ElMessage({
|
|
|
message: "请填写个人占比",
|
|
|
type: "info",
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- proxy.post("/commissionType/addOrEdit", commissionTypeList.value).then((res) => {
|
|
|
- commissionTypeModal.value = false
|
|
|
- getCommissionType()
|
|
|
-
|
|
|
- ElMessage({
|
|
|
- message: "操作成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
+ proxy
|
|
|
+ .post("/commissionType/addOrEdit", commissionTypeList.value)
|
|
|
+ .then((res) => {
|
|
|
+ commissionTypeModal.value = false;
|
|
|
+ getCommissionType();
|
|
|
|
|
|
+ ElMessage({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
const commissionTypeListPush = () => {
|
|
|
commissionTypeList.value.push({
|
|
|
- id:null,
|
|
|
- name: '',
|
|
|
- afterSalesRatio: '',
|
|
|
- publicRatio: '',
|
|
|
- haveOverallRatio: '',
|
|
|
- departmentalRatio: '',
|
|
|
- personalRatio: '',
|
|
|
- })
|
|
|
-}
|
|
|
+ id: null,
|
|
|
+ name: "",
|
|
|
+ afterSalesRatio: "",
|
|
|
+ publicRatio: "",
|
|
|
+ haveOverallRatio: "",
|
|
|
+ departmentalRatio: "",
|
|
|
+ personalRatio: "",
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
const rowData = ref({});
|
|
|
const changeExchangeRate = (row) => {
|
|
|
rowData.value = row;
|
|
|
- getCommissionType()
|
|
|
+ getCommissionType();
|
|
|
proxy.post("/commissionRule/detail", { id: row.id }).then((res) => {
|
|
|
-
|
|
|
formChangeData.data = res;
|
|
|
});
|
|
|
};
|