dev-cl
qsh 4 months ago
parent f45123126d
commit f56305505f
  1. 41
      src/api/finance/plan.js
  2. 36
      src/api/finance/salary.js
  3. 20
      src/api/home/index.js
  4. 20
      src/api/home/salary.js
  5. 101
      src/views/Finance/Commission/Comp/DialogPlan.vue
  6. 42
      src/views/Finance/Commission/index.vue
  7. 76
      src/views/Finance/Salary/Comp/DialogSalary.vue
  8. 12
      src/views/Finance/Salary/index.vue
  9. 2
      src/views/Pers/Setting/index.vue

@ -0,0 +1,41 @@
import request from '@/config/axios'
// 获取提成结算参数
export const getCommissionParams = async () => {
return await request.get({ url: '/admin-api/oa/percentage/get-percentage-param' })
}
// 创建
export const createPlan = (data) => {
return request.post({ url: '/admin-api/oa/percentage/create', data, isSubmitForm: true })
}
// 修改
export const updatePlan = (data) => {
return request.put({ url: '/admin-api/oa/percentage/update', data })
}
// 修改状态
export const updatePlanStatus = (data) => {
return request.put({ url: '/admin-api/oa/percentage/status/update', data })
}
// 分页
export const getPlanPage = (params) => {
return request.get({ url: '/admin-api/oa/percentage/page', params })
}
// 列表
export const getPlanSimpleList = (params) => {
return request.get({ url: '/admin-api/oa/percentage/simple-list', params })
}
// 详情
export const getPlanDetail = (id) => {
return request.get({ url: '/admin-api/oa/percentage/get', params: { id } })
}
// 删除
export const deletePlan = (id) => {
return request.delete({ url: '/admin-api/oa/percentage/delete', params: { id } })
}

@ -0,0 +1,36 @@
import request from '@/config/axios'
// 创建
export const createSalary = (data) => {
return request.post({ url: '/admin-api/oa/user-salary/create', data, isSubmitForm: true })
}
// 修改
export const updateSalary = (data) => {
return request.put({ url: '/admin-api/oa/user-salary/update', data })
}
// 修改状态
export const updateSalaryStatus = (data) => {
return request.put({ url: '/admin-api/oa/user-salary/status/update', data })
}
// 分页
export const getSalaryPage = (params) => {
return request.get({ url: '/admin-api/oa/user-salary/page', params })
}
// 列表
export const getSalarySimpleList = (params) => {
return request.get({ url: '/admin-api/oa/user-salary/simple-list', params })
}
// 详情
export const getSalaryDetail = (id) => {
return request.get({ url: '/admin-api/oa/user-salary/get', params: { id } })
}
// 删除
export const deleteSalary = (id) => {
return request.delete({ url: '/admin-api/oa/user-salary/delete', params: { id } })
}

@ -1,20 +0,0 @@
import request from '@/config/axios'
// 线索情况
export const getUserClueCount = async (params) => {
return await request.get({ url: '/admin-api/crm/home/get-user-count', params })
}
// 成交率
export const getClueSignSignRate = async (params) => {
return await request.get({ url: '/admin-api/crm/home/get-sign-rate', params })
}
// 成交率
export const getClueSignSignRank = async (params) => {
return await request.get({ url: '/admin-api/crm/home/get-sign-top10', params })
}
// 成交率
export const getClueFollowRank = async (params) => {
return await request.get({ url: '/admin-api/crm/home/get-follow-top10', params })
}

@ -0,0 +1,20 @@
import request from '@/config/axios'
// 生成工资条
export const createSalarySlip = async (data) => {
return await request.post({ url: '/admin-api/oa/user-salary-grant/create', data })
}
// 导入工资条
export const importSalarySlip = async (params) => {
return await request.get({ url: '/admin-api/oa/user-salary-grant/import', params })
}
// 修改工资条
export const updateSalarySlip = async (data) => {
return await request.put({ url: '/admin-api/oa/user-salary-grant/update', data })
}
// 封存
export const sealupSalarySlip = async (data) => {
return await request.post({ url: '/admin-api/oa/user-salary-grant/confirm', data })
}

