接口调试
This commit is contained in:
@@ -7,8 +7,8 @@ export const getSalaryPage = async (params) => {
|
|||||||
|
|
||||||
// 生成工资条
|
// 生成工资条
|
||||||
export const createSalarySlip = async (data) => {
|
export const createSalarySlip = async (data) => {
|
||||||
return await request.post({
|
return await request.upload({
|
||||||
url: '/admin-api/oa/user-salary-grant/create',
|
url: '/admin-api/oa/user-salary-grant/import',
|
||||||
data,
|
data,
|
||||||
isSubmitForm: true
|
isSubmitForm: true
|
||||||
})
|
})
|
||||||
@@ -16,12 +16,12 @@ export const createSalarySlip = async (data) => {
|
|||||||
|
|
||||||
// 导入工资条
|
// 导入工资条
|
||||||
export const importSalarySlip = async (data) => {
|
export const importSalarySlip = async (data) => {
|
||||||
return await request.post({ url: '/admin-api/oa/user-salary-grant/import', data })
|
return await request.upload({ url: '/admin-api/oa/user-salary-grant/import/history', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改工资条
|
// 修改工资条
|
||||||
export const updateSalarySlip = async (data) => {
|
export const updateSalarySlip = async (data) => {
|
||||||
return await request.put({ url: '/admin-api/oa/user-salary-grant/update', data })
|
return await request.put({ url: '/admin-api/oa/user-salary-grant/batchUpdate', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 封存
|
// 封存
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<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="planId">
|
<el-form-item label="提成方案" prop="planId">
|
||||||
<el-select v-model="formData.planId" placeholder="请选择" filterable>
|
<el-select v-model="formData.planId" placeholder="请选择" filterable clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in planOptions"
|
v-for="item in planOptions"
|
||||||
:key="item.percentageId"
|
:key="item.percentageId"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="导入工资">
|
<el-form-item label="导入奖金">
|
||||||
<div>
|
<div>
|
||||||
<el-upload
|
<el-upload
|
||||||
ref="rewardFile"
|
ref="rewardFile"
|
||||||
|
|||||||
@@ -68,8 +68,9 @@ function open() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
|
const month = `${new Date().getMonth() + 1}`
|
||||||
formData.value = {
|
formData.value = {
|
||||||
period: `${new Date().getFullYear()}-${new Date().getMonth() + 1}`
|
period: `${new Date().getFullYear()}-${month.padStart(2, '0')}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -285,11 +285,11 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
v-if="row.id"
|
v-if="row.id && !row.isConfirm"
|
||||||
style="padding: 0"
|
style="padding: 0"
|
||||||
text
|
text
|
||||||
v-hasPermi="['home:salary:sealup']"
|
v-hasPermi="['home:salary:sealup']"
|
||||||
@click="handleSave(row)"
|
@click="handleSealup(row)"
|
||||||
>
|
>
|
||||||
封存
|
封存
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -316,6 +316,8 @@ import DialogSalaryImport from './Comp/DialogSalaryImport.vue'
|
|||||||
import { removeNullField } from '@/utils'
|
import { removeNullField } from '@/utils'
|
||||||
import * as SalaryApi from '@/api/home/salary.js'
|
import * as SalaryApi from '@/api/home/salary.js'
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
name: undefined,
|
name: undefined,
|
||||||
period: undefined,
|
period: undefined,
|
||||||
@@ -357,7 +359,7 @@ async function getList() {
|
|||||||
tableList.value = data.list.map((it, index) => ({
|
tableList.value = data.list.map((it, index) => ({
|
||||||
...it,
|
...it,
|
||||||
id: index + 1,
|
id: index + 1,
|
||||||
edit: '0'
|
edit: it.isConfirm ? '2' : '0'
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
total.value = data.total
|
total.value = data.total
|
||||||
@@ -395,9 +397,29 @@ function handleEdit(row) {
|
|||||||
row.userSalaryGrantRespVOList.forEach((it) => (it.edit = true))
|
row.userSalaryGrantRespVOList.forEach((it) => (it.edit = true))
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSave(row) {
|
async function handleSave(row) {
|
||||||
row.edit = '0'
|
row.edit = '0'
|
||||||
row.userSalaryGrantRespVOList.forEach((it) => (it.edit = false))
|
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>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user