Compare commits

..

No commits in common. '9180d14edefc0ac820b7271d2cfbaea1b302f6c7' and '9dada27bd04b274dac043b12080435d8a26553ce' have entirely different histories.

  1. 8
      src/api/home/salary.js
  2. 81
      src/views/Finance/Commission/Comp/DialogPlan.vue
  3. 2
      src/views/Finance/Salary/Comp/DialogSalary.vue
  4. 2
      src/views/Home/Salary/Comp/DialogCreateSalary.vue
  5. 3
      src/views/Home/Salary/Comp/DialogSalaryImport.vue
  6. 30
      src/views/Home/Salary/index.vue

@ -7,8 +7,8 @@ export const getSalaryPage = async (params) => {
// 生成工资条
export const createSalarySlip = async (data) => {
return await request.upload({
url: '/admin-api/oa/user-salary-grant/import',
return await request.post({
url: '/admin-api/oa/user-salary-grant/create',
data,
isSubmitForm: true
})
@ -16,12 +16,12 @@ export const createSalarySlip = async (data) => {
// 导入工资条
export const importSalarySlip = async (data) => {
return await request.upload({ url: '/admin-api/oa/user-salary-grant/import/history', data })
return await request.post({ url: '/admin-api/oa/user-salary-grant/import', data })
}
// 修改工资条
export const updateSalarySlip = async (data) => {
return await request.put({ url: '/admin-api/oa/user-salary-grant/batchUpdate', data })
return await request.put({ url: '/admin-api/oa/user-salary-grant/update', data })
}
// 封存

@ -27,20 +27,6 @@
</el-form-item>
</el-col>
</el-row>
<el-card class="mb-18px" shadow="never" :body-style="{ padding: '10px' }">
<div v-if="formData.percentageType == 1">
<p class="text-red-500">阶梯结算说明</p>
<p>若设置 010002000</p>
<p>金额为1500则未满1000的部分按照0档结算提成1000-1500的部分按照1000档结算</p>
</div>
<div v-else-if="formData.percentageType == 2">
<p class="text-red-500">阶梯结算说明</p>
<p>若设置 010002000</p>
<p>金额为1500则全部按照1000档结算</p>
</div>
</el-card>
<el-button type="primary" class="mb-10px" plain @click="handleAddRules">
添加提成档位
</el-button>
@ -52,12 +38,7 @@
v-for="(item, index) in formData.rules"
:key="index"
>
<el-select
v-model="item.ruleParam1"
style="width: 100px"
:disabled="index > 0"
@change="planChanged('ruleParam1', false)"
>
<el-select v-model="item.ruleParam1" style="width: 100px">
<el-option
v-for="it in opts.percentage_param1"
:key="it.value"
@ -65,13 +46,7 @@
:value="it.value"
/>
</el-select>
<el-select
class="ml-5px"
v-model="item.ruleParam2"
style="width: 100px"
:disabled="index > 0"
@change="planChanged('ruleParam2', false)"
>
<el-select class="ml-5px" v-model="item.ruleParam2" style="width: 100px">
<el-option
v-for="it in opts.percentage_param2"
:key="it.value"
@ -110,13 +85,7 @@
</div>
<div v-else class="inline-flex items-center">
<span class="ml-5px"></span>
<el-select
class="ml-5px"
v-model="item.ruleParam5"
style="width: 100px"
:disabled="formData.percentageType == 1"
@change="planChanged('ruleParam5')"
>
<el-select class="ml-5px" v-model="item.ruleParam5" style="width: 100px">
<el-option
v-for="it in opts.percentage_param5"
:key="it.value"
@ -136,12 +105,7 @@
<template #suffix> % </template>
</el-input>
</div>
<Icon
v-if="index > 0"
icon="ep:remove-filled"
class="text-red-500 ml-20px"
@click="handleRemove(index)"
/>
<Icon icon="ep:remove-filled" class="text-red-500 ml-20px" @click="handleRemove(index)" />
</el-col>
</el-row>
@ -238,7 +202,7 @@ const message = useMessage() // 消息弹窗
const { t } = useI18n() //
const dialogVisible = ref(false) //
const dialogTitle = ref('提成方案')
const dialogTitle = ref('工资条设置')
const formLoading = ref(false) // 12
const formData = ref({})
@ -280,15 +244,9 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 重置表单 */
const resetForm = () => {
opts.value = {
percentage_param1: [],
percentage_param2: [],
percentage_param4: [],
percentage_param5: []
}
formData.value = {
percentageName: undefined,
percentageType: 2,
percentageType: 1,
rules: [
{
ruleParam1: '2',
@ -309,7 +267,14 @@ const resetForm = () => {
}
function handleAddRules() {
formData.value.rules.push(formData.value.rules[0])
formData.value.rules.push({
ruleParam1: '2',
ruleParam2: '1',
ruleParam3: 0,
ruleParam4: '1',
ruleParam5: '1',
ruleParam6: 0
})
}
const emit = defineEmits(['success'])
@ -341,24 +306,6 @@ const submitForm = async () => {
function handleRemove(index) {
formData.value.rules.splice(index, 1)
}
function planChanged(paramName, editble = true) {
const defaultRule = formData.value.rules[0]
formData.value.rules.forEach((it, index) => {
if (formData.value.percentageType == 2) {
if (!editble) {
it[paramName] = defaultRule[paramName]
}
} else {
if (index > 0) {
it[paramName] = defaultRule[paramName]
}
if (paramName == 'ruleParam2') {
it['ruleParam5'] = defaultRule[paramName]
}
}
})
}
</script>
<style lang="scss" scoped></style>

@ -26,7 +26,7 @@
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="提成方案" prop="planId">
<el-select v-model="formData.planId" placeholder="请选择" filterable clearable>
<el-select v-model="formData.planId" placeholder="请选择" filterable>
<el-option
v-for="item in planOptions"
:key="item.percentageId"

@ -16,7 +16,7 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="导入奖金">
<el-form-item label="导入工资">
<div>
<el-upload
ref="rewardFile"

@ -68,9 +68,8 @@ function open() {
}
function resetForm() {
const month = `${new Date().getMonth() + 1}`
formData.value = {
period: `${new Date().getFullYear()}-${month.padStart(2, '0')}`
period: `${new Date().getFullYear()}-${new Date().getMonth() + 1}`
}
}

@ -285,11 +285,11 @@
</el-button>
<el-button
type="danger"
v-if="row.id && !row.isConfirm"
v-if="row.id"
style="padding: 0"
text
v-hasPermi="['home:salary:sealup']"
@click="handleSealup(row)"
@click="handleSave(row)"
>
封存
</el-button>
@ -316,8 +316,6 @@ import DialogSalaryImport from './Comp/DialogSalaryImport.vue'
import { removeNullField } from '@/utils'
import * as SalaryApi from '@/api/home/salary.js'
const message = useMessage() //
const searchForm = ref({
name: undefined,
period: undefined,
@ -359,7 +357,7 @@ async function getList() {
tableList.value = data.list.map((it, index) => ({
...it,
id: index + 1,
edit: it.isConfirm ? '2' : '0'
edit: '0'
}))
}
total.value = data.total
@ -397,29 +395,9 @@ function handleEdit(row) {
row.userSalaryGrantRespVOList.forEach((it) => (it.edit = true))
}
async function handleSave(row) {
function handleSave(row) {
row.edit = '0'
row.userSalaryGrantRespVOList.forEach((it) => (it.edit = false))
loading.value = true
await SalaryApi.updateSalarySlip(row.userSalaryGrantRespVOList)
message.success('保存成功!')
getList()
}
async function handleSealup(row) {
try {
//
await message.confirm('确认要封存"' + row.period + '"工资条吗?')
//
await SalaryApi.sealupSalarySlip({
grantIdList: row.userSalaryGrantRespVOList.map((it) => it.grantId),
period: row.period
})
//
await getList()
} catch (err) {
console.log(err)
}
}
</script>

Loading…
Cancel
Save