dev-cl
qsh 4 months ago
parent f3b5079fbe
commit a9c5d16926
  1. 99
      src/views/Finance/Commission/Comp/DialogPlan.vue
  2. 53
      src/views/Home/Salary/Comp/DialogCreateSalary.vue
  3. 353
      src/views/Home/Salary/index.vue
  4. 6
      src/views/Pers/Employee/Comp/DialogEmployee.vue
  5. 9
      src/views/Pers/Setting/Comp/DialogPlan.vue

@ -1,7 +1,7 @@
<template> <template>
<Dialog v-model="dialogVisible" :title="dialogTitle" style="width: 1000px"> <Dialog v-model="dialogVisible" :title="dialogTitle" style="width: 1000px">
<el-form <el-form
:model="comissionForm" :model="formData"
ref="formRef" ref="formRef"
:rules="rules" :rules="rules"
class="mt-10px" class="mt-10px"
@ -11,12 +11,12 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12" :offset="0"> <el-col :span="12" :offset="0">
<el-form-item label="方案名称" prop="name"> <el-form-item label="方案名称" prop="name">
<el-input v-model="comissionForm.name" placeholder="请输入方案名称" clearable /> <el-input v-model="formData.name" placeholder="请输入方案名称" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" :offset="0"> <el-col :span="12" :offset="0">
<el-form-item label="结算方式"> <el-form-item label="结算方式">
<el-radio-group v-model="comissionForm.percentageType"> <el-radio-group v-model="formData.percentageType">
<el-radio :label="1"> <el-radio :label="1">
<Tooltip message="可配置多级,命中某档位后,按照档位分级结算" />阶梯结算 <Tooltip message="可配置多级,命中某档位后,按照档位分级结算" />阶梯结算
</el-radio> </el-radio>
@ -35,7 +35,7 @@
:span="24" :span="24"
:offset="0" :offset="0"
class="flex" class="flex"
v-for="(item, index) in comissionForm.rules" v-for="(item, index) in formData.rules"
:key="index" :key="index"
> >
<el-select v-model="item.ruleParam1" style="width: 100px"> <el-select v-model="item.ruleParam1" style="width: 100px">
@ -107,6 +107,85 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-divider direction="horizontal" />
<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>
</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>
</el-form-item>
</el-col>
</el-row>
<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>
</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 :label="1">成交后</el-radio>
<el-radio :label="2">回款后</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="关联规则" v-if="formData.saleCommissionRelateDealConfig == 'true'">
<div>
<el-button @click="formData.saleCommissionRelateRulesConfig.push({})">
新增规则
</el-button>
<div
v-for="(item, index) in formData.saleCommissionRelateRulesConfig"
:key="index"
class="mt-10px flex justify-center items-center"
>
<span>成交率达</span>
<el-input
class="ml-10px"
v-model="item.successRate"
placeholder="成交率"
style="width: 100px"
type="number"
:min="0"
>
<template #suffix>%</template>
</el-input>
<span>可结算</span>
<el-input
class="ml-10px"
v-model="item.comissionRate"
placeholder="提成率"
style="width: 100px"
type="number"
:min="0"
>
<template #suffix>%</template>
</el-input>
<span>提成</span>
</div>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<template #footer> <template #footer>
@ -125,7 +204,7 @@ const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('工资条设置') const dialogTitle = ref('工资条设置')
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const comissionForm = ref({}) const formData = ref({})
const rules = { const rules = {
name: { required: true, message: '方案名称不可为空', trigger: 'blur' } name: { required: true, message: '方案名称不可为空', trigger: 'blur' }
} }
@ -154,7 +233,7 @@ const open = async (type, row) => {
if (row?.id) { if (row?.id) {
formLoading.value = true formLoading.value = true
try { try {
// comissionForm.value = await UserApi.getUser(id) // formData.value = await UserApi.getUser(id)
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
@ -164,7 +243,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 重置表单 */ /** 重置表单 */
const resetForm = () => { const resetForm = () => {
comissionForm.value = { formData.value = {
name: undefined, name: undefined,
percentageType: 1, percentageType: 1,
rules: [ rules: [
@ -176,13 +255,15 @@ const resetForm = () => {
ruleParam5: 1, ruleParam5: 1,
ruleParam6: 10 ruleParam6: 10
} }
] ],
saleCommissionRelateDealConfig: 'false',
saleCommissionRelateRulesConfig: []
} }
formRef.value?.resetFields() formRef.value?.resetFields()
} }
function handleAddRules() { function handleAddRules() {
comissionForm.value.rules.push({ formData.value.rules.push({
ruleParam1: 1, ruleParam1: 1,
ruleParam2: 1, ruleParam2: 1,
ruleParam3: 0, ruleParam3: 0,

@ -0,0 +1,53 @@
<template>
<Dialog v-model="dialogVisible" title="生成工资条" style="width: 800px">
<el-form :model="formData" ref="formRef" :rules="rules" label-width="80px">
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="年月" prop="yearmonth">
<el-date-picker v-model="formData.yearmonth" type="month" placeholder="选择年月" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="导入奖金" size="normal">
<UploadFile v-model="formData.files1" :limit="1" :isShowTip="false" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="导入考勤" size="normal">
<UploadFile v-model="formData.files2" :limit="1" :isShowTip="false" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span>
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" :disabled="formLoading" @click="handleSave">
</el-button>
</span>
</template>
</Dialog>
</template>
<script setup name="DialogCreateSalary">
const dialogVisible = ref(false)
const formData = ref({})
const formLoading = ref(false)
const rules = {}
function open() {
dialogVisible.value = true
}
defineExpose({ open })
function handleSave() {}
</script>
<style lang="scss" scoped></style>

@ -1,7 +1,354 @@
<template> <template>
<div> 工资条 </div> <div>
<el-form :model="searchForm" ref="searchFormRef" inline>
<el-form-item>
<el-input v-model="searchForm.employeeName" placeholder="员工姓名" />
</el-form-item>
<el-form-item>
<el-date-picker
v-model="searchForm.month"
type="month"
placeholder="年月"
format="YYYY-MM"
value-format="YYYY-MM"
style="width: 100%"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleSearch">查询</el-button>
<el-button type="primary" plain @click="craeteSalary">生成工资条</el-button>
<el-button type="primary" @click="importHistorySalary">导入历史工资条</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="tableList"
border
stripe
:default-expand-all="false"
row-key="id"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
:span-method="spanMethod"
>
<el-table-column label="姓名" min-width="90px">
<template #default="{ row }">
<span v-if="row.children && row.children.length">
<span>{{ row.yearmonth }}</span>
<span class="ml-20px">应发工资人数30</span>
</span>
<span v-else>
{{ row.name }}
</span>
</template>
</el-table-column>
<el-table-column prop="dept" label="部门" min-width="90px" />
<el-table-column prop="job" label="职位" min-width="90px" />
<el-table-column label="应发工资" align="center">
<el-table-column label="基本工资" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="补贴" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="提成" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="满勤" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="绩效" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="其他" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="小计" min-width="90px" />
</el-table-column>
<el-table-column label="应发工资" align="center">
<el-table-column label="基本工资" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="请假" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="缺勤" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="旷工" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="违纪" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="公积金" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="社保" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template> </template>
</el-table-column>
<el-table-column label="所得税" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="其他" min-width="90px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.jbgz"
:min="0"
:controls="false"
size="small"
style="width: 65px"
/>
<span v-else> {{ row.jbgz }}</span>
</template>
</el-table-column>
<el-table-column label="小计" min-width="90px" />
</el-table-column>
<el-table-column label="实发工资" fixed="right" />
<el-table-column label="操作" fixed="right" width="200">
<template #default="{ row }">
<el-button
type="primary"
style="padding: 0"
v-if="!row.edit && row.yearmonth"
text
@click="handleEdit(row)"
>
修改
</el-button>
<el-button
type="primary"
v-else-if="row.edit && row.yearmonth"
text
style="padding: 0"
@click="handleSave(row)"
>
保存
</el-button>
<el-button
type="danger"
v-if="row.yearmonth"
style="padding: 0"
text
@click="handleSave(row)"
>
封存
</el-button>
</template>
</el-table-column>
</el-table>
<DialogCreateSalary ref="createSalaryRef" @success="getList" />
<DialogImportSalary ref="importSalaryRef" @success="getList" />
</div>
</template>
<script setup name="SalarySlip">
import DialogCreateSalary from './Comp/DialogCreateSalary.vue'
const searchForm = ref({})
onMounted(() => {
handleSearch()
})
function handleSearch() {
searchForm.value.pageNO = 1
getList()
}
const loading = ref(false)
const tableList = ref([])
const total = ref(0)
function getList() {
tableList.value = [
{
yearmonth: '2024-06',
id: 1,
children: [
{ id: 11, name: '张三' },
{ id: 12, name: '李四' }
]
}
]
total.value = 0
}
const createSalaryRef = ref()
function craeteSalary() {
createSalaryRef.value.open()
}
function importHistorySalary() {}
function spanMethod({ row, columnIndex }) {
if (row.children && row.children.length > 0) {
if (columnIndex === 0) {
return [1, 21]
} else if (columnIndex == 21) {
return [1, 1]
} else {
return [0, 0]
}
}
}
function handleEdit(row) {
row.edit = true
row.children.forEach((it) => (it.edit = true))
}
function handleSave(row) {
row.edit = false
row.children.forEach((it) => (it.edit = false))
}
</script>
<script setup name="SalarySlip"></script> <style lang="scss" scoped>
:deep(.el-table__indent) {
display: none;
}
<style lang="scss" scoped></style> :deep(.el-table__placeholder) {
display: none;
}
</style>

@ -9,8 +9,8 @@
> >
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="用户姓名" prop="nickname"> <el-form-item label="员工姓名" prop="nickname">
<el-input v-model="formData.nickname" placeholder="请输入用户姓名" /> <el-input v-model="formData.nickname" placeholder="请输入员工姓名" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -149,7 +149,7 @@ const formData = ref({
kaitongxitong: [] kaitongxitong: []
}) })
const formRules = ref({ const formRules = ref({
nickname: [{ required: true, message: '用户姓名不能为空', trigger: 'blur' }], nickname: [{ required: true, message: '员工姓名不能为空', trigger: 'blur' }],
job: { required: true, message: '职位不能为空', trigger: 'blur' }, job: { required: true, message: '职位不能为空', trigger: 'blur' },
email: [ email: [
{ {

@ -54,6 +54,11 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="操作" :width="80" fixed="right">
<template #default="{ $index }">
<Icon icon="ep:remove-filled" class="text-red-500" @click="handleRemove($index)" />
</template>
</el-table-column>
</el-table> </el-table>
<template #footer> <template #footer>
@ -144,6 +149,10 @@ const submitForm = async () => {
formLoading.value = false formLoading.value = false
} }
} }
function handleRemove(index) {
form.value.planList.splice(index, 1)
}
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

Loading…
Cancel
Save