diff --git a/src/views/Clue/Order/Comp/SchoolSettle.vue b/src/views/Clue/Order/Comp/SchoolSettle.vue new file mode 100644 index 0000000..92e329f --- /dev/null +++ b/src/views/Clue/Order/Comp/SchoolSettle.vue @@ -0,0 +1,236 @@ + + + + + diff --git a/src/views/Clue/Order/Comp/Settle.vue b/src/views/Clue/Order/Comp/Settle.vue new file mode 100644 index 0000000..11a1432 --- /dev/null +++ b/src/views/Clue/Order/Comp/Settle.vue @@ -0,0 +1,14 @@ + + + + + diff --git a/src/views/Clue/Order/index.vue b/src/views/Clue/Order/index.vue index 662ce8c..266717e 100644 --- a/src/views/Clue/Order/index.vue +++ b/src/views/Clue/Order/index.vue @@ -15,6 +15,9 @@ + + + @@ -25,6 +28,7 @@ import MallOrderList from './Comp/MallOrderList.vue' import Reback from './Comp/Reback.vue' import AfterSales from './Comp/AfterSales.vue' import Delivery from './Comp/Delivery.vue' +import Settle from './Comp/Settle.vue' const appStore = useAppStore() const tabName = ref('list') diff --git a/src/views/Clue/Pool/Comp/DialogSuccess.vue b/src/views/Clue/Pool/Comp/DialogSuccess.vue index 2734060..e7601b5 100644 --- a/src/views/Clue/Pool/Comp/DialogSuccess.vue +++ b/src/views/Clue/Pool/Comp/DialogSuccess.vue @@ -79,6 +79,7 @@ :disabled="!form.signPlace" placeholder="选择班型" filterable + @change="changeClass" > + + + + + + + + (it.typeId = form.value.signClass)).guidingPrice || 0 +} + function handleRemove(type, index) { form.value[type].splice(index, 1) } diff --git a/src/views/SchoolManagement/Class/Comp/DialogClass.vue b/src/views/SchoolManagement/Class/Comp/DialogClass.vue index 0cd910c..ab63f3e 100644 --- a/src/views/SchoolManagement/Class/Comp/DialogClass.vue +++ b/src/views/SchoolManagement/Class/Comp/DialogClass.vue @@ -116,26 +116,26 @@ label-width="90px" > - + 比例模式 固定模式 -
+
公司利润 = ( 成交价 - - + + ) 乘以
-
+
添加利润档位
成交额满 ,公司利润为 - + 比例模式 固定模式 -
+
公司利润 = ( 成交价 ) 乘以
-
+
添加利润档位 @@ -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 {