接口调试

dev-cl
qsh 4 months ago
parent 9dada27bd0
commit 3aa44fa60a
  1. 8
      src/api/home/salary.js
  2. 2
      src/views/Finance/Salary/Comp/DialogSalary.vue
  3. 2
      src/views/Home/Salary/Comp/DialogCreateSalary.vue
  4. 3
      src/views/Home/Salary/Comp/DialogSalaryImport.vue
  5. 30
      src/views/Home/Salary/index.vue

@ -7,8 +7,8 @@ export const getSalaryPage = async (params) => {
// 生成工资条
export const createSalarySlip = async (data) => {
return await request.post({
url: '/admin-api/oa/user-salary-grant/create',
return await request.upload({
url: '/admin-api/oa/user-salary-grant/import',
data,
isSubmitForm: true
})
@ -16,12 +16,12 @@ export const createSalarySlip = 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) => {
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-col :span="12" :offset="0">
<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
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,8 +68,9 @@ function open() {
}
function resetForm() {
const month = `${new Date().getMonth() + 1}`
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
type="danger"
v-if="row.id"
v-if="row.id && !row.isConfirm"
style="padding: 0"
text
v-hasPermi="['home:salary:sealup']"
@click="handleSave(row)"
@click="handleSealup(row)"
>
封存
</el-button>
@ -316,6 +316,8 @@ 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,
@ -357,7 +359,7 @@ async function getList() {
tableList.value = data.list.map((it, index) => ({
...it,
id: index + 1,
edit: '0'
edit: it.isConfirm ? '2' : '0'
}))
}
total.value = data.total
@ -395,9 +397,29 @@ function handleEdit(row) {
row.userSalaryGrantRespVOList.forEach((it) => (it.edit = true))
}
function handleSave(row) {
async 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