Merge branch 'main' of https://gitee.com/hdka/fad_oa
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 根据月份和文件计算工资
|
||||
* @param {*} param0.monthStr: 月份
|
||||
* @param {*} param0.filePath: 文件路径
|
||||
* @returns
|
||||
*/
|
||||
* 根据月份和文件计算工资
|
||||
* @param {*} param0.monthStr: 月份
|
||||
* @param {*} param0.filePath: 文件路径
|
||||
* @returns
|
||||
*/
|
||||
export function calculateSalary({ monthStr, filePath }) {
|
||||
return request({
|
||||
url: '/oa/salary/calc',
|
||||
@@ -16,10 +16,18 @@ export function calculateSalary({ monthStr, filePath }) {
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询职工薪资列表
|
||||
export function listStaff(query) {
|
||||
return request({
|
||||
url: '/oa/salary/list-staff',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* oss文件上传
|
||||
*/
|
||||
* oss文件上传
|
||||
*/
|
||||
export function uploadOssFile(data) {
|
||||
return request({
|
||||
url: '/system/oss/upload',
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<div class="home">
|
||||
<div>
|
||||
<el-container style="height: 100vh;">
|
||||
|
||||
<el-main>
|
||||
<el-row :gutter="20">
|
||||
<!-- 右侧展示区域 -->
|
||||
@@ -32,6 +33,7 @@ import Inventory from "../components/Inventory/index.vue";
|
||||
import Announcements from "../components/Announcements/index.vue";
|
||||
import ProjectManagement from "../components/ProjectManagement/index.vue";
|
||||
import FinancialCharts from "../components/FinancialCharts/index.vue";
|
||||
import {importUser} from "@/api/oa/salary";
|
||||
|
||||
export default {
|
||||
name: "Index",
|
||||
@@ -62,6 +64,7 @@ export default {
|
||||
this.getListNotice();
|
||||
},
|
||||
methods: {
|
||||
|
||||
getList() {
|
||||
getCache().then((response) => {
|
||||
this.cache = response.data;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 上传弹窗 -->
|
||||
<el-dialog
|
||||
<el-dialog
|
||||
title="薪资计算"
|
||||
:visible.sync="uploadVisible"
|
||||
width="30%"
|
||||
@@ -23,7 +23,7 @@
|
||||
:disabled="isUploading">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="薪资文件" required>
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
@@ -38,15 +38,16 @@
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="uploadVisible = false" :disabled="isUploading">取消</el-button>
|
||||
<el-button @click="handleUpload" :disabled="fileList.length === 0">确认上传</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleSubmit"
|
||||
:loading="isUploading"
|
||||
:disabled="!filePath">
|
||||
:disabled="isUploading"
|
||||
>
|
||||
{{ isUploading ? '计算中...' : '开始计算' }}
|
||||
</el-button>
|
||||
</span>
|
||||
@@ -84,7 +85,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<div class="summary">
|
||||
<span>合计人数:{{currentResult.length}} 人</span>
|
||||
<span class="total-amount">总金额:¥ {{totalAmount}}</span>
|
||||
@@ -109,6 +110,12 @@ export default {
|
||||
currentMonth: '',
|
||||
historyData: [],
|
||||
filePath: '',
|
||||
query:{
|
||||
pageSize:10,
|
||||
pageNum:1,
|
||||
payTime:"2025-03-01"
|
||||
},
|
||||
StaffSalaryList:[]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -131,15 +138,21 @@ export default {
|
||||
this.getHistoryData(firstDayStr)
|
||||
},
|
||||
methods: {
|
||||
getStaffList(){
|
||||
listStaff(this.query).then(res => {
|
||||
this.StaffSalaryList = res.rows
|
||||
console.log(this.StaffSalaryList)
|
||||
})
|
||||
},
|
||||
showUploadDialog() {
|
||||
this.uploadVisible = true
|
||||
},
|
||||
|
||||
|
||||
handleFileChange(file, fileList) {
|
||||
// 限制单个文件上传
|
||||
this.fileList = [fileList[fileList.length - 1]]
|
||||
},
|
||||
|
||||
|
||||
async handleSubmit() {
|
||||
try {
|
||||
this.isUploading = true
|
||||
@@ -166,12 +179,12 @@ export default {
|
||||
this.isUploading = false
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 上传文件
|
||||
async handleUpload() {
|
||||
const formData = new FormData()
|
||||
formData.append('file', this.fileList[0].raw)
|
||||
|
||||
|
||||
const { data } = await uploadOssFile(formData)
|
||||
|
||||
const filePath = '/data' + data.url.split('/data')[1];
|
||||
@@ -183,7 +196,7 @@ export default {
|
||||
this.fileList = []
|
||||
this.month = ''
|
||||
},
|
||||
|
||||
|
||||
showDetail(row) {
|
||||
// 查看历史详情逻辑
|
||||
console.log('查看详情', row)
|
||||
@@ -251,4 +264,4 @@ export default {
|
||||
.upload-demo {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user