工资/奖金变更页面接口对接
This commit is contained in:
37
src/api/calibration/approval/index.ts
Normal file
37
src/api/calibration/approval/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import request from '@/utils/request'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 审批
|
||||
* */
|
||||
|
||||
// 审批接口
|
||||
export const UserApprovalProcessing = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('type', data.type)
|
||||
formData.append('state', data.state)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/user/approval_processing`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 审批分页接口
|
||||
export const UserRoxyexhibition = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('page', data.pageNum)
|
||||
formData.append('per_page', data.pageSize)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/user/roxyexhibition`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -25,3 +25,23 @@ export const FinancePaymentRequest = (data: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 付款申请展示
|
||||
export const FinancePaymentDisplay = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('page', data.pageNum)
|
||||
formData.append('per_page', data.pageSize)
|
||||
if (data.times && data.times.length) {
|
||||
formData.append('times', data.times[0])
|
||||
formData.append('end_time', data.times[1])
|
||||
}
|
||||
formData.append('payee', data.payee)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/PaymentDisplay`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -23,3 +23,23 @@ export const FinanceReimbursement = (data: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 报销展示
|
||||
export const FinanceReidetail = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('page', data.pageNum)
|
||||
formData.append('per_page', data.pageSize)
|
||||
if (data.times && data.times.length) {
|
||||
formData.append('times', data.times[0])
|
||||
formData.append('end_time', data.times[1])
|
||||
}
|
||||
formData.append('person', data.person)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/reidetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
43
src/api/calibration/salaryBonusAdjustment/index.ts
Normal file
43
src/api/calibration/salaryBonusAdjustment/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import request from '@/utils/request'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 工资/奖金变更
|
||||
* */
|
||||
|
||||
// 新增工资/奖金变更
|
||||
export const FinanceChange = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('username', data.username)
|
||||
formData.append('type', data.type)
|
||||
formData.append('Instructions', data.Instructions)
|
||||
formData.append('personincharge', data.personincharge)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/change`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 工资/奖金变更展示
|
||||
export const FinanceChangeDetail = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('page', data.pageNum)
|
||||
formData.append('per_page', data.pageSize)
|
||||
if (data.times && data.times.length) {
|
||||
formData.append('times', data.times[0])
|
||||
formData.append('end_time', data.times[1])
|
||||
}
|
||||
formData.append('username', data.username)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/ChangeDetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -89,9 +89,30 @@ export function convertFilePathsToObject(filePaths: string | string[]): Array<{
|
||||
})
|
||||
}
|
||||
|
||||
// 安全的文件信息提取函数
|
||||
export function getFileInfo(fileStr: string): { url: string; name: string } | null {
|
||||
try {
|
||||
if (!fileStr || !isValidJson(fileStr)) return null
|
||||
const files = convertFilePathsToObject(JSON.parse(fileStr))
|
||||
return files && files.length > 0 ? files[0] : null
|
||||
} catch (e) {
|
||||
console.error('解析文件信息失败:', e)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
export function isString(value: any): boolean {
|
||||
return typeof value === 'string'
|
||||
}
|
||||
export function isFile(obj: any): obj is File {
|
||||
return obj instanceof File
|
||||
}
|
||||
// JSON验证
|
||||
export function isValidJson(str: string): boolean {
|
||||
try {
|
||||
JSON.parse(str)
|
||||
return true
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,33 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索区域 -->
|
||||
<!-- <div class="search-container">-->
|
||||
<!-- <el-form ref="queryFormRef" :model="queryParams" :inline="true">-->
|
||||
<!-- <el-form-item prop="keywords" label="关键字">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.keywords"-->
|
||||
<!-- placeholder="角色名称"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<!-- <el-form-item class="search-buttons">-->
|
||||
<!-- <el-button type="primary" icon="search" @click="handleQuery">搜索</el-button>-->
|
||||
<!-- <el-button icon="refresh" @click="handleResetQuery">重置</el-button>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<!-- </div>-->
|
||||
<div class="search-container">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item prop="payee" label="收款人">
|
||||
<el-input
|
||||
v-model="queryParams.payee"
|
||||
placeholder="请输入收款人"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="times">
|
||||
<el-date-picker
|
||||
v-model="queryParams.times"
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择创建时间"
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item class="search-buttons">
|
||||
<el-button type="primary" icon="search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-card shadow="hover" class="data-table">
|
||||
<div class="data-table__toolbar">
|
||||
<div class="data-table__toolbar--actions">
|
||||
@@ -42,16 +52,13 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="提交人" prop="username" />
|
||||
<el-table-column label="合同号" prop="ContractNo" />
|
||||
<el-table-column label="负责人" prop="personincharge" />
|
||||
<el-table-column label="开票金额" prop="amount" />
|
||||
<el-table-column label="开票类型" prop="type" />
|
||||
<el-table-column label="开票单位全称" prop="unit" />
|
||||
<el-table-column label="纳税人识别号" prop="number" />
|
||||
<el-table-column label="地址/电话" prop="address_telephone" />
|
||||
<el-table-column label="银行卡" prop="bank" />
|
||||
<el-table-column label="收款人" prop="payee" />
|
||||
<el-table-column label="申请人" prop="applicant" />
|
||||
<el-table-column label="银行卡" prop="bankcard" />
|
||||
<el-table-column label="开户行" prop="BankName" />
|
||||
<el-table-column label="付款金额" prop="amount" />
|
||||
<el-table-column label="在职情况" prop="state" />
|
||||
<el-table-column label="时间" prop="times" />
|
||||
<el-table-column fixed="right" label="操作" width="220">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -208,8 +215,10 @@ import { DeviceEnum } from '@/enums/settings/device-enum'
|
||||
|
||||
import RoleAPI, { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserDeleteDepartment } from '@/api/calibration/department'
|
||||
import { FinanceIssueDetail } from '@/api/calibration/invoiceApplication'
|
||||
import { FinancePaymentRequest } from '@/api/calibration/paymentApplicationForm'
|
||||
import {
|
||||
FinancePaymentDisplay,
|
||||
FinancePaymentRequest
|
||||
} from '@/api/calibration/paymentApplicationForm'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
|
||||
defineOptions({
|
||||
@@ -230,7 +239,9 @@ const personinchargeList = ref<any[]>([])
|
||||
|
||||
const queryParams = reactive<any>({
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
pageSize: 10,
|
||||
times: [],
|
||||
payee: ''
|
||||
})
|
||||
|
||||
// 角色表格数据
|
||||
@@ -285,7 +296,7 @@ const parentChildLinked = ref(true)
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
FinanceIssueDetail(queryParams)
|
||||
FinancePaymentDisplay(queryParams)
|
||||
.then((res: any) => {
|
||||
roleList.value = res.data
|
||||
total.value = res.total
|
||||
|
||||
@@ -111,31 +111,39 @@
|
||||
<el-table-column label="学历证书" align="center" prop="AcademicResume">
|
||||
<template #default="{ row }">
|
||||
<el-link
|
||||
:href="`http://${convertFilePathsToObject(JSON.parse(row.AcademicResume))[0].url}`"
|
||||
v-if="row.AcademicResume && isValidJson(row.AcademicResume)"
|
||||
:href="getFileInfo(row.AcademicResume)?.url"
|
||||
target="_blank"
|
||||
>
|
||||
{{ convertFilePathsToObject(JSON.parse(row.AcademicResume))[0].name }}
|
||||
{{ getFileInfo(row.AcademicResume)?.name }}
|
||||
</el-link>
|
||||
<span v-else>无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="劳动合同" align="center" prop="contract">
|
||||
<template #default="{ row }">
|
||||
<el-link
|
||||
:href="`http://${convertFilePathsToObject(JSON.parse(row.contract))[0].url}`"
|
||||
v-if="row.contract && isValidJson(row.contract)"
|
||||
:href="getFileInfo(row.contract)?.url"
|
||||
target="_blank"
|
||||
>
|
||||
{{ convertFilePathsToObject(JSON.parse(row.contract))[0].name }}
|
||||
{{ getFileInfo(row.contract)?.name }}
|
||||
</el-link>
|
||||
<span v-else>无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="入职申请表" align="center" prop="ApplicationForm">
|
||||
<template #default="{ row }">
|
||||
<el-link
|
||||
:href="`http://${convertFilePathsToObject(JSON.parse(row.ApplicationForm))[0].url}`"
|
||||
v-if="row.ApplicationForm && isValidJson(row.ApplicationForm)"
|
||||
:href="getFileInfo(row.ApplicationForm)?.url"
|
||||
target="_blank"
|
||||
>
|
||||
{{ convertFilePathsToObject(JSON.parse(row.ApplicationForm))[0].name }}
|
||||
{{ getFileInfo(row.ApplicationForm)?.name }}
|
||||
</el-link>
|
||||
<span v-else>无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入职时间" align="center" prop="Dateofjoining" />
|
||||
@@ -426,7 +434,7 @@ import {
|
||||
UserEditorialStaff,
|
||||
UserPersonnelList
|
||||
} from '@/api/calibration/personnelManagement'
|
||||
import { convertFilePathsToObject } from '@/utils/auxiliaryFunction'
|
||||
import { getFileInfo, convertFilePathsToObject, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
|
||||
// ==================== 组件配置 ====================
|
||||
defineOptions({
|
||||
@@ -703,9 +711,25 @@ async function handleOpenDialog(data?: any): Promise<void> {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
data1.academic = parseJsonToArray(data1.academic)
|
||||
|
||||
data1.AcademicResume = convertFilePathsToObject(JSON.parse(data1.AcademicResume))[0]
|
||||
data1.contract = convertFilePathsToObject(JSON.parse(data1.contract))[0]
|
||||
data1.ApplicationForm = convertFilePathsToObject(JSON.parse(data1.ApplicationForm))[0]
|
||||
// 添加安全检查
|
||||
if (data1.AcademicResume && isValidJson(data1.AcademicResume)) {
|
||||
data1.AcademicResume = convertFilePathsToObject(JSON.parse(data1.AcademicResume))[0]
|
||||
} else {
|
||||
data1.AcademicResume = undefined
|
||||
}
|
||||
|
||||
if (data1.contract && isValidJson(data1.contract)) {
|
||||
data1.contract = convertFilePathsToObject(JSON.parse(data1.contract))[0]
|
||||
} else {
|
||||
data1.contract = undefined
|
||||
}
|
||||
|
||||
if (data1.ApplicationForm && isValidJson(data1.ApplicationForm)) {
|
||||
data1.ApplicationForm = convertFilePathsToObject(JSON.parse(data1.ApplicationForm))[0]
|
||||
} else {
|
||||
data1.ApplicationForm = undefined
|
||||
}
|
||||
|
||||
Object.assign(formData, data1)
|
||||
} catch (error) {
|
||||
ElMessage.error('加载用户数据失败')
|
||||
|
||||
@@ -1,23 +1,33 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索区域 -->
|
||||
<!-- <div class="search-container">-->
|
||||
<!-- <el-form ref="queryFormRef" :model="queryParams" :inline="true">-->
|
||||
<!-- <el-form-item prop="keywords" label="关键字">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.keywords"-->
|
||||
<!-- placeholder="角色名称"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<!-- <el-form-item class="search-buttons">-->
|
||||
<!-- <el-button type="primary" icon="search" @click="handleQuery">搜索</el-button>-->
|
||||
<!-- <el-button icon="refresh" @click="handleResetQuery">重置</el-button>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<!-- </div>-->
|
||||
<div class="search-container">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item prop="person" label="报销人">
|
||||
<el-input
|
||||
v-model="queryParams.person"
|
||||
placeholder="请输入报销人"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="times">
|
||||
<el-date-picker
|
||||
v-model="queryParams.times"
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择创建时间"
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item class="search-buttons">
|
||||
<el-button type="primary" icon="search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-card shadow="hover" class="data-table">
|
||||
<div class="data-table__toolbar">
|
||||
<div class="data-table__toolbar--actions">
|
||||
@@ -42,16 +52,11 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="提交人" prop="username" />
|
||||
<el-table-column label="合同号" prop="ContractNo" />
|
||||
<el-table-column label="负责人" prop="personincharge" />
|
||||
<el-table-column label="开票金额" prop="amount" />
|
||||
<el-table-column label="开票类型" prop="type" />
|
||||
<el-table-column label="开票单位全称" prop="unit" />
|
||||
<el-table-column label="纳税人识别号" prop="number" />
|
||||
<el-table-column label="地址/电话" prop="address_telephone" />
|
||||
<el-table-column label="银行卡" prop="bank" />
|
||||
<el-table-column label="在职情况" prop="state" />
|
||||
<el-table-column label="报销人" prop="person" />
|
||||
<el-table-column label="报销金额" prop="amount" />
|
||||
<el-table-column label="费用说明" prop="FeeDescription" />
|
||||
<el-table-column label="状态" prop="state" />
|
||||
<el-table-column label="时间" prop="times" />
|
||||
<el-table-column fixed="right" label="操作" width="220">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -202,8 +207,7 @@ import { DeviceEnum } from '@/enums/settings/device-enum'
|
||||
|
||||
import RoleAPI, { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserDeleteDepartment } from '@/api/calibration/department'
|
||||
import { FinanceIssueDetail } from '@/api/calibration/invoiceApplication'
|
||||
import { FinanceReimbursement } from '@/api/calibration/reimbursement'
|
||||
import { FinanceReidetail, FinanceReimbursement } from '@/api/calibration/reimbursement'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
|
||||
defineOptions({
|
||||
@@ -224,7 +228,9 @@ const personinchargeList = ref<any[]>([])
|
||||
|
||||
const queryParams = reactive<any>({
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
pageSize: 10,
|
||||
times: [],
|
||||
person: ''
|
||||
})
|
||||
|
||||
// 角色表格数据
|
||||
@@ -275,7 +281,7 @@ const parentChildLinked = ref(true)
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
FinanceIssueDetail(queryParams)
|
||||
FinanceReidetail(queryParams)
|
||||
.then((res: any) => {
|
||||
roleList.value = res.data
|
||||
total.value = res.total
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user