@ -10,8 +10,8 @@
>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="方案名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入方案名称" clearable />
<el-form-item label="方案名称" prop="percentageName">
<el-input v-model="formData.percentageName" placeholder="请输入方案名称" clearable />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
@ -27,9 +27,9 @@
</el-form-item>
</el-col>
</el-row>
<el-button type="primary" class="mb-10px" plain @click="handleAddRules"
>添加提成档位</el-button
>
<el-button type="primary" class="mb-10px" plain @click="handleAddRules">
添加提成档位
</el-button>
<el-row :gutter="20" class="mb-10px">
<el-col
:span="24"
@ -41,17 +41,17 @@
<el-select v-model="item.ruleParam1" style="width: 100px">
<el-option
v-for="it in opts.percentage_param1"
:key="Number(it.value)"
:key="it.value"
:label="it.label"
:value="Number(it.value)"
:value="it.value"
/>
</el-select>
<el-select class="ml-5px" v-model="item.ruleParam2" style="width: 100px">
<el-option
v-for="it in opts.percentage_param2"
:key="Number(it.value)"
:key="it.value"
:label="it.label"
:value="Number(it.value)"
:value="it.value"
/>
</el-select>
<span class="ml-5px"></span>
@ -67,9 +67,9 @@
<el-select class="ml-5px" v-model="item.ruleParam4" style="width: 120px">
<el-option
v-for="it in opts.percentage_param4"
:key="Number(it.value)"
:key="it.value"
:label="it.label"
:value="Number(it.value)"
:value="it.value"
/>
</el-select>
<div v-if="item.ruleParam4 == 2" class="inline-flex items-center">
@ -88,9 +88,9 @@
<el-select class="ml-5px" v-model="item.ruleParam5" style="width: 100px">
<el-option
v-for="it in opts.percentage_param5"
:key="Number(it.value)"
:key="it.value"
:label="it.label"
:value="Number(it.value)"
:value="it.value"
/>
</el-select>
<span class="ml-5px">结算</span>
@ -105,6 +105,7 @@
<template #suffix> % </template>
</el-input>
</div>
<Icon icon="ep:remove-filled" class="text-red-500 ml-20px" @click="handleRemove(index)" />
</el-col>
</el-row>
@ -113,17 +114,17 @@
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="是否扣除其他支出" labelWidth="150px">
<el-radio-group v-model="formData.qitazhichu">
<el-radio :label="0"> </el-radio>
<el-radio :label="1"> </el-radio>
<el-radio-group v-model="formData.isDeductExtraPay">
<el-radio :label="true"> </el-radio>
<el-radio :label="false"> </el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="是否扣除售后" labelWidth="150px">
<el-radio-group v-model="formData.shouhou">
<el-radio :label="0"> </el-radio>
<el-radio :label="1"> </el-radio>
<el-radio-group v-model="formData.isDeductAfterSale">
<el-radio :label="true"> </el-radio>
<el-radio :label="false"> </el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -131,15 +132,15 @@
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="是否关联成交率" labelWidth="150px">
<el-radio-group v-model="formData.saleCommissionRelateDealConfig">
<el-radio label="true"> </el-radio>
<el-radio label="false"> </el-radio>
<el-radio-group v-model="formData.isRelateSignRate">
<el-radio :label="true"> </el-radio>
<el-radio :label="false"> </el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="提成计算时间" labelWidth="150px">
<el-radio-group v-model="formData.jisuanshijian">
<el-radio-group v-model="formData.calculateType">
<el-radio :label="1">成交后</el-radio>
<el-radio :label="2">回款后</el-radio>
</el-radio-group>
@ -148,7 +149,7 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="关联规则" v-if="formData.saleCommissionRelateDealConfig == 'true'">
<el-form-item label="关联规则" v-if="formData.isRelateSignRate == 'true'">
<div>
<el-button @click="formData.saleCommissionRelateRulesConfig.push({})">
新增规则
@ -198,7 +199,9 @@
</template>
<script setup name="DialogCommissionPlan">
import * as PlanApi from '@/api/finance/plan'
const message = useMessage() //
const { t } = useI18n() //
const dialogVisible = ref(false) //
const dialogTitle = ref('工资条设置')
@ -206,7 +209,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formData = ref({})
const rules = {
name: { required: true, message: '方案名称不可为空', trigger: 'blur' }
percentageName: { required: true, message: '方案名称不可为空', trigger: 'blur' }
}
const opts = ref({
percentage_param1: [],
@ -224,16 +227,16 @@ const open = async (type, row) => {
resetForm()
if (!opts.value.length) {
// const arr = await ClassApi.getCommissionParams()
// arr.map((item) => {
// opts.value[item.dictType].push(item)
// })
const arr = await PlanApi.getCommissionParams()
arr.map((item) => {
opts.value[item.dictType].push(item)
})
}
if (row?.id) {
if (row?.percentageId) {
formLoading.value = true
try {
// formData.value = await UserApi.getUser(id)
formData.value = await PlanApi.getPlanDetail(row.percentageId)
} finally {
formLoading.value = false
}
@ -244,32 +247,35 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 重置表单 */
const resetForm = () => {
formData.value = {
name: undefined,
percentageName: undefined,
percentageType: 1,
rules: [
{
ruleParam1: 1,
ruleParam2: 1,
ruleParam1: '2',
ruleParam2: '1',
ruleParam3: 0,
ruleParam4: 1,
ruleParam5: 1,
ruleParam4: '1',
ruleParam5: '1',
ruleParam6: 10
}
],
saleCommissionRelateDealConfig: 'false',
saleCommissionRelateRulesConfig: []
isRelateSignRate: false,
saleCommissionRelateRulesConfig: [],
isDeductExtraPay: true,
isDeductAfterSale: true,
calculateType: 1
}
formRef.value?.resetFields()
}
function handleAddRules() {
formData.value.rules.push({
ruleParam1: 1,
ruleParam2: 1,
ruleParam1: '2',
ruleParam2: '1',
ruleParam3: 0,
ruleParam4: 1,
ruleParam5: 1,
ruleParam6: 1
ruleParam4: '1',
ruleParam5: '1',
ruleParam6: 0
})
}
@ -283,11 +289,12 @@ const submitForm = async () => {
//
formLoading.value = true
try {
const data = { ...formData.value }
if (formType.value === 'create') {
// await ClassApi.createClassType(data)
await PlanApi.createPlan(data)
message.success(t('common.createSuccess'))
} else {
// await ClassApi.updateClassType(data)
await PlanApi.updatePlan(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
@ -297,6 +304,10 @@ const submitForm = async () => {
formLoading.value = false
}
}
function handleRemove(index) {
formData.value.rules.splice(index, 1)
}
</script>
<style lang="scss" scoped></style>

@ -2,7 +2,11 @@
<div>
<el-form :model="searchForm" inline @submit.prevent>
<el-form-item>
<el-input v-model="searchForm.name" placeholder="方案名称" @keyup.enter="handleQuery" />
<el-input
v-model="searchForm.percentageName"
placeholder="方案名称"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-select
@ -30,7 +34,7 @@
</el-form>
<el-table v-loading="loading" :data="tableList" border stripe>
<el-table-column type="index" width="50" />
<el-table-column label="方案名称" prop="name" width="240" />
<el-table-column label="方案名称" prop="percentageName" width="240" />
<el-table-column label="结算方式" prop="percentageType" width="150" />
<el-table-column label="结算规则">
<template #default="{ row }">
@ -61,7 +65,7 @@
<el-button
type="primary"
link
@click="handleDelete(scope.row.id)"
@click="handleDelete(scope.row.percentageId)"
v-hasPermi="['finance:commission:delete']"
>
删除
@ -82,8 +86,14 @@
<script name="CommissionPlan" setup>
import DialogPlan from './Comp/DialogPlan.vue'
import * as PlanApi from '@/api/finance/plan'
import { removeNullField } from '@/utils'
const message = useMessage() //
const { t } = useI18n() //
const searchForm = ref({
name: undefined,
percentageName: undefined,
status: undefined,
pageNo: 1,
pageSize: 20
@ -106,10 +116,9 @@ const total = ref(0)
const getList = async () => {
loading.value = true
try {
tableList.value = [{ status: 0 }]
// const data = await UserApi.getUserPage(queryParams)
// tableList.value = data.list
// total.value = data.total
const data = await PlanApi.getPlanPage(removeNullField(searchForm.value))
tableList.value = data.list
total.value = data.total
} finally {
loading.value = false
}
@ -124,9 +133,9 @@ const handleStatusChange = async (row) => {
try {
//
const text = row.status === 0 ? '启用' : '停用'
await message.confirm('确认要"' + text + '""' + row.name + '"方案吗?')
await message.confirm('确认要"' + text + '""' + row.percentageName + '"方案吗?')
//
// await UserApi.updateUserStatus(row.id, row.status)
await PlanApi.updatePlanStatus({ percentageId: row.percentageId, status: row.status })
//
await getList()
} catch {
@ -134,6 +143,19 @@ const handleStatusChange = async (row) => {
row.status = row.status === 0 ? 1 : 0
}
}
/** 删除按钮操作 */
const handleDelete = async (id) => {
try {
//
await message.delConfirm()
//
await PlanApi.deletePlan(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
</script>
<style lang="scss" scoped></style>

@ -13,22 +13,22 @@
<el-divider direction="horizontal" content-position="left">应发</el-divider>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="基本工资" prop="dixin">
<el-input-number v-model="formData.dixin" :min="0" :controls="false" />
<el-form-item label="基本工资" prop="baseSalary">
<el-input-number v-model="formData.baseSalary" :min="0" :controls="false" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="奖金" prop="jiangjin">
<el-input-number v-model="formData.jiangjin" :min="0" :controls="false" />
<el-form-item label="奖金" prop="rewardSalary">
<el-input-number v-model="formData.rewardSalary" :min="0" :controls="false" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="提成方案" prop="tichengfangan">
<el-select v-model="formData.tichengfangan" placeholder="请选择" filterable>
<el-form-item label="提成方案" prop="planId">
<el-select v-model="formData.planId" placeholder="请选择" filterable>
<el-option
v-for="item in tichengfanganOptions"
v-for="item in planOptions"
:key="item.value"
:label="item.label"
:value="item.value"
@ -49,39 +49,39 @@
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="其他应发" prop="qitayingfa">
<el-input-number v-model="formData.qitayingfa" :min="0" :controls="false" />
<el-form-item label="其他应发" prop="extraSalary">
<el-input-number v-model="formData.extraSalary" :min="0" :controls="false" />
</el-form-item>
</el-col>
</el-row>
<el-divider direction="horizontal" content-position="left">应扣</el-divider>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="绩效" prop="jixiao">
<el-form-item label="绩效">
<el-input placeholder="生成后录入" disabled />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="考勤" prop="kaoqin">
<el-form-item label="考勤">
<el-input placeholder="自动计算" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="社保" prop="shebao">
<el-input-number v-model="formData.shebao" :min="0" :controls="false" />
<el-form-item label="社保" prop="socialDeduct">
<el-input-number v-model="formData.socialDeduct" :min="0" :controls="false" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="公积金" prop="gongjijin">
<el-input-number v-model="formData.gongjijin" :min="0" :controls="false" />
<el-form-item label="公积金" prop="accumulationFundDeduct">
<el-input-number v-model="formData.accumulationFundDeduct" :min="0" :controls="false" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="税额" prop="shuie">
<el-form-item label="税额">
<el-input placeholder="自动计算" disabled />
</el-form-item>
</el-col>
@ -103,7 +103,8 @@
</template>
<script setup name="DialogSalarySetting">
// const message = useMessage() //
import * as SalaryApi from '@/api/finance/salary'
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('工资条设置')
@ -112,41 +113,40 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formData = ref({})
const rules = {
dixin: { required: true, message: '基本工资不可为空', trigger: 'blur' }
baseSalary: { required: true, message: '基本工资不可为空', trigger: 'blur' }
}
/** 打开弹窗 */
const open = async (row) => {
dialogVisible.value = true
dialogTitle.value = `工资条设置-【${row.nickname}`
dialogTitle.value = `工资条设置-【${row.name}`
resetForm()
getOptions()
formLoading.value = true
try {
// formData.value = await UserApi.getUser(id)
formData.value = await SalaryApi.getSalaryDetail(id)
} finally {
formLoading.value = false
}
}
defineExpose({ open }) // open
const tichengfanganOptions = ref([])
const planOptions = ref([])
function getOptions() {
tichengfanganOptions.value = []
planOptions.value = []
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
dixin: 0,
tichengfangan: undefined,
jiangjin: 0,
qitayingfa: 0,
jixiao: 0,
kaoqin: 0,
shebao: 0,
gongjijin: 0,
shuie: 0,
baseSalary: 0,
planId: undefined,
rewardSalary: 0,
butie: 0,
manqin: 0,
extraSalary: 0,
socialDeduct: 0,
accumulationFundDeduct: 0,
qitayingkou: 0
}
formRef.value?.resetFields()
@ -162,13 +162,13 @@ const submitForm = async () => {
//
formLoading.value = true
try {
// const data = formData.value as unknown as UserApi.UserVO
// if (formType.value === 'create') {
// await UserApi.createUser(data)
// message.success(t('common.createSuccess'))
// } else {
// await UserApi.updateUser(data)
// }
const data = formData.value
if (formType.value === 'create') {
await SalaryApi.createSalary(data)
message.success(t('common.createSuccess'))
} else {
await SalaryApi.updateSalary(data)
}
message.success('配置成功')
dialogVisible.value = false
//

@ -21,7 +21,7 @@
<el-table v-loading="loading" :data="tableList" border stripe>
<el-table-column type="index" width="50" />
<el-table-column label="用户姓名" prop="nickname" />
<el-table-column label="员工姓名" prop="nickname" />
<el-table-column label="部门" key="deptName" prop="deptName" />
<el-table-column label="手机号码" prop="mobile" width="120" />
<el-table-column label="在职状态" prop="status" />
@ -50,6 +50,9 @@
<script name="EmployeeList" setup>
import DialogSalary from './Comp/DialogSalary.vue'
import * as SalaryApi from '@/api/finance/salary'
import { removeNullField } from '@/utils'
const searchForm = ref({
name: undefined,
status: 0,
@ -74,10 +77,9 @@ const total = ref(0)
const getList = async () => {
loading.value = true
try {
tableList.value = [1, 2]
// const data = await UserApi.getUserPage(queryParams)
// tableList.value = data.list
// total.value = data.total
const data = await SalaryApi.getSalaryPage(removeNullField(searchForm.value))
tableList.value = data.list
total.value = data.total
} finally {
loading.value = false
}

@ -1,6 +1,6 @@
<template>
<el-tabs v-model="tabName">
<el-tab-pane label="考勤方案" name="kqfa" v-if="checkPermi['per:setting:attendance-plan']">
<el-tab-pane label="考勤方案" name="kqfa" v-if="checkPermi(['per:setting:attendance-plan'])">
<AttendancePlan v-if="tabName == 'kqfa'" />
</el-tab-pane>
</el-tabs>

Loading…
Cancel
Save