+
公司利润 = ( 成交价
-
-
+
+
) 乘以
-
+
添加利润档位
成交额满
,公司利润为
-
+
比例模式
固定模式
-
+
公司利润 = ( 成交价
) 乘以
-
+
添加利润档位
@@ -249,7 +249,7 @@
>
成交额满
,公司利润为
{
dialogVisible.value = true
dialogTitle.value = type == 'create' ? '新增班型' : '修改班型'
formType.value = type
+ currentTab.value = 'base'
resetForm()
if (!opts.value.length) {
const arr = await ClassApi.getCommissionParams()
@@ -489,6 +492,37 @@ const open = async (type, id) => {
try {
formData.value = await ClassApi.getClassType(id)
formData.value.schPlace = [formData.value.schoolId, formData.value.placeId]
+ if (!formData.value.companyProfitVO) {
+ profitCompanyForm.value = {
+ profitMode: 1,
+ dangwei: [],
+ profitRule: {}
+ }
+ } else if (formData.value.companyProfitVO.profitMode == 1) {
+ profitCompanyForm.value = { ...formData.value.companyProfitVO, dangwei: [] }
+ } else {
+ profitCompanyForm.value = {
+ ...formData.value.companyProfitVO,
+ dangwei: formData.value.companyProfitVO.profitRule
+ }
+ profitCompanyForm.value.profitRule = {}
+ }
+
+ if (!formData.value.personProfitVO) {
+ profitEmployeeForm.value = {
+ profitMode: 1,
+ dangwei: [],
+ profitRule: {}
+ }
+ } else if (formData.value.personProfitVO.profitMode == 1) {
+ profitEmployeeForm.value = { ...formData.value.personProfitVO, dangwei: [] }
+ } else {
+ profitEmployeeForm.value = {
+ ...formData.value.personProfitVO,
+ dangwei: formData.value.personProfitVO.profitRule
+ }
+ profitEmployeeForm.value.profitRule = {}
+ }
} finally {
formLoading.value = false
}
@@ -579,6 +613,51 @@ async function submitForm() {
delete data.schPlace
delete data.percentages
data.percentages = { ...comissionForm.value }
+ data.companyProfitVO = { ...profitCompanyForm.value }
+ data.personProfitVO = { ...profitEmployeeForm.value }
+ if (data.companyProfitVO.profitMode == 1) {
+ data.companyProfitVO.profitRule.minPrice = data.companyProfitVO.profitRule.minPrice || 0
+ if (!data.companyProfitVO.profitRule.mark || !data.companyProfitVO.profitRule.rate) {
+ message.info('请将公司利润计算规则填写完整!')
+ return
+ }
+ } else {
+ data.companyProfitVO.profitRule = data.companyProfitVO?.dangwei || []
+ delete data.companyProfitVO.dangwei
+ if (data.companyProfitVO.profitRule.length == 0) {
+ message.info('请添加公司利润计算规则!')
+ return
+ } else if (
+ data.companyProfitVO.profitRule.some(
+ (it) => it.signPrice == undefined || it.profit == undefined
+ )
+ ) {
+ message.info('请将公司利润计算规则填写完整!')
+ return
+ }
+ }
+
+ if (data.personProfitVO.profitMode == 1) {
+ data.personProfitVO.profitRule.minPrice = data.personProfitVO.profitRule.minPrice || 0
+ if (!data.personProfitVO.profitRule.mark || !data.personProfitVO.profitRule.rate) {
+ message.info('请将员工利润计算规则填写完整!')
+ return
+ }
+ } else {
+ data.personProfitVO.profitRule = data.personProfitVO?.dangwei || []
+ delete data.personProfitVO.dangwei
+ if (data.personProfitVO.profitRule.length == 0) {
+ message.info('请添加员工利润计算规则!')
+ return
+ } else if (
+ data.personProfitVO.profitRule.some(
+ (it) => it.signPrice == undefined || it.profit == undefined
+ )
+ ) {
+ message.info('请将员工利润计算规则填写完整!')
+ return
+ }
+ }
if (formType.value === 'create') {
await ClassApi.createClassType(data)
message.success(t('common.createSuccess'))
diff --git a/src/views/SchoolManagement/Class/index.vue b/src/views/SchoolManagement/Class/index.vue
index 0edfe16..921f1bb 100644
--- a/src/views/SchoolManagement/Class/index.vue
+++ b/src/views/SchoolManagement/Class/index.vue
@@ -82,7 +82,13 @@
/>
-
+
+
+
+ 点击查看
+
+
+
@@ -154,6 +160,7 @@ import DialogClass from './Comp/DialogClass.vue'
import { checkPermi } from '@/utils/permission'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
+import { removeNullField } from '@/utils'
const message = useMessage() // 消息弹窗
@@ -198,8 +205,7 @@ const columns = [
{ props: 'placeName', label: '场地' },
{ props: 'typeName', label: '班型名称' },
{ props: 'licenseType', label: '驾照类型', width: '100px' },
- { props: 'guidingPrice', label: '最新报价', width: '100px' },
- { props: 'minPrice', label: '最新底价', width: '100px' }
+ { props: 'guidingPrice', label: '最新报价', width: '100px' }
// { props: 'remark', label: '备注', width: '100px' }
]
@@ -219,7 +225,7 @@ async function getList() {
}
}
delete params.schPlace
- const data = await ClassApi.getClassTypePage(params)
+ const data = await ClassApi.getClassTypePage(removeNullField(params))
tableList.value = data.list
total.value = data.total
} finally